antonioanerao commited on
Commit
38ac4c9
·
verified ·
1 Parent(s): 3f8caea

Add new SentenceTransformer model

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 1024,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,708 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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:30
11
+ - loss:MatryoshkaLoss
12
+ - loss:MultipleNegativesRankingLoss
13
+ base_model: BAAI/bge-large-en-v1.5
14
+ widget:
15
+ - source_sentence: O NAT foi criado em 13 de setembro de 2012 pelo Ato n.º 25 da Procuradoria-Geral
16
+ de Justiça do MPAC.
17
+ sentences:
18
+ - Quando o NAT foi criado?
19
+ - O que significa NAT?
20
+ - Quem instituiu o NAT?
21
+ - source_sentence: A Lei Complementar n.º 291 de 2014 regulamentou o NAT como um órgão
22
+ auxiliar do MPAC, fortalecendo seu papel de apoio técnico e científico.
23
+ sentences:
24
+ - O NAT é parte de qual organização?
25
+ - Qual é a função do NAT no MPAC?
26
+ - Como o NAT foi regulamentado pela Lei Complementar 291?
27
+ - source_sentence: O NAT é o Núcleo de Apoio Técnico do MPAC, criado para prestar
28
+ apoio em inteligência, segurança e operações técnico-científicas aos órgãos de
29
+ execução, especialmente ao GAECO.
30
+ sentences:
31
+ - Quem são os coordenadores do NAT?
32
+ - Qual é a função do NAT no LAB-LD?
33
+ - Me explique o que é o NAT no Ministério Público.
34
+ - source_sentence: O NAT é responsável por fornecer inteligência, suporte técnico-científico
35
+ e segurança ao MPAC, além de gerenciar o SIMBA e o LAB-LD.
36
+ sentences:
37
+ - O que é o SIMBA, gerenciado pelo NAT?
38
+ - Quais são as responsabilidades do NAT?
39
+ - Para que foi criado o NAT?
40
+ - source_sentence: NAT é o Núcleo de Apoio Técnico do Ministério Público do Estado
41
+ do Acre, criado para fornecer suporte especializado em inteligência, segurança
42
+ institucional e operações técnico-científicas.
43
+ sentences:
44
+ - Explique o que é o NAT no MPAC.
45
+ - O NAT trabalha com o GAECO?
46
+ - O que significa NAT no Ministério Público?
47
+ pipeline_tag: sentence-similarity
48
+ library_name: sentence-transformers
49
+ metrics:
50
+ - cosine_accuracy@1
51
+ - cosine_accuracy@3
52
+ - cosine_accuracy@5
53
+ - cosine_accuracy@10
54
+ - cosine_precision@1
55
+ - cosine_precision@3
56
+ - cosine_precision@5
57
+ - cosine_precision@10
58
+ - cosine_recall@1
59
+ - cosine_recall@3
60
+ - cosine_recall@5
61
+ - cosine_recall@10
62
+ - cosine_ndcg@10
63
+ - cosine_mrr@10
64
+ - cosine_map@100
65
+ model-index:
66
+ - name: BGE base Financial Matryoshka
67
+ results:
68
+ - task:
69
+ type: information-retrieval
70
+ name: Information Retrieval
71
+ dataset:
72
+ name: dim 768
73
+ type: dim_768
74
+ metrics:
75
+ - type: cosine_accuracy@1
76
+ value: 0.5
77
+ name: Cosine Accuracy@1
78
+ - type: cosine_accuracy@3
79
+ value: 0.75
80
+ name: Cosine Accuracy@3
81
+ - type: cosine_accuracy@5
82
+ value: 1.0
83
+ name: Cosine Accuracy@5
84
+ - type: cosine_accuracy@10
85
+ value: 1.0
86
+ name: Cosine Accuracy@10
87
+ - type: cosine_precision@1
88
+ value: 0.5
89
+ name: Cosine Precision@1
90
+ - type: cosine_precision@3
91
+ value: 0.25
92
+ name: Cosine Precision@3
93
+ - type: cosine_precision@5
94
+ value: 0.2
95
+ name: Cosine Precision@5
96
+ - type: cosine_precision@10
97
+ value: 0.1
98
+ name: Cosine Precision@10
99
+ - type: cosine_recall@1
100
+ value: 0.5
101
+ name: Cosine Recall@1
102
+ - type: cosine_recall@3
103
+ value: 0.75
104
+ name: Cosine Recall@3
105
+ - type: cosine_recall@5
106
+ value: 1.0
107
+ name: Cosine Recall@5
108
+ - type: cosine_recall@10
109
+ value: 1.0
110
+ name: Cosine Recall@10
111
+ - type: cosine_ndcg@10
112
+ value: 0.7544456402014998
113
+ name: Cosine Ndcg@10
114
+ - type: cosine_mrr@10
115
+ value: 0.675
116
+ name: Cosine Mrr@10
117
+ - type: cosine_map@100
118
+ value: 0.675
119
+ name: Cosine Map@100
120
+ - task:
121
+ type: information-retrieval
122
+ name: Information Retrieval
123
+ dataset:
124
+ name: dim 512
125
+ type: dim_512
126
+ metrics:
127
+ - type: cosine_accuracy@1
128
+ value: 0.5
129
+ name: Cosine Accuracy@1
130
+ - type: cosine_accuracy@3
131
+ value: 1.0
132
+ name: Cosine Accuracy@3
133
+ - type: cosine_accuracy@5
134
+ value: 1.0
135
+ name: Cosine Accuracy@5
136
+ - type: cosine_accuracy@10
137
+ value: 1.0
138
+ name: Cosine Accuracy@10
139
+ - type: cosine_precision@1
140
+ value: 0.5
141
+ name: Cosine Precision@1
142
+ - type: cosine_precision@3
143
+ value: 0.3333333333333333
144
+ name: Cosine Precision@3
145
+ - type: cosine_precision@5
146
+ value: 0.2
147
+ name: Cosine Precision@5
148
+ - type: cosine_precision@10
149
+ value: 0.1
150
+ name: Cosine Precision@10
151
+ - type: cosine_recall@1
152
+ value: 0.5
153
+ name: Cosine Recall@1
154
+ - type: cosine_recall@3
155
+ value: 1.0
156
+ name: Cosine Recall@3
157
+ - type: cosine_recall@5
158
+ value: 1.0
159
+ name: Cosine Recall@5
160
+ - type: cosine_recall@10
161
+ value: 1.0
162
+ name: Cosine Recall@10
163
+ - type: cosine_ndcg@10
164
+ value: 0.7827324383928644
165
+ name: Cosine Ndcg@10
166
+ - type: cosine_mrr@10
167
+ value: 0.7083333333333333
168
+ name: Cosine Mrr@10
169
+ - type: cosine_map@100
170
+ value: 0.7083333333333333
171
+ name: Cosine Map@100
172
+ - task:
173
+ type: information-retrieval
174
+ name: Information Retrieval
175
+ dataset:
176
+ name: dim 256
177
+ type: dim_256
178
+ metrics:
179
+ - type: cosine_accuracy@1
180
+ value: 0.5
181
+ name: Cosine Accuracy@1
182
+ - type: cosine_accuracy@3
183
+ value: 0.75
184
+ name: Cosine Accuracy@3
185
+ - type: cosine_accuracy@5
186
+ value: 1.0
187
+ name: Cosine Accuracy@5
188
+ - type: cosine_accuracy@10
189
+ value: 1.0
190
+ name: Cosine Accuracy@10
191
+ - type: cosine_precision@1
192
+ value: 0.5
193
+ name: Cosine Precision@1
194
+ - type: cosine_precision@3
195
+ value: 0.25
196
+ name: Cosine Precision@3
197
+ - type: cosine_precision@5
198
+ value: 0.2
199
+ name: Cosine Precision@5
200
+ - type: cosine_precision@10
201
+ value: 0.1
202
+ name: Cosine Precision@10
203
+ - type: cosine_recall@1
204
+ value: 0.5
205
+ name: Cosine Recall@1
206
+ - type: cosine_recall@3
207
+ value: 0.75
208
+ name: Cosine Recall@3
209
+ - type: cosine_recall@5
210
+ value: 1.0
211
+ name: Cosine Recall@5
212
+ - type: cosine_recall@10
213
+ value: 1.0
214
+ name: Cosine Recall@10
215
+ - type: cosine_ndcg@10
216
+ value: 0.7544456402014998
217
+ name: Cosine Ndcg@10
218
+ - type: cosine_mrr@10
219
+ value: 0.675
220
+ name: Cosine Mrr@10
221
+ - type: cosine_map@100
222
+ value: 0.675
223
+ name: Cosine Map@100
224
+ - task:
225
+ type: information-retrieval
226
+ name: Information Retrieval
227
+ dataset:
228
+ name: dim 128
229
+ type: dim_128
230
+ metrics:
231
+ - type: cosine_accuracy@1
232
+ value: 0.5
233
+ name: Cosine Accuracy@1
234
+ - type: cosine_accuracy@3
235
+ value: 0.75
236
+ name: Cosine Accuracy@3
237
+ - type: cosine_accuracy@5
238
+ value: 1.0
239
+ name: Cosine Accuracy@5
240
+ - type: cosine_accuracy@10
241
+ value: 1.0
242
+ name: Cosine Accuracy@10
243
+ - type: cosine_precision@1
244
+ value: 0.5
245
+ name: Cosine Precision@1
246
+ - type: cosine_precision@3
247
+ value: 0.25
248
+ name: Cosine Precision@3
249
+ - type: cosine_precision@5
250
+ value: 0.2
251
+ name: Cosine Precision@5
252
+ - type: cosine_precision@10
253
+ value: 0.1
254
+ name: Cosine Precision@10
255
+ - type: cosine_recall@1
256
+ value: 0.5
257
+ name: Cosine Recall@1
258
+ - type: cosine_recall@3
259
+ value: 0.75
260
+ name: Cosine Recall@3
261
+ - type: cosine_recall@5
262
+ value: 1.0
263
+ name: Cosine Recall@5
264
+ - type: cosine_recall@10
265
+ value: 1.0
266
+ name: Cosine Recall@10
267
+ - type: cosine_ndcg@10
268
+ value: 0.7326691395183482
269
+ name: Cosine Ndcg@10
270
+ - type: cosine_mrr@10
271
+ value: 0.6458333333333333
272
+ name: Cosine Mrr@10
273
+ - type: cosine_map@100
274
+ value: 0.6458333333333333
275
+ name: Cosine Map@100
276
+ - task:
277
+ type: information-retrieval
278
+ name: Information Retrieval
279
+ dataset:
280
+ name: dim 64
281
+ type: dim_64
282
+ metrics:
283
+ - type: cosine_accuracy@1
284
+ value: 0.5
285
+ name: Cosine Accuracy@1
286
+ - type: cosine_accuracy@3
287
+ value: 0.5
288
+ name: Cosine Accuracy@3
289
+ - type: cosine_accuracy@5
290
+ value: 1.0
291
+ name: Cosine Accuracy@5
292
+ - type: cosine_accuracy@10
293
+ value: 1.0
294
+ name: Cosine Accuracy@10
295
+ - type: cosine_precision@1
296
+ value: 0.5
297
+ name: Cosine Precision@1
298
+ - type: cosine_precision@3
299
+ value: 0.16666666666666666
300
+ name: Cosine Precision@3
301
+ - type: cosine_precision@5
302
+ value: 0.2
303
+ name: Cosine Precision@5
304
+ - type: cosine_precision@10
305
+ value: 0.1
306
+ name: Cosine Precision@10
307
+ - type: cosine_recall@1
308
+ value: 0.5
309
+ name: Cosine Recall@1
310
+ - type: cosine_recall@3
311
+ value: 0.5
312
+ name: Cosine Recall@3
313
+ - type: cosine_recall@5
314
+ value: 1.0
315
+ name: Cosine Recall@5
316
+ - type: cosine_recall@10
317
+ value: 1.0
318
+ name: Cosine Recall@10
319
+ - type: cosine_ndcg@10
320
+ value: 0.7043823413269836
321
+ name: Cosine Ndcg@10
322
+ - type: cosine_mrr@10
323
+ value: 0.6125
324
+ name: Cosine Mrr@10
325
+ - type: cosine_map@100
326
+ value: 0.6125
327
+ name: Cosine Map@100
328
+ ---
329
+
330
+ # BGE base Financial Matryoshka
331
+
332
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) on the json dataset. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
333
+
334
+ ## Model Details
335
+
336
+ ### Model Description
337
+ - **Model Type:** Sentence Transformer
338
+ - **Base model:** [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) <!-- at revision d4aa6901d3a41ba39fb536a557fa166f842b0e09 -->
339
+ - **Maximum Sequence Length:** 512 tokens
340
+ - **Output Dimensionality:** 1024 dimensions
341
+ - **Similarity Function:** Cosine Similarity
342
+ - **Training Dataset:**
343
+ - json
344
+ - **Language:** en
345
+ - **License:** apache-2.0
346
+
347
+ ### Model Sources
348
+
349
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
350
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
351
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
352
+
353
+ ### Full Model Architecture
354
+
355
+ ```
356
+ SentenceTransformer(
357
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel
358
+ (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
359
+ (2): Normalize()
360
+ )
361
+ ```
362
+
363
+ ## Usage
364
+
365
+ ### Direct Usage (Sentence Transformers)
366
+
367
+ First install the Sentence Transformers library:
368
+
369
+ ```bash
370
+ pip install -U sentence-transformers
371
+ ```
372
+
373
+ Then you can load this model and run inference.
374
+ ```python
375
+ from sentence_transformers import SentenceTransformer
376
+
377
+ # Download from the 🤗 Hub
378
+ model = SentenceTransformer("antonioanerao/mpac-bge-large")
379
+ # Run inference
380
+ sentences = [
381
+ 'NAT é o Núcleo de Apoio Técnico do Ministério Público do Estado do Acre, criado para fornecer suporte especializado em inteligência, segurança institucional e operações técnico-científicas.',
382
+ 'O que significa NAT no Ministério Público?',
383
+ 'O NAT trabalha com o GAECO?',
384
+ ]
385
+ embeddings = model.encode(sentences)
386
+ print(embeddings.shape)
387
+ # [3, 1024]
388
+
389
+ # Get the similarity scores for the embeddings
390
+ similarities = model.similarity(embeddings, embeddings)
391
+ print(similarities.shape)
392
+ # [3, 3]
393
+ ```
394
+
395
+ <!--
396
+ ### Direct Usage (Transformers)
397
+
398
+ <details><summary>Click to see the direct usage in Transformers</summary>
399
+
400
+ </details>
401
+ -->
402
+
403
+ <!--
404
+ ### Downstream Usage (Sentence Transformers)
405
+
406
+ You can finetune this model on your own dataset.
407
+
408
+ <details><summary>Click to expand</summary>
409
+
410
+ </details>
411
+ -->
412
+
413
+ <!--
414
+ ### Out-of-Scope Use
415
+
416
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
417
+ -->
418
+
419
+ ## Evaluation
420
+
421
+ ### Metrics
422
+
423
+ #### Information Retrieval
424
+
425
+ * Datasets: `dim_768`, `dim_512`, `dim_256`, `dim_128` and `dim_64`
426
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
427
+
428
+ | Metric | dim_768 | dim_512 | dim_256 | dim_128 | dim_64 |
429
+ |:--------------------|:-----------|:-----------|:-----------|:-----------|:-----------|
430
+ | cosine_accuracy@1 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 |
431
+ | cosine_accuracy@3 | 0.75 | 1.0 | 0.75 | 0.75 | 0.5 |
432
+ | cosine_accuracy@5 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
433
+ | cosine_accuracy@10 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
434
+ | cosine_precision@1 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 |
435
+ | cosine_precision@3 | 0.25 | 0.3333 | 0.25 | 0.25 | 0.1667 |
436
+ | cosine_precision@5 | 0.2 | 0.2 | 0.2 | 0.2 | 0.2 |
437
+ | cosine_precision@10 | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 |
438
+ | cosine_recall@1 | 0.5 | 0.5 | 0.5 | 0.5 | 0.5 |
439
+ | cosine_recall@3 | 0.75 | 1.0 | 0.75 | 0.75 | 0.5 |
440
+ | cosine_recall@5 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
441
+ | cosine_recall@10 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
442
+ | **cosine_ndcg@10** | **0.7544** | **0.7827** | **0.7544** | **0.7327** | **0.7044** |
443
+ | cosine_mrr@10 | 0.675 | 0.7083 | 0.675 | 0.6458 | 0.6125 |
444
+ | cosine_map@100 | 0.675 | 0.7083 | 0.675 | 0.6458 | 0.6125 |
445
+
446
+ <!--
447
+ ## Bias, Risks and Limitations
448
+
449
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
450
+ -->
451
+
452
+ <!--
453
+ ### Recommendations
454
+
455
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
456
+ -->
457
+
458
+ ## Training Details
459
+
460
+ ### Training Dataset
461
+
462
+ #### json
463
+
464
+ * Dataset: json
465
+ * Size: 30 training samples
466
+ * Columns: <code>positive</code> and <code>anchor</code>
467
+ * Approximate statistics based on the first 30 samples:
468
+ | | positive | anchor |
469
+ |:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
470
+ | type | string | string |
471
+ | details | <ul><li>min: 38 tokens</li><li>mean: 54.3 tokens</li><li>max: 75 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 13.5 tokens</li><li>max: 18 tokens</li></ul> |
472
+ * Samples:
473
+ | positive | anchor |
474
+ |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------|
475
+ | <code>O NAT foi criado em 13 de setembro de 2012 pelo Ato n.º 25 da Procuradoria-Geral de Justiça do MPAC.</code> | <code>Quando o NAT foi criado?</code> |
476
+ | <code>O NAT é vinculado à Procuradoria-Geral de Justiça e presta apoio técnico especializado ao MPAC.</code> | <code>O NAT é vinculado a qual órgão?</code> |
477
+ | <code>Os coordenadores do Núcleo de Apoio Técnico (NAT) são Marcela Cristina Ozório, como Coordenadora Geral e Bernardo Fiterman Albano, como Coordenador Adjunto </code> | <code>Quem são os coordenadores do NAT?</code> |
478
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
479
+ ```json
480
+ {
481
+ "loss": "MultipleNegativesRankingLoss",
482
+ "matryoshka_dims": [
483
+ 768,
484
+ 512,
485
+ 256,
486
+ 128,
487
+ 64
488
+ ],
489
+ "matryoshka_weights": [
490
+ 1,
491
+ 1,
492
+ 1,
493
+ 1,
494
+ 1
495
+ ],
496
+ "n_dims_per_step": -1
497
+ }
498
+ ```
499
+
500
+ ### Training Hyperparameters
501
+ #### Non-Default Hyperparameters
502
+
503
+ - `eval_strategy`: epoch
504
+ - `per_device_train_batch_size`: 32
505
+ - `per_device_eval_batch_size`: 16
506
+ - `gradient_accumulation_steps`: 16
507
+ - `learning_rate`: 2e-05
508
+ - `num_train_epochs`: 4
509
+ - `lr_scheduler_type`: cosine
510
+ - `warmup_ratio`: 0.1
511
+ - `bf16`: True
512
+ - `tf32`: True
513
+ - `load_best_model_at_end`: True
514
+ - `optim`: adamw_torch_fused
515
+ - `batch_sampler`: no_duplicates
516
+
517
+ #### All Hyperparameters
518
+ <details><summary>Click to expand</summary>
519
+
520
+ - `overwrite_output_dir`: False
521
+ - `do_predict`: False
522
+ - `eval_strategy`: epoch
523
+ - `prediction_loss_only`: True
524
+ - `per_device_train_batch_size`: 32
525
+ - `per_device_eval_batch_size`: 16
526
+ - `per_gpu_train_batch_size`: None
527
+ - `per_gpu_eval_batch_size`: None
528
+ - `gradient_accumulation_steps`: 16
529
+ - `eval_accumulation_steps`: None
530
+ - `learning_rate`: 2e-05
531
+ - `weight_decay`: 0.0
532
+ - `adam_beta1`: 0.9
533
+ - `adam_beta2`: 0.999
534
+ - `adam_epsilon`: 1e-08
535
+ - `max_grad_norm`: 1.0
536
+ - `num_train_epochs`: 4
537
+ - `max_steps`: -1
538
+ - `lr_scheduler_type`: cosine
539
+ - `lr_scheduler_kwargs`: {}
540
+ - `warmup_ratio`: 0.1
541
+ - `warmup_steps`: 0
542
+ - `log_level`: passive
543
+ - `log_level_replica`: warning
544
+ - `log_on_each_node`: True
545
+ - `logging_nan_inf_filter`: True
546
+ - `save_safetensors`: True
547
+ - `save_on_each_node`: False
548
+ - `save_only_model`: False
549
+ - `restore_callback_states_from_checkpoint`: False
550
+ - `no_cuda`: False
551
+ - `use_cpu`: False
552
+ - `use_mps_device`: False
553
+ - `seed`: 42
554
+ - `data_seed`: None
555
+ - `jit_mode_eval`: False
556
+ - `use_ipex`: False
557
+ - `bf16`: True
558
+ - `fp16`: False
559
+ - `fp16_opt_level`: O1
560
+ - `half_precision_backend`: auto
561
+ - `bf16_full_eval`: False
562
+ - `fp16_full_eval`: False
563
+ - `tf32`: True
564
+ - `local_rank`: 0
565
+ - `ddp_backend`: None
566
+ - `tpu_num_cores`: None
567
+ - `tpu_metrics_debug`: False
568
+ - `debug`: []
569
+ - `dataloader_drop_last`: False
570
+ - `dataloader_num_workers`: 0
571
+ - `dataloader_prefetch_factor`: None
572
+ - `past_index`: -1
573
+ - `disable_tqdm`: False
574
+ - `remove_unused_columns`: True
575
+ - `label_names`: None
576
+ - `load_best_model_at_end`: True
577
+ - `ignore_data_skip`: False
578
+ - `fsdp`: []
579
+ - `fsdp_min_num_params`: 0
580
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
581
+ - `fsdp_transformer_layer_cls_to_wrap`: None
582
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
583
+ - `deepspeed`: None
584
+ - `label_smoothing_factor`: 0.0
585
+ - `optim`: adamw_torch_fused
586
+ - `optim_args`: None
587
+ - `adafactor`: False
588
+ - `group_by_length`: False
589
+ - `length_column_name`: length
590
+ - `ddp_find_unused_parameters`: None
591
+ - `ddp_bucket_cap_mb`: None
592
+ - `ddp_broadcast_buffers`: False
593
+ - `dataloader_pin_memory`: True
594
+ - `dataloader_persistent_workers`: False
595
+ - `skip_memory_metrics`: True
596
+ - `use_legacy_prediction_loop`: False
597
+ - `push_to_hub`: False
598
+ - `resume_from_checkpoint`: None
599
+ - `hub_model_id`: None
600
+ - `hub_strategy`: every_save
601
+ - `hub_private_repo`: False
602
+ - `hub_always_push`: False
603
+ - `gradient_checkpointing`: False
604
+ - `gradient_checkpointing_kwargs`: None
605
+ - `include_inputs_for_metrics`: False
606
+ - `eval_do_concat_batches`: True
607
+ - `fp16_backend`: auto
608
+ - `push_to_hub_model_id`: None
609
+ - `push_to_hub_organization`: None
610
+ - `mp_parameters`:
611
+ - `auto_find_batch_size`: False
612
+ - `full_determinism`: False
613
+ - `torchdynamo`: None
614
+ - `ray_scope`: last
615
+ - `ddp_timeout`: 1800
616
+ - `torch_compile`: False
617
+ - `torch_compile_backend`: None
618
+ - `torch_compile_mode`: None
619
+ - `dispatch_batches`: None
620
+ - `split_batches`: None
621
+ - `include_tokens_per_second`: False
622
+ - `include_num_input_tokens_seen`: False
623
+ - `neftune_noise_alpha`: None
624
+ - `optim_target_modules`: None
625
+ - `batch_eval_metrics`: False
626
+ - `prompts`: None
627
+ - `batch_sampler`: no_duplicates
628
+ - `multi_dataset_batch_sampler`: proportional
629
+
630
+ </details>
631
+
632
+ ### Training Logs
633
+ | Epoch | Step | 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 |
634
+ |:-------:|:-----:|:----------------------:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|
635
+ | 1.0 | 1 | 0.75 | 0.75 | 0.75 | 0.75 | 0.75 |
636
+ | **2.0** | **2** | **0.7468** | **0.7468** | **0.6967** | **0.7654** | **0.6973** |
637
+ | 3.0 | 3 | 0.7544 | 0.7654 | 0.7544 | 0.7327 | 0.6967 |
638
+ | 4.0 | 4 | 0.7544 | 0.7827 | 0.7544 | 0.7327 | 0.7044 |
639
+
640
+ * The bold row denotes the saved checkpoint.
641
+
642
+ ### Framework Versions
643
+ - Python: 3.12.7
644
+ - Sentence Transformers: 3.3.1
645
+ - Transformers: 4.41.2
646
+ - PyTorch: 2.5.1+cu124
647
+ - Accelerate: 1.1.0
648
+ - Datasets: 2.19.1
649
+ - Tokenizers: 0.19.1
650
+
651
+ ## Citation
652
+
653
+ ### BibTeX
654
+
655
+ #### Sentence Transformers
656
+ ```bibtex
657
+ @inproceedings{reimers-2019-sentence-bert,
658
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
659
+ author = "Reimers, Nils and Gurevych, Iryna",
660
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
661
+ month = "11",
662
+ year = "2019",
663
+ publisher = "Association for Computational Linguistics",
664
+ url = "https://arxiv.org/abs/1908.10084",
665
+ }
666
+ ```
667
+
668
+ #### MatryoshkaLoss
669
+ ```bibtex
670
+ @misc{kusupati2024matryoshka,
671
+ title={Matryoshka Representation Learning},
672
+ 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},
673
+ year={2024},
674
+ eprint={2205.13147},
675
+ archivePrefix={arXiv},
676
+ primaryClass={cs.LG}
677
+ }
678
+ ```
679
+
680
+ #### MultipleNegativesRankingLoss
681
+ ```bibtex
682
+ @misc{henderson2017efficient,
683
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
684
+ 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},
685
+ year={2017},
686
+ eprint={1705.00652},
687
+ archivePrefix={arXiv},
688
+ primaryClass={cs.CL}
689
+ }
690
+ ```
691
+
692
+ <!--
693
+ ## Glossary
694
+
695
+ *Clearly define terms in order to be accessible across audiences.*
696
+ -->
697
+
698
+ <!--
699
+ ## Model Card Authors
700
+
701
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
702
+ -->
703
+
704
+ <!--
705
+ ## Model Card Contact
706
+
707
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
708
+ -->
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "BAAI/bge-large-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": 1024,
12
+ "id2label": {
13
+ "0": "LABEL_0"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 4096,
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": 16,
24
+ "num_hidden_layers": 24,
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.5.1+cu124"
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:070a7aab956b3badfe9f92cc35ce243635c5ae2b1903fa331b6a167acac55e1b
3
+ size 1340612432
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