LamaDiab commited on
Commit
4ea2f84
·
verified ·
1 Parent(s): d542619

Updating model weights

Browse files
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,426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - dense
7
+ - generated_from_trainer
8
+ - dataset_size:790756
9
+ - loss:MultipleNegativesSymmetricRankingLoss
10
+ base_model: sentence-transformers/all-MiniLM-L6-v2
11
+ widget:
12
+ - source_sentence: creamy black varnish for black leathers
13
+ sentences:
14
+ - shoe accessory
15
+ - the first product scented, nourishing, polishing and preserving all types of leather
16
+ 50 gr.
17
+ - steal the scene t-shirt
18
+ - source_sentence: beige lounge set
19
+ sentences:
20
+ - pajamas
21
+ - women pajama set
22
+ - not so basic sports bra
23
+ - source_sentence: not not donner
24
+ sentences:
25
+ - sesame bites
26
+ - stuffed dough
27
+ - deli
28
+ - source_sentence: seaboat-5 240/2 sea fishing combo
29
+ sentences:
30
+ - fishing
31
+ - vertical fishing rod
32
+ - small pool ball - red
33
+ - source_sentence: eva a.bacterial h.sanitizer han.gel350m#
34
+ sentences:
35
+ - blue balloon collection
36
+ - sanitizer
37
+ - ' hand gel'
38
+ pipeline_tag: sentence-similarity
39
+ library_name: sentence-transformers
40
+ metrics:
41
+ - cosine_accuracy
42
+ model-index:
43
+ - name: SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
44
+ results:
45
+ - task:
46
+ type: triplet
47
+ name: Triplet
48
+ dataset:
49
+ name: Unknown
50
+ type: unknown
51
+ metrics:
52
+ - type: cosine_accuracy
53
+ value: 0.9748573899269104
54
+ name: Cosine Accuracy
55
+ ---
56
+
57
+ # SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
58
+
59
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-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.
60
+
61
+ ## Model Details
62
+
63
+ ### Model Description
64
+ - **Model Type:** Sentence Transformer
65
+ - **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision c9745ed1d9f207416be6d2e6f8de32d1f16199bf -->
66
+ - **Maximum Sequence Length:** 256 tokens
67
+ - **Output Dimensionality:** 384 dimensions
68
+ - **Similarity Function:** Cosine Similarity
69
+ <!-- - **Training Dataset:** Unknown -->
70
+ <!-- - **Language:** Unknown -->
71
+ <!-- - **License:** Unknown -->
72
+
73
+ ### Model Sources
74
+
75
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
76
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
77
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
78
+
79
+ ### Full Model Architecture
80
+
81
+ ```
82
+ SentenceTransformer(
83
+ (0): Transformer({'max_seq_length': 256, 'do_lower_case': False, 'architecture': 'BertModel'})
84
+ (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})
85
+ (2): Normalize()
86
+ )
87
+ ```
88
+
89
+ ## Usage
90
+
91
+ ### Direct Usage (Sentence Transformers)
92
+
93
+ First install the Sentence Transformers library:
94
+
95
+ ```bash
96
+ pip install -U sentence-transformers
97
+ ```
98
+
99
+ Then you can load this model and run inference.
100
+ ```python
101
+ from sentence_transformers import SentenceTransformer
102
+
103
+ # Download from the 🤗 Hub
104
+ model = SentenceTransformer("LamaDiab/MiniLM-v35-SemanticEngine")
105
+ # Run inference
106
+ sentences = [
107
+ 'eva a.bacterial h.sanitizer han.gel350m#',
108
+ ' hand gel',
109
+ 'blue balloon collection',
110
+ ]
111
+ embeddings = model.encode(sentences)
112
+ print(embeddings.shape)
113
+ # [3, 384]
114
+
115
+ # Get the similarity scores for the embeddings
116
+ similarities = model.similarity(embeddings, embeddings)
117
+ print(similarities)
118
+ # tensor([[ 1.0000, 0.4571, -0.0845],
119
+ # [ 0.4571, 1.0000, 0.0257],
120
+ # [-0.0845, 0.0257, 1.0000]])
121
+ ```
122
+
123
+ <!--
124
+ ### Direct Usage (Transformers)
125
+
126
+ <details><summary>Click to see the direct usage in Transformers</summary>
127
+
128
+ </details>
129
+ -->
130
+
131
+ <!--
132
+ ### Downstream Usage (Sentence Transformers)
133
+
134
+ You can finetune this model on your own dataset.
135
+
136
+ <details><summary>Click to expand</summary>
137
+
138
+ </details>
139
+ -->
140
+
141
+ <!--
142
+ ### Out-of-Scope Use
143
+
144
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
145
+ -->
146
+
147
+ ## Evaluation
148
+
149
+ ### Metrics
150
+
151
+ #### Triplet
152
+
153
+ * Evaluated with [<code>TripletEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.TripletEvaluator)
154
+
155
+ | Metric | Value |
156
+ |:--------------------|:-----------|
157
+ | **cosine_accuracy** | **0.9749** |
158
+
159
+ <!--
160
+ ## Bias, Risks and Limitations
161
+
162
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
163
+ -->
164
+
165
+ <!--
166
+ ### Recommendations
167
+
168
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
169
+ -->
170
+
171
+ ## Training Details
172
+
173
+ ### Training Dataset
174
+
175
+ #### Unnamed Dataset
176
+
177
+ * Size: 790,756 training samples
178
+ * Columns: <code>anchor</code>, <code>positive</code>, and <code>itemCategory</code>
179
+ * Approximate statistics based on the first 1000 samples:
180
+ | | anchor | positive | itemCategory |
181
+ |:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|
182
+ | type | string | string | string |
183
+ | details | <ul><li>min: 3 tokens</li><li>mean: 8.91 tokens</li><li>max: 92 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 5.92 tokens</li><li>max: 23 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 3.95 tokens</li><li>max: 9 tokens</li></ul> |
184
+ * Samples:
185
+ | anchor | positive | itemCategory |
186
+ |:---------------------------------------------------------------|:---------------------------------------------------------|:-------------------------------|
187
+ | <code>m&g acrylic marker, apl976d966, viridescent, s500</code> | <code>m&g acrylic marker, apl976d966, green, s500</code> | <code>marker</code> |
188
+ | <code>daky raspberry 48h deo r.on 2x50m@#</code> | <code>deodorant</code> | <code>women's deodorant</code> |
189
+ | <code>melatex sun yellow spf(50+)50m</code> | <code>melatex cream spf(50+)50m</code> | <code>skin whitening</code> |
190
+ * Loss: [<code>MultipleNegativesSymmetricRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativessymmetricrankingloss) with these parameters:
191
+ ```json
192
+ {
193
+ "scale": 20.0,
194
+ "similarity_fct": "cos_sim",
195
+ "gather_across_devices": false
196
+ }
197
+ ```
198
+
199
+ ### Evaluation Dataset
200
+
201
+ #### Unnamed Dataset
202
+
203
+ * Size: 9,466 evaluation samples
204
+ * Columns: <code>anchor</code>, <code>positive</code>, <code>negative</code>, and <code>itemCategory</code>
205
+ * Approximate statistics based on the first 1000 samples:
206
+ | | anchor | positive | negative | itemCategory |
207
+ |:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:--------------------------------------------------------------------------------|
208
+ | type | string | string | string | string |
209
+ | details | <ul><li>min: 3 tokens</li><li>mean: 9.65 tokens</li><li>max: 32 tokens</li></ul> | <ul><li>min: 2 tokens</li><li>mean: 6.0 tokens</li><li>max: 131 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 9.08 tokens</li><li>max: 33 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 3.82 tokens</li><li>max: 9 tokens</li></ul> |
210
+ * Samples:
211
+ | anchor | positive | negative | itemCategory |
212
+ |:-------------------------------------------------------|:-----------------------------|:--------------------------------------------------------------|:----------------------|
213
+ | <code>extra bubblemint sugar free chewing gum</code> | <code> gum</code> | <code>zumra coconut milk 17-19% fats</code> | <code>sweet</code> |
214
+ | <code>golden pothos</code> | <code>evergreen plant</code> | <code>stainless steel insulated hiking bottle 1 l blue</code> | <code>plant</code> |
215
+ | <code>effortless style slit linen pants - beige</code> | <code>women pants</code> | <code>cool grey camouflage training short sleeve top</code> | <code>trousers</code> |
216
+ * Loss: [<code>MultipleNegativesSymmetricRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativessymmetricrankingloss) with these parameters:
217
+ ```json
218
+ {
219
+ "scale": 20.0,
220
+ "similarity_fct": "cos_sim",
221
+ "gather_across_devices": false
222
+ }
223
+ ```
224
+
225
+ ### Training Hyperparameters
226
+ #### Non-Default Hyperparameters
227
+
228
+ - `eval_strategy`: steps
229
+ - `per_device_train_batch_size`: 256
230
+ - `per_device_eval_batch_size`: 256
231
+ - `learning_rate`: 3e-05
232
+ - `weight_decay`: 0.01
233
+ - `num_train_epochs`: 4
234
+ - `warmup_ratio`: 0.1
235
+ - `fp16`: True
236
+ - `dataloader_num_workers`: 1
237
+ - `dataloader_prefetch_factor`: 2
238
+ - `dataloader_persistent_workers`: True
239
+ - `push_to_hub`: True
240
+ - `hub_model_id`: LamaDiab/MiniLM-v35-SemanticEngine
241
+ - `hub_strategy`: all_checkpoints
242
+
243
+ #### All Hyperparameters
244
+ <details><summary>Click to expand</summary>
245
+
246
+ - `overwrite_output_dir`: False
247
+ - `do_predict`: False
248
+ - `eval_strategy`: steps
249
+ - `prediction_loss_only`: True
250
+ - `per_device_train_batch_size`: 256
251
+ - `per_device_eval_batch_size`: 256
252
+ - `per_gpu_train_batch_size`: None
253
+ - `per_gpu_eval_batch_size`: None
254
+ - `gradient_accumulation_steps`: 1
255
+ - `eval_accumulation_steps`: None
256
+ - `torch_empty_cache_steps`: None
257
+ - `learning_rate`: 3e-05
258
+ - `weight_decay`: 0.01
259
+ - `adam_beta1`: 0.9
260
+ - `adam_beta2`: 0.999
261
+ - `adam_epsilon`: 1e-08
262
+ - `max_grad_norm`: 1.0
263
+ - `num_train_epochs`: 4
264
+ - `max_steps`: -1
265
+ - `lr_scheduler_type`: linear
266
+ - `lr_scheduler_kwargs`: {}
267
+ - `warmup_ratio`: 0.1
268
+ - `warmup_steps`: 0
269
+ - `log_level`: passive
270
+ - `log_level_replica`: warning
271
+ - `log_on_each_node`: True
272
+ - `logging_nan_inf_filter`: True
273
+ - `save_safetensors`: True
274
+ - `save_on_each_node`: False
275
+ - `save_only_model`: False
276
+ - `restore_callback_states_from_checkpoint`: False
277
+ - `no_cuda`: False
278
+ - `use_cpu`: False
279
+ - `use_mps_device`: False
280
+ - `seed`: 42
281
+ - `data_seed`: None
282
+ - `jit_mode_eval`: False
283
+ - `use_ipex`: False
284
+ - `bf16`: False
285
+ - `fp16`: True
286
+ - `fp16_opt_level`: O1
287
+ - `half_precision_backend`: auto
288
+ - `bf16_full_eval`: False
289
+ - `fp16_full_eval`: False
290
+ - `tf32`: None
291
+ - `local_rank`: 0
292
+ - `ddp_backend`: None
293
+ - `tpu_num_cores`: None
294
+ - `tpu_metrics_debug`: False
295
+ - `debug`: []
296
+ - `dataloader_drop_last`: False
297
+ - `dataloader_num_workers`: 1
298
+ - `dataloader_prefetch_factor`: 2
299
+ - `past_index`: -1
300
+ - `disable_tqdm`: False
301
+ - `remove_unused_columns`: True
302
+ - `label_names`: None
303
+ - `load_best_model_at_end`: False
304
+ - `ignore_data_skip`: False
305
+ - `fsdp`: []
306
+ - `fsdp_min_num_params`: 0
307
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
308
+ - `fsdp_transformer_layer_cls_to_wrap`: None
309
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
310
+ - `deepspeed`: None
311
+ - `label_smoothing_factor`: 0.0
312
+ - `optim`: adamw_torch
313
+ - `optim_args`: None
314
+ - `adafactor`: False
315
+ - `group_by_length`: False
316
+ - `length_column_name`: length
317
+ - `ddp_find_unused_parameters`: None
318
+ - `ddp_bucket_cap_mb`: None
319
+ - `ddp_broadcast_buffers`: False
320
+ - `dataloader_pin_memory`: True
321
+ - `dataloader_persistent_workers`: True
322
+ - `skip_memory_metrics`: True
323
+ - `use_legacy_prediction_loop`: False
324
+ - `push_to_hub`: True
325
+ - `resume_from_checkpoint`: None
326
+ - `hub_model_id`: LamaDiab/MiniLM-v35-SemanticEngine
327
+ - `hub_strategy`: all_checkpoints
328
+ - `hub_private_repo`: None
329
+ - `hub_always_push`: False
330
+ - `hub_revision`: None
331
+ - `gradient_checkpointing`: False
332
+ - `gradient_checkpointing_kwargs`: None
333
+ - `include_inputs_for_metrics`: False
334
+ - `include_for_metrics`: []
335
+ - `eval_do_concat_batches`: True
336
+ - `fp16_backend`: auto
337
+ - `push_to_hub_model_id`: None
338
+ - `push_to_hub_organization`: None
339
+ - `mp_parameters`:
340
+ - `auto_find_batch_size`: False
341
+ - `full_determinism`: False
342
+ - `torchdynamo`: None
343
+ - `ray_scope`: last
344
+ - `ddp_timeout`: 1800
345
+ - `torch_compile`: False
346
+ - `torch_compile_backend`: None
347
+ - `torch_compile_mode`: None
348
+ - `include_tokens_per_second`: False
349
+ - `include_num_input_tokens_seen`: False
350
+ - `neftune_noise_alpha`: None
351
+ - `optim_target_modules`: None
352
+ - `batch_eval_metrics`: False
353
+ - `eval_on_start`: False
354
+ - `use_liger_kernel`: False
355
+ - `liger_kernel_config`: None
356
+ - `eval_use_gather_object`: False
357
+ - `average_tokens_across_devices`: False
358
+ - `prompts`: None
359
+ - `batch_sampler`: batch_sampler
360
+ - `multi_dataset_batch_sampler`: proportional
361
+ - `router_mapping`: {}
362
+ - `learning_rate_mapping`: {}
363
+
364
+ </details>
365
+
366
+ ### Training Logs
367
+ | Epoch | Step | Training Loss | Validation Loss | cosine_accuracy |
368
+ |:------:|:-----:|:-------------:|:---------------:|:---------------:|
369
+ | 0.0003 | 1 | 2.5131 | - | - |
370
+ | 0.3237 | 1000 | 1.8415 | 1.0824 | 0.9512 |
371
+ | 0.6475 | 2000 | 1.3696 | 0.9929 | 0.9617 |
372
+ | 0.9712 | 3000 | 1.4502 | 0.9487 | 0.9656 |
373
+ | 1.2947 | 4000 | 1.3141 | 0.8925 | 0.9704 |
374
+ | 1.6182 | 5000 | 1.1692 | 0.8781 | 0.9709 |
375
+ | 1.9418 | 6000 | 1.1209 | 0.8579 | 0.9718 |
376
+ | 2.2653 | 7000 | 1.0609 | 0.8649 | 0.9738 |
377
+ | 2.5888 | 8000 | 1.0507 | 0.8569 | 0.9725 |
378
+ | 2.9123 | 9000 | 1.0079 | 0.8493 | 0.9736 |
379
+ | 3.2358 | 10000 | 1.0006 | 0.8392 | 0.9735 |
380
+ | 3.5594 | 11000 | 0.9947 | 0.8390 | 0.9751 |
381
+ | 3.8829 | 12000 | 0.9774 | 0.8403 | 0.9749 |
382
+
383
+
384
+ ### Framework Versions
385
+ - Python: 3.11.13
386
+ - Sentence Transformers: 5.1.2
387
+ - Transformers: 4.53.3
388
+ - PyTorch: 2.6.0+cu124
389
+ - Accelerate: 1.9.0
390
+ - Datasets: 4.4.1
391
+ - Tokenizers: 0.21.2
392
+
393
+ ## Citation
394
+
395
+ ### BibTeX
396
+
397
+ #### Sentence Transformers
398
+ ```bibtex
399
+ @inproceedings{reimers-2019-sentence-bert,
400
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
401
+ author = "Reimers, Nils and Gurevych, Iryna",
402
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
403
+ month = "11",
404
+ year = "2019",
405
+ publisher = "Association for Computational Linguistics",
406
+ url = "https://arxiv.org/abs/1908.10084",
407
+ }
408
+ ```
409
+
410
+ <!--
411
+ ## Glossary
412
+
413
+ *Clearly define terms in order to be accessible across audiences.*
414
+ -->
415
+
416
+ <!--
417
+ ## Model Card Authors
418
+
419
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
420
+ -->
421
+
422
+ <!--
423
+ ## Model Card Contact
424
+
425
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
426
+ -->
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.1.2",
4
+ "transformers": "4.53.3",
5
+ "pytorch": "2.6.0+cu124"
6
+ },
7
+ "model_type": "SentenceTransformer",
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
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": 256,
3
+ "do_lower_case": false
4
+ }