moritzglnr commited on
Commit
2bb2883
1 Parent(s): 978c3ec

Add new SentenceTransformer model.

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
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,798 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: BAAI/bge-base-en-v1.5
3
+ datasets: []
4
+ language:
5
+ - en
6
+ library_name: sentence-transformers
7
+ license: apache-2.0
8
+ metrics:
9
+ - cosine_accuracy@1
10
+ - cosine_accuracy@3
11
+ - cosine_accuracy@5
12
+ - cosine_accuracy@10
13
+ - cosine_precision@1
14
+ - cosine_precision@3
15
+ - cosine_precision@5
16
+ - cosine_precision@10
17
+ - cosine_recall@1
18
+ - cosine_recall@3
19
+ - cosine_recall@5
20
+ - cosine_recall@10
21
+ - cosine_ndcg@10
22
+ - cosine_mrr@10
23
+ - cosine_map@100
24
+ pipeline_tag: sentence-similarity
25
+ tags:
26
+ - sentence-transformers
27
+ - sentence-similarity
28
+ - feature-extraction
29
+ - generated_from_trainer
30
+ - dataset_size:6300
31
+ - loss:MatryoshkaLoss
32
+ - loss:MultipleNegativesRankingLoss
33
+ widget:
34
+ - source_sentence: R&D expense increased by $304 million, or 14.9%, led by Intelligent
35
+ Edge, HPC & AI and Storage in fiscal 2023.
36
+ sentences:
37
+ - What was the growth rate of Visa Inc.'s overall total nominal volume from 2021
38
+ to 2022?
39
+ - How much did Hewlett Packard Enterprise's R&D expenses increase in fiscal 2023?
40
+ - What is the purpose of the Global Day of Joy at Hasbro?
41
+ - source_sentence: In 2022 and continuing into 2023, the Russia-Ukraine conflict was
42
+ a catalyst for an energy crisis in Europe. Government interventions related to
43
+ the energy crisis resulting from the Russia-Ukraine conflict, such as the Market
44
+ Correction Mechanism (price cap), or interventions that may be proposed in the
45
+ future related to the Russia-Ukraine conflict or the conflict in Israel and Gaza
46
+ could also have a negative impact on our business.
47
+ sentences:
48
+ - What are Garmin's core strategies for reducing its environmental impact?
49
+ - What are the potential consequences of the Russia-Ukraine conflict on a company's
50
+ business?
51
+ - What factors influence HP's critical accounting estimates?
52
+ - source_sentence: The increase in other income, net was primarily due to an increase
53
+ in interest income as a result of higher cash balances and higher interest rates.
54
+ sentences:
55
+ - What was the primary reason for the increase in other income, net during the noted
56
+ period?
57
+ - What led to the increase in room expenses at Las Vegas Sands Corp. in 2023?
58
+ - What was the provision for income taxes for the year ended June 30, 2023?
59
+ - source_sentence: When an investment declines below cost basis, management evaluates
60
+ whether the decline in fair value is other than temporary. If deemed other than
61
+ temporary, an impairment charge is recorded.
62
+ sentences:
63
+ - What are the requirements for Gilead's cell therapy products under the FDA's Risk
64
+ Evaluation and Mitigation Strategy program?
65
+ - What are the four focus areas declared by the company to strengthen their performance
66
+ going forward?
67
+ - What triggers the requirement for management to record an impairment charge for
68
+ investments?
69
+ - source_sentence: The total gross fair value of derivatives was listed as $422,232
70
+ million as per the latest financial data without adjustments for counterparty
71
+ netting or collateral.
72
+ sentences:
73
+ - What was the total gross fair value of derivatives as of December 2023 before
74
+ netting adjustments in the consolidated financial statements?
75
+ - How does the company handle the recording and disclosure of contingent liabilities?
76
+ - What is the significance of reporting financial results on a constant currency
77
+ basis?
78
+ model-index:
79
+ - name: BGE base Financial Matryoshka
80
+ results:
81
+ - task:
82
+ type: information-retrieval
83
+ name: Information Retrieval
84
+ dataset:
85
+ name: dim 768
86
+ type: dim_768
87
+ metrics:
88
+ - type: cosine_accuracy@1
89
+ value: 0.7071428571428572
90
+ name: Cosine Accuracy@1
91
+ - type: cosine_accuracy@3
92
+ value: 0.8214285714285714
93
+ name: Cosine Accuracy@3
94
+ - type: cosine_accuracy@5
95
+ value: 0.8614285714285714
96
+ name: Cosine Accuracy@5
97
+ - type: cosine_accuracy@10
98
+ value: 0.9042857142857142
99
+ name: Cosine Accuracy@10
100
+ - type: cosine_precision@1
101
+ value: 0.7071428571428572
102
+ name: Cosine Precision@1
103
+ - type: cosine_precision@3
104
+ value: 0.2738095238095238
105
+ name: Cosine Precision@3
106
+ - type: cosine_precision@5
107
+ value: 0.17228571428571426
108
+ name: Cosine Precision@5
109
+ - type: cosine_precision@10
110
+ value: 0.09042857142857141
111
+ name: Cosine Precision@10
112
+ - type: cosine_recall@1
113
+ value: 0.7071428571428572
114
+ name: Cosine Recall@1
115
+ - type: cosine_recall@3
116
+ value: 0.8214285714285714
117
+ name: Cosine Recall@3
118
+ - type: cosine_recall@5
119
+ value: 0.8614285714285714
120
+ name: Cosine Recall@5
121
+ - type: cosine_recall@10
122
+ value: 0.9042857142857142
123
+ name: Cosine Recall@10
124
+ - type: cosine_ndcg@10
125
+ value: 0.8050065074948352
126
+ name: Cosine Ndcg@10
127
+ - type: cosine_mrr@10
128
+ value: 0.7732902494331064
129
+ name: Cosine Mrr@10
130
+ - type: cosine_map@100
131
+ value: 0.776990609765374
132
+ name: Cosine Map@100
133
+ - task:
134
+ type: information-retrieval
135
+ name: Information Retrieval
136
+ dataset:
137
+ name: dim 512
138
+ type: dim_512
139
+ metrics:
140
+ - type: cosine_accuracy@1
141
+ value: 0.7014285714285714
142
+ name: Cosine Accuracy@1
143
+ - type: cosine_accuracy@3
144
+ value: 0.8214285714285714
145
+ name: Cosine Accuracy@3
146
+ - type: cosine_accuracy@5
147
+ value: 0.8657142857142858
148
+ name: Cosine Accuracy@5
149
+ - type: cosine_accuracy@10
150
+ value: 0.9057142857142857
151
+ name: Cosine Accuracy@10
152
+ - type: cosine_precision@1
153
+ value: 0.7014285714285714
154
+ name: Cosine Precision@1
155
+ - type: cosine_precision@3
156
+ value: 0.2738095238095238
157
+ name: Cosine Precision@3
158
+ - type: cosine_precision@5
159
+ value: 0.17314285714285713
160
+ name: Cosine Precision@5
161
+ - type: cosine_precision@10
162
+ value: 0.09057142857142855
163
+ name: Cosine Precision@10
164
+ - type: cosine_recall@1
165
+ value: 0.7014285714285714
166
+ name: Cosine Recall@1
167
+ - type: cosine_recall@3
168
+ value: 0.8214285714285714
169
+ name: Cosine Recall@3
170
+ - type: cosine_recall@5
171
+ value: 0.8657142857142858
172
+ name: Cosine Recall@5
173
+ - type: cosine_recall@10
174
+ value: 0.9057142857142857
175
+ name: Cosine Recall@10
176
+ - type: cosine_ndcg@10
177
+ value: 0.8035496957871646
178
+ name: Cosine Ndcg@10
179
+ - type: cosine_mrr@10
180
+ value: 0.7707964852607707
181
+ name: Cosine Mrr@10
182
+ - type: cosine_map@100
183
+ value: 0.7744696266512991
184
+ name: Cosine Map@100
185
+ - task:
186
+ type: information-retrieval
187
+ name: Information Retrieval
188
+ dataset:
189
+ name: dim 256
190
+ type: dim_256
191
+ metrics:
192
+ - type: cosine_accuracy@1
193
+ value: 0.6885714285714286
194
+ name: Cosine Accuracy@1
195
+ - type: cosine_accuracy@3
196
+ value: 0.8157142857142857
197
+ name: Cosine Accuracy@3
198
+ - type: cosine_accuracy@5
199
+ value: 0.86
200
+ name: Cosine Accuracy@5
201
+ - type: cosine_accuracy@10
202
+ value: 0.9014285714285715
203
+ name: Cosine Accuracy@10
204
+ - type: cosine_precision@1
205
+ value: 0.6885714285714286
206
+ name: Cosine Precision@1
207
+ - type: cosine_precision@3
208
+ value: 0.27190476190476187
209
+ name: Cosine Precision@3
210
+ - type: cosine_precision@5
211
+ value: 0.172
212
+ name: Cosine Precision@5
213
+ - type: cosine_precision@10
214
+ value: 0.09014285714285714
215
+ name: Cosine Precision@10
216
+ - type: cosine_recall@1
217
+ value: 0.6885714285714286
218
+ name: Cosine Recall@1
219
+ - type: cosine_recall@3
220
+ value: 0.8157142857142857
221
+ name: Cosine Recall@3
222
+ - type: cosine_recall@5
223
+ value: 0.86
224
+ name: Cosine Recall@5
225
+ - type: cosine_recall@10
226
+ value: 0.9014285714285715
227
+ name: Cosine Recall@10
228
+ - type: cosine_ndcg@10
229
+ value: 0.7959304086509564
230
+ name: Cosine Ndcg@10
231
+ - type: cosine_mrr@10
232
+ value: 0.7620759637188204
233
+ name: Cosine Mrr@10
234
+ - type: cosine_map@100
235
+ value: 0.7656989001700307
236
+ name: Cosine Map@100
237
+ - task:
238
+ type: information-retrieval
239
+ name: Information Retrieval
240
+ dataset:
241
+ name: dim 128
242
+ type: dim_128
243
+ metrics:
244
+ - type: cosine_accuracy@1
245
+ value: 0.6871428571428572
246
+ name: Cosine Accuracy@1
247
+ - type: cosine_accuracy@3
248
+ value: 0.7871428571428571
249
+ name: Cosine Accuracy@3
250
+ - type: cosine_accuracy@5
251
+ value: 0.8257142857142857
252
+ name: Cosine Accuracy@5
253
+ - type: cosine_accuracy@10
254
+ value: 0.8828571428571429
255
+ name: Cosine Accuracy@10
256
+ - type: cosine_precision@1
257
+ value: 0.6871428571428572
258
+ name: Cosine Precision@1
259
+ - type: cosine_precision@3
260
+ value: 0.2623809523809524
261
+ name: Cosine Precision@3
262
+ - type: cosine_precision@5
263
+ value: 0.16514285714285712
264
+ name: Cosine Precision@5
265
+ - type: cosine_precision@10
266
+ value: 0.08828571428571427
267
+ name: Cosine Precision@10
268
+ - type: cosine_recall@1
269
+ value: 0.6871428571428572
270
+ name: Cosine Recall@1
271
+ - type: cosine_recall@3
272
+ value: 0.7871428571428571
273
+ name: Cosine Recall@3
274
+ - type: cosine_recall@5
275
+ value: 0.8257142857142857
276
+ name: Cosine Recall@5
277
+ - type: cosine_recall@10
278
+ value: 0.8828571428571429
279
+ name: Cosine Recall@10
280
+ - type: cosine_ndcg@10
281
+ value: 0.7805054661054854
282
+ name: Cosine Ndcg@10
283
+ - type: cosine_mrr@10
284
+ value: 0.7483526077097503
285
+ name: Cosine Mrr@10
286
+ - type: cosine_map@100
287
+ value: 0.7524860233992903
288
+ name: Cosine Map@100
289
+ - task:
290
+ type: information-retrieval
291
+ name: Information Retrieval
292
+ dataset:
293
+ name: dim 64
294
+ type: dim_64
295
+ metrics:
296
+ - type: cosine_accuracy@1
297
+ value: 0.64
298
+ name: Cosine Accuracy@1
299
+ - type: cosine_accuracy@3
300
+ value: 0.7557142857142857
301
+ name: Cosine Accuracy@3
302
+ - type: cosine_accuracy@5
303
+ value: 0.7828571428571428
304
+ name: Cosine Accuracy@5
305
+ - type: cosine_accuracy@10
306
+ value: 0.8428571428571429
307
+ name: Cosine Accuracy@10
308
+ - type: cosine_precision@1
309
+ value: 0.64
310
+ name: Cosine Precision@1
311
+ - type: cosine_precision@3
312
+ value: 0.25190476190476185
313
+ name: Cosine Precision@3
314
+ - type: cosine_precision@5
315
+ value: 0.15657142857142856
316
+ name: Cosine Precision@5
317
+ - type: cosine_precision@10
318
+ value: 0.08428571428571427
319
+ name: Cosine Precision@10
320
+ - type: cosine_recall@1
321
+ value: 0.64
322
+ name: Cosine Recall@1
323
+ - type: cosine_recall@3
324
+ value: 0.7557142857142857
325
+ name: Cosine Recall@3
326
+ - type: cosine_recall@5
327
+ value: 0.7828571428571428
328
+ name: Cosine Recall@5
329
+ - type: cosine_recall@10
330
+ value: 0.8428571428571429
331
+ name: Cosine Recall@10
332
+ - type: cosine_ndcg@10
333
+ value: 0.7386047605712329
334
+ name: Cosine Ndcg@10
335
+ - type: cosine_mrr@10
336
+ value: 0.7057772108843535
337
+ name: Cosine Mrr@10
338
+ - type: cosine_map@100
339
+ value: 0.7112870933540941
340
+ name: Cosine Map@100
341
+ ---
342
+
343
+ # BGE base Financial Matryoshka
344
+
345
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5). 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.
346
+
347
+ ## Model Details
348
+
349
+ ### Model Description
350
+ - **Model Type:** Sentence Transformer
351
+ - **Base model:** [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) <!-- at revision a5beb1e3e68b9ab74eb54cfd186867f64f240e1a -->
352
+ - **Maximum Sequence Length:** 512 tokens
353
+ - **Output Dimensionality:** 768 tokens
354
+ - **Similarity Function:** Cosine Similarity
355
+ <!-- - **Training Dataset:** Unknown -->
356
+ - **Language:** en
357
+ - **License:** apache-2.0
358
+
359
+ ### Model Sources
360
+
361
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
362
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
363
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
364
+
365
+ ### Full Model Architecture
366
+
367
+ ```
368
+ SentenceTransformer(
369
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
370
+ (1): Pooling({'word_embedding_dimension': 768, '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})
371
+ (2): Normalize()
372
+ )
373
+ ```
374
+
375
+ ## Usage
376
+
377
+ ### Direct Usage (Sentence Transformers)
378
+
379
+ First install the Sentence Transformers library:
380
+
381
+ ```bash
382
+ pip install -U sentence-transformers
383
+ ```
384
+
385
+ Then you can load this model and run inference.
386
+ ```python
387
+ from sentence_transformers import SentenceTransformer
388
+
389
+ # Download from the 🤗 Hub
390
+ model = SentenceTransformer("moritzglnr/bge-base-financial-matryoshka")
391
+ # Run inference
392
+ sentences = [
393
+ 'The total gross fair value of derivatives was listed as $422,232 million as per the latest financial data without adjustments for counterparty netting or collateral.',
394
+ 'What was the total gross fair value of derivatives as of December 2023 before netting adjustments in the consolidated financial statements?',
395
+ 'How does the company handle the recording and disclosure of contingent liabilities?',
396
+ ]
397
+ embeddings = model.encode(sentences)
398
+ print(embeddings.shape)
399
+ # [3, 768]
400
+
401
+ # Get the similarity scores for the embeddings
402
+ similarities = model.similarity(embeddings, embeddings)
403
+ print(similarities.shape)
404
+ # [3, 3]
405
+ ```
406
+
407
+ <!--
408
+ ### Direct Usage (Transformers)
409
+
410
+ <details><summary>Click to see the direct usage in Transformers</summary>
411
+
412
+ </details>
413
+ -->
414
+
415
+ <!--
416
+ ### Downstream Usage (Sentence Transformers)
417
+
418
+ You can finetune this model on your own dataset.
419
+
420
+ <details><summary>Click to expand</summary>
421
+
422
+ </details>
423
+ -->
424
+
425
+ <!--
426
+ ### Out-of-Scope Use
427
+
428
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
429
+ -->
430
+
431
+ ## Evaluation
432
+
433
+ ### Metrics
434
+
435
+ #### Information Retrieval
436
+ * Dataset: `dim_768`
437
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
438
+
439
+ | Metric | Value |
440
+ |:--------------------|:----------|
441
+ | cosine_accuracy@1 | 0.7071 |
442
+ | cosine_accuracy@3 | 0.8214 |
443
+ | cosine_accuracy@5 | 0.8614 |
444
+ | cosine_accuracy@10 | 0.9043 |
445
+ | cosine_precision@1 | 0.7071 |
446
+ | cosine_precision@3 | 0.2738 |
447
+ | cosine_precision@5 | 0.1723 |
448
+ | cosine_precision@10 | 0.0904 |
449
+ | cosine_recall@1 | 0.7071 |
450
+ | cosine_recall@3 | 0.8214 |
451
+ | cosine_recall@5 | 0.8614 |
452
+ | cosine_recall@10 | 0.9043 |
453
+ | cosine_ndcg@10 | 0.805 |
454
+ | cosine_mrr@10 | 0.7733 |
455
+ | **cosine_map@100** | **0.777** |
456
+
457
+ #### Information Retrieval
458
+ * Dataset: `dim_512`
459
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
460
+
461
+ | Metric | Value |
462
+ |:--------------------|:-----------|
463
+ | cosine_accuracy@1 | 0.7014 |
464
+ | cosine_accuracy@3 | 0.8214 |
465
+ | cosine_accuracy@5 | 0.8657 |
466
+ | cosine_accuracy@10 | 0.9057 |
467
+ | cosine_precision@1 | 0.7014 |
468
+ | cosine_precision@3 | 0.2738 |
469
+ | cosine_precision@5 | 0.1731 |
470
+ | cosine_precision@10 | 0.0906 |
471
+ | cosine_recall@1 | 0.7014 |
472
+ | cosine_recall@3 | 0.8214 |
473
+ | cosine_recall@5 | 0.8657 |
474
+ | cosine_recall@10 | 0.9057 |
475
+ | cosine_ndcg@10 | 0.8035 |
476
+ | cosine_mrr@10 | 0.7708 |
477
+ | **cosine_map@100** | **0.7745** |
478
+
479
+ #### Information Retrieval
480
+ * Dataset: `dim_256`
481
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
482
+
483
+ | Metric | Value |
484
+ |:--------------------|:-----------|
485
+ | cosine_accuracy@1 | 0.6886 |
486
+ | cosine_accuracy@3 | 0.8157 |
487
+ | cosine_accuracy@5 | 0.86 |
488
+ | cosine_accuracy@10 | 0.9014 |
489
+ | cosine_precision@1 | 0.6886 |
490
+ | cosine_precision@3 | 0.2719 |
491
+ | cosine_precision@5 | 0.172 |
492
+ | cosine_precision@10 | 0.0901 |
493
+ | cosine_recall@1 | 0.6886 |
494
+ | cosine_recall@3 | 0.8157 |
495
+ | cosine_recall@5 | 0.86 |
496
+ | cosine_recall@10 | 0.9014 |
497
+ | cosine_ndcg@10 | 0.7959 |
498
+ | cosine_mrr@10 | 0.7621 |
499
+ | **cosine_map@100** | **0.7657** |
500
+
501
+ #### Information Retrieval
502
+ * Dataset: `dim_128`
503
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
504
+
505
+ | Metric | Value |
506
+ |:--------------------|:-----------|
507
+ | cosine_accuracy@1 | 0.6871 |
508
+ | cosine_accuracy@3 | 0.7871 |
509
+ | cosine_accuracy@5 | 0.8257 |
510
+ | cosine_accuracy@10 | 0.8829 |
511
+ | cosine_precision@1 | 0.6871 |
512
+ | cosine_precision@3 | 0.2624 |
513
+ | cosine_precision@5 | 0.1651 |
514
+ | cosine_precision@10 | 0.0883 |
515
+ | cosine_recall@1 | 0.6871 |
516
+ | cosine_recall@3 | 0.7871 |
517
+ | cosine_recall@5 | 0.8257 |
518
+ | cosine_recall@10 | 0.8829 |
519
+ | cosine_ndcg@10 | 0.7805 |
520
+ | cosine_mrr@10 | 0.7484 |
521
+ | **cosine_map@100** | **0.7525** |
522
+
523
+ #### Information Retrieval
524
+ * Dataset: `dim_64`
525
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
526
+
527
+ | Metric | Value |
528
+ |:--------------------|:-----------|
529
+ | cosine_accuracy@1 | 0.64 |
530
+ | cosine_accuracy@3 | 0.7557 |
531
+ | cosine_accuracy@5 | 0.7829 |
532
+ | cosine_accuracy@10 | 0.8429 |
533
+ | cosine_precision@1 | 0.64 |
534
+ | cosine_precision@3 | 0.2519 |
535
+ | cosine_precision@5 | 0.1566 |
536
+ | cosine_precision@10 | 0.0843 |
537
+ | cosine_recall@1 | 0.64 |
538
+ | cosine_recall@3 | 0.7557 |
539
+ | cosine_recall@5 | 0.7829 |
540
+ | cosine_recall@10 | 0.8429 |
541
+ | cosine_ndcg@10 | 0.7386 |
542
+ | cosine_mrr@10 | 0.7058 |
543
+ | **cosine_map@100** | **0.7113** |
544
+
545
+ <!--
546
+ ## Bias, Risks and Limitations
547
+
548
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
549
+ -->
550
+
551
+ <!--
552
+ ### Recommendations
553
+
554
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
555
+ -->
556
+
557
+ ## Training Details
558
+
559
+ ### Training Dataset
560
+
561
+ #### Unnamed Dataset
562
+
563
+
564
+ * Size: 6,300 training samples
565
+ * Columns: <code>positive</code> and <code>anchor</code>
566
+ * Approximate statistics based on the first 1000 samples:
567
+ | | positive | anchor |
568
+ |:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
569
+ | type | string | string |
570
+ | details | <ul><li>min: 2 tokens</li><li>mean: 45.41 tokens</li><li>max: 371 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 20.32 tokens</li><li>max: 51 tokens</li></ul> |
571
+ * Samples:
572
+ | positive | anchor |
573
+ |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------|
574
+ | <code>The 2023 Form 10-K for Delta Air Lines, Inc. includes various types of financial statements such as consolidated balance sheets, consolidated statements of operations, comprehensive income, cash flows, and stockholders' equity.</code> | <code>What are the primary types of financial statements included in Delta Air Lines, Inc.'s 2023 Form 10-K?</code> |
575
+ | <code>Critical accounting estimates are those that involve a significant level of estimation uncertainty and have had or are reasonably likely to have a material impact on HP's financial condition or results of operations.</code> | <code>What factors influence HP's critical accounting estimates?</code> |
576
+ | <code>The requisite service period for both employee stock options and RSUs is generally four years from the grant date.</code> | <code>What is the recognition period for Etsy's stock options and RSUs granted to employees?</code> |
577
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
578
+ ```json
579
+ {
580
+ "loss": "MultipleNegativesRankingLoss",
581
+ "matryoshka_dims": [
582
+ 768,
583
+ 512,
584
+ 256,
585
+ 128,
586
+ 64
587
+ ],
588
+ "matryoshka_weights": [
589
+ 1,
590
+ 1,
591
+ 1,
592
+ 1,
593
+ 1
594
+ ],
595
+ "n_dims_per_step": -1
596
+ }
597
+ ```
598
+
599
+ ### Training Hyperparameters
600
+ #### Non-Default Hyperparameters
601
+
602
+ - `per_device_train_batch_size`: 32
603
+ - `per_device_eval_batch_size`: 16
604
+ - `gradient_accumulation_steps`: 16
605
+ - `learning_rate`: 2e-05
606
+ - `num_train_epochs`: 1
607
+ - `lr_scheduler_type`: cosine
608
+ - `warmup_ratio`: 0.1
609
+ - `tf32`: False
610
+ - `load_best_model_at_end`: True
611
+ - `batch_sampler`: no_duplicates
612
+
613
+ #### All Hyperparameters
614
+ <details><summary>Click to expand</summary>
615
+
616
+ - `overwrite_output_dir`: False
617
+ - `do_predict`: False
618
+ - `prediction_loss_only`: True
619
+ - `per_device_train_batch_size`: 32
620
+ - `per_device_eval_batch_size`: 16
621
+ - `per_gpu_train_batch_size`: None
622
+ - `per_gpu_eval_batch_size`: None
623
+ - `gradient_accumulation_steps`: 16
624
+ - `eval_accumulation_steps`: None
625
+ - `learning_rate`: 2e-05
626
+ - `weight_decay`: 0.0
627
+ - `adam_beta1`: 0.9
628
+ - `adam_beta2`: 0.999
629
+ - `adam_epsilon`: 1e-08
630
+ - `max_grad_norm`: 1.0
631
+ - `num_train_epochs`: 1
632
+ - `max_steps`: -1
633
+ - `lr_scheduler_type`: cosine
634
+ - `lr_scheduler_kwargs`: {}
635
+ - `warmup_ratio`: 0.1
636
+ - `warmup_steps`: 0
637
+ - `log_level`: passive
638
+ - `log_level_replica`: warning
639
+ - `log_on_each_node`: True
640
+ - `logging_nan_inf_filter`: True
641
+ - `save_safetensors`: True
642
+ - `save_on_each_node`: False
643
+ - `save_only_model`: False
644
+ - `no_cuda`: False
645
+ - `use_cpu`: False
646
+ - `use_mps_device`: False
647
+ - `seed`: 42
648
+ - `data_seed`: None
649
+ - `jit_mode_eval`: False
650
+ - `use_ipex`: False
651
+ - `bf16`: False
652
+ - `fp16`: False
653
+ - `fp16_opt_level`: O1
654
+ - `half_precision_backend`: auto
655
+ - `bf16_full_eval`: False
656
+ - `fp16_full_eval`: False
657
+ - `tf32`: False
658
+ - `local_rank`: 0
659
+ - `ddp_backend`: None
660
+ - `tpu_num_cores`: None
661
+ - `tpu_metrics_debug`: False
662
+ - `debug`: []
663
+ - `dataloader_drop_last`: False
664
+ - `dataloader_num_workers`: 0
665
+ - `dataloader_prefetch_factor`: None
666
+ - `past_index`: -1
667
+ - `disable_tqdm`: False
668
+ - `remove_unused_columns`: True
669
+ - `label_names`: None
670
+ - `load_best_model_at_end`: True
671
+ - `ignore_data_skip`: False
672
+ - `fsdp`: []
673
+ - `fsdp_min_num_params`: 0
674
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
675
+ - `fsdp_transformer_layer_cls_to_wrap`: None
676
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'gradient_accumulation_kwargs': None}
677
+ - `deepspeed`: None
678
+ - `label_smoothing_factor`: 0.0
679
+ - `optim`: adamw_torch
680
+ - `optim_args`: None
681
+ - `adafactor`: False
682
+ - `group_by_length`: False
683
+ - `length_column_name`: length
684
+ - `ddp_find_unused_parameters`: None
685
+ - `ddp_bucket_cap_mb`: None
686
+ - `ddp_broadcast_buffers`: False
687
+ - `dataloader_pin_memory`: True
688
+ - `dataloader_persistent_workers`: False
689
+ - `skip_memory_metrics`: True
690
+ - `use_legacy_prediction_loop`: False
691
+ - `push_to_hub`: False
692
+ - `resume_from_checkpoint`: None
693
+ - `hub_model_id`: None
694
+ - `hub_strategy`: every_save
695
+ - `hub_private_repo`: False
696
+ - `hub_always_push`: False
697
+ - `gradient_checkpointing`: False
698
+ - `gradient_checkpointing_kwargs`: None
699
+ - `include_inputs_for_metrics`: False
700
+ - `eval_do_concat_batches`: True
701
+ - `fp16_backend`: auto
702
+ - `push_to_hub_model_id`: None
703
+ - `push_to_hub_organization`: None
704
+ - `mp_parameters`:
705
+ - `auto_find_batch_size`: False
706
+ - `full_determinism`: False
707
+ - `torchdynamo`: None
708
+ - `ray_scope`: last
709
+ - `ddp_timeout`: 1800
710
+ - `torch_compile`: False
711
+ - `torch_compile_backend`: None
712
+ - `torch_compile_mode`: None
713
+ - `dispatch_batches`: None
714
+ - `split_batches`: None
715
+ - `include_tokens_per_second`: False
716
+ - `include_num_input_tokens_seen`: False
717
+ - `neftune_noise_alpha`: None
718
+ - `optim_target_modules`: None
719
+ - `batch_sampler`: no_duplicates
720
+ - `multi_dataset_batch_sampler`: proportional
721
+
722
+ </details>
723
+
724
+ ### Training Logs
725
+ | Epoch | Step | Training Loss | dim_128_cosine_map@100 | dim_256_cosine_map@100 | dim_512_cosine_map@100 | dim_64_cosine_map@100 | dim_768_cosine_map@100 |
726
+ |:----------:|:------:|:-------------:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|:----------------------:|
727
+ | 0.8122 | 10 | 1.4747 | - | - | - | - | - |
728
+ | **0.9746** | **12** | **-** | **0.7525** | **0.7657** | **0.7745** | **0.7113** | **0.777** |
729
+
730
+ * The bold row denotes the saved checkpoint.
731
+
732
+ ### Framework Versions
733
+ - Python: 3.11.9
734
+ - Sentence Transformers: 3.0.1
735
+ - Transformers: 4.40.2
736
+ - PyTorch: 2.3.1
737
+ - Accelerate: 0.32.1
738
+ - Datasets: 2.20.0
739
+ - Tokenizers: 0.19.1
740
+
741
+ ## Citation
742
+
743
+ ### BibTeX
744
+
745
+ #### Sentence Transformers
746
+ ```bibtex
747
+ @inproceedings{reimers-2019-sentence-bert,
748
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
749
+ author = "Reimers, Nils and Gurevych, Iryna",
750
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
751
+ month = "11",
752
+ year = "2019",
753
+ publisher = "Association for Computational Linguistics",
754
+ url = "https://arxiv.org/abs/1908.10084",
755
+ }
756
+ ```
757
+
758
+ #### MatryoshkaLoss
759
+ ```bibtex
760
+ @misc{kusupati2024matryoshka,
761
+ title={Matryoshka Representation Learning},
762
+ 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},
763
+ year={2024},
764
+ eprint={2205.13147},
765
+ archivePrefix={arXiv},
766
+ primaryClass={cs.LG}
767
+ }
768
+ ```
769
+
770
+ #### MultipleNegativesRankingLoss
771
+ ```bibtex
772
+ @misc{henderson2017efficient,
773
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
774
+ 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},
775
+ year={2017},
776
+ eprint={1705.00652},
777
+ archivePrefix={arXiv},
778
+ primaryClass={cs.CL}
779
+ }
780
+ ```
781
+
782
+ <!--
783
+ ## Glossary
784
+
785
+ *Clearly define terms in order to be accessible across audiences.*
786
+ -->
787
+
788
+ <!--
789
+ ## Model Card Authors
790
+
791
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
792
+ -->
793
+
794
+ <!--
795
+ ## Model Card Contact
796
+
797
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
798
+ -->
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "BAAI/bge-base-en-v1.5",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "LABEL_0"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 3072,
17
+ "label2id": {
18
+ "LABEL_0": 0
19
+ },
20
+ "layer_norm_eps": 1e-12,
21
+ "max_position_embeddings": 512,
22
+ "model_type": "bert",
23
+ "num_attention_heads": 12,
24
+ "num_hidden_layers": 12,
25
+ "pad_token_id": 0,
26
+ "position_embedding_type": "absolute",
27
+ "torch_dtype": "float32",
28
+ "transformers_version": "4.40.2",
29
+ "type_vocab_size": 2,
30
+ "use_cache": true,
31
+ "vocab_size": 30522
32
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.0.1",
4
+ "transformers": "4.40.2",
5
+ "pytorch": "2.3.1"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": null
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dca649d3679e0f7725f2ce71425b5e4713878f8a7e96ba37c3290b3560c1ce62
3
+ size 437951328
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": true
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,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "mask_token": "[MASK]",
49
+ "model_max_length": 512,
50
+ "never_split": null,
51
+ "pad_token": "[PAD]",
52
+ "sep_token": "[SEP]",
53
+ "strip_accents": null,
54
+ "tokenize_chinese_chars": true,
55
+ "tokenizer_class": "BertTokenizer",
56
+ "unk_token": "[UNK]"
57
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff