sbert
This is a sentence-transformers model finetuned from sentence-transformers/bert-base-nli-mean-tokens on the fin_modern_bert-pairs-sec-synthetic-v1 dataset. 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: sentence-transformers/bert-base-nli-mean-tokens
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
- Training Dataset:
- fin_modern_bert-pairs-sec-synthetic-v1
- Language: en
- License: apache-2.0
Model Sources
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': 'mean', 'include_prompt': True})
)
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
queries = [
'What is the reporting currency used for the Ares Management Corporation financial statements?',
]
documents = [
'Financial Statements (Continued) (Dollars in Thousands, Except Share Data and As Otherwise Noted)',
'Factors contributing to a decrease in Genco’s electric margin were as follows: \x95 Lower wholesale margins as Genco purchased additional power at higher costs to supply Marketing Company after the expiration of the cost-based power supply contract between EEI and its affiliates on December 31, 2005. \x95 Higher net emission allowance costs because of a $21 million gain at Genco in the third quarter of 2005... \x95 A 9% increase in coal and transportation prices. \x95 Lower margins on interchange sales in 2006 compared with 2005, primarily because of lower power prices, and a $23 million reduction in 2006 due to the amendment of the JDA among UE, Genco and CIPS. \x95 Higher MISO Day Two Energy Market costs totaling $12 million in 2006 compared with 2005...',
'4.3 Form of Broadridge Financial Solutions, Inc. 3.400% Senior Note due 2026... 4.5 Form of Broadridge Financial Solutions, Inc. 2.900% Senior Note due 2029... 4.8 Form of Broadridge Financial Solutions, Inc. 2.600% Senior Note due 2031',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 768] [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.6956, 0.2088, 0.5187]])
Evaluation
Metrics
Information Retrieval
| Metric |
Value |
| cosine_accuracy@1 |
0.9333 |
| cosine_accuracy@3 |
1.0 |
| cosine_accuracy@5 |
1.0 |
| cosine_accuracy@10 |
1.0 |
| cosine_precision@1 |
0.9333 |
| cosine_precision@3 |
0.3333 |
| cosine_precision@5 |
0.2 |
| cosine_precision@10 |
0.1 |
| cosine_recall@1 |
0.9333 |
| cosine_recall@3 |
1.0 |
| cosine_recall@5 |
1.0 |
| cosine_recall@10 |
1.0 |
| cosine_ndcg@10 |
0.9754 |
| cosine_mrr@10 |
0.9667 |
| cosine_map@100 |
0.9667 |
Training Details
Training Dataset
fin_modern_bert-pairs-sec-synthetic-v1
- Dataset: fin_modern_bert-pairs-sec-synthetic-v1
- Size: 70 training samples
- Columns:
query and positive
- Approximate statistics based on the first 70 samples:
|
query |
positive |
| type |
string |
string |
| modality |
text |
text |
| details |
- min: 16 tokens
- mean: 27.47 tokens
- max: 42 tokens
|
- min: 15 tokens
- mean: 65.44 tokens
- max: 168 tokens
|
- Samples:
| query |
positive |
What was the company's adjusted after-tax return on invested capital (ROIC) for fiscal 2021, and how does it compare to the prior year? |
For the fiscal year ended August 28, 2021, our adjusted after-tax return on invested capital (“ROIC”), which is a non-GAAP measure, was 41.0% as compared to 35.7% for the comparable prior year period. |
What specific risks does Baxter face when sourcing raw materials for its products, and how does the company mitigate these risks? |
Although most of these materials are generally available, certain raw materials used in producing some of the company’s products are available only from one or a limited number of suppliers, and Baxter at times may experience shortages of supply. In an effort to manage risk associated with raw materials supply, Baxter works closely with its suppliers to help ensure availability and continuity of supply while maintaining high quality and reliability. |
What is the company's expected recovery for dip tube repair claims, administrative costs, and legal fees as of December 31, 2002? |
As of December 31, 2002, the company recorded as a long-term receivable approximately $34.0 million related to dip tube repair claims, administrative costs, legal fees, and related expenses. It is the company's expectation that all or a substantial portion of its costs will be recovered from Perfection, American Meter Company, Manner Plastics Materials, Inc. and their insurers, as well as the company's insurers. |
- Loss:
CachedMultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 4,
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
Evaluation Dataset
fin_modern_bert-pairs-sec-synthetic-v1
- Dataset: fin_modern_bert-pairs-sec-synthetic-v1
- Size: 15 evaluation samples
- Columns:
query and positive
- Approximate statistics based on the first 15 samples:
|
query |
positive |
| type |
string |
string |
| modality |
text |
text |
| details |
- min: 16 tokens
- mean: 28.47 tokens
- max: 39 tokens
|
- min: 20 tokens
- mean: 66.07 tokens
- max: 156 tokens
|
- Samples:
| query |
positive |
What is the company's rationale for the expected decline in stock repurchases during 2013 compared to 2012 and 2011 levels? |
The company expects to incur significant debt in 2013 related to the planned acquisition of Gambro and, as a result, stock repurchases in 2013 are expected to decline from 2012 and 2011 levels. |
What is the reporting currency used for the Ares Management Corporation financial statements? |
Financial Statements (Continued) (Dollars in Thousands, Except Share Data and As Otherwise Noted) |
What are the specific terms and dates for the Broadridge Financial Solutions, Inc. Senior Notes due in 2026, 2029, and 2031? |
4.3 Form of Broadridge Financial Solutions, Inc. 3.400% Senior Note due 2026... 4.5 Form of Broadridge Financial Solutions, Inc. 2.900% Senior Note due 2029... 4.8 Form of Broadridge Financial Solutions, Inc. 2.600% Senior Note due 2031 |
- Loss:
CachedMultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim",
"mini_batch_size": 4,
"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: 16
learning_rate: 0.0005
warmup_steps: 0.1
bf16: True
logging_nan_inf_filter: False
per_device_eval_batch_size: 16
seed: 777
data_seed: 777
prompts: {'query': '', 'positive': ''}
batch_sampler: no_duplicates
All Hyperparameters
Click to expand
per_device_train_batch_size: 16
num_train_epochs: 3
max_steps: -1
learning_rate: 0.0005
lr_scheduler_type: linear
lr_scheduler_kwargs: None
warmup_steps: 0.1
optim: adamw_torch_fused
optim_args: None
weight_decay: 0.0
adam_beta1: 0.9
adam_beta2: 0.999
adam_epsilon: 1e-08
optim_target_modules: None
gradient_accumulation_steps: 1
average_tokens_across_devices: True
max_grad_norm: 1.0
label_smoothing_factor: 0.0
bf16: True
fp16: False
bf16_full_eval: False
fp16_full_eval: False
tf32: None
gradient_checkpointing: False
gradient_checkpointing_kwargs: None
torch_compile: False
torch_compile_backend: None
torch_compile_mode: None
use_liger_kernel: False
liger_kernel_config: None
use_cache: False
neftune_noise_alpha: None
torch_empty_cache_steps: None
auto_find_batch_size: False
log_on_each_node: True
logging_nan_inf_filter: False
include_num_input_tokens_seen: no
log_level: passive
log_level_replica: warning
disable_tqdm: False
project: huggingface
trackio_space_id: None
trackio_bucket_id: None
trackio_static_space_id: None
per_device_eval_batch_size: 16
prediction_loss_only: True
eval_on_start: False
eval_do_concat_batches: True
eval_use_gather_object: False
eval_accumulation_steps: None
include_for_metrics: []
batch_eval_metrics: False
save_only_model: False
save_on_each_node: False
enable_jit_checkpoint: False
push_to_hub: False
hub_private_repo: None
hub_model_id: None
hub_strategy: every_save
hub_always_push: False
hub_revision: None
load_best_model_at_end: False
ignore_data_skip: False
restore_callback_states_from_checkpoint: False
full_determinism: False
seed: 777
data_seed: 777
use_cpu: 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
dataloader_drop_last: False
dataloader_num_workers: 0
dataloader_pin_memory: True
dataloader_persistent_workers: False
dataloader_prefetch_factor: None
dataloader_multiprocessing_context: None
dataloader_in_order: True
remove_unused_columns: True
label_names: None
train_sampling_strategy: random
length_column_name: length
ddp_find_unused_parameters: None
ddp_bucket_cap_mb: None
ddp_broadcast_buffers: False
ddp_static_graph: None
ddp_backend: None
ddp_timeout: 1800
fsdp: None
fsdp_config: None
deepspeed: None
debug: []
skip_memory_metrics: True
do_predict: False
resume_from_checkpoint: None
local_rank: -1
prompts: {'query': '', 'positive': ''}
batch_sampler: no_duplicates
multi_dataset_batch_sampler: proportional
router_mapping: {}
learning_rate_mapping: {}
warmup_ratio: None
Training Logs
| Epoch |
Step |
Validation Loss |
finance-eval_cosine_ndcg@10 |
| -1 |
-1 |
- |
0.8363 |
| 1.0 |
5 |
0.6339 |
0.9374 |
| 2.0 |
10 |
0.3965 |
0.9591 |
| 3.0 |
15 |
0.2027 |
0.9754 |
| -1 |
-1 |
- |
0.9754 |
Training Time
Framework Versions
- Python: 3.13.16
- Sentence Transformers: 5.6.0
- Transformers: 5.22.1
- PyTorch: 2.14.1+cu130
- Accelerate: 1.14.0
- Datasets: 4.8.5
- Tokenizers: 0.23.3
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}
}