SentenceTransformer based on intfloat/multilingual-e5-large-instruct

This is a sentence-transformers model finetuned from intfloat/multilingual-e5-large-instruct on the clef-me5-mined-pairs-train-pairs dataset. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: intfloat/multilingual-e5-large-instruct
  • Maximum Sequence Length: 256 tokens
  • Output Dimensionality: 1024 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modality: Text
  • Training Dataset:
    • clef-me5-mined-pairs-train-pairs

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'XLMRobertaModel'})
  (1): Pooling({'embedding_dimension': 1024, 'pooling_mode': 'mean', '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

# Download from the 🤗 Hub
model = SentenceTransformer("MinhPhuc0804/me5-256-kiem-tra-di-t1-v2.3-epoch-10")
# Run inference
sentences = [
    'query: @user That’s not what some of the data suggests. 25% of those who had a light infection the first time required an ER visit the 2nd time. And we know there is a mounting load with reinfections.',
    "passage: diagnoses occur closer to the index date for infection or reinfection in the Omicron BA epoch.\n\ntitle: SARS-CoV-2 Reinfection is Preceded by Unique Biomarkers and Related to Initial Infection Timing and Severity: an N3C RECOVER EHR-Based Cohort Study\nWe report lower albumin levels leading up to reinfection and a statistically significant association of severity between first infection and reinfection (chi-squared value: 9446.2, p-value: 0) with a medium effect size (Cramer's V: 0.18, DoF = 4).",
    'passage: randomization to hospital discharge.\n\ntitle: Effect of a Single High Dose of Vitamin D<sub>3</sub> on Hospital Length of Stay in Patients With Moderate to Severe COVID-19\nPrespecified secondary outcomes included mortality during hospitalization; the number of patients admitted to the intensive care unit; the number of patients who required mechanical ventilation and the duration of mechanical ventilation; and serum levels of 25-hydroxyvitamin D, total calcium, creatinine, and C-reactive protein.Of 240 randomized patients, 237 were included in the primary analysis (mean [SD] age, 56.2 [14.4] years; 104 [43.9%] women; mean [SD] baseline 25-hydroxyvitamin D level, 20.9 [9.2] ng/mL). Median (interquartile range) length of stay was not significantly different between the vitamin D3 (7.0 [4.0-10.0] days) and placebo groups (7.0 [5.0-13.0] days) (log-rank P = .59; unadjusted hazard ratio for hospital discharge, 1.07 [95% CI, 0.82-1.39]; P = .62).',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.4792, 0.1923],
#         [0.4792, 1.0000, 0.0620],
#         [0.1923, 0.0620, 1.0000]])

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.6926
cosine_accuracy@3 0.8588
cosine_accuracy@5 0.9024
cosine_accuracy@10 0.9346
cosine_precision@1 0.6926
cosine_precision@3 0.2863
cosine_precision@5 0.1805
cosine_precision@10 0.0935
cosine_recall@1 0.6926
cosine_recall@3 0.8588
cosine_recall@5 0.9024
cosine_recall@10 0.9346
cosine_ndcg@10 0.8204
cosine_mrr@10 0.7831
cosine_map@100 0.7853

Training Details

Training Dataset

clef-me5-mined-pairs-train-pairs

  • Dataset: clef-me5-mined-pairs-train-pairs
  • Size: 18,281 training samples
  • Columns: anchor and positive
  • Approximate statistics based on the first 1000 samples:
    anchor positive
    type string string
    details
    • min: 26 tokens
    • mean: 59.43 tokens
    • max: 104 tokens
    • min: 26 tokens
    • mean: 190.97 tokens
    • max: 256 tokens
  • Samples:
    anchor positive
    query: Peer-reviewed scientific studies project universal mask use would spare nearly 130,000 U.S. lives by February. But Utah carries on with a baffling, lax patchwork of feeble mask rules. If elected, I’ll shield your family. #PetersonProtects #utpol passage: 469,578–578,347) lives could be lost to COVID-19 across the United States by 28 February 2021.

    title: Modeling COVID-19 scenarios for the United States
    We find that achieving universal mask use (95% mask use in public) could be sufficient to ameliorate the worst effects of epidemic resurgences in many states. Universal mask use could save an additional 129,574 (85,284–170,867) lives from September 22, 2020 through the end of February 2021, or an additional 95,814 (60,731–133,077) lives assuming a lesser adoption of mask wearing (85%), when compared to the reference scenario.
    query: "Seroprevalence studies may fail to detect people who have had mild covid-19. Consideration should be given to [...] calibration of assay thresholds, the breadth of the antibody response, and the role of mucosal antibodies" passage: was used to analyse the data.

    title: Are we underestimating seroprevalence of SARS-CoV-2?

    Results

    The study indicates a fairly high knowledge level of STI/HIV (89.4%) with more males (87%) and younger participants (88%) possessing good knowledge of STI/HIV. Majority of the participants are sexually active (63.3%) and of this are more males (61.3%) and younger participants (60%). Findings show that age (β = 0.025; t = 0.04; p > 0.05) of the three predictor variables was not a predictor of attitude towards STI/HIV. However, knowledge of STI/HIV (β = 0.459; t = 5.032; p < 0.05) and sexual behaviour (β = 0.341; t = 4.278; p < 0.05) were strong predictors of attitude towards STI/HIV.

    Conclusion

    This study shows the need for strong advocacy, enlightenment and community mobilisation for improved awareness of STI/HIV.
    query: Rebuilding of October #Arctic sea ice volume spanning over the past 100 years... [Side-by-side look between PIOMAS-20C and PIOMAS data sets now refreshed through October 2021. Model details available at passage: title: Arctic Sea Ice Volume Variability over 1901–2010: A Model-Based Reconstruction
    abstract: Abstract PIOMAS-20C, an Arctic sea ice reconstruction for 1901–2010, is produced by forcing the Pan-Arctic Ice Ocean Modeling and Assimilation System (PIOMAS) with ERA-20C atmospheric data. ERA-20C performance over Arctic sea ice is assessed by comparisons with measurements and data from other reanalyses. ERA-20C performs similarly with respect to the annual cycle of downwelling radiation, air temperature, and wind speed compared to reanalyses with more extensive data assimilation such as ERA-Interim and MERRA. PIOMAS-20C sea ice thickness and volume are then compared with in situ and aircraft remote sensing observations for the period of ~1950–2010. Error statistics are similar to those for PIOMAS. We compare the magnitude and patterns of sea ice variability between the first half of the twentieth century (1901–40) and the more recent period (1980–2010), both marked by sea ice decl...
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false,
        "directions": [
            "query_to_doc"
        ],
        "partition_mode": "joint",
        "hardness_mode": null,
        "hardness_strength": 0.0
    }
    

Evaluation Dataset

clef-me5-mined-pairs-train-pairs

  • Dataset: clef-me5-mined-pairs-train-pairs
  • Size: 963 evaluation samples
  • Columns: anchor and positive
  • Approximate statistics based on the first 963 samples:
    anchor positive
    type string string
    details
    • min: 24 tokens
    • mean: 59.09 tokens
    • max: 138 tokens
    • min: 30 tokens
    • mean: 189.75 tokens
    • max: 256 tokens
  • Samples:
    anchor positive
    query: I reckon we’ll be hearing more about plitidepsin, which (in vitro, at least) is 27.5 times stronger than remdesivir #COVID19 passage: title: Plitidepsin has potent preclinical efficacy against SARS-CoV-2 by targeting the host protein eEF1A
    abstract: Severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) viral proteins interact with the eukaryotic translation machinery, and inhibitors of translation have potent antiviral effects. We found that the drug plitidepsin (aplidin), which has limited clinical approval, possesses antiviral activity (90% inhibitory concentration = 0.88 nM) that is more potent than remdesivir against SARS-CoV-2 in vitro by a factor of 27.5, with limited toxicity in cell culture. Through the use of a drug-resistant mutant, we show that the antiviral activity of plitidepsin against SARS-CoV-2 is mediated through inhibition of the known target eEF1A (eukaryotic translation elongation factor 1A).
    query: 2020 research on #LongCovid. Pre‑vaccine era. “Young, low risk patients with ongoing symptoms of #covid19 had signs of damage to multiple organs four months after initially being infected.” passage: title: Long covid: Damage to multiple organs presents in young, low risk patients
    abstract: Young, low risk patients with ongoing symptoms of covid-19 had signs of damage to multiple organs four months after initially being infected, a preprint study has suggested.
    query: L'inflammation indépendante provoquée par les macrophages encourage-t-elle les lésions alvéolaires dans la COVID-19 ? passage: title: Does autonomous macrophage-driven inflammation promote alveolar damage in COVID-19?
    abstract: The editorial reviews an ERJ publication which shows direct viral replication is rare in the alveolar space due to rare ACE2 expression. Instead it posits that autonomous macrophage inflammation occurs and drives lung injury.https://bit.ly/3CqjwiT
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false,
        "directions": [
            "query_to_doc"
        ],
        "partition_mode": "joint",
        "hardness_mode": null,
        "hardness_strength": 0.0
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 64
  • learning_rate: 1.6e-05
  • num_train_epochs: 10
  • warmup_ratio: 0.1
  • fp16: True
  • dataloader_num_workers: 8
  • load_best_model_at_end: True

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • prediction_loss_only: True
  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 64
  • 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: 1.6e-05
  • 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: True
  • 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: 8
  • 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}
  • parallelism_config: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • 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
  • hub_revision: None
  • 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
  • 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
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss Validation Loss CT26-dev-split_cosine_ndcg@10
1.0 286 - 0.3706 0.8055
1.7483 500 0.6016 - -
2.0 572 - 0.3239 0.8161
3.0 858 - 0.3250 0.8084
3.4965 1000 0.1923 - -
4.0 1144 - 0.3174 0.8120
5.0 1430 - 0.3163 0.8129
5.2448 1500 0.1003 - -
6.0 1716 - 0.3005 0.8148
6.9930 2000 0.0679 - -
7.0 2002 - 0.2999 0.8226
8.0 2288 - 0.3027 0.8235
8.7413 2500 0.053 - -
9.0 2574 - 0.3017 0.8186
10.0 2860 - 0.299 0.8204
  • The bold row denotes the saved checkpoint.

Training Time

  • Training: 21.4 minutes

Framework Versions

  • Python: 3.12.6
  • Sentence Transformers: 5.4.1
  • Transformers: 4.56.0
  • PyTorch: 2.8.0+cu129
  • Accelerate: 1.10.1
  • Datasets: 4.8.5
  • Tokenizers: 0.22.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",
}

MultipleNegativesRankingLoss

@misc{oord2019representationlearningcontrastivepredictive,
      title={Representation Learning with Contrastive Predictive Coding},
      author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
      year={2019},
      eprint={1807.03748},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1807.03748},
}
Downloads last month
4
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for MinhPhuc0804/me5-256-kiem-tra-di-t1-v2.3-epoch-10

Finetuned
(179)
this model

Papers for MinhPhuc0804/me5-256-kiem-tra-di-t1-v2.3-epoch-10

Evaluation results