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

This is a sentence-transformers model finetuned from BAAI/bge-small-en-v1.5 on the csv dataset. 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
  • Training Dataset:
    • csv

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: 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 = [
    'Represent this sentence for searching relevant passages: What are some effects of maternal iron deficiency on adult male offspring development?',
    'We found three differentially abundant taxonomic classes in the IDD group using an LDA effect size calculation with an LDA score higher than 4.0. The results showed that the Bacteroidaceae genus Bacteroides and Lachnospiraceae genus Marvinbryantia were significantly increased in rats in the IDD group compared to rats in the other groups (C). \nIn this study, we showed that maternal iron deficiency may program and alter adult male offspring development with regard to spatial learning and memory, dorsal hippocampus BDNF expression, gut microbiota, and SCFA concentrations. Our results showed that the adult male offspring of rats that were fed a low-iron diet before pregnancy and throughout the lactation period had (1) spatial deficits via a Morris water maze evaluation; (2) decreased dorsal hippocampal BDNF mRNA and protein concentrations accompanied by a low TrkB abundance; (3) a decreased plasma acetate concentration without changes in butyrate and propionate concentrations; (4) enrichment of the Bacteroidaceae genus Bacteroides and Lachnospiraceae genus Marvinbryantia.',
    'Parents report encouraging their children to engage in “healthy” lifestyle choices, including making alterations to diet, physical activity (PA), and sleep behavior, which may (1) help parents feel more in control over the impact of the condition, and (2) allow them gain a more positive outlook on the future. Unfortunately, even in the adult MS literature, there is insufficient evidence to make clinical recommendations regarding lifestyle modifications. Improving the body of literature on modifiable lifestyle factors in pediatric MS with the goal of creating guidelines that will help POMS patients and their parents deal with these difficult decisions is needed. \nOur objective in this manuscript is to summarize and identify gaps in current research on modifiable lifestyle factors and pediatric MS. Two questions guided this review: (1) Which modifiable lifestyle factors have been investigated in the context of POMS? And (2) which factors have been shown to play a role in the risk of POMS, disease course, or quality of life? \nWe used the Arksey and O’Malley framework to guide this review.',
]
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

Information Retrieval

Metric Value
cosine_accuracy@1 0.5854
cosine_accuracy@3 0.7196
cosine_accuracy@5 0.7635
cosine_accuracy@10 0.8084
cosine_precision@1 0.5854
cosine_precision@3 0.2399
cosine_precision@5 0.1527
cosine_precision@10 0.0808
cosine_recall@1 0.5854
cosine_recall@3 0.7196
cosine_recall@5 0.7635
cosine_recall@10 0.8084
cosine_ndcg@10 0.6971
cosine_mrr@10 0.6615
cosine_map@100 0.6663

Training Details

Training Dataset

csv

  • Dataset: csv
  • Size: 650,596 training samples
  • Columns: anchor and positive
  • Approximate statistics based on the first 1000 samples:
    anchor positive
    type string string
    details
    • min: 16 tokens
    • mean: 26.5 tokens
    • max: 65 tokens
    • min: 25 tokens
    • mean: 229.67 tokens
    • max: 512 tokens
  • Samples:
    anchor positive
    Represent this sentence for searching relevant passages: What conditions are excluded as secondary causes of hypercholesterolemia? In addition, no abnormalities were revealed under physical examination.
    The exclusion criteria comprised secondary causes of hypercholesterolemia, including hypothyroidism, kidney diseases, poorly-controlled diabetes, cholestasis or the use of drugs impairing lipid metabolism.
    The investigation was approved by the Bioethics Committee of the Medical University of Lodz (RNN/191/21/KE). Informed consent was obtained from all participants. All methods were carried out in accordance with relevant guidelines and regulations.
    All participants were interviewed for their personal history of diabetes, hypertension, smoking, cardiovascular disease, pharmacological treatment, family history of hypercholesterolemia and cardiovascular disease. During the same visit, a physical examination for the presence of corneal arcus and tendon xanthomas was performed.
    In both the control and research groups, peripheral blood mononuclear cells (PBMCs) and serum were isolated from peripheral whole blood. All...
    Represent this sentence for searching relevant passages: What type of mannose linkage in side chains has the highest impact on antibody response? On the other hand, side chains with β-(1→2)-linked mannose residues, which have the highest impact on antibody response , were found only in Candida spp.. The oligomannoside sequence within S. cerevisiae mannan corresponding to antibodies associated with Crohn’s disease was assigned to be the following mannotetraoside: Man(1→3)Man(1→2)Man(1→2)Man , which is illustrated in. Therefore, the corresponding oligosaccharide 1 was selected in this study as a basis for the creation of structurally related glycoarray. Ligands 2 and 3 stem from 1 after formally replacing the terminal α-(1→3)-mannoside fragment with α-(1→2)- and β-(1→2)-mannoside units, respectively. Additional glycosylation of ligand 1 leads to the formation of ligands 4 and 5.
    Represent this sentence for searching relevant passages: How do fluctuations in nest temperature affect bumblebee colonies in aboveground nest boxes? Impairments to colony function, as a result a sublethal environmental stressors, are linked with reduced colony success , therefore, combined increases in worker abandonment and reduced offspring production may act to have the greatest impact on bumblebee colony success under chronic heat stress.
    The results obtained from our laboratory study inform about the capacity of bumblebee colonies to cope with chronic warm temperatures, but there are several distinctions when transposed to natural settings. Conditions used correspond more to surface or aboveground nesting that provide minor buffering from the environment. Underground nest sites are the most frequently observed nesting strategies across multiple bumblebee species, including B. impatiens. However, surface or aboveground nest sites combined are almost as frequently reported for natural settings and even more frequent when nesting in artificial nest such as human made structures. Aboveground temperatures can cause wide fluctuatio...
  • Loss: CachedGISTEmbedLoss with these parameters:
    {'guide': SentenceTransformer(
      (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: NewModel 
      (1): Pooling({'word_embedding_dimension': 1024, '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): Dense({'in_features': 1024, 'out_features': 1024, 'bias': True, 'activation_function': 'torch.nn.modules.linear.Identity'})
    ), 'temperature': 0.01}
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 32768
  • num_train_epochs: 8
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.1
  • 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: 32768
  • per_device_eval_batch_size: 8
  • 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: 5e-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: 8
  • max_steps: -1
  • lr_scheduler_type: cosine
  • 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: False
  • 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: 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
  • 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
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional

Training Logs

Click to expand
Epoch Step Training Loss cosine_ndcg@10
0.0526 1 7.2666 -
0.1053 2 7.2688 -
0.1579 3 6.8798 -
0.2105 4 6.0896 -
0.2632 5 5.1499 0.5392
0.3158 6 4.2179 -
0.3684 7 3.4166 -
0.4211 8 2.9593 -
0.4737 9 2.8846 -
0.5263 10 2.8879 0.5541
0.5789 11 2.728 -
0.6316 12 2.5792 -
0.6842 13 2.4242 -
0.7368 14 2.2856 -
0.7895 15 2.2488 0.5852
0.8421 16 2.1646 -
0.8947 17 2.0432 -
0.9474 18 1.9749 -
1.0 19 1.8132 -
1.0526 20 1.8851 0.6135
1.1053 21 1.8024 -
1.1579 22 1.777 -
1.2105 23 1.7047 -
1.2632 24 1.6751 -
1.3158 25 1.6875 0.6283
1.3684 26 1.6396 -
1.4211 27 1.5756 -
1.4737 28 1.5591 -
1.5263 29 1.533 -
1.5789 30 1.5035 0.6449
1.6316 31 1.4705 -
1.6842 32 1.4446 -
1.7368 33 1.4092 -
1.7895 34 1.4139 -
1.8421 35 1.3996 0.6557
1.8947 36 1.365 -
1.9474 37 1.3397 -
2.0 38 1.2443 -
2.0526 39 1.3322 -
2.1053 40 1.2862 0.6632
2.1579 41 1.2965 -
2.2105 42 1.2544 -
2.2632 43 1.2474 -
2.3158 44 1.2748 -
2.3684 45 1.2509 0.6688
2.4211 46 1.2271 -
2.4737 47 1.2172 -
2.5263 48 1.2263 -
2.5789 49 1.1919 -
2.6316 50 1.1962 0.6748
2.6842 51 1.1732 -
2.7368 52 1.1683 -
2.7895 53 1.1711 -
2.8421 54 1.1783 -
2.8947 55 1.1353 0.6784
2.9474 56 1.1301 -
3.0 57 1.0551 -
3.0526 58 1.1436 -
3.1053 59 1.0967 -
3.1579 60 1.1259 0.6822
3.2105 61 1.085 -
3.2632 62 1.1107 -
3.3158 63 1.104 -
3.3684 64 1.1113 -
3.4211 65 1.0884 0.6849
3.4737 66 1.079 -
3.5263 67 1.0946 -
3.5789 68 1.0751 -
3.6316 69 1.0585 -
3.6842 70 1.0601 0.6877
3.7368 71 1.0576 -
3.7895 72 1.0558 -
3.8421 73 1.0642 -
3.8947 74 1.0349 -
3.9474 75 1.0368 0.6889
4.0 76 0.9558 -
4.0526 77 1.0487 -
4.1053 78 1.0164 -
4.1579 79 1.0359 -
4.2105 80 1.0095 0.6908
4.2632 81 1.0194 -
4.3158 82 1.0359 -
4.3684 83 1.0266 -
4.4211 84 1.0161 -
4.4737 85 1.0188 0.6913
4.5263 86 1.0265 -
4.5789 87 1.0193 -
4.6316 88 1.0052 -
4.6842 89 0.9994 -
4.7368 90 1.0024 0.6934
4.7895 91 1.0134 -
4.8421 92 1.0259 -
4.8947 93 0.9807 -
4.9474 94 0.9947 -
5.0 95 0.9139 0.6945
5.0526 96 0.9956 -
5.1053 97 0.9615 -
5.1579 98 0.9942 -
5.2105 99 0.9616 -
5.2632 100 0.9848 0.6947
5.3158 101 0.9967 -
5.3684 102 0.9861 -
5.4211 103 0.9694 -
5.4737 104 0.984 -
5.5263 105 0.9953 0.6953
5.5789 106 0.987 -
5.6316 107 0.9745 -
5.6842 108 0.9582 -
5.7368 109 0.957 -
5.7895 110 0.9826 0.6960
5.8421 111 0.9911 -
5.8947 112 0.96 -
5.9474 113 0.9593 -
6.0 114 0.8886 -
6.0526 115 0.9722 0.6963
6.1053 116 0.9507 -
6.1579 117 0.9767 -
6.2105 118 0.9394 -
6.2632 119 0.9569 -
6.3158 120 0.9674 0.6965
6.3684 121 0.9674 -
6.4211 122 0.9606 -
6.4737 123 0.96 -
6.5263 124 0.9767 -
6.5789 125 0.9664 0.6968
6.6316 126 0.948 -
6.6842 127 0.9581 -
6.7368 128 0.9491 -
6.7895 129 0.9627 -
6.8421 130 0.9723 0.6971
6.8947 131 0.9447 -
6.9474 132 0.9502 -
7.0 133 0.8796 -
7.0526 134 0.9589 -
7.1053 135 0.9377 0.6971
7.1579 136 0.9573 -
7.2105 137 0.9369 -
7.2632 138 0.9559 -
7.3158 139 0.9662 -
7.3684 140 0.9615 0.6971
7.4211 141 0.9555 -
7.4737 142 0.9579 -
7.5263 143 0.9719 -
7.5789 144 0.9664 -
7.6316 145 0.9554 0.6972
7.6842 146 0.9526 -
7.7368 147 0.9456 -
7.7895 148 0.9621 -
7.8421 149 0.9669 -
7.8947 150 0.9473 0.6971
7.9474 151 0.9519 -
8.0 152 0.8705 -

Framework Versions

  • Python: 3.11.9
  • Sentence Transformers: 3.3.1
  • Transformers: 4.47.0
  • PyTorch: 2.5.1+cu124
  • Accelerate: 1.2.0
  • Datasets: 2.19.2
  • Tokenizers: 0.21.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",
}
Downloads last month
7
Safetensors
Model size
33.4M 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 gutsartificial/bge-small-en-v1.5-2025-01-01_21-55-17

Finetuned
(138)
this model

Evaluation results