SentenceTransformer based on BAAI/bge-base-en-v1.5
This is a sentence-transformers model finetuned from BAAI/bge-base-en-v1.5. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for retrieval.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: BAAI/bge-base-en-v1.5
- Maximum Sequence Length: 256 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'cls', '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: How can a blending engineer distinguish between filter-clogging sediments caused by the solvent cleaning action of high-concentration biodiesel versus those resulting from fuel degradation over time?',
'not mimic any condition the fuel might encounter in use, but is designed to force rapid oxidation, which differentiates stable and unstable fuels. Results from this test provide a relative stability index; longer times mean more stable fuel. In some cases, deposits from the cleaning or solvent effect of B100 have been confused with gums and sediments that could form in storage as the B100 ages. Although sediment can clog a filter in either case, care should be taken to make sure the reason for the clogging is properly identified. For example, if oxidation stability and acid number are within specification, sediments are most likely due to the cleaning effect and not to aging or oxidation. Guidelines to help identify',
'with petroleum home heating oil. • Antioxidants, whether natural or incorporated as additives, can significantly increase the storage life or stability of B100. The use of antioxidant additives is highly recommended with B100, especially with longer-term storage. Actual results and improvements may vary depending upon the chemistry of each additive. • Limiting or preventing biodiesel contact with air reduces or eliminates fuel oxidation and increases storage life. Commercially, this is done by using a nitrogen blanket on storage tanks or storing biodiesel in sealed drums or totes with minimal headspace. Accelerated stability tests like EN15751 will show if a fuel has high or low stability, but this cannot exactly predict the amount of time a fuel can be stored. The',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.5562, 0.0880],
# [0.5562, 1.0000, 0.4385],
# [0.0880, 0.4385, 1.0000]])
Training Details
Training Dataset
Unnamed Dataset
- Size: 371 training samples
- Columns: sentence_0 and sentence_1
- Approximate statistics based on the first 100 samples:
sentence_0 sentence_1 type string string modality text text details min: 23 tokensmean: 35.15 tokensmax: 56 tokens min: 133 tokensmean: 167.69 tokensmax: 238 tokens - Samples:
sentence_0 sentence_1 Represent this sentence for searching relevant passages: What feedstocks are commonly used to produce biodiesel? is also provided. Biodiesel is produced from plant oils, animal fats, recycled cooking oils, and/or greases and has several advantages: • Renewable, with a much lower carbon intensity/life cycle greenhouse gas emissions profile than petroleum diesel fuel, such that it reduces global warming emissions. • Can be used at up to at least 20% blend level in most diesel equipment with zero or minor modifications. • Compatible with all new on- and off-road diesel engines—often called “new technology diesel engines” (NTDEs)—and burners and backward-compatible with most equipment. • Demonstrated to reduce tailpipe soot emissions and other criteria pollutants from older (e.g., legacy) engines without modern emission controls, as well as from industrial boiler and home heating systems. • Nontoxic, biodegradable, Represent this sentence for searching relevant passages: What kinds of residual substances in an unwashed transport vessel would be considered unacceptable when loading biodiesel? B100 must be transported in a way that does not lead to contamination. The following procedures are recommended for trucks and railcars and are used by distributors and transporters of diesel fuel and/or biodiesel: • Ensure trucks and railcars are constructed of aluminum, carbon steel, or stainless steel. • Ensure proper inspection or washout (i.e., a washout certificate) before loading. • Check for previous load carried and residual material. Generally, only diesel fuel or biodiesel is acceptable as a residual. If the vessel has not gone through a washout, some residuals—including food products or raw plant oils, gasoline, or lubricants—may not be acceptable. • Ensure there is no residual water in the tank. • Check that hoses and seals are Represent this sentence for searching relevant passages: What characteristic of the fatty acid chains in biodiesel feedstocks explains why energy content remains relatively consistent regardless of the source oil or fat used? No. 2 diesel fuel. Due to the similar carbon chain length number of the fatty acid chains in the oils and fats used to produce biodiesel, the energy content of biodiesel is similar, regardless of the feedstock and the particular biodiesel process. The energy content of biodiesel and diesel fuel blend linearly, so the energy content of B50 would be midway between the energy content of the starting biodiesel and diesel fuel. However, these differences in energy content do not inherently translate into lower biodiesel fuel economy, especially with engines that employ modern diesel particulate filter/selective catalytic reduction technology that can be positively impacted by lower particulate emissions of biodiesel. Typical reference values for various fuels and biodiesel are shown - Loss: MultipleNegativesRankingLoss with these parameters:
{ "scale": 20.0, "similarity_fct": "cos_sim", "gather_across_devices": false, "directions": [ "query_to_doc" ], "partition_mode": "joint", "hardness_mode": null, "hardness_strength": 0.0 }
Training Hyperparameters
Non-Default Hyperparameters
multi_dataset_batch_sampler: round_robin
All Hyperparameters
per_device_train_batch_size: 8num_train_epochs: 3max_steps: -1learning_rate: 5e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_tokens_across_devices: Truemax_grad_norm: 1label_smoothing_factor: 0.0bf16: Falsefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 8prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Falseignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robinrouter_mapping: {}learning_rate_mapping: {}
Training Time
- Training: 30.2 minutes
Framework Versions
- Python: 3.12.3
- Sentence Transformers: 5.6.0
- Transformers: 5.12.1
- PyTorch: 2.12.1+cpu
- Accelerate: 1.14.0
- Datasets: 5.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{oord2019representationlearningcontrastivepredictive,
title={Representation Learning with Contrastive Predictive Coding},
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
year={2019},
eprint={1807.03748},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.03748},
}