DannyAI commited on
Commit
1a368c8
·
verified ·
1 Parent(s): 65e1e3f

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,510 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: mit
5
+ tags:
6
+ - sentence-transformers
7
+ - sentence-similarity
8
+ - feature-extraction
9
+ - dense
10
+ - generated_from_trainer
11
+ - dataset_size:200000
12
+ - loss:Matryoshka2dLoss
13
+ - loss:MatryoshkaLoss
14
+ - loss:MultipleNegativesRankingLoss
15
+ base_model: BAAI/bge-large-en-v1.5
16
+ widget:
17
+ - source_sentence: A man standing in front of a brick building.
18
+ sentences:
19
+ - The men are together.
20
+ - A man is outside.
21
+ - The man pushes a women on the ground.
22
+ - source_sentence: A football coach is walking on a football field.
23
+ sentences:
24
+ - Two girls are watching dolls.
25
+ - a baseball player walks on the field
26
+ - a football coach walks on the field
27
+ - source_sentence: A woman wearing gray pants, a white blouse and a black vest is
28
+ jumping with one hand in the air as she goes through an indoor stadium.
29
+ sentences:
30
+ - The girl wearing a dress skips down the sidewalk.
31
+ - They are outdoors.
32
+ - The jumping lady in slacks also has her hand raised.
33
+ - source_sentence: A light brown dog with his tail in the air jumps of a pontoon toward
34
+ the water.
35
+ sentences:
36
+ - A man is heading to his house of worship.
37
+ - A dog jumps toward the water.
38
+ - A cat is jumping in the air.
39
+ - source_sentence: Young boy kicks a soccer ball towards the goal as the crowd watches.
40
+ sentences:
41
+ - The boy is under the age of eighteen.
42
+ - The girl is running.
43
+ - The boy is alone in his backyard.
44
+ datasets:
45
+ - sentence-transformers/all-nli
46
+ pipeline_tag: sentence-similarity
47
+ library_name: sentence-transformers
48
+ metrics:
49
+ - cosine_accuracy
50
+ model-index:
51
+ - name: bge-large-en-v1.5
52
+ results:
53
+ - task:
54
+ type: triplet
55
+ name: Triplet
56
+ dataset:
57
+ name: all nli val
58
+ type: all-nli-val
59
+ metrics:
60
+ - type: cosine_accuracy
61
+ value: 0.9513333439826965
62
+ name: Cosine Accuracy
63
+ - task:
64
+ type: triplet
65
+ name: Triplet
66
+ dataset:
67
+ name: all nli test
68
+ type: all-nli-test
69
+ metrics:
70
+ - type: cosine_accuracy
71
+ value: 0.9511272311210632
72
+ name: Cosine Accuracy
73
+ ---
74
+
75
+ # bge-large-en-v1.5
76
+
77
+ 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 [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) 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.
78
+
79
+ ## Model Details
80
+
81
+ ### Model Description
82
+ - **Model Type:** Sentence Transformer
83
+ - **Base model:** [BAAI/bge-large-en-v1.5](https://huggingface.co/BAAI/bge-large-en-v1.5) <!-- at revision d4aa6901d3a41ba39fb536a557fa166f842b0e09 -->
84
+ - **Maximum Sequence Length:** 512 tokens
85
+ - **Output Dimensionality:** 1024 dimensions
86
+ - **Similarity Function:** Cosine Similarity
87
+ - **Training Dataset:**
88
+ - [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli)
89
+ - **Language:** en
90
+ - **License:** mit
91
+
92
+ ### Model Sources
93
+
94
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
95
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
96
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
97
+
98
+ ### Full Model Architecture
99
+
100
+ ```
101
+ SentenceTransformer(
102
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': True, 'architecture': 'BertModel'})
103
+ (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})
104
+ (2): Normalize()
105
+ )
106
+ ```
107
+
108
+ ## Usage
109
+
110
+ ### Direct Usage (Sentence Transformers)
111
+
112
+ First install the Sentence Transformers library:
113
+
114
+ ```bash
115
+ pip install -U sentence-transformers
116
+ ```
117
+
118
+ Then you can load this model and run inference.
119
+ ```python
120
+ from sentence_transformers import SentenceTransformer
121
+
122
+ # Download from the 🤗 Hub
123
+ model = SentenceTransformer("DannyAI/embedding_fine_tuning_adaptive_layer_matryoshka2dloss_bge_large_en_v1.5")
124
+ # Run inference
125
+ sentences = [
126
+ 'Young boy kicks a soccer ball towards the goal as the crowd watches.',
127
+ 'The boy is under the age of eighteen.',
128
+ 'The boy is alone in his backyard.',
129
+ ]
130
+ embeddings = model.encode(sentences)
131
+ print(embeddings.shape)
132
+ # [3, 1024]
133
+
134
+ # Get the similarity scores for the embeddings
135
+ similarities = model.similarity(embeddings, embeddings)
136
+ print(similarities)
137
+ # tensor([[1.0000, 0.6251, 0.4467],
138
+ # [0.6251, 1.0000, 0.6598],
139
+ # [0.4467, 0.6598, 1.0000]])
140
+ ```
141
+
142
+ <!--
143
+ ### Direct Usage (Transformers)
144
+
145
+ <details><summary>Click to see the direct usage in Transformers</summary>
146
+
147
+ </details>
148
+ -->
149
+
150
+ <!--
151
+ ### Downstream Usage (Sentence Transformers)
152
+
153
+ You can finetune this model on your own dataset.
154
+
155
+ <details><summary>Click to expand</summary>
156
+
157
+ </details>
158
+ -->
159
+
160
+ <!--
161
+ ### Out-of-Scope Use
162
+
163
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
164
+ -->
165
+
166
+ ## Evaluation
167
+
168
+ ### Metrics
169
+
170
+ #### Triplet
171
+
172
+ * Datasets: `all-nli-val` and `all-nli-test`
173
+ * Evaluated with [<code>TripletEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
174
+
175
+ | Metric | all-nli-val | all-nli-test |
176
+ |:--------------------|:------------|:-------------|
177
+ | **cosine_accuracy** | **0.9513** | **0.9511** |
178
+
179
+ <!--
180
+ ## Bias, Risks and Limitations
181
+
182
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
183
+ -->
184
+
185
+ <!--
186
+ ### Recommendations
187
+
188
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
189
+ -->
190
+
191
+ ## Training Details
192
+
193
+ ### Training Dataset
194
+
195
+ #### all-nli
196
+
197
+ * Dataset: [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) at [d482672](https://huggingface.co/datasets/sentence-transformers/all-nli/tree/d482672c8e74ce18da116f430137434ba2e52fab)
198
+ * Size: 200,000 training samples
199
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
200
+ * Approximate statistics based on the first 1000 samples:
201
+ | | anchor | positive | negative |
202
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|
203
+ | type | string | string | string |
204
+ | details | <ul><li>min: 7 tokens</li><li>mean: 10.46 tokens</li><li>max: 46 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 12.81 tokens</li><li>max: 40 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 13.4 tokens</li><li>max: 50 tokens</li></ul> |
205
+ * Samples:
206
+ | anchor | positive | negative |
207
+ |:---------------------------------------------------------------------------|:-------------------------------------------------|:-----------------------------------------------------------|
208
+ | <code>A person on a horse jumps over a broken down airplane.</code> | <code>A person is outdoors, on a horse.</code> | <code>A person is at a diner, ordering an omelette.</code> |
209
+ | <code>Children smiling and waving at camera</code> | <code>There are children present</code> | <code>The kids are frowning</code> |
210
+ | <code>A boy is jumping on skateboard in the middle of a red bridge.</code> | <code>The boy does a skateboarding trick.</code> | <code>The boy skates down the sidewalk.</code> |
211
+ * Loss: [<code>Matryoshka2dLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
212
+ ```json
213
+ {
214
+ "loss": "MultipleNegativesRankingLoss",
215
+ "n_layers_per_step": 1,
216
+ "last_layer_weight": 1.0,
217
+ "prior_layers_weight": 1.0,
218
+ "kl_div_weight": 1.0,
219
+ "kl_temperature": 0.3,
220
+ "matryoshka_dims": [
221
+ 768,
222
+ 512,
223
+ 256,
224
+ 128,
225
+ 64
226
+ ],
227
+ "matryoshka_weights": [
228
+ 1,
229
+ 1,
230
+ 1,
231
+ 1,
232
+ 1
233
+ ],
234
+ "n_dims_per_step": 1
235
+ }
236
+ ```
237
+
238
+ ### Evaluation Dataset
239
+
240
+ #### all-nli
241
+
242
+ * Dataset: [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) at [d482672](https://huggingface.co/datasets/sentence-transformers/all-nli/tree/d482672c8e74ce18da116f430137434ba2e52fab)
243
+ * Size: 3,000 evaluation samples
244
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>negative</code>
245
+ * Approximate statistics based on the first 1000 samples:
246
+ | | anchor | positive | negative |
247
+ |:--------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
248
+ | type | string | string | string |
249
+ | details | <ul><li>min: 6 tokens</li><li>mean: 17.95 tokens</li><li>max: 63 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 9.78 tokens</li><li>max: 29 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 10.35 tokens</li><li>max: 29 tokens</li></ul> |
250
+ * Samples:
251
+ | anchor | positive | negative |
252
+ |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------|:--------------------------------------------------------|
253
+ | <code>Two women are embracing while holding to go packages.</code> | <code>Two woman are holding packages.</code> | <code>The men are fighting outside a deli.</code> |
254
+ | <code>Two young children in blue jerseys, one with the number 9 and one with the number 2 are standing on wooden steps in a bathroom and washing their hands in a sink.</code> | <code>Two kids in numbered jerseys wash their hands.</code> | <code>Two kids in jackets walk to school.</code> |
255
+ | <code>A man selling donuts to a customer during a world exhibition event held in the city of Angeles</code> | <code>A man selling donuts to a customer.</code> | <code>A woman drinks her coffee in a small cafe.</code> |
256
+ * Loss: [<code>Matryoshka2dLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshka2dloss) with these parameters:
257
+ ```json
258
+ {
259
+ "loss": "MultipleNegativesRankingLoss",
260
+ "n_layers_per_step": 1,
261
+ "last_layer_weight": 1.0,
262
+ "prior_layers_weight": 1.0,
263
+ "kl_div_weight": 1.0,
264
+ "kl_temperature": 0.3,
265
+ "matryoshka_dims": [
266
+ 768,
267
+ 512,
268
+ 256,
269
+ 128,
270
+ 64
271
+ ],
272
+ "matryoshka_weights": [
273
+ 1,
274
+ 1,
275
+ 1,
276
+ 1,
277
+ 1
278
+ ],
279
+ "n_dims_per_step": 1
280
+ }
281
+ ```
282
+
283
+ ### Training Hyperparameters
284
+ #### Non-Default Hyperparameters
285
+
286
+ - `eval_strategy`: steps
287
+ - `per_device_train_batch_size`: 5
288
+ - `per_device_eval_batch_size`: 5
289
+ - `learning_rate`: 2e-05
290
+ - `max_steps`: 300
291
+ - `warmup_ratio`: 0.1
292
+ - `seed`: 30
293
+ - `bf16`: True
294
+ - `load_best_model_at_end`: True
295
+ - `batch_sampler`: no_duplicates
296
+
297
+ #### All Hyperparameters
298
+ <details><summary>Click to expand</summary>
299
+
300
+ - `overwrite_output_dir`: False
301
+ - `do_predict`: False
302
+ - `eval_strategy`: steps
303
+ - `prediction_loss_only`: True
304
+ - `per_device_train_batch_size`: 5
305
+ - `per_device_eval_batch_size`: 5
306
+ - `per_gpu_train_batch_size`: None
307
+ - `per_gpu_eval_batch_size`: None
308
+ - `gradient_accumulation_steps`: 1
309
+ - `eval_accumulation_steps`: None
310
+ - `torch_empty_cache_steps`: None
311
+ - `learning_rate`: 2e-05
312
+ - `weight_decay`: 0.0
313
+ - `adam_beta1`: 0.9
314
+ - `adam_beta2`: 0.999
315
+ - `adam_epsilon`: 1e-08
316
+ - `max_grad_norm`: 1.0
317
+ - `num_train_epochs`: 3.0
318
+ - `max_steps`: 300
319
+ - `lr_scheduler_type`: linear
320
+ - `lr_scheduler_kwargs`: {}
321
+ - `warmup_ratio`: 0.1
322
+ - `warmup_steps`: 0
323
+ - `log_level`: passive
324
+ - `log_level_replica`: warning
325
+ - `log_on_each_node`: True
326
+ - `logging_nan_inf_filter`: True
327
+ - `save_safetensors`: True
328
+ - `save_on_each_node`: False
329
+ - `save_only_model`: False
330
+ - `restore_callback_states_from_checkpoint`: False
331
+ - `no_cuda`: False
332
+ - `use_cpu`: False
333
+ - `use_mps_device`: False
334
+ - `seed`: 30
335
+ - `data_seed`: None
336
+ - `jit_mode_eval`: False
337
+ - `use_ipex`: False
338
+ - `bf16`: True
339
+ - `fp16`: False
340
+ - `fp16_opt_level`: O1
341
+ - `half_precision_backend`: auto
342
+ - `bf16_full_eval`: False
343
+ - `fp16_full_eval`: False
344
+ - `tf32`: None
345
+ - `local_rank`: 0
346
+ - `ddp_backend`: None
347
+ - `tpu_num_cores`: None
348
+ - `tpu_metrics_debug`: False
349
+ - `debug`: []
350
+ - `dataloader_drop_last`: False
351
+ - `dataloader_num_workers`: 0
352
+ - `dataloader_prefetch_factor`: None
353
+ - `past_index`: -1
354
+ - `disable_tqdm`: False
355
+ - `remove_unused_columns`: True
356
+ - `label_names`: None
357
+ - `load_best_model_at_end`: True
358
+ - `ignore_data_skip`: False
359
+ - `fsdp`: []
360
+ - `fsdp_min_num_params`: 0
361
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
362
+ - `fsdp_transformer_layer_cls_to_wrap`: None
363
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
364
+ - `parallelism_config`: None
365
+ - `deepspeed`: None
366
+ - `label_smoothing_factor`: 0.0
367
+ - `optim`: adamw_torch_fused
368
+ - `optim_args`: None
369
+ - `adafactor`: False
370
+ - `group_by_length`: False
371
+ - `length_column_name`: length
372
+ - `ddp_find_unused_parameters`: None
373
+ - `ddp_bucket_cap_mb`: None
374
+ - `ddp_broadcast_buffers`: False
375
+ - `dataloader_pin_memory`: True
376
+ - `dataloader_persistent_workers`: False
377
+ - `skip_memory_metrics`: True
378
+ - `use_legacy_prediction_loop`: False
379
+ - `push_to_hub`: False
380
+ - `resume_from_checkpoint`: None
381
+ - `hub_model_id`: None
382
+ - `hub_strategy`: every_save
383
+ - `hub_private_repo`: None
384
+ - `hub_always_push`: False
385
+ - `hub_revision`: None
386
+ - `gradient_checkpointing`: False
387
+ - `gradient_checkpointing_kwargs`: None
388
+ - `include_inputs_for_metrics`: False
389
+ - `include_for_metrics`: []
390
+ - `eval_do_concat_batches`: True
391
+ - `fp16_backend`: auto
392
+ - `push_to_hub_model_id`: None
393
+ - `push_to_hub_organization`: None
394
+ - `mp_parameters`:
395
+ - `auto_find_batch_size`: False
396
+ - `full_determinism`: False
397
+ - `torchdynamo`: None
398
+ - `ray_scope`: last
399
+ - `ddp_timeout`: 1800
400
+ - `torch_compile`: False
401
+ - `torch_compile_backend`: None
402
+ - `torch_compile_mode`: None
403
+ - `include_tokens_per_second`: False
404
+ - `include_num_input_tokens_seen`: False
405
+ - `neftune_noise_alpha`: None
406
+ - `optim_target_modules`: None
407
+ - `batch_eval_metrics`: False
408
+ - `eval_on_start`: False
409
+ - `use_liger_kernel`: False
410
+ - `liger_kernel_config`: None
411
+ - `eval_use_gather_object`: False
412
+ - `average_tokens_across_devices`: False
413
+ - `prompts`: None
414
+ - `batch_sampler`: no_duplicates
415
+ - `multi_dataset_batch_sampler`: proportional
416
+ - `router_mapping`: {}
417
+ - `learning_rate_mapping`: {}
418
+
419
+ </details>
420
+
421
+ ### Training Logs
422
+ | Epoch | Step | Training Loss | Validation Loss | all-nli-val_cosine_accuracy | all-nli-test_cosine_accuracy |
423
+ |:----------:|:-------:|:-------------:|:---------------:|:---------------------------:|:----------------------------:|
424
+ | -1 | -1 | - | - | 0.9600 | - |
425
+ | **0.0025** | **100** | **0.828** | **0.561** | **0.954** | **-** |
426
+ | 0.005 | 200 | 0.8041 | 0.5819 | 0.9493 | - |
427
+ | 0.0075 | 300 | 0.7997 | 0.5663 | 0.9513 | - |
428
+ | -1 | -1 | - | - | - | 0.9511 |
429
+
430
+ * The bold row denotes the saved checkpoint.
431
+
432
+ ### Framework Versions
433
+ - Python: 3.12.11
434
+ - Sentence Transformers: 5.1.0
435
+ - Transformers: 4.56.1
436
+ - PyTorch: 2.8.0+cu126
437
+ - Accelerate: 1.10.1
438
+ - Datasets: 4.0.0
439
+ - Tokenizers: 0.22.0
440
+
441
+ ## Citation
442
+
443
+ ### BibTeX
444
+
445
+ #### Sentence Transformers
446
+ ```bibtex
447
+ @inproceedings{reimers-2019-sentence-bert,
448
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
449
+ author = "Reimers, Nils and Gurevych, Iryna",
450
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
451
+ month = "11",
452
+ year = "2019",
453
+ publisher = "Association for Computational Linguistics",
454
+ url = "https://arxiv.org/abs/1908.10084",
455
+ }
456
+ ```
457
+
458
+ #### Matryoshka2dLoss
459
+ ```bibtex
460
+ @misc{li20242d,
461
+ title={2D Matryoshka Sentence Embeddings},
462
+ author={Xianming Li and Zongxi Li and Jing Li and Haoran Xie and Qing Li},
463
+ year={2024},
464
+ eprint={2402.14776},
465
+ archivePrefix={arXiv},
466
+ primaryClass={cs.CL}
467
+ }
468
+ ```
469
+
470
+ #### MatryoshkaLoss
471
+ ```bibtex
472
+ @misc{kusupati2024matryoshka,
473
+ title={Matryoshka Representation Learning},
474
+ 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},
475
+ year={2024},
476
+ eprint={2205.13147},
477
+ archivePrefix={arXiv},
478
+ primaryClass={cs.LG}
479
+ }
480
+ ```
481
+
482
+ #### MultipleNegativesRankingLoss
483
+ ```bibtex
484
+ @misc{henderson2017efficient,
485
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
486
+ 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},
487
+ year={2017},
488
+ eprint={1705.00652},
489
+ archivePrefix={arXiv},
490
+ primaryClass={cs.CL}
491
+ }
492
+ ```
493
+
494
+ <!--
495
+ ## Glossary
496
+
497
+ *Clearly define terms in order to be accessible across audiences.*
498
+ -->
499
+
500
+ <!--
501
+ ## Model Card Authors
502
+
503
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
504
+ -->
505
+
506
+ <!--
507
+ ## Model Card Contact
508
+
509
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
510
+ -->
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "dtype": "float32",
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
+ "output_hidden_states": true,
26
+ "pad_token_id": 0,
27
+ "position_embedding_type": "absolute",
28
+ "transformers_version": "4.56.1",
29
+ "type_vocab_size": 2,
30
+ "use_cache": true,
31
+ "vocab_size": 30522
32
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.1.0",
4
+ "transformers": "4.56.1",
5
+ "pytorch": "2.8.0+cu126"
6
+ },
7
+ "model_type": "SentenceTransformer",
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e056492ad8cb8dd8158dcabe45790ff144bd74bd50252468f03e3706115535f
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,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