SentenceTransformer based on BAAI/bge-small-en-v1.5

This is a sentence-transformers model finetuned from BAAI/bge-small-en-v1.5. 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: BAAI/bge-small-en-v1.5
  • 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': True, 'architecture': 'BertModel'})
  (1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, '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.3468, 0.0824],
#         [0.3468, 1.0000, 0.0908],
#         [0.0824, 0.0908, 1.0000]])

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.6682
cosine_accuracy@3 0.8609
cosine_accuracy@5 0.9119
cosine_accuracy@10 0.9558
cosine_precision@1 0.6682
cosine_precision@3 0.287
cosine_precision@5 0.1824
cosine_precision@10 0.0956
cosine_recall@1 0.6682
cosine_recall@3 0.8609
cosine_recall@5 0.9119
cosine_recall@10 0.9558
cosine_ndcg@10 0.8174
cosine_mrr@10 0.7724
cosine_map@100 0.7747

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: 18.0 tokens
    • max: 33 tokens
    • min: 29 tokens
    • mean: 310.93 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.6734
0.0335 100 - 0.7120
0.0503 150 - 0.7353
0.0670 200 - 0.7509
0.0838 250 - 0.7648
0.1005 300 - 0.7689
0.1173 350 - 0.7750
0.1340 400 - 0.7768
0.1508 450 - 0.7820
0.1676 500 0.3104 0.7755
0.1843 550 - 0.7774
0.2011 600 - 0.7818
0.2178 650 - 0.7868
0.2346 700 - 0.7849
0.2513 750 - 0.7887
0.2681 800 - 0.7854
0.2849 850 - 0.7974
0.3016 900 - 0.7997
0.3184 950 - 0.8035
0.3351 1000 0.1422 0.8040
0.3519 1050 - 0.8026
0.3686 1100 - 0.7927
0.3854 1150 - 0.7955
0.4021 1200 - 0.8013
0.4189 1250 - 0.7979
0.4357 1300 - 0.8031
0.4524 1350 - 0.8028
0.4692 1400 - 0.8017
0.4859 1450 - 0.8032
0.5027 1500 0.1207 0.8070
0.5194 1550 - 0.8005
0.5362 1600 - 0.8034
0.5529 1650 - 0.7993
0.5697 1700 - 0.8100
0.5865 1750 - 0.8019
0.6032 1800 - 0.8087
0.6200 1850 - 0.8076
0.6367 1900 - 0.8080
0.6535 1950 - 0.8134
0.6702 2000 0.1071 0.8083
0.6870 2050 - 0.8071
0.7038 2100 - 0.8132
0.7205 2150 - 0.8108
0.7373 2200 - 0.8062
0.7540 2250 - 0.8007
0.7708 2300 - 0.8043
0.7875 2350 - 0.8122
0.8043 2400 - 0.8054
0.8210 2450 - 0.8074
0.8378 2500 0.1096 0.8125
0.8546 2550 - 0.8130
0.8713 2600 - 0.8115
0.8881 2650 - 0.8060
0.9048 2700 - 0.8106
0.9216 2750 - 0.8071
0.9383 2800 - 0.8104
0.9551 2850 - 0.8094
0.9718 2900 - 0.8108
0.9886 2950 - 0.8148
1.0 2984 - 0.8167
1.0054 3000 0.0994 0.8160
1.0221 3050 - 0.8132
1.0389 3100 - 0.8120
1.0556 3150 - 0.8133
1.0724 3200 - 0.8123
1.0891 3250 - 0.8084
1.1059 3300 - 0.8068
1.1227 3350 - 0.8067
1.1394 3400 - 0.8035
1.1562 3450 - 0.8046
1.1729 3500 0.0695 0.8094
1.1897 3550 - 0.8109
1.2064 3600 - 0.8097
1.2232 3650 - 0.8136
1.2399 3700 - 0.8067
1.2567 3750 - 0.8102
1.2735 3800 - 0.8119
1.2902 3850 - 0.8147
1.3070 3900 - 0.8115
1.3237 3950 - 0.8113
1.3405 4000 0.0764 0.8106
1.3572 4050 - 0.8095
1.3740 4100 - 0.8102
1.3908 4150 - 0.8116
1.4075 4200 - 0.8130
1.4243 4250 - 0.8137
1.4410 4300 - 0.8148
1.4578 4350 - 0.8121
1.4745 4400 - 0.8138
1.4913 4450 - 0.8145
1.5080 4500 0.0688 0.8153
1.5248 4550 - 0.8149
1.5416 4600 - 0.8150
1.5583 4650 - 0.8146
1.5751 4700 - 0.8141
1.5918 4750 - 0.8141
1.6086 4800 - 0.8122
1.6253 4850 - 0.8150
1.6421 4900 - 0.8164
1.6588 4950 - 0.8173
1.6756 5000 0.0761 0.8154
1.6924 5050 - 0.8142
1.7091 5100 - 0.8145
1.7259 5150 - 0.8143
1.7426 5200 - 0.8145
1.7594 5250 - 0.8162
1.7761 5300 - 0.8174

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

Model tree for austinpatrickm/finetuned_bge_embeddings_v6_small_v1.5

Finetuned
(297)
this model

Papers for austinpatrickm/finetuned_bge_embeddings_v6_small_v1.5

Evaluation results