CocoRoF commited on
Commit
57b476e
·
verified ·
1 Parent(s): a440fde

CocoRoF/ModernBERT-SimCSE-multitask_v03-retry

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
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
+ }
2_Dense/config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"in_features": 768, "out_features": 1024, "bias": true, "activation_function": "torch.nn.modules.activation.Tanh"}
2_Dense/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fa0062d6d38c9ca7ccf5338c945d80b51ec0d3a19ce30227bc0a04f4581b231
3
+ size 3149984
README.md ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - generated_from_trainer
7
+ - dataset_size:5749
8
+ - loss:CosineSimilarityLoss
9
+ base_model: CocoRoF/mobert_retry_SimCSE_test
10
+ widget:
11
+ - source_sentence: 우리는 움직이는 동행 우주 정지 좌표계에 비례하여 이동하고 있습니다 ... 약 371km / s에서 별자리 leo
12
+ 쪽으로. "
13
+ sentences:
14
+ - 두 마리의 독수리가 가지에 앉는다.
15
+ - 다른 물체와는 관련이 없는 '정지'는 없다.
16
+ - 소녀는 버스의 열린 문 앞에 서 있다.
17
+ - source_sentence: 숲에는 개들이 있다.
18
+ sentences:
19
+ - 양을 보는 아이들.
20
+ - 여왕의 배우자를 "왕"이라고 부르지 않는 것은 아주 좋은 이유가 있다. 왜냐하면 그들은 왕이 아니기 때문이다.
21
+ - 개들은 숲속에 혼자 있다.
22
+ - source_sentence: '첫째, 두 가지 다른 종류의 대시가 있다는 것을 알아야 합니다 : en 대시와 em 대시.'
23
+ sentences:
24
+ - 그들은 그 물건들을 집 주변에 두고 가거나 집의 정리를 해칠 의도가 없다.
25
+ - 세미콜론은 혼자 있을 수 있는 문장에 참여하는데 사용되지만, 그들의 관계를 강조하기 위해 결합됩니다.
26
+ - 그의 남동생이 지켜보는 동안 집 앞에서 트럼펫을 연주하는 금발의 아이.
27
+ - source_sentence: 한 여성이 생선 껍질을 벗기고 있다.
28
+ sentences:
29
+ - 한 남자가 수영장으로 뛰어들었다.
30
+ - 한 여성이 프라이팬에 노란 혼합물을 부어 넣고 있다.
31
+ - 두 마리의 갈색 개가 눈 속에서 서로 놀고 있다.
32
+ - source_sentence: 버스가 바쁜 길을 따라 운전한다.
33
+ sentences:
34
+ - 우리와 같은 태양계가 은하계 밖에서 존재할 수도 있을 것입니다.
35
+ - 그 여자는 데이트하러 가는 중이다.
36
+ - 녹색 버스가 도로를 따라 내려간다.
37
+ pipeline_tag: sentence-similarity
38
+ library_name: sentence-transformers
39
+ ---
40
+
41
+ # SentenceTransformer based on CocoRoF/mobert_retry_SimCSE_test
42
+
43
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [CocoRoF/mobert_retry_SimCSE_test](https://huggingface.co/CocoRoF/mobert_retry_SimCSE_test). 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.
44
+
45
+ ## Model Details
46
+
47
+ ### Model Description
48
+ - **Model Type:** Sentence Transformer
49
+ - **Base model:** [CocoRoF/mobert_retry_SimCSE_test](https://huggingface.co/CocoRoF/mobert_retry_SimCSE_test) <!-- at revision 94f4e00947539b6741c4a31b977a66220298317d -->
50
+ - **Maximum Sequence Length:** 2048 tokens
51
+ - **Output Dimensionality:** 1024 dimensions
52
+ - **Similarity Function:** Cosine Similarity
53
+ <!-- - **Training Dataset:** Unknown -->
54
+ <!-- - **Language:** Unknown -->
55
+ <!-- - **License:** Unknown -->
56
+
57
+ ### Model Sources
58
+
59
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
60
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
61
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
62
+
63
+ ### Full Model Architecture
64
+
65
+ ```
66
+ SentenceTransformer(
67
+ (0): Transformer({'max_seq_length': 2048, 'do_lower_case': False}) with Transformer model: ModernBertModel
68
+ (1): Pooling({'word_embedding_dimension': 768, '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})
69
+ (2): Dense({'in_features': 768, 'out_features': 1024, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})
70
+ )
71
+ ```
72
+
73
+ ## Usage
74
+
75
+ ### Direct Usage (Sentence Transformers)
76
+
77
+ First install the Sentence Transformers library:
78
+
79
+ ```bash
80
+ pip install -U sentence-transformers
81
+ ```
82
+
83
+ Then you can load this model and run inference.
84
+ ```python
85
+ from sentence_transformers import SentenceTransformer
86
+
87
+ # Download from the 🤗 Hub
88
+ model = SentenceTransformer("CocoRoF/ModernBERT-SimCSE-multitask_v03-retry")
89
+ # Run inference
90
+ sentences = [
91
+ '버스가 바쁜 길을 따라 운전한다.',
92
+ '녹색 버스가 도로를 따라 내려간다.',
93
+ '그 여자는 데이트하러 가는 중이다.',
94
+ ]
95
+ embeddings = model.encode(sentences)
96
+ print(embeddings.shape)
97
+ # [3, 1024]
98
+
99
+ # Get the similarity scores for the embeddings
100
+ similarities = model.similarity(embeddings, embeddings)
101
+ print(similarities.shape)
102
+ # [3, 3]
103
+ ```
104
+
105
+ <!--
106
+ ### Direct Usage (Transformers)
107
+
108
+ <details><summary>Click to see the direct usage in Transformers</summary>
109
+
110
+ </details>
111
+ -->
112
+
113
+ <!--
114
+ ### Downstream Usage (Sentence Transformers)
115
+
116
+ You can finetune this model on your own dataset.
117
+
118
+ <details><summary>Click to expand</summary>
119
+
120
+ </details>
121
+ -->
122
+
123
+ <!--
124
+ ### Out-of-Scope Use
125
+
126
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
127
+ -->
128
+
129
+ <!--
130
+ ## Bias, Risks and Limitations
131
+
132
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
133
+ -->
134
+
135
+ <!--
136
+ ### Recommendations
137
+
138
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
139
+ -->
140
+
141
+ ## Training Details
142
+
143
+ ### Training Dataset
144
+
145
+ #### Unnamed Dataset
146
+
147
+ * Size: 5,749 training samples
148
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
149
+ * Approximate statistics based on the first 1000 samples:
150
+ | | sentence1 | sentence2 | score |
151
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
152
+ | type | string | string | float |
153
+ | details | <ul><li>min: 7 tokens</li><li>mean: 13.52 tokens</li><li>max: 36 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 13.41 tokens</li><li>max: 32 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.45</li><li>max: 1.0</li></ul> |
154
+ * Samples:
155
+ | sentence1 | sentence2 | score |
156
+ |:------------------------------------|:------------------------------------------|:------------------|
157
+ | <code>비행기가 이륙하고 있다.</code> | <code>비행기가 이륙하고 있다.</code> | <code>1.0</code> |
158
+ | <code>한 남자가 큰 플루트를 연주하고 있다.</code> | <code>남자가 플루트를 연주하고 있다.</code> | <code>0.76</code> |
159
+ | <code>한 남자가 피자에 치즈를 뿌려놓고 있다.</code> | <code>한 남자가 구운 피자에 치즈 조각을 뿌려놓고 있다.</code> | <code>0.76</code> |
160
+ * Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
161
+ ```json
162
+ {
163
+ "loss_fct": "torch.nn.modules.loss.MSELoss"
164
+ }
165
+ ```
166
+
167
+ ### Evaluation Dataset
168
+
169
+ #### Unnamed Dataset
170
+
171
+ * Size: 1,500 evaluation samples
172
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
173
+ * Approximate statistics based on the first 1000 samples:
174
+ | | sentence1 | sentence2 | score |
175
+ |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------|
176
+ | type | string | string | float |
177
+ | details | <ul><li>min: 7 tokens</li><li>mean: 20.38 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 20.52 tokens</li><li>max: 54 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.42</li><li>max: 1.0</li></ul> |
178
+ * Samples:
179
+ | sentence1 | sentence2 | score |
180
+ |:-------------------------------------|:------------------------------------|:------------------|
181
+ | <code>안전모를 가진 한 남자가 춤을 추고 있다.</code> | <code>안전모를 쓴 한 남자가 춤을 추고 있다.</code> | <code>1.0</code> |
182
+ | <code>어린아이가 말을 타고 있다.</code> | <code>아이가 말을 타고 있다.</code> | <code>0.95</code> |
183
+ | <code>한 남자가 뱀에게 쥐를 먹이고 있다.</code> | <code>남자가 뱀에게 쥐를 먹이고 있다.</code> | <code>1.0</code> |
184
+ * Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
185
+ ```json
186
+ {
187
+ "loss_fct": "torch.nn.modules.loss.MSELoss"
188
+ }
189
+ ```
190
+
191
+ ### Training Hyperparameters
192
+ #### Non-Default Hyperparameters
193
+
194
+ - `overwrite_output_dir`: True
195
+ - `eval_strategy`: steps
196
+ - `per_device_train_batch_size`: 16
197
+ - `per_device_eval_batch_size`: 16
198
+ - `gradient_accumulation_steps`: 8
199
+ - `learning_rate`: 8e-05
200
+ - `warmup_ratio`: 0.2
201
+ - `push_to_hub`: True
202
+ - `hub_model_id`: CocoRoF/ModernBERT-SimCSE-multitask_v03-retry
203
+ - `hub_strategy`: checkpoint
204
+ - `batch_sampler`: no_duplicates
205
+
206
+ #### All Hyperparameters
207
+ <details><summary>Click to expand</summary>
208
+
209
+ - `overwrite_output_dir`: True
210
+ - `do_predict`: False
211
+ - `eval_strategy`: steps
212
+ - `prediction_loss_only`: True
213
+ - `per_device_train_batch_size`: 16
214
+ - `per_device_eval_batch_size`: 16
215
+ - `per_gpu_train_batch_size`: None
216
+ - `per_gpu_eval_batch_size`: None
217
+ - `gradient_accumulation_steps`: 8
218
+ - `eval_accumulation_steps`: None
219
+ - `torch_empty_cache_steps`: None
220
+ - `learning_rate`: 8e-05
221
+ - `weight_decay`: 0.0
222
+ - `adam_beta1`: 0.9
223
+ - `adam_beta2`: 0.999
224
+ - `adam_epsilon`: 1e-08
225
+ - `max_grad_norm`: 1.0
226
+ - `num_train_epochs`: 3.0
227
+ - `max_steps`: -1
228
+ - `lr_scheduler_type`: linear
229
+ - `lr_scheduler_kwargs`: {}
230
+ - `warmup_ratio`: 0.2
231
+ - `warmup_steps`: 0
232
+ - `log_level`: passive
233
+ - `log_level_replica`: warning
234
+ - `log_on_each_node`: True
235
+ - `logging_nan_inf_filter`: True
236
+ - `save_safetensors`: True
237
+ - `save_on_each_node`: False
238
+ - `save_only_model`: False
239
+ - `restore_callback_states_from_checkpoint`: False
240
+ - `no_cuda`: False
241
+ - `use_cpu`: False
242
+ - `use_mps_device`: False
243
+ - `seed`: 42
244
+ - `data_seed`: None
245
+ - `jit_mode_eval`: False
246
+ - `use_ipex`: False
247
+ - `bf16`: False
248
+ - `fp16`: False
249
+ - `fp16_opt_level`: O1
250
+ - `half_precision_backend`: auto
251
+ - `bf16_full_eval`: False
252
+ - `fp16_full_eval`: False
253
+ - `tf32`: None
254
+ - `local_rank`: 0
255
+ - `ddp_backend`: None
256
+ - `tpu_num_cores`: None
257
+ - `tpu_metrics_debug`: False
258
+ - `debug`: []
259
+ - `dataloader_drop_last`: True
260
+ - `dataloader_num_workers`: 0
261
+ - `dataloader_prefetch_factor`: None
262
+ - `past_index`: -1
263
+ - `disable_tqdm`: False
264
+ - `remove_unused_columns`: True
265
+ - `label_names`: None
266
+ - `load_best_model_at_end`: False
267
+ - `ignore_data_skip`: False
268
+ - `fsdp`: []
269
+ - `fsdp_min_num_params`: 0
270
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
271
+ - `fsdp_transformer_layer_cls_to_wrap`: None
272
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
273
+ - `deepspeed`: None
274
+ - `label_smoothing_factor`: 0.0
275
+ - `optim`: adamw_torch
276
+ - `optim_args`: None
277
+ - `adafactor`: False
278
+ - `group_by_length`: False
279
+ - `length_column_name`: length
280
+ - `ddp_find_unused_parameters`: None
281
+ - `ddp_bucket_cap_mb`: None
282
+ - `ddp_broadcast_buffers`: False
283
+ - `dataloader_pin_memory`: True
284
+ - `dataloader_persistent_workers`: False
285
+ - `skip_memory_metrics`: True
286
+ - `use_legacy_prediction_loop`: False
287
+ - `push_to_hub`: True
288
+ - `resume_from_checkpoint`: None
289
+ - `hub_model_id`: CocoRoF/ModernBERT-SimCSE-multitask_v03-retry
290
+ - `hub_strategy`: checkpoint
291
+ - `hub_private_repo`: None
292
+ - `hub_always_push`: False
293
+ - `gradient_checkpointing`: False
294
+ - `gradient_checkpointing_kwargs`: None
295
+ - `include_inputs_for_metrics`: False
296
+ - `include_for_metrics`: []
297
+ - `eval_do_concat_batches`: True
298
+ - `fp16_backend`: auto
299
+ - `push_to_hub_model_id`: None
300
+ - `push_to_hub_organization`: None
301
+ - `mp_parameters`:
302
+ - `auto_find_batch_size`: False
303
+ - `full_determinism`: False
304
+ - `torchdynamo`: None
305
+ - `ray_scope`: last
306
+ - `ddp_timeout`: 1800
307
+ - `torch_compile`: False
308
+ - `torch_compile_backend`: None
309
+ - `torch_compile_mode`: None
310
+ - `dispatch_batches`: None
311
+ - `split_batches`: None
312
+ - `include_tokens_per_second`: False
313
+ - `include_num_input_tokens_seen`: False
314
+ - `neftune_noise_alpha`: None
315
+ - `optim_target_modules`: None
316
+ - `batch_eval_metrics`: False
317
+ - `eval_on_start`: False
318
+ - `use_liger_kernel`: False
319
+ - `eval_use_gather_object`: False
320
+ - `average_tokens_across_devices`: False
321
+ - `prompts`: None
322
+ - `batch_sampler`: no_duplicates
323
+ - `multi_dataset_batch_sampler`: proportional
324
+
325
+ </details>
326
+
327
+ ### Training Logs
328
+ | Epoch | Step | Training Loss |
329
+ |:------:|:----:|:-------------:|
330
+ | 1.7273 | 10 | 0.3102 |
331
+
332
+
333
+ ### Framework Versions
334
+ - Python: 3.11.10
335
+ - Sentence Transformers: 3.4.1
336
+ - Transformers: 4.48.3
337
+ - PyTorch: 2.5.1+cu124
338
+ - Accelerate: 1.3.0
339
+ - Datasets: 3.3.0
340
+ - Tokenizers: 0.21.0
341
+
342
+ ## Citation
343
+
344
+ ### BibTeX
345
+
346
+ #### Sentence Transformers
347
+ ```bibtex
348
+ @inproceedings{reimers-2019-sentence-bert,
349
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
350
+ author = "Reimers, Nils and Gurevych, Iryna",
351
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
352
+ month = "11",
353
+ year = "2019",
354
+ publisher = "Association for Computational Linguistics",
355
+ url = "https://arxiv.org/abs/1908.10084",
356
+ }
357
+ ```
358
+
359
+ <!--
360
+ ## Glossary
361
+
362
+ *Clearly define terms in order to be accessible across audiences.*
363
+ -->
364
+
365
+ <!--
366
+ ## Model Card Authors
367
+
368
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
369
+ -->
370
+
371
+ <!--
372
+ ## Model Card Contact
373
+
374
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
375
+ -->
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.4.1",
4
+ "transformers": "4.48.3",
5
+ "pytorch": "2.5.1+cu124"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
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_Dense",
18
+ "type": "sentence_transformers.models.Dense"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 2048,
3
+ "do_lower_case": false
4
+ }