Sentence Similarity
sentence-transformers
Safetensors
bert
feature-extraction
dense
Generated from Trainer
dataset_size:111470
loss:MultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use redis/model-b-structured with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use redis/model-b-structured with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("redis/model-b-structured") sentences = [ "when was the first elephant brought to america", "Old Bet The first elephant brought to the United States was in 1796, aboard the America which set sail from Calcutta for New York on December 3, 1795.[4] However, it is not certain that this was Old Bet.[2] The first references to Old Bet start in 1804 in Boston as part of a menagerie.[1] In 1808, while residing in Somers, New York, Hachaliah Bailey purchased the menagerie elephant for $1,000 and named it \"Old Bet\".[5][6]", "Cronus Rhea secretly gave birth to Zeus in Crete, and handed Cronus a stone wrapped in swaddling clothes, also known as the Omphalos Stone, which he promptly swallowed, thinking that it was his son.", "Renal artery One or two accessory renal arteries are frequently found, especially on the left side since they usually arise from the aorta, and may come off above (more common) or below the main artery. Instead of entering the kidney at the hilus, they usually pierce the upper or lower part of the organ." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Add new SentenceTransformer model
Browse files
README.md
CHANGED
|
@@ -5,41 +5,42 @@ tags:
|
|
| 5 |
- feature-extraction
|
| 6 |
- dense
|
| 7 |
- generated_from_trainer
|
| 8 |
-
- dataset_size:
|
| 9 |
- loss:MultipleNegativesRankingLoss
|
| 10 |
base_model: sentence-transformers/all-MiniLM-L6-v2
|
| 11 |
widget:
|
| 12 |
-
- source_sentence:
|
|
|
|
| 13 |
sentences:
|
| 14 |
-
-
|
| 15 |
-
|
| 16 |
-
-
|
| 17 |
-
-
|
| 18 |
-
|
|
|
|
| 19 |
sentences:
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
-
|
| 23 |
-
-
|
| 24 |
-
|
|
|
|
| 25 |
sentences:
|
| 26 |
-
- How
|
| 27 |
-
|
| 28 |
-
-
|
| 29 |
-
|
| 30 |
-
- Are there any platforms that provides end-to-end encryption for file transfer/
|
| 31 |
-
sharing?
|
| 32 |
-
- source_sentence: Why AAP’s MLA Dinesh Mohaniya has been arrested?
|
| 33 |
sentences:
|
| 34 |
-
-
|
| 35 |
-
- What is
|
| 36 |
-
-
|
| 37 |
-
- source_sentence:
|
|
|
|
| 38 |
sentences:
|
| 39 |
-
-
|
| 40 |
-
|
| 41 |
-
-
|
| 42 |
-
|
| 43 |
pipeline_tag: sentence-similarity
|
| 44 |
library_name: sentence-transformers
|
| 45 |
metrics:
|
|
@@ -69,49 +70,49 @@ model-index:
|
|
| 69 |
type: NanoMSMARCO
|
| 70 |
metrics:
|
| 71 |
- type: cosine_accuracy@1
|
| 72 |
-
value: 0.
|
| 73 |
name: Cosine Accuracy@1
|
| 74 |
- type: cosine_accuracy@3
|
| 75 |
-
value: 0.
|
| 76 |
name: Cosine Accuracy@3
|
| 77 |
- type: cosine_accuracy@5
|
| 78 |
-
value: 0.
|
| 79 |
name: Cosine Accuracy@5
|
| 80 |
- type: cosine_accuracy@10
|
| 81 |
-
value: 0.
|
| 82 |
name: Cosine Accuracy@10
|
| 83 |
- type: cosine_precision@1
|
| 84 |
-
value: 0.
|
| 85 |
name: Cosine Precision@1
|
| 86 |
- type: cosine_precision@3
|
| 87 |
-
value: 0.
|
| 88 |
name: Cosine Precision@3
|
| 89 |
- type: cosine_precision@5
|
| 90 |
-
value: 0.
|
| 91 |
name: Cosine Precision@5
|
| 92 |
- type: cosine_precision@10
|
| 93 |
-
value: 0.
|
| 94 |
name: Cosine Precision@10
|
| 95 |
- type: cosine_recall@1
|
| 96 |
-
value: 0.
|
| 97 |
name: Cosine Recall@1
|
| 98 |
- type: cosine_recall@3
|
| 99 |
-
value: 0.
|
| 100 |
name: Cosine Recall@3
|
| 101 |
- type: cosine_recall@5
|
| 102 |
-
value: 0.
|
| 103 |
name: Cosine Recall@5
|
| 104 |
- type: cosine_recall@10
|
| 105 |
-
value: 0.
|
| 106 |
name: Cosine Recall@10
|
| 107 |
- type: cosine_ndcg@10
|
| 108 |
-
value: 0.
|
| 109 |
name: Cosine Ndcg@10
|
| 110 |
- type: cosine_mrr@10
|
| 111 |
-
value: 0.
|
| 112 |
name: Cosine Mrr@10
|
| 113 |
- type: cosine_map@100
|
| 114 |
-
value: 0.
|
| 115 |
name: Cosine Map@100
|
| 116 |
- task:
|
| 117 |
type: information-retrieval
|
|
@@ -121,49 +122,49 @@ model-index:
|
|
| 121 |
type: NanoNQ
|
| 122 |
metrics:
|
| 123 |
- type: cosine_accuracy@1
|
| 124 |
-
value: 0.
|
| 125 |
name: Cosine Accuracy@1
|
| 126 |
- type: cosine_accuracy@3
|
| 127 |
-
value: 0.
|
| 128 |
name: Cosine Accuracy@3
|
| 129 |
- type: cosine_accuracy@5
|
| 130 |
-
value: 0.
|
| 131 |
name: Cosine Accuracy@5
|
| 132 |
- type: cosine_accuracy@10
|
| 133 |
-
value: 0.
|
| 134 |
name: Cosine Accuracy@10
|
| 135 |
- type: cosine_precision@1
|
| 136 |
-
value: 0.
|
| 137 |
name: Cosine Precision@1
|
| 138 |
- type: cosine_precision@3
|
| 139 |
-
value: 0.
|
| 140 |
name: Cosine Precision@3
|
| 141 |
- type: cosine_precision@5
|
| 142 |
-
value: 0.
|
| 143 |
name: Cosine Precision@5
|
| 144 |
- type: cosine_precision@10
|
| 145 |
-
value: 0.
|
| 146 |
name: Cosine Precision@10
|
| 147 |
- type: cosine_recall@1
|
| 148 |
-
value: 0.
|
| 149 |
name: Cosine Recall@1
|
| 150 |
- type: cosine_recall@3
|
| 151 |
-
value: 0.
|
| 152 |
name: Cosine Recall@3
|
| 153 |
- type: cosine_recall@5
|
| 154 |
-
value: 0.
|
| 155 |
name: Cosine Recall@5
|
| 156 |
- type: cosine_recall@10
|
| 157 |
-
value: 0.
|
| 158 |
name: Cosine Recall@10
|
| 159 |
- type: cosine_ndcg@10
|
| 160 |
-
value: 0.
|
| 161 |
name: Cosine Ndcg@10
|
| 162 |
- type: cosine_mrr@10
|
| 163 |
-
value: 0.
|
| 164 |
name: Cosine Mrr@10
|
| 165 |
- type: cosine_map@100
|
| 166 |
-
value: 0.
|
| 167 |
name: Cosine Map@100
|
| 168 |
- task:
|
| 169 |
type: nano-beir
|
|
@@ -173,49 +174,49 @@ model-index:
|
|
| 173 |
type: NanoBEIR_mean
|
| 174 |
metrics:
|
| 175 |
- type: cosine_accuracy@1
|
| 176 |
-
value: 0.
|
| 177 |
name: Cosine Accuracy@1
|
| 178 |
- type: cosine_accuracy@3
|
| 179 |
-
value: 0.
|
| 180 |
name: Cosine Accuracy@3
|
| 181 |
- type: cosine_accuracy@5
|
| 182 |
-
value: 0.
|
| 183 |
name: Cosine Accuracy@5
|
| 184 |
- type: cosine_accuracy@10
|
| 185 |
-
value: 0.
|
| 186 |
name: Cosine Accuracy@10
|
| 187 |
- type: cosine_precision@1
|
| 188 |
-
value: 0.
|
| 189 |
name: Cosine Precision@1
|
| 190 |
- type: cosine_precision@3
|
| 191 |
-
value: 0.
|
| 192 |
name: Cosine Precision@3
|
| 193 |
- type: cosine_precision@5
|
| 194 |
-
value: 0.
|
| 195 |
name: Cosine Precision@5
|
| 196 |
- type: cosine_precision@10
|
| 197 |
-
value: 0.
|
| 198 |
name: Cosine Precision@10
|
| 199 |
- type: cosine_recall@1
|
| 200 |
-
value: 0.
|
| 201 |
name: Cosine Recall@1
|
| 202 |
- type: cosine_recall@3
|
| 203 |
-
value: 0.
|
| 204 |
name: Cosine Recall@3
|
| 205 |
- type: cosine_recall@5
|
| 206 |
-
value: 0.
|
| 207 |
name: Cosine Recall@5
|
| 208 |
- type: cosine_recall@10
|
| 209 |
-
value: 0.
|
| 210 |
name: Cosine Recall@10
|
| 211 |
- type: cosine_ndcg@10
|
| 212 |
-
value: 0.
|
| 213 |
name: Cosine Ndcg@10
|
| 214 |
- type: cosine_mrr@10
|
| 215 |
-
value: 0.
|
| 216 |
name: Cosine Mrr@10
|
| 217 |
- type: cosine_map@100
|
| 218 |
-
value: 0.
|
| 219 |
name: Cosine Map@100
|
| 220 |
---
|
| 221 |
|
|
@@ -269,9 +270,9 @@ from sentence_transformers import SentenceTransformer
|
|
| 269 |
model = SentenceTransformer("redis/model-b-structured")
|
| 270 |
# Run inference
|
| 271 |
sentences = [
|
| 272 |
-
'
|
| 273 |
-
'
|
| 274 |
-
'
|
| 275 |
]
|
| 276 |
embeddings = model.encode(sentences)
|
| 277 |
print(embeddings.shape)
|
|
@@ -280,9 +281,9 @@ print(embeddings.shape)
|
|
| 280 |
# Get the similarity scores for the embeddings
|
| 281 |
similarities = model.similarity(embeddings, embeddings)
|
| 282 |
print(similarities)
|
| 283 |
-
# tensor([[
|
| 284 |
-
# [
|
| 285 |
-
# [
|
| 286 |
```
|
| 287 |
|
| 288 |
<!--
|
|
@@ -318,23 +319,23 @@ You can finetune this model on your own dataset.
|
|
| 318 |
* Datasets: `NanoMSMARCO` and `NanoNQ`
|
| 319 |
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
| 320 |
|
| 321 |
-
| Metric | NanoMSMARCO | NanoNQ
|
| 322 |
-
|:--------------------|:------------|:----------|
|
| 323 |
-
| cosine_accuracy@1 | 0.
|
| 324 |
-
| cosine_accuracy@3 | 0.
|
| 325 |
-
| cosine_accuracy@5 | 0.
|
| 326 |
-
| cosine_accuracy@10 | 0.
|
| 327 |
-
| cosine_precision@1 | 0.
|
| 328 |
-
| cosine_precision@3 | 0.
|
| 329 |
-
| cosine_precision@5 | 0.
|
| 330 |
-
| cosine_precision@10 | 0.
|
| 331 |
-
| cosine_recall@1 | 0.
|
| 332 |
-
| cosine_recall@3 | 0.
|
| 333 |
-
| cosine_recall@5 | 0.
|
| 334 |
-
| cosine_recall@10 | 0.
|
| 335 |
-
| **cosine_ndcg@10** | **0.
|
| 336 |
-
| cosine_mrr@10 | 0.
|
| 337 |
-
| cosine_map@100 | 0.
|
| 338 |
|
| 339 |
#### Nano BEIR
|
| 340 |
|
|
@@ -352,21 +353,21 @@ You can finetune this model on your own dataset.
|
|
| 352 |
|
| 353 |
| Metric | Value |
|
| 354 |
|:--------------------|:-----------|
|
| 355 |
-
| cosine_accuracy@1 | 0.
|
| 356 |
-
| cosine_accuracy@3 | 0.
|
| 357 |
-
| cosine_accuracy@5 | 0.
|
| 358 |
-
| cosine_accuracy@10 | 0.
|
| 359 |
-
| cosine_precision@1 | 0.
|
| 360 |
-
| cosine_precision@3 | 0.
|
| 361 |
-
| cosine_precision@5 | 0.
|
| 362 |
-
| cosine_precision@10 | 0.
|
| 363 |
-
| cosine_recall@1 | 0.
|
| 364 |
-
| cosine_recall@3 | 0.
|
| 365 |
-
| cosine_recall@5 | 0.
|
| 366 |
-
| cosine_recall@10 | 0.
|
| 367 |
-
| **cosine_ndcg@10** | **0.
|
| 368 |
-
| cosine_mrr@10 | 0.
|
| 369 |
-
| cosine_map@100 | 0.
|
| 370 |
|
| 371 |
<!--
|
| 372 |
## Bias, Risks and Limitations
|
|
@@ -386,19 +387,19 @@ You can finetune this model on your own dataset.
|
|
| 386 |
|
| 387 |
#### Unnamed Dataset
|
| 388 |
|
| 389 |
-
* Size:
|
| 390 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 391 |
* Approximate statistics based on the first 1000 samples:
|
| 392 |
| | anchor | positive | negative |
|
| 393 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 394 |
| type | string | string | string |
|
| 395 |
-
| details | <ul><li>min: 6 tokens</li><li>mean: 16.
|
| 396 |
* Samples:
|
| 397 |
-
| anchor
|
| 398 |
-
|:-------------------------------------------------------------------------------
|
| 399 |
-
| <code>
|
| 400 |
-
| <code>
|
| 401 |
-
| <code>
|
| 402 |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 403 |
```json
|
| 404 |
{
|
|
@@ -412,19 +413,19 @@ You can finetune this model on your own dataset.
|
|
| 412 |
|
| 413 |
#### Unnamed Dataset
|
| 414 |
|
| 415 |
-
* Size:
|
| 416 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 417 |
* Approximate statistics based on the first 1000 samples:
|
| 418 |
| | anchor | positive | negative |
|
| 419 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 420 |
| type | string | string | string |
|
| 421 |
-
| details | <ul><li>min: 6 tokens</li><li>mean:
|
| 422 |
* Samples:
|
| 423 |
-
| anchor
|
| 424 |
-
|:------------------------------------------------------------------------------------------------------------------------------------
|
| 425 |
-
| <code>
|
| 426 |
-
| <code>
|
| 427 |
-
| <code>
|
| 428 |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 429 |
```json
|
| 430 |
{
|
|
@@ -442,7 +443,7 @@ You can finetune this model on your own dataset.
|
|
| 442 |
- `per_device_eval_batch_size`: 128
|
| 443 |
- `learning_rate`: 2e-05
|
| 444 |
- `weight_decay`: 0.0001
|
| 445 |
-
- `max_steps`:
|
| 446 |
- `warmup_ratio`: 0.1
|
| 447 |
- `fp16`: True
|
| 448 |
- `dataloader_drop_last`: True
|
|
@@ -476,7 +477,7 @@ You can finetune this model on your own dataset.
|
|
| 476 |
- `adam_epsilon`: 1e-08
|
| 477 |
- `max_grad_norm`: 1.0
|
| 478 |
- `num_train_epochs`: 3.0
|
| 479 |
-
- `max_steps`:
|
| 480 |
- `lr_scheduler_type`: linear
|
| 481 |
- `lr_scheduler_kwargs`: {}
|
| 482 |
- `warmup_ratio`: 0.1
|
|
@@ -583,27 +584,19 @@ You can finetune this model on your own dataset.
|
|
| 583 |
### Training Logs
|
| 584 |
| Epoch | Step | Training Loss | Validation Loss | NanoMSMARCO_cosine_ndcg@10 | NanoNQ_cosine_ndcg@10 | NanoBEIR_mean_cosine_ndcg@10 |
|
| 585 |
|:------:|:----:|:-------------:|:---------------:|:--------------------------:|:---------------------:|:----------------------------:|
|
| 586 |
-
| 0 | 0 | - | 0.
|
| 587 |
-
| 0.
|
| 588 |
-
| 0.
|
| 589 |
-
| 0.
|
| 590 |
-
|
|
| 591 |
-
|
|
| 592 |
-
|
|
| 593 |
-
|
|
| 594 |
-
|
|
| 595 |
-
|
|
| 596 |
-
|
|
| 597 |
-
|
|
| 598 |
-
|
|
| 599 |
-
| 0.5829 | 3250 | 0.4722 | 0.3786 | 0.4588 | 0.4458 | 0.4523 |
|
| 600 |
-
| 0.6277 | 3500 | 0.4725 | 0.3774 | 0.4587 | 0.4537 | 0.4562 |
|
| 601 |
-
| 0.6725 | 3750 | 0.4692 | 0.3766 | 0.4561 | 0.4621 | 0.4591 |
|
| 602 |
-
| 0.7174 | 4000 | 0.4664 | 0.3763 | 0.4584 | 0.4395 | 0.4489 |
|
| 603 |
-
| 0.7622 | 4250 | 0.4659 | 0.3747 | 0.4645 | 0.4586 | 0.4616 |
|
| 604 |
-
| 0.8070 | 4500 | 0.464 | 0.3742 | 0.4619 | 0.4479 | 0.4549 |
|
| 605 |
-
| 0.8519 | 4750 | 0.4662 | 0.3739 | 0.4590 | 0.4498 | 0.4544 |
|
| 606 |
-
| 0.8967 | 5000 | 0.4662 | 0.3739 | 0.4590 | 0.4620 | 0.4605 |
|
| 607 |
|
| 608 |
|
| 609 |
### Framework Versions
|
|
|
|
| 5 |
- feature-extraction
|
| 6 |
- dense
|
| 7 |
- generated_from_trainer
|
| 8 |
+
- dataset_size:111468
|
| 9 |
- loss:MultipleNegativesRankingLoss
|
| 10 |
base_model: sentence-transformers/all-MiniLM-L6-v2
|
| 11 |
widget:
|
| 12 |
+
- source_sentence: What is something you do (or don’t do), even though you feel conflicted
|
| 13 |
+
about it?
|
| 14 |
sentences:
|
| 15 |
+
- What is something you do (or don’t do), even though you feel conflicted about
|
| 16 |
+
it?
|
| 17 |
+
- Is it worth buying the iPhone 7?
|
| 18 |
+
- 'Hypothetical scenarios: King Henry VIII loses his battle with James IV in 1513
|
| 19 |
+
& dies; Pope Julius II doesn''t die in 1513. How''s the world different?'
|
| 20 |
+
- source_sentence: Exams for a mechanical engineer?
|
| 21 |
sentences:
|
| 22 |
+
- Exams for a mechanical engineer?
|
| 23 |
+
- Can you prefer any website or ideas by which I can understand antenna subject
|
| 24 |
+
practically in b.tech?
|
| 25 |
+
- Mackenzie is a writer-in-residence at the 2B Theatre in Halifax and teaches at
|
| 26 |
+
the National Theatre School of Canada in Montreal .
|
| 27 |
+
- source_sentence: What will a Christian wife do if her husband left her for years?
|
| 28 |
sentences:
|
| 29 |
+
- How many United States Presidents have there been?
|
| 30 |
+
- What is planning without words?
|
| 31 |
+
- What will a Christian wife do if her husband left her for years?
|
| 32 |
+
- source_sentence: How do I research for MUN?
|
|
|
|
|
|
|
|
|
|
| 33 |
sentences:
|
| 34 |
+
- How do I research for MUN?
|
| 35 |
+
- What is the best way to be an investment banker?
|
| 36 |
+
- What is the best way to do an MUN research?
|
| 37 |
+
- source_sentence: I am poor, ugly, untalented, 20 years old, and have big dreams.
|
| 38 |
+
How can I succeed in life?
|
| 39 |
sentences:
|
| 40 |
+
- What app can I use taking notes?
|
| 41 |
+
- Am I too old to succeed in my life at age 32?
|
| 42 |
+
- I am poor, ugly, untalented, 20 years old, and have big dreams. How can I succeed
|
| 43 |
+
in life?
|
| 44 |
pipeline_tag: sentence-similarity
|
| 45 |
library_name: sentence-transformers
|
| 46 |
metrics:
|
|
|
|
| 70 |
type: NanoMSMARCO
|
| 71 |
metrics:
|
| 72 |
- type: cosine_accuracy@1
|
| 73 |
+
value: 0.28
|
| 74 |
name: Cosine Accuracy@1
|
| 75 |
- type: cosine_accuracy@3
|
| 76 |
+
value: 0.38
|
| 77 |
name: Cosine Accuracy@3
|
| 78 |
- type: cosine_accuracy@5
|
| 79 |
+
value: 0.42
|
| 80 |
name: Cosine Accuracy@5
|
| 81 |
- type: cosine_accuracy@10
|
| 82 |
+
value: 0.56
|
| 83 |
name: Cosine Accuracy@10
|
| 84 |
- type: cosine_precision@1
|
| 85 |
+
value: 0.28
|
| 86 |
name: Cosine Precision@1
|
| 87 |
- type: cosine_precision@3
|
| 88 |
+
value: 0.12666666666666665
|
| 89 |
name: Cosine Precision@3
|
| 90 |
- type: cosine_precision@5
|
| 91 |
+
value: 0.084
|
| 92 |
name: Cosine Precision@5
|
| 93 |
- type: cosine_precision@10
|
| 94 |
+
value: 0.05600000000000001
|
| 95 |
name: Cosine Precision@10
|
| 96 |
- type: cosine_recall@1
|
| 97 |
+
value: 0.28
|
| 98 |
name: Cosine Recall@1
|
| 99 |
- type: cosine_recall@3
|
| 100 |
+
value: 0.38
|
| 101 |
name: Cosine Recall@3
|
| 102 |
- type: cosine_recall@5
|
| 103 |
+
value: 0.42
|
| 104 |
name: Cosine Recall@5
|
| 105 |
- type: cosine_recall@10
|
| 106 |
+
value: 0.56
|
| 107 |
name: Cosine Recall@10
|
| 108 |
- type: cosine_ndcg@10
|
| 109 |
+
value: 0.4001173610020243
|
| 110 |
name: Cosine Ndcg@10
|
| 111 |
- type: cosine_mrr@10
|
| 112 |
+
value: 0.3516904761904761
|
| 113 |
name: Cosine Mrr@10
|
| 114 |
- type: cosine_map@100
|
| 115 |
+
value: 0.37336992686291426
|
| 116 |
name: Cosine Map@100
|
| 117 |
- task:
|
| 118 |
type: information-retrieval
|
|
|
|
| 122 |
type: NanoNQ
|
| 123 |
metrics:
|
| 124 |
- type: cosine_accuracy@1
|
| 125 |
+
value: 0.24
|
| 126 |
name: Cosine Accuracy@1
|
| 127 |
- type: cosine_accuracy@3
|
| 128 |
+
value: 0.32
|
| 129 |
name: Cosine Accuracy@3
|
| 130 |
- type: cosine_accuracy@5
|
| 131 |
+
value: 0.38
|
| 132 |
name: Cosine Accuracy@5
|
| 133 |
- type: cosine_accuracy@10
|
| 134 |
+
value: 0.44
|
| 135 |
name: Cosine Accuracy@10
|
| 136 |
- type: cosine_precision@1
|
| 137 |
+
value: 0.24
|
| 138 |
name: Cosine Precision@1
|
| 139 |
- type: cosine_precision@3
|
| 140 |
+
value: 0.10666666666666665
|
| 141 |
name: Cosine Precision@3
|
| 142 |
- type: cosine_precision@5
|
| 143 |
+
value: 0.07600000000000001
|
| 144 |
name: Cosine Precision@5
|
| 145 |
- type: cosine_precision@10
|
| 146 |
+
value: 0.046
|
| 147 |
name: Cosine Precision@10
|
| 148 |
- type: cosine_recall@1
|
| 149 |
+
value: 0.23
|
| 150 |
name: Cosine Recall@1
|
| 151 |
- type: cosine_recall@3
|
| 152 |
+
value: 0.3
|
| 153 |
name: Cosine Recall@3
|
| 154 |
- type: cosine_recall@5
|
| 155 |
+
value: 0.35
|
| 156 |
name: Cosine Recall@5
|
| 157 |
- type: cosine_recall@10
|
| 158 |
+
value: 0.42
|
| 159 |
name: Cosine Recall@10
|
| 160 |
- type: cosine_ndcg@10
|
| 161 |
+
value: 0.32272214750507383
|
| 162 |
name: Cosine Ndcg@10
|
| 163 |
- type: cosine_mrr@10
|
| 164 |
+
value: 0.30133333333333334
|
| 165 |
name: Cosine Mrr@10
|
| 166 |
- type: cosine_map@100
|
| 167 |
+
value: 0.30267489572313894
|
| 168 |
name: Cosine Map@100
|
| 169 |
- task:
|
| 170 |
type: nano-beir
|
|
|
|
| 174 |
type: NanoBEIR_mean
|
| 175 |
metrics:
|
| 176 |
- type: cosine_accuracy@1
|
| 177 |
+
value: 0.26
|
| 178 |
name: Cosine Accuracy@1
|
| 179 |
- type: cosine_accuracy@3
|
| 180 |
+
value: 0.35
|
| 181 |
name: Cosine Accuracy@3
|
| 182 |
- type: cosine_accuracy@5
|
| 183 |
+
value: 0.4
|
| 184 |
name: Cosine Accuracy@5
|
| 185 |
- type: cosine_accuracy@10
|
| 186 |
+
value: 0.5
|
| 187 |
name: Cosine Accuracy@10
|
| 188 |
- type: cosine_precision@1
|
| 189 |
+
value: 0.26
|
| 190 |
name: Cosine Precision@1
|
| 191 |
- type: cosine_precision@3
|
| 192 |
+
value: 0.11666666666666664
|
| 193 |
name: Cosine Precision@3
|
| 194 |
- type: cosine_precision@5
|
| 195 |
+
value: 0.08000000000000002
|
| 196 |
name: Cosine Precision@5
|
| 197 |
- type: cosine_precision@10
|
| 198 |
+
value: 0.051000000000000004
|
| 199 |
name: Cosine Precision@10
|
| 200 |
- type: cosine_recall@1
|
| 201 |
+
value: 0.255
|
| 202 |
name: Cosine Recall@1
|
| 203 |
- type: cosine_recall@3
|
| 204 |
+
value: 0.33999999999999997
|
| 205 |
name: Cosine Recall@3
|
| 206 |
- type: cosine_recall@5
|
| 207 |
+
value: 0.385
|
| 208 |
name: Cosine Recall@5
|
| 209 |
- type: cosine_recall@10
|
| 210 |
+
value: 0.49
|
| 211 |
name: Cosine Recall@10
|
| 212 |
- type: cosine_ndcg@10
|
| 213 |
+
value: 0.36141975425354905
|
| 214 |
name: Cosine Ndcg@10
|
| 215 |
- type: cosine_mrr@10
|
| 216 |
+
value: 0.3265119047619047
|
| 217 |
name: Cosine Mrr@10
|
| 218 |
- type: cosine_map@100
|
| 219 |
+
value: 0.33802241129302657
|
| 220 |
name: Cosine Map@100
|
| 221 |
---
|
| 222 |
|
|
|
|
| 270 |
model = SentenceTransformer("redis/model-b-structured")
|
| 271 |
# Run inference
|
| 272 |
sentences = [
|
| 273 |
+
'I am poor, ugly, untalented, 20 years old, and have big dreams. How can I succeed in life?',
|
| 274 |
+
'I am poor, ugly, untalented, 20 years old, and have big dreams. How can I succeed in life?',
|
| 275 |
+
'Am I too old to succeed in my life at age 32?',
|
| 276 |
]
|
| 277 |
embeddings = model.encode(sentences)
|
| 278 |
print(embeddings.shape)
|
|
|
|
| 281 |
# Get the similarity scores for the embeddings
|
| 282 |
similarities = model.similarity(embeddings, embeddings)
|
| 283 |
print(similarities)
|
| 284 |
+
# tensor([[1.0000, 1.0000, 0.5088],
|
| 285 |
+
# [1.0000, 1.0000, 0.5088],
|
| 286 |
+
# [0.5088, 0.5088, 1.0000]])
|
| 287 |
```
|
| 288 |
|
| 289 |
<!--
|
|
|
|
| 319 |
* Datasets: `NanoMSMARCO` and `NanoNQ`
|
| 320 |
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
| 321 |
|
| 322 |
+
| Metric | NanoMSMARCO | NanoNQ |
|
| 323 |
+
|:--------------------|:------------|:-----------|
|
| 324 |
+
| cosine_accuracy@1 | 0.28 | 0.24 |
|
| 325 |
+
| cosine_accuracy@3 | 0.38 | 0.32 |
|
| 326 |
+
| cosine_accuracy@5 | 0.42 | 0.38 |
|
| 327 |
+
| cosine_accuracy@10 | 0.56 | 0.44 |
|
| 328 |
+
| cosine_precision@1 | 0.28 | 0.24 |
|
| 329 |
+
| cosine_precision@3 | 0.1267 | 0.1067 |
|
| 330 |
+
| cosine_precision@5 | 0.084 | 0.076 |
|
| 331 |
+
| cosine_precision@10 | 0.056 | 0.046 |
|
| 332 |
+
| cosine_recall@1 | 0.28 | 0.23 |
|
| 333 |
+
| cosine_recall@3 | 0.38 | 0.3 |
|
| 334 |
+
| cosine_recall@5 | 0.42 | 0.35 |
|
| 335 |
+
| cosine_recall@10 | 0.56 | 0.42 |
|
| 336 |
+
| **cosine_ndcg@10** | **0.4001** | **0.3227** |
|
| 337 |
+
| cosine_mrr@10 | 0.3517 | 0.3013 |
|
| 338 |
+
| cosine_map@100 | 0.3734 | 0.3027 |
|
| 339 |
|
| 340 |
#### Nano BEIR
|
| 341 |
|
|
|
|
| 353 |
|
| 354 |
| Metric | Value |
|
| 355 |
|:--------------------|:-----------|
|
| 356 |
+
| cosine_accuracy@1 | 0.26 |
|
| 357 |
+
| cosine_accuracy@3 | 0.35 |
|
| 358 |
+
| cosine_accuracy@5 | 0.4 |
|
| 359 |
+
| cosine_accuracy@10 | 0.5 |
|
| 360 |
+
| cosine_precision@1 | 0.26 |
|
| 361 |
+
| cosine_precision@3 | 0.1167 |
|
| 362 |
+
| cosine_precision@5 | 0.08 |
|
| 363 |
+
| cosine_precision@10 | 0.051 |
|
| 364 |
+
| cosine_recall@1 | 0.255 |
|
| 365 |
+
| cosine_recall@3 | 0.34 |
|
| 366 |
+
| cosine_recall@5 | 0.385 |
|
| 367 |
+
| cosine_recall@10 | 0.49 |
|
| 368 |
+
| **cosine_ndcg@10** | **0.3614** |
|
| 369 |
+
| cosine_mrr@10 | 0.3265 |
|
| 370 |
+
| cosine_map@100 | 0.338 |
|
| 371 |
|
| 372 |
<!--
|
| 373 |
## Bias, Risks and Limitations
|
|
|
|
| 387 |
|
| 388 |
#### Unnamed Dataset
|
| 389 |
|
| 390 |
+
* Size: 111,468 training samples
|
| 391 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 392 |
* Approximate statistics based on the first 1000 samples:
|
| 393 |
| | anchor | positive | negative |
|
| 394 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 395 |
| type | string | string | string |
|
| 396 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 16.11 tokens</li><li>max: 71 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 16.16 tokens</li><li>max: 71 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 17.35 tokens</li><li>max: 76 tokens</li></ul> |
|
| 397 |
* Samples:
|
| 398 |
+
| anchor | positive | negative |
|
| 399 |
+
|:--------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------|
|
| 400 |
+
| <code>How many grams of protein should I eat a day?</code> | <code>How much protein should I eat per day?</code> | <code>How does hypokalemia lead to polyuria in primary aldosteronism?</code> |
|
| 401 |
+
| <code>Who said to get out of economic crisis we need to buy more?</code> | <code>Who said to get out of economic crisis we need to buy more?</code> | <code>What are some good IT certifications that don't require programming skills?</code> |
|
| 402 |
+
| <code>What is the difference between Chinese and western culture within China?</code> | <code>What is the difference between Chinese and western culture within China?</code> | <code>What is the difference between Chinese and western culture outside China?</code> |
|
| 403 |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 404 |
```json
|
| 405 |
{
|
|
|
|
| 413 |
|
| 414 |
#### Unnamed Dataset
|
| 415 |
|
| 416 |
+
* Size: 12,386 evaluation samples
|
| 417 |
* Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
|
| 418 |
* Approximate statistics based on the first 1000 samples:
|
| 419 |
| | anchor | positive | negative |
|
| 420 |
|:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
|
| 421 |
| type | string | string | string |
|
| 422 |
+
| details | <ul><li>min: 6 tokens</li><li>mean: 16.22 tokens</li><li>max: 62 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 16.28 tokens</li><li>max: 62 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 17.39 tokens</li><li>max: 66 tokens</li></ul> |
|
| 423 |
* Samples:
|
| 424 |
+
| anchor | positive | negative |
|
| 425 |
+
|:------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------|
|
| 426 |
+
| <code>What is it about novels that allow them to deal with deep themes that short stories, drama, and poetry cannot achieve?</code> | <code>What is it about novels that allow them to deal with deep themes that short stories, drama, and poetry cannot achieve?</code> | <code>What are films that deal with themes like death and letting go?</code> |
|
| 427 |
+
| <code>If alien civilizations are thought to be much more advanced than us, why haven't they made contact with us yet?</code> | <code>If there are super intelligent alien beings somewhere in the Galaxy why haven't they tried to contact us yet?</code> | <code>What's not so good about Aston Martin cars?</code> |
|
| 428 |
+
| <code>How can you determine the Lewis dot structure for sulfur trioxide?</code> | <code>How can you determine the Lewis dot structure for sulfur trioxide?</code> | <code>How can you determine the Lewis dot structure for sulfur?</code> |
|
| 429 |
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 430 |
```json
|
| 431 |
{
|
|
|
|
| 443 |
- `per_device_eval_batch_size`: 128
|
| 444 |
- `learning_rate`: 2e-05
|
| 445 |
- `weight_decay`: 0.0001
|
| 446 |
+
- `max_steps`: 3000
|
| 447 |
- `warmup_ratio`: 0.1
|
| 448 |
- `fp16`: True
|
| 449 |
- `dataloader_drop_last`: True
|
|
|
|
| 477 |
- `adam_epsilon`: 1e-08
|
| 478 |
- `max_grad_norm`: 1.0
|
| 479 |
- `num_train_epochs`: 3.0
|
| 480 |
+
- `max_steps`: 3000
|
| 481 |
- `lr_scheduler_type`: linear
|
| 482 |
- `lr_scheduler_kwargs`: {}
|
| 483 |
- `warmup_ratio`: 0.1
|
|
|
|
| 584 |
### Training Logs
|
| 585 |
| Epoch | Step | Training Loss | Validation Loss | NanoMSMARCO_cosine_ndcg@10 | NanoNQ_cosine_ndcg@10 | NanoBEIR_mean_cosine_ndcg@10 |
|
| 586 |
|:------:|:----:|:-------------:|:---------------:|:--------------------------:|:---------------------:|:----------------------------:|
|
| 587 |
+
| 0 | 0 | - | 0.5694 | 0.5540 | 0.5931 | 0.5735 |
|
| 588 |
+
| 0.2874 | 250 | 0.6309 | 0.4347 | 0.5265 | 0.5258 | 0.5261 |
|
| 589 |
+
| 0.5747 | 500 | 0.5501 | 0.4159 | 0.5106 | 0.4177 | 0.4641 |
|
| 590 |
+
| 0.8621 | 750 | 0.5266 | 0.4058 | 0.4710 | 0.3872 | 0.4291 |
|
| 591 |
+
| 1.1494 | 1000 | 0.5128 | 0.4009 | 0.4510 | 0.3696 | 0.4103 |
|
| 592 |
+
| 1.4368 | 1250 | 0.5012 | 0.3967 | 0.4555 | 0.3549 | 0.4052 |
|
| 593 |
+
| 1.7241 | 1500 | 0.4973 | 0.3939 | 0.4370 | 0.3621 | 0.3996 |
|
| 594 |
+
| 2.0115 | 1750 | 0.4937 | 0.3920 | 0.4131 | 0.3396 | 0.3763 |
|
| 595 |
+
| 2.2989 | 2000 | 0.4865 | 0.3902 | 0.4214 | 0.3226 | 0.3720 |
|
| 596 |
+
| 2.5862 | 2250 | 0.4844 | 0.3893 | 0.4021 | 0.3364 | 0.3693 |
|
| 597 |
+
| 2.8736 | 2500 | 0.4791 | 0.3880 | 0.4090 | 0.3225 | 0.3657 |
|
| 598 |
+
| 3.1609 | 2750 | 0.4784 | 0.3874 | 0.4071 | 0.3233 | 0.3652 |
|
| 599 |
+
| 3.4483 | 3000 | 0.4758 | 0.3873 | 0.4001 | 0.3227 | 0.3614 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 600 |
|
| 601 |
|
| 602 |
### Framework Versions
|