Wi-Fi commited on
Commit
6dfa4f9
·
verified ·
1 Parent(s): 15baab3

Add new CrossEncoder model

Browse files
README.md ADDED
@@ -0,0 +1,489 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - sentence-transformers
6
+ - cross-encoder
7
+ - generated_from_trainer
8
+ - dataset_size:78704
9
+ - loss:ListMLELoss
10
+ base_model: microsoft/MiniLM-L12-H384-uncased
11
+ datasets:
12
+ - microsoft/ms_marco
13
+ pipeline_tag: text-ranking
14
+ library_name: sentence-transformers
15
+ metrics:
16
+ - map
17
+ - mrr@10
18
+ - ndcg@10
19
+ model-index:
20
+ - name: CrossEncoder based on microsoft/MiniLM-L12-H384-uncased
21
+ results:
22
+ - task:
23
+ type: cross-encoder-reranking
24
+ name: Cross Encoder Reranking
25
+ dataset:
26
+ name: NanoMSMARCO R100
27
+ type: NanoMSMARCO_R100
28
+ metrics:
29
+ - type: map
30
+ value: 0.3407
31
+ name: Map
32
+ - type: mrr@10
33
+ value: 0.3234
34
+ name: Mrr@10
35
+ - type: ndcg@10
36
+ value: 0.3834
37
+ name: Ndcg@10
38
+ - task:
39
+ type: cross-encoder-reranking
40
+ name: Cross Encoder Reranking
41
+ dataset:
42
+ name: NanoNFCorpus R100
43
+ type: NanoNFCorpus_R100
44
+ metrics:
45
+ - type: map
46
+ value: 0.2803
47
+ name: Map
48
+ - type: mrr@10
49
+ value: 0.3818
50
+ name: Mrr@10
51
+ - type: ndcg@10
52
+ value: 0.252
53
+ name: Ndcg@10
54
+ - task:
55
+ type: cross-encoder-reranking
56
+ name: Cross Encoder Reranking
57
+ dataset:
58
+ name: NanoNQ R100
59
+ type: NanoNQ_R100
60
+ metrics:
61
+ - type: map
62
+ value: 0.2448
63
+ name: Map
64
+ - type: mrr@10
65
+ value: 0.2333
66
+ name: Mrr@10
67
+ - type: ndcg@10
68
+ value: 0.2953
69
+ name: Ndcg@10
70
+ - task:
71
+ type: cross-encoder-nano-beir
72
+ name: Cross Encoder Nano BEIR
73
+ dataset:
74
+ name: NanoBEIR R100 mean
75
+ type: NanoBEIR_R100_mean
76
+ metrics:
77
+ - type: map
78
+ value: 0.2886
79
+ name: Map
80
+ - type: mrr@10
81
+ value: 0.3128
82
+ name: Mrr@10
83
+ - type: ndcg@10
84
+ value: 0.3103
85
+ name: Ndcg@10
86
+ ---
87
+
88
+ # CrossEncoder based on microsoft/MiniLM-L12-H384-uncased
89
+
90
+ This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [microsoft/MiniLM-L12-H384-uncased](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased) on the [ms_marco](https://huggingface.co/datasets/microsoft/ms_marco) dataset using the [sentence-transformers](https://www.SBERT.net) library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
91
+
92
+ ## Model Details
93
+
94
+ ### Model Description
95
+ - **Model Type:** Cross Encoder
96
+ - **Base model:** [microsoft/MiniLM-L12-H384-uncased](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased) <!-- at revision 44acabbec0ef496f6dbc93adadea57f376b7c0ec -->
97
+ - **Maximum Sequence Length:** 512 tokens
98
+ - **Number of Output Labels:** 1 label
99
+ - **Training Dataset:**
100
+ - [ms_marco](https://huggingface.co/datasets/microsoft/ms_marco)
101
+ - **Language:** en
102
+ <!-- - **License:** Unknown -->
103
+
104
+ ### Model Sources
105
+
106
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
107
+ - **Documentation:** [Cross Encoder Documentation](https://www.sbert.net/docs/cross_encoder/usage/usage.html)
108
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
109
+ - **Hugging Face:** [Cross Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=cross-encoder)
110
+
111
+ ## Usage
112
+
113
+ ### Direct Usage (Sentence Transformers)
114
+
115
+ First install the Sentence Transformers library:
116
+
117
+ ```bash
118
+ pip install -U sentence-transformers
119
+ ```
120
+
121
+ Then you can load this model and run inference.
122
+ ```python
123
+ from sentence_transformers import CrossEncoder
124
+
125
+ # Download from the 🤗 Hub
126
+ model = CrossEncoder("Wi-Fi/reranker-msmarco-v1.1-MiniLM-L12-H384-uncased-listmle")
127
+ # Get scores for pairs of texts
128
+ pairs = [
129
+ ['what schooling is required to become a nephrologist', 'Educational Requirements. Necessary education to become a nephrologist includes a medical doctoral degree, completion of an Accreditation Council for Graduate Medical Education (ACGME) internal medicine residency program and at least two years of professional experience working with patients. '],
130
+ ['what schooling is required to become a nephrologist', 'How to Become a Nephrologist. Nephrology is a discipline of internal medicine that focuses on the kidney and related conditions and diseases. Nephrologists are specially trained medical doctors that are experts on treating patients with conditions related to the kidneys and other related areas. Nephrologists diagnose and treat a variety of conditions such as kidney disease, electrolyte disorders, high blood pressure, and kidney stones. They perform many different types of tests to assist in diagnosis and treatments such as blood tests, urine tests, biopsies, ultrasounds, and placement of catheters.'],
131
+ ['what schooling is required to become a nephrologist', '10. While in your residency period, try to make contacts with other nephrologists. Having good contacts in the field of nephrology, as well as urology, is a very good step while in your residency and if you are sure of becoming a nephrologist. Since nephrology is a branch of internal medicine, you will have to do your residency in internal medicine first. During your residency period, you will work in a hospital. You are responsible for patients, and supervised by senior residents as well as professional doctors'],
132
+ ['what schooling is required to become a nephrologist', "Residency and Fellowships. Graduation from medical school is just the beginning of the nephrologist's medical education. After graduation, newly minted doctors do their medical residency at a hospital. Would-be nephrologists complete an internal medicine residency, which lasts for three years. Medical School. Budding nephrologists must graduate from a medical school. The road just to get into medical school after graduation from an accredited four-year college or university is arduous."],
133
+ ['what schooling is required to become a nephrologist', 'Formal education and training requirements for physicians are among the most demanding of any occupation-4 years of undergraduate school, 4 years of medical school, and 3 to 8 years of internship and residency, depending on the specialty selected. Physicians specializing in anesthesiology must spend a substantial number of years completing education and training requirements, including 4 years of undergraduate school, 4 … years of medical school, and 3 to 8 years of residency.'],
134
+ ]
135
+ scores = model.predict(pairs)
136
+ print(scores.shape)
137
+ # (5,)
138
+
139
+ # Or rank different texts based on similarity to a single text
140
+ ranks = model.rank(
141
+ 'what schooling is required to become a nephrologist',
142
+ [
143
+ 'Educational Requirements. Necessary education to become a nephrologist includes a medical doctoral degree, completion of an Accreditation Council for Graduate Medical Education (ACGME) internal medicine residency program and at least two years of professional experience working with patients. ',
144
+ 'How to Become a Nephrologist. Nephrology is a discipline of internal medicine that focuses on the kidney and related conditions and diseases. Nephrologists are specially trained medical doctors that are experts on treating patients with conditions related to the kidneys and other related areas. Nephrologists diagnose and treat a variety of conditions such as kidney disease, electrolyte disorders, high blood pressure, and kidney stones. They perform many different types of tests to assist in diagnosis and treatments such as blood tests, urine tests, biopsies, ultrasounds, and placement of catheters.',
145
+ '10. While in your residency period, try to make contacts with other nephrologists. Having good contacts in the field of nephrology, as well as urology, is a very good step while in your residency and if you are sure of becoming a nephrologist. Since nephrology is a branch of internal medicine, you will have to do your residency in internal medicine first. During your residency period, you will work in a hospital. You are responsible for patients, and supervised by senior residents as well as professional doctors',
146
+ "Residency and Fellowships. Graduation from medical school is just the beginning of the nephrologist's medical education. After graduation, newly minted doctors do their medical residency at a hospital. Would-be nephrologists complete an internal medicine residency, which lasts for three years. Medical School. Budding nephrologists must graduate from a medical school. The road just to get into medical school after graduation from an accredited four-year college or university is arduous.",
147
+ 'Formal education and training requirements for physicians are among the most demanding of any occupation-4 years of undergraduate school, 4 years of medical school, and 3 to 8 years of internship and residency, depending on the specialty selected. Physicians specializing in anesthesiology must spend a substantial number of years completing education and training requirements, including 4 years of undergraduate school, 4 … years of medical school, and 3 to 8 years of residency.',
148
+ ]
149
+ )
150
+ # [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
151
+ ```
152
+
153
+ <!--
154
+ ### Direct Usage (Transformers)
155
+
156
+ <details><summary>Click to see the direct usage in Transformers</summary>
157
+
158
+ </details>
159
+ -->
160
+
161
+ <!--
162
+ ### Downstream Usage (Sentence Transformers)
163
+
164
+ You can finetune this model on your own dataset.
165
+
166
+ <details><summary>Click to expand</summary>
167
+
168
+ </details>
169
+ -->
170
+
171
+ <!--
172
+ ### Out-of-Scope Use
173
+
174
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
175
+ -->
176
+
177
+ ## Evaluation
178
+
179
+ ### Metrics
180
+
181
+ #### Cross Encoder Reranking
182
+
183
+ * Datasets: `NanoMSMARCO_R100`, `NanoNFCorpus_R100` and `NanoNQ_R100`
184
+ * Evaluated with [<code>CrossEncoderRerankingEvaluator</code>](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderRerankingEvaluator) with these parameters:
185
+ ```json
186
+ {
187
+ "at_k": 10,
188
+ "always_rerank_positives": true
189
+ }
190
+ ```
191
+
192
+ | Metric | NanoMSMARCO_R100 | NanoNFCorpus_R100 | NanoNQ_R100 |
193
+ |:------------|:---------------------|:---------------------|:---------------------|
194
+ | map | 0.3407 (-0.1489) | 0.2803 (+0.0193) | 0.2448 (-0.1748) |
195
+ | mrr@10 | 0.3234 (-0.1541) | 0.3818 (-0.1180) | 0.2333 (-0.1934) |
196
+ | **ndcg@10** | **0.3834 (-0.1570)** | **0.2520 (-0.0730)** | **0.2953 (-0.2053)** |
197
+
198
+ #### Cross Encoder Nano BEIR
199
+
200
+ * Dataset: `NanoBEIR_R100_mean`
201
+ * Evaluated with [<code>CrossEncoderNanoBEIREvaluator</code>](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderNanoBEIREvaluator) with these parameters:
202
+ ```json
203
+ {
204
+ "dataset_names": [
205
+ "msmarco",
206
+ "nfcorpus",
207
+ "nq"
208
+ ],
209
+ "rerank_k": 100,
210
+ "at_k": 10,
211
+ "always_rerank_positives": true
212
+ }
213
+ ```
214
+
215
+ | Metric | Value |
216
+ |:------------|:---------------------|
217
+ | map | 0.2886 (-0.1015) |
218
+ | mrr@10 | 0.3128 (-0.1552) |
219
+ | **ndcg@10** | **0.3103 (-0.1451)** |
220
+
221
+ <!--
222
+ ## Bias, Risks and Limitations
223
+
224
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
225
+ -->
226
+
227
+ <!--
228
+ ### Recommendations
229
+
230
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
231
+ -->
232
+
233
+ ## Training Details
234
+
235
+ ### Training Dataset
236
+
237
+ #### ms_marco
238
+
239
+ * Dataset: [ms_marco](https://huggingface.co/datasets/microsoft/ms_marco) at [a47ee7a](https://huggingface.co/datasets/microsoft/ms_marco/tree/a47ee7aae8d7d466ba15f9f0bfac3b3681087b3a)
240
+ * Size: 78,704 training samples
241
+ * Columns: <code>query</code>, <code>docs</code>, and <code>labels</code>
242
+ * Approximate statistics based on the first 1000 samples:
243
+ | | query | docs | labels |
244
+ |:--------|:-----------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------|
245
+ | type | string | list | list |
246
+ | details | <ul><li>min: 10 characters</li><li>mean: 34.09 characters</li><li>max: 99 characters</li></ul> | <ul><li>min: 3 elements</li><li>mean: 6.50 elements</li><li>max: 10 elements</li></ul> | <ul><li>min: 3 elements</li><li>mean: 6.50 elements</li><li>max: 10 elements</li></ul> |
247
+ * Samples:
248
+ | query | docs | labels |
249
+ |:----------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------|
250
+ | <code>'average cost of hospital stay per day for sepsis'</code> | <code>['1 The incremental costs incurred by patients on their last full day of hospital stay were $420 per day on average, or just 2.4 percent of the $17,734 average total cost. 2 End-of-stay costs represented only a slightly higher percentage of total costs when the length of stay was as short as four days.', 'Cost per stay and cost per day for hospitalizations with a secondary diagnosis of septicemia also. increased between 2000 and 2009 (from $30,900 to $33,900; from $2,100 to $2,300), although the. average length of these stays remained relatively stable.', 'They found: 1 The incremental costs incurred by patients on their last full day of hospital stay were $420 per day on average, or just 2.4 percent of the $17,734 average total cost. 2 End-of-stay costs represented only a slightly higher percentage of total costs when the length of stay was as short as four days.', '60 percent of hospital stays in 2011. Forty-seven percent of aggregate costs were billed to Medicare, and. the mean c...</code> | <code>[1, 0, 0, 0, 0, ...]</code> |
251
+ | <code>what is lion tailing of trees</code> | <code>["Lion's tail pruning is a method of pruning the lower branches from tree limbs, leaving a top tuft of foliage that resembles a lion's tail. Previously advocated by some arborists as a way of increasing a tree's wind resistance, the practice has become controversial. ", 'Lions-tailed. This over-lifting or over-thinning is often referred to as lions-tailing. It leaves live branches only at the tips of the canopy. Tremendous numbers of sprouts often result from this type of tree mutilation.', 'To the untrained eye, a lion-tailed tree may appear to be well groomed. Many tree trimmers who routinely lion-tail trees are unaware of the problems that they cause. Lion-tailing is harmful to trees and it increases susceptibility to wind-failure. Clients may ask for this type of pruning because they’re unaware that the practice is detrimental to their trees. Many of these trees are hundreds of years old and can be seen on private, city, county and community properties. It is a practice of trimming...</code> | <code>[1, 1, 0, 0, 0, ...]</code> |
252
+ | <code>where is kuwait on the world map</code> | <code>["Kuwait is located in the Middle East. Kuwait is bordered by the Persian Gulf to the east, Iraq to the west and north, and Saudi Arabia to the south. Iraq, Saudi Arabia. Abdali, Al Ahmadi, Al Jahra, Al Khiran, Al Kuwayt (Kuwait), Al Wafrah, As Subayhiyah, Ash Shuwayhk, Az Zawr, Bubiyan, Mardaz Hudud al Abdali, Mina' 'Abd Allah and Qasr as Sabiyah.", 'Iraq. Iraq is located in the Middle East. It is bound by Iran to the east, Turkey to the north, Syria to the northwest, Jordan to the west, Saudi Arabia to the southwest and south as well as Kuwait and the Persian Gulf to the southeast....', 'Map of Kuwait: Map of the World Map of Asia Map of Kuwait. Map-Kuwait. Google-Kuwait. Earth-Kuwait. Weather-Kuwait. World Map Finder, Map of Kuwait. The best web resource for', 'The State of Kuwait is a sovereign emirate on the coast of the Persian Gulf, enclosed by Saudi Arabia to the south and Iraq to the north and west. The name is a diminutive of an Arabic word meaning fortress built near water.....</code> | <code>[1, 0, 0, 0, 0, ...]</code> |
253
+ * Loss: [<code>ListMLELoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#listmleloss) with these parameters:
254
+ ```json
255
+ {
256
+ "activation_fn": "torch.nn.modules.linear.Identity",
257
+ "mini_batch_size": 16,
258
+ "respect_input_order": true
259
+ }
260
+ ```
261
+
262
+ ### Evaluation Dataset
263
+
264
+ #### ms_marco
265
+
266
+ * Dataset: [ms_marco](https://huggingface.co/datasets/microsoft/ms_marco) at [a47ee7a](https://huggingface.co/datasets/microsoft/ms_marco/tree/a47ee7aae8d7d466ba15f9f0bfac3b3681087b3a)
267
+ * Size: 1,000 evaluation samples
268
+ * Columns: <code>query</code>, <code>docs</code>, and <code>labels</code>
269
+ * Approximate statistics based on the first 1000 samples:
270
+ | | query | docs | labels |
271
+ |:--------|:----------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------|
272
+ | type | string | list | list |
273
+ | details | <ul><li>min: 11 characters</li><li>mean: 34.4 characters</li><li>max: 97 characters</li></ul> | <ul><li>min: 3 elements</li><li>mean: 6.50 elements</li><li>max: 10 elements</li></ul> | <ul><li>min: 3 elements</li><li>mean: 6.50 elements</li><li>max: 10 elements</li></ul> |
274
+ * Samples:
275
+ | query | docs | labels |
276
+ |:-----------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------|
277
+ | <code>what schooling is required to become a nephrologist</code> | <code>['Educational Requirements. Necessary education to become a nephrologist includes a medical doctoral degree, completion of an Accreditation Council for Graduate Medical Education (ACGME) internal medicine residency program and at least two years of professional experience working with patients. ', 'How to Become a Nephrologist. Nephrology is a discipline of internal medicine that focuses on the kidney and related conditions and diseases. Nephrologists are specially trained medical doctors that are experts on treating patients with conditions related to the kidneys and other related areas. Nephrologists diagnose and treat a variety of conditions such as kidney disease, electrolyte disorders, high blood pressure, and kidney stones. They perform many different types of tests to assist in diagnosis and treatments such as blood tests, urine tests, biopsies, ultrasounds, and placement of catheters.', '10. While in your residency period, try to make contacts with other nephrologists. Having g...</code> | <code>[1, 0, 0, 0, 0, ...]</code> |
278
+ | <code>shelled peanut/ carb or protein</code> | <code>['One serving of shelled peanuts provides 6 g of carbohydrates and also provides 7 g of protein. Salted shelled peanuts contain 230 mg of sodium, 187 mg of potassium, but they do not provide vitamin A, vitamin C, calcium or iron. Unsalted shelled peanuts contain no sodium, calcium or iron, but they do provide 180 mg of potassium. Both salted and unsalted shelled peanuts provide 2 g of dietary fiber.', 'Carbs in Peanuts. The favorite choice for the term Peanuts is 1 ounce of Peanuts which has about 5 grams of carbohydrate. The total carbohyrate, sugar, fiber and estimated net carbs (non-fiber carbs) for a variety of types and serving sizes of Peanuts is shown below. View other nutritional values (such as Calories or Fats) using the filter below: Calories | Total Carbs | Total Fats | Protein | Sodium | Cholesterol | Vitamins.', 'A 1-ounce serving of peanuts provides 7g of protein, which can meet up to 15 percent of your daily protein needs. Fiber, which accounts for over 1/3 of the carbohydrates in peanuts, is beneficial to the digestive system and slows the absorption of sugar and fat, helping your body regulate blood sugar levels.', 'Protein, fats, and fiber are the major components that make up peanuts. The good news is that these major components are all the healthy types when it comes to peanuts. The protein is plant-based; the fat is unsaturated, and the fiber is the main type of complex carbohydrate in peanuts.', 'When you think of healthy fats, you can think of peanuts, peanut butter, and peanut oil. That is because at least half of the fat in peanuts is heart-healthy monounsaturated fat, the kind found in olive oil and avocados. And over 30% is polyunsaturated fat; another good fat important in a healthy diet.']</code> | <code>[1, 0, 0, 0, 0]</code> |
279
+ | <code>terahertz radiation definition</code> | <code>['SecurActive Performance Vision. The terahertz, abbreviated THz, is a unit of electromagnetic (EM) wave frequency equal to one trillion hertz (10 12 Hz). The terahertz is used as an indicator of the frequency of infrared (IR), visible, and ultraviolet (UV) radiation. Download this Pocket Guide to Network Management and Monitoring. The terahertz is not commonly used in computer and wireless technology, although it is possible that a microprocessor with a clock speed of 1 THz might someday be developed.', 'Electromagnetic radiation with waves of frequencies ranging from 0.3 × 10 12 to 3 × 10 12 hertz and of wavelengths ranging from 0.1 to 1 millimeter of potential use in detection, imaging, and communications technologies. Also called submillimeter radiation. Radiation from airport body scanner may detect early signs of skin ... by Asian News International. is non-ionizing, and reliable studies have shown that active operation in this frequency band is harmless to humans.', 'How to cite...</code> | <code>[1, 0, 0, 0, 0, ...]</code> |
280
+ * Loss: [<code>ListMLELoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#listmleloss) with these parameters:
281
+ ```json
282
+ {
283
+ "activation_fn": "torch.nn.modules.linear.Identity",
284
+ "mini_batch_size": 16,
285
+ "respect_input_order": true
286
+ }
287
+ ```
288
+
289
+ ### Training Hyperparameters
290
+ #### Non-Default Hyperparameters
291
+
292
+ - `eval_strategy`: steps
293
+ - `per_device_train_batch_size`: 16
294
+ - `per_device_eval_batch_size`: 16
295
+ - `learning_rate`: 2e-05
296
+ - `num_train_epochs`: 1
297
+ - `warmup_ratio`: 0.1
298
+ - `seed`: 12
299
+ - `bf16`: True
300
+ - `load_best_model_at_end`: True
301
+
302
+ #### All Hyperparameters
303
+ <details><summary>Click to expand</summary>
304
+
305
+ - `overwrite_output_dir`: False
306
+ - `do_predict`: False
307
+ - `eval_strategy`: steps
308
+ - `prediction_loss_only`: True
309
+ - `per_device_train_batch_size`: 16
310
+ - `per_device_eval_batch_size`: 16
311
+ - `per_gpu_train_batch_size`: None
312
+ - `per_gpu_eval_batch_size`: None
313
+ - `gradient_accumulation_steps`: 1
314
+ - `eval_accumulation_steps`: None
315
+ - `torch_empty_cache_steps`: None
316
+ - `learning_rate`: 2e-05
317
+ - `weight_decay`: 0.0
318
+ - `adam_beta1`: 0.9
319
+ - `adam_beta2`: 0.999
320
+ - `adam_epsilon`: 1e-08
321
+ - `max_grad_norm`: 1.0
322
+ - `num_train_epochs`: 1
323
+ - `max_steps`: -1
324
+ - `lr_scheduler_type`: linear
325
+ - `lr_scheduler_kwargs`: {}
326
+ - `warmup_ratio`: 0.1
327
+ - `warmup_steps`: 0
328
+ - `log_level`: passive
329
+ - `log_level_replica`: warning
330
+ - `log_on_each_node`: True
331
+ - `logging_nan_inf_filter`: True
332
+ - `save_safetensors`: True
333
+ - `save_on_each_node`: False
334
+ - `save_only_model`: False
335
+ - `restore_callback_states_from_checkpoint`: False
336
+ - `no_cuda`: False
337
+ - `use_cpu`: False
338
+ - `use_mps_device`: False
339
+ - `seed`: 12
340
+ - `data_seed`: None
341
+ - `jit_mode_eval`: False
342
+ - `use_ipex`: False
343
+ - `bf16`: True
344
+ - `fp16`: False
345
+ - `fp16_opt_level`: O1
346
+ - `half_precision_backend`: auto
347
+ - `bf16_full_eval`: False
348
+ - `fp16_full_eval`: False
349
+ - `tf32`: None
350
+ - `local_rank`: 0
351
+ - `ddp_backend`: None
352
+ - `tpu_num_cores`: None
353
+ - `tpu_metrics_debug`: False
354
+ - `debug`: []
355
+ - `dataloader_drop_last`: False
356
+ - `dataloader_num_workers`: 0
357
+ - `dataloader_prefetch_factor`: None
358
+ - `past_index`: -1
359
+ - `disable_tqdm`: False
360
+ - `remove_unused_columns`: True
361
+ - `label_names`: None
362
+ - `load_best_model_at_end`: True
363
+ - `ignore_data_skip`: False
364
+ - `fsdp`: []
365
+ - `fsdp_min_num_params`: 0
366
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
367
+ - `tp_size`: 0
368
+ - `fsdp_transformer_layer_cls_to_wrap`: None
369
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
370
+ - `deepspeed`: None
371
+ - `label_smoothing_factor`: 0.0
372
+ - `optim`: adamw_torch
373
+ - `optim_args`: None
374
+ - `adafactor`: False
375
+ - `group_by_length`: False
376
+ - `length_column_name`: length
377
+ - `ddp_find_unused_parameters`: None
378
+ - `ddp_bucket_cap_mb`: None
379
+ - `ddp_broadcast_buffers`: False
380
+ - `dataloader_pin_memory`: True
381
+ - `dataloader_persistent_workers`: False
382
+ - `skip_memory_metrics`: True
383
+ - `use_legacy_prediction_loop`: False
384
+ - `push_to_hub`: False
385
+ - `resume_from_checkpoint`: None
386
+ - `hub_model_id`: None
387
+ - `hub_strategy`: every_save
388
+ - `hub_private_repo`: None
389
+ - `hub_always_push`: False
390
+ - `gradient_checkpointing`: False
391
+ - `gradient_checkpointing_kwargs`: None
392
+ - `include_inputs_for_metrics`: False
393
+ - `include_for_metrics`: []
394
+ - `eval_do_concat_batches`: True
395
+ - `fp16_backend`: auto
396
+ - `push_to_hub_model_id`: None
397
+ - `push_to_hub_organization`: None
398
+ - `mp_parameters`:
399
+ - `auto_find_batch_size`: False
400
+ - `full_determinism`: False
401
+ - `torchdynamo`: None
402
+ - `ray_scope`: last
403
+ - `ddp_timeout`: 1800
404
+ - `torch_compile`: False
405
+ - `torch_compile_backend`: None
406
+ - `torch_compile_mode`: None
407
+ - `include_tokens_per_second`: False
408
+ - `include_num_input_tokens_seen`: False
409
+ - `neftune_noise_alpha`: None
410
+ - `optim_target_modules`: None
411
+ - `batch_eval_metrics`: False
412
+ - `eval_on_start`: False
413
+ - `use_liger_kernel`: False
414
+ - `eval_use_gather_object`: False
415
+ - `average_tokens_across_devices`: False
416
+ - `prompts`: None
417
+ - `batch_sampler`: batch_sampler
418
+ - `multi_dataset_batch_sampler`: proportional
419
+
420
+ </details>
421
+
422
+ ### Training Logs
423
+ | Epoch | Step | Training Loss | Validation Loss | NanoMSMARCO_R100_ndcg@10 | NanoNFCorpus_R100_ndcg@10 | NanoNQ_R100_ndcg@10 | NanoBEIR_R100_mean_ndcg@10 |
424
+ |:---------:|:--------:|:-------------:|:---------------:|:------------------------:|:-------------------------:|:--------------------:|:--------------------------:|
425
+ | -1 | -1 | - | - | 0.0300 (-0.5104) | 0.2528 (-0.0723) | 0.0168 (-0.4839) | 0.0999 (-0.3555) |
426
+ | 0.0008 | 1 | 14.1367 | - | - | - | - | - |
427
+ | 0.2033 | 250 | 12.2769 | - | - | - | - | - |
428
+ | 0.4065 | 500 | 11.248 | 11.2104 | 0.1129 (-0.4275) | 0.2002 (-0.1248) | 0.1527 (-0.3480) | 0.1553 (-0.3001) |
429
+ | 0.6098 | 750 | 11.2506 | - | - | - | - | - |
430
+ | **0.813** | **1000** | **11.1721** | **11.1729** | **0.3834 (-0.1570)** | **0.2520 (-0.0730)** | **0.2953 (-0.2053)** | **0.3103 (-0.1451)** |
431
+ | -1 | -1 | - | - | 0.3834 (-0.1570) | 0.2520 (-0.0730) | 0.2953 (-0.2053) | 0.3103 (-0.1451) |
432
+
433
+ * The bold row denotes the saved checkpoint.
434
+
435
+ ### Framework Versions
436
+ - Python: 3.11.11
437
+ - Sentence Transformers: 4.1.0
438
+ - Transformers: 4.51.3
439
+ - PyTorch: 2.6.0+cu124
440
+ - Accelerate: 1.6.0
441
+ - Datasets: 3.5.0
442
+ - Tokenizers: 0.21.1
443
+
444
+ ## Citation
445
+
446
+ ### BibTeX
447
+
448
+ #### Sentence Transformers
449
+ ```bibtex
450
+ @inproceedings{reimers-2019-sentence-bert,
451
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
452
+ author = "Reimers, Nils and Gurevych, Iryna",
453
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
454
+ month = "11",
455
+ year = "2019",
456
+ publisher = "Association for Computational Linguistics",
457
+ url = "https://arxiv.org/abs/1908.10084",
458
+ }
459
+ ```
460
+
461
+ #### ListMLELoss
462
+ ```bibtex
463
+ @inproceedings{10.1145/1390156.1390306,
464
+ title = {Listwise Approach to Learning to Rank - Theory and Algorithm},
465
+ author = {Xia, Fen and Liu, Tie-Yan and Wang, Jue and Zhang, Wensheng and Li, Hang},
466
+ booktitle = {Proceedings of the 25th International Conference on Machine Learning},
467
+ pages = {1192-1199},
468
+ year = {2008},
469
+ url = {https://doi.org/10.1145/1390156.1390306},
470
+ }
471
+ ```
472
+
473
+ <!--
474
+ ## Glossary
475
+
476
+ *Clearly define terms in order to be accessible across audiences.*
477
+ -->
478
+
479
+ <!--
480
+ ## Model Card Authors
481
+
482
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
483
+ -->
484
+
485
+ <!--
486
+ ## Model Card Contact
487
+
488
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
489
+ -->
config.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "hidden_act": "gelu",
8
+ "hidden_dropout_prob": 0.1,
9
+ "hidden_size": 384,
10
+ "id2label": {
11
+ "0": "LABEL_0"
12
+ },
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 1536,
15
+ "label2id": {
16
+ "LABEL_0": 0
17
+ },
18
+ "layer_norm_eps": 1e-12,
19
+ "max_position_embeddings": 512,
20
+ "model_type": "bert",
21
+ "num_attention_heads": 12,
22
+ "num_hidden_layers": 12,
23
+ "pad_token_id": 0,
24
+ "position_embedding_type": "absolute",
25
+ "sentence_transformers": {
26
+ "activation_fn": "torch.nn.modules.activation.Sigmoid",
27
+ "version": "4.1.0"
28
+ },
29
+ "torch_dtype": "float32",
30
+ "transformers_version": "4.51.3",
31
+ "type_vocab_size": 2,
32
+ "use_cache": true,
33
+ "vocab_size": 30522
34
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f2b18f2e2a7552bf2b4915f056a274f140bc62c8a1ca22f68fdaf35470de2d7
3
+ size 133464836
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 512,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff