SentenceTransformer based on sergeyzh/rubert-mini-frida
This is a sentence-transformers model finetuned from sergeyzh/rubert-mini-frida. It maps sentences & paragraphs to a 312-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: sergeyzh/rubert-mini-frida
- Maximum Sequence Length: 2048 tokens
- Output Dimensionality: 312 dimensions
- Similarity Function: Cosine Similarity
Model Sources
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 2048, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 312, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)
Usage
Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("George2002/duplicates_checker_v1")
sentences = [
'Что такое минимальная гарантированная ставка по вкладу?',
'Минимальная гарантированная ставка указывается на первой странице договора вклада и определяет минимальный доход при хранении вклада до конца срока.',
'Допускается ли внесение средств на счет ПДС с банковской карты, принадлежащей другому лицу?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
Evaluation
Metrics
Binary Classification
| Metric |
Value |
| cosine_accuracy |
0.8157 |
| cosine_accuracy_threshold |
0.668 |
| cosine_f1 |
0.8383 |
| cosine_f1_threshold |
0.5157 |
| cosine_precision |
0.7519 |
| cosine_recall |
0.9471 |
| cosine_ap |
0.8756 |
| cosine_mcc |
0.5939 |
Training Details
Training Dataset
Unnamed Dataset
Evaluation Dataset
Unnamed Dataset
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: steps
per_device_train_batch_size: 32
per_device_eval_batch_size: 16
learning_rate: 5e-06
num_train_epochs: 10
warmup_ratio: 0.1
load_best_model_at_end: True
batch_sampler: no_duplicates
All Hyperparameters
Click to expand
overwrite_output_dir: False
do_predict: False
eval_strategy: steps
prediction_loss_only: True
per_device_train_batch_size: 32
per_device_eval_batch_size: 16
per_gpu_train_batch_size: None
per_gpu_eval_batch_size: None
gradient_accumulation_steps: 1
eval_accumulation_steps: None
torch_empty_cache_steps: None
learning_rate: 5e-06
weight_decay: 0.0
adam_beta1: 0.9
adam_beta2: 0.999
adam_epsilon: 1e-08
max_grad_norm: 1.0
num_train_epochs: 10
max_steps: -1
lr_scheduler_type: linear
lr_scheduler_kwargs: {}
warmup_ratio: 0.1
warmup_steps: 0
log_level: passive
log_level_replica: warning
log_on_each_node: True
logging_nan_inf_filter: True
save_safetensors: True
save_on_each_node: False
save_only_model: False
restore_callback_states_from_checkpoint: False
no_cuda: False
use_cpu: False
use_mps_device: False
seed: 42
data_seed: None
jit_mode_eval: False
use_ipex: False
bf16: False
fp16: False
fp16_opt_level: O1
half_precision_backend: auto
bf16_full_eval: False
fp16_full_eval: False
tf32: None
local_rank: 0
ddp_backend: None
tpu_num_cores: None
tpu_metrics_debug: False
debug: []
dataloader_drop_last: False
dataloader_num_workers: 0
dataloader_prefetch_factor: None
past_index: -1
disable_tqdm: False
remove_unused_columns: True
label_names: None
load_best_model_at_end: True
ignore_data_skip: False
fsdp: []
fsdp_min_num_params: 0
fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
fsdp_transformer_layer_cls_to_wrap: None
accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
deepspeed: None
label_smoothing_factor: 0.0
optim: adamw_torch
optim_args: None
adafactor: False
group_by_length: False
length_column_name: length
ddp_find_unused_parameters: None
ddp_bucket_cap_mb: None
ddp_broadcast_buffers: False
dataloader_pin_memory: True
dataloader_persistent_workers: False
skip_memory_metrics: True
use_legacy_prediction_loop: False
push_to_hub: False
resume_from_checkpoint: None
hub_model_id: None
hub_strategy: every_save
hub_private_repo: None
hub_always_push: False
gradient_checkpointing: False
gradient_checkpointing_kwargs: None
include_inputs_for_metrics: False
include_for_metrics: []
eval_do_concat_batches: True
fp16_backend: auto
push_to_hub_model_id: None
push_to_hub_organization: None
mp_parameters:
auto_find_batch_size: False
full_determinism: False
torchdynamo: None
ray_scope: last
ddp_timeout: 1800
torch_compile: False
torch_compile_backend: None
torch_compile_mode: None
dispatch_batches: None
split_batches: None
include_tokens_per_second: False
include_num_input_tokens_seen: False
neftune_noise_alpha: None
optim_target_modules: None
batch_eval_metrics: False
eval_on_start: False
use_liger_kernel: False
eval_use_gather_object: False
average_tokens_across_devices: False
prompts: None
batch_sampler: no_duplicates
multi_dataset_batch_sampler: proportional
Training Logs
| Epoch |
Step |
Training Loss |
Validation Loss |
binary-sts-validation_cosine_ap |
| 0.2553 |
12 |
0.217 |
- |
- |
| 0.5106 |
24 |
0.22 |
- |
- |
| 0.7660 |
36 |
0.1985 |
- |
- |
| 1.0213 |
48 |
0.2037 |
- |
- |
| 1.0638 |
50 |
- |
0.2223 |
0.7656 |
| 1.2766 |
60 |
0.205 |
- |
- |
| 1.5319 |
72 |
0.1976 |
- |
- |
| 1.7872 |
84 |
0.2051 |
- |
- |
| 2.0426 |
96 |
0.1796 |
- |
- |
| 2.1277 |
100 |
- |
0.2085 |
0.8037 |
| 2.2979 |
108 |
0.1993 |
- |
- |
| 2.5532 |
120 |
0.188 |
- |
- |
| 2.8085 |
132 |
0.1925 |
- |
- |
| 3.0638 |
144 |
0.2108 |
- |
- |
| 3.1915 |
150 |
- |
0.1975 |
0.8317 |
| 3.3191 |
156 |
0.1852 |
- |
- |
| 3.5745 |
168 |
0.1796 |
- |
- |
| 3.8298 |
180 |
0.1981 |
- |
- |
| 4.0851 |
192 |
0.1917 |
- |
- |
| 4.2553 |
200 |
- |
0.1880 |
0.8486 |
| 4.3404 |
204 |
0.192 |
- |
- |
| 4.5957 |
216 |
0.1955 |
- |
- |
| 4.8511 |
228 |
0.1688 |
- |
- |
| 5.1064 |
240 |
0.1741 |
- |
- |
| 5.3191 |
250 |
- |
0.1799 |
0.8625 |
| 5.3617 |
252 |
0.1762 |
- |
- |
| 5.6170 |
264 |
0.1796 |
- |
- |
| 5.8723 |
276 |
0.1786 |
- |
- |
| 6.1277 |
288 |
0.177 |
- |
- |
| 6.3830 |
300 |
0.1738 |
0.1739 |
0.8686 |
| 6.6383 |
312 |
0.1826 |
- |
- |
| 6.8936 |
324 |
0.1599 |
- |
- |
| 7.1489 |
336 |
0.1844 |
- |
- |
| 7.4043 |
348 |
0.1747 |
- |
- |
| 7.4468 |
350 |
- |
0.1702 |
0.8730 |
| 7.6596 |
360 |
0.1742 |
- |
- |
| 7.9149 |
372 |
0.1663 |
- |
- |
| 8.1702 |
384 |
0.1658 |
- |
- |
| 8.4255 |
396 |
0.1623 |
- |
- |
| 8.5106 |
400 |
- |
0.1676 |
0.8756 |
Framework Versions
- Python: 3.11.2
- Sentence Transformers: 4.1.0
- Transformers: 4.49.0
- PyTorch: 2.5.1
- Accelerate: 1.5.2
- Datasets: 3.5.1
- Tokenizers: 0.21.0
Citation
BibTeX
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}