File size: 45,018 Bytes
22e0578
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
---

base_model: microsoft/mpnet-base
datasets:
- sentence-transformers/natural-questions
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
- dot_accuracy@1
- dot_accuracy@3
- dot_accuracy@5
- dot_accuracy@10
- dot_precision@1
- dot_precision@3
- dot_precision@5
- dot_precision@10
- dot_recall@1
- dot_recall@3
- dot_recall@5
- dot_recall@10
- dot_ndcg@10
- dot_mrr@10
- dot_map@100
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:100231
- loss:MultipleNegativesRankingLoss
widget:
- source_sentence: when did the british leave new york city
  sentences:
  - Golden State Warriors The Golden State Warriors are an American professional basketball
    team based in Oakland, California. The Warriors compete in the National Basketball
    Association (NBA) as a member of the league's Western Conference Pacific Division.
    The Warriors play their home games at the Oracle Arena in Oakland. The Warriors
    have reached nine NBA Finals, winning five NBA championships in 1947,[b] 1956,
    1975, 2015 and 2017. Golden State's five NBA championships are tied for fourth-most
    in NBA history with the San Antonio Spurs, and behind only the Boston Celtics
    (17), Los Angeles Lakers (16) and Chicago Bulls (6). As of 2017, the Warriors
    are the third most valuable NBA franchise according to Forbes, with an estimated
    value of $2.6 billion.[6]
  - Evacuation Day (New York) Evacuation Day on November 25 marks the day in 1783
    when British troops departed from New York City on Manhattan Island, after the
    end of the American Revolutionary War. After this British Army evacuation, General
    George Washington triumphantly led the Continental Army from his former headquarters,
    north of the city, across the Harlem River south down Manhattan through the town
    to The Battery at the foot of Broadway.[1]
  - Biochemical oxygen demand BOD can be used as a gauge of the effectiveness of wastewater
    treatment plants. It is listed as a conventional pollutant in the U.S. Clean Water
    Act.[2]
- source_sentence: what is the newest generation of the ipad
  sentences:
  - Alex Karev Alex is fired by Dr. Lebackes when Maggie Pierce accidentally reveals
    to him that Karev was thinking about leaving the job. Webber recommended Bailey
    to fill Yang's board seat after she left, so Bailey and Alex fight over the chair.
    They both make presentations to the board and eventually Bailey wins, with a unanimous
    vote in her favor. He is hired back as an attending Peds surgeon and takes over
    full-time as Arizona pursues a fellowship with Dr. Herman. Alex continues to date
    Jo and his friendship with Meredith grows stronger than ever, with him taking
    on the role of her new person. When Derek dies and Meredith runs away, Alex is
    upset by her leaving without telling him where she went and calls her everyday.
    Eventually she calls him, tells him she is okay, and to stop calling. When she
    goes into labor and gives birth to Ellis Shepherd, Alex goes to see her since
    he is her emergency contact. He brings Meredith and her kids back to her house.
    She asks to move back in with him in her old house. Alex sells Meredith back the
    house and he and Jo rent a loft.
  - List of presidents of the United States by age The median age upon accession to
    the presidency is 55 years and 3 months. This is how old Lyndon B. Johnson was
    at the time of his inauguration. The youngest person to assume the office was
    Theodore Roosevelt, who became president at the age of 42 years, 322 days, following
    William McKinley's assassination; the oldest was Donald Trump, who was 70 years,
    220 days old at his inauguration. The youngest person to be elected president
    was John F. Kennedy, at 43 years, 163 days of age on election day; the oldest
    was Ronald Reagan, who was 73 years, 274 days old at the time of his election
    to a second term.
  - iPad (2018) The iPad (officially sixth-generation iPad) is a 9.7-inch (25cm) tablet
    computer designed, developed, and marketed by Apple Inc. It was announced on March
    27, 2018 during an education-focused event in Chicago and it is a revision of
    the 2017 model, upgraded with the Apple A10 Fusion SoC and support for styluses
    such as Apple Pencil.[2] The iPad is marketed towards educators and schools.
- source_sentence: what is the average speed of passenger airplane
  sentences:
  - Fixed exchange-rate system In the 21st century, the currencies associated with
    large economies typically do not fix or peg exchange rates to other currencies.
    The last large economy to use a fixed exchange rate system was the People's Republic
    of China which, in July 2005, adopted a slightly more flexible exchange rate system
    called a managed exchange rate.[2] The European Exchange Rate Mechanism is also
    used on a temporary basis to establish a final conversion rate against the Euro
    (€) from the local currencies of countries joining the Eurozone.
  - Tenth Doctor The Tenth Doctor is an incarnation of the Doctor, the protagonist
    of the BBC science fiction television programme Doctor Who, who is played by David
    Tennant in three series as well as nine specials. As with previous incarnations
    of the Doctor, the character has also appeared in other Doctor Who spin-offs.
    In the programme's narrative, the Doctor is a centuries-old Time Lord alien from
    the planet Gallifrey who travels in time in his TARDIS, frequently with companions.
    When the Doctor is critically injured beyond medical repair, he can regenerate
    his body; in doing so, his physical appearance and personality change, and a new
    actor assumes the role. Tennant's portrayal of the Doctor is of an outwardly charismatic
    and charming adventurer whose likable and easygoing attitude can quickly turn
    to righteous fury when provoked.
  - Cruise (aeronautics) The typical cruising airspeed for a long-distance commercial
    passenger aircraft is approximately 475–500 knots (878–926 km/h; 546–575 mph).
- source_sentence: when is cars three going to be released
  sentences:
  - Benedict's reagent The color of the obtained precipitate gives an idea about the
    quantity of sugar present in the solution, hence the test is semi-quantitative.
    A greenish precipitate indicates about 0.5 g% concentration; yellow precipitate
    indicates 1 g% concentration; orange indicates 1.5 g% and red indicates 2 g% or
    higher concentration.
  - Cars 3 The film was released on June 16, 2017, has grossed over $362 million worldwide
    and received generally positive reviews, with many critics considering it an improvement
    over its predecessor, as well as praising its emotional story and animation.[7]
  - Sleeping Beauty At the christening of a king and queen's long-wished-for child,
    seven good fairies are invited to be godmothers to the infant princess. The fairies
    attend the banquet at the palace. Each fairy is presented with a golden plate
    and drinking cups adorned with jewels. Soon after, an old fairy enters the palace
    and is seated with a plate of fine china and a crystal drinking glass. This old
    fairy is overlooked because she has been within a tower for many years and everyone
    had believed her to be deceased. Six of the other seven fairies then offer their
    gifts of beauty, wit, grace, dance, song, and goodness to the infant princess.
    The evil fairy is very angry about having been forgotten, and as her gift, enchants
    the infant princess so that she will one day prick her finger on a spindle of
    a spinning wheel and die. The seventh fairy, who hasn't yet given her gift, attempts
    to reverse the evil fairy's curse. However, she can only do so partially. Instead
    of dying, the Princess will fall into a deep sleep for 100 years and be awakened
    by a kiss from a king's son.
- source_sentence: who was ancient china's main enemy that lived to the north
  sentences:
  - Betty Lynn Elizabeth Ann Theresa "Betty" Lynn[1] (born August 29, 1926) is a former
    American actress. She is best known for her role as Thelma Lou, Deputy Barney
    Fife's girlfriend, on The Andy Griffith Show.
  - Sampath Bank Sampath Bank PLC is a licensed commercial bank incorporated in Sri
    Lanka in 1986 with 229 branches and 373 ATMs island wide. It has won the "Bank

    of the Year" award by "The Banker" of Financial Times Limited – London, for
    the second consecutive year and the "National Business Excellence Awards 2010".[citation
    needed] It has become the third largest private sector bank in Sri Lanka with
    Rs. 453 billion in deposits as of 30 June 2016.[1]
  - 'Sui dynasty The Sui Dynasty (Chinese: 隋朝; pinyin: Suí cháo) was a short-lived

    imperial dynasty of China of pivotal significance. The Sui unified the Northern

    and Southern dynasties and reinstalled the rule of ethnic Han Chinese in the entirety

    of China proper, along with sinicization of former nomadic ethnic minorities (the

    Five Barbarians) within its territory. It was succeeded by the Tang dynasty, which

    largely inherited its foundation.'
co2_eq_emissions:
  emissions: 176.27316538970194
  energy_consumed: 0.45349178905614573
  source: codecarbon
  training_type: fine-tuning
  on_cloud: false
  cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
  ram_total_size: 31.777088165283203
  hours_used: 1.208
  hardware_used: 1 x NVIDIA GeForce RTX 3090
model-index:
- name: MPNet base trained on Natural Questions pairs
  results:
  - task:
      type: information-retrieval
      name: Information Retrieval
    dataset:
      name: natural questions dev
      type: natural-questions-dev
    metrics:
    - type: cosine_accuracy@1
      value: 0.5898739126185124
      name: Cosine Accuracy@1
    - type: cosine_accuracy@3
      value: 0.8181018473267521
      name: Cosine Accuracy@3
    - type: cosine_accuracy@5
      value: 0.8875965203792395
      name: Cosine Accuracy@5
    - type: cosine_accuracy@10
      value: 0.9434072915648519
      name: Cosine Accuracy@10
    - type: cosine_precision@1
      value: 0.5898739126185124
      name: Cosine Precision@1
    - type: cosine_precision@3
      value: 0.272700615775584
      name: Cosine Precision@3
    - type: cosine_precision@5
      value: 0.17751930407584793
      name: Cosine Precision@5
    - type: cosine_precision@10
      value: 0.0943407291564852
      name: Cosine Precision@10
    - type: cosine_recall@1
      value: 0.5898739126185124
      name: Cosine Recall@1
    - type: cosine_recall@3
      value: 0.8181018473267521
      name: Cosine Recall@3
    - type: cosine_recall@5
      value: 0.8875965203792395
      name: Cosine Recall@5
    - type: cosine_recall@10
      value: 0.9434072915648519
      name: Cosine Recall@10
    - type: cosine_ndcg@10
      value: 0.7718587241150588
      name: Cosine Ndcg@10
    - type: cosine_mrr@10
      value: 0.7161706640105541
      name: Cosine Mrr@10
    - type: cosine_map@100
      value: 0.7187822446150476
      name: Cosine Map@100
    - type: dot_accuracy@1
      value: 0.5610399765418825
      name: Dot Accuracy@1
    - type: dot_accuracy@3
      value: 0.7970872837454794
      name: Dot Accuracy@3
    - type: dot_accuracy@5
      value: 0.866386472485583
      name: Dot Accuracy@5
    - type: dot_accuracy@10
      value: 0.9327533965399277
      name: Dot Accuracy@10
    - type: dot_precision@1
      value: 0.5610399765418825
      name: Dot Precision@1
    - type: dot_precision@3
      value: 0.2656957612484931
      name: Dot Precision@3
    - type: dot_precision@5
      value: 0.17327729449711662
      name: Dot Precision@5
    - type: dot_precision@10
      value: 0.09327533965399278
      name: Dot Precision@10
    - type: dot_recall@1
      value: 0.5610399765418825
      name: Dot Recall@1
    - type: dot_recall@3
      value: 0.7970872837454794
      name: Dot Recall@3
    - type: dot_recall@5
      value: 0.866386472485583
      name: Dot Recall@5
    - type: dot_recall@10
      value: 0.9327533965399277
      name: Dot Recall@10
    - type: dot_ndcg@10
      value: 0.7508293948042275
      name: Dot Ndcg@10
    - type: dot_mrr@10
      value: 0.6920021317098743
      name: Dot Mrr@10
    - type: dot_map@100
      value: 0.6951493585515177
      name: Dot Map@100
---


# MPNet base trained on Natural Questions pairs

This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [microsoft/mpnet-base](https://huggingface.co/microsoft/mpnet-base) on the [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) 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.

## Model Details

### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [microsoft/mpnet-base](https://huggingface.co/microsoft/mpnet-base) <!-- at revision 6996ce1e91bd2a9c7d7f61daec37463394f73f09 -->
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 tokens
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
    - [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions)
- **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': 512, '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})

)

```

## 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("tomaarsen/mpnet-base-natural-questions-mnrl")

# Run inference

sentences = [

    "who was ancient china's main enemy that lived to the north",

    'Sui dynasty The Sui Dynasty (Chinese: 隋朝; pinyin: Suí cháo) was a short-lived imperial dynasty of China of pivotal significance. The Sui unified the Northern and Southern dynasties and reinstalled the rule of ethnic Han Chinese in the entirety of China proper, along with sinicization of former nomadic ethnic minorities (the Five Barbarians) within its territory. It was succeeded by the Tang dynasty, which largely inherited its foundation.',

    'Sampath Bank Sampath Bank PLC is a licensed commercial bank incorporated in Sri Lanka in 1986 with 229 branches and 373 ATMs island wide. It has won the "Bank of the Year" award by "The Banker" of Financial Times Limited – London, for the second consecutive year and the "National Business Excellence Awards 2010".[citation needed] It has become the third largest private sector bank in Sri Lanka with Rs. 453 billion in deposits as of 30 June 2016.[1]',

]

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]

```

<!--
### 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: `natural-questions-dev`
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)

| Metric              | Value      |
|:--------------------|:-----------|
| cosine_accuracy@1   | 0.5899     |

| cosine_accuracy@3   | 0.8181     |
| cosine_accuracy@5   | 0.8876     |

| cosine_accuracy@10  | 0.9434     |
| cosine_precision@1  | 0.5899     |

| cosine_precision@3  | 0.2727     |
| cosine_precision@5  | 0.1775     |

| cosine_precision@10 | 0.0943     |
| cosine_recall@1     | 0.5899     |

| cosine_recall@3     | 0.8181     |
| cosine_recall@5     | 0.8876     |

| cosine_recall@10    | 0.9434     |
| cosine_ndcg@10      | 0.7719     |

| cosine_mrr@10       | 0.7162     |
| **cosine_map@100**  | **0.7188** |

| dot_accuracy@1      | 0.561      |

| dot_accuracy@3      | 0.7971     |

| dot_accuracy@5      | 0.8664     |

| dot_accuracy@10     | 0.9328     |

| dot_precision@1     | 0.561      |

| dot_precision@3     | 0.2657     |

| dot_precision@5     | 0.1733     |

| dot_precision@10    | 0.0933     |

| dot_recall@1        | 0.561      |

| dot_recall@3        | 0.7971     |

| dot_recall@5        | 0.8664     |

| dot_recall@10       | 0.9328     |

| dot_ndcg@10         | 0.7508     |

| dot_mrr@10          | 0.692      |

| dot_map@100         | 0.6951     |



<!--

## 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



#### natural-questions



* Dataset: [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) at [f9e894e](https://huggingface.co/datasets/sentence-transformers/natural-questions/tree/f9e894e1081e206e577b4eaa9ee6de2b06ae6f17)

* Size: 100,231 training samples

* Columns: <code>query</code> and <code>answer</code>

* Approximate statistics based on the first 1000 samples:

  |         | query                                                                              | answer                                                                               |

  |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|

  | type    | string                                                                             | string                                                                               |

  | details | <ul><li>min: 10 tokens</li><li>mean: 11.74 tokens</li><li>max: 21 tokens</li></ul> | <ul><li>min: 17 tokens</li><li>mean: 135.66 tokens</li><li>max: 512 tokens</li></ul> |

* Samples:

  | query                                                           | answer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

  |:----------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

  | <code>when did richmond last play in a preliminary final</code> | <code>Richmond Football Club Richmond began 2017 with 5 straight wins, a feat it had not achieved since 1995. A series of close losses hampered the Tigers throughout the middle of the season, including a 5-point loss to the Western Bulldogs, 2-point loss to Fremantle, and a 3-point loss to the Giants. Richmond ended the season strongly with convincing victories over Fremantle and St Kilda in the final two rounds, elevating the club to 3rd on the ladder. Richmond's first final of the season against the Cats at the MCG attracted a record qualifying final crowd of 95,028; the Tigers won by 51 points. Having advanced to the first preliminary finals for the first time since 2001, Richmond defeated Greater Western Sydney by 36 points in front of a crowd of 94,258 to progress to the Grand Final against Adelaide, their first Grand Final appearance since 1982. The attendance was 100,021, the largest crowd to a grand final since 1986. The Crows led at quarter time and led by as many as 13, but the Tigers took over the game as it progressed and scored seven straight goals at one point. They eventually would win by 48 points – 16.12 (108) to Adelaide's 8.12 (60) – to end their 37-year flag drought.[22] Dustin Martin also became the first player to win a Premiership medal, the Brownlow Medal and the Norm Smith Medal in the same season, while Damien Hardwick was named AFL Coaches Association Coach of the Year. Richmond's jump from 13th to premiers also marked the biggest jump from one AFL season to the next.</code> |

  | <code>who sang what in the world's come over you</code>         | <code>Jack Scott (singer) At the beginning of 1960, Scott again changed record labels, this time to Top Rank Records.[1] He then recorded four Billboard Hot 100 hits – "What in the World's Come Over You" (#5), "Burning Bridges" (#3) b/w "Oh Little One" (#34), and "It Only Happened Yesterday" (#38).[1] "What in the World's Come Over You" was Scott's second gold disc winner.[6] Scott continued to record and perform during the 1960s and 1970s.[1] His song "You're Just Gettin' Better" reached the country charts in 1974.[1] In May 1977, Scott recorded a Peel session for BBC Radio 1 disc jockey, John Peel.</code>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

  | <code>who produces the most wool in the world</code>            | <code>Wool Global wool production is about 2 million tonnes per year, of which 60% goes into apparel. Wool comprises ca 3% of the global textile market, but its value is higher owing to dying and other modifications of the material.[1] Australia is a leading producer of wool which is mostly from Merino sheep but has been eclipsed by China in terms of total weight.[30] New Zealand (2016) is the third-largest producer of wool, and the largest producer of crossbred wool. Breeds such as Lincoln, Romney, Drysdale, and Elliotdale produce coarser fibers, and wool from these sheep is usually used for making carpets.</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"

  }

  ```



### Evaluation Dataset



#### natural-questions



* Dataset: [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) at [f9e894e](https://huggingface.co/datasets/sentence-transformers/natural-questions/tree/f9e894e1081e206e577b4eaa9ee6de2b06ae6f17)

* Size: 100,231 evaluation samples

* Columns: <code>query</code> and <code>answer</code>

* Approximate statistics based on the first 1000 samples:

  |         | query                                                                              | answer                                                                               |

  |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|

  | type    | string                                                                             | string                                                                               |

  | details | <ul><li>min: 10 tokens</li><li>mean: 11.79 tokens</li><li>max: 25 tokens</li></ul> | <ul><li>min: 15 tokens</li><li>mean: 142.78 tokens</li><li>max: 512 tokens</li></ul> |

* Samples:

  | query                                                                     | answer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

  |:--------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

  | <code>who betrayed siraj ud daula in the battle of plassey in 1757</code> | <code>Siraj ud-Daulah The Battle of Plassey (or Palashi) is widely considered the turning point in the history of the subcontinent, and opened the way to eventual British domination. After Siraj-ud-Daulah's conquest of Calcutta, the British sent fresh troops from Madras to recapture the fort and avenge the attack. A retreating Siraj-ud-Daulah met the British at Plassey. He had to make camp 27 miles away from Murshidabad. On 23 June 1757 Siraj-ud-Daulah called on Mir Jafar because he was saddened by the sudden fall of Mir Mardan who was a very dear companion of Siraj in battles. The Nawab asked for help from Mir Jafar. Mir Jafar advised Siraj to retreat for that day. The Nawab made the blunder in giving the order to stop the fight. Following his command, the soldiers of the Nawab were returning to their camps. At that time, Robert Clive attacked the soldiers with his army. At such a sudden attack, the army of Siraj became indisciplined and could think of no way to fight. So all fled away in such a situation. Betrayed by a conspiracy plotted by Jagat Seth, Mir Jafar, Krishna Chandra, Omichund etc., he lost the battle and had to escape. He went first to Murshidabad and then to Patna by boat, but was eventually arrested by Mir Jafar's soldiers.</code> |

  | <code>what is the meaning of single malt whisky</code>                    | <code>Single malt whisky Single malt whisky is malt whisky from a single distillery, that is, whisky distilled from fermented mash made exclusively with malted grain (usually barley), as distinguished from unmalted grain.</code>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

  | <code>when is despicable me 3 going to release</code>                     | <code>Despicable Me 3 Despicable Me 3 premiered on June 14, 2017, at the Annecy International Animated Film Festival, and was released in the United States on June 30, 2017, by Universal Pictures in 3D, RealD 3D, Dolby Cinema, and IMAX 3D. The film received mixed reviews from critics[7] and has grossed over $1 billion worldwide, making it the third highest-grossing film of 2017, the fifth highest-grossing animated film of all time and the 28th highest-grossing overall. It is Illumination's second film to gross over $1 billion, after Minions in 2015, becoming the first ever animated franchise to do so.</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"

  }

  ```



### Training Hyperparameters

#### Non-Default Hyperparameters



- `eval_strategy`: steps

- `per_device_train_batch_size`: 32

- `per_device_eval_batch_size`: 32

- `learning_rate`: 2e-05

- `num_train_epochs`: 1

- `warmup_ratio`: 0.1

- `bf16`: True

- `batch_sampler`: no_duplicates



#### All Hyperparameters

<details><summary>Click to expand</summary>



- `overwrite_output_dir`: False

- `do_predict`: False

- `eval_strategy`: steps

- `prediction_loss_only`: True

- `per_device_train_batch_size`: 32

- `per_device_eval_batch_size`: 32

- `per_gpu_train_batch_size`: None

- `per_gpu_eval_batch_size`: None

- `gradient_accumulation_steps`: 1

- `eval_accumulation_steps`: None

- `learning_rate`: 2e-05

- `weight_decay`: 0.0

- `adam_beta1`: 0.9

- `adam_beta2`: 0.999

- `adam_epsilon`: 1e-08

- `max_grad_norm`: 1.0

- `num_train_epochs`: 1

- `max_steps`: -1

- `lr_scheduler_type`: linear

- `lr_scheduler_kwargs`: {}

- `warmup_ratio`: 0.1

- `warmup_steps`: 0

- `log_level`: passive

- `log_level_replica`: warning

- `log_on_each_node`: True

- `logging_nan_inf_filter`: True

- `save_safetensors`: True

- `save_on_each_node`: False

- `save_only_model`: False

- `restore_callback_states_from_checkpoint`: False

- `no_cuda`: False

- `use_cpu`: False

- `use_mps_device`: False

- `seed`: 42

- `data_seed`: None

- `jit_mode_eval`: False

- `use_ipex`: False

- `bf16`: True

- `fp16`: False

- `fp16_opt_level`: O1

- `half_precision_backend`: auto

- `bf16_full_eval`: False

- `fp16_full_eval`: False

- `tf32`: None

- `local_rank`: 0

- `ddp_backend`: None

- `tpu_num_cores`: None

- `tpu_metrics_debug`: False

- `debug`: []

- `dataloader_drop_last`: False

- `dataloader_num_workers`: 0

- `dataloader_prefetch_factor`: None

- `past_index`: -1

- `disable_tqdm`: False

- `remove_unused_columns`: True

- `label_names`: None

- `load_best_model_at_end`: False

- `ignore_data_skip`: False

- `fsdp`: []

- `fsdp_min_num_params`: 0

- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}

- `fsdp_transformer_layer_cls_to_wrap`: None

- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}

- `deepspeed`: None

- `label_smoothing_factor`: 0.0

- `optim`: adamw_torch

- `optim_args`: None

- `adafactor`: False

- `group_by_length`: False

- `length_column_name`: length

- `ddp_find_unused_parameters`: None

- `ddp_bucket_cap_mb`: None

- `ddp_broadcast_buffers`: False

- `dataloader_pin_memory`: True

- `dataloader_persistent_workers`: False

- `skip_memory_metrics`: True

- `use_legacy_prediction_loop`: False

- `push_to_hub`: False

- `resume_from_checkpoint`: None

- `hub_model_id`: None

- `hub_strategy`: every_save

- `hub_private_repo`: False

- `hub_always_push`: False

- `gradient_checkpointing`: False

- `gradient_checkpointing_kwargs`: None

- `include_inputs_for_metrics`: False

- `eval_do_concat_batches`: True

- `fp16_backend`: auto

- `push_to_hub_model_id`: None

- `push_to_hub_organization`: None

- `mp_parameters`: 

- `auto_find_batch_size`: False

- `full_determinism`: False

- `torchdynamo`: None

- `ray_scope`: last

- `ddp_timeout`: 1800

- `torch_compile`: False

- `torch_compile_backend`: None

- `torch_compile_mode`: None

- `dispatch_batches`: None

- `split_batches`: None

- `include_tokens_per_second`: False

- `include_num_input_tokens_seen`: False

- `neftune_noise_alpha`: None

- `optim_target_modules`: None

- `batch_eval_metrics`: False

- `batch_sampler`: no_duplicates

- `multi_dataset_batch_sampler`: proportional



</details>



### Training Logs

| Epoch  | Step | Training Loss | loss   | natural-questions-dev_cosine_map@100 |

|:------:|:----:|:-------------:|:------:|:------------------------------------:|

| 0      | 0    | -             | -      | 0.1228                               |

| 0.0004 | 1    | 3.0833        | -      | -                                    |

| 0.0355 | 100  | 1.3516        | 0.1545 | 0.5151                               |

| 0.0711 | 200  | 0.1189        | 0.0607 | 0.6299                               |

| 0.1066 | 300  | 0.0641        | 0.0450 | 0.6535                               |

| 0.1422 | 400  | 0.0529        | 0.0436 | 0.6532                               |

| 0.1777 | 500  | 0.0601        | 0.0349 | 0.6716                               |

| 0.2133 | 600  | 0.0453        | 0.0308 | 0.6771                               |

| 0.2488 | 700  | 0.0478        | 0.0298 | 0.6769                               |

| 0.2844 | 800  | 0.0404        | 0.0309 | 0.6834                               |

| 0.3199 | 900  | 0.0377        | 0.0275 | 0.6855                               |

| 0.3555 | 1000 | 0.0391        | 0.0248 | 0.6929                               |

| 0.3910 | 1100 | 0.026         | 0.0265 | 0.6919                               |

| 0.4266 | 1200 | 0.0343        | 0.0247 | 0.6985                               |

| 0.4621 | 1300 | 0.0359        | 0.0245 | 0.6951                               |

| 0.4977 | 1400 | 0.0283        | 0.0213 | 0.6993                               |

| 0.5332 | 1500 | 0.027         | 0.0207 | 0.7072                               |

| 0.5688 | 1600 | 0.0313        | 0.0223 | 0.6980                               |

| 0.6043 | 1700 | 0.0373        | 0.0203 | 0.7042                               |

| 0.6399 | 1800 | 0.0245        | 0.0199 | 0.7049                               |

| 0.6754 | 1900 | 0.0294        | 0.0186 | 0.7143                               |

| 0.7110 | 2000 | 0.0185        | 0.0185 | 0.7116                               |

| 0.7465 | 2100 | 0.0247        | 0.0181 | 0.7118                               |

| 0.7821 | 2200 | 0.0221        | 0.0183 | 0.7142                               |

| 0.8176 | 2300 | 0.0178        | 0.0182 | 0.7141                               |

| 0.8532 | 2400 | 0.0235        | 0.0170 | 0.7172                               |

| 0.8887 | 2500 | 0.0279        | 0.0168 | 0.7190                               |

| 0.9243 | 2600 | 0.0278        | 0.0167 | 0.7188                               |

| 0.9598 | 2700 | 0.022         | 0.0166 | 0.7179                               |

| 0.9954 | 2800 | 0.0191        | 0.0166 | 0.7173                               |

| 1.0    | 2813 | -             | -      | 0.7188                               |





### Environmental Impact

Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).

- **Energy Consumed**: 0.453 kWh

- **Carbon Emitted**: 0.176 kg of CO2

- **Hours Used**: 1.208 hours



### Training Hardware

- **On Cloud**: No

- **GPU Model**: 1 x NVIDIA GeForce RTX 3090

- **CPU Model**: 13th Gen Intel(R) Core(TM) i7-13700K

- **RAM Size**: 31.78 GB



### Framework Versions

- Python: 3.11.6

- Sentence Transformers: 3.1.0.dev0

- Transformers: 4.41.2

- PyTorch: 2.3.1+cu121

- Accelerate: 0.31.0

- Datasets: 2.20.0

- Tokenizers: 0.19.1



## 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{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.*

-->