File size: 5,008 Bytes
f8a4293
87594a1
 
 
 
 
 
 
 
 
 
 
 
f8a4293
6061102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f8a4293
 
 
 
 
 
 
 
 
 
 
 
 
 
6061102
 
 
 
f8a4293
 
 
 
 
87594a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language:
- en
multilinguality:
- monolingual
size_categories:
- 1M<n<10M
task_categories:
- feature-extraction
- sentence-similarity
pretty_name: GooAQ with mined hard negatives
tags:
- sentence-transformers
dataset_info:
- config_name: triplet-5
  features:
  - name: question
    dtype: string
  - name: answer
    dtype: string
  - name: negative_1
    dtype: string
  - name: negative_2
    dtype: string
  - name: negative_3
    dtype: string
  - name: negative_4
    dtype: string
  - name: negative_5
    dtype: string
  splits:
  - name: train
    num_bytes: 3593548091
    num_examples: 2294443
  download_size: 2433298512
  dataset_size: 3593548091
- config_name: triplet-all
  features:
  - name: question
    dtype: string
  - name: answer
    dtype: string
  - name: negative
    dtype: string
  splits:
  - name: train
    num_bytes: 5571746272
    num_examples: 10048700
  download_size: 1710985513
  dataset_size: 5571746272
configs:
- config_name: triplet-5
  data_files:
  - split: train
    path: triplet-5/train-*
- config_name: triplet-all
  data_files:
  - split: train
    path: triplet-all/train-*
---

# Dataset Card for GooAQ with mined hard negatives

This dataset is a collection of question-answer-negative triplets and question-answer-negative_1...-negative_5 tuples from the GooAQ dataset. See [GooAQ](https://huggingface.co/datasets/sentence-transformers/gooaq) for additional information.
This dataset can be used directly with Sentence Transformers to train embedding models.

The negative samples have been automatically mined with [all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) and:
* `range_min`: 10, i.e. we skip the 10 most similar samples
* `range_max`: 100, i.e. we only look at the top 100 most similar samples
* `margin`: 0, i.e. we require negative similarity + margin < positive similarity, so negative samples can't be more similar than the known true answer
* `sampling_strategy`: "random", i.e. we randomly sample from the candidate negatives rather than taking the "top" negatives
* `num_negatives`: 5, i.e. we mine 5 negatives per question-answer pair

## Dataset Subsets

### `triplet-all` subset

* Columns: "question", "answer", "negative"
* Column types: `str`, `str`, `str`
* Examples:
    ```python
    {
      'question': 'is toprol xl the same as metoprolol?',
      'answer': 'Metoprolol succinate is also known by the brand name Toprol XL. It is the extended-release form of metoprolol. Metoprolol succinate is approved to treat high blood pressure, chronic chest pain, and congestive heart failure.',
      'negative': 'TOPROL-XL is indicated for the treatment of stable, symptomatic (NYHA Class II or III) heart failure of ischemic, hypertensive, or cardiomyopathic origin. It was studied in patients already receiving ACE inhibitors, diuretics, and, in the majority of cases, digitalis.'
    }
    ```
* Collection strategy: Reading the natural questions dataset from [sentence-transformers/natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) and performing hard negative mining with `as_triplets=True`.
* Deduplified: No

### `triplet-5` subset

* Columns: "question", "answer", "negative_1", "negative_2", "negative_3", "negative_4", "negative_5"
* Column types: `str`, `str`, `str`, `str`, `str`, `str`, `str`
* Examples:
    ```python
    {
      'question': 'is toprol xl the same as metoprolol?',
      'answer': 'Metoprolol succinate is also known by the brand name Toprol XL. It is the extended-release form of metoprolol. Metoprolol succinate is approved to treat high blood pressure, chronic chest pain, and congestive heart failure.',
      'negative_1': 'Secondly, metoprolol and metoprolol ER have different brand-name equivalents: Brand version of metoprolol: Lopressor. Brand version of metoprolol ER: Toprol XL.',
      'negative_2': 'Pill with imprint 1 is White, Round and has been identified as Metoprolol Tartrate 25 mg.',
      'negative_3': 'Interactions between your drugs No interactions were found between Allergy Relief and metoprolol. This does not necessarily mean no interactions exist. Always consult your healthcare provider.',
      'negative_4': 'Metoprolol is a type of medication called a beta blocker. It works by relaxing blood vessels and slowing heart rate, which improves blood flow and lowers blood pressure. Metoprolol can also improve the likelihood of survival after a heart attack.',
      'negative_5': "Metoprolol starts to work after about 2 hours, but it can take up to 1 week to fully take effect. You may not feel any different when you take metoprolol, but this doesn't mean it's not working. It's important to keep taking your medicine."
    }
    ```
* Collection strategy: Reading the natural questions dataset from [sentence-transformers/natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) and performing hard negative mining with `as_triplets=False`.
* Deduplified: No