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: 512 tokens
  • Output Dimensionality: 384 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': '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 = [
    'Can I automate the Gain image over time to create dynamic volume changes?',
    'Document_title: Harmor \nFile_name: plugins/Harmor.htm\nHeading_hierarchy: [Harmor -> About images and planes]\nAnchor_id: [none]\nThere are independent images that control the Pitch/Frequency and Gain of partials. Together these can create any sound, just as sampler can. In the image window the vertical dimension\n  is frequency (each line of pixels is a single partial), while the horizontal dimension is time.',
    'Document_title: PoiZone V2 \nFile_name: plugins/PoiZone.htm\nHeading_hierarchy: [PoiZone V2 -> Voicing]\nAnchor_id: [none]\n• 2 main oscillators for subtractive synthesis: SAW and PULSE shapes, pulse width adjustable. • 1 NOISE Oscillator. • Variable polyphony (1 to 32 voices).',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.4301, 0.1394],
#         [0.4301, 1.0000, 0.1051],
#         [0.1394, 0.1051, 1.0000]])

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.6911
cosine_accuracy@3 0.878
cosine_accuracy@5 0.9252
cosine_accuracy@10 0.9643
cosine_precision@1 0.6911
cosine_precision@3 0.2927
cosine_precision@5 0.185
cosine_precision@10 0.0964
cosine_recall@1 0.6911
cosine_recall@3 0.878
cosine_recall@5 0.9252
cosine_recall@10 0.9643
cosine_ndcg@10 0.834
cosine_mrr@10 0.7914
cosine_map@100 0.7931

Training Details

Training Dataset

Unnamed Dataset

  • Size: 29,840 training samples
  • Columns: sentence_0 and sentence_1
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1
    type string string
    details
    • min: 9 tokens
    • mean: 19.39 tokens
    • max: 34 tokens
    • min: 29 tokens
    • mean: 324.18 tokens
    • max: 512 tokens
  • Samples:
    sentence_0 sentence_1
    How do I load a *.SPEECH preset into the Sampler plugin? Document_title: Speech Preset (.SPEECH)
    File_name: fformats_sample_speech.htm
    Heading_hierarchy: [Speech Preset (
    .SPEECH)]
    Anchor_id: [none]
    The Speech synthesizer processes text to create computerized or Vocoder-like vocals to your projects. The *.SPEECH presets are supported by all native FL Studio plugins that use custom samples for
    synthesizing, i.e. Sampler , Granulizer , Fruity
    Slicer
    and Fruity Scratcher .
    Can I use Speech presets with the Fruity Granulizer to create vocal effects? Document_title: Speech Preset (.SPEECH)
    File_name: fformats_sample_speech.htm
    Heading_hierarchy: [Speech Preset (
    .SPEECH)]
    Anchor_id: [none]
    The Speech synthesizer processes text to create computerized or Vocoder-like vocals to your projects. The *.SPEECH presets are supported by all native FL Studio plugins that use custom samples for
    synthesizing, i.e. Sampler , Granulizer , Fruity
    Slicer
    and Fruity Scratcher .
    What kind of vocals can the Speech synthesizer create from text? Document_title: Speech Preset (.SPEECH)
    File_name: fformats_sample_speech.htm
    Heading_hierarchy: [Speech Preset (
    .SPEECH)]
    Anchor_id: [none]
    The Speech synthesizer processes text to create computerized or Vocoder-like vocals to your projects. The *.SPEECH presets are supported by all native FL Studio plugins that use custom samples for
    synthesizing, i.e. Sampler , Granulizer , Fruity
    Slicer
    and Fruity Scratcher .
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 10
  • per_device_eval_batch_size: 10
  • num_train_epochs: 2
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 10
  • per_device_eval_batch_size: 10
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 2
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_ratio: None
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • enable_jit_checkpoint: False
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • use_cpu: False
  • seed: 42
  • data_seed: None
  • bf16: False
  • fp16: False
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: -1
  • ddp_backend: None
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • 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
  • group_by_length: False
  • length_column_name: length
  • project: huggingface
  • trackio_space_id: trackio
  • 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
  • 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_for_metrics: []
  • eval_do_concat_batches: True
  • auto_find_batch_size: False
  • full_determinism: False
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_num_input_tokens_seen: no
  • 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: True
  • use_cache: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Click to expand
Epoch Step Training Loss cosine_ndcg@10
0.0168 50 - 0.7103
0.0335 100 - 0.7267
0.0503 150 - 0.7500
0.0670 200 - 0.7715
0.0838 250 - 0.7892
0.1005 300 - 0.7921
0.1173 350 - 0.7940
0.1340 400 - 0.7958
0.1508 450 - 0.7889
0.1676 500 0.3978 0.7999
0.1843 550 - 0.7861
0.2011 600 - 0.7848
0.2178 650 - 0.7780
0.2346 700 - 0.7885
0.2513 750 - 0.7926
0.2681 800 - 0.7914
0.2849 850 - 0.8043
0.3016 900 - 0.7939
0.3184 950 - 0.8057
0.3351 1000 0.1115 0.8093
0.3519 1050 - 0.8056
0.3686 1100 - 0.7941
0.3854 1150 - 0.8042
0.4021 1200 - 0.8007
0.4189 1250 - 0.8071
0.4357 1300 - 0.8121
0.4524 1350 - 0.8037
0.4692 1400 - 0.7958
0.4859 1450 - 0.8052
0.5027 1500 0.0989 0.8028
0.5194 1550 - 0.7989
0.5362 1600 - 0.8078
0.5529 1650 - 0.8117
0.5697 1700 - 0.8108
0.5865 1750 - 0.8101
0.6032 1800 - 0.8102
0.6200 1850 - 0.8080
0.6367 1900 - 0.8150
0.6535 1950 - 0.8156
0.6702 2000 0.0901 0.8138
0.6870 2050 - 0.8127
0.7038 2100 - 0.8123
0.7205 2150 - 0.8128
0.7373 2200 - 0.8141
0.7540 2250 - 0.8108
0.7708 2300 - 0.8108
0.7875 2350 - 0.8164
0.8043 2400 - 0.8159
0.8210 2450 - 0.8175
0.8378 2500 0.0908 0.8206
0.8546 2550 - 0.8223
0.8713 2600 - 0.8238
0.8881 2650 - 0.8264
0.9048 2700 - 0.8212
0.9216 2750 - 0.8204
0.9383 2800 - 0.8236
0.9551 2850 - 0.8170
0.9718 2900 - 0.8217
0.9886 2950 - 0.8246
1.0 2984 - 0.8222
1.0054 3000 0.0868 0.8207
1.0221 3050 - 0.8173
1.0389 3100 - 0.8165
1.0556 3150 - 0.8211
1.0724 3200 - 0.8236
1.0891 3250 - 0.8207
1.1059 3300 - 0.8173
1.1227 3350 - 0.8197
1.1394 3400 - 0.8164
1.1562 3450 - 0.8212
1.1729 3500 0.0611 0.8225
1.1897 3550 - 0.8250
1.2064 3600 - 0.8256
1.2232 3650 - 0.8253
1.2399 3700 - 0.8254
1.2567 3750 - 0.8254
1.2735 3800 - 0.8284
1.2902 3850 - 0.8324
1.3070 3900 - 0.8311
1.3237 3950 - 0.8272
1.3405 4000 0.0581 0.8245
1.3572 4050 - 0.8227
1.3740 4100 - 0.8235
1.3908 4150 - 0.8211
1.4075 4200 - 0.8199
1.4243 4250 - 0.8230
1.4410 4300 - 0.8248
1.4578 4350 - 0.8266
1.4745 4400 - 0.8268
1.4913 4450 - 0.8273
1.5080 4500 0.0499 0.8305
1.5248 4550 - 0.8293
1.5416 4600 - 0.8291
1.5583 4650 - 0.8287
1.5751 4700 - 0.8285
1.5918 4750 - 0.8286
1.6086 4800 - 0.8289
1.6253 4850 - 0.8277
1.6421 4900 - 0.8283
1.6588 4950 - 0.8287
1.6756 5000 0.0595 0.8285
1.6924 5050 - 0.8289
1.7091 5100 - 0.8274
1.7259 5150 - 0.8277
1.7426 5200 - 0.8296
1.7594 5250 - 0.8326
1.7761 5300 - 0.8323
1.7929 5350 - 0.8308
1.8097 5400 - 0.8312
1.8264 5450 - 0.8314
1.8432 5500 0.0544 0.8328
1.8599 5550 - 0.8331
1.8767 5600 - 0.8327
1.8934 5650 - 0.8335
1.9102 5700 - 0.8340

Framework Versions

  • Python: 3.12.12
  • Sentence Transformers: 5.2.3
  • Transformers: 5.0.0
  • PyTorch: 2.10.0+cu128
  • Accelerate: 1.12.0
  • Datasets: 4.0.0
  • Tokenizers: 0.22.2

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
26
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for austinpatrickm/multilingual-e5-small-finetuned

Finetuned
(144)
this model

Papers for austinpatrickm/multilingual-e5-small-finetuned

Evaluation results