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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
---
base_model: ai-forever/ruRoberta-large
datasets: []
language: []
library_name: sentence-transformers
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:19383
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: '12.02.2.17  Панель ингаляционных аллергенов № 9 (IgE): эпителий
    кошки, перхоть собаки, овсяница луговая'
  sentences:
  - Панель аллергенов плесени  1 IgE (penicillium notatum, cladosporium herbarum,
    aspergillus fumigatus, candida albicans, alternaria tenuis),
  - Панель пищевых аллергенов  51 IgE (помидор, картофель, морковь, чеснок, горчица),
  - Прием (осмотр, консультация) врача-психотерапевта первичный
- source_sentence: '12.02.2.2.04 Панель пищевых аллергенов № 2 (IgG): треска, тунец,
    креветки, лосось,  мидии'
  sentences:
  - Панель пищевых аллергенов  5 IgE (яичный белок, молоко, треска, пшеничная мука,
    арахис, соевые бобы),
  - Панель пищевых аллергенов  7 IgE (яичный белок, рис, коровье молоко, aрахис,
    пшеничная мука, соевые бобы),
  - Панель ингаляционных аллергенов  3 IgE (клещ - дерматофаг перинный, эпителий
    кошки, эпителий собаки, плесневый гриб (Aspergillus fumigatus)),
- source_sentence: 12.4.6.04 Аллерген f27 - говядина, IgE (ImmunoCAP)
  sentences:
  - Панель ингаляционных аллергенов  3 IgE (клещ - дерматофаг перинный, эпителий
    кошки, эпителий собаки, плесневый гриб (Aspergillus fumigatus)),
  - Панель аллергенов животных/перья птиц/  71 IgE (перо гуся, перо курицы, перо
    утки, перо индюка),
  - Панель ингаляционных аллергенов  6 IgE (плесневый гриб (Cladosporium herbarum),
    тимофеевка, плесневый гриб (Alternaria tenuis), береза, полынь обыкновенная),
- source_sentence: Микробиологическое исследование биосубстатов на микрофлору (отделяемое
    зева, носа, глаз, ушей, гениталий, ран,мокрота) с постановкой чувствительности
    [Мартьянова]
  sentences:
  - Панель ингаляционных аллергенов  9 IgE (эпителий кошки, перхоть собаки, овсяница
    луговая, плесневый гриб (Alternaria tenuis), подорожник),
  - Панель аллергенов плесени  1 IgE (penicillium notatum, cladosporium herbarum,
    aspergillus fumigatus, candida albicans, alternaria tenuis),
  - Посев отделяемого верхних дыхательных путей на микрофлору, определение чувствительности
    к антимикробным препаратам (одна локализация) (Upper Respiratory Culture. Bacteria
    Identification and Antibiotic Susceptibility Testing)*
- source_sentence: НЕТ ДО 20.04!!!!!!!! 12.01.16  Аллергокомпонент f77 - бета-лактоглобулин
    nBos d 5, IgE (ImmunoCAP)
  sentences:
  - Ультразвуковое исследование плода
  - Панель аллергенов животных  70 IgE (эпителий морской свинки, эпителий кролика,
    хомяк, крыса, мышь),
  - Панель пищевых аллергенов  15 IgE (апельсин, банан, яблоко, персик),
---

# SentenceTransformer based on ai-forever/ruRoberta-large

This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [ai-forever/ruRoberta-large](https://huggingface.co/ai-forever/ruRoberta-large). It maps sentences & paragraphs to a 1024-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:** [ai-forever/ruRoberta-large](https://huggingface.co/ai-forever/ruRoberta-large) <!-- at revision 5192d064ca6ac67c14c40e017ce41612e010f05f -->
- **Maximum Sequence Length:** 514 tokens
- **Output Dimensionality:** 1024 tokens
- **Similarity Function:** Cosine Similarity
<!-- - **Training Dataset:** Unknown -->
<!-- - **Language:** Unknown -->
<!-- - **License:** Unknown -->

### Model Sources

- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)

### Full Model Architecture

```
SentenceTransformer(
  (0): Transformer({'max_seq_length': 514, 'do_lower_case': False}) with Transformer model: RobertaModel 
  (1): Pooling({'word_embedding_dimension': 1024, '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})
)
```

## Usage

### Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

```bash
pip install -U sentence-transformers
```

Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
    'НЕТ ДО 20.04!!!!!!!! 12.01.16  Аллергокомпонент f77 - бета-лактоглобулин nBos d 5, IgE (ImmunoCAP)',
    'Панель аллергенов животных № 70 IgE (эпителий морской свинки, эпителий кролика, хомяк, крыса, мышь),',
    'Ультразвуковое исследование плода',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```

<!--
### Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details>
-->

<!--
### Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details>
-->

<!--
### Out-of-Scope Use

*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->

<!--
## Bias, Risks and Limitations

*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->

<!--
### Recommendations

*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->

## Training Details

### Training Dataset

#### Unnamed Dataset


* Size: 19,383 training samples
* Columns: <code>sentence_0</code> and <code>sentence_1</code>
* Approximate statistics based on the first 1000 samples:
  |         | sentence_0                                                                        | sentence_1                                                                         |
  |:--------|:----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
  | type    | string                                                                            | string                                                                             |
  | details | <ul><li>min: 5 tokens</li><li>mean: 30.0 tokens</li><li>max: 121 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 30.73 tokens</li><li>max: 105 tokens</li></ul> |
* Samples:
  | sentence_0                                                                                       | sentence_1                                                                                    |
  |:-------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------|
  | <code>Ингибитор VIII фактора</code>                                                              | <code>Исследование уровня антигена фактора Виллебранда</code>                                 |
  | <code>13.01.02 Антитела к экстрагируемому нуклеарному АГ (ЭНА/ENA-скрин), сыворотка крови</code> | <code>Антитела к экстрагируемому ядерному антигену, кач.</code>                               |
  | <code>Нет 12.4.092 Аллерген f203 - фисташковые орехи, IgE</code>                                 | <code>Панель аллергенов деревьев № 2 IgE (клен ясенелистный, тополь, вяз, дуб, пекан),</code> |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
  ```json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }
  ```

### Training Hyperparameters
#### Non-Default Hyperparameters

- `per_device_train_batch_size`: 4
- `per_device_eval_batch_size`: 4
- `num_train_epochs`: 11
- `multi_dataset_batch_sampler`: round_robin

#### All Hyperparameters
<details><summary>Click to expand</summary>

- `overwrite_output_dir`: False
- `do_predict`: False
- `eval_strategy`: no
- `prediction_loss_only`: True
- `per_device_train_batch_size`: 4
- `per_device_eval_batch_size`: 4
- `per_gpu_train_batch_size`: None
- `per_gpu_eval_batch_size`: None
- `gradient_accumulation_steps`: 1
- `eval_accumulation_steps`: None
- `learning_rate`: 5e-05
- `weight_decay`: 0.0
- `adam_beta1`: 0.9
- `adam_beta2`: 0.999
- `adam_epsilon`: 1e-08
- `max_grad_norm`: 1
- `num_train_epochs`: 11
- `max_steps`: -1
- `lr_scheduler_type`: linear
- `lr_scheduler_kwargs`: {}
- `warmup_ratio`: 0.0
- `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`: False
- `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`: False
- `hub_always_push`: False
- `gradient_checkpointing`: False
- `gradient_checkpointing_kwargs`: None
- `include_inputs_for_metrics`: False
- `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
- `batch_sampler`: batch_sampler
- `multi_dataset_batch_sampler`: round_robin

</details>

### Training Logs
<details><summary>Click to expand</summary>

| Epoch   | Step  | Training Loss |
|:-------:|:-----:|:-------------:|
| 0.1032  | 500   | 0.7937        |
| 0.2064  | 1000  | 0.5179        |
| 0.3095  | 1500  | 0.5271        |
| 0.4127  | 2000  | 0.5696        |
| 0.5159  | 2500  | 0.5232        |
| 0.6191  | 3000  | 0.6401        |
| 0.7222  | 3500  | 0.6337        |
| 0.8254  | 4000  | 0.9436        |
| 0.9286  | 4500  | 1.3872        |
| 1.0318  | 5000  | 1.3834        |
| 1.1350  | 5500  | 0.9831        |
| 1.2381  | 6000  | 1.0122        |
| 1.3413  | 6500  | 1.3708        |
| 1.4445  | 7000  | 1.3794        |
| 1.5477  | 7500  | 1.3784        |
| 1.6508  | 8000  | 1.3856        |
| 1.7540  | 8500  | 1.3809        |
| 1.8572  | 9000  | 1.3776        |
| 1.9604  | 9500  | 1.0041        |
| 2.0636  | 10000 | 0.8559        |
| 2.1667  | 10500 | 0.8531        |
| 2.2699  | 11000 | 0.8446        |
| 2.3731  | 11500 | 0.8487        |
| 2.4763  | 12000 | 1.0807        |
| 2.5794  | 12500 | 1.3792        |
| 2.6826  | 13000 | 1.3923        |
| 2.7858  | 13500 | 1.3787        |
| 2.8890  | 14000 | 1.3803        |
| 2.9922  | 14500 | 1.3641        |
| 3.0953  | 15000 | 1.3725        |
| 3.1985  | 15500 | 1.3624        |
| 3.3017  | 16000 | 1.3659        |
| 3.4049  | 16500 | 1.3609        |
| 3.5080  | 17000 | 1.3496        |
| 3.6112  | 17500 | 1.3639        |
| 3.7144  | 18000 | 1.3487        |
| 3.8176  | 18500 | 1.3463        |
| 3.9208  | 19000 | 1.336         |
| 4.0239  | 19500 | 1.3451        |
| 4.1271  | 20000 | 1.3363        |
| 4.2303  | 20500 | 1.3411        |
| 4.3335  | 21000 | 1.3376        |
| 4.4366  | 21500 | 1.3294        |
| 4.5398  | 22000 | 1.3281        |
| 4.6430  | 22500 | 1.3323        |
| 4.7462  | 23000 | 1.3411        |
| 4.8494  | 23500 | 1.3162        |
| 4.9525  | 24000 | 1.3204        |
| 5.0557  | 24500 | 1.324         |
| 5.1589  | 25000 | 1.3253        |
| 5.2621  | 25500 | 1.3283        |
| 5.3652  | 26000 | 1.3298        |
| 5.4684  | 26500 | 1.3144        |
| 5.5716  | 27000 | 1.3162        |
| 5.6748  | 27500 | 1.3148        |
| 5.7780  | 28000 | 1.3254        |
| 5.8811  | 28500 | 1.319         |
| 5.9843  | 29000 | 1.3134        |
| 6.0875  | 29500 | 1.3184        |
| 6.1907  | 30000 | 1.3049        |
| 6.2939  | 30500 | 1.3167        |
| 6.3970  | 31000 | 1.3192        |
| 6.5002  | 31500 | 1.2926        |
| 6.6034  | 32000 | 1.3035        |
| 6.7066  | 32500 | 1.3117        |
| 6.8097  | 33000 | 1.3093        |
| 6.9129  | 33500 | 1.278         |
| 7.0161  | 34000 | 1.3143        |
| 7.1193  | 34500 | 1.3144        |
| 7.2225  | 35000 | 1.304         |
| 7.3256  | 35500 | 1.3066        |
| 7.4288  | 36000 | 1.2916        |
| 7.5320  | 36500 | 1.2943        |
| 7.6352  | 37000 | 1.2883        |
| 7.7383  | 37500 | 1.3014        |
| 7.8415  | 38000 | 1.3005        |
| 7.9447  | 38500 | 1.2699        |
| 8.0479  | 39000 | 1.3042        |
| 8.1511  | 39500 | 1.289         |
| 8.2542  | 40000 | 1.3012        |
| 8.3574  | 40500 | 1.3017        |
| 8.4606  | 41000 | 1.272         |
| 8.5638  | 41500 | 1.2939        |
| 8.6669  | 42000 | 1.2764        |
| 8.7701  | 42500 | 1.2908        |
| 8.8733  | 43000 | 1.2619        |
| 8.9765  | 43500 | 1.2791        |
| 9.0797  | 44000 | 1.2722        |
| 9.1828  | 44500 | 1.278         |
| 9.2860  | 45000 | 1.2911        |
| 9.3892  | 45500 | 1.2791        |
| 9.4924  | 46000 | 1.2791        |
| 9.5955  | 46500 | 1.2782        |
| 9.6987  | 47000 | 1.2789        |
| 9.8019  | 47500 | 1.2858        |
| 9.9051  | 48000 | 1.2601        |
| 10.0083 | 48500 | 1.29          |
| 10.1114 | 49000 | 1.276         |
| 10.2146 | 49500 | 1.2801        |
| 10.3178 | 50000 | 1.2853        |
| 10.4210 | 50500 | 1.2655        |
| 10.5241 | 51000 | 1.271         |
| 10.6273 | 51500 | 1.2633        |
| 10.7305 | 52000 | 1.2565        |
| 10.8337 | 52500 | 1.2755        |
| 10.9369 | 53000 | 1.2567        |

</details>

### Framework Versions
- Python: 3.10.12
- Sentence Transformers: 3.0.1
- Transformers: 4.41.2
- PyTorch: 2.3.0+cu121
- Accelerate: 0.31.0
- Datasets: 2.20.0
- Tokenizers: 0.19.1

## Citation

### BibTeX

#### Sentence Transformers
```bibtex
@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",
}
```

#### MultipleNegativesRankingLoss
```bibtex
@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply}, 
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}
```

<!--
## Glossary

*Clearly define terms in order to be accessible across audiences.*
-->

<!--
## Model Card Authors

*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->

<!--
## Model Card Contact

*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->