Downloads · 30 days
10
9% of all-time downloads
ThuyNT03/bge-base-financial-matryoshka
bge-base-financial-matryoshka is a sentence similarity model from ThuyNT03. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
This is a sentence-transformers model finetuned from BAAI/bge-base-en-v1.5 on the json dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, s…
Downloads · 30 days
10
9% of all-time downloads
All-time downloads
111
Public
Parameters
109M
876 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This is a sentence-transformers model finetuned from BAAI/bge-base-en-v1.5 on the json dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': True, 'architecture': 'BertModel'})
(1): Pooling({'word_embedding_dimension': 768, '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()
)
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 = [
'Net write-off rate – principal only – Represents the amount of proprietary consumer or small business Card Member loans or receivables written off, consisting of principal (resulting from authorized transactions), less recoveries, as a percentage of the average loan or receivable balance during the period.',
"What does the term 'net write-off rate – principal only' refer to?",
"What operating system is used for the Company's iPhone line?",
]
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.9044, 0.1858],
# [0.9044, 1.0000, 0.1715],
# [0.1858, 0.1715, 1.0000]])
<!--
### 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.*
-->
dim_768{
"truncate_dim": 768
}
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.69 |
| cosine_accuracy@3 | 0.82 |
| cosine_accuracy@5 | 0.8614 |
| cosine_accuracy@10 | 0.9043 |
| cosine_precision@1 | 0.69 |
| cosine_precision@3 | 0.2733 |
| cosine_precision@5 | 0.1723 |
| cosine_precision@10 | 0.0904 |
| cosine_recall@1 | 0.69 |
| cosine_recall@3 | 0.82 |
| cosine_recall@5 | 0.8614 |
| cosine_recall@10 | 0.9043 |
| cosine_ndcg@10 | 0.797 |
| cosine_mrr@10 | 0.7627 |
| cosine_map@100 | 0.7663 |
dim_512{
"truncate_dim": 512
}
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.6814 |
| cosine_accuracy@3 | 0.8214 |
| cosine_accuracy@5 | 0.8657 |
| cosine_accuracy@10 | 0.9086 |
| cosine_precision@1 | 0.6814 |
| cosine_precision@3 | 0.2738 |
| cosine_precision@5 | 0.1731 |
| cosine_precision@10 | 0.0909 |
| cosine_recall@1 | 0.6814 |
| cosine_recall@3 | 0.8214 |
| cosine_recall@5 | 0.8657 |
| cosine_recall@10 | 0.9086 |
| cosine_ndcg@10 | 0.7963 |
| cosine_mrr@10 | 0.7602 |
| cosine_map@100 | 0.7635 |
dim_256{
"truncate_dim": 256
}
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.68 |
| cosine_accuracy@3 | 0.8186 |
| cosine_accuracy@5 | 0.8629 |
| cosine_accuracy@10 | 0.91 |
| cosine_precision@1 | 0.68 |
| cosine_precision@3 | 0.2729 |
| cosine_precision@5 | 0.1726 |
| cosine_precision@10 | 0.091 |
| cosine_recall@1 | 0.68 |
| cosine_recall@3 | 0.8186 |
| cosine_recall@5 | 0.8629 |
| cosine_recall@10 | 0.91 |
| cosine_ndcg@10 | 0.7944 |
| cosine_mrr@10 | 0.7573 |
| cosine_map@100 | 0.7603 |
dim_128{
"truncate_dim": 128
}
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.6614 |
| cosine_accuracy@3 | 0.8014 |
| cosine_accuracy@5 | 0.8471 |
| cosine_accuracy@10 | 0.8971 |
| cosine_precision@1 | 0.6614 |
| cosine_precision@3 | 0.2671 |
| cosine_precision@5 | 0.1694 |
| cosine_precision@10 | 0.0897 |
| cosine_recall@1 | 0.6614 |
| cosine_recall@3 | 0.8014 |
| cosine_recall@5 | 0.8471 |
| cosine_recall@10 | 0.8971 |
| cosine_ndcg@10 | 0.7792 |
| cosine_mrr@10 | 0.7415 |
| cosine_map@100 | 0.7452 |
dim_64{
"truncate_dim": 64
}
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.6514 |
| cosine_accuracy@3 | 0.7771 |
| cosine_accuracy@5 | 0.8086 |
| cosine_accuracy@10 | 0.87 |
| cosine_precision@1 | 0.6514 |
| cosine_precision@3 | 0.259 |
| cosine_precision@5 | 0.1617 |
| cosine_precision@10 | 0.087 |
| cosine_recall@1 | 0.6514 |
| cosine_recall@3 | 0.7771 |
| cosine_recall@5 | 0.8086 |
| cosine_recall@10 | 0.87 |
| cosine_ndcg@10 | 0.7583 |
| cosine_mrr@10 | 0.7229 |
| cosine_map@100 | 0.7277 |
| positive | anchor | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 4 tokens</li><li>mean: 47.53 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 20.3 tokens</li><li>max: 45 tokens</li></ul> |
| positive | anchor |
|---|---|
| <code>The report on the financial statements dated February 16, 2024, was conducted by PricewaterhouseCoopers LLP, a registered public accounting firm.</code> | <code>Who conducted the audit of the financial statements reported on February 16, 2024?</code> |
| <code>The term 'Part IV hereof' in the document refers to the section that directly precedes the consolidated financial statements.</code> | <code>What does 'Part IV hereof' refer to in the context of a document layout?</code> |
| <code>The Company believes that compensation should be competitive and equitable, and should enable employees to share in the Company’s success. The Company recognizes its people are most likely to thrive when they have the resources to meet their needs and the time and support to succeed in their professional and personal lives. In support of this, the Company offers a wide variety of benefits for employees around the world and invests in tools and resources that are designed to support employees’ individual growth and development.</code> | <code>What does Apple believe contributes significantly to employee thriving in professional and personal lives?</code> |
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": -1
}
eval_strategy: epochper_device_train_batch_size: 16per_device_eval_batch_size: 16gradient_accumulation_steps: 16learning_rate: 2e-05num_train_epochs: 4lr_scheduler_type: cosinewarmup_ratio: 0.1bf16: Truetf32: Falseload_best_model_at_end: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 16eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 4max_steps: -1lr_scheduler_type: cosinelr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falsebf16: Truefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Falselocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 | dim_128_cosine_ndcg@10 | dim_64_cosine_ndcg@10 |
|---|---|---|---|---|---|---|---|
| 0.0812 | 1 | 2.3727 | - | - | - | - | - |
| 0.1624 | 2 | 2.2415 | - | - | - | - | - |
| 0.2437 | 3 | 1.936 | - | - | - | - | - |
| 0.3249 | 4 | 1.7652 | - | - | - | - | - |
| 0.4061 | 5 | 1.7747 | - | - | - | - | - |
| 0.4873 | 6 | 1.8633 | - | - | - | - | - |
| 0.5685 | 7 | 1.2185 | - | - | - | - | - |
| 0.6497 | 8 | 1.1714 | - | - | - | - | - |
| 0.7310 | 9 | 1.2446 | - | - | - | - | - |
| 0.8122 | 10 | 0.8898 | - | - | - | - | - |
| 0.8934 | 11 | 0.7339 | - | - | - | - | - |
| 0.9746 | 12 | 0.9125 | - | - | - | - | - |
| 1.0 | 13 | 0.8029 | 0.7797 | 0.7832 | 0.7809 | 0.7678 | 0.7293 |
| 1.0812 | 14 | 0.8589 | - | - | - | - | - |
| 1.1624 | 15 | 0.6242 | - | - | - | - | - |
| 1.2437 | 16 | 0.5551 | - | - | - | - | - |
| 1.3249 | 17 | 0.531 | - | - | - | - | - |
| 1.4061 | 18 | 0.6005 | - | - | - | - | - |
| 1.4873 | 19 | 0.5804 | - | - | - | - | - |
| 1.5685 | 20 | 0.4858 | - | - | - | - | - |
| 1.6497 | 21 | 0.5477 | - | - | - | - | - |
| 1.7310 | 22 | 0.5264 | - | - | - | - | - |
| 1.8122 | 23 | 0.5103 | - | - | - | - | - |
| 1.8934 | 24 | 0.526 | - | - | - | - | - |
| 1.9746 | 25 | 0.5467 | - | - | - | - | - |
| 2.0 | 26 | 0.5616 | 0.7939 | 0.7914 | 0.7920 | 0.7771 | 0.7526 |
| 2.0812 | 27 | 0.3629 | - | - | - | - | - |
| 2.1624 | 28 | 0.5791 | - | - | - | - | - |
| 2.2437 | 29 | 0.3589 | - | - | - | - | - |
| 2.3249 | 30 | 0.4871 | - | - | - | - | - |
| 2.4061 | 31 | 0.4882 | - | - | - | - | - |
| 2.4873 | 32 | 0.4918 | - | - | - | - | - |
| 2.5685 | 33 | 0.5361 | - | - | - | - | - |
| 2.6497 | 34 | 0.3287 | - | - | - | - | - |
| 2.7310 | 35 | 0.4862 | - | - | - | - | - |
| 2.8122 | 36 | 0.4074 | - | - | - | - | - |
| 2.8934 | 37 | 0.3773 | - | - | - | - | - |
| 2.9746 | 38 | 0.5296 | - | - | - | - | - |
| 3.0 | 39 | 0.3996 | 0.7967 | 0.796 | 0.7939 | 0.78 | 0.7577 |
| 3.0812 | 40 | 0.4635 | - | - | - | - | - |
| 3.1624 | 41 | 0.5024 | - | - | - | - | - |
| 3.2437 | 42 | 0.2432 | - | - | - | - | - |
| 3.3249 | 43 | 0.3366 | - | - | - | - | - |
| 3.4061 | 44 | 0.3927 | - | - | - | - | - |
| 3.4873 | 45 | 0.383 | - | - | - | - | - |
| 3.5685 | 46 | 0.4662 | - | - | - | - | - |
| 3.6497 | 47 | 0.4321 | - | - | - | - | - |
| 3.7310 | 48 | 0.4524 | - | - | - | - | - |
| 3.8122 | 49 | 0.4118 | - | - | - | - | - |
| 3.8934 | 50 | 0.3569 | - | - | - | - | - |
| 3.9746 | 51 | 0.4397 | - | - | - | - | - |
| 4.0 | 52 | 0.3315 | 0.7970 | 0.7963 | 0.7944 | 0.7792 | 0.7583 |
@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",
}
@misc{kusupati2024matryoshka,
title={Matryoshka Representation Learning},
author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
year={2024},
eprint={2205.13147},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
<!--
## 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.*
-->