mohamed20-AI commited on
Commit
2e668da
·
verified ·
1 Parent(s): 62f9556

mohamed20-AI/model_title

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 1024,
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,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - sentence-transformers
6
+ - sentence-similarity
7
+ - feature-extraction
8
+ - generated_from_trainer
9
+ - dataset_size:80
10
+ - loss:CoSENTLoss
11
+ base_model: abdeljalilELmajjodi/model
12
+ widget:
13
+ - source_sentence: Woman in white in foreground and a man slightly behind walking
14
+ with a sign for John's Pizza and Gyro in the background.
15
+ sentences:
16
+ - They are walking with a sign.
17
+ - A married couple is sleeping.
18
+ - There are children present
19
+ - source_sentence: Woman in white in foreground and a man slightly behind walking
20
+ with a sign for John's Pizza and Gyro in the background.
21
+ sentences:
22
+ - A child with mom and dad, on summer vacation at the beach.
23
+ - A person is outdoors, on a horse.
24
+ - The woman is wearing white.
25
+ - source_sentence: Two adults, one female in white, with shades and one male, gray
26
+ clothes, walking across a street, away from a eatery with a blurred image of a
27
+ dark colored red shirted person in the foreground.
28
+ sentences:
29
+ - Two adults swimming in water
30
+ - A couple watch a little girl play by herself on the beach.
31
+ - Near a couple of restaurants, two people walk across the street.
32
+ - source_sentence: Woman in white in foreground and a man slightly behind walking
33
+ with a sign for John's Pizza and Gyro in the background.
34
+ sentences:
35
+ - They are working for John's Pizza.
36
+ - Two adults walking across a road near the convicted prisoner dressed in red
37
+ - Women are waiting by a tram.
38
+ - source_sentence: A man, woman, and child enjoying themselves on a beach.
39
+ sentences:
40
+ - A team is trying to tag a runner out.
41
+ - There are women showing affection.
42
+ - A family of three is at the mall shopping.
43
+ datasets:
44
+ - sentence-transformers/all-nli
45
+ pipeline_tag: sentence-similarity
46
+ library_name: sentence-transformers
47
+ metrics:
48
+ - pearson_cosine
49
+ - spearman_cosine
50
+ model-index:
51
+ - name: SentenceTransformer based on abdeljalilELmajjodi/model
52
+ results:
53
+ - task:
54
+ type: semantic-similarity
55
+ name: Semantic Similarity
56
+ dataset:
57
+ name: pair score evaluator dev
58
+ type: pair-score-evaluator-dev
59
+ metrics:
60
+ - type: pearson_cosine
61
+ value: 0.01358701091758253
62
+ name: Pearson Cosine
63
+ - type: spearman_cosine
64
+ value: 0.02861316917596507
65
+ name: Spearman Cosine
66
+ ---
67
+
68
+ # SentenceTransformer based on abdeljalilELmajjodi/model
69
+
70
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [abdeljalilELmajjodi/model](https://huggingface.co/abdeljalilELmajjodi/model) 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.
71
+
72
+ ## Model Details
73
+
74
+ ### Model Description
75
+ - **Model Type:** Sentence Transformer
76
+ - **Base model:** [abdeljalilELmajjodi/model](https://huggingface.co/abdeljalilELmajjodi/model) <!-- at revision 284169e2c18b482372374a251b8dc1e1756416de -->
77
+ - **Maximum Sequence Length:** 512 tokens
78
+ - **Output Dimensionality:** 1024 dimensions
79
+ - **Similarity Function:** Cosine Similarity
80
+ - **Training Dataset:**
81
+ - [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli)
82
+ - **Language:** en
83
+ <!-- - **License:** Unknown -->
84
+
85
+ ### Model Sources
86
+
87
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
88
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
89
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
90
+
91
+ ### Full Model Architecture
92
+
93
+ ```
94
+ SentenceTransformer(
95
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
96
+ (1): Pooling({'word_embedding_dimension': 1024, '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})
97
+ )
98
+ ```
99
+
100
+ ## Usage
101
+
102
+ ### Direct Usage (Sentence Transformers)
103
+
104
+ First install the Sentence Transformers library:
105
+
106
+ ```bash
107
+ pip install -U sentence-transformers
108
+ ```
109
+
110
+ Then you can load this model and run inference.
111
+ ```python
112
+ from sentence_transformers import SentenceTransformer
113
+
114
+ # Download from the 🤗 Hub
115
+ model = SentenceTransformer("sentence_transformers_model_id")
116
+ # Run inference
117
+ sentences = [
118
+ 'A man, woman, and child enjoying themselves on a beach.',
119
+ 'A family of three is at the mall shopping.',
120
+ 'A team is trying to tag a runner out.',
121
+ ]
122
+ embeddings = model.encode(sentences)
123
+ print(embeddings.shape)
124
+ # [3, 1024]
125
+
126
+ # Get the similarity scores for the embeddings
127
+ similarities = model.similarity(embeddings, embeddings)
128
+ print(similarities.shape)
129
+ # [3, 3]
130
+ ```
131
+
132
+ <!--
133
+ ### Direct Usage (Transformers)
134
+
135
+ <details><summary>Click to see the direct usage in Transformers</summary>
136
+
137
+ </details>
138
+ -->
139
+
140
+ <!--
141
+ ### Downstream Usage (Sentence Transformers)
142
+
143
+ You can finetune this model on your own dataset.
144
+
145
+ <details><summary>Click to expand</summary>
146
+
147
+ </details>
148
+ -->
149
+
150
+ <!--
151
+ ### Out-of-Scope Use
152
+
153
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
154
+ -->
155
+
156
+ ## Evaluation
157
+
158
+ ### Metrics
159
+
160
+ #### Semantic Similarity
161
+
162
+ * Dataset: `pair-score-evaluator-dev`
163
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
164
+
165
+ | Metric | Value |
166
+ |:--------------------|:-----------|
167
+ | pearson_cosine | 0.0136 |
168
+ | **spearman_cosine** | **0.0286** |
169
+
170
+ <!--
171
+ ## Bias, Risks and Limitations
172
+
173
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
174
+ -->
175
+
176
+ <!--
177
+ ### Recommendations
178
+
179
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
180
+ -->
181
+
182
+ ## Training Details
183
+
184
+ ### Training Dataset
185
+
186
+ #### all-nli
187
+
188
+ * Dataset: [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) at [d482672](https://huggingface.co/datasets/sentence-transformers/all-nli/tree/d482672c8e74ce18da116f430137434ba2e52fab)
189
+ * Size: 80 training samples
190
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
191
+ * Approximate statistics based on the first 80 samples:
192
+ | | sentence1 | sentence2 | score |
193
+ |:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
194
+ | type | string | string | float |
195
+ | details | <ul><li>min: 10 tokens</li><li>mean: 26.15 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 11.68 tokens</li><li>max: 29 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.47</li><li>max: 1.0</li></ul> |
196
+ * Samples:
197
+ | sentence1 | sentence2 | score |
198
+ |:-------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------|:-----------------|
199
+ | <code>Two women, holding food carryout containers, hug.</code> | <code>Two groups of rival gang members flipped each other off.</code> | <code>0.0</code> |
200
+ | <code>A man and a woman cross the street in front of a pizza and gyro restaurant.</code> | <code>The people are standing still on the curb.</code> | <code>0.0</code> |
201
+ | <code>Woman in white in foreground and a man slightly behind walking with a sign for John's Pizza and Gyro in the background.</code> | <code>The woman is waiting for a friend.</code> | <code>0.5</code> |
202
+ * Loss: [<code>CoSENTLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosentloss) with these parameters:
203
+ ```json
204
+ {
205
+ "scale": 20.0,
206
+ "similarity_fct": "pairwise_cos_sim"
207
+ }
208
+ ```
209
+
210
+ ### Evaluation Dataset
211
+
212
+ #### all-nli
213
+
214
+ * Dataset: [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) at [d482672](https://huggingface.co/datasets/sentence-transformers/all-nli/tree/d482672c8e74ce18da116f430137434ba2e52fab)
215
+ * Size: 20 evaluation samples
216
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
217
+ * Approximate statistics based on the first 20 samples:
218
+ | | sentence1 | sentence2 | score |
219
+ |:--------|:-----------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------|
220
+ | type | string | string | float |
221
+ | details | <ul><li>min: 10 tokens</li><li>mean: 24.05 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 13.2 tokens</li><li>max: 29 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.62</li><li>max: 1.0</li></ul> |
222
+ * Samples:
223
+ | sentence1 | sentence2 | score |
224
+ |:--------------------------------------------------------------------|:------------------------------------------------------------------------|:-----------------|
225
+ | <code>A person on a horse jumps over a broken down airplane.</code> | <code>A person is outdoors, on a horse.</code> | <code>1.0</code> |
226
+ | <code>Children smiling and waving at camera</code> | <code>There are children present</code> | <code>1.0</code> |
227
+ | <code>A couple playing with a little boy on the beach.</code> | <code>A couple watch a little girl play by herself on the beach.</code> | <code>0.0</code> |
228
+ * Loss: [<code>CoSENTLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosentloss) with these parameters:
229
+ ```json
230
+ {
231
+ "scale": 20.0,
232
+ "similarity_fct": "pairwise_cos_sim"
233
+ }
234
+ ```
235
+
236
+ ### Training Hyperparameters
237
+ #### Non-Default Hyperparameters
238
+
239
+ - `eval_strategy`: steps
240
+ - `num_train_epochs`: 1
241
+ - `warmup_ratio`: 0.05
242
+ - `bf16`: True
243
+ - `fp16_full_eval`: True
244
+ - `load_best_model_at_end`: True
245
+ - `push_to_hub`: True
246
+ - `gradient_checkpointing`: True
247
+
248
+ #### All Hyperparameters
249
+ <details><summary>Click to expand</summary>
250
+
251
+ - `overwrite_output_dir`: False
252
+ - `do_predict`: False
253
+ - `eval_strategy`: steps
254
+ - `prediction_loss_only`: True
255
+ - `per_device_train_batch_size`: 8
256
+ - `per_device_eval_batch_size`: 8
257
+ - `per_gpu_train_batch_size`: None
258
+ - `per_gpu_eval_batch_size`: None
259
+ - `gradient_accumulation_steps`: 1
260
+ - `eval_accumulation_steps`: None
261
+ - `torch_empty_cache_steps`: None
262
+ - `learning_rate`: 5e-05
263
+ - `weight_decay`: 0.0
264
+ - `adam_beta1`: 0.9
265
+ - `adam_beta2`: 0.999
266
+ - `adam_epsilon`: 1e-08
267
+ - `max_grad_norm`: 1.0
268
+ - `num_train_epochs`: 1
269
+ - `max_steps`: -1
270
+ - `lr_scheduler_type`: linear
271
+ - `lr_scheduler_kwargs`: {}
272
+ - `warmup_ratio`: 0.05
273
+ - `warmup_steps`: 0
274
+ - `log_level`: passive
275
+ - `log_level_replica`: warning
276
+ - `log_on_each_node`: True
277
+ - `logging_nan_inf_filter`: True
278
+ - `save_safetensors`: True
279
+ - `save_on_each_node`: False
280
+ - `save_only_model`: False
281
+ - `restore_callback_states_from_checkpoint`: False
282
+ - `no_cuda`: False
283
+ - `use_cpu`: False
284
+ - `use_mps_device`: False
285
+ - `seed`: 42
286
+ - `data_seed`: None
287
+ - `jit_mode_eval`: False
288
+ - `use_ipex`: False
289
+ - `bf16`: True
290
+ - `fp16`: False
291
+ - `fp16_opt_level`: O1
292
+ - `half_precision_backend`: auto
293
+ - `bf16_full_eval`: False
294
+ - `fp16_full_eval`: True
295
+ - `tf32`: None
296
+ - `local_rank`: 0
297
+ - `ddp_backend`: None
298
+ - `tpu_num_cores`: None
299
+ - `tpu_metrics_debug`: False
300
+ - `debug`: []
301
+ - `dataloader_drop_last`: False
302
+ - `dataloader_num_workers`: 0
303
+ - `dataloader_prefetch_factor`: None
304
+ - `past_index`: -1
305
+ - `disable_tqdm`: False
306
+ - `remove_unused_columns`: True
307
+ - `label_names`: None
308
+ - `load_best_model_at_end`: True
309
+ - `ignore_data_skip`: False
310
+ - `fsdp`: []
311
+ - `fsdp_min_num_params`: 0
312
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
313
+ - `fsdp_transformer_layer_cls_to_wrap`: None
314
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
315
+ - `deepspeed`: None
316
+ - `label_smoothing_factor`: 0.0
317
+ - `optim`: adamw_torch
318
+ - `optim_args`: None
319
+ - `adafactor`: False
320
+ - `group_by_length`: False
321
+ - `length_column_name`: length
322
+ - `ddp_find_unused_parameters`: None
323
+ - `ddp_bucket_cap_mb`: None
324
+ - `ddp_broadcast_buffers`: False
325
+ - `dataloader_pin_memory`: True
326
+ - `dataloader_persistent_workers`: False
327
+ - `skip_memory_metrics`: True
328
+ - `use_legacy_prediction_loop`: False
329
+ - `push_to_hub`: True
330
+ - `resume_from_checkpoint`: None
331
+ - `hub_model_id`: None
332
+ - `hub_strategy`: every_save
333
+ - `hub_private_repo`: None
334
+ - `hub_always_push`: False
335
+ - `gradient_checkpointing`: True
336
+ - `gradient_checkpointing_kwargs`: None
337
+ - `include_inputs_for_metrics`: False
338
+ - `include_for_metrics`: []
339
+ - `eval_do_concat_batches`: True
340
+ - `fp16_backend`: auto
341
+ - `push_to_hub_model_id`: None
342
+ - `push_to_hub_organization`: None
343
+ - `mp_parameters`:
344
+ - `auto_find_batch_size`: False
345
+ - `full_determinism`: False
346
+ - `torchdynamo`: None
347
+ - `ray_scope`: last
348
+ - `ddp_timeout`: 1800
349
+ - `torch_compile`: False
350
+ - `torch_compile_backend`: None
351
+ - `torch_compile_mode`: None
352
+ - `include_tokens_per_second`: False
353
+ - `include_num_input_tokens_seen`: False
354
+ - `neftune_noise_alpha`: None
355
+ - `optim_target_modules`: None
356
+ - `batch_eval_metrics`: False
357
+ - `eval_on_start`: False
358
+ - `use_liger_kernel`: False
359
+ - `eval_use_gather_object`: False
360
+ - `average_tokens_across_devices`: False
361
+ - `prompts`: None
362
+ - `batch_sampler`: batch_sampler
363
+ - `multi_dataset_batch_sampler`: proportional
364
+
365
+ </details>
366
+
367
+ ### Training Logs
368
+ | Epoch | Step | Training Loss | Validation Loss | pair-score-evaluator-dev_spearman_cosine |
369
+ |:-------:|:------:|:-------------:|:---------------:|:----------------------------------------:|
370
+ | 0.1 | 1 | 2.5069 | - | - |
371
+ | 0.5 | 5 | 3.0496 | - | - |
372
+ | **1.0** | **10** | **3.0534** | **2.7607** | **0.0286** |
373
+
374
+ * The bold row denotes the saved checkpoint.
375
+
376
+ ### Framework Versions
377
+ - Python: 3.11.12
378
+ - Sentence Transformers: 4.1.0
379
+ - Transformers: 4.52.3
380
+ - PyTorch: 2.7.0+cu126
381
+ - Accelerate: 1.6.0
382
+ - Datasets: 3.6.0
383
+ - Tokenizers: 0.21.1
384
+
385
+ ## Citation
386
+
387
+ ### BibTeX
388
+
389
+ #### Sentence Transformers
390
+ ```bibtex
391
+ @inproceedings{reimers-2019-sentence-bert,
392
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
393
+ author = "Reimers, Nils and Gurevych, Iryna",
394
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
395
+ month = "11",
396
+ year = "2019",
397
+ publisher = "Association for Computational Linguistics",
398
+ url = "https://arxiv.org/abs/1908.10084",
399
+ }
400
+ ```
401
+
402
+ #### CoSENTLoss
403
+ ```bibtex
404
+ @online{kexuefm-8847,
405
+ title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
406
+ author={Su Jianlin},
407
+ year={2022},
408
+ month={Jan},
409
+ url={https://kexue.fm/archives/8847},
410
+ }
411
+ ```
412
+
413
+ <!--
414
+ ## Glossary
415
+
416
+ *Clearly define terms in order to be accessible across audiences.*
417
+ -->
418
+
419
+ <!--
420
+ ## Model Card Authors
421
+
422
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
423
+ -->
424
+
425
+ <!--
426
+ ## Model Card Contact
427
+
428
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
429
+ -->
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "4.1.0",
4
+ "transformers": "4.52.3",
5
+ "pytorch": "2.7.0+cu126"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
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": 512,
3
+ "do_lower_case": false
4
+ }