mezeidragos-lateral commited on
Commit
0a88f1b
·
verified ·
1 Parent(s): f12b6ac

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,730 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: Consolidated Regulatory Capital - The capital requirements calculated
16
+ under the FRB’s Capital Framework include the capital conservation buffer requirements,
17
+ which are comprised of a 2.5% buffer (under the Advanced Capital Rules).
18
+ sentences:
19
+ - What was the effective income tax rate for the year ended December 31, 2023?
20
+ - What is the function of capital conservation buffer requirements in the FRB's
21
+ Capital Framework for banks like Group Inc. in 2023?
22
+ - What incentive does the Hawaiian Electric’s Battery Bonus grid services program
23
+ offer?
24
+ - source_sentence: Balance at beginning of year 2021 was $30 million and, after charge-offs,
25
+ recoveries, and provisions for credit losses, the balance at end of year was $18
26
+ million.
27
+ sentences:
28
+ - Between what dates did CS&Co allegedly violate their duty to seek best execution
29
+ as per the plaintiffs' allegations in the lawsuit involving UBS Securities LLC?
30
+ - What were the balance at the beginning and the end of the year for credit loss
31
+ balances in 2021?
32
+ - How does the company handle leasehold improvements in terms of depreciation?
33
+ - source_sentence: The Compute reporting unit has an excess of fair value over carrying
34
+ value of 5% as of the annual test date.
35
+ sentences:
36
+ - What percent excess of fair value over carrying value did the Compute reporting
37
+ unit have as of the annual test date in 2023?
38
+ - What were the effective income tax rates for fiscal years 2023, 2022, and 2021,
39
+ and how did specific tax events affect these rates?
40
+ - When does the latest expiring European composition of matter patent (Supplementary
41
+ Protection Certificate) for STELARA expire?
42
+ - source_sentence: The net revenue decrease during 2023 in the Entertainment segment
43
+ was driven by lower entertainment productions and deliveries, reflecting the impact
44
+ of the several months-long strikes during 2023 by the Writers Guild of America
45
+ and the American actors' union, SAG-AFTRA.
46
+ sentences:
47
+ - What was the operating income for Google Cloud in 2023?
48
+ - How much did the company contribute to its pension and OPEB plans in 2023?
49
+ - What was the impact of the strikes by the Writers Guild of America and SAG-AFTRA
50
+ on the Entertainment segment's net revenues in 2023?
51
+ - source_sentence: As a REIT, future repatriation of incremental undistributed earnings
52
+ of the company's foreign subsidiaries will not be subject to federal or state
53
+ income tax, with the exception of foreign withholding taxes.
54
+ sentences:
55
+ - What tax implications apply to the future repatriation of incremental undistributed
56
+ earnings by a REIT from its foreign subsidiaries?
57
+ - What was the accrued liability for product recall related matters as of the end
58
+ of the fiscal year on June 30, 2023?
59
+ - What was the total amount of future interest payments associated with the Notes
60
+ as of September 30, 2023?
61
+ pipeline_tag: sentence-similarity
62
+ library_name: sentence-transformers
63
+ metrics:
64
+ - cosine_accuracy@1
65
+ - cosine_accuracy@3
66
+ - cosine_accuracy@5
67
+ - cosine_accuracy@10
68
+ - cosine_precision@1
69
+ - cosine_precision@3
70
+ - cosine_precision@5
71
+ - cosine_precision@10
72
+ - cosine_recall@1
73
+ - cosine_recall@3
74
+ - cosine_recall@5
75
+ - cosine_recall@10
76
+ - cosine_ndcg@10
77
+ - cosine_mrr@10
78
+ - cosine_map@100
79
+ model-index:
80
+ - name: BGE base Financial Matryoshka
81
+ results:
82
+ - task:
83
+ type: information-retrieval
84
+ name: Information Retrieval
85
+ dataset:
86
+ name: dim 768
87
+ type: dim_768
88
+ metrics:
89
+ - type: cosine_accuracy@1
90
+ value: 0.7128571428571429
91
+ name: Cosine Accuracy@1
92
+ - type: cosine_accuracy@3
93
+ value: 0.8428571428571429
94
+ name: Cosine Accuracy@3
95
+ - type: cosine_accuracy@5
96
+ value: 0.88
97
+ name: Cosine Accuracy@5
98
+ - type: cosine_accuracy@10
99
+ value: 0.92
100
+ name: Cosine Accuracy@10
101
+ - type: cosine_precision@1
102
+ value: 0.7128571428571429
103
+ name: Cosine Precision@1
104
+ - type: cosine_precision@3
105
+ value: 0.28095238095238095
106
+ name: Cosine Precision@3
107
+ - type: cosine_precision@5
108
+ value: 0.176
109
+ name: Cosine Precision@5
110
+ - type: cosine_precision@10
111
+ value: 0.09199999999999998
112
+ name: Cosine Precision@10
113
+ - type: cosine_recall@1
114
+ value: 0.7128571428571429
115
+ name: Cosine Recall@1
116
+ - type: cosine_recall@3
117
+ value: 0.8428571428571429
118
+ name: Cosine Recall@3
119
+ - type: cosine_recall@5
120
+ value: 0.88
121
+ name: Cosine Recall@5
122
+ - type: cosine_recall@10
123
+ value: 0.92
124
+ name: Cosine Recall@10
125
+ - type: cosine_ndcg@10
126
+ value: 0.8194470096208256
127
+ name: Cosine Ndcg@10
128
+ - type: cosine_mrr@10
129
+ value: 0.7869285714285713
130
+ name: Cosine Mrr@10
131
+ - type: cosine_map@100
132
+ value: 0.7892168694112985
133
+ name: Cosine Map@100
134
+ - task:
135
+ type: information-retrieval
136
+ name: Information Retrieval
137
+ dataset:
138
+ name: dim 512
139
+ type: dim_512
140
+ metrics:
141
+ - type: cosine_accuracy@1
142
+ value: 0.7214285714285714
143
+ name: Cosine Accuracy@1
144
+ - type: cosine_accuracy@3
145
+ value: 0.8471428571428572
146
+ name: Cosine Accuracy@3
147
+ - type: cosine_accuracy@5
148
+ value: 0.8757142857142857
149
+ name: Cosine Accuracy@5
150
+ - type: cosine_accuracy@10
151
+ value: 0.9185714285714286
152
+ name: Cosine Accuracy@10
153
+ - type: cosine_precision@1
154
+ value: 0.7214285714285714
155
+ name: Cosine Precision@1
156
+ - type: cosine_precision@3
157
+ value: 0.2823809523809524
158
+ name: Cosine Precision@3
159
+ - type: cosine_precision@5
160
+ value: 0.17514285714285713
161
+ name: Cosine Precision@5
162
+ - type: cosine_precision@10
163
+ value: 0.09185714285714286
164
+ name: Cosine Precision@10
165
+ - type: cosine_recall@1
166
+ value: 0.7214285714285714
167
+ name: Cosine Recall@1
168
+ - type: cosine_recall@3
169
+ value: 0.8471428571428572
170
+ name: Cosine Recall@3
171
+ - type: cosine_recall@5
172
+ value: 0.8757142857142857
173
+ name: Cosine Recall@5
174
+ - type: cosine_recall@10
175
+ value: 0.9185714285714286
176
+ name: Cosine Recall@10
177
+ - type: cosine_ndcg@10
178
+ value: 0.8222551376922121
179
+ name: Cosine Ndcg@10
180
+ - type: cosine_mrr@10
181
+ value: 0.7912256235827663
182
+ name: Cosine Mrr@10
183
+ - type: cosine_map@100
184
+ value: 0.7935743687249276
185
+ name: Cosine Map@100
186
+ - task:
187
+ type: information-retrieval
188
+ name: Information Retrieval
189
+ dataset:
190
+ name: dim 256
191
+ type: dim_256
192
+ metrics:
193
+ - type: cosine_accuracy@1
194
+ value: 0.7042857142857143
195
+ name: Cosine Accuracy@1
196
+ - type: cosine_accuracy@3
197
+ value: 0.8342857142857143
198
+ name: Cosine Accuracy@3
199
+ - type: cosine_accuracy@5
200
+ value: 0.8771428571428571
201
+ name: Cosine Accuracy@5
202
+ - type: cosine_accuracy@10
203
+ value: 0.9157142857142857
204
+ name: Cosine Accuracy@10
205
+ - type: cosine_precision@1
206
+ value: 0.7042857142857143
207
+ name: Cosine Precision@1
208
+ - type: cosine_precision@3
209
+ value: 0.27809523809523806
210
+ name: Cosine Precision@3
211
+ - type: cosine_precision@5
212
+ value: 0.1754285714285714
213
+ name: Cosine Precision@5
214
+ - type: cosine_precision@10
215
+ value: 0.09157142857142857
216
+ name: Cosine Precision@10
217
+ - type: cosine_recall@1
218
+ value: 0.7042857142857143
219
+ name: Cosine Recall@1
220
+ - type: cosine_recall@3
221
+ value: 0.8342857142857143
222
+ name: Cosine Recall@3
223
+ - type: cosine_recall@5
224
+ value: 0.8771428571428571
225
+ name: Cosine Recall@5
226
+ - type: cosine_recall@10
227
+ value: 0.9157142857142857
228
+ name: Cosine Recall@10
229
+ - type: cosine_ndcg@10
230
+ value: 0.813165438848782
231
+ name: Cosine Ndcg@10
232
+ - type: cosine_mrr@10
233
+ value: 0.7800498866213152
234
+ name: Cosine Mrr@10
235
+ - type: cosine_map@100
236
+ value: 0.7822651539071127
237
+ name: Cosine Map@100
238
+ - task:
239
+ type: information-retrieval
240
+ name: Information Retrieval
241
+ dataset:
242
+ name: dim 128
243
+ type: dim_128
244
+ metrics:
245
+ - type: cosine_accuracy@1
246
+ value: 0.6971428571428572
247
+ name: Cosine Accuracy@1
248
+ - type: cosine_accuracy@3
249
+ value: 0.8142857142857143
250
+ name: Cosine Accuracy@3
251
+ - type: cosine_accuracy@5
252
+ value: 0.8557142857142858
253
+ name: Cosine Accuracy@5
254
+ - type: cosine_accuracy@10
255
+ value: 0.9028571428571428
256
+ name: Cosine Accuracy@10
257
+ - type: cosine_precision@1
258
+ value: 0.6971428571428572
259
+ name: Cosine Precision@1
260
+ - type: cosine_precision@3
261
+ value: 0.2714285714285714
262
+ name: Cosine Precision@3
263
+ - type: cosine_precision@5
264
+ value: 0.17114285714285712
265
+ name: Cosine Precision@5
266
+ - type: cosine_precision@10
267
+ value: 0.09028571428571427
268
+ name: Cosine Precision@10
269
+ - type: cosine_recall@1
270
+ value: 0.6971428571428572
271
+ name: Cosine Recall@1
272
+ - type: cosine_recall@3
273
+ value: 0.8142857142857143
274
+ name: Cosine Recall@3
275
+ - type: cosine_recall@5
276
+ value: 0.8557142857142858
277
+ name: Cosine Recall@5
278
+ - type: cosine_recall@10
279
+ value: 0.9028571428571428
280
+ name: Cosine Recall@10
281
+ - type: cosine_ndcg@10
282
+ value: 0.7996582219917312
283
+ name: Cosine Ndcg@10
284
+ - type: cosine_mrr@10
285
+ value: 0.7667329931972787
286
+ name: Cosine Mrr@10
287
+ - type: cosine_map@100
288
+ value: 0.7700915959452638
289
+ name: Cosine Map@100
290
+ - task:
291
+ type: information-retrieval
292
+ name: Information Retrieval
293
+ dataset:
294
+ name: dim 64
295
+ type: dim_64
296
+ metrics:
297
+ - type: cosine_accuracy@1
298
+ value: 0.6742857142857143
299
+ name: Cosine Accuracy@1
300
+ - type: cosine_accuracy@3
301
+ value: 0.7942857142857143
302
+ name: Cosine Accuracy@3
303
+ - type: cosine_accuracy@5
304
+ value: 0.8257142857142857
305
+ name: Cosine Accuracy@5
306
+ - type: cosine_accuracy@10
307
+ value: 0.8742857142857143
308
+ name: Cosine Accuracy@10
309
+ - type: cosine_precision@1
310
+ value: 0.6742857142857143
311
+ name: Cosine Precision@1
312
+ - type: cosine_precision@3
313
+ value: 0.26476190476190475
314
+ name: Cosine Precision@3
315
+ - type: cosine_precision@5
316
+ value: 0.16514285714285712
317
+ name: Cosine Precision@5
318
+ - type: cosine_precision@10
319
+ value: 0.08742857142857141
320
+ name: Cosine Precision@10
321
+ - type: cosine_recall@1
322
+ value: 0.6742857142857143
323
+ name: Cosine Recall@1
324
+ - type: cosine_recall@3
325
+ value: 0.7942857142857143
326
+ name: Cosine Recall@3
327
+ - type: cosine_recall@5
328
+ value: 0.8257142857142857
329
+ name: Cosine Recall@5
330
+ - type: cosine_recall@10
331
+ value: 0.8742857142857143
332
+ name: Cosine Recall@10
333
+ - type: cosine_ndcg@10
334
+ value: 0.7742733360934079
335
+ name: Cosine Ndcg@10
336
+ - type: cosine_mrr@10
337
+ value: 0.7424053287981859
338
+ name: Cosine Mrr@10
339
+ - type: cosine_map@100
340
+ value: 0.7463231326238146
341
+ name: Cosine Map@100
342
+ ---
343
+
344
+ # BGE base Financial Matryoshka
345
+
346
+ 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.
347
+
348
+ ## Model Details
349
+
350
+ ### Model Description
351
+ - **Model Type:** Sentence Transformer
352
+ - **Base model:** [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) <!-- at revision a5beb1e3e68b9ab74eb54cfd186867f64f240e1a -->
353
+ - **Maximum Sequence Length:** 512 tokens
354
+ - **Output Dimensionality:** 768 dimensions
355
+ - **Similarity Function:** Cosine Similarity
356
+ - **Training Dataset:**
357
+ - json
358
+ - **Language:** en
359
+ - **License:** apache-2.0
360
+
361
+ ### Model Sources
362
+
363
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
364
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
365
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
366
+
367
+ ### Full Model Architecture
368
+
369
+ ```
370
+ SentenceTransformer(
371
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
372
+ (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})
373
+ (2): Normalize()
374
+ )
375
+ ```
376
+
377
+ ## Usage
378
+
379
+ ### Direct Usage (Sentence Transformers)
380
+
381
+ First install the Sentence Transformers library:
382
+
383
+ ```bash
384
+ pip install -U sentence-transformers
385
+ ```
386
+
387
+ Then you can load this model and run inference.
388
+ ```python
389
+ from sentence_transformers import SentenceTransformer
390
+
391
+ # Download from the 🤗 Hub
392
+ model = SentenceTransformer("mezeidragos-lateral/bge-base-financial-matryoshka")
393
+ # Run inference
394
+ sentences = [
395
+ "As a REIT, future repatriation of incremental undistributed earnings of the company's foreign subsidiaries will not be subject to federal or state income tax, with the exception of foreign withholding taxes.",
396
+ 'What tax implications apply to the future repatriation of incremental undistributed earnings by a REIT from its foreign subsidiaries?',
397
+ 'What was the accrued liability for product recall related matters as of the end of the fiscal year on June 30, 2023?',
398
+ ]
399
+ embeddings = model.encode(sentences)
400
+ print(embeddings.shape)
401
+ # [3, 768]
402
+
403
+ # Get the similarity scores for the embeddings
404
+ similarities = model.similarity(embeddings, embeddings)
405
+ print(similarities.shape)
406
+ # [3, 3]
407
+ ```
408
+
409
+ <!--
410
+ ### Direct Usage (Transformers)
411
+
412
+ <details><summary>Click to see the direct usage in Transformers</summary>
413
+
414
+ </details>
415
+ -->
416
+
417
+ <!--
418
+ ### Downstream Usage (Sentence Transformers)
419
+
420
+ You can finetune this model on your own dataset.
421
+
422
+ <details><summary>Click to expand</summary>
423
+
424
+ </details>
425
+ -->
426
+
427
+ <!--
428
+ ### Out-of-Scope Use
429
+
430
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
431
+ -->
432
+
433
+ ## Evaluation
434
+
435
+ ### Metrics
436
+
437
+ #### Information Retrieval
438
+
439
+ * Datasets: `dim_768`, `dim_512`, `dim_256`, `dim_128` and `dim_64`
440
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
441
+
442
+ | Metric | dim_768 | dim_512 | dim_256 | dim_128 | dim_64 |
443
+ |:--------------------|:-----------|:-----------|:-----------|:-----------|:-----------|
444
+ | cosine_accuracy@1 | 0.7129 | 0.7214 | 0.7043 | 0.6971 | 0.6743 |
445
+ | cosine_accuracy@3 | 0.8429 | 0.8471 | 0.8343 | 0.8143 | 0.7943 |
446
+ | cosine_accuracy@5 | 0.88 | 0.8757 | 0.8771 | 0.8557 | 0.8257 |
447
+ | cosine_accuracy@10 | 0.92 | 0.9186 | 0.9157 | 0.9029 | 0.8743 |
448
+ | cosine_precision@1 | 0.7129 | 0.7214 | 0.7043 | 0.6971 | 0.6743 |
449
+ | cosine_precision@3 | 0.281 | 0.2824 | 0.2781 | 0.2714 | 0.2648 |
450
+ | cosine_precision@5 | 0.176 | 0.1751 | 0.1754 | 0.1711 | 0.1651 |
451
+ | cosine_precision@10 | 0.092 | 0.0919 | 0.0916 | 0.0903 | 0.0874 |
452
+ | cosine_recall@1 | 0.7129 | 0.7214 | 0.7043 | 0.6971 | 0.6743 |
453
+ | cosine_recall@3 | 0.8429 | 0.8471 | 0.8343 | 0.8143 | 0.7943 |
454
+ | cosine_recall@5 | 0.88 | 0.8757 | 0.8771 | 0.8557 | 0.8257 |
455
+ | cosine_recall@10 | 0.92 | 0.9186 | 0.9157 | 0.9029 | 0.8743 |
456
+ | **cosine_ndcg@10** | **0.8194** | **0.8223** | **0.8132** | **0.7997** | **0.7743** |
457
+ | cosine_mrr@10 | 0.7869 | 0.7912 | 0.78 | 0.7667 | 0.7424 |
458
+ | cosine_map@100 | 0.7892 | 0.7936 | 0.7823 | 0.7701 | 0.7463 |
459
+
460
+ <!--
461
+ ## Bias, Risks and Limitations
462
+
463
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
464
+ -->
465
+
466
+ <!--
467
+ ### Recommendations
468
+
469
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
470
+ -->
471
+
472
+ ## Training Details
473
+
474
+ ### Training Dataset
475
+
476
+ #### json
477
+
478
+ * Dataset: json
479
+ * Size: 6,300 training samples
480
+ * Columns: <code>positive</code> and <code>anchor</code>
481
+ * Approximate statistics based on the first 1000 samples:
482
+ | | positive | anchor |
483
+ |:--------|:-----------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|
484
+ | type | string | string |
485
+ | details | <ul><li>min: 4 tokens</li><li>mean: 44.62 tokens</li><li>max: 301 tokens</li></ul> | <ul><li>min: 10 tokens</li><li>mean: 20.66 tokens</li><li>max: 45 tokens</li></ul> |
486
+ * Samples:
487
+ | positive | anchor |
488
+ |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------|
489
+ | <code>We provide transaction processing services (primarily authorization, clearing and settlement) to our financial institution and merchant clients through VisaNet, our proprietary advanced transaction processing network.</code> | <code>What are the primary transaction processing services provided by Visa through VisaNet?</code> |
490
+ | <code>Information about legal proceedings is included in Item 8 of the Annual Report on Form 10-K, as referenced in Item 3.</code> | <code>What item in the Annual Report on Form 10-K provides information about legal proceedings?</code> |
491
+ | <code>Investing activities used cash of $3.0 billion in 2022.</code> | <code>What was the net cash used by investing activities in 2022?</code> |
492
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
493
+ ```json
494
+ {
495
+ "loss": "MultipleNegativesRankingLoss",
496
+ "matryoshka_dims": [
497
+ 768,
498
+ 512,
499
+ 256,
500
+ 128,
501
+ 64
502
+ ],
503
+ "matryoshka_weights": [
504
+ 1,
505
+ 1,
506
+ 1,
507
+ 1,
508
+ 1
509
+ ],
510
+ "n_dims_per_step": -1
511
+ }
512
+ ```
513
+
514
+ ### Training Hyperparameters
515
+ #### Non-Default Hyperparameters
516
+
517
+ - `eval_strategy`: epoch
518
+ - `per_device_train_batch_size`: 32
519
+ - `per_device_eval_batch_size`: 16
520
+ - `gradient_accumulation_steps`: 16
521
+ - `learning_rate`: 2e-05
522
+ - `num_train_epochs`: 4
523
+ - `lr_scheduler_type`: cosine
524
+ - `warmup_ratio`: 0.1
525
+ - `bf16`: True
526
+ - `load_best_model_at_end`: True
527
+ - `batch_sampler`: no_duplicates
528
+
529
+ #### All Hyperparameters
530
+ <details><summary>Click to expand</summary>
531
+
532
+ - `overwrite_output_dir`: False
533
+ - `do_predict`: False
534
+ - `eval_strategy`: epoch
535
+ - `prediction_loss_only`: True
536
+ - `per_device_train_batch_size`: 32
537
+ - `per_device_eval_batch_size`: 16
538
+ - `per_gpu_train_batch_size`: None
539
+ - `per_gpu_eval_batch_size`: None
540
+ - `gradient_accumulation_steps`: 16
541
+ - `eval_accumulation_steps`: None
542
+ - `torch_empty_cache_steps`: None
543
+ - `learning_rate`: 2e-05
544
+ - `weight_decay`: 0.0
545
+ - `adam_beta1`: 0.9
546
+ - `adam_beta2`: 0.999
547
+ - `adam_epsilon`: 1e-08
548
+ - `max_grad_norm`: 1.0
549
+ - `num_train_epochs`: 4
550
+ - `max_steps`: -1
551
+ - `lr_scheduler_type`: cosine
552
+ - `lr_scheduler_kwargs`: {}
553
+ - `warmup_ratio`: 0.1
554
+ - `warmup_steps`: 0
555
+ - `log_level`: passive
556
+ - `log_level_replica`: warning
557
+ - `log_on_each_node`: True
558
+ - `logging_nan_inf_filter`: True
559
+ - `save_safetensors`: True
560
+ - `save_on_each_node`: False
561
+ - `save_only_model`: False
562
+ - `restore_callback_states_from_checkpoint`: False
563
+ - `no_cuda`: False
564
+ - `use_cpu`: False
565
+ - `use_mps_device`: False
566
+ - `seed`: 42
567
+ - `data_seed`: None
568
+ - `jit_mode_eval`: False
569
+ - `use_ipex`: False
570
+ - `bf16`: True
571
+ - `fp16`: False
572
+ - `fp16_opt_level`: O1
573
+ - `half_precision_backend`: auto
574
+ - `bf16_full_eval`: False
575
+ - `fp16_full_eval`: False
576
+ - `tf32`: None
577
+ - `local_rank`: 0
578
+ - `ddp_backend`: None
579
+ - `tpu_num_cores`: None
580
+ - `tpu_metrics_debug`: False
581
+ - `debug`: []
582
+ - `dataloader_drop_last`: False
583
+ - `dataloader_num_workers`: 0
584
+ - `dataloader_prefetch_factor`: None
585
+ - `past_index`: -1
586
+ - `disable_tqdm`: False
587
+ - `remove_unused_columns`: True
588
+ - `label_names`: None
589
+ - `load_best_model_at_end`: True
590
+ - `ignore_data_skip`: False
591
+ - `fsdp`: []
592
+ - `fsdp_min_num_params`: 0
593
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
594
+ - `fsdp_transformer_layer_cls_to_wrap`: None
595
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
596
+ - `deepspeed`: None
597
+ - `label_smoothing_factor`: 0.0
598
+ - `optim`: adamw_torch
599
+ - `optim_args`: None
600
+ - `adafactor`: False
601
+ - `group_by_length`: False
602
+ - `length_column_name`: length
603
+ - `ddp_find_unused_parameters`: None
604
+ - `ddp_bucket_cap_mb`: None
605
+ - `ddp_broadcast_buffers`: False
606
+ - `dataloader_pin_memory`: True
607
+ - `dataloader_persistent_workers`: False
608
+ - `skip_memory_metrics`: True
609
+ - `use_legacy_prediction_loop`: False
610
+ - `push_to_hub`: False
611
+ - `resume_from_checkpoint`: None
612
+ - `hub_model_id`: None
613
+ - `hub_strategy`: every_save
614
+ - `hub_private_repo`: None
615
+ - `hub_always_push`: False
616
+ - `gradient_checkpointing`: False
617
+ - `gradient_checkpointing_kwargs`: None
618
+ - `include_inputs_for_metrics`: False
619
+ - `include_for_metrics`: []
620
+ - `eval_do_concat_batches`: True
621
+ - `fp16_backend`: auto
622
+ - `push_to_hub_model_id`: None
623
+ - `push_to_hub_organization`: None
624
+ - `mp_parameters`:
625
+ - `auto_find_batch_size`: False
626
+ - `full_determinism`: False
627
+ - `torchdynamo`: None
628
+ - `ray_scope`: last
629
+ - `ddp_timeout`: 1800
630
+ - `torch_compile`: False
631
+ - `torch_compile_backend`: None
632
+ - `torch_compile_mode`: None
633
+ - `dispatch_batches`: None
634
+ - `split_batches`: None
635
+ - `include_tokens_per_second`: False
636
+ - `include_num_input_tokens_seen`: False
637
+ - `neftune_noise_alpha`: None
638
+ - `optim_target_modules`: None
639
+ - `batch_eval_metrics`: False
640
+ - `eval_on_start`: False
641
+ - `use_liger_kernel`: False
642
+ - `eval_use_gather_object`: False
643
+ - `average_tokens_across_devices`: False
644
+ - `prompts`: None
645
+ - `batch_sampler`: no_duplicates
646
+ - `multi_dataset_batch_sampler`: proportional
647
+
648
+ </details>
649
+
650
+ ### Training Logs
651
+ | 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 |
652
+ |:---------:|:------:|:-------------:|:----------------------:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|
653
+ | 0.8122 | 10 | 1.5626 | - | - | - | - | - |
654
+ | 1.0 | 13 | - | 0.8071 | 0.8040 | 0.7933 | 0.7781 | 0.7478 |
655
+ | 1.5685 | 20 | 0.6111 | - | - | - | - | - |
656
+ | 2.0 | 26 | - | 0.8173 | 0.8192 | 0.8111 | 0.7961 | 0.7661 |
657
+ | 2.3249 | 30 | 0.4333 | - | - | - | - | - |
658
+ | 3.0 | 39 | - | 0.8193 | 0.8211 | 0.8127 | 0.7996 | 0.7729 |
659
+ | 3.0812 | 40 | 0.3465 | - | - | - | - | - |
660
+ | **3.731** | **48** | **-** | **0.8194** | **0.8223** | **0.8132** | **0.7997** | **0.7743** |
661
+
662
+ * The bold row denotes the saved checkpoint.
663
+
664
+ ### Framework Versions
665
+ - Python: 3.12.8
666
+ - Sentence Transformers: 3.3.1
667
+ - Transformers: 4.48.0
668
+ - PyTorch: 2.2.2
669
+ - Accelerate: 1.2.1
670
+ - Datasets: 3.2.0
671
+ - Tokenizers: 0.21.0
672
+
673
+ ## Citation
674
+
675
+ ### BibTeX
676
+
677
+ #### Sentence Transformers
678
+ ```bibtex
679
+ @inproceedings{reimers-2019-sentence-bert,
680
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
681
+ author = "Reimers, Nils and Gurevych, Iryna",
682
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
683
+ month = "11",
684
+ year = "2019",
685
+ publisher = "Association for Computational Linguistics",
686
+ url = "https://arxiv.org/abs/1908.10084",
687
+ }
688
+ ```
689
+
690
+ #### MatryoshkaLoss
691
+ ```bibtex
692
+ @misc{kusupati2024matryoshka,
693
+ title={Matryoshka Representation Learning},
694
+ 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},
695
+ year={2024},
696
+ eprint={2205.13147},
697
+ archivePrefix={arXiv},
698
+ primaryClass={cs.LG}
699
+ }
700
+ ```
701
+
702
+ #### MultipleNegativesRankingLoss
703
+ ```bibtex
704
+ @misc{henderson2017efficient,
705
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
706
+ 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},
707
+ year={2017},
708
+ eprint={1705.00652},
709
+ archivePrefix={arXiv},
710
+ primaryClass={cs.CL}
711
+ }
712
+ ```
713
+
714
+ <!--
715
+ ## Glossary
716
+
717
+ *Clearly define terms in order to be accessible across audiences.*
718
+ -->
719
+
720
+ <!--
721
+ ## Model Card Authors
722
+
723
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
724
+ -->
725
+
726
+ <!--
727
+ ## Model Card Contact
728
+
729
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
730
+ -->
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.48.0",
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.48.0",
5
+ "pytorch": "2.2.2"
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:227129a61e5bbc1d4865673b400faf2fabc94088f77a850847538f1e8557d39d
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,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 512,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff