Edit model card

SentenceTransformer based on intfloat/multilingual-e5-large

This is a sentence-transformers model finetuned from intfloat/multilingual-e5-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: intfloat/multilingual-e5-large
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 1024 tokens
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel 
  (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})
  (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("meandyou200175/e5_large_finetune")
# Run inference
sentences = [
    'Bác sĩ cho em hỏi, em bị rạn nứt xương gót chân bên phải. Em bị hơn 1 tháng nay rồi. Em bỏ thuốc lá. Em muốn hỏi bác sĩ thông thường bó bột hơn hay thuốc lá hơn? Như của em khoảng bao lâu thì khỏi? Và giờ em vẫn chưa đi được bác sĩ ạ. Em cảm ơn.',
    'Chào em, Thứ nhất, bắt buộc phải có phim Xquang để biết em có thực sự nứt xương gót hay bị gãy phức tạp hơn, vì nhiều trường hợp tưởng chỉ nứt xương thôi nhưng thật ra là vỡ phức tạp, phải phẫu thuật mới nhanh ổn được. Thứ hai, theo nguyên tắc điều trị nứt gãy xương là phải cố định tốt để can xương mọc ra, chỗ nứt gãy mới được nối liền. Do đó, nếu bó bột thì chân sẽ được cố định liên tục trong 4-6 tuần, còn bó lá thì phải thay thường xuyên, mỗi lần thay là 1 lần xê dịch nên xương khó lành. Tốt hơn hết em nên đến Bệnh viện Chấn thương Chỉnh hình để được kiểm tra và điều trị thích hợp, em nhé. Thân mến.',
    'Chào bạn, Qua hình ảnh sang thương và mô tả triệu chứng, bệnh lý của bạn có khả năng là chàm hay còn gọi là viêm da dị ứng với đặc điểm là viêm và nổi mụn nhỏ, ngứa ngáy. Nguyên nhân của chàm hiện nay chưa rõ nhưng có thể do cơ địa dị ứng (người mắc hen, viêm mũi dị ứng có nguy cơ cao mắc chàm), do kích thích của hóa chất như nước rửa chén, bột giặt, cao su, kim loại, chất liệu giày dép (chàm tiếp xúc),... Thời tiết lạnh, stress, đổ mồ hôi nhiều và phấn hoa... cũng là những nguyên nhân có thể khiến da bị chàm. Chàm cũng có thể gặp ở người bị suy van tĩnh mạch, giãn tĩnh mạch chân khiến tình trạng bệnh dai dẳng, kém đáp ứng điều trị. Điều trị chàm thường phải sử dụng một số loại thuốc bôi da kéo dài, có thể để lại tác dụng phụ, do đó bạn nên khám BS Da liễu để kê toa loại thuốc phù hợp. Ngoài ra, bạn nên chú ý xem có yếu tố nào thường kích thích khởi phát chàm để tránh cho bệnh tái phát bạn nhé! Thân mến.',
]
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]

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.6998
cosine_accuracy@2 0.7882
cosine_accuracy@5 0.8661
cosine_accuracy@10 0.916
cosine_accuracy@100 0.9898
cosine_precision@1 0.6998
cosine_precision@2 0.3941
cosine_precision@5 0.1732
cosine_precision@10 0.0916
cosine_precision@100 0.0099
cosine_recall@1 0.6998
cosine_recall@2 0.7882
cosine_recall@5 0.8661
cosine_recall@10 0.916
cosine_recall@100 0.9898
cosine_ndcg@10 0.8072
cosine_mrr@1 0.6998
cosine_mrr@2 0.744
cosine_mrr@5 0.7657
cosine_mrr@10 0.7725
cosine_mrr@100 0.7761
cosine_map@100 0.7761
dot_accuracy@1 0.6998
dot_accuracy@2 0.7882
dot_accuracy@5 0.8661
dot_accuracy@10 0.916
dot_accuracy@100 0.9898
dot_precision@1 0.6998
dot_precision@2 0.3941
dot_precision@5 0.1732
dot_precision@10 0.0916
dot_precision@100 0.0099
dot_recall@1 0.6998
dot_recall@2 0.7882
dot_recall@5 0.8661
dot_recall@10 0.916
dot_recall@100 0.9898
dot_ndcg@10 0.8072
dot_mrr@1 0.6998
dot_mrr@2 0.744
dot_mrr@5 0.7657
dot_mrr@10 0.7725
dot_mrr@100 0.7761
dot_map@100 0.7761

Training Details

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 2
  • per_device_eval_batch_size: 2
  • learning_rate: 2e-05
  • num_train_epochs: 1
  • warmup_ratio: 0.1
  • fp16: 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: 2
  • per_device_eval_batch_size: 2
  • 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: 2e-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: 1
  • 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: 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
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional

Training Logs

Click to expand
Epoch Step Training Loss Validation Loss cosine_map@100
0 0 - - 0.7808
0.0046 100 0.4932 - -
0.0091 200 0.1357 - -
0.0137 300 0.0238 - -
0.0183 400 0.0148 - -
0.0228 500 0.0143 - -
0.0274 600 0.0182 - -
0.0320 700 0.0084 - -
0.0365 800 0.0116 - -
0.0411 900 0.0137 - -
0.0457 1000 0.0112 0.0155 0.7403
0.0502 1100 0.0093 - -
0.0548 1200 0.0254 - -
0.0594 1300 0.0056 - -
0.0639 1400 0.0328 - -
0.0685 1500 0.0059 - -
0.0731 1600 0.0071 - -
0.0776 1700 0.0247 - -
0.0822 1800 0.0319 - -
0.0868 1900 0.0109 - -
0.0913 2000 0.0145 0.0228 0.7228
0.0959 2100 0.0156 - -
0.1004 2200 0.0399 - -
0.1050 2300 0.0594 - -
0.1096 2400 0.0172 - -
0.1141 2500 0.0156 - -
0.1187 2600 0.0748 - -
0.1233 2700 0.0299 - -
0.1278 2800 0.056 - -
0.1324 2900 0.0499 - -
0.1370 3000 0.0398 0.0453 0.6408
0.1415 3100 0.0486 - -
0.1461 3200 0.0159 - -
0.1507 3300 0.0464 - -
0.1552 3400 0.0345 - -
0.1598 3500 0.0102 - -
0.1644 3600 0.0203 - -
0.1689 3700 0.033 - -
0.1735 3800 0.0596 - -
0.1781 3900 0.0156 - -
0.1826 4000 0.0204 0.0394 0.6855
0.1872 4100 0.0168 - -
0.1918 4200 0.0516 - -
0.1963 4300 0.034 - -
0.2009 4400 0.0109 - -
0.2055 4500 0.0328 - -
0.2100 4600 0.0191 - -
0.2146 4700 0.0561 - -
0.2192 4800 0.0167 - -
0.2237 4900 0.0418 - -
0.2283 5000 0.0476 0.0339 0.6703
0.2329 5100 0.0315 - -
0.2374 5200 0.0111 - -
0.2420 5300 0.0172 - -
0.2466 5400 0.0198 - -
0.2511 5500 0.0305 - -
0.2557 5600 0.0192 - -
0.2603 5700 0.0468 - -
0.2648 5800 0.038 - -
0.2694 5900 0.0331 - -
0.2739 6000 0.0353 0.0417 0.6621
0.2785 6100 0.0405 - -
0.2831 6200 0.0251 - -
0.2876 6300 0.0223 - -
0.2922 6400 0.0219 - -
0.2968 6500 0.0596 - -
0.3013 6600 0.0581 - -
0.3059 6700 0.0521 - -
0.3105 6800 0.0595 - -
0.3150 6900 0.0211 - -
0.3196 7000 0.0568 0.0249 0.6985
0.3242 7100 0.0761 - -
0.3287 7200 0.0189 - -
0.3333 7300 0.0218 - -
0.3379 7400 0.0216 - -
0.3424 7500 0.0091 - -
0.3470 7600 0.0621 - -
0.3516 7700 0.0169 - -
0.3561 7800 0.0137 - -
0.3607 7900 0.0304 - -
0.3653 8000 0.0097 0.0206 0.7061
0.3698 8100 0.0202 - -
0.3744 8200 0.0103 - -
0.3790 8300 0.0292 - -
0.3835 8400 0.022 - -
0.3881 8500 0.0323 - -
0.3927 8600 0.0328 - -
0.3972 8700 0.0264 - -
0.4018 8800 0.0373 - -
0.4064 8900 0.0224 - -
0.4109 9000 0.0215 0.0380 0.6628
0.4155 9100 0.0237 - -
0.4201 9200 0.0301 - -
0.4246 9300 0.041 - -
0.4292 9400 0.0117 - -
0.4338 9500 0.0077 - -
0.4383 9600 0.0334 - -
0.4429 9700 0.0492 - -
0.4474 9800 0.0279 - -
0.4520 9900 0.0126 - -
0.4566 10000 0.0436 0.0251 0.6931
0.4611 10100 0.058 - -
0.4657 10200 0.0169 - -
0.4703 10300 0.0101 - -
0.4748 10400 0.0348 - -
0.4794 10500 0.0059 - -
0.4840 10600 0.0212 - -
0.4885 10700 0.007 - -
0.4931 10800 0.0323 - -
0.4977 10900 0.0123 - -
0.5022 11000 0.0106 0.0200 0.7077
0.5068 11100 0.0129 - -
0.5114 11200 0.0067 - -
0.5159 11300 0.0087 - -
0.5205 11400 0.0149 - -
0.5251 11500 0.0387 - -
0.5296 11600 0.035 - -
0.5342 11700 0.0353 - -
0.5388 11800 0.025 - -
0.5433 11900 0.005 - -
0.5479 12000 0.0152 0.0241 0.6972
0.5525 12100 0.0475 - -
0.5570 12200 0.034 - -
0.5616 12300 0.0539 - -
0.5662 12400 0.0687 - -
0.5707 12500 0.007 - -
0.5753 12600 0.0169 - -
0.5799 12700 0.0186 - -
0.5844 12800 0.0076 - -
0.5890 12900 0.0032 - -
0.5936 13000 0.0094 0.0170 0.7311
0.5981 13100 0.0091 - -
0.6027 13200 0.0335 - -
0.6073 13300 0.0054 - -
0.6118 13400 0.0351 - -
0.6164 13500 0.0451 - -
0.6209 13600 0.0048 - -
0.6255 13700 0.0316 - -
0.6301 13800 0.0346 - -
0.6346 13900 0.0341 - -
0.6392 14000 0.0105 0.0154 0.7408
0.6438 14100 0.0181 - -
0.6483 14200 0.064 - -
0.6529 14300 0.0381 - -
0.6575 14400 0.0433 - -
0.6620 14500 0.0451 - -
0.6666 14600 0.0139 - -
0.6712 14700 0.0169 - -
0.6757 14800 0.0105 - -
0.6803 14900 0.0058 - -
0.6849 15000 0.0327 0.0148 0.7504
0.6894 15100 0.0537 - -
0.6940 15200 0.0093 - -
0.6986 15300 0.0116 - -
0.7031 15400 0.024 - -
0.7077 15500 0.0176 - -
0.7123 15600 0.0119 - -
0.7168 15700 0.0087 - -
0.7214 15800 0.0196 - -
0.7260 15900 0.003 - -
0.7305 16000 0.0222 0.0144 0.7430
0.7351 16100 0.0021 - -
0.7397 16200 0.0081 - -
0.7442 16300 0.0125 - -
0.7488 16400 0.0047 - -
0.7534 16500 0.0144 - -
0.7579 16600 0.0159 - -
0.7625 16700 0.0112 - -
0.7671 16800 0.0144 - -
0.7716 16900 0.0151 - -
0.7762 17000 0.0268 0.0142 0.7434
0.7808 17100 0.013 - -
0.7853 17200 0.0054 - -
0.7899 17300 0.019 - -
0.7944 17400 0.014 - -
0.7990 17500 0.0143 - -
0.8036 17600 0.008 - -
0.8081 17700 0.0047 - -
0.8127 17800 0.0383 - -
0.8173 17900 0.0258 - -
0.8218 18000 0.0403 0.0117 0.7650
0.8264 18100 0.0033 - -
0.8310 18200 0.0264 - -
0.8355 18300 0.0062 - -
0.8401 18400 0.0014 - -
0.8447 18500 0.002 - -
0.8492 18600 0.0229 - -
0.8538 18700 0.02 - -
0.8584 18800 0.005 - -
0.8629 18900 0.0073 - -
0.8675 19000 0.0233 0.0139 0.7625
0.8721 19100 0.0164 - -
0.8766 19200 0.0053 - -
0.8812 19300 0.0075 - -
0.8858 19400 0.0159 - -
0.8903 19500 0.0022 - -
0.8949 19600 0.0136 - -
0.8995 19700 0.0322 - -
0.9040 19800 0.0023 - -
0.9086 19900 0.0787 - -
0.9132 20000 0.0092 0.0114 0.7713
0.9177 20100 0.0174 - -
0.9223 20200 0.0211 - -
0.9269 20300 0.0051 - -
0.9314 20400 0.0223 - -
0.9360 20500 0.0197 - -
0.9406 20600 0.0076 - -
0.9451 20700 0.0497 - -
0.9497 20800 0.0053 - -
0.9543 20900 0.0096 - -
0.9588 21000 0.0039 0.0105 0.7761
0.9634 21100 0.0184 - -
0.9679 21200 0.0129 - -
0.9725 21300 0.0056 - -
0.9771 21400 0.0093 - -
0.9816 21500 0.023 - -
0.9862 21600 0.0071 - -
0.9908 21700 0.0061 - -
0.9953 21800 0.0009 - -
0.9999 21900 0.0012 - -

Framework Versions

  • Python: 3.10.14
  • Sentence Transformers: 3.2.1
  • Transformers: 4.45.1
  • PyTorch: 2.4.0
  • Accelerate: 0.34.2
  • Datasets: 3.0.1
  • Tokenizers: 0.20.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{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}
}
Downloads last month
2
Safetensors
Model size
560M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for meandyou200175/e5_large_finetune

Finetuned
(53)
this model

Evaluation results