kokitabayashi's picture
Add new SentenceTransformer model
ca83735 verified
|
Raw History Blame Contribute Delete
29.2 kB
---
language:
- en
license: apache-2.0
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:44709
- loss:MultipleNegativesRankingLoss
base_model: sentence-transformers/bert-base-nli-mean-tokens
widget:
- source_sentence: What is the breakdown of Akamai's global workforce by functional
role as of the end of 2020?
sentences:
- We had approximately 15,000 customers for electronic measurement products in fiscal
2011 and no single customer represented greater than 4 percent of net revenue
of the electronic measurement business.
- if any principal of or interest on any Loan or any fee or other amount payable
by any Borrower hereunder is not paid when due, whether at stated maturity, upon
acceleration or otherwise, such overdue amount shall bear interest, after as well
as before judgment, at a rate per annum equal to (i) in the case of overdue principal
of any Loan, 2% plus the rate otherwise applicable to such Loan as provided in
the preceding paragraphs of this Section
- 'Our employees are grouped across the following roles, with the approximate percentage
of the overall population noted: engineering and research and development (29%),
services and support (28%), sales and marketing (23%) and administrative functions
(20%).'
- source_sentence: How could U.S. government budget policies or shutdowns specifically
impact the company's results of operations?
sentences:
- BNO’s primary contractual obligations are with USCF. In return for its services,
USCF is entitled to a management fee calculated daily and paid monthly as a fixed
percentage of BNO’s NAV, currently 0.75% of NAV on its average daily total net
assets.
- Non-compliance with the NCRE requirements will result in fines. AES Andes currently
fulfills the NCRE requirements by utilizing AES Andes' solar, wind, and biomass
power plants.
- Additionally, the inability of the U.S. Congress to enact a budget for a fiscal
year or the occurrence of partial or complete U.S. federal government shutdowns
may result in temporary closures of agencies such as the Food and Drug Administration
(the “FDA”) or NIH, which could adversely affect business operations of our tenants
who are dependent on government approvals and appropriations. Any shift away from
funding of research and development or delays surrounding the approval of government
budget 20 proposals may adversely impact our tenants’ operations, which in turn
may impact their demand for office/laboratory and tech office space and their
ability to make lease payments to us and thus adversely impact our results of
operations.
- source_sentence: How did the Allstate Financial segment rank in terms of ordinary
life insurance in force and statutory admitted assets as of December 31, 2001?
sentences:
- The increasing cost and complexity for semiconductor manufacturers to move more
technically advanced capability and smaller geometries to volume manufacturing,
and the resulting impact on the rates of technology transition and investment
in capital equipment.
- 4.19 Officers’ Certificate of American Water Capital Corp., dated May 14, 2021,
establishing the terms and authorizing the issuance of the 2.300% Senior Notes
due 2031... 4.20 Officers’ Certificate of American Water Capital Corp., dated
May 14, 2021, establishing the terms and authorizing the issuance of the 3.250%
Senior Notes due 2051.
- As of December 31, 2001, the Allstate Financial segment ranked tenth based on
ordinary life insurance in force and 19th based on statutory admitted assets.
- source_sentence: Who is the current Executive Vice President and Chief Financial
Officer of the Company, and what other roles has he held?
sentences:
- MICHAEL F. MEE - From 1994 to 2000, Chief Financial Officer and Senior Vice President,
Corporate Staff of the Company. Mr. Mee has been Executive Vice President and
Chief Financial Officer, Corporate Staff of the Company and a member of the Office
of the Chairman and Corporate Operating Committee since 2000.
- When actual development of these data elements is different than the historical
development pattern used in a prior period reserve estimate, a new reserve is
determined. The difference between indicated reserves based on new reserve estimates
and recorded reserves (the previous estimate) is the amount of reserve reestimate
and is recognized as an increase
- Total expense under these agreements was approximately $252.6 million, $159.2
million, and $175.4 million in fiscal 2012, 2011, and 2010, respectively...
- source_sentence: What were the primary drivers for the increase in net income for
the year ended December 31, 2021?
sentences:
- In March 2006, AIG borrowed a total of $1.3 billion on an unsecured basis pursuant
to loan agreements with third-party banks, of which $700 million remained outstanding
on Decem- 70 AIG 2006 Form 10-K American International Group, Inc. and Subsidiaries
ber 31, 2006; $500 million was repaid in February 2007, and the balance matures
in March 2007.
- The increase in net income was primarily due to (i) an increase in our operating
profit and (ii) a decrease in other expenses, primarily due to foreign currency
gains in the current period as compared to foreign currency losses in the prior-year
period, partially offset by (a) an increase in depreciation, amortization and
accretion expense, (b) an increase in other operating expense, primarily attributable
to acquisition related costs associated with the Telxius Acquisition and the CoreSite
Acquisition, and (c) an increase in the income tax provision.
- Total modifications $ 1,017 $ 649 $ 2,655 $ 775 $ 5,120 $ 592
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy@1
- cosine_accuracy@3
- cosine_accuracy@5
- cosine_accuracy@10
- cosine_precision@1
- cosine_precision@3
- cosine_precision@5
- cosine_precision@10
- cosine_recall@1
- cosine_recall@3
- cosine_recall@5
- cosine_recall@10
- cosine_ndcg@10
- cosine_mrr@10
- cosine_map@100
model-index:
- name: SBERT base trained on BatuhanECB/FinModernBERT-pairs-sec-synthetic-v1
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: finance eval
type: finance-eval
metrics:
- type: cosine_accuracy@1
value: 0.755741127348643
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.9042797494780793
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.9369519832985386
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.9618997912317327
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.755741127348643
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.3014265831593598
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.18739039665970775
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.0961899791231733
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.755741127348643
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.9042797494780793
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.9369519832985386
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.9618997912317327
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.8659815477103893
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.8344031464360225
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.8361667009883983
name: Cosine Map@100
---
# SBERT base trained on BatuhanECB/FinModernBERT-pairs-sec-synthetic-v1
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/bert-base-nli-mean-tokens](https://huggingface.co/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 semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [sentence-transformers/bert-base-nli-mean-tokens](https://huggingface.co/sentence-transformers/bert-base-nli-mean-tokens) <!-- at revision 160a52b38a51ae87295ec3eabcf11755e5d27a8d -->
- **Maximum Sequence Length:** 128 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
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### 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:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("kokitabayashi/sbert_FinModernBERT_query")
# Run inference
queries = [
'What were the primary drivers for the increase in net income for the year ended December 31, 2021?',
]
documents = [
'The increase in net income was primarily due to (i) an increase in our operating profit and (ii) a decrease in other expenses, primarily due to foreign currency gains in the current period as compared to foreign currency losses in the prior-year period, partially offset by (a) an increase in depreciation, amortization and accretion expense, (b) an increase in other operating expense, primarily attributable to acquisition related costs associated with the Telxius Acquisition and the CoreSite Acquisition, and (c) an increase in the income tax provision.',
'In March 2006, AIG borrowed a total of $1.3 billion on an unsecured basis pursuant to loan agreements with third-party banks, of which $700 million remained outstanding on Decem- 70 AIG 2006 Form 10-K American International Group, Inc. and Subsidiaries ber 31, 2006; $500 million was repaid in February 2007, and the balance matures in March 2007.',
'Total modifications $ 1,017 $ 649 $ 2,655 $ 775 $ 5,120 $ 592',
]
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.7576, -0.0695, -0.0497]])
```
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
## Evaluation
### Metrics
#### Information Retrieval
* Dataset: `finance-eval`
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.sentence_transformer.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:----------|
| cosine_accuracy@1 | 0.7557 |
| cosine_accuracy@3 | 0.9043 |
| cosine_accuracy@5 | 0.937 |
| cosine_accuracy@10 | 0.9619 |
| cosine_precision@1 | 0.7557 |
| cosine_precision@3 | 0.3014 |
| cosine_precision@5 | 0.1874 |
| cosine_precision@10 | 0.0962 |
| cosine_recall@1 | 0.7557 |
| cosine_recall@3 | 0.9043 |
| cosine_recall@5 | 0.937 |
| cosine_recall@10 | 0.9619 |
| **cosine_ndcg@10** | **0.866** |
| cosine_mrr@10 | 0.8344 |
| cosine_map@100 | 0.8362 |
<!--
## Bias, Risks and Limitations
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->
<!--
### Recommendations
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->
## Training Details
### Training Dataset
#### fin_modern_bert-pairs-sec-synthetic-v1
* Dataset: fin_modern_bert-pairs-sec-synthetic-v1
* Size: 44,709 training samples
* Columns: <code>query</code> and <code>positive</code>
* Approximate statistics based on the first 100 samples:
| | query | positive |
|:---------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
| type | string | string |
| modality | text | text |
| details | <ul><li>min: 16 tokens</li><li>mean: 27.5 tokens</li><li>max: 44 tokens</li></ul> | <ul><li>min: 10 tokens</li><li>mean: 60.88 tokens</li><li>max: 128 tokens</li></ul> |
* Samples:
| query | positive |
|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <code>What was the total share-based compensation expense included in net income attributable to Biogen Inc. for the year ended December 31, 2015?</code> | <code>Share-based compensation expense included in net income attributable to Biogen Inc. $ 140.5 $ 170.2 $ 172.8 (For the Years Ended December 31, 2015 2014 2013)</code> |
| <code>What specific tax implications does the company face regarding its investment portfolio if the portfolio interest exemption on U.S. corporate debt is repealed?</code> | <code>The drafts would repeal the portfolio interest exemption on U.S. corporate debt, which could significantly increase tax liabilities on our investment portfolio or cause us to increase investment in non-U.S. corporate debt.</code> |
| <code>What specific organizational changes did the company undertake during fiscal 2013 to support its business initiatives?</code> | <code>Specifically, during fiscal 2013 we undertook organizational changes in order to address major business initiatives, including our desire to accelerate our move to the cloud, transform our customers' experience, increase industry focus to meet customer demands, and develop more effective marketing. These reorganizational efforts included changes to the structure and alignment of our product development and marketing teams and re-organization of our sales teams by industry.</code> |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"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
}
```
### Evaluation Dataset
#### fin_modern_bert-pairs-sec-synthetic-v1
* Dataset: fin_modern_bert-pairs-sec-synthetic-v1
* Size: 9,580 evaluation samples
* Columns: <code>query</code> and <code>positive</code>
* Approximate statistics based on the first 100 samples:
| | query | positive |
|:---------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
| type | string | string |
| modality | text | text |
| details | <ul><li>min: 16 tokens</li><li>mean: 27.52 tokens</li><li>max: 45 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 63.29 tokens</li><li>max: 128 tokens</li></ul> |
* Samples:
| query | positive |
|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <code>What are the potential consequences if the Federal Reserve determines that any of the company's Banks are not 'well-capitalized' or 'well-managed'?</code> | <code>If the Federal Reserve finds that any of our Banks is not “well-capitalized” or “well-managed,” we would be required to enter into an agreement with the Federal Reserve to comply with all applicable capital and management requirements, which may contain additional limitations or conditions relating to our activities.</code> |
| <code>What is the concentration of revenue from single customers within the electronic measurement business as of the end of fiscal 2007?</code> | <code>As of the end of fiscal 2007, no single customer represented greater than 10 percent of the net revenue of the business.</code> |
| <code>What are the specific requirements for Arch Insurance Europe to maintain its solvency margin in the U.K.?</code> | <code>The FSA requires that Arch Insurance Europe maintain a margin of solvency calculation based on the classes of business for which it is authorized and within its premium income projections applied to its worldwide general business.</code> |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"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
- `per_device_train_batch_size`: 64
- `num_train_epochs`: 1
- `warmup_steps`: 0.1
- `fp16`: True
- `per_device_eval_batch_size`: 64
- `dataloader_num_workers`: 2
- `batch_sampler`: no_duplicates
#### All Hyperparameters
<details><summary>Click to expand</summary>
- `per_device_train_batch_size`: 64
- `num_train_epochs`: 1
- `max_steps`: -1
- `learning_rate`: 5e-05
- `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`: False
- `fp16`: True
- `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`: True
- `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`: 64
- `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`: 42
- `data_seed`: None
- `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`: 2
- `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`: None
- `batch_sampler`: no_duplicates
- `multi_dataset_batch_sampler`: proportional
- `router_mapping`: {}
- `learning_rate_mapping`: {}
- `warmup_ratio`: None
</details>
### Training Logs
| Epoch | Step | Training Loss | Validation Loss | finance-eval_cosine_ndcg@10 |
|:------:|:----:|:-------------:|:---------------:|:---------------------------:|
| -1 | -1 | - | - | 0.2789 |
| 0.1431 | 100 | 0.4771 | 0.1072 | 0.7990 |
| 0.2861 | 200 | 0.1062 | 0.0731 | 0.8299 |
| 0.4292 | 300 | 0.0877 | 0.0570 | 0.8443 |
| 0.5722 | 400 | 0.0674 | 0.0488 | 0.8506 |
| 0.7153 | 500 | 0.0598 | 0.0436 | 0.8599 |
| 0.8584 | 600 | 0.0487 | 0.0404 | 0.8635 |
| 1.0 | 699 | - | 0.0384 | 0.8660 |
| -1 | -1 | - | - | 0.8660 |
### Training Time
- **Training**: 2.0 minutes
### Framework Versions
- Python: 3.13.16
- Sentence Transformers: 5.7.0
- Transformers: 5.21.0
- PyTorch: 2.11.0+cu130
- Accelerate: 1.15.0
- Datasets: 4.8.5
- Tokenizers: 0.23.3
## Additional Resources
- [Training and Finetuning Embedding Models with Sentence Transformers](https://huggingface.co/blog/train-sentence-transformers): the end-to-end guide for training or finetuning Sentence Transformer models.
- [Introduction to Matryoshka Embedding Models](https://huggingface.co/blog/matryoshka): variable-size embeddings that can be truncated with minimal quality loss.
- [Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper Retrieval](https://huggingface.co/blog/embedding-quantization): post-training compression of embedding vectors.
- [Multimodal Embedding & Reranker Models with Sentence Transformers](https://huggingface.co/blog/multimodal-sentence-transformers): use text, image, audio, and video models through the same API.
- [Training and Finetuning Multimodal Embedding & Reranker Models with Sentence Transformers](https://huggingface.co/blog/train-multimodal-sentence-transformers): train multimodal embedding models, with a Visual Document Retrieval walkthrough.
## Citation
### BibTeX
#### Sentence Transformers
```bibtex
@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
```bibtex
@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},
}
```
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->