metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:910013
- loss:CosineSimilarityLoss
base_model: intfloat/multilingual-e5-small
widget:
- source_sentence: business healing
sentences:
- modify ict system capacity
- objetividade, inovadora,estudiosa,pesquisadora e organizada
- business consulting
- source_sentence: architecture acoustics
sentences:
- disicpline leader
- 生产工艺开发及优化
- data analysis
- source_sentence: arbitru natatie
sentences:
- criação cinematográfica
- quarterly distribution
- улучшение путешествий клиентов с помощью дополненной реальности
- source_sentence: configuración de software antivirus
sentences:
- protocol & coordination
- laurea magistrale biologia
- deploy anti-virus software
- source_sentence: child maltreatment counselling
sentences:
- book covers, flyers, posters, banners
- tool and die making
- cmc
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- pearson_cosine
- spearman_cosine
model-index:
- name: SentenceTransformer based on intfloat/multilingual-e5-small
results:
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts dev
type: sts-dev
metrics:
- type: pearson_cosine
value: 0.9579653395486292
name: Pearson Cosine
- type: spearman_cosine
value: 0.8788941637037295
name: Spearman Cosine
- task:
type: semantic-similarity
name: Semantic Similarity
dataset:
name: sts test
type: sts-test
metrics:
- type: pearson_cosine
value: 0.9579215714676803
name: Pearson Cosine
- type: spearman_cosine
value: 0.8795799743051839
name: Spearman Cosine
SentenceTransformer based on intfloat/multilingual-e5-small
This is a sentence-transformers model finetuned from intfloat/multilingual-e5-small. It maps sentences & paragraphs to a 384-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-small
- Maximum Sequence Length: 30 tokens
- Output Dimensionality: 384 dimensions
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 30, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 384, '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("sentence_transformers_model_id")
# Run inference
sentences = [
'child maltreatment counselling',
'cmc',
'book covers, flyers, posters, banners',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Evaluation
Metrics
Semantic Similarity
- Datasets:
sts-devandsts-test - Evaluated with
EmbeddingSimilarityEvaluator
| Metric | sts-dev | sts-test |
|---|---|---|
| pearson_cosine | 0.958 | 0.9579 |
| spearman_cosine | 0.8789 | 0.8796 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 910,013 training samples
- Columns:
sentence1,sentence2, andscore - Approximate statistics based on the first 1000 samples:
sentence1 sentence2 score type string string float details - min: 3 tokens
- mean: 8.91 tokens
- max: 30 tokens
- min: 3 tokens
- mean: 8.83 tokens
- max: 30 tokens
- min: 0.0
- mean: 0.52
- max: 1.0
- Samples:
sentence1 sentence2 score edición de fotografias, fondosmaterial selection and cognition0.0professional alarm installer,service tech.,customer service relations,sales,cctvquantity surveying & reading charts0.1diagnostico ecograficowaste identification system downtime0.19 - Loss:
CosineSimilarityLosswith these parameters:{ "loss_fct": "torch.nn.modules.loss.MSELoss" }
Evaluation Dataset
Unnamed Dataset
- Size: 113,751 evaluation samples
- Columns:
sentence1,sentence2, andscore - Approximate statistics based on the first 1000 samples:
sentence1 sentence2 score type string string float details - min: 4 tokens
- mean: 8.89 tokens
- max: 30 tokens
- min: 3 tokens
- mean: 8.96 tokens
- max: 30 tokens
- min: 0.0
- mean: 0.54
- max: 1.0
- Samples:
sentence1 sentence2 score a2 dutcha2 dutch0.98design of mine dumps设计矿山废料堆1.0create soil and plant improvement programmes创建土壤和植物改良计划1.0 - Loss:
CosineSimilarityLosswith these parameters:{ "loss_fct": "torch.nn.modules.loss.MSELoss" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: epochper_device_train_batch_size: 32per_device_eval_batch_size: 32learning_rate: 1e-05num_train_epochs: 4warmup_ratio: 0.1fp16: True
All Hyperparameters
Click to expand
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 32per_device_eval_batch_size: 32per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 1e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 4max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_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: Truefp16_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}tp_size: 0fsdp_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: Falsegradient_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: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportional
Training Logs
Click to expand
| Epoch | Step | Training Loss | Validation Loss | sts-dev_spearman_cosine | sts-test_spearman_cosine |
|---|---|---|---|---|---|
| 0.0352 | 500 | 0.1991 | - | - | - |
| 0.0703 | 1000 | 0.0513 | - | - | - |
| 0.1055 | 1500 | 0.0362 | - | - | - |
| 0.1407 | 2000 | 0.0331 | - | - | - |
| 0.1758 | 2500 | 0.0305 | - | - | - |
| 0.2110 | 3000 | 0.029 | - | - | - |
| 0.2461 | 3500 | 0.0273 | - | - | - |
| 0.2813 | 4000 | 0.0268 | - | - | - |
| 0.3165 | 4500 | 0.0255 | - | - | - |
| 0.3516 | 5000 | 0.0245 | - | - | - |
| 0.3868 | 5500 | 0.0238 | - | - | - |
| 0.4220 | 6000 | 0.0236 | - | - | - |
| 0.4571 | 6500 | 0.0233 | - | - | - |
| 0.4923 | 7000 | 0.0222 | - | - | - |
| 0.5275 | 7500 | 0.0225 | - | - | - |
| 0.5626 | 8000 | 0.0219 | - | - | - |
| 0.5978 | 8500 | 0.0212 | - | - | - |
| 0.6330 | 9000 | 0.0215 | - | - | - |
| 0.6681 | 9500 | 0.0207 | - | - | - |
| 0.7033 | 10000 | 0.0204 | - | - | - |
| 0.7384 | 10500 | 0.0203 | - | - | - |
| 0.7736 | 11000 | 0.0203 | - | - | - |
| 0.8088 | 11500 | 0.0202 | - | - | - |
| 0.8439 | 12000 | 0.0202 | - | - | - |
| 0.8791 | 12500 | 0.0196 | - | - | - |
| 0.9143 | 13000 | 0.0193 | - | - | - |
| 0.9494 | 13500 | 0.0193 | - | - | - |
| 0.9846 | 14000 | 0.0193 | - | - | - |
| 1.0 | 14219 | - | 0.0170 | 0.8694 | - |
| 1.0198 | 14500 | 0.0188 | - | - | - |
| 1.0549 | 15000 | 0.0178 | - | - | - |
| 1.0901 | 15500 | 0.0179 | - | - | - |
| 1.1253 | 16000 | 0.0178 | - | - | - |
| 1.1604 | 16500 | 0.0178 | - | - | - |
| 1.1956 | 17000 | 0.0172 | - | - | - |
| 1.2307 | 17500 | 0.0172 | - | - | - |
| 1.2659 | 18000 | 0.0175 | - | - | - |
| 1.3011 | 18500 | 0.0178 | - | - | - |
| 1.3362 | 19000 | 0.0174 | - | - | - |
| 1.3714 | 19500 | 0.0175 | - | - | - |
| 1.4066 | 20000 | 0.0171 | - | - | - |
| 1.4417 | 20500 | 0.0175 | - | - | - |
| 1.4769 | 21000 | 0.0173 | - | - | - |
| 1.5121 | 21500 | 0.0171 | - | - | - |
| 1.5472 | 22000 | 0.0174 | - | - | - |
| 1.5824 | 22500 | 0.0172 | - | - | - |
| 1.6176 | 23000 | 0.0168 | - | - | - |
| 1.6527 | 23500 | 0.0165 | - | - | - |
| 1.6879 | 24000 | 0.0169 | - | - | - |
| 1.7230 | 24500 | 0.0169 | - | - | - |
| 1.7582 | 25000 | 0.0171 | - | - | - |
| 1.7934 | 25500 | 0.0165 | - | - | - |
| 1.8285 | 26000 | 0.0165 | - | - | - |
| 1.8637 | 26500 | 0.0165 | - | - | - |
| 1.8989 | 27000 | 0.0165 | - | - | - |
| 1.9340 | 27500 | 0.0164 | - | - | - |
| 1.9692 | 28000 | 0.0164 | - | - | - |
| 2.0 | 28438 | - | 0.0153 | 0.8751 | - |
| 2.0044 | 28500 | 0.0162 | - | - | - |
| 2.0395 | 29000 | 0.0156 | - | - | - |
| 2.0747 | 29500 | 0.0154 | - | - | - |
| 2.1099 | 30000 | 0.0157 | - | - | - |
| 2.1450 | 30500 | 0.016 | - | - | - |
| 2.1802 | 31000 | 0.015 | - | - | - |
| 2.2153 | 31500 | 0.0155 | - | - | - |
| 2.2505 | 32000 | 0.0154 | - | - | - |
| 2.2857 | 32500 | 0.0152 | - | - | - |
| 2.3208 | 33000 | 0.0152 | - | - | - |
| 2.3560 | 33500 | 0.0152 | - | - | - |
| 2.3912 | 34000 | 0.0154 | - | - | - |
| 2.4263 | 34500 | 0.0153 | - | - | - |
| 2.4615 | 35000 | 0.0154 | - | - | - |
| 2.4967 | 35500 | 0.015 | - | - | - |
| 2.5318 | 36000 | 0.0153 | - | - | - |
| 2.5670 | 36500 | 0.0149 | - | - | - |
| 2.6022 | 37000 | 0.015 | - | - | - |
| 2.6373 | 37500 | 0.0152 | - | - | - |
| 2.6725 | 38000 | 0.0152 | - | - | - |
| 2.7076 | 38500 | 0.015 | - | - | - |
| 2.7428 | 39000 | 0.0151 | - | - | - |
| 2.7780 | 39500 | 0.0155 | - | - | - |
| 2.8131 | 40000 | 0.0148 | - | - | - |
| 2.8483 | 40500 | 0.0149 | - | - | - |
| 2.8835 | 41000 | 0.0147 | - | - | - |
| 2.9186 | 41500 | 0.015 | - | - | - |
| 2.9538 | 42000 | 0.0148 | - | - | - |
| 2.9890 | 42500 | 0.0146 | - | - | - |
| 3.0 | 42657 | - | 0.0146 | 0.8775 | - |
| 3.0241 | 43000 | 0.0142 | - | - | - |
| 3.0593 | 43500 | 0.0144 | - | - | - |
| 3.0945 | 44000 | 0.0146 | - | - | - |
| 3.1296 | 44500 | 0.0142 | - | - | - |
| 3.1648 | 45000 | 0.0144 | - | - | - |
| 3.1999 | 45500 | 0.0141 | - | - | - |
| 3.2351 | 46000 | 0.0142 | - | - | - |
| 3.2703 | 46500 | 0.0142 | - | - | - |
| 3.3054 | 47000 | 0.0142 | - | - | - |
| 3.3406 | 47500 | 0.0145 | - | - | - |
| 3.3758 | 48000 | 0.0142 | - | - | - |
| 3.4109 | 48500 | 0.0143 | - | - | - |
| 3.4461 | 49000 | 0.0145 | - | - | - |
| 3.4813 | 49500 | 0.0142 | - | - | - |
| 3.5164 | 50000 | 0.014 | - | - | - |
| 3.5516 | 50500 | 0.0141 | - | - | - |
| 3.5868 | 51000 | 0.0144 | - | - | - |
| 3.6219 | 51500 | 0.0143 | - | - | - |
| 3.6571 | 52000 | 0.0143 | - | - | - |
| 3.6922 | 52500 | 0.0142 | - | - | - |
| 3.7274 | 53000 | 0.014 | - | - | - |
| 3.7626 | 53500 | 0.0142 | - | - | - |
| 3.7977 | 54000 | 0.0141 | - | - | - |
| 3.8329 | 54500 | 0.0141 | - | - | - |
| 3.8681 | 55000 | 0.014 | - | - | - |
| 3.9032 | 55500 | 0.0143 | - | - | - |
| 3.9384 | 56000 | 0.0142 | - | - | - |
| 3.9736 | 56500 | 0.0141 | - | - | - |
| 4.0 | 56876 | - | 0.0146 | 0.8789 | - |
| -1 | -1 | - | - | - | 0.8796 |
Framework Versions
- Python: 3.11.11
- Sentence Transformers: 4.1.0
- Transformers: 4.51.3
- PyTorch: 2.6.0+cu124
- Accelerate: 1.5.2
- Datasets: 3.6.0
- Tokenizers: 0.21.1
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",
}