Edit model card

SentenceTransformer based on intfloat/multilingual-e5-base

This is a sentence-transformers model finetuned from intfloat/multilingual-e5-base. It maps sentences & paragraphs to a 768-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-base
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 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': 768, '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-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, 768]

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

Training Details

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • learning_rate: 2e-05
  • num_train_epochs: 5
  • 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: 16
  • 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: 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: 5
  • 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
0.0365 100 1.9653 -
0.0730 200 0.5908 -
0.1096 300 0.1976 -
0.1461 400 0.1503 -
0.1826 500 0.118 -
0.2191 600 0.1347 -
0.2557 700 0.1303 -
0.2922 800 0.1133 -
0.3287 900 0.1208 -
0.3652 1000 0.0909 0.0738
0.4018 1100 0.0901 -
0.4383 1200 0.1026 -
0.4748 1300 0.1049 -
0.5113 1400 0.079 -
0.5478 1500 0.0963 -
0.5844 1600 0.0994 -
0.6209 1700 0.0858 -
0.6574 1800 0.0948 -
0.6939 1900 0.0776 -
0.7305 2000 0.0822 0.0691
0.7670 2100 0.0872 -
0.8035 2200 0.0687 -
0.8400 2300 0.0713 -
0.8766 2400 0.0746 -
0.9131 2500 0.085 -
0.9496 2600 0.0809 -
0.9861 2700 0.0868 -
1.0226 2800 0.07 -
1.0592 2900 0.0572 -
1.0957 3000 0.0651 0.0558
1.1322 3100 0.0487 -
1.1687 3200 0.0554 -
1.2053 3300 0.0551 -
1.2418 3400 0.0524 -
1.2783 3500 0.0563 -
1.3148 3600 0.0394 -
1.3514 3700 0.0492 -
1.3879 3800 0.0239 -
1.4244 3900 0.0359 -
1.4609 4000 0.0343 0.0483
1.4974 4100 0.0239 -
1.5340 4200 0.0246 -
1.5705 4300 0.0323 -
1.6070 4400 0.0233 -
1.6435 4500 0.0198 -
1.6801 4600 0.0263 -
1.7166 4700 0.0232 -
1.7531 4800 0.0263 -
1.7896 4900 0.0201 -
1.8262 5000 0.0155 0.0506
1.8627 5100 0.0185 -
1.8992 5200 0.0241 -
1.9357 5300 0.0215 -
1.9722 5400 0.0301 -
2.0088 5500 0.0229 -
2.0453 5600 0.018 -
2.0818 5700 0.0178 -
2.1183 5800 0.02 -
2.1549 5900 0.0164 -
2.1914 6000 0.0155 0.0446
2.2279 6100 0.0202 -
2.2644 6200 0.0131 -
2.3009 6300 0.0159 -
2.3375 6400 0.0183 -
2.3740 6500 0.0081 -
2.4105 6600 0.0119 -
2.4470 6700 0.0108 -
2.4836 6800 0.0128 -
2.5201 6900 0.0068 -
2.5566 7000 0.0107 0.0425
2.5931 7100 0.0086 -
2.6297 7200 0.0073 -
2.6662 7300 0.0072 -
2.7027 7400 0.0056 -
2.7392 7500 0.0069 -
2.7757 7600 0.0077 -
2.8123 7700 0.0054 -
2.8488 7800 0.0055 -
2.8853 7900 0.0087 -
2.9218 8000 0.006 0.0457
2.9584 8100 0.0065 -
2.9949 8200 0.0112 -
3.0314 8300 0.0065 -
3.0679 8400 0.0045 -
3.1045 8500 0.007 -
3.1410 8600 0.0053 -
3.1775 8700 0.0053 -
3.2140 8800 0.0062 -
3.2505 8900 0.0055 -
3.2871 9000 0.0074 0.0414
3.3236 9100 0.0061 -
3.3601 9200 0.0047 -
3.3966 9300 0.0034 -
3.4332 9400 0.0037 -
3.4697 9500 0.0043 -
3.5062 9600 0.0035 -
3.5427 9700 0.0043 -
3.5793 9800 0.0035 -
3.6158 9900 0.0035 -
3.6523 10000 0.0028 0.0395
3.6888 10100 0.0029 -
3.7253 10200 0.0032 -
3.7619 10300 0.003 -
3.7984 10400 0.0024 -
3.8349 10500 0.0035 -
3.8714 10600 0.0031 -
3.9080 10700 0.0028 -
3.9445 10800 0.0027 -
3.9810 10900 0.0038 -
4.0175 11000 0.0026 0.0392
4.0541 11100 0.0022 -
4.0906 11200 0.0025 -
4.1271 11300 0.0023 -
4.1636 11400 0.0022 -
4.2001 11500 0.0026 -
4.2367 11600 0.0028 -
4.2732 11700 0.0022 -
4.3097 11800 0.0027 -
4.3462 11900 0.0023 -
4.3828 12000 0.0016 0.0384
4.4193 12100 0.0022 -
4.4558 12200 0.0018 -
4.4923 12300 0.002 -
4.5289 12400 0.0017 -
4.5654 12500 0.002 -
4.6019 12600 0.0021 -
4.6384 12700 0.0019 -
4.6749 12800 0.0016 -
4.7115 12900 0.0013 -
4.7480 13000 0.0022 0.0367
4.7845 13100 0.0016 -
4.8210 13200 0.0013 -
4.8576 13300 0.0019 -
4.8941 13400 0.002 -
4.9306 13500 0.0015 -
4.9671 13600 0.0017 -

Framework Versions

  • Python: 3.10.14
  • Sentence Transformers: 3.2.0
  • 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
9
Safetensors
Model size
278M 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-finetune

Finetuned
(23)
this model