ezequiel's picture
sub-version a: Hyper Tunning for "full stack", "back end" and "front end"
f861129 verified
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

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

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, and score
  • 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, fondos material selection and cognition 0.0
    professional alarm installer,service tech.,customer service relations,sales,cctv quantity surveying & reading charts 0.1
    diagnostico ecografico waste identification system downtime 0.19
  • Loss: CosineSimilarityLoss with these parameters:
    {
        "loss_fct": "torch.nn.modules.loss.MSELoss"
    }
    

Evaluation Dataset

Unnamed Dataset

  • Size: 113,751 evaluation samples
  • Columns: sentence1, sentence2, and score
  • 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 dutch a2 dutch 0.98
    design of mine dumps 设计矿山废料堆 1.0
    create soil and plant improvement programmes 创建土壤和植物改良计划 1.0
  • Loss: CosineSimilarityLoss with these parameters:
    {
        "loss_fct": "torch.nn.modules.loss.MSELoss"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: epoch
  • per_device_train_batch_size: 32
  • per_device_eval_batch_size: 32
  • learning_rate: 1e-05
  • num_train_epochs: 4
  • warmup_ratio: 0.1
  • fp16: True

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: epoch
  • prediction_loss_only: True
  • per_device_train_batch_size: 32
  • per_device_eval_batch_size: 32
  • 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: 1e-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: 4
  • 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}
  • tp_size: 0
  • 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: None
  • hub_always_push: False
  • 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
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_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",
}