Gonalb commited on
Commit
ecf317f
·
verified ·
1 Parent(s): 2361536

Add new SentenceTransformer model

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 1024,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,675 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - generated_from_trainer
7
+ - dataset_size:334
8
+ - loss:MatryoshkaLoss
9
+ - loss:MultipleNegativesRankingLoss
10
+ base_model: Snowflake/snowflake-arctic-embed-l
11
+ widget:
12
+ - source_sentence: 'QUESTION #1: What are the potential adverse effects associated
13
+ with the use of peramivir?'
14
+ sentences:
15
+ - "although poultry-to-human and human-to-human trans -\nmission remains relatively\
16
+ \ low. Despite low transmissibility, \nthe reported fatality rate is high (approximately\
17
+ \ 60%).14\nPrevention\nThe Centers for Disease Control and Prevention’s (CDC’s)\
18
+ \ \nAdvisory Committee on Immunization Practices (ACIP) \nand the American Academy\
19
+ \ of Family Physicians (AAFP) \nrecommend annual influenza vaccination for all\
20
+ \ people six \nmonths and older who do not have contraindications. 15,16 \nVaccination\
21
+ \ efforts should target people at increased risk of \ncomplicated or severe influenza\
22
+ \ (Table 117-19) and those who \ncare for or live with high-risk individuals,\
23
+ \ including health \ncare professionals. 15 Two previous FPM articles provided"
24
+ - 'increased sensitivity to pain.60 These cytokines are also
25
+
26
+ associated with URTIs and may mediate mood changes
27
+
28
+ associated with these infections.
29
+
30
+ Anorexia
31
+
32
+ Anorexia is a common behavioural response to URTIs,
33
+
34
+ and this response has entered the folklore as advice to
35
+
36
+ Figure 4: Fever is caused by cytokines released from macrophages and other
37
+
38
+ immune cells
39
+
40
+ The cytokines may act on vagal nerve endings or enter the brain to cause a
41
+
42
+ resetting of the temperature control centre in the hypothalamus. The
43
+
44
+ hypothalamus causes shivering and constriction of skin blood vessels and also
45
+
46
+ initiates a sensation of chilliness that is perceived at the level of the cerebral
47
+
48
+ cortex. IL=interleukin; TNF=tumour necrosis factor.
49
+
50
+ Vagal
51
+
52
+ nerves
53
+
54
+ ShiveringMacrophages'
55
+ - "older who have been \nsymptomatic for no \nmore than 48 hours\nContraindicated\
56
+ \ in people \nwith serious hypersensitivity or \nanaphylaxis to peramivir or any\
57
+ \ \ncomponent of the product\nPotential adverse effects include \ndiarrhea, nausea,\
58
+ \ vomiting, and \nneutropenia\nWeigh risks and benefits during \npregnancy; no\
59
+ \ human data \navailable; no known risk of \nembryo-fetal toxicity based on \n\
60
+ animal data at 8 times the recom -\nmended human dose; possible \nrisk of embryo-fetal\
61
+ \ toxicity with \ncontinuous intravenous infusion \nbased on limited animal data\n\
62
+ Baloxavir (Xofluza), \navailable as oral \ntablets\nNA ($160) Adults and children\
63
+ \ 12 years \nand older: \n88 to 174 lb (40 to 79 kg): \nsingle dose of 40 mg\
64
+ \ \n≥ 175 lb (80 kg): single dose \nof 80 mg"
65
+ - source_sentence: Why is Influenza A most responsible for causing pandemics?
66
+ sentences:
67
+ - "on the first day of symptoms, medications containing ibu -\nprofen and pseudoephedrine\
68
+ \ may reduce the severity of cold \nsymptoms.35 Antihistamine monotherapy is not\
69
+ \ effective \nfor relieving cough.6,23\nIpratropium. Inhaled ipratropium is the\
70
+ \ only medication \nthat improves persistent cough related to URI in adults. 24,36\
71
+ \ \nTABLE 1\nDifferential Diagnosis for the Common Cold\nDiagnosis\nSymptom \n\
72
+ onset Cough Sore throat Fever Rhinorrhea Aches Watery eyes Sneezing\nNasal \n\
73
+ congestion Headache\nShortness \nof breath\nAcute \nbronchitis\nGradual Prominent,\
74
+ \ per-\nsistent, dry or wet\nCommon None or low \ngrade\nUncommon Mild Common\
75
+ \ Uncommon Uncommon Common, mild Common\nAllergic \nrhinitis\nGradual Common,\
76
+ \ chronic Possible, especially \non awakening\nNone Common,"
77
+ - "Patient information: Handouts on this topic are available \nat https:// family\
78
+ \ doctor.org/preventing-the-flu and https:// \nfamily doctor.org/flu-myths.\n\
79
+ Influenza is an acute viral respiratory infection that causes significant morbidity\
80
+ \ and mortality worldwide. Three types of influ-\nenza cause disease in humans.\
81
+ \ Influenza A is the type most responsible for causing pandemics because of its\
82
+ \ high susceptibility \nto antigenic variation. Influenza is highly contagious,\
83
+ \ and the hallmark of infection is abrupt onset of fever, cough, chills or \n\
84
+ sweats, myalgias, and malaise. For most patients in the outpatient setting, the\
85
+ \ diagnosis is made clinically, and laboratory con-"
86
+ - "www.aafp.org/fpm/2017/0900/p6.html\n 22. Centers for Disease Control and Prevention.\
87
+ \ Influenza (flu): immuno -\ngenicity, efficacy, and effectiveness of influenza\
88
+ \ vaccines. Updated \nAugust 23, 2018. Accessed January 22, 2019. https:// www.cdc.gov/flu/\n\
89
+ professionals/acip/2018-2019/background/immunogenicity.htm\n 23. DiazGranados\
90
+ \ CA, Dunning AJ, Kimmel M, et al. Efficacy of high-dose \nversus standard-dose\
91
+ \ influenza vaccine in older adults. N Engl J Med. \n2014; 371(7): 635-645.\n\
92
+ \ 24. DiazGranados CA, Robertson CA, Talbot HK, et al. Prevention of serious\
93
+ \ \nevents in adults 65 years of age or older: a comparison between high-\ndose\
94
+ \ and standard-dose inactivated influenza vaccines. Vaccine. 2015; \n33(38):\
95
+ \ 4988-4993."
96
+ - source_sentence: How does the negative likelihood ratio for digital immunoassays
97
+ compare between adults and children for Influenza A?
98
+ sentences:
99
+ - "17. Erlikh IV, Abraham S, Kondamudi VK. Management of influenza. Am \nFam Physician\
100
+ \ . 2010; 82(9): 1087-1095. Accessed September 5, 2019. \nhttps:// www.aafp.org/afp/2010/1101/p1087.html\n\
101
+ \ 18. Centers for Disease Control and Prevention. Influenza (flu): for clini\
102
+ \ -\ncians: antiviral medication. Updated Decemebr 27, 2018. Accessed \nFebruary\
103
+ \ 24, 2019. https:// www.cdc.gov/flu/professionals/antivirals/\nsummary-clinicians.htm\n\
104
+ \ 19. Centers for Disease Control and Prevention. Influenza (flu): guide for\
105
+ \ \nconsidering influenza testing. Updated March 4, 2019. Accessed Octo -\nber\
106
+ \ 5, 2019. https:// www.cdc.gov/flu/professionals/diagnosis/consider-\ninfluenza-testing.htm"
107
+ - "TABLE 3\nAccuracy of Point-of-Care Tests for Influenza\nTest\nPositive \nlikelihood\
108
+ \ \nratio\nNegative \nlikelihood \nratio\nLow prevalence (5%) High prevalence\
109
+ \ (33%)\nPositive \npredictive \nvalue (%)\nNegative \npredictive \nvalue (%)\n\
110
+ Positive \npredictive \nvalue (%)\nNegative \npredictive \nvalue (%)\nInfluenza\
111
+ \ A\nAdults \nCommercially available rapid influenza tests 85 0.58 82 3\
112
+ \ 98 22\nDigital immunoassays 23 0.25 55 1 92 11\nRapid nucleic acid amplification\
113
+ \ tests 44 0.13 70 1 96 6\nChildren \nCommercially available rapid influenza\
114
+ \ tests 76 0.39 80 2 97 16\nDigital immunoassays 46 0.13 71 1 96 6\nRapid nucleic\
115
+ \ acid amplification tests 90 0.10 83 0 98 5\nInfluenza B\nAdults \nCommercially\
116
+ \ available rapid influenza tests 332 0.67 95 3 99 25"
117
+ - "recommended dosages. 28 However, extended treatment \ncourses may be indicated\
118
+ \ in critically ill patients. 18 Support-\nive treatment and management of complications,\
119
+ \ including \npotential secondary bacterial pneumonia, are paramount. \nCorticosteroids\
120
+ \ are not recommended unless the patient \nhas another approved indication for\
121
+ \ their use.18,28 Treatment \nresistance should be considered in patients who\
122
+ \ take anti -\nvirals and develop lower respiratory tract disease, although \n\
123
+ this is less likely than natural disease progression and more \ncommon in immunosuppressed\
124
+ \ patients.18\nPregnancy is an independent risk factor for complicated \ninfluenza.\
125
+ \ The risk of maternal death increases with each"
126
+ - source_sentence: What is the role of ipratropium in the treatment of the common
127
+ cold according to the context?
128
+ sentences:
129
+ - "sistent, dry or wet\nCommon None or low \ngrade\nUncommon Mild Common Uncommon\
130
+ \ Uncommon Common, mild Common\nAllergic \nrhinitis\nGradual Common, chronic Possible,\
131
+ \ especially \non awakening\nNone Common, \nprominent\nNone Common Prominent Common\
132
+ \ Uncommon Uncommon\nBacterial \nsinusitis\nGradual Common Common Common Common\
133
+ \ Common Uncommon Uncommon Common Common Uncommon\nCommon \ncold\nGradual Common,\
134
+ \ dry Common None or low \ngrade\nCommon Mild Common Common Common Common, mild\
135
+ \ Uncommon\nInfluenza Abrupt Common, dry \nhacking\nCommon Characteristic; \
136
+ \ \nhigh and rises \nrapidly\nCommon Early, \nprominent\nUncommon Uncommon Possible\
137
+ \ Prominent Uncommon\nPertussis Gradual Prominent, parox-\nysmal, whoop-like\n\
138
+ Uncommon None or low \ngrade"
139
+ - 'common cold are inhibited by intranasal administration
140
+
141
+ of ipratropium.25 The nasal discharge also consists of a
142
+
143
+ protein-rich plasma exudate derived from subepithelial
144
+
145
+ capillaries,28 which may explain why anticholinergics
146
+
147
+ only partly inhibit nasal discharge associated with
148
+
149
+ URTIs.27
150
+
151
+ The colour of nasal discharge and sputum is often
152
+
153
+ used as a clinical marker to determine whether or not to
154
+
155
+ prescribe antibiotics but there is no evidence from the
156
+
157
+ literature that supports this concept,29 since colour
158
+
159
+ changes in nasal discharge or sputum reflect the severity
160
+
161
+ of the inflammatory response30 rather than the nature of
162
+
163
+ the infection. Much of the literature relates to colour
164
+
165
+ changes in sputum and the lower airways but the same'
166
+ - "release by leukocytic pyrogen (interleukin-1). A mechanism for the\nincreased\
167
+ \ degradation of muscle proteins during fever. N Engl J\nMed1983; 308: 553–58.\n\
168
+ 64 Kotler DP. Cachexia. Ann Intern Med2000; 133: 622–34. \n65 Ferreira SH. Prostaglandins,\
169
+ \ pain, and inflammation. Agents\nActions Suppl1986; 19: 91–98."
170
+ - source_sentence: 'QUESTION #1: How might changes in posture from sitting to supine
171
+ affect sinus pain according to the context?'
172
+ sentences:
173
+ - 'gas absorption from the sinus and “vacuum maxillary
174
+
175
+ sinusitis”.37 However, sinuses with patent ostia may also
176
+
177
+ be painful, indicating that the generation of
178
+
179
+ inflammatory mediators within the sinus may be
180
+
181
+ sufficient to trigger the sensation of pain either by direct
182
+
183
+ stimulation of pain nerve fibres or via distension of blood
184
+
185
+ vessels that are also served by sensory nerves.36 Changes
186
+
187
+ in posture from sitting to supine cause an increase in
188
+
189
+ sinus pain that may be related to dilation of the blood
190
+
191
+ vessels draining the sinus caused by an increase in
192
+
193
+ venous pressure. Pressure changes in the sinus may also
194
+
195
+ cause pain by stimulation of branches of the trigeminal
196
+
197
+ nerve that course in and around the sinuses.37
198
+
199
+ Watery eyes'
200
+ - "American Indians and Alaska Natives\nChildren younger than 5 years (particularly\
201
+ \ those younger \nthan 2 years)\nInstitutionalized adults (e.g., residents of\
202
+ \ nursing homes or \nchronic care facilities)\nPregnant and postpartum women (up\
203
+ \ to 2 weeks postpartum, \nincluding pregnancy loss)\nAdapted with permission\
204
+ \ from Erlikh IV, Abraham S, Kondamudi VK. \nManagement of influenza. Am Fam Physician.\
205
+ \ 2010; 82(9): 1088, with \nadditional information from references 18 and 19."
206
+ - "sary Antibiotics\nStep Examples\nExplain why \nantibiotics will \nnot help\n\
207
+ “The common cold is caused by a virus, so antibiot -\nics won’t help.”\n“Antibiotics\
208
+ \ can’t fight viruses like colds. Taking them \nwon’t do any good this time and\
209
+ \ may hurt their \nchances of fighting bacterial infections you might \nget in\
210
+ \ the future.”\nSuggest treat-\nments that might \nhelp\n“You can try honey for\
211
+ \ your cough, ibuprofen or \nacetaminophen for your muscle aches, and nasal or\
212
+ \ \noral decongestants with or without an antihistamine \nfor your congestion.”\n\
213
+ Manage expec-\ntations for length \nof illness\n“Cold viruses can make you feel\
214
+ \ lousy. Most people \nstart to feel better after about a week, but some -\ntimes\
215
+ \ the cough can last even longer, especially if \nyou smoke.”"
216
+ pipeline_tag: sentence-similarity
217
+ library_name: sentence-transformers
218
+ metrics:
219
+ - cosine_accuracy@1
220
+ - cosine_accuracy@3
221
+ - cosine_accuracy@5
222
+ - cosine_accuracy@10
223
+ - cosine_precision@1
224
+ - cosine_precision@3
225
+ - cosine_precision@5
226
+ - cosine_precision@10
227
+ - cosine_recall@1
228
+ - cosine_recall@3
229
+ - cosine_recall@5
230
+ - cosine_recall@10
231
+ - cosine_ndcg@10
232
+ - cosine_mrr@10
233
+ - cosine_map@100
234
+ model-index:
235
+ - name: SentenceTransformer based on Snowflake/snowflake-arctic-embed-l
236
+ results:
237
+ - task:
238
+ type: information-retrieval
239
+ name: Information Retrieval
240
+ dataset:
241
+ name: Unknown
242
+ type: unknown
243
+ metrics:
244
+ - type: cosine_accuracy@1
245
+ value: 0.75
246
+ name: Cosine Accuracy@1
247
+ - type: cosine_accuracy@3
248
+ value: 0.9166666666666666
249
+ name: Cosine Accuracy@3
250
+ - type: cosine_accuracy@5
251
+ value: 1.0
252
+ name: Cosine Accuracy@5
253
+ - type: cosine_accuracy@10
254
+ value: 1.0
255
+ name: Cosine Accuracy@10
256
+ - type: cosine_precision@1
257
+ value: 0.75
258
+ name: Cosine Precision@1
259
+ - type: cosine_precision@3
260
+ value: 0.3055555555555555
261
+ name: Cosine Precision@3
262
+ - type: cosine_precision@5
263
+ value: 0.19999999999999998
264
+ name: Cosine Precision@5
265
+ - type: cosine_precision@10
266
+ value: 0.09999999999999999
267
+ name: Cosine Precision@10
268
+ - type: cosine_recall@1
269
+ value: 0.75
270
+ name: Cosine Recall@1
271
+ - type: cosine_recall@3
272
+ value: 0.9166666666666666
273
+ name: Cosine Recall@3
274
+ - type: cosine_recall@5
275
+ value: 1.0
276
+ name: Cosine Recall@5
277
+ - type: cosine_recall@10
278
+ value: 1.0
279
+ name: Cosine Recall@10
280
+ - type: cosine_ndcg@10
281
+ value: 0.8864909792836682
282
+ name: Cosine Ndcg@10
283
+ - type: cosine_mrr@10
284
+ value: 0.8486111111111113
285
+ name: Cosine Mrr@10
286
+ - type: cosine_map@100
287
+ value: 0.8486111111111111
288
+ name: Cosine Map@100
289
+ ---
290
+
291
+ # SentenceTransformer based on Snowflake/snowflake-arctic-embed-l
292
+
293
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Snowflake/snowflake-arctic-embed-l](https://huggingface.co/Snowflake/snowflake-arctic-embed-l). It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
294
+
295
+ ## Model Details
296
+
297
+ ### Model Description
298
+ - **Model Type:** Sentence Transformer
299
+ - **Base model:** [Snowflake/snowflake-arctic-embed-l](https://huggingface.co/Snowflake/snowflake-arctic-embed-l) <!-- at revision d8fb21ca8d905d2832ee8b96c894d3298964346b -->
300
+ - **Maximum Sequence Length:** 512 tokens
301
+ - **Output Dimensionality:** 1024 dimensions
302
+ - **Similarity Function:** Cosine Similarity
303
+ <!-- - **Training Dataset:** Unknown -->
304
+ <!-- - **Language:** Unknown -->
305
+ <!-- - **License:** Unknown -->
306
+
307
+ ### Model Sources
308
+
309
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
310
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
311
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
312
+
313
+ ### Full Model Architecture
314
+
315
+ ```
316
+ SentenceTransformer(
317
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
318
+ (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
319
+ (2): Normalize()
320
+ )
321
+ ```
322
+
323
+ ## Usage
324
+
325
+ ### Direct Usage (Sentence Transformers)
326
+
327
+ First install the Sentence Transformers library:
328
+
329
+ ```bash
330
+ pip install -U sentence-transformers
331
+ ```
332
+
333
+ Then you can load this model and run inference.
334
+ ```python
335
+ from sentence_transformers import SentenceTransformer
336
+
337
+ # Download from the 🤗 Hub
338
+ model = SentenceTransformer("Gonalb/flucold-ft-v0")
339
+ # Run inference
340
+ sentences = [
341
+ 'QUESTION #1: How might changes in posture from sitting to supine affect sinus pain according to the context?',
342
+ 'gas absorption from the sinus and “vacuum maxillary\nsinusitis”.37 However, sinuses with patent ostia may also\nbe painful, indicating that the generation of\ninflammatory mediators within the sinus may be\nsufficient to trigger the sensation of pain either by direct\nstimulation of pain nerve fibres or via distension of blood\nvessels that are also served by sensory nerves.36 Changes\nin posture from sitting to supine cause an increase in\nsinus pain that may be related to dilation of the blood\nvessels draining the sinus caused by an increase in\nvenous pressure. Pressure changes in the sinus may also\ncause pain by stimulation of branches of the trigeminal\nnerve that course in and around the sinuses.37\nWatery eyes',
343
+ 'American Indians and Alaska Natives\nChildren younger than 5 years (particularly those younger \nthan 2 years)\nInstitutionalized adults (e.g., residents of nursing homes or \nchronic care facilities)\nPregnant and postpartum women (up to 2 weeks postpartum, \nincluding pregnancy loss)\nAdapted with permission from Erlikh IV, Abraham S, Kondamudi VK. \nManagement of influenza. Am Fam Physician. 2010; 82(9): 1088, with \nadditional information from references 18 and 19.',
344
+ ]
345
+ embeddings = model.encode(sentences)
346
+ print(embeddings.shape)
347
+ # [3, 1024]
348
+
349
+ # Get the similarity scores for the embeddings
350
+ similarities = model.similarity(embeddings, embeddings)
351
+ print(similarities.shape)
352
+ # [3, 3]
353
+ ```
354
+
355
+ <!--
356
+ ### Direct Usage (Transformers)
357
+
358
+ <details><summary>Click to see the direct usage in Transformers</summary>
359
+
360
+ </details>
361
+ -->
362
+
363
+ <!--
364
+ ### Downstream Usage (Sentence Transformers)
365
+
366
+ You can finetune this model on your own dataset.
367
+
368
+ <details><summary>Click to expand</summary>
369
+
370
+ </details>
371
+ -->
372
+
373
+ <!--
374
+ ### Out-of-Scope Use
375
+
376
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
377
+ -->
378
+
379
+ ## Evaluation
380
+
381
+ ### Metrics
382
+
383
+ #### Information Retrieval
384
+
385
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
386
+
387
+ | Metric | Value |
388
+ |:--------------------|:-----------|
389
+ | cosine_accuracy@1 | 0.75 |
390
+ | cosine_accuracy@3 | 0.9167 |
391
+ | cosine_accuracy@5 | 1.0 |
392
+ | cosine_accuracy@10 | 1.0 |
393
+ | cosine_precision@1 | 0.75 |
394
+ | cosine_precision@3 | 0.3056 |
395
+ | cosine_precision@5 | 0.2 |
396
+ | cosine_precision@10 | 0.1 |
397
+ | cosine_recall@1 | 0.75 |
398
+ | cosine_recall@3 | 0.9167 |
399
+ | cosine_recall@5 | 1.0 |
400
+ | cosine_recall@10 | 1.0 |
401
+ | **cosine_ndcg@10** | **0.8865** |
402
+ | cosine_mrr@10 | 0.8486 |
403
+ | cosine_map@100 | 0.8486 |
404
+
405
+ <!--
406
+ ## Bias, Risks and Limitations
407
+
408
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
409
+ -->
410
+
411
+ <!--
412
+ ### Recommendations
413
+
414
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
415
+ -->
416
+
417
+ ## Training Details
418
+
419
+ ### Training Dataset
420
+
421
+ #### Unnamed Dataset
422
+
423
+ * Size: 334 training samples
424
+ * Columns: <code>sentence_0</code> and <code>sentence_1</code>
425
+ * Approximate statistics based on the first 334 samples:
426
+ | | sentence_0 | sentence_1 |
427
+ |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
428
+ | type | string | string |
429
+ | details | <ul><li>min: 12 tokens</li><li>mean: 24.85 tokens</li><li>max: 61 tokens</li></ul> | <ul><li>min: 61 tokens</li><li>mean: 159.74 tokens</li><li>max: 248 tokens</li></ul> |
430
+ * Samples:
431
+ | sentence_0 | sentence_1 |
432
+ |:------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
433
+ | <code>QUESTION #1: What is the source website from which the document was downloaded?</code> | <code>Downloaded from the American Family Physician website at www.aafp.org/afp. Copyright © 2019 American Academy of Family Physicians. For the private, noncom -<br>mercial use of one individual user of the website. All other rights reserved. Contact [email protected] for copyright questions and/or permission requests.</code> |
434
+ | <code>QUESTION #2: Who should be contacted for copyright questions and/or permission requests regarding the document?</code> | <code>Downloaded from the American Family Physician website at www.aafp.org/afp. Copyright © 2019 American Academy of Family Physicians. For the private, noncom -<br>mercial use of one individual user of the website. All other rights reserved. Contact [email protected] for copyright questions and/or permission requests.</code> |
435
+ | <code>QUESTION #1: Why is early diagnosis essential for antiviral therapy and public-health measures in the community?</code> | <code>syndrome (SARS) 3 because early diagnosis is essential<br>for any antiviral therapy and for the initiation of public-<br>health measures in the community (eg, isolation of<br>infected cases). Here, I discuss the mechanisms that<br>generate symptoms associated with URTIs, especially<br>common cold and flu, but will not review virology in any<br>detail except as regards relevance to symptoms. <br>Is it a cold or flu?<br>The clinical expression of URTIs is variable and is<br>partly influenced by the nature of the infecting virus<br>but to a greater extent is modulated by the age,<br>physiological state, and immunological experience of<br>the host. 4 Depending on these factors, URTIs may<br>occur without symptoms, may kill, or most commonly</code> |
436
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
437
+ ```json
438
+ {
439
+ "loss": "MultipleNegativesRankingLoss",
440
+ "matryoshka_dims": [
441
+ 768,
442
+ 512,
443
+ 256,
444
+ 128,
445
+ 64
446
+ ],
447
+ "matryoshka_weights": [
448
+ 1,
449
+ 1,
450
+ 1,
451
+ 1,
452
+ 1
453
+ ],
454
+ "n_dims_per_step": -1
455
+ }
456
+ ```
457
+
458
+ ### Training Hyperparameters
459
+ #### Non-Default Hyperparameters
460
+
461
+ - `eval_strategy`: steps
462
+ - `per_device_train_batch_size`: 10
463
+ - `per_device_eval_batch_size`: 10
464
+ - `num_train_epochs`: 10
465
+ - `multi_dataset_batch_sampler`: round_robin
466
+
467
+ #### All Hyperparameters
468
+ <details><summary>Click to expand</summary>
469
+
470
+ - `overwrite_output_dir`: False
471
+ - `do_predict`: False
472
+ - `eval_strategy`: steps
473
+ - `prediction_loss_only`: True
474
+ - `per_device_train_batch_size`: 10
475
+ - `per_device_eval_batch_size`: 10
476
+ - `per_gpu_train_batch_size`: None
477
+ - `per_gpu_eval_batch_size`: None
478
+ - `gradient_accumulation_steps`: 1
479
+ - `eval_accumulation_steps`: None
480
+ - `torch_empty_cache_steps`: None
481
+ - `learning_rate`: 5e-05
482
+ - `weight_decay`: 0.0
483
+ - `adam_beta1`: 0.9
484
+ - `adam_beta2`: 0.999
485
+ - `adam_epsilon`: 1e-08
486
+ - `max_grad_norm`: 1
487
+ - `num_train_epochs`: 10
488
+ - `max_steps`: -1
489
+ - `lr_scheduler_type`: linear
490
+ - `lr_scheduler_kwargs`: {}
491
+ - `warmup_ratio`: 0.0
492
+ - `warmup_steps`: 0
493
+ - `log_level`: passive
494
+ - `log_level_replica`: warning
495
+ - `log_on_each_node`: True
496
+ - `logging_nan_inf_filter`: True
497
+ - `save_safetensors`: True
498
+ - `save_on_each_node`: False
499
+ - `save_only_model`: False
500
+ - `restore_callback_states_from_checkpoint`: False
501
+ - `no_cuda`: False
502
+ - `use_cpu`: False
503
+ - `use_mps_device`: False
504
+ - `seed`: 42
505
+ - `data_seed`: None
506
+ - `jit_mode_eval`: False
507
+ - `use_ipex`: False
508
+ - `bf16`: False
509
+ - `fp16`: False
510
+ - `fp16_opt_level`: O1
511
+ - `half_precision_backend`: auto
512
+ - `bf16_full_eval`: False
513
+ - `fp16_full_eval`: False
514
+ - `tf32`: None
515
+ - `local_rank`: 0
516
+ - `ddp_backend`: None
517
+ - `tpu_num_cores`: None
518
+ - `tpu_metrics_debug`: False
519
+ - `debug`: []
520
+ - `dataloader_drop_last`: False
521
+ - `dataloader_num_workers`: 0
522
+ - `dataloader_prefetch_factor`: None
523
+ - `past_index`: -1
524
+ - `disable_tqdm`: False
525
+ - `remove_unused_columns`: True
526
+ - `label_names`: None
527
+ - `load_best_model_at_end`: False
528
+ - `ignore_data_skip`: False
529
+ - `fsdp`: []
530
+ - `fsdp_min_num_params`: 0
531
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
532
+ - `fsdp_transformer_layer_cls_to_wrap`: None
533
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
534
+ - `deepspeed`: None
535
+ - `label_smoothing_factor`: 0.0
536
+ - `optim`: adamw_torch
537
+ - `optim_args`: None
538
+ - `adafactor`: False
539
+ - `group_by_length`: False
540
+ - `length_column_name`: length
541
+ - `ddp_find_unused_parameters`: None
542
+ - `ddp_bucket_cap_mb`: None
543
+ - `ddp_broadcast_buffers`: False
544
+ - `dataloader_pin_memory`: True
545
+ - `dataloader_persistent_workers`: False
546
+ - `skip_memory_metrics`: True
547
+ - `use_legacy_prediction_loop`: False
548
+ - `push_to_hub`: False
549
+ - `resume_from_checkpoint`: None
550
+ - `hub_model_id`: None
551
+ - `hub_strategy`: every_save
552
+ - `hub_private_repo`: None
553
+ - `hub_always_push`: False
554
+ - `gradient_checkpointing`: False
555
+ - `gradient_checkpointing_kwargs`: None
556
+ - `include_inputs_for_metrics`: False
557
+ - `include_for_metrics`: []
558
+ - `eval_do_concat_batches`: True
559
+ - `fp16_backend`: auto
560
+ - `push_to_hub_model_id`: None
561
+ - `push_to_hub_organization`: None
562
+ - `mp_parameters`:
563
+ - `auto_find_batch_size`: False
564
+ - `full_determinism`: False
565
+ - `torchdynamo`: None
566
+ - `ray_scope`: last
567
+ - `ddp_timeout`: 1800
568
+ - `torch_compile`: False
569
+ - `torch_compile_backend`: None
570
+ - `torch_compile_mode`: None
571
+ - `dispatch_batches`: None
572
+ - `split_batches`: None
573
+ - `include_tokens_per_second`: False
574
+ - `include_num_input_tokens_seen`: False
575
+ - `neftune_noise_alpha`: None
576
+ - `optim_target_modules`: None
577
+ - `batch_eval_metrics`: False
578
+ - `eval_on_start`: False
579
+ - `use_liger_kernel`: False
580
+ - `eval_use_gather_object`: False
581
+ - `average_tokens_across_devices`: False
582
+ - `prompts`: None
583
+ - `batch_sampler`: batch_sampler
584
+ - `multi_dataset_batch_sampler`: round_robin
585
+
586
+ </details>
587
+
588
+ ### Training Logs
589
+ | Epoch | Step | cosine_ndcg@10 |
590
+ |:------:|:----:|:--------------:|
591
+ | 1.0 | 34 | 0.9108 |
592
+ | 1.4706 | 50 | 0.9098 |
593
+ | 2.0 | 68 | 0.8834 |
594
+ | 2.9412 | 100 | 0.9051 |
595
+ | 3.0 | 102 | 0.9066 |
596
+ | 4.0 | 136 | 0.9205 |
597
+ | 4.4118 | 150 | 0.9019 |
598
+ | 5.0 | 170 | 0.9156 |
599
+ | 5.8824 | 200 | 0.9247 |
600
+ | 6.0 | 204 | 0.9238 |
601
+ | 7.0 | 238 | 0.9019 |
602
+ | 7.3529 | 250 | 0.8856 |
603
+ | 8.0 | 272 | 0.8856 |
604
+ | 8.8235 | 300 | 0.8879 |
605
+ | 9.0 | 306 | 0.8879 |
606
+ | 10.0 | 340 | 0.8865 |
607
+
608
+
609
+ ### Framework Versions
610
+ - Python: 3.11.11
611
+ - Sentence Transformers: 3.4.1
612
+ - Transformers: 4.48.3
613
+ - PyTorch: 2.5.1+cu124
614
+ - Accelerate: 1.3.0
615
+ - Datasets: 3.3.2
616
+ - Tokenizers: 0.21.0
617
+
618
+ ## Citation
619
+
620
+ ### BibTeX
621
+
622
+ #### Sentence Transformers
623
+ ```bibtex
624
+ @inproceedings{reimers-2019-sentence-bert,
625
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
626
+ author = "Reimers, Nils and Gurevych, Iryna",
627
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
628
+ month = "11",
629
+ year = "2019",
630
+ publisher = "Association for Computational Linguistics",
631
+ url = "https://arxiv.org/abs/1908.10084",
632
+ }
633
+ ```
634
+
635
+ #### MatryoshkaLoss
636
+ ```bibtex
637
+ @misc{kusupati2024matryoshka,
638
+ title={Matryoshka Representation Learning},
639
+ author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
640
+ year={2024},
641
+ eprint={2205.13147},
642
+ archivePrefix={arXiv},
643
+ primaryClass={cs.LG}
644
+ }
645
+ ```
646
+
647
+ #### MultipleNegativesRankingLoss
648
+ ```bibtex
649
+ @misc{henderson2017efficient,
650
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
651
+ 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},
652
+ year={2017},
653
+ eprint={1705.00652},
654
+ archivePrefix={arXiv},
655
+ primaryClass={cs.CL}
656
+ }
657
+ ```
658
+
659
+ <!--
660
+ ## Glossary
661
+
662
+ *Clearly define terms in order to be accessible across audiences.*
663
+ -->
664
+
665
+ <!--
666
+ ## Model Card Authors
667
+
668
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
669
+ -->
670
+
671
+ <!--
672
+ ## Model Card Contact
673
+
674
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
675
+ -->
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "Snowflake/snowflake-arctic-embed-l",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 1024,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 4096,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 16,
17
+ "num_hidden_layers": 24,
18
+ "pad_token_id": 0,
19
+ "position_embedding_type": "absolute",
20
+ "torch_dtype": "float32",
21
+ "transformers_version": "4.48.3",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 30522
25
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.4.1",
4
+ "transformers": "4.48.3",
5
+ "pytorch": "2.5.1+cu124"
6
+ },
7
+ "prompts": {
8
+ "query": "Represent this sentence for searching relevant passages: "
9
+ },
10
+ "default_prompt_name": null,
11
+ "similarity_fn_name": "cosine"
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fac91b1318a851d3ea7340b12e2d7b42a384f6d1dbd763a59717bcfb5c16b944
3
+ size 1336413848
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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_lower_case": true,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "max_length": 512,
50
+ "model_max_length": 512,
51
+ "pad_to_multiple_of": null,
52
+ "pad_token": "[PAD]",
53
+ "pad_token_type_id": 0,
54
+ "padding_side": "right",
55
+ "sep_token": "[SEP]",
56
+ "stride": 0,
57
+ "strip_accents": null,
58
+ "tokenize_chinese_chars": true,
59
+ "tokenizer_class": "BertTokenizer",
60
+ "truncation_side": "right",
61
+ "truncation_strategy": "longest_first",
62
+ "unk_token": "[UNK]"
63
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff