metadata
tags:
- sentence-transformers
- cross-encoder
- reranker
- generated_from_trainer
- dataset_size:87398
- loss:CrossEntropyLoss
base_model: deepvk/USER-bge-m3
pipeline_tag: text-classification
library_name: sentence-transformers
metrics:
- f1_macro
- f1_micro
- f1_weighted
model-index:
- name: CrossEncoder based on deepvk/USER-bge-m3
results:
- task:
type: cross-encoder-softmax-accuracy
name: Cross Encoder Softmax Accuracy
dataset:
name: softmax accuracy eval
type: softmax_accuracy_eval
metrics:
- type: f1_macro
value: 0.9726781946411447
name: F1 Macro
- type: f1_micro
value: 0.9753250742295485
name: F1 Micro
- type: f1_weighted
value: 0.9752858934461676
name: F1 Weighted
CrossEncoder based on deepvk/USER-bge-m3
This is a Cross Encoder model finetuned from deepvk/USER-bge-m3 using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text pair classification.
Model Details
Model Description
- Model Type: Cross Encoder
- Base model: deepvk/USER-bge-m3
- Maximum Sequence Length: 8192 tokens
- Number of Output Labels: 2 labels
Model Sources
- Documentation: Sentence Transformers Documentation
- Documentation: Cross Encoder Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Cross Encoders on Hugging Face
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 CrossEncoder
# Download from the 🤗 Hub
model = CrossEncoder("Chimalpopoka/CrossEncoderRanker")
# Get scores for pairs of texts
pairs = [
['Свободный кортизол, суточная\xa0моча (Free Сortisol, Free Hydrocortisone, 24-Hour urine)', 'Кортизол в разовой порции мочи'],
['Определение антител класса G (IgG) к RBD домену S белка вируса SARS-CoV-2 (COVID-19), количественное исследование', 'Антитела к миокарду, IgG'],
['Прием (осмотр, консультация) врача-терапевта, первичный', 'Консультация врача, в клинике, терапевт'],
['Вакцинация против гепатита В для взрослых', 'Вакцинация против гепатита А. Вакцина: Альгавак М (Россия)'],
['АТ к миокарду', 'Антитела к миокарду, IgG'],
]
scores = model.predict(pairs)
print(scores.shape)
# (5, 2)
Evaluation
Metrics
Cross Encoder Softmax Accuracy
- Dataset:
softmax_accuracy_eval - Evaluated with
CESoftmaxAccuracyEvaluator
| Metric | Value |
|---|---|
| f1_macro | 0.9727 |
| f1_micro | 0.9753 |
| f1_weighted | 0.9753 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 87,398 training samples
- Columns:
sentence_0,sentence_1, andlabel - Approximate statistics based on the first 1000 samples:
sentence_0 sentence_1 label type string string int details - min: 4 characters
- mean: 68.59 characters
- max: 747 characters
- min: 3 characters
- mean: 63.11 characters
- max: 281 characters
- 0: ~34.30%
- 1: ~65.70%
- Samples:
sentence_0 sentence_1 label Свободный кортизол, суточная моча (Free Сortisol, Free Hydrocortisone, 24-Hour urine)Кортизол в разовой порции мочи1Определение антител класса G (IgG) к RBD домену S белка вируса SARS-CoV-2 (COVID-19), количественное исследованиеАнтитела к миокарду, IgG0Прием (осмотр, консультация) врача-терапевта, первичныйКонсультация врача, в клинике, терапевт1 - Loss:
CrossEntropyLoss
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: stepsnum_train_epochs: 1
All Hyperparameters
Click to expand
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 8per_device_eval_batch_size: 8per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}
Training Logs
| Epoch | Step | Training Loss | softmax_accuracy_eval_f1_macro |
|---|---|---|---|
| 0.0458 | 500 | 0.5651 | - |
| 0.0915 | 1000 | 0.2182 | - |
| 0.1373 | 1500 | 0.2239 | - |
| 0.1831 | 2000 | 0.2015 | 0.9616 |
| 0.2288 | 2500 | 0.1617 | - |
| 0.2746 | 3000 | 0.1942 | - |
| 0.3204 | 3500 | 0.1888 | - |
| 0.3661 | 4000 | 0.1772 | 0.9629 |
| 0.4119 | 4500 | 0.1635 | - |
| 0.4577 | 5000 | 0.1596 | - |
| 0.5034 | 5500 | 0.1709 | - |
| 0.5492 | 6000 | 0.1566 | 0.9640 |
| 0.5950 | 6500 | 0.1278 | - |
| 0.6407 | 7000 | 0.1276 | - |
| 0.6865 | 7500 | 0.1339 | - |
| 0.7323 | 8000 | 0.1422 | 0.9715 |
| 0.7780 | 8500 | 0.148 | - |
| 0.8238 | 9000 | 0.1271 | - |
| 0.8696 | 9500 | 0.125 | - |
| 0.9153 | 10000 | 0.1103 | 0.9727 |
Framework Versions
- Python: 3.12.3
- Sentence Transformers: 5.1.0
- Transformers: 4.53.2
- PyTorch: 2.7.1+cu126
- Accelerate: 1.10.1
- Datasets: 4.0.0
- Tokenizers: 0.21.2
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",
}