michalwilkosz commited on
Commit
6ac4d03
·
verified ·
1 Parent(s): 21bfbc2

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,733 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ tags:
6
+ - sentence-transformers
7
+ - sentence-similarity
8
+ - feature-extraction
9
+ - generated_from_trainer
10
+ - dataset_size:6300
11
+ - loss:MatryoshkaLoss
12
+ - loss:MultipleNegativesRankingLoss
13
+ base_model: BAAI/bge-base-en-v1.5
14
+ widget:
15
+ - source_sentence: Americas | $ | 7,631,647 | | | $ | 6,817,454 | | 79.3 | % | 84.1
16
+ | %
17
+ sentences:
18
+ - What therapeutic area does the folate receptor alpha antibody drug conjugate MBK-103
19
+ target?
20
+ - What was the proportion of Americas' net revenue to the company's total net revenue
21
+ in 2023, and how did it change from 2022?
22
+ - What was the Company's income tax provision for the year ended December 31, 2022?
23
+ - source_sentence: The Company establishes SSP based on observable prices of products
24
+ or services sold or priced separately in comparable circumstances to similar customers.
25
+ sentences:
26
+ - What were the lease terms and discount rates for operating leases as of March
27
+ 31, 2023 and 2022?
28
+ - What factors influence the Company's ability to establish Standalone Selling Prices
29
+ (SSP) based on observable prices?
30
+ - What number is associated with Item 8 in the document?
31
+ - source_sentence: Our effective tax rates could be affected by numerous factors,
32
+ such as changes in our business operations, acquisitions, investments, entry into
33
+ new businesses and geographies, intercompany transactions, the relative amount
34
+ of our foreign earnings, including earnings being lower than anticipated in jurisdictions
35
+ where we have lower statutory rates and higher than anticipated in jurisdictions
36
+ where we have higher statutory rates, losses incurred in jurisdictions for which
37
+ we are not able to realize related tax benefits, the applicability of special
38
+ tax regimes, changes in foreign exchange rates, changes in our stock price, changes
39
+ to our forecasts of income and loss and the mix of jurisdictions to which they
40
+ relate, changes in our deferred tax assets and liabilities and their valuation,
41
+ changes in the laws, regulations, administrative practices, principles, and interpretations
42
+ related to tax, including changes to the global tax framework, competition, and
43
+ other laws and accounting rules in various jurisdictions.
44
+ sentences:
45
+ - What impact do tax laws and economic conditions have on the company's effective
46
+ tax rates?
47
+ - What is the purpose of Alphabet Inc.'s annual review of methodologies used in
48
+ monitoring advertising metrics?
49
+ - From which sources does Apple obtain certain essential components?
50
+ - source_sentence: (Decrease) increase in cash, cash equivalents and restricted cash
51
+ for fiscal year 2023 was a decrease of $182 million, starting with $4,763 million
52
+ at the beginning and ending with $4,581 million.
53
+ sentences:
54
+ - What is the minimum project cost for the development described in the Second Development
55
+ Agreement involving MBS?
56
+ - What does the No Surprises Act require providers to develop and disclose?
57
+ - What was the change in cash and cash equivalents for Hewlett Packard Enterprise
58
+ from the beginning to the end of the fiscal year 2023?
59
+ - source_sentence: The total amount of gross unrecognized tax benefits as of December
60
+ 30, 2023 was $13,571.
61
+ sentences:
62
+ - What was the total amount of gross unrecognized tax benefits as of December 30,
63
+ 2023?
64
+ - What percentage of Kenvue Common Stock did Johnson & Johnson own as of the closing
65
+ of the IPO?
66
+ - What was the percentage change in sales from 2022 to 2023 for the Trauma segment
67
+ in the U.S.?
68
+ pipeline_tag: sentence-similarity
69
+ library_name: sentence-transformers
70
+ metrics:
71
+ - cosine_accuracy@1
72
+ - cosine_accuracy@3
73
+ - cosine_accuracy@5
74
+ - cosine_accuracy@10
75
+ - cosine_precision@1
76
+ - cosine_precision@3
77
+ - cosine_precision@5
78
+ - cosine_precision@10
79
+ - cosine_recall@1
80
+ - cosine_recall@3
81
+ - cosine_recall@5
82
+ - cosine_recall@10
83
+ - cosine_ndcg@10
84
+ - cosine_mrr@10
85
+ - cosine_map@100
86
+ model-index:
87
+ - name: BGE base Financial Matryoshka
88
+ results:
89
+ - task:
90
+ type: information-retrieval
91
+ name: Information Retrieval
92
+ dataset:
93
+ name: dim 768
94
+ type: dim_768
95
+ metrics:
96
+ - type: cosine_accuracy@1
97
+ value: 0.6928571428571428
98
+ name: Cosine Accuracy@1
99
+ - type: cosine_accuracy@3
100
+ value: 0.8142857142857143
101
+ name: Cosine Accuracy@3
102
+ - type: cosine_accuracy@5
103
+ value: 0.8471428571428572
104
+ name: Cosine Accuracy@5
105
+ - type: cosine_accuracy@10
106
+ value: 0.9014285714285715
107
+ name: Cosine Accuracy@10
108
+ - type: cosine_precision@1
109
+ value: 0.6928571428571428
110
+ name: Cosine Precision@1
111
+ - type: cosine_precision@3
112
+ value: 0.2714285714285714
113
+ name: Cosine Precision@3
114
+ - type: cosine_precision@5
115
+ value: 0.1694285714285714
116
+ name: Cosine Precision@5
117
+ - type: cosine_precision@10
118
+ value: 0.09014285714285714
119
+ name: Cosine Precision@10
120
+ - type: cosine_recall@1
121
+ value: 0.6928571428571428
122
+ name: Cosine Recall@1
123
+ - type: cosine_recall@3
124
+ value: 0.8142857142857143
125
+ name: Cosine Recall@3
126
+ - type: cosine_recall@5
127
+ value: 0.8471428571428572
128
+ name: Cosine Recall@5
129
+ - type: cosine_recall@10
130
+ value: 0.9014285714285715
131
+ name: Cosine Recall@10
132
+ - type: cosine_ndcg@10
133
+ value: 0.7960400928582716
134
+ name: Cosine Ndcg@10
135
+ - type: cosine_mrr@10
136
+ value: 0.7625391156462585
137
+ name: Cosine Mrr@10
138
+ - type: cosine_map@100
139
+ value: 0.7656459931357954
140
+ name: Cosine Map@100
141
+ - task:
142
+ type: information-retrieval
143
+ name: Information Retrieval
144
+ dataset:
145
+ name: dim 512
146
+ type: dim_512
147
+ metrics:
148
+ - type: cosine_accuracy@1
149
+ value: 0.7
150
+ name: Cosine Accuracy@1
151
+ - type: cosine_accuracy@3
152
+ value: 0.8142857142857143
153
+ name: Cosine Accuracy@3
154
+ - type: cosine_accuracy@5
155
+ value: 0.85
156
+ name: Cosine Accuracy@5
157
+ - type: cosine_accuracy@10
158
+ value: 0.8928571428571429
159
+ name: Cosine Accuracy@10
160
+ - type: cosine_precision@1
161
+ value: 0.7
162
+ name: Cosine Precision@1
163
+ - type: cosine_precision@3
164
+ value: 0.2714285714285714
165
+ name: Cosine Precision@3
166
+ - type: cosine_precision@5
167
+ value: 0.16999999999999998
168
+ name: Cosine Precision@5
169
+ - type: cosine_precision@10
170
+ value: 0.08928571428571426
171
+ name: Cosine Precision@10
172
+ - type: cosine_recall@1
173
+ value: 0.7
174
+ name: Cosine Recall@1
175
+ - type: cosine_recall@3
176
+ value: 0.8142857142857143
177
+ name: Cosine Recall@3
178
+ - type: cosine_recall@5
179
+ value: 0.85
180
+ name: Cosine Recall@5
181
+ - type: cosine_recall@10
182
+ value: 0.8928571428571429
183
+ name: Cosine Recall@10
184
+ - type: cosine_ndcg@10
185
+ value: 0.7962092633155669
186
+ name: Cosine Ndcg@10
187
+ - type: cosine_mrr@10
188
+ value: 0.7652437641723353
189
+ name: Cosine Mrr@10
190
+ - type: cosine_map@100
191
+ value: 0.7690571344301111
192
+ name: Cosine Map@100
193
+ - task:
194
+ type: information-retrieval
195
+ name: Information Retrieval
196
+ dataset:
197
+ name: dim 256
198
+ type: dim_256
199
+ metrics:
200
+ - type: cosine_accuracy@1
201
+ value: 0.6885714285714286
202
+ name: Cosine Accuracy@1
203
+ - type: cosine_accuracy@3
204
+ value: 0.8085714285714286
205
+ name: Cosine Accuracy@3
206
+ - type: cosine_accuracy@5
207
+ value: 0.8485714285714285
208
+ name: Cosine Accuracy@5
209
+ - type: cosine_accuracy@10
210
+ value: 0.8928571428571429
211
+ name: Cosine Accuracy@10
212
+ - type: cosine_precision@1
213
+ value: 0.6885714285714286
214
+ name: Cosine Precision@1
215
+ - type: cosine_precision@3
216
+ value: 0.2695238095238095
217
+ name: Cosine Precision@3
218
+ - type: cosine_precision@5
219
+ value: 0.16971428571428568
220
+ name: Cosine Precision@5
221
+ - type: cosine_precision@10
222
+ value: 0.08928571428571427
223
+ name: Cosine Precision@10
224
+ - type: cosine_recall@1
225
+ value: 0.6885714285714286
226
+ name: Cosine Recall@1
227
+ - type: cosine_recall@3
228
+ value: 0.8085714285714286
229
+ name: Cosine Recall@3
230
+ - type: cosine_recall@5
231
+ value: 0.8485714285714285
232
+ name: Cosine Recall@5
233
+ - type: cosine_recall@10
234
+ value: 0.8928571428571429
235
+ name: Cosine Recall@10
236
+ - type: cosine_ndcg@10
237
+ value: 0.790294082455236
238
+ name: Cosine Ndcg@10
239
+ - type: cosine_mrr@10
240
+ value: 0.7575634920634915
241
+ name: Cosine Mrr@10
242
+ - type: cosine_map@100
243
+ value: 0.7608461966590305
244
+ name: Cosine Map@100
245
+ - task:
246
+ type: information-retrieval
247
+ name: Information Retrieval
248
+ dataset:
249
+ name: dim 128
250
+ type: dim_128
251
+ metrics:
252
+ - type: cosine_accuracy@1
253
+ value: 0.6771428571428572
254
+ name: Cosine Accuracy@1
255
+ - type: cosine_accuracy@3
256
+ value: 0.7971428571428572
257
+ name: Cosine Accuracy@3
258
+ - type: cosine_accuracy@5
259
+ value: 0.83
260
+ name: Cosine Accuracy@5
261
+ - type: cosine_accuracy@10
262
+ value: 0.89
263
+ name: Cosine Accuracy@10
264
+ - type: cosine_precision@1
265
+ value: 0.6771428571428572
266
+ name: Cosine Precision@1
267
+ - type: cosine_precision@3
268
+ value: 0.26571428571428574
269
+ name: Cosine Precision@3
270
+ - type: cosine_precision@5
271
+ value: 0.16599999999999998
272
+ name: Cosine Precision@5
273
+ - type: cosine_precision@10
274
+ value: 0.089
275
+ name: Cosine Precision@10
276
+ - type: cosine_recall@1
277
+ value: 0.6771428571428572
278
+ name: Cosine Recall@1
279
+ - type: cosine_recall@3
280
+ value: 0.7971428571428572
281
+ name: Cosine Recall@3
282
+ - type: cosine_recall@5
283
+ value: 0.83
284
+ name: Cosine Recall@5
285
+ - type: cosine_recall@10
286
+ value: 0.89
287
+ name: Cosine Recall@10
288
+ - type: cosine_ndcg@10
289
+ value: 0.7811390356263523
290
+ name: Cosine Ndcg@10
291
+ - type: cosine_mrr@10
292
+ value: 0.7466921768707482
293
+ name: Cosine Mrr@10
294
+ - type: cosine_map@100
295
+ value: 0.7500930927741866
296
+ name: Cosine Map@100
297
+ - task:
298
+ type: information-retrieval
299
+ name: Information Retrieval
300
+ dataset:
301
+ name: dim 64
302
+ type: dim_64
303
+ metrics:
304
+ - type: cosine_accuracy@1
305
+ value: 0.6457142857142857
306
+ name: Cosine Accuracy@1
307
+ - type: cosine_accuracy@3
308
+ value: 0.7685714285714286
309
+ name: Cosine Accuracy@3
310
+ - type: cosine_accuracy@5
311
+ value: 0.8114285714285714
312
+ name: Cosine Accuracy@5
313
+ - type: cosine_accuracy@10
314
+ value: 0.8628571428571429
315
+ name: Cosine Accuracy@10
316
+ - type: cosine_precision@1
317
+ value: 0.6457142857142857
318
+ name: Cosine Precision@1
319
+ - type: cosine_precision@3
320
+ value: 0.2561904761904762
321
+ name: Cosine Precision@3
322
+ - type: cosine_precision@5
323
+ value: 0.16228571428571428
324
+ name: Cosine Precision@5
325
+ - type: cosine_precision@10
326
+ value: 0.08628571428571427
327
+ name: Cosine Precision@10
328
+ - type: cosine_recall@1
329
+ value: 0.6457142857142857
330
+ name: Cosine Recall@1
331
+ - type: cosine_recall@3
332
+ value: 0.7685714285714286
333
+ name: Cosine Recall@3
334
+ - type: cosine_recall@5
335
+ value: 0.8114285714285714
336
+ name: Cosine Recall@5
337
+ - type: cosine_recall@10
338
+ value: 0.8628571428571429
339
+ name: Cosine Recall@10
340
+ - type: cosine_ndcg@10
341
+ value: 0.7526448867884948
342
+ name: Cosine Ndcg@10
343
+ - type: cosine_mrr@10
344
+ value: 0.7175549886621314
345
+ name: Cosine Mrr@10
346
+ - type: cosine_map@100
347
+ value: 0.721601645358737
348
+ name: Cosine Map@100
349
+ ---
350
+
351
+ # BGE base Financial Matryoshka
352
+
353
+ 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) on the json dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
354
+
355
+ ## Model Details
356
+
357
+ ### Model Description
358
+ - **Model Type:** Sentence Transformer
359
+ - **Base model:** [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) <!-- at revision a5beb1e3e68b9ab74eb54cfd186867f64f240e1a -->
360
+ - **Maximum Sequence Length:** 512 tokens
361
+ - **Output Dimensionality:** 768 dimensions
362
+ - **Similarity Function:** Cosine Similarity
363
+ - **Training Dataset:**
364
+ - json
365
+ - **Language:** en
366
+ - **License:** apache-2.0
367
+
368
+ ### Model Sources
369
+
370
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
371
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
372
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
373
+
374
+ ### Full Model Architecture
375
+
376
+ ```
377
+ SentenceTransformer(
378
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
379
+ (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})
380
+ (2): Normalize()
381
+ )
382
+ ```
383
+
384
+ ## Usage
385
+
386
+ ### Direct Usage (Sentence Transformers)
387
+
388
+ First install the Sentence Transformers library:
389
+
390
+ ```bash
391
+ pip install -U sentence-transformers
392
+ ```
393
+
394
+ Then you can load this model and run inference.
395
+ ```python
396
+ from sentence_transformers import SentenceTransformer
397
+
398
+ # Download from the 🤗 Hub
399
+ model = SentenceTransformer("michalwilkosz/bge-base-financial-matryoshka")
400
+ # Run inference
401
+ sentences = [
402
+ 'The total amount of gross unrecognized tax benefits as of December 30, 2023 was $13,571.',
403
+ 'What was the total amount of gross unrecognized tax benefits as of December 30, 2023?',
404
+ 'What percentage of Kenvue Common Stock did Johnson & Johnson own as of the closing of the IPO?',
405
+ ]
406
+ embeddings = model.encode(sentences)
407
+ print(embeddings.shape)
408
+ # [3, 768]
409
+
410
+ # Get the similarity scores for the embeddings
411
+ similarities = model.similarity(embeddings, embeddings)
412
+ print(similarities.shape)
413
+ # [3, 3]
414
+ ```
415
+
416
+ <!--
417
+ ### Direct Usage (Transformers)
418
+
419
+ <details><summary>Click to see the direct usage in Transformers</summary>
420
+
421
+ </details>
422
+ -->
423
+
424
+ <!--
425
+ ### Downstream Usage (Sentence Transformers)
426
+
427
+ You can finetune this model on your own dataset.
428
+
429
+ <details><summary>Click to expand</summary>
430
+
431
+ </details>
432
+ -->
433
+
434
+ <!--
435
+ ### Out-of-Scope Use
436
+
437
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
438
+ -->
439
+
440
+ ## Evaluation
441
+
442
+ ### Metrics
443
+
444
+ #### Information Retrieval
445
+
446
+ * Datasets: `dim_768`, `dim_512`, `dim_256`, `dim_128` and `dim_64`
447
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
448
+
449
+ | Metric | dim_768 | dim_512 | dim_256 | dim_128 | dim_64 |
450
+ |:--------------------|:----------|:-----------|:-----------|:-----------|:-----------|
451
+ | cosine_accuracy@1 | 0.6929 | 0.7 | 0.6886 | 0.6771 | 0.6457 |
452
+ | cosine_accuracy@3 | 0.8143 | 0.8143 | 0.8086 | 0.7971 | 0.7686 |
453
+ | cosine_accuracy@5 | 0.8471 | 0.85 | 0.8486 | 0.83 | 0.8114 |
454
+ | cosine_accuracy@10 | 0.9014 | 0.8929 | 0.8929 | 0.89 | 0.8629 |
455
+ | cosine_precision@1 | 0.6929 | 0.7 | 0.6886 | 0.6771 | 0.6457 |
456
+ | cosine_precision@3 | 0.2714 | 0.2714 | 0.2695 | 0.2657 | 0.2562 |
457
+ | cosine_precision@5 | 0.1694 | 0.17 | 0.1697 | 0.166 | 0.1623 |
458
+ | cosine_precision@10 | 0.0901 | 0.0893 | 0.0893 | 0.089 | 0.0863 |
459
+ | cosine_recall@1 | 0.6929 | 0.7 | 0.6886 | 0.6771 | 0.6457 |
460
+ | cosine_recall@3 | 0.8143 | 0.8143 | 0.8086 | 0.7971 | 0.7686 |
461
+ | cosine_recall@5 | 0.8471 | 0.85 | 0.8486 | 0.83 | 0.8114 |
462
+ | cosine_recall@10 | 0.9014 | 0.8929 | 0.8929 | 0.89 | 0.8629 |
463
+ | **cosine_ndcg@10** | **0.796** | **0.7962** | **0.7903** | **0.7811** | **0.7526** |
464
+ | cosine_mrr@10 | 0.7625 | 0.7652 | 0.7576 | 0.7467 | 0.7176 |
465
+ | cosine_map@100 | 0.7656 | 0.7691 | 0.7608 | 0.7501 | 0.7216 |
466
+
467
+ <!--
468
+ ## Bias, Risks and Limitations
469
+
470
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
471
+ -->
472
+
473
+ <!--
474
+ ### Recommendations
475
+
476
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
477
+ -->
478
+
479
+ ## Training Details
480
+
481
+ ### Training Dataset
482
+
483
+ #### json
484
+
485
+ * Dataset: json
486
+ * Size: 6,300 training samples
487
+ * Columns: <code>positive</code> and <code>anchor</code>
488
+ * Approximate statistics based on the first 1000 samples:
489
+ | | positive | anchor |
490
+ |:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
491
+ | type | string | string |
492
+ | details | <ul><li>min: 2 tokens</li><li>mean: 45.43 tokens</li><li>max: 301 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 20.34 tokens</li><li>max: 46 tokens</li></ul> |
493
+ * Samples:
494
+ | positive | anchor |
495
+ |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------|
496
+ | <code>Almost all FedEx Office locations provide local pickup-and-delivery service for print jobs completed by FedEx Office. A FedEx courier picks up a customer’s print job at the customer’s location and then returns the finished product to the customer.</code> | <code>What service does almost all FedEx Office locations provide for completed print jobs?</code> |
497
+ | <code>Non-compliance with government laws and regulations may result in fines, limits on the ability to sell products, suspension of business activities, reputational damage, and legal liabilities.</code> | <code>What are the consequences of failing to comply with government laws and regulations?</code> |
498
+ | <code>Item 8 is labeled as Financial Statements and Supplementary Data.</code> | <code>What is the title of Item 8 in the financial document?</code> |
499
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
500
+ ```json
501
+ {
502
+ "loss": "MultipleNegativesRankingLoss",
503
+ "matryoshka_dims": [
504
+ 768,
505
+ 512,
506
+ 256,
507
+ 128,
508
+ 64
509
+ ],
510
+ "matryoshka_weights": [
511
+ 1,
512
+ 1,
513
+ 1,
514
+ 1,
515
+ 1
516
+ ],
517
+ "n_dims_per_step": -1
518
+ }
519
+ ```
520
+
521
+ ### Training Hyperparameters
522
+ #### Non-Default Hyperparameters
523
+
524
+ - `eval_strategy`: epoch
525
+ - `per_device_train_batch_size`: 32
526
+ - `per_device_eval_batch_size`: 16
527
+ - `gradient_accumulation_steps`: 16
528
+ - `learning_rate`: 2e-05
529
+ - `num_train_epochs`: 4
530
+ - `lr_scheduler_type`: cosine
531
+ - `warmup_ratio`: 0.1
532
+ - `bf16`: True
533
+ - `tf32`: True
534
+ - `load_best_model_at_end`: True
535
+ - `optim`: adamw_torch_fused
536
+ - `batch_sampler`: no_duplicates
537
+
538
+ #### All Hyperparameters
539
+ <details><summary>Click to expand</summary>
540
+
541
+ - `overwrite_output_dir`: False
542
+ - `do_predict`: False
543
+ - `eval_strategy`: epoch
544
+ - `prediction_loss_only`: True
545
+ - `per_device_train_batch_size`: 32
546
+ - `per_device_eval_batch_size`: 16
547
+ - `per_gpu_train_batch_size`: None
548
+ - `per_gpu_eval_batch_size`: None
549
+ - `gradient_accumulation_steps`: 16
550
+ - `eval_accumulation_steps`: None
551
+ - `learning_rate`: 2e-05
552
+ - `weight_decay`: 0.0
553
+ - `adam_beta1`: 0.9
554
+ - `adam_beta2`: 0.999
555
+ - `adam_epsilon`: 1e-08
556
+ - `max_grad_norm`: 1.0
557
+ - `num_train_epochs`: 4
558
+ - `max_steps`: -1
559
+ - `lr_scheduler_type`: cosine
560
+ - `lr_scheduler_kwargs`: {}
561
+ - `warmup_ratio`: 0.1
562
+ - `warmup_steps`: 0
563
+ - `log_level`: passive
564
+ - `log_level_replica`: warning
565
+ - `log_on_each_node`: True
566
+ - `logging_nan_inf_filter`: True
567
+ - `save_safetensors`: True
568
+ - `save_on_each_node`: False
569
+ - `save_only_model`: False
570
+ - `restore_callback_states_from_checkpoint`: False
571
+ - `no_cuda`: False
572
+ - `use_cpu`: False
573
+ - `use_mps_device`: False
574
+ - `seed`: 42
575
+ - `data_seed`: None
576
+ - `jit_mode_eval`: False
577
+ - `use_ipex`: False
578
+ - `bf16`: True
579
+ - `fp16`: False
580
+ - `fp16_opt_level`: O1
581
+ - `half_precision_backend`: auto
582
+ - `bf16_full_eval`: False
583
+ - `fp16_full_eval`: False
584
+ - `tf32`: True
585
+ - `local_rank`: 0
586
+ - `ddp_backend`: None
587
+ - `tpu_num_cores`: None
588
+ - `tpu_metrics_debug`: False
589
+ - `debug`: []
590
+ - `dataloader_drop_last`: False
591
+ - `dataloader_num_workers`: 0
592
+ - `dataloader_prefetch_factor`: None
593
+ - `past_index`: -1
594
+ - `disable_tqdm`: False
595
+ - `remove_unused_columns`: True
596
+ - `label_names`: None
597
+ - `load_best_model_at_end`: True
598
+ - `ignore_data_skip`: False
599
+ - `fsdp`: []
600
+ - `fsdp_min_num_params`: 0
601
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
602
+ - `fsdp_transformer_layer_cls_to_wrap`: None
603
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
604
+ - `deepspeed`: None
605
+ - `label_smoothing_factor`: 0.0
606
+ - `optim`: adamw_torch_fused
607
+ - `optim_args`: None
608
+ - `adafactor`: False
609
+ - `group_by_length`: False
610
+ - `length_column_name`: length
611
+ - `ddp_find_unused_parameters`: None
612
+ - `ddp_bucket_cap_mb`: None
613
+ - `ddp_broadcast_buffers`: False
614
+ - `dataloader_pin_memory`: True
615
+ - `dataloader_persistent_workers`: False
616
+ - `skip_memory_metrics`: True
617
+ - `use_legacy_prediction_loop`: False
618
+ - `push_to_hub`: False
619
+ - `resume_from_checkpoint`: None
620
+ - `hub_model_id`: None
621
+ - `hub_strategy`: every_save
622
+ - `hub_private_repo`: False
623
+ - `hub_always_push`: False
624
+ - `gradient_checkpointing`: False
625
+ - `gradient_checkpointing_kwargs`: None
626
+ - `include_inputs_for_metrics`: False
627
+ - `eval_do_concat_batches`: True
628
+ - `fp16_backend`: auto
629
+ - `push_to_hub_model_id`: None
630
+ - `push_to_hub_organization`: None
631
+ - `mp_parameters`:
632
+ - `auto_find_batch_size`: False
633
+ - `full_determinism`: False
634
+ - `torchdynamo`: None
635
+ - `ray_scope`: last
636
+ - `ddp_timeout`: 1800
637
+ - `torch_compile`: False
638
+ - `torch_compile_backend`: None
639
+ - `torch_compile_mode`: None
640
+ - `dispatch_batches`: None
641
+ - `split_batches`: None
642
+ - `include_tokens_per_second`: False
643
+ - `include_num_input_tokens_seen`: False
644
+ - `neftune_noise_alpha`: None
645
+ - `optim_target_modules`: None
646
+ - `batch_eval_metrics`: False
647
+ - `prompts`: None
648
+ - `batch_sampler`: no_duplicates
649
+ - `multi_dataset_batch_sampler`: proportional
650
+
651
+ </details>
652
+
653
+ ### Training Logs
654
+ | Epoch | Step | Training Loss | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 | dim_128_cosine_ndcg@10 | dim_64_cosine_ndcg@10 |
655
+ |:----------:|:------:|:-------------:|:----------------------:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|
656
+ | 0.8122 | 10 | 1.5678 | - | - | - | - | - |
657
+ | 0.9746 | 12 | - | 0.7840 | 0.7835 | 0.7763 | 0.7656 | 0.7360 |
658
+ | 1.6244 | 20 | 0.6336 | - | - | - | - | - |
659
+ | 1.9492 | 24 | - | 0.7960 | 0.7950 | 0.7903 | 0.7783 | 0.7500 |
660
+ | 2.4365 | 30 | 0.464 | - | - | - | - | - |
661
+ | **2.9239** | **36** | **-** | **0.7965** | **0.7969** | **0.7912** | **0.7825** | **0.7525** |
662
+ | 3.2487 | 40 | 0.3768 | - | - | - | - | - |
663
+ | 3.8985 | 48 | - | 0.7960 | 0.7962 | 0.7903 | 0.7811 | 0.7526 |
664
+
665
+ * The bold row denotes the saved checkpoint.
666
+
667
+ ### Framework Versions
668
+ - Python: 3.11.11
669
+ - Sentence Transformers: 3.3.1
670
+ - Transformers: 4.41.2
671
+ - PyTorch: 2.1.2+cu121
672
+ - Accelerate: 1.2.0
673
+ - Datasets: 2.19.1
674
+ - Tokenizers: 0.19.1
675
+
676
+ ## Citation
677
+
678
+ ### BibTeX
679
+
680
+ #### Sentence Transformers
681
+ ```bibtex
682
+ @inproceedings{reimers-2019-sentence-bert,
683
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
684
+ author = "Reimers, Nils and Gurevych, Iryna",
685
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
686
+ month = "11",
687
+ year = "2019",
688
+ publisher = "Association for Computational Linguistics",
689
+ url = "https://arxiv.org/abs/1908.10084",
690
+ }
691
+ ```
692
+
693
+ #### MatryoshkaLoss
694
+ ```bibtex
695
+ @misc{kusupati2024matryoshka,
696
+ title={Matryoshka Representation Learning},
697
+ 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},
698
+ year={2024},
699
+ eprint={2205.13147},
700
+ archivePrefix={arXiv},
701
+ primaryClass={cs.LG}
702
+ }
703
+ ```
704
+
705
+ #### MultipleNegativesRankingLoss
706
+ ```bibtex
707
+ @misc{henderson2017efficient,
708
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
709
+ 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},
710
+ year={2017},
711
+ eprint={1705.00652},
712
+ archivePrefix={arXiv},
713
+ primaryClass={cs.CL}
714
+ }
715
+ ```
716
+
717
+ <!--
718
+ ## Glossary
719
+
720
+ *Clearly define terms in order to be accessible across audiences.*
721
+ -->
722
+
723
+ <!--
724
+ ## Model Card Authors
725
+
726
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
727
+ -->
728
+
729
+ <!--
730
+ ## Model Card Contact
731
+
732
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
733
+ -->
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.41.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.3.1",
4
+ "transformers": "4.41.2",
5
+ "pytorch": "2.1.2+cu121"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d478e3868e32dfa9681f79758b84b12d51cbf73f2511c62724a2970341bc444
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