---
base_model: sentence-transformers/all-mpnet-base-v2
datasets: []
language:
- en
library_name: sentence-transformers
license: apache-2.0
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
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:169213
- loss:MatryoshkaLoss
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: This is bullshit. The US government requires taxes to be paid in
USD. There's your intrinsic value. If you want to be compliant with the federal
law, your business and you as an individual are required to convert assets or
labor into USD to pay them.
sentences:
- we love face paint melbourne
- how long to pay off debt
- what is the difference between us tax and mls
- source_sentence: '> There''s always another fresh-faced new grad with dollar
signs in his eyes who doesn''t know enough to ask about outstanding shares, dilution,
or preferences. They''ll learn soon enough. > Very few startups are looking
for penny-ante ''investor'' employees who can only put <$100k. You''ll probably
find that the majority of tech startups are looking for under $100k to get going.
Check out kickstarter.com sometime. > Actual employees are lucky if they can
properly value their options, let alone control how much it ends up being worth
in the end. If you''re asked to put in work without being fully compensated,
you are no longer an employee. You''re an investor. You need to change your way
of thinking.'
sentences:
- how much money is needed to start a company
- capital one interest rate
- can you transfer abc tax directly to a customer
- source_sentence: Let's suppose your friend gave your $100 and you invested all of
it (plus your own money, $500) into one stock. Therefore, the total investment
becomes $100 + $500 = $600. After few months, when you want to sell the stock
or give back the money to your friend, check the percentage of profit/loss. So,
let's assume you get 10% return on total investment of $600. Now, you have two
choices. Either you exit the stock entirely, OR you just sell his portion. If
you want to exit, sell everything and go home with $600 + 10% of 600 = $660. Out
of $660, give you friend his initial capital + 10% of initial capital. Therefore,
your friend will get $100 + 10% of $100 = $110. If you choose the later, to sell
his portion, then you'll need to work everything opposite. Take his initial capital
and add 10% of initial capital to it; which is $100 + 10% of $100 = $110. Sell
the stocks that would be worth equivalent to that money and that's it. Similarly,
you can apply the same logic if you broke his $100 into parts. Do the maths.
sentences:
- what do people think about getting a good job
- how to tell how much to sell a stock after buying one
- how to claim rrsp room allowance
- source_sentence: '"You''re acting like my comments are inconsistent. They''re not. I
think bitcoin''s price is primarily due to Chinese money being moved outside of
China. I don''t think you can point to a price chart and say ""Look, that''s the
Chinese money right there, and look, that part isn''t Chinese money"". That''s
what I said already."'
sentences:
- bitcoin price in china
- can i use tax act to file a spouse's tax
- what to look at if house sells for an appraiser?
- source_sentence: 'It''s simple, really: Practice. Fiscal responsibility is not a
trick you can learn look up on Google, or a service you can buy from your accountant. Being
responsible with your money is a skill that is learned over a lifetime. The only
way to get better at it is to practice, and not get discouraged when you make
mistakes.'
sentences:
- how long does it take for a loan to get paid interest
- whatsapp to use with a foreigner
- why do people have to be fiscally responsible
model-index:
- name: mpnet-base-financial-rag-matryoshka
results:
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 768
type: dim_768
metrics:
- type: cosine_accuracy@1
value: 0.1809635722679201
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.4935370152761457
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.5734430082256169
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.663924794359577
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.1809635722679201
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.1645123384253819
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.11468860164512337
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.06639247943595769
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.1809635722679201
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.4935370152761457
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.5734430082256169
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.663924794359577
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.41746626575107176
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.33849252979687783
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.3464380043472146
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 512
type: dim_512
metrics:
- type: cosine_accuracy@1
value: 0.19036427732079905
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.4900117508813161
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.5687426556991775
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.6533490011750881
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.19036427732079905
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.16333725029377202
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.11374853113983546
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.06533490011750881
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.19036427732079905
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.4900117508813161
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.5687426556991775
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.6533490011750881
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.4174472433498665
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.3417030384421691
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.35038294448729146
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 256
type: dim_256
metrics:
- type: cosine_accuracy@1
value: 0.1797884841363102
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.47473560517038776
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.54524089306698
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.6439482961222092
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.1797884841363102
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.15824520172346257
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.10904817861339598
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.06439482961222091
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.1797884841363102
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.47473560517038776
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.54524089306698
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.6439482961222092
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.4067526935952037
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.3308208829947965
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.33951940009649473
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 128
type: dim_128
metrics:
- type: cosine_accuracy@1
value: 0.18566392479435959
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.4535840188014101
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.5240893066980024
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.6216216216216216
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.18566392479435959
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.15119467293380337
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.10481786133960047
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.06216216216216215
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.18566392479435959
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.4535840188014101
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.5240893066980024
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.6216216216216216
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.39600584846785714
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.324298211254733
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.33327512340163784
name: Cosine Map@100
- task:
type: information-retrieval
name: Information Retrieval
dataset:
name: dim 64
type: dim_64
metrics:
- type: cosine_accuracy@1
value: 0.16333725029377202
name: Cosine Accuracy@1
- type: cosine_accuracy@3
value: 0.42420681551116335
name: Cosine Accuracy@3
- type: cosine_accuracy@5
value: 0.491186839012926
name: Cosine Accuracy@5
- type: cosine_accuracy@10
value: 0.5781433607520564
name: Cosine Accuracy@10
- type: cosine_precision@1
value: 0.16333725029377202
name: Cosine Precision@1
- type: cosine_precision@3
value: 0.14140227183705445
name: Cosine Precision@3
- type: cosine_precision@5
value: 0.09823736780258518
name: Cosine Precision@5
- type: cosine_precision@10
value: 0.05781433607520563
name: Cosine Precision@10
- type: cosine_recall@1
value: 0.16333725029377202
name: Cosine Recall@1
- type: cosine_recall@3
value: 0.42420681551116335
name: Cosine Recall@3
- type: cosine_recall@5
value: 0.491186839012926
name: Cosine Recall@5
- type: cosine_recall@10
value: 0.5781433607520564
name: Cosine Recall@10
- type: cosine_ndcg@10
value: 0.36616361619562976
name: Cosine Ndcg@10
- type: cosine_mrr@10
value: 0.2984467386641303
name: Cosine Mrr@10
- type: cosine_map@100
value: 0.3078022299669783
name: Cosine Map@100
---
# mpnet-base-financial-rag-matryoshka
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2). 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.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [sentence-transformers/all-mpnet-base-v2](https://huggingface.co/sentence-transformers/all-mpnet-base-v2)
- **Maximum Sequence Length:** 384 tokens
- **Output Dimensionality:** 768 tokens
- **Similarity Function:** Cosine Similarity
- **Language:** en
- **License:** apache-2.0
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'max_seq_length': 384, 'do_lower_case': False}) with Transformer model: MPNetModel
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, '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()
)
```
## 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("rbhatia46/mpnet-base-financial-rag-matryoshka")
# Run inference
sentences = [
"It's simple, really: Practice. Fiscal responsibility is not a trick you can learn look up on Google, or a service you can buy from your accountant. Being responsible with your money is a skill that is learned over a lifetime. The only way to get better at it is to practice, and not get discouraged when you make mistakes.",
'why do people have to be fiscally responsible',
'how long does it take for a loan to get paid interest',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```
## Evaluation
### Metrics
#### Information Retrieval
* Dataset: `dim_768`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.181 |
| cosine_accuracy@3 | 0.4935 |
| cosine_accuracy@5 | 0.5734 |
| cosine_accuracy@10 | 0.6639 |
| cosine_precision@1 | 0.181 |
| cosine_precision@3 | 0.1645 |
| cosine_precision@5 | 0.1147 |
| cosine_precision@10 | 0.0664 |
| cosine_recall@1 | 0.181 |
| cosine_recall@3 | 0.4935 |
| cosine_recall@5 | 0.5734 |
| cosine_recall@10 | 0.6639 |
| cosine_ndcg@10 | 0.4175 |
| cosine_mrr@10 | 0.3385 |
| **cosine_map@100** | **0.3464** |
#### Information Retrieval
* Dataset: `dim_512`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.1904 |
| cosine_accuracy@3 | 0.49 |
| cosine_accuracy@5 | 0.5687 |
| cosine_accuracy@10 | 0.6533 |
| cosine_precision@1 | 0.1904 |
| cosine_precision@3 | 0.1633 |
| cosine_precision@5 | 0.1137 |
| cosine_precision@10 | 0.0653 |
| cosine_recall@1 | 0.1904 |
| cosine_recall@3 | 0.49 |
| cosine_recall@5 | 0.5687 |
| cosine_recall@10 | 0.6533 |
| cosine_ndcg@10 | 0.4174 |
| cosine_mrr@10 | 0.3417 |
| **cosine_map@100** | **0.3504** |
#### Information Retrieval
* Dataset: `dim_256`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.1798 |
| cosine_accuracy@3 | 0.4747 |
| cosine_accuracy@5 | 0.5452 |
| cosine_accuracy@10 | 0.6439 |
| cosine_precision@1 | 0.1798 |
| cosine_precision@3 | 0.1582 |
| cosine_precision@5 | 0.109 |
| cosine_precision@10 | 0.0644 |
| cosine_recall@1 | 0.1798 |
| cosine_recall@3 | 0.4747 |
| cosine_recall@5 | 0.5452 |
| cosine_recall@10 | 0.6439 |
| cosine_ndcg@10 | 0.4068 |
| cosine_mrr@10 | 0.3308 |
| **cosine_map@100** | **0.3395** |
#### Information Retrieval
* Dataset: `dim_128`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.1857 |
| cosine_accuracy@3 | 0.4536 |
| cosine_accuracy@5 | 0.5241 |
| cosine_accuracy@10 | 0.6216 |
| cosine_precision@1 | 0.1857 |
| cosine_precision@3 | 0.1512 |
| cosine_precision@5 | 0.1048 |
| cosine_precision@10 | 0.0622 |
| cosine_recall@1 | 0.1857 |
| cosine_recall@3 | 0.4536 |
| cosine_recall@5 | 0.5241 |
| cosine_recall@10 | 0.6216 |
| cosine_ndcg@10 | 0.396 |
| cosine_mrr@10 | 0.3243 |
| **cosine_map@100** | **0.3333** |
#### Information Retrieval
* Dataset: `dim_64`
* Evaluated with [InformationRetrievalEvaluator
](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
| Metric | Value |
|:--------------------|:-----------|
| cosine_accuracy@1 | 0.1633 |
| cosine_accuracy@3 | 0.4242 |
| cosine_accuracy@5 | 0.4912 |
| cosine_accuracy@10 | 0.5781 |
| cosine_precision@1 | 0.1633 |
| cosine_precision@3 | 0.1414 |
| cosine_precision@5 | 0.0982 |
| cosine_precision@10 | 0.0578 |
| cosine_recall@1 | 0.1633 |
| cosine_recall@3 | 0.4242 |
| cosine_recall@5 | 0.4912 |
| cosine_recall@10 | 0.5781 |
| cosine_ndcg@10 | 0.3662 |
| cosine_mrr@10 | 0.2984 |
| **cosine_map@100** | **0.3078** |
## Training Details
### Training Dataset
#### Unnamed Dataset
* Size: 169,213 training samples
* Columns: positive
and anchor
* Approximate statistics based on the first 1000 samples:
| | positive | anchor |
|:--------|:------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string |
| details |
International Trade, the exchange of goods and services between nations. “Goods” can be defined as finished products, as intermediate goods used in producing other goods, or as raw materials such as minerals, agricultural products, and other such commodities. International trade commerce enables a nation to specialize in those goods it can produce most cheaply and efficiently, and sell those that are surplus to its requirements. Trade also enables a country to consume more than it would be able to produce if it depended only on its own resources. Finally, trade encourages economic development by increasing the size of the market to which products can be sold. Trade has always been the major force behind the economic relations among nations; it is a measure of national strength.
| what does international trade
|
| My wife and I meet in the first few days of each month to create a budget for the coming month. During that meeting we reconcile any spending for the previous month and make sure the amount money in our accounts matches the amount of money in our budget record to the penny. (We use an excel spreadsheet, how you track it matters less than the need to track it and see how much you spent in each category during the previous month.) After we have have reviewed the previous month's spending, we allocate money we made during that previous month to each of the categories. What categories you track and how granular you are is less important than regularly seeing how much you spend so that you can evaluate whether your spending is really matching your priorities. We keep a running total for each category so if we go over on groceries one month, then the following month we have to add more to bring the category back to black as well as enough for our anticipated needs in the coming month. If there is one category that we are consistently underestimating (or overestimating) we talk about why. If there are large purchases that we are planning in the coming month, or even in a few months, we talk about them, why we want them, and we talk about how much we're planning to spend. If we want a new TV or to go on a trip, we may start adding money to the category with no plans to spend in the coming month. The biggest benefit to this process has been that we don't make a lot of impulse purchases, or if we do, they are for small dollar amounts. The simple need to explain what I want and why means I have to put the thought into it myself, and I talk myself out of a lot of purchases during that train of thought. The time spent regularly evaluating what we get for our money has cut waste that wasn't really bringing much happiness. We still buy what we want, but we agree that we want it first.
| how to make a budget
|
| I just finished my bachelor and I'm doing my masters in Computer Science at a french school in Quebec. I consider myself being in the top 5% and I have an excellent curriculum, having studied abroad, learned 4 languages, participated in student committees, etc. I'm leaning towards IT or business strategy/development...but I'm not sure yet. I guess I'm not that prepared, that's why I wanted a little help.
| what school do you want to attend for a masters
|
* Loss: [MatryoshkaLoss
](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
```json
{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
768,
512,
256,
128,
64
],
"matryoshka_weights": [
1,
1,
1,
1,
1
],
"n_dims_per_step": -1
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `eval_strategy`: epoch
- `per_device_train_batch_size`: 32
- `per_device_eval_batch_size`: 16
- `gradient_accumulation_steps`: 16
- `learning_rate`: 2e-05
- `num_train_epochs`: 10
- `lr_scheduler_type`: cosine
- `warmup_ratio`: 0.1
- `bf16`: True
- `tf32`: True
- `load_best_model_at_end`: True
- `optim`: adamw_torch_fused
- `batch_sampler`: no_duplicates
#### All Hyperparameters