philipp-zettl commited on
Commit
642811c
1 Parent(s): e7cad6b

Add new SentenceTransformer model.

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ unigram.json filter=lfs diff=lfs merge=lfs -text
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
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,509 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: []
3
+ library_name: sentence-transformers
4
+ tags:
5
+ - sentence-transformers
6
+ - sentence-similarity
7
+ - feature-extraction
8
+ - generated_from_trainer
9
+ - dataset_size:508
10
+ - loss:CoSENTLoss
11
+ base_model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
12
+ datasets: []
13
+ metrics:
14
+ - pearson_cosine
15
+ - spearman_cosine
16
+ - pearson_manhattan
17
+ - spearman_manhattan
18
+ - pearson_euclidean
19
+ - spearman_euclidean
20
+ - pearson_dot
21
+ - spearman_dot
22
+ - pearson_max
23
+ - spearman_max
24
+ widget:
25
+ - source_sentence: Dame más opciones para enviar mi paquete
26
+ sentences:
27
+ - general query
28
+ - product query
29
+ - product query
30
+ - source_sentence: 我怎样才能更改我的账户密码?
31
+ sentences:
32
+ - product query
33
+ - general query
34
+ - product query
35
+ - source_sentence: Order a new pair of running shoes
36
+ sentences:
37
+ - faq query
38
+ - faq query
39
+ - general query
40
+ - source_sentence: 请推荐一些家庭健身器材
41
+ sentences:
42
+ - faq query
43
+ - general query
44
+ - faq query
45
+ - source_sentence: Order a new winter coat
46
+ sentences:
47
+ - product query
48
+ - product query
49
+ - general query
50
+ pipeline_tag: sentence-similarity
51
+ model-index:
52
+ - name: SentenceTransformer based on sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
53
+ results:
54
+ - task:
55
+ type: semantic-similarity
56
+ name: Semantic Similarity
57
+ dataset:
58
+ name: MiniLM dev
59
+ type: MiniLM-dev
60
+ metrics:
61
+ - type: pearson_cosine
62
+ value: 0.6555822177989306
63
+ name: Pearson Cosine
64
+ - type: spearman_cosine
65
+ value: 0.691867992236466
66
+ name: Spearman Cosine
67
+ - type: pearson_manhattan
68
+ value: 0.29915192592277506
69
+ name: Pearson Manhattan
70
+ - type: spearman_manhattan
71
+ value: 0.28303690591491787
72
+ name: Spearman Manhattan
73
+ - type: pearson_euclidean
74
+ value: 0.315386191469612
75
+ name: Pearson Euclidean
76
+ - type: spearman_euclidean
77
+ value: 0.3040026026493563
78
+ name: Spearman Euclidean
79
+ - type: pearson_dot
80
+ value: 0.6661666205439878
81
+ name: Pearson Dot
82
+ - type: spearman_dot
83
+ value: 0.7058451233927582
84
+ name: Spearman Dot
85
+ - type: pearson_max
86
+ value: 0.6661666205439878
87
+ name: Pearson Max
88
+ - type: spearman_max
89
+ value: 0.7058451233927582
90
+ name: Spearman Max
91
+ - task:
92
+ type: semantic-similarity
93
+ name: Semantic Similarity
94
+ dataset:
95
+ name: MiniLM test
96
+ type: MiniLM-test
97
+ metrics:
98
+ - type: pearson_cosine
99
+ value: 0.4482551956271782
100
+ name: Pearson Cosine
101
+ - type: spearman_cosine
102
+ value: 0.4495833650450182
103
+ name: Spearman Cosine
104
+ - type: pearson_manhattan
105
+ value: 0.28974095674607353
106
+ name: Pearson Manhattan
107
+ - type: spearman_manhattan
108
+ value: 0.2628992248929916
109
+ name: Spearman Manhattan
110
+ - type: pearson_euclidean
111
+ value: 0.27730588463332995
112
+ name: Pearson Euclidean
113
+ - type: spearman_euclidean
114
+ value: 0.25776112929247713
115
+ name: Spearman Euclidean
116
+ - type: pearson_dot
117
+ value: 0.4608998927589405
118
+ name: Pearson Dot
119
+ - type: spearman_dot
120
+ value: 0.46671035038006653
121
+ name: Spearman Dot
122
+ - type: pearson_max
123
+ value: 0.4608998927589405
124
+ name: Pearson Max
125
+ - type: spearman_max
126
+ value: 0.46671035038006653
127
+ name: Spearman Max
128
+ ---
129
+
130
+ # SentenceTransformer based on sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
131
+
132
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
133
+
134
+ ## Model Details
135
+
136
+ ### Model Description
137
+ - **Model Type:** Sentence Transformer
138
+ - **Base model:** [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2) <!-- at revision bf3bf13ab40c3157080a7ab344c831b9ad18b5eb -->
139
+ - **Maximum Sequence Length:** 128 tokens
140
+ - **Output Dimensionality:** 384 tokens
141
+ - **Similarity Function:** Cosine Similarity
142
+ <!-- - **Training Dataset:** Unknown -->
143
+ <!-- - **Language:** Unknown -->
144
+ <!-- - **License:** Unknown -->
145
+
146
+ ### Model Sources
147
+
148
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
149
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
150
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
151
+
152
+ ### Full Model Architecture
153
+
154
+ ```
155
+ SentenceTransformer(
156
+ (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: BertModel
157
+ (1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
158
+ )
159
+ ```
160
+
161
+ ## Usage
162
+
163
+ ### Direct Usage (Sentence Transformers)
164
+
165
+ First install the Sentence Transformers library:
166
+
167
+ ```bash
168
+ pip install -U sentence-transformers
169
+ ```
170
+
171
+ Then you can load this model and run inference.
172
+ ```python
173
+ from sentence_transformers import SentenceTransformer
174
+
175
+ # Download from the 🤗 Hub
176
+ model = SentenceTransformer("philipp-zettl/MiniLM-amazon_massive_intent-similarity-small")
177
+ # Run inference
178
+ sentences = [
179
+ 'Order a new winter coat',
180
+ 'product query',
181
+ 'product query',
182
+ ]
183
+ embeddings = model.encode(sentences)
184
+ print(embeddings.shape)
185
+ # [3, 384]
186
+
187
+ # Get the similarity scores for the embeddings
188
+ similarities = model.similarity(embeddings, embeddings)
189
+ print(similarities.shape)
190
+ # [3, 3]
191
+ ```
192
+
193
+ <!--
194
+ ### Direct Usage (Transformers)
195
+
196
+ <details><summary>Click to see the direct usage in Transformers</summary>
197
+
198
+ </details>
199
+ -->
200
+
201
+ <!--
202
+ ### Downstream Usage (Sentence Transformers)
203
+
204
+ You can finetune this model on your own dataset.
205
+
206
+ <details><summary>Click to expand</summary>
207
+
208
+ </details>
209
+ -->
210
+
211
+ <!--
212
+ ### Out-of-Scope Use
213
+
214
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
215
+ -->
216
+
217
+ ## Evaluation
218
+
219
+ ### Metrics
220
+
221
+ #### Semantic Similarity
222
+ * Dataset: `MiniLM-dev`
223
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
224
+
225
+ | Metric | Value |
226
+ |:--------------------|:-----------|
227
+ | pearson_cosine | 0.6556 |
228
+ | **spearman_cosine** | **0.6919** |
229
+ | pearson_manhattan | 0.2992 |
230
+ | spearman_manhattan | 0.283 |
231
+ | pearson_euclidean | 0.3154 |
232
+ | spearman_euclidean | 0.304 |
233
+ | pearson_dot | 0.6662 |
234
+ | spearman_dot | 0.7058 |
235
+ | pearson_max | 0.6662 |
236
+ | spearman_max | 0.7058 |
237
+
238
+ #### Semantic Similarity
239
+ * Dataset: `MiniLM-test`
240
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
241
+
242
+ | Metric | Value |
243
+ |:--------------------|:-----------|
244
+ | pearson_cosine | 0.4483 |
245
+ | **spearman_cosine** | **0.4496** |
246
+ | pearson_manhattan | 0.2897 |
247
+ | spearman_manhattan | 0.2629 |
248
+ | pearson_euclidean | 0.2773 |
249
+ | spearman_euclidean | 0.2578 |
250
+ | pearson_dot | 0.4609 |
251
+ | spearman_dot | 0.4667 |
252
+ | pearson_max | 0.4609 |
253
+ | spearman_max | 0.4667 |
254
+
255
+ <!--
256
+ ## Bias, Risks and Limitations
257
+
258
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
259
+ -->
260
+
261
+ <!--
262
+ ### Recommendations
263
+
264
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
265
+ -->
266
+
267
+ ## Training Details
268
+
269
+ ### Training Dataset
270
+
271
+ #### Unnamed Dataset
272
+
273
+
274
+ * Size: 508 training samples
275
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
276
+ * Approximate statistics based on the first 1000 samples:
277
+ | | sentence1 | sentence2 | score |
278
+ |:--------|:----------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|:---------------------------------------------------------------|
279
+ | type | string | string | float |
280
+ | details | <ul><li>min: 7 tokens</li><li>mean: 11.19 tokens</li><li>max: 19 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 5.35 tokens</li><li>max: 6 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.49</li><li>max: 1.0</li></ul> |
281
+ * Samples:
282
+ | sentence1 | sentence2 | score |
283
+ |:-------------------------------------------------------------|:---------------------------|:-----------------|
284
+ | <code>أريد أن أعرف أسعار الحقائب الجلدية</code> | <code>product query</code> | <code>1.0</code> |
285
+ | <code>Sende mir die neuesten Modetrends</code> | <code>product query</code> | <code>1.0</code> |
286
+ | <code>¿Cuánto tarda en llegar un envío internacional?</code> | <code>product query</code> | <code>0.0</code> |
287
+ * Loss: [<code>CoSENTLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosentloss) with these parameters:
288
+ ```json
289
+ {
290
+ "scale": 20.0,
291
+ "similarity_fct": "pairwise_cos_sim"
292
+ }
293
+ ```
294
+
295
+ ### Evaluation Dataset
296
+
297
+ #### Unnamed Dataset
298
+
299
+
300
+ * Size: 64 evaluation samples
301
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
302
+ * Approximate statistics based on the first 1000 samples:
303
+ | | sentence1 | sentence2 | score |
304
+ |:--------|:---------------------------------------------------------------------------------|:-------------------------------------------------------------------------------|:---------------------------------------------------------------|
305
+ | type | string | string | float |
306
+ | details | <ul><li>min: 7 tokens</li><li>mean: 10.8 tokens</li><li>max: 16 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 5.3 tokens</li><li>max: 6 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.62</li><li>max: 1.0</li></ul> |
307
+ * Samples:
308
+ | sentence1 | sentence2 | score |
309
+ |:-----------------------------------------------|:---------------------------|:-----------------|
310
+ | <code>Order a new pair of running shoes</code> | <code>faq query</code> | <code>0.0</code> |
311
+ | <code>Где ближайшая заправка?</code> | <code>general query</code> | <code>1.0</code> |
312
+ | <code>哪里有提供优惠的酒店?</code> | <code>product query</code> | <code>1.0</code> |
313
+ * Loss: [<code>CoSENTLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosentloss) with these parameters:
314
+ ```json
315
+ {
316
+ "scale": 20.0,
317
+ "similarity_fct": "pairwise_cos_sim"
318
+ }
319
+ ```
320
+
321
+ ### Training Hyperparameters
322
+ #### Non-Default Hyperparameters
323
+
324
+ - `eval_strategy`: steps
325
+ - `per_device_train_batch_size`: 32
326
+ - `per_device_eval_batch_size`: 32
327
+ - `learning_rate`: 2e-05
328
+ - `warmup_ratio`: 0.1
329
+ - `fp16`: True
330
+ - `batch_sampler`: no_duplicates
331
+
332
+ #### All Hyperparameters
333
+ <details><summary>Click to expand</summary>
334
+
335
+ - `overwrite_output_dir`: False
336
+ - `do_predict`: False
337
+ - `eval_strategy`: steps
338
+ - `prediction_loss_only`: True
339
+ - `per_device_train_batch_size`: 32
340
+ - `per_device_eval_batch_size`: 32
341
+ - `per_gpu_train_batch_size`: None
342
+ - `per_gpu_eval_batch_size`: None
343
+ - `gradient_accumulation_steps`: 1
344
+ - `eval_accumulation_steps`: None
345
+ - `learning_rate`: 2e-05
346
+ - `weight_decay`: 0.0
347
+ - `adam_beta1`: 0.9
348
+ - `adam_beta2`: 0.999
349
+ - `adam_epsilon`: 1e-08
350
+ - `max_grad_norm`: 1.0
351
+ - `num_train_epochs`: 3
352
+ - `max_steps`: -1
353
+ - `lr_scheduler_type`: linear
354
+ - `lr_scheduler_kwargs`: {}
355
+ - `warmup_ratio`: 0.1
356
+ - `warmup_steps`: 0
357
+ - `log_level`: passive
358
+ - `log_level_replica`: warning
359
+ - `log_on_each_node`: True
360
+ - `logging_nan_inf_filter`: True
361
+ - `save_safetensors`: True
362
+ - `save_on_each_node`: False
363
+ - `save_only_model`: False
364
+ - `restore_callback_states_from_checkpoint`: False
365
+ - `no_cuda`: False
366
+ - `use_cpu`: False
367
+ - `use_mps_device`: False
368
+ - `seed`: 42
369
+ - `data_seed`: None
370
+ - `jit_mode_eval`: False
371
+ - `use_ipex`: False
372
+ - `bf16`: False
373
+ - `fp16`: True
374
+ - `fp16_opt_level`: O1
375
+ - `half_precision_backend`: auto
376
+ - `bf16_full_eval`: False
377
+ - `fp16_full_eval`: False
378
+ - `tf32`: None
379
+ - `local_rank`: 0
380
+ - `ddp_backend`: None
381
+ - `tpu_num_cores`: None
382
+ - `tpu_metrics_debug`: False
383
+ - `debug`: []
384
+ - `dataloader_drop_last`: False
385
+ - `dataloader_num_workers`: 0
386
+ - `dataloader_prefetch_factor`: None
387
+ - `past_index`: -1
388
+ - `disable_tqdm`: False
389
+ - `remove_unused_columns`: True
390
+ - `label_names`: None
391
+ - `load_best_model_at_end`: False
392
+ - `ignore_data_skip`: False
393
+ - `fsdp`: []
394
+ - `fsdp_min_num_params`: 0
395
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
396
+ - `fsdp_transformer_layer_cls_to_wrap`: None
397
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
398
+ - `deepspeed`: None
399
+ - `label_smoothing_factor`: 0.0
400
+ - `optim`: adamw_torch
401
+ - `optim_args`: None
402
+ - `adafactor`: False
403
+ - `group_by_length`: False
404
+ - `length_column_name`: length
405
+ - `ddp_find_unused_parameters`: None
406
+ - `ddp_bucket_cap_mb`: None
407
+ - `ddp_broadcast_buffers`: False
408
+ - `dataloader_pin_memory`: True
409
+ - `dataloader_persistent_workers`: False
410
+ - `skip_memory_metrics`: True
411
+ - `use_legacy_prediction_loop`: False
412
+ - `push_to_hub`: False
413
+ - `resume_from_checkpoint`: None
414
+ - `hub_model_id`: None
415
+ - `hub_strategy`: every_save
416
+ - `hub_private_repo`: False
417
+ - `hub_always_push`: False
418
+ - `gradient_checkpointing`: False
419
+ - `gradient_checkpointing_kwargs`: None
420
+ - `include_inputs_for_metrics`: False
421
+ - `eval_do_concat_batches`: True
422
+ - `fp16_backend`: auto
423
+ - `push_to_hub_model_id`: None
424
+ - `push_to_hub_organization`: None
425
+ - `mp_parameters`:
426
+ - `auto_find_batch_size`: False
427
+ - `full_determinism`: False
428
+ - `torchdynamo`: None
429
+ - `ray_scope`: last
430
+ - `ddp_timeout`: 1800
431
+ - `torch_compile`: False
432
+ - `torch_compile_backend`: None
433
+ - `torch_compile_mode`: None
434
+ - `dispatch_batches`: None
435
+ - `split_batches`: None
436
+ - `include_tokens_per_second`: False
437
+ - `include_num_input_tokens_seen`: False
438
+ - `neftune_noise_alpha`: None
439
+ - `optim_target_modules`: None
440
+ - `batch_eval_metrics`: False
441
+ - `batch_sampler`: no_duplicates
442
+ - `multi_dataset_batch_sampler`: proportional
443
+
444
+ </details>
445
+
446
+ ### Training Logs
447
+ | Epoch | Step | Training Loss | loss | MiniLM-dev_spearman_cosine | MiniLM-test_spearman_cosine |
448
+ |:-----:|:----:|:-------------:|:------:|:--------------------------:|:---------------------------:|
449
+ | 0.625 | 10 | 0.8435 | 0.5815 | 0.3774 | - |
450
+ | 1.25 | 20 | 1.5026 | 0.4236 | 0.5731 | - |
451
+ | 1.875 | 30 | 0.8919 | 0.2179 | 0.6796 | - |
452
+ | 2.5 | 40 | 0.2909 | 0.1763 | 0.6919 | - |
453
+ | 3.0 | 48 | - | - | - | 0.4496 |
454
+
455
+
456
+ ### Framework Versions
457
+ - Python: 3.10.14
458
+ - Sentence Transformers: 3.0.1
459
+ - Transformers: 4.41.2
460
+ - PyTorch: 2.3.1+cu121
461
+ - Accelerate: 0.33.0
462
+ - Datasets: 2.21.0
463
+ - Tokenizers: 0.19.1
464
+
465
+ ## Citation
466
+
467
+ ### BibTeX
468
+
469
+ #### Sentence Transformers
470
+ ```bibtex
471
+ @inproceedings{reimers-2019-sentence-bert,
472
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
473
+ author = "Reimers, Nils and Gurevych, Iryna",
474
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
475
+ month = "11",
476
+ year = "2019",
477
+ publisher = "Association for Computational Linguistics",
478
+ url = "https://arxiv.org/abs/1908.10084",
479
+ }
480
+ ```
481
+
482
+ #### CoSENTLoss
483
+ ```bibtex
484
+ @online{kexuefm-8847,
485
+ title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
486
+ author={Su Jianlin},
487
+ year={2022},
488
+ month={Jan},
489
+ url={https://kexue.fm/archives/8847},
490
+ }
491
+ ```
492
+
493
+ <!--
494
+ ## Glossary
495
+
496
+ *Clearly define terms in order to be accessible across audiences.*
497
+ -->
498
+
499
+ <!--
500
+ ## Model Card Authors
501
+
502
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
503
+ -->
504
+
505
+ <!--
506
+ ## Model Card Contact
507
+
508
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
509
+ -->
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
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": 384,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 1536,
14
+ "layer_norm_eps": 1e-12,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.41.2",
23
+ "type_vocab_size": 2,
24
+ "use_cache": true,
25
+ "vocab_size": 250037
26
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.0.1",
4
+ "transformers": "4.41.2",
5
+ "pytorch": "2.3.1+cu121"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": null
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f788da217b3e9eda6435120c0404c087a3ba87fb40cc4d7d0328971bbda4fa04
3
+ size 470637416
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 128,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cad551d5600a84242d0973327029452a1e3672ba6313c2a3c3d69c4310e12719
3
+ size 17082987
tokenizer_config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "250001": {
36
+ "content": "<mask>",
37
+ "lstrip": true,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "<s>",
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "<s>",
47
+ "do_lower_case": true,
48
+ "eos_token": "</s>",
49
+ "mask_token": "<mask>",
50
+ "max_length": 128,
51
+ "model_max_length": 128,
52
+ "pad_to_multiple_of": null,
53
+ "pad_token": "<pad>",
54
+ "pad_token_type_id": 0,
55
+ "padding_side": "right",
56
+ "sep_token": "</s>",
57
+ "stride": 0,
58
+ "strip_accents": null,
59
+ "tokenize_chinese_chars": true,
60
+ "tokenizer_class": "BertTokenizer",
61
+ "truncation_side": "right",
62
+ "truncation_strategy": "longest_first",
63
+ "unk_token": "<unk>"
64
+ }
unigram.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da145b5e7700ae40f16691ec32a0b1fdc1ee3298db22a31ea55f57a966c4a65d
3
+ size 14763260