sintuk commited on
Commit
44d5f3a
·
verified ·
1 Parent(s): eddeafb

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: As of December 30, 2023, about 92% of securities in the Company's
16
+ portfolio were at an unrealized loss position.
17
+ sentences:
18
+ - What additional document is included in the financial document apart from the
19
+ Consolidated Financial Statements?
20
+ - What percentage of the Company's portfolio of securities was in an unrealized
21
+ loss position as of December 30, 2023?
22
+ - What was the total loss the company incurred in association with the sale of the
23
+ eOne Music business in 2021?
24
+ - source_sentence: Revenue Recognition Product Sales We recognize revenue from product
25
+ sales when control of the product transfers to the customer, which is generally
26
+ upon shipment or delivery, or in certain cases, upon the corresponding sales by
27
+ our customer to a third party. Revenues are recognized net of estimated rebates
28
+ and chargebacks, patient co-pay assistance, prompt pay discounts, distributor
29
+ fees, sales return provisions and other related deductions. These deductions to
30
+ product sales are referred to as gross-to-net deductions and are estimated and
31
+ recorded in the period in which the related product sales occur.
32
+ sentences:
33
+ - What is the expiration date for the federal research and development tax credits
34
+ as of 2023?
35
+ - How are revenue recognition and Gross-to-Net deductions related in the context
36
+ of product sales?
37
+ - What is the approval status of Tirzepatide (Mounjaro, Zepbound®) for the treatment
38
+ of obesity as of 2023?
39
+ - source_sentence: The expected long-term rate of return assumption used in computing
40
+ 2023 net periodic benefit income for the U.S. pension plans was 6.75%.
41
+ sentences:
42
+ - What is the expected long-term rate of return on plan assets used in computing
43
+ the 2023 net periodic benefit income for U.S. pension plans?
44
+ - What was the increase in postpaid phone subscribers at AT&T Inc. from 2021 to
45
+ 2023?
46
+ - How does Chipotle ensure pay equity among its employees?
47
+ - source_sentence: In an Annual Report on Form 10-K, 'Litigation and Other Legal Matters'
48
+ are detailed under 'Note 13 — Commitments and Contingencies' in Part IV, Item
49
+ 15 of the consolidated financial statements.
50
+ sentences:
51
+ - What is Apple's commitment to workplace practices and policies concerning harassment
52
+ or discrimination?
53
+ - By what percentage did net income increase in 2023 compared to 2022?
54
+ - In the structure of an Annual Report on Form 10-K, where does one find details
55
+ about 'Litigation and Other Legal Matters'?
56
+ - source_sentence: Any such inquiries or investigations (including the IDPC proceedings)
57
+ could subject us to substantial fines and costs, require us to change our business
58
+ practices, divert resources and the attention of management from our business,
59
+ or adversely affect our business.
60
+ sentences:
61
+ - What are some of the potential consequences for Meta Platforms, Inc. from inquiries
62
+ or investigations as noted in the provided text?
63
+ - What was the quarterly dividend declared by Bank of America's board of directors
64
+ on January 31, 2024?
65
+ - What recent technological advancements has the company implemented in set-top
66
+ box (STB) solutions?
67
+ pipeline_tag: sentence-similarity
68
+ library_name: sentence-transformers
69
+ metrics:
70
+ - cosine_accuracy@1
71
+ - cosine_accuracy@3
72
+ - cosine_accuracy@5
73
+ - cosine_accuracy@10
74
+ - cosine_precision@1
75
+ - cosine_precision@3
76
+ - cosine_precision@5
77
+ - cosine_precision@10
78
+ - cosine_recall@1
79
+ - cosine_recall@3
80
+ - cosine_recall@5
81
+ - cosine_recall@10
82
+ - cosine_ndcg@10
83
+ - cosine_mrr@10
84
+ - cosine_map@100
85
+ model-index:
86
+ - name: BGE base Financial Matryoshka
87
+ results:
88
+ - task:
89
+ type: information-retrieval
90
+ name: Information Retrieval
91
+ dataset:
92
+ name: dim 768
93
+ type: dim_768
94
+ metrics:
95
+ - type: cosine_accuracy@1
96
+ value: 0.7357142857142858
97
+ name: Cosine Accuracy@1
98
+ - type: cosine_accuracy@3
99
+ value: 0.8557142857142858
100
+ name: Cosine Accuracy@3
101
+ - type: cosine_accuracy@5
102
+ value: 0.8957142857142857
103
+ name: Cosine Accuracy@5
104
+ - type: cosine_accuracy@10
105
+ value: 0.9285714285714286
106
+ name: Cosine Accuracy@10
107
+ - type: cosine_precision@1
108
+ value: 0.7357142857142858
109
+ name: Cosine Precision@1
110
+ - type: cosine_precision@3
111
+ value: 0.28523809523809524
112
+ name: Cosine Precision@3
113
+ - type: cosine_precision@5
114
+ value: 0.1791428571428571
115
+ name: Cosine Precision@5
116
+ - type: cosine_precision@10
117
+ value: 0.09285714285714286
118
+ name: Cosine Precision@10
119
+ - type: cosine_recall@1
120
+ value: 0.7357142857142858
121
+ name: Cosine Recall@1
122
+ - type: cosine_recall@3
123
+ value: 0.8557142857142858
124
+ name: Cosine Recall@3
125
+ - type: cosine_recall@5
126
+ value: 0.8957142857142857
127
+ name: Cosine Recall@5
128
+ - type: cosine_recall@10
129
+ value: 0.9285714285714286
130
+ name: Cosine Recall@10
131
+ - type: cosine_ndcg@10
132
+ value: 0.8337852464509243
133
+ name: Cosine Ndcg@10
134
+ - type: cosine_mrr@10
135
+ value: 0.8032046485260771
136
+ name: Cosine Mrr@10
137
+ - type: cosine_map@100
138
+ value: 0.8062343226371107
139
+ name: Cosine Map@100
140
+ - task:
141
+ type: information-retrieval
142
+ name: Information Retrieval
143
+ dataset:
144
+ name: dim 512
145
+ type: dim_512
146
+ metrics:
147
+ - type: cosine_accuracy@1
148
+ value: 0.7271428571428571
149
+ name: Cosine Accuracy@1
150
+ - type: cosine_accuracy@3
151
+ value: 0.8628571428571429
152
+ name: Cosine Accuracy@3
153
+ - type: cosine_accuracy@5
154
+ value: 0.89
155
+ name: Cosine Accuracy@5
156
+ - type: cosine_accuracy@10
157
+ value: 0.9328571428571428
158
+ name: Cosine Accuracy@10
159
+ - type: cosine_precision@1
160
+ value: 0.7271428571428571
161
+ name: Cosine Precision@1
162
+ - type: cosine_precision@3
163
+ value: 0.2876190476190476
164
+ name: Cosine Precision@3
165
+ - type: cosine_precision@5
166
+ value: 0.17799999999999996
167
+ name: Cosine Precision@5
168
+ - type: cosine_precision@10
169
+ value: 0.09328571428571426
170
+ name: Cosine Precision@10
171
+ - type: cosine_recall@1
172
+ value: 0.7271428571428571
173
+ name: Cosine Recall@1
174
+ - type: cosine_recall@3
175
+ value: 0.8628571428571429
176
+ name: Cosine Recall@3
177
+ - type: cosine_recall@5
178
+ value: 0.89
179
+ name: Cosine Recall@5
180
+ - type: cosine_recall@10
181
+ value: 0.9328571428571428
182
+ name: Cosine Recall@10
183
+ - type: cosine_ndcg@10
184
+ value: 0.8315560673246299
185
+ name: Cosine Ndcg@10
186
+ - type: cosine_mrr@10
187
+ value: 0.7989370748299317
188
+ name: Cosine Mrr@10
189
+ - type: cosine_map@100
190
+ value: 0.801544102570532
191
+ name: Cosine Map@100
192
+ - task:
193
+ type: information-retrieval
194
+ name: Information Retrieval
195
+ dataset:
196
+ name: dim 256
197
+ type: dim_256
198
+ metrics:
199
+ - type: cosine_accuracy@1
200
+ value: 0.73
201
+ name: Cosine Accuracy@1
202
+ - type: cosine_accuracy@3
203
+ value: 0.8428571428571429
204
+ name: Cosine Accuracy@3
205
+ - type: cosine_accuracy@5
206
+ value: 0.8842857142857142
207
+ name: Cosine Accuracy@5
208
+ - type: cosine_accuracy@10
209
+ value: 0.9242857142857143
210
+ name: Cosine Accuracy@10
211
+ - type: cosine_precision@1
212
+ value: 0.73
213
+ name: Cosine Precision@1
214
+ - type: cosine_precision@3
215
+ value: 0.28095238095238095
216
+ name: Cosine Precision@3
217
+ - type: cosine_precision@5
218
+ value: 0.17685714285714282
219
+ name: Cosine Precision@5
220
+ - type: cosine_precision@10
221
+ value: 0.09242857142857142
222
+ name: Cosine Precision@10
223
+ - type: cosine_recall@1
224
+ value: 0.73
225
+ name: Cosine Recall@1
226
+ - type: cosine_recall@3
227
+ value: 0.8428571428571429
228
+ name: Cosine Recall@3
229
+ - type: cosine_recall@5
230
+ value: 0.8842857142857142
231
+ name: Cosine Recall@5
232
+ - type: cosine_recall@10
233
+ value: 0.9242857142857143
234
+ name: Cosine Recall@10
235
+ - type: cosine_ndcg@10
236
+ value: 0.8268873311527957
237
+ name: Cosine Ndcg@10
238
+ - type: cosine_mrr@10
239
+ value: 0.7956485260770971
240
+ name: Cosine Mrr@10
241
+ - type: cosine_map@100
242
+ value: 0.798561528530067
243
+ name: Cosine Map@100
244
+ - task:
245
+ type: information-retrieval
246
+ name: Information Retrieval
247
+ dataset:
248
+ name: dim 128
249
+ type: dim_128
250
+ metrics:
251
+ - type: cosine_accuracy@1
252
+ value: 0.7157142857142857
253
+ name: Cosine Accuracy@1
254
+ - type: cosine_accuracy@3
255
+ value: 0.8414285714285714
256
+ name: Cosine Accuracy@3
257
+ - type: cosine_accuracy@5
258
+ value: 0.8671428571428571
259
+ name: Cosine Accuracy@5
260
+ - type: cosine_accuracy@10
261
+ value: 0.9185714285714286
262
+ name: Cosine Accuracy@10
263
+ - type: cosine_precision@1
264
+ value: 0.7157142857142857
265
+ name: Cosine Precision@1
266
+ - type: cosine_precision@3
267
+ value: 0.28047619047619043
268
+ name: Cosine Precision@3
269
+ - type: cosine_precision@5
270
+ value: 0.1734285714285714
271
+ name: Cosine Precision@5
272
+ - type: cosine_precision@10
273
+ value: 0.09185714285714283
274
+ name: Cosine Precision@10
275
+ - type: cosine_recall@1
276
+ value: 0.7157142857142857
277
+ name: Cosine Recall@1
278
+ - type: cosine_recall@3
279
+ value: 0.8414285714285714
280
+ name: Cosine Recall@3
281
+ - type: cosine_recall@5
282
+ value: 0.8671428571428571
283
+ name: Cosine Recall@5
284
+ - type: cosine_recall@10
285
+ value: 0.9185714285714286
286
+ name: Cosine Recall@10
287
+ - type: cosine_ndcg@10
288
+ value: 0.8170171494742537
289
+ name: Cosine Ndcg@10
290
+ - type: cosine_mrr@10
291
+ value: 0.784555555555555
292
+ name: Cosine Mrr@10
293
+ - type: cosine_map@100
294
+ value: 0.7871835671545038
295
+ name: Cosine Map@100
296
+ - task:
297
+ type: information-retrieval
298
+ name: Information Retrieval
299
+ dataset:
300
+ name: dim 64
301
+ type: dim_64
302
+ metrics:
303
+ - type: cosine_accuracy@1
304
+ value: 0.6928571428571428
305
+ name: Cosine Accuracy@1
306
+ - type: cosine_accuracy@3
307
+ value: 0.8171428571428572
308
+ name: Cosine Accuracy@3
309
+ - type: cosine_accuracy@5
310
+ value: 0.8471428571428572
311
+ name: Cosine Accuracy@5
312
+ - type: cosine_accuracy@10
313
+ value: 0.8928571428571429
314
+ name: Cosine Accuracy@10
315
+ - type: cosine_precision@1
316
+ value: 0.6928571428571428
317
+ name: Cosine Precision@1
318
+ - type: cosine_precision@3
319
+ value: 0.2723809523809524
320
+ name: Cosine Precision@3
321
+ - type: cosine_precision@5
322
+ value: 0.16942857142857143
323
+ name: Cosine Precision@5
324
+ - type: cosine_precision@10
325
+ value: 0.08928571428571426
326
+ name: Cosine Precision@10
327
+ - type: cosine_recall@1
328
+ value: 0.6928571428571428
329
+ name: Cosine Recall@1
330
+ - type: cosine_recall@3
331
+ value: 0.8171428571428572
332
+ name: Cosine Recall@3
333
+ - type: cosine_recall@5
334
+ value: 0.8471428571428572
335
+ name: Cosine Recall@5
336
+ - type: cosine_recall@10
337
+ value: 0.8928571428571429
338
+ name: Cosine Recall@10
339
+ - type: cosine_ndcg@10
340
+ value: 0.7945818011619106
341
+ name: Cosine Ndcg@10
342
+ - type: cosine_mrr@10
343
+ value: 0.7630130385487527
344
+ name: Cosine Mrr@10
345
+ - type: cosine_map@100
346
+ value: 0.7667826657397622
347
+ name: Cosine Map@100
348
+ ---
349
+
350
+ # BGE base Financial Matryoshka
351
+
352
+ 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.
353
+
354
+ ## Model Details
355
+
356
+ ### Model Description
357
+ - **Model Type:** Sentence Transformer
358
+ - **Base model:** [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) <!-- at revision a5beb1e3e68b9ab74eb54cfd186867f64f240e1a -->
359
+ - **Maximum Sequence Length:** 512 tokens
360
+ - **Output Dimensionality:** 768 dimensions
361
+ - **Similarity Function:** Cosine Similarity
362
+ - **Training Dataset:**
363
+ - json
364
+ - **Language:** en
365
+ - **License:** apache-2.0
366
+
367
+ ### Model Sources
368
+
369
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
370
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
371
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
372
+
373
+ ### Full Model Architecture
374
+
375
+ ```
376
+ SentenceTransformer(
377
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
378
+ (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})
379
+ (2): Normalize()
380
+ )
381
+ ```
382
+
383
+ ## Usage
384
+
385
+ ### Direct Usage (Sentence Transformers)
386
+
387
+ First install the Sentence Transformers library:
388
+
389
+ ```bash
390
+ pip install -U sentence-transformers
391
+ ```
392
+
393
+ Then you can load this model and run inference.
394
+ ```python
395
+ from sentence_transformers import SentenceTransformer
396
+
397
+ # Download from the 🤗 Hub
398
+ model = SentenceTransformer("sintuk/bge-base-financial-matryoshka")
399
+ # Run inference
400
+ sentences = [
401
+ 'Any such inquiries or investigations (including the IDPC proceedings) could subject us to substantial fines and costs, require us to change our business practices, divert resources and the attention of management from our business, or adversely affect our business.',
402
+ 'What are some of the potential consequences for Meta Platforms, Inc. from inquiries or investigations as noted in the provided text?',
403
+ "What was the quarterly dividend declared by Bank of America's board of directors on January 31, 2024?",
404
+ ]
405
+ embeddings = model.encode(sentences)
406
+ print(embeddings.shape)
407
+ # [3, 768]
408
+
409
+ # Get the similarity scores for the embeddings
410
+ similarities = model.similarity(embeddings, embeddings)
411
+ print(similarities.shape)
412
+ # [3, 3]
413
+ ```
414
+
415
+ <!--
416
+ ### Direct Usage (Transformers)
417
+
418
+ <details><summary>Click to see the direct usage in Transformers</summary>
419
+
420
+ </details>
421
+ -->
422
+
423
+ <!--
424
+ ### Downstream Usage (Sentence Transformers)
425
+
426
+ You can finetune this model on your own dataset.
427
+
428
+ <details><summary>Click to expand</summary>
429
+
430
+ </details>
431
+ -->
432
+
433
+ <!--
434
+ ### Out-of-Scope Use
435
+
436
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
437
+ -->
438
+
439
+ ## Evaluation
440
+
441
+ ### Metrics
442
+
443
+ #### Information Retrieval
444
+
445
+ * Datasets: `dim_768`, `dim_512`, `dim_256`, `dim_128` and `dim_64`
446
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
447
+
448
+ | Metric | dim_768 | dim_512 | dim_256 | dim_128 | dim_64 |
449
+ |:--------------------|:-----------|:-----------|:-----------|:----------|:-----------|
450
+ | cosine_accuracy@1 | 0.7357 | 0.7271 | 0.73 | 0.7157 | 0.6929 |
451
+ | cosine_accuracy@3 | 0.8557 | 0.8629 | 0.8429 | 0.8414 | 0.8171 |
452
+ | cosine_accuracy@5 | 0.8957 | 0.89 | 0.8843 | 0.8671 | 0.8471 |
453
+ | cosine_accuracy@10 | 0.9286 | 0.9329 | 0.9243 | 0.9186 | 0.8929 |
454
+ | cosine_precision@1 | 0.7357 | 0.7271 | 0.73 | 0.7157 | 0.6929 |
455
+ | cosine_precision@3 | 0.2852 | 0.2876 | 0.281 | 0.2805 | 0.2724 |
456
+ | cosine_precision@5 | 0.1791 | 0.178 | 0.1769 | 0.1734 | 0.1694 |
457
+ | cosine_precision@10 | 0.0929 | 0.0933 | 0.0924 | 0.0919 | 0.0893 |
458
+ | cosine_recall@1 | 0.7357 | 0.7271 | 0.73 | 0.7157 | 0.6929 |
459
+ | cosine_recall@3 | 0.8557 | 0.8629 | 0.8429 | 0.8414 | 0.8171 |
460
+ | cosine_recall@5 | 0.8957 | 0.89 | 0.8843 | 0.8671 | 0.8471 |
461
+ | cosine_recall@10 | 0.9286 | 0.9329 | 0.9243 | 0.9186 | 0.8929 |
462
+ | **cosine_ndcg@10** | **0.8338** | **0.8316** | **0.8269** | **0.817** | **0.7946** |
463
+ | cosine_mrr@10 | 0.8032 | 0.7989 | 0.7956 | 0.7846 | 0.763 |
464
+ | cosine_map@100 | 0.8062 | 0.8015 | 0.7986 | 0.7872 | 0.7668 |
465
+
466
+ <!--
467
+ ## Bias, Risks and Limitations
468
+
469
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
470
+ -->
471
+
472
+ <!--
473
+ ### Recommendations
474
+
475
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
476
+ -->
477
+
478
+ ## Training Details
479
+
480
+ ### Training Dataset
481
+
482
+ #### json
483
+
484
+ * Dataset: json
485
+ * Size: 6,300 training samples
486
+ * Columns: <code>positive</code> and <code>anchor</code>
487
+ * Approximate statistics based on the first 1000 samples:
488
+ | | positive | anchor |
489
+ |:--------|:-----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
490
+ | type | string | string |
491
+ | details | <ul><li>min: 6 tokens</li><li>mean: 45.64 tokens</li><li>max: 301 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 20.4 tokens</li><li>max: 42 tokens</li></ul> |
492
+ * Samples:
493
+ | positive | anchor |
494
+ |:----------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------|
495
+ | <code>We later began working with commercial enterprises, who often faced fundamentally similar challenges in working with data.</code> | <code>What type of software solutions did Palantir later provide to commercial enterprises?</code> |
496
+ | <code>General Motors Company was incorporated as a Delaware corporation in 2009.</code> | <code>What year was General Motors Company incorporated?</code> |
497
+ | <code>Companies with which we have strategic partnerships in some areas may be competitors in other areas.</code> | <code>What is the nature of IBM's relationship with its strategic partners in competitional terms?</code> |
498
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
499
+ ```json
500
+ {
501
+ "loss": "MultipleNegativesRankingLoss",
502
+ "matryoshka_dims": [
503
+ 768,
504
+ 512,
505
+ 256,
506
+ 128,
507
+ 64
508
+ ],
509
+ "matryoshka_weights": [
510
+ 1,
511
+ 1,
512
+ 1,
513
+ 1,
514
+ 1
515
+ ],
516
+ "n_dims_per_step": -1
517
+ }
518
+ ```
519
+
520
+ ### Training Hyperparameters
521
+ #### Non-Default Hyperparameters
522
+
523
+ - `eval_strategy`: epoch
524
+ - `per_device_train_batch_size`: 32
525
+ - `per_device_eval_batch_size`: 16
526
+ - `gradient_accumulation_steps`: 16
527
+ - `learning_rate`: 2e-05
528
+ - `num_train_epochs`: 4
529
+ - `lr_scheduler_type`: cosine
530
+ - `warmup_ratio`: 0.1
531
+ - `tf32`: False
532
+ - `load_best_model_at_end`: True
533
+ - `batch_sampler`: no_duplicates
534
+
535
+ #### All Hyperparameters
536
+ <details><summary>Click to expand</summary>
537
+
538
+ - `overwrite_output_dir`: False
539
+ - `do_predict`: False
540
+ - `eval_strategy`: epoch
541
+ - `prediction_loss_only`: True
542
+ - `per_device_train_batch_size`: 32
543
+ - `per_device_eval_batch_size`: 16
544
+ - `per_gpu_train_batch_size`: None
545
+ - `per_gpu_eval_batch_size`: None
546
+ - `gradient_accumulation_steps`: 16
547
+ - `eval_accumulation_steps`: None
548
+ - `learning_rate`: 2e-05
549
+ - `weight_decay`: 0.0
550
+ - `adam_beta1`: 0.9
551
+ - `adam_beta2`: 0.999
552
+ - `adam_epsilon`: 1e-08
553
+ - `max_grad_norm`: 1.0
554
+ - `num_train_epochs`: 4
555
+ - `max_steps`: -1
556
+ - `lr_scheduler_type`: cosine
557
+ - `lr_scheduler_kwargs`: {}
558
+ - `warmup_ratio`: 0.1
559
+ - `warmup_steps`: 0
560
+ - `log_level`: passive
561
+ - `log_level_replica`: warning
562
+ - `log_on_each_node`: True
563
+ - `logging_nan_inf_filter`: True
564
+ - `save_safetensors`: True
565
+ - `save_on_each_node`: False
566
+ - `save_only_model`: False
567
+ - `restore_callback_states_from_checkpoint`: False
568
+ - `no_cuda`: False
569
+ - `use_cpu`: False
570
+ - `use_mps_device`: False
571
+ - `seed`: 42
572
+ - `data_seed`: None
573
+ - `jit_mode_eval`: False
574
+ - `use_ipex`: False
575
+ - `bf16`: False
576
+ - `fp16`: False
577
+ - `fp16_opt_level`: O1
578
+ - `half_precision_backend`: auto
579
+ - `bf16_full_eval`: False
580
+ - `fp16_full_eval`: False
581
+ - `tf32`: False
582
+ - `local_rank`: 0
583
+ - `ddp_backend`: None
584
+ - `tpu_num_cores`: None
585
+ - `tpu_metrics_debug`: False
586
+ - `debug`: []
587
+ - `dataloader_drop_last`: False
588
+ - `dataloader_num_workers`: 0
589
+ - `dataloader_prefetch_factor`: None
590
+ - `past_index`: -1
591
+ - `disable_tqdm`: False
592
+ - `remove_unused_columns`: True
593
+ - `label_names`: None
594
+ - `load_best_model_at_end`: True
595
+ - `ignore_data_skip`: False
596
+ - `fsdp`: []
597
+ - `fsdp_min_num_params`: 0
598
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
599
+ - `fsdp_transformer_layer_cls_to_wrap`: None
600
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
601
+ - `deepspeed`: None
602
+ - `label_smoothing_factor`: 0.0
603
+ - `optim`: adamw_torch
604
+ - `optim_args`: None
605
+ - `adafactor`: False
606
+ - `group_by_length`: False
607
+ - `length_column_name`: length
608
+ - `ddp_find_unused_parameters`: None
609
+ - `ddp_bucket_cap_mb`: None
610
+ - `ddp_broadcast_buffers`: False
611
+ - `dataloader_pin_memory`: True
612
+ - `dataloader_persistent_workers`: False
613
+ - `skip_memory_metrics`: True
614
+ - `use_legacy_prediction_loop`: False
615
+ - `push_to_hub`: False
616
+ - `resume_from_checkpoint`: None
617
+ - `hub_model_id`: None
618
+ - `hub_strategy`: every_save
619
+ - `hub_private_repo`: False
620
+ - `hub_always_push`: False
621
+ - `gradient_checkpointing`: False
622
+ - `gradient_checkpointing_kwargs`: None
623
+ - `include_inputs_for_metrics`: False
624
+ - `eval_do_concat_batches`: True
625
+ - `fp16_backend`: auto
626
+ - `push_to_hub_model_id`: None
627
+ - `push_to_hub_organization`: None
628
+ - `mp_parameters`:
629
+ - `auto_find_batch_size`: False
630
+ - `full_determinism`: False
631
+ - `torchdynamo`: None
632
+ - `ray_scope`: last
633
+ - `ddp_timeout`: 1800
634
+ - `torch_compile`: False
635
+ - `torch_compile_backend`: None
636
+ - `torch_compile_mode`: None
637
+ - `dispatch_batches`: None
638
+ - `split_batches`: None
639
+ - `include_tokens_per_second`: False
640
+ - `include_num_input_tokens_seen`: False
641
+ - `neftune_noise_alpha`: None
642
+ - `optim_target_modules`: None
643
+ - `batch_eval_metrics`: 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.6103 | - | - | - | - | - |
654
+ | 0.9746 | 12 | - | 0.8290 | 0.8247 | 0.8184 | 0.8110 | 0.7726 |
655
+ | 1.6244 | 20 | 0.6597 | - | - | - | - | - |
656
+ | 1.9492 | 24 | - | 0.8313 | 0.8290 | 0.8264 | 0.8161 | 0.7849 |
657
+ | 2.4365 | 30 | 0.5016 | - | - | - | - | - |
658
+ | 2.9239 | 36 | - | 0.8340 | 0.8323 | 0.8265 | 0.8170 | 0.7943 |
659
+ | 3.2487 | 40 | 0.4629 | - | - | - | - | - |
660
+ | **3.8985** | **48** | **-** | **0.8338** | **0.8316** | **0.8269** | **0.817** | **0.7946** |
661
+
662
+ * The bold row denotes the saved checkpoint.
663
+
664
+ ### Framework Versions
665
+ - Python: 3.12.9
666
+ - Sentence Transformers: 3.4.1
667
+ - Transformers: 4.41.2
668
+ - PyTorch: 2.2.2
669
+ - Accelerate: 1.5.2
670
+ - Datasets: 2.19.1
671
+ - Tokenizers: 0.19.1
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.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.4.1",
4
+ "transformers": "4.41.2",
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:675d99cd1caeef299a2570581e271d4bb9b8b53be79955a094ab03ce77f476a5
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