haf1g commited on
Commit
0c95555
·
verified ·
1 Parent(s): e71ac84

haf1g/result_model

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