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 bge-retrieval-data-finance-50_k dataset. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: BAAI/bge-small-en-v1.5
- Maximum Sequence Length: 256 tokens
- Output Dimensionality: 384 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
- Training Dataset:
- bge-retrieval-data-finance-50_k
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': 384, '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("40Hz/autoresearch-business-v1")
# Run inference
sentences = [
'gmc is what type of truck',
'- It has been said that the roots of GMC Trucks go back to the 3 Rs of early truck development: Rapid, Reliance and Randolph. Truly, the first GMC trucks were Rapid or Reliance trucks with GMC nameplates. However, Randolph trucks apparently had little or no influence on GMC design.',
'business economic policy international africa house believes africans are worse Despite projects such as direct dividends, the gap between rich and poor is still worsened by natural resources. Investment from the profits of natural resources in human development is relatively low in Africa. In 2006, 29 of the 31 lowest scoring countries for HDI were in Africa, a symptom of low re-investment rates [1] . Generally it is only the economic elite who benefit from any resource extraction, and reinvestment rarely strays far from urban areas [2] . This increases regional and class inequality, ensuring poverty persists.\n\n[1] African Development Bank ‘African Development Report 2007’ pg.110 http://www.afdb.org/fileadmin/uploads/afdb/Documents/Publications/Maximizing%20the%20Benefits%20from%20-%20Oil%20and%20Gas%20in%20Africa.pdf\n\n[2] Ibid\n',
]
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.7964, 0.0219],
# [0.7964, 1.0000, 0.0947],
# [0.0219, 0.0947, 1.0000]])
Training Details
Training Dataset
bge-retrieval-data-finance-50_k
- Dataset: bge-retrieval-data-finance-50_k
- Size: 38,236 training samples
- Columns: anchor and positive
- Approximate statistics based on the first 100 samples:
anchor positive type string string modality text text details min: 5 tokensmean: 18.69 tokensmax: 256 tokens min: 30 tokensmean: 101.75 tokensmax: 256 tokens - Samples:
anchor positive price chopper operating headquarters Price Chopper cuts 80 jobs at corporate headquarters Exterior of the new Price Chopper Headquarters Building at 461 Nott St. on Thursday, June 3, 2010, in Schenectady, NY. The Green Building is LEED certified. (Luanne M. Ferris / Times Union) Exterior of the new Price Chopper Headquarters Building at 461 Nott St. on Thursday, June 3, 2010, in Schenectady, NY. The Green Building is LEED certified. Price Chopper has laid off 80 employees at its corporate headquarters, the chain announced Wednesday. The layoffs include management, field, clerical and administrative support workers, according to a statement from the company. vibrent health - Vibrent Health is an innovative health technology company that uses evidence-based B2B2C technology infrastructure called Adaptive Platform for Personalized Engagement that enables longitudinal data collection, engagement and insights. what is the dry harvesting method of coffee cherries Harvesting, Milling and Packing Coffee â Part 2 of âAll About Coffeeâ Coffee Milling: After harvesting, the coffee cherries must then be set to dry. The oldest and “natural” method of this process is the Dry Mill where the coffee cherries are cleaned and sorted before its exposure to the sun. - Loss: CachedMultipleNegativesRankingLoss with these parameters:
{ "scale": 20.0, "similarity_fct": "cos_sim", "mini_batch_size": 16, "mini_batch_num_tokens": null, "gather_across_devices": false, "directions": [ "query_to_doc" ], "partition_mode": "joint", "hardness_mode": null, "hardness_strength": 0.0 }
Evaluation Dataset
bge-retrieval-data-finance-50_k
- Dataset: bge-retrieval-data-finance-50_k
- Size: 2,013 evaluation samples
- Columns: anchor and positive
- Approximate statistics based on the first 100 samples:
anchor positive type string string modality text text details min: 5 tokensmean: 21.01 tokensmax: 256 tokens min: 27 tokensmean: 103.73 tokensmax: 256 tokens - Samples:
anchor positive What is the name of the Australian-based visual effects company founded in 1995 in Adelaide whose spin-off privately held company was founded in April 2000 and has customers worldwide in film, advertising, etc.? Rising Sun Research Cospective Pty Ltd is an Australian software firm. Originally born as Rising Sun Research, a technology spin-off from the boutique visual effects company Rising Sun Pictures, the company now operates under the Cospective banner to reflect the broadening nature of the business. Cospective has customers worldwide in film, advertising, television, games and design. The privately held company was founded in April 2000 and is headquartered in Adelaide, Australia. Who was born first, Takeshi Kitano or Arturo Ripstein? Takeshi Kitano Takeshi Kitano (北野 武 , Kitano Takeshi , born 18 January 1947) is a Japanese comedian, television personality, director, actor, author, and screenwriter. While he is known primarily as a comedian and TV host in his native Japan, abroad he is known almost entirely for his filmwork. With the exception of his works as a film director, he is known almost exclusively by the stage name Beat Takeshi (ビートたけし , Bīto Takeshi ) . what year o reilly auto parts founded O'Reilly Auto Parts O’Reilly Auto Parts is an American auto parts retailer that provides automotive aftermarket parts, tools, supplies, equipment, and accessories in the United States serving both the professional service providers and do-it-yourself customers. Founded in 1957 by the O’Reilly family, the company operates more than 4,829 stores in 47 states. - Loss: CachedMultipleNegativesRankingLoss with these parameters:
{ "scale": 20.0, "similarity_fct": "cos_sim", "mini_batch_size": 16, "mini_batch_num_tokens": null, "gather_across_devices": false, "directions": [ "query_to_doc" ], "partition_mode": "joint", "hardness_mode": null, "hardness_strength": 0.0 }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 32learning_rate: 2e-05warmup_steps: 0.1fp16: Trueproject: autoresearch-businesstrackio_space_id: 40Hz/autoresearch-gpupush_to_hub: Truehub_model_id: 40Hz/autoresearch-business-v1batch_sampler: no_duplicates
All Hyperparameters
per_device_train_batch_size: 32num_train_epochs: 3max_steps: -1learning_rate: 2e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: 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: 1.0label_smoothing_factor: 0.0bf16: Falsefp16: Truebf16_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: autoresearch-businesstrackio_space_id: 40Hz/autoresearch-gputrackio_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: Truehub_private_repo: Nonehub_model_id: 40Hz/autoresearch-business-v1hub_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: Nonedataloader_multiprocessing_context: Nonedataloader_in_order: Trueremove_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: Nonelocal_rank: -1prompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}warmup_ratio: None
Training Logs
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0418 | 50 | 0.1604 | - |
| 0.0837 | 100 | 0.1063 | - |
| 0.1255 | 150 | 0.0727 | - |
| 0.1674 | 200 | 0.0436 | - |
| 0.2092 | 250 | 0.0474 | - |
| 0.2510 | 300 | 0.0428 | - |
| 0.2929 | 350 | 0.0368 | - |
| 0.3347 | 400 | 0.0386 | - |
| 0.3766 | 450 | 0.0405 | - |
| 0.4184 | 500 | 0.0294 | - |
| 0.4603 | 550 | 0.0323 | - |
| 0.5021 | 600 | 0.0302 | - |
| 0.5439 | 650 | 0.0328 | - |
| 0.5858 | 700 | 0.0325 | - |
| 0.6276 | 750 | 0.0372 | - |
| 0.6695 | 800 | 0.0339 | - |
| 0.7113 | 850 | 0.0334 | - |
| 0.7531 | 900 | 0.0321 | - |
| 0.7950 | 950 | 0.0361 | - |
| 0.8368 | 1000 | 0.0311 | - |
| 0.8787 | 1050 | 0.0330 | - |
| 0.9205 | 1100 | 0.0309 | - |
| 0.9623 | 1150 | 0.0367 | - |
| 1.0 | 1195 | - | 0.0039 |
| 1.0042 | 1200 | 0.0213 | - |
| 1.0460 | 1250 | 0.0193 | - |
| 1.0879 | 1300 | 0.0219 | - |
| 1.1297 | 1350 | 0.0205 | - |
| 1.1715 | 1400 | 0.0173 | - |
| 1.2134 | 1450 | 0.0174 | - |
| 1.2552 | 1500 | 0.0203 | - |
| 1.2971 | 1550 | 0.0147 | - |
| 1.3389 | 1600 | 0.0242 | - |
| 1.3808 | 1650 | 0.0224 | - |
| 1.4226 | 1700 | 0.0229 | - |
| 1.4644 | 1750 | 0.0187 | - |
| 1.5063 | 1800 | 0.0198 | - |
| 1.5481 | 1850 | 0.0173 | - |
| 1.5900 | 1900 | 0.0212 | - |
| 1.6318 | 1950 | 0.0196 | - |
| 1.6736 | 2000 | 0.0207 | - |
| 1.7155 | 2050 | 0.0236 | - |
| 1.7573 | 2100 | 0.0222 | - |
| 1.7992 | 2150 | 0.0201 | - |
| 1.8410 | 2200 | 0.0270 | - |
| 1.8828 | 2250 | 0.0240 | - |
| 1.9247 | 2300 | 0.0186 | - |
| 1.9665 | 2350 | 0.0186 | - |
| 2.0 | 2390 | - | 0.0036 |
| 2.0084 | 2400 | 0.0176 | - |
| 2.0502 | 2450 | 0.0188 | - |
| 2.0921 | 2500 | 0.0114 | - |
| 2.1339 | 2550 | 0.0105 | - |
| 2.1757 | 2600 | 0.0167 | - |
| 2.2176 | 2650 | 0.0128 | - |
| 2.2594 | 2700 | 0.0122 | - |
| 2.3013 | 2750 | 0.0117 | - |
| 2.3431 | 2800 | 0.0153 | - |
| 2.3849 | 2850 | 0.0143 | - |
| 2.4268 | 2900 | 0.0133 | - |
| 2.4686 | 2950 | 0.0152 | - |
| 2.5105 | 3000 | 0.0169 | - |
| 2.5523 | 3050 | 0.0122 | - |
| 2.5941 | 3100 | 0.0181 | - |
| 2.6360 | 3150 | 0.0156 | - |
| 2.6778 | 3200 | 0.0109 | - |
| 2.7197 | 3250 | 0.0171 | - |
| 2.7615 | 3300 | 0.0147 | - |
| 2.8033 | 3350 | 0.0120 | - |
| 2.8452 | 3400 | 0.0142 | - |
| 2.8870 | 3450 | 0.0123 | - |
| 2.9289 | 3500 | 0.0134 | - |
| 2.9707 | 3550 | 0.0142 | - |
| 3.0 | 3585 | - | 0.0032 |
Training Time
- Training: 20.5 minutes
- Evaluation: 23.5 seconds
- Total: 20.9 minutes
Framework Versions
- Python: 3.12.11
- Sentence Transformers: 5.7.0
- Transformers: 5.15.0
- PyTorch: 2.8.0+cu128
- Accelerate: 1.14.0
- Datasets: 5.0.1
- Tokenizers: 0.22.2
Additional Resources
- Training and Finetuning Embedding Models with Sentence Transformers: the end-to-end guide for training or finetuning Sentence Transformer models.
- Introduction to Matryoshka Embedding Models: variable-size embeddings that can be truncated with minimal quality loss.
- Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper Retrieval: post-training compression of embedding vectors.
- Multimodal Embedding & Reranker Models with Sentence Transformers: use text, image, audio, and video models through the same API.
- Training and Finetuning Multimodal Embedding & Reranker Models with Sentence Transformers: train multimodal embedding models, with a Visual Document Retrieval walkthrough.
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",
}
CachedMultipleNegativesRankingLoss
@misc{gao2021scaling,
title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
year={2021},
eprint={2101.06983},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
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},
}