quarkss commited on
Commit
e0390e2
1 Parent(s): 9677b40

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +489 -478
README.md CHANGED
@@ -1,479 +1,490 @@
1
- ---
2
- base_model: indobenchmark/indobert-base-p2
3
- datasets: []
4
- language: []
5
- library_name: sentence-transformers
6
- metrics:
7
- - pearson_cosine
8
- - spearman_cosine
9
- - pearson_manhattan
10
- - spearman_manhattan
11
- - pearson_euclidean
12
- - spearman_euclidean
13
- - pearson_dot
14
- - spearman_dot
15
- - pearson_max
16
- - spearman_max
17
- pipeline_tag: sentence-similarity
18
- tags:
19
- - sentence-transformers
20
- - sentence-similarity
21
- - feature-extraction
22
- - generated_from_trainer
23
- - dataset_size:5749
24
- - loss:CosineSimilarityLoss
25
- widget:
26
- - source_sentence: Dua ekor anjing berenang di kolam renang.
27
- sentences:
28
- - Anjing-anjing sedang berenang di kolam renang.
29
- - Seekor binatang sedang berjalan di atas tanah.
30
- - Seorang pria sedang menyeka pinggiran mangkuk.
31
- - source_sentence: Seorang anak perempuan sedang mengiris mentega menjadi dua bagian.
32
- sentences:
33
- - Seorang wanita sedang mengiris tahu.
34
- - Dua orang berkelahi.
35
- - Seorang pria sedang menari.
36
- - source_sentence: Seorang gadis sedang makan kue mangkuk.
37
- sentences:
38
- - Seorang pria sedang mengiris bawang putih dengan alat pengiris mandolin.
39
- - Seorang pria sedang memotong dan memotong bawang.
40
- - Seorang wanita sedang makan kue mangkuk.
41
- - source_sentence: Sebuah helikopter mendarat di landasan helikopter.
42
- sentences:
43
- - Seorang pria sedang mengiris mentimun.
44
- - Seorang pria sedang memotong batang pohon dengan kapak.
45
- - Sebuah helikopter mendarat.
46
- - source_sentence: Seorang pria sedang berjalan dengan seekor kuda.
47
- sentences:
48
- - Seorang pria sedang menuntun seekor kuda dengan tali kekang.
49
- - Seorang pria sedang menembakkan pistol.
50
- - Seorang wanita sedang memetik tomat.
51
- model-index:
52
- - name: SentenceTransformer based on indobenchmark/indobert-base-p2
53
- results:
54
- - task:
55
- type: semantic-similarity
56
- name: Semantic Similarity
57
- dataset:
58
- name: Unknown
59
- type: unknown
60
- metrics:
61
- - type: pearson_cosine
62
- value: 0.8577280779646681
63
- name: Pearson Cosine
64
- - type: spearman_cosine
65
- value: 0.8588776334781149
66
- name: Spearman Cosine
67
- - type: pearson_manhattan
68
- value: 0.8315261521874587
69
- name: Pearson Manhattan
70
- - type: spearman_manhattan
71
- value: 0.8355406849443783
72
- name: Spearman Manhattan
73
- - type: pearson_euclidean
74
- value: 0.8318083198603524
75
- name: Pearson Euclidean
76
- - type: spearman_euclidean
77
- value: 0.8359194889385243
78
- name: Spearman Euclidean
79
- - type: pearson_dot
80
- value: 0.7767060276322824
81
- name: Pearson Dot
82
- - type: spearman_dot
83
- value: 0.783607744137448
84
- name: Spearman Dot
85
- - type: pearson_max
86
- value: 0.8577280779646681
87
- name: Pearson Max
88
- - type: spearman_max
89
- value: 0.8588776334781149
90
- name: Spearman Max
91
- - type: pearson_cosine
92
- value: 0.8122790124383042
93
- name: Pearson Cosine
94
- - type: spearman_cosine
95
- value: 0.8123119892530147
96
- name: Spearman Cosine
97
- - type: pearson_manhattan
98
- value: 0.7987643661729152
99
- name: Pearson Manhattan
100
- - type: spearman_manhattan
101
- value: 0.7966661480553803
102
- name: Spearman Manhattan
103
- - type: pearson_euclidean
104
- value: 0.7992882233155829
105
- name: Pearson Euclidean
106
- - type: spearman_euclidean
107
- value: 0.797227936168015
108
- name: Spearman Euclidean
109
- - type: pearson_dot
110
- value: 0.712195542080357
111
- name: Pearson Dot
112
- - type: spearman_dot
113
- value: 0.7014898656834544
114
- name: Spearman Dot
115
- - type: pearson_max
116
- value: 0.8122790124383042
117
- name: Pearson Max
118
- - type: spearman_max
119
- value: 0.8123119892530147
120
- name: Spearman Max
121
- ---
122
-
123
- # SentenceTransformer based on indobenchmark/indobert-base-p2
124
-
125
- This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [indobenchmark/indobert-base-p2](https://huggingface.co/indobenchmark/indobert-base-p2). It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
126
-
127
- ## Model Details
128
-
129
- ### Model Description
130
- - **Model Type:** Sentence Transformer
131
- - **Base model:** [indobenchmark/indobert-base-p2](https://huggingface.co/indobenchmark/indobert-base-p2) <!-- at revision 94b4e0a82081fa57f227fcc2024d1ea89b57ac1f -->
132
- - **Maximum Sequence Length:** 512 tokens
133
- - **Output Dimensionality:** 768 tokens
134
- - **Similarity Function:** Cosine Similarity
135
- <!-- - **Training Dataset:** Unknown -->
136
- <!-- - **Language:** Unknown -->
137
- <!-- - **License:** Unknown -->
138
-
139
- ### Model Sources
140
-
141
- - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
142
- - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
143
- - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
144
-
145
- ### Full Model Architecture
146
-
147
- ```
148
- SentenceTransformer(
149
- (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
150
- (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})
151
- )
152
- ```
153
-
154
- ## Usage
155
-
156
- ### Direct Usage (Sentence Transformers)
157
-
158
- First install the Sentence Transformers library:
159
-
160
- ```bash
161
- pip install -U sentence-transformers
162
- ```
163
-
164
- Then you can load this model and run inference.
165
- ```python
166
- from sentence_transformers import SentenceTransformer
167
-
168
- # Download from the 🤗 Hub
169
- model = SentenceTransformer("quarkss/indobert-base-stsb")
170
- # Run inference
171
- sentences = [
172
- 'Seorang pria sedang berjalan dengan seekor kuda.',
173
- 'Seorang pria sedang menuntun seekor kuda dengan tali kekang.',
174
- 'Seorang pria sedang menembakkan pistol.',
175
- ]
176
- embeddings = model.encode(sentences)
177
- print(embeddings.shape)
178
- # [3, 768]
179
-
180
- # Get the similarity scores for the embeddings
181
- similarities = model.similarity(embeddings, embeddings)
182
- print(similarities.shape)
183
- # [3, 3]
184
- ```
185
-
186
- <!--
187
- ### Direct Usage (Transformers)
188
-
189
- <details><summary>Click to see the direct usage in Transformers</summary>
190
-
191
- </details>
192
- -->
193
-
194
- <!--
195
- ### Downstream Usage (Sentence Transformers)
196
-
197
- You can finetune this model on your own dataset.
198
-
199
- <details><summary>Click to expand</summary>
200
-
201
- </details>
202
- -->
203
-
204
- <!--
205
- ### Out-of-Scope Use
206
-
207
- *List how the model may foreseeably be misused and address what users ought not to do with the model.*
208
- -->
209
-
210
- ## Evaluation
211
-
212
- ### Metrics
213
-
214
- #### Semantic Similarity
215
-
216
- * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
217
-
218
- | Metric | Value |
219
- |:--------------------|:-----------|
220
- | pearson_cosine | 0.8577 |
221
- | **spearman_cosine** | **0.8589** |
222
- | pearson_manhattan | 0.8315 |
223
- | spearman_manhattan | 0.8355 |
224
- | pearson_euclidean | 0.8318 |
225
- | spearman_euclidean | 0.8359 |
226
- | pearson_dot | 0.7767 |
227
- | spearman_dot | 0.7836 |
228
- | pearson_max | 0.8577 |
229
- | spearman_max | 0.8589 |
230
-
231
- #### Semantic Similarity
232
-
233
- * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
234
-
235
- | Metric | Value |
236
- |:-------------------|:-----------|
237
- | pearson_cosine | 0.8123 |
238
- | spearman_cosine | 0.8123 |
239
- | pearson_manhattan | 0.7988 |
240
- | spearman_manhattan | 0.7967 |
241
- | pearson_euclidean | 0.7993 |
242
- | spearman_euclidean | 0.7972 |
243
- | pearson_dot | 0.7122 |
244
- | spearman_dot | 0.7015 |
245
- | pearson_max | 0.8123 |
246
- | **spearman_max** | **0.8123** |
247
-
248
- <!--
249
- ## Bias, Risks and Limitations
250
-
251
- *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
252
- -->
253
-
254
- <!--
255
- ### Recommendations
256
-
257
- *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
258
- -->
259
-
260
- ## Training Details
261
-
262
- ### Training Dataset
263
-
264
- #### Unnamed Dataset
265
-
266
-
267
- * Size: 5,749 training samples
268
- * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
269
- * Approximate statistics based on the first 1000 samples:
270
- | | sentence1 | sentence2 | score |
271
- |:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------|
272
- | type | string | string | float |
273
- | details | <ul><li>min: 6 tokens</li><li>mean: 9.65 tokens</li><li>max: 25 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 9.59 tokens</li><li>max: 24 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.54</li><li>max: 1.0</li></ul> |
274
- * Samples:
275
- | sentence1 | sentence2 | score |
276
- |:-----------------------------------------------------------------------|:-----------------------------------------------------------------------------------------|:------------------|
277
- | <code>Sebuah pesawat sedang lepas landas.</code> | <code>Sebuah pesawat terbang sedang lepas landas.</code> | <code>1.0</code> |
278
- | <code>Seorang pria sedang memainkan seruling besar.</code> | <code>Seorang pria sedang memainkan seruling.</code> | <code>0.76</code> |
279
- | <code>Seorang pria sedang mengoleskan keju parut di atas pizza.</code> | <code>Seorang pria sedang mengoleskan keju parut di atas pizza yang belum matang.</code> | <code>0.76</code> |
280
- * Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
281
- ```json
282
- {
283
- "loss_fct": "torch.nn.modules.loss.MSELoss"
284
- }
285
- ```
286
-
287
- ### Training Hyperparameters
288
- #### Non-Default Hyperparameters
289
-
290
- - `eval_strategy`: steps
291
- - `per_device_train_batch_size`: 16
292
- - `per_device_eval_batch_size`: 16
293
- - `learning_rate`: 2e-05
294
- - `weight_decay`: 0.01
295
- - `num_train_epochs`: 5
296
- - `warmup_ratio`: 0.1
297
- - `fp16`: True
298
-
299
- #### All Hyperparameters
300
- <details><summary>Click to expand</summary>
301
-
302
- - `overwrite_output_dir`: False
303
- - `do_predict`: False
304
- - `eval_strategy`: steps
305
- - `prediction_loss_only`: True
306
- - `per_device_train_batch_size`: 16
307
- - `per_device_eval_batch_size`: 16
308
- - `per_gpu_train_batch_size`: None
309
- - `per_gpu_eval_batch_size`: None
310
- - `gradient_accumulation_steps`: 1
311
- - `eval_accumulation_steps`: None
312
- - `learning_rate`: 2e-05
313
- - `weight_decay`: 0.01
314
- - `adam_beta1`: 0.9
315
- - `adam_beta2`: 0.999
316
- - `adam_epsilon`: 1e-08
317
- - `max_grad_norm`: 1.0
318
- - `num_train_epochs`: 5
319
- - `max_steps`: -1
320
- - `lr_scheduler_type`: linear
321
- - `lr_scheduler_kwargs`: {}
322
- - `warmup_ratio`: 0.1
323
- - `warmup_steps`: 0
324
- - `log_level`: passive
325
- - `log_level_replica`: warning
326
- - `log_on_each_node`: True
327
- - `logging_nan_inf_filter`: True
328
- - `save_safetensors`: True
329
- - `save_on_each_node`: False
330
- - `save_only_model`: False
331
- - `restore_callback_states_from_checkpoint`: False
332
- - `no_cuda`: False
333
- - `use_cpu`: False
334
- - `use_mps_device`: False
335
- - `seed`: 42
336
- - `data_seed`: None
337
- - `jit_mode_eval`: False
338
- - `use_ipex`: False
339
- - `bf16`: False
340
- - `fp16`: True
341
- - `fp16_opt_level`: O1
342
- - `half_precision_backend`: auto
343
- - `bf16_full_eval`: False
344
- - `fp16_full_eval`: False
345
- - `tf32`: None
346
- - `local_rank`: 0
347
- - `ddp_backend`: None
348
- - `tpu_num_cores`: None
349
- - `tpu_metrics_debug`: False
350
- - `debug`: []
351
- - `dataloader_drop_last`: False
352
- - `dataloader_num_workers`: 0
353
- - `dataloader_prefetch_factor`: None
354
- - `past_index`: -1
355
- - `disable_tqdm`: False
356
- - `remove_unused_columns`: True
357
- - `label_names`: None
358
- - `load_best_model_at_end`: False
359
- - `ignore_data_skip`: False
360
- - `fsdp`: []
361
- - `fsdp_min_num_params`: 0
362
- - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
363
- - `fsdp_transformer_layer_cls_to_wrap`: None
364
- - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
365
- - `deepspeed`: None
366
- - `label_smoothing_factor`: 0.0
367
- - `optim`: adamw_torch
368
- - `optim_args`: None
369
- - `adafactor`: False
370
- - `group_by_length`: False
371
- - `length_column_name`: length
372
- - `ddp_find_unused_parameters`: None
373
- - `ddp_bucket_cap_mb`: None
374
- - `ddp_broadcast_buffers`: False
375
- - `dataloader_pin_memory`: True
376
- - `dataloader_persistent_workers`: False
377
- - `skip_memory_metrics`: True
378
- - `use_legacy_prediction_loop`: False
379
- - `push_to_hub`: False
380
- - `resume_from_checkpoint`: None
381
- - `hub_model_id`: None
382
- - `hub_strategy`: every_save
383
- - `hub_private_repo`: False
384
- - `hub_always_push`: False
385
- - `gradient_checkpointing`: False
386
- - `gradient_checkpointing_kwargs`: None
387
- - `include_inputs_for_metrics`: False
388
- - `eval_do_concat_batches`: True
389
- - `fp16_backend`: auto
390
- - `push_to_hub_model_id`: None
391
- - `push_to_hub_organization`: None
392
- - `mp_parameters`:
393
- - `auto_find_batch_size`: False
394
- - `full_determinism`: False
395
- - `torchdynamo`: None
396
- - `ray_scope`: last
397
- - `ddp_timeout`: 1800
398
- - `torch_compile`: False
399
- - `torch_compile_backend`: None
400
- - `torch_compile_mode`: None
401
- - `dispatch_batches`: None
402
- - `split_batches`: None
403
- - `include_tokens_per_second`: False
404
- - `include_num_input_tokens_seen`: False
405
- - `neftune_noise_alpha`: None
406
- - `optim_target_modules`: None
407
- - `batch_eval_metrics`: False
408
- - `eval_on_start`: False
409
- - `batch_sampler`: batch_sampler
410
- - `multi_dataset_batch_sampler`: proportional
411
-
412
- </details>
413
-
414
- ### Training Logs
415
- | Epoch | Step | Training Loss | spearman_cosine | spearman_max |
416
- |:------:|:----:|:-------------:|:---------------:|:------------:|
417
- | 0.2778 | 100 | 0.0615 | - | - |
418
- | 0.5556 | 200 | 0.0336 | - | - |
419
- | 0.8333 | 300 | 0.0331 | - | - |
420
- | 1.1111 | 400 | 0.0235 | - | - |
421
- | 1.3889 | 500 | 0.018 | 0.8472 | - |
422
- | 1.6667 | 600 | 0.0164 | - | - |
423
- | 1.9444 | 700 | 0.0159 | - | - |
424
- | 2.2222 | 800 | 0.0097 | - | - |
425
- | 2.5 | 900 | 0.0085 | - | - |
426
- | 2.7778 | 1000 | 0.0084 | 0.8563 | - |
427
- | 3.0556 | 1100 | 0.0076 | - | - |
428
- | 3.3333 | 1200 | 0.0056 | - | - |
429
- | 3.6111 | 1300 | 0.0054 | - | - |
430
- | 3.8889 | 1400 | 0.0052 | - | - |
431
- | 4.1667 | 1500 | 0.0047 | 0.8589 | - |
432
- | 4.4444 | 1600 | 0.0045 | - | - |
433
- | 4.7222 | 1700 | 0.004 | - | - |
434
- | 5.0 | 1800 | 0.0042 | - | 0.8123 |
435
-
436
-
437
- ### Framework Versions
438
- - Python: 3.10.13
439
- - Sentence Transformers: 3.0.1
440
- - Transformers: 4.42.4
441
- - PyTorch: 2.0.1+cu117
442
- - Accelerate: 0.32.1
443
- - Datasets: 2.17.0
444
- - Tokenizers: 0.19.1
445
-
446
- ## Citation
447
-
448
- ### BibTeX
449
-
450
- #### Sentence Transformers
451
- ```bibtex
452
- @inproceedings{reimers-2019-sentence-bert,
453
- title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
454
- author = "Reimers, Nils and Gurevych, Iryna",
455
- booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
456
- month = "11",
457
- year = "2019",
458
- publisher = "Association for Computational Linguistics",
459
- url = "https://arxiv.org/abs/1908.10084",
460
- }
461
- ```
462
-
463
- <!--
464
- ## Glossary
465
-
466
- *Clearly define terms in order to be accessible across audiences.*
467
- -->
468
-
469
- <!--
470
- ## Model Card Authors
471
-
472
- *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
473
- -->
474
-
475
- <!--
476
- ## Model Card Contact
477
-
478
- *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
 
 
 
 
 
 
 
 
 
 
 
479
  -->
 
1
+ ---
2
+ base_model: indobenchmark/indobert-base-p2
3
+ datasets: []
4
+ language: []
5
+ library_name: sentence-transformers
6
+ metrics:
7
+ - pearson_cosine
8
+ - spearman_cosine
9
+ - pearson_manhattan
10
+ - spearman_manhattan
11
+ - pearson_euclidean
12
+ - spearman_euclidean
13
+ - pearson_dot
14
+ - spearman_dot
15
+ - pearson_max
16
+ - spearman_max
17
+ pipeline_tag: sentence-similarity
18
+ tags:
19
+ - sentence-transformers
20
+ - sentence-similarity
21
+ - feature-extraction
22
+ - generated_from_trainer
23
+ - dataset_size:5749
24
+ - loss:CosineSimilarityLoss
25
+ widget:
26
+ - source_sentence: Dua ekor anjing berenang di kolam renang.
27
+ sentences:
28
+ - Anjing-anjing sedang berenang di kolam renang.
29
+ - Seekor binatang sedang berjalan di atas tanah.
30
+ - Seorang pria sedang menyeka pinggiran mangkuk.
31
+ - source_sentence: Seorang anak perempuan sedang mengiris mentega menjadi dua bagian.
32
+ sentences:
33
+ - Seorang wanita sedang mengiris tahu.
34
+ - Dua orang berkelahi.
35
+ - Seorang pria sedang menari.
36
+ - source_sentence: Seorang gadis sedang makan kue mangkuk.
37
+ sentences:
38
+ - Seorang pria sedang mengiris bawang putih dengan alat pengiris mandolin.
39
+ - Seorang pria sedang memotong dan memotong bawang.
40
+ - Seorang wanita sedang makan kue mangkuk.
41
+ - source_sentence: Sebuah helikopter mendarat di landasan helikopter.
42
+ sentences:
43
+ - Seorang pria sedang mengiris mentimun.
44
+ - Seorang pria sedang memotong batang pohon dengan kapak.
45
+ - Sebuah helikopter mendarat.
46
+ - source_sentence: Seorang pria sedang berjalan dengan seekor kuda.
47
+ sentences:
48
+ - Seorang pria sedang menuntun seekor kuda dengan tali kekang.
49
+ - Seorang pria sedang menembakkan pistol.
50
+ - Seorang wanita sedang memetik tomat.
51
+ model-index:
52
+ - name: SentenceTransformer based on indobenchmark/indobert-base-p2
53
+ results:
54
+ - task:
55
+ type: semantic-similarity
56
+ name: Semantic Similarity
57
+ dataset:
58
+ name: Unknown
59
+ type: unknown
60
+ metrics:
61
+ - type: pearson_cosine
62
+ value: 0.8577280779646681
63
+ name: Pearson Cosine
64
+ - type: spearman_cosine
65
+ value: 0.8588776334781149
66
+ name: Spearman Cosine
67
+ - type: pearson_manhattan
68
+ value: 0.8315261521874587
69
+ name: Pearson Manhattan
70
+ - type: spearman_manhattan
71
+ value: 0.8355406849443783
72
+ name: Spearman Manhattan
73
+ - type: pearson_euclidean
74
+ value: 0.8318083198603524
75
+ name: Pearson Euclidean
76
+ - type: spearman_euclidean
77
+ value: 0.8359194889385243
78
+ name: Spearman Euclidean
79
+ - type: pearson_dot
80
+ value: 0.7767060276322824
81
+ name: Pearson Dot
82
+ - type: spearman_dot
83
+ value: 0.783607744137448
84
+ name: Spearman Dot
85
+ - type: pearson_max
86
+ value: 0.8577280779646681
87
+ name: Pearson Max
88
+ - type: spearman_max
89
+ value: 0.8588776334781149
90
+ name: Spearman Max
91
+ - type: pearson_cosine
92
+ value: 0.8122790124383042
93
+ name: Pearson Cosine
94
+ - type: spearman_cosine
95
+ value: 0.8123119892530147
96
+ name: Spearman Cosine
97
+ - type: pearson_manhattan
98
+ value: 0.7987643661729152
99
+ name: Pearson Manhattan
100
+ - type: spearman_manhattan
101
+ value: 0.7966661480553803
102
+ name: Spearman Manhattan
103
+ - type: pearson_euclidean
104
+ value: 0.7992882233155829
105
+ name: Pearson Euclidean
106
+ - type: spearman_euclidean
107
+ value: 0.797227936168015
108
+ name: Spearman Euclidean
109
+ - type: pearson_dot
110
+ value: 0.712195542080357
111
+ name: Pearson Dot
112
+ - type: spearman_dot
113
+ value: 0.7014898656834544
114
+ name: Spearman Dot
115
+ - type: pearson_max
116
+ value: 0.8122790124383042
117
+ name: Pearson Max
118
+ - type: spearman_max
119
+ value: 0.8123119892530147
120
+ name: Spearman Max
121
+ ---
122
+
123
+ # SentenceTransformer based on indobenchmark/indobert-base-p2
124
+
125
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [indobenchmark/indobert-base-p2](https://huggingface.co/indobenchmark/indobert-base-p2). It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
126
+
127
+ ## STSB Test
128
+ | | Spearman Correlation |
129
+ |:----------------------------------------|-----------------------:|
130
+ | models/indobert-large-stsb | 0.8366 |
131
+ | models/indobert-base-stsb | 0.8123 |
132
+ | sentence-transformers/all-MiniLM-L6-v2 | 0.5952 |
133
+ | indobenchmark/indobert-large-p2 | 0.5673 |
134
+ | sentence-transformers/all-mpnet-base-v2 | 0.5531 |
135
+ | sentence-transformers/stsb-bert-base | 0.5349 |
136
+ | indobenchmark/indobert-base-p2 | 0.5309 |
137
+
138
+ ## Model Details
139
+
140
+ ### Model Description
141
+ - **Model Type:** Sentence Transformer
142
+ - **Base model:** [indobenchmark/indobert-base-p2](https://huggingface.co/indobenchmark/indobert-base-p2) <!-- at revision 94b4e0a82081fa57f227fcc2024d1ea89b57ac1f -->
143
+ - **Maximum Sequence Length:** 512 tokens
144
+ - **Output Dimensionality:** 768 tokens
145
+ - **Similarity Function:** Cosine Similarity
146
+ <!-- - **Training Dataset:** Unknown -->
147
+ <!-- - **Language:** Unknown -->
148
+ <!-- - **License:** Unknown -->
149
+
150
+ ### Model Sources
151
+
152
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
153
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
154
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
155
+
156
+ ### Full Model Architecture
157
+
158
+ ```
159
+ SentenceTransformer(
160
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
161
+ (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})
162
+ )
163
+ ```
164
+
165
+ ## Usage
166
+
167
+ ### Direct Usage (Sentence Transformers)
168
+
169
+ First install the Sentence Transformers library:
170
+
171
+ ```bash
172
+ pip install -U sentence-transformers
173
+ ```
174
+
175
+ Then you can load this model and run inference.
176
+ ```python
177
+ from sentence_transformers import SentenceTransformer
178
+
179
+ # Download from the 🤗 Hub
180
+ model = SentenceTransformer("quarkss/indobert-base-stsb")
181
+ # Run inference
182
+ sentences = [
183
+ 'Seorang pria sedang berjalan dengan seekor kuda.',
184
+ 'Seorang pria sedang menuntun seekor kuda dengan tali kekang.',
185
+ 'Seorang pria sedang menembakkan pistol.',
186
+ ]
187
+ embeddings = model.encode(sentences)
188
+ print(embeddings.shape)
189
+ # [3, 768]
190
+
191
+ # Get the similarity scores for the embeddings
192
+ similarities = model.similarity(embeddings, embeddings)
193
+ print(similarities.shape)
194
+ # [3, 3]
195
+ ```
196
+
197
+ <!--
198
+ ### Direct Usage (Transformers)
199
+
200
+ <details><summary>Click to see the direct usage in Transformers</summary>
201
+
202
+ </details>
203
+ -->
204
+
205
+ <!--
206
+ ### Downstream Usage (Sentence Transformers)
207
+
208
+ You can finetune this model on your own dataset.
209
+
210
+ <details><summary>Click to expand</summary>
211
+
212
+ </details>
213
+ -->
214
+
215
+ <!--
216
+ ### Out-of-Scope Use
217
+
218
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
219
+ -->
220
+
221
+ ## Evaluation
222
+
223
+ ### Metrics
224
+
225
+ #### Semantic Similarity
226
+
227
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
228
+
229
+ | Metric | Value |
230
+ |:--------------------|:-----------|
231
+ | pearson_cosine | 0.8577 |
232
+ | **spearman_cosine** | **0.8589** |
233
+ | pearson_manhattan | 0.8315 |
234
+ | spearman_manhattan | 0.8355 |
235
+ | pearson_euclidean | 0.8318 |
236
+ | spearman_euclidean | 0.8359 |
237
+ | pearson_dot | 0.7767 |
238
+ | spearman_dot | 0.7836 |
239
+ | pearson_max | 0.8577 |
240
+ | spearman_max | 0.8589 |
241
+
242
+ #### Semantic Similarity
243
+
244
+ * Evaluated with [<code>EmbeddingSimilarityEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.EmbeddingSimilarityEvaluator)
245
+
246
+ | Metric | Value |
247
+ |:-------------------|:-----------|
248
+ | pearson_cosine | 0.8123 |
249
+ | spearman_cosine | 0.8123 |
250
+ | pearson_manhattan | 0.7988 |
251
+ | spearman_manhattan | 0.7967 |
252
+ | pearson_euclidean | 0.7993 |
253
+ | spearman_euclidean | 0.7972 |
254
+ | pearson_dot | 0.7122 |
255
+ | spearman_dot | 0.7015 |
256
+ | pearson_max | 0.8123 |
257
+ | **spearman_max** | **0.8123** |
258
+
259
+ <!--
260
+ ## Bias, Risks and Limitations
261
+
262
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
263
+ -->
264
+
265
+ <!--
266
+ ### Recommendations
267
+
268
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
269
+ -->
270
+
271
+ ## Training Details
272
+
273
+ ### Training Dataset
274
+
275
+ #### Unnamed Dataset
276
+
277
+
278
+ * Size: 5,749 training samples
279
+ * Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
280
+ * Approximate statistics based on the first 1000 samples:
281
+ | | sentence1 | sentence2 | score |
282
+ |:--------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------------------------|:---------------------------------------------------------------|
283
+ | type | string | string | float |
284
+ | details | <ul><li>min: 6 tokens</li><li>mean: 9.65 tokens</li><li>max: 25 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 9.59 tokens</li><li>max: 24 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.54</li><li>max: 1.0</li></ul> |
285
+ * Samples:
286
+ | sentence1 | sentence2 | score |
287
+ |:-----------------------------------------------------------------------|:-----------------------------------------------------------------------------------------|:------------------|
288
+ | <code>Sebuah pesawat sedang lepas landas.</code> | <code>Sebuah pesawat terbang sedang lepas landas.</code> | <code>1.0</code> |
289
+ | <code>Seorang pria sedang memainkan seruling besar.</code> | <code>Seorang pria sedang memainkan seruling.</code> | <code>0.76</code> |
290
+ | <code>Seorang pria sedang mengoleskan keju parut di atas pizza.</code> | <code>Seorang pria sedang mengoleskan keju parut di atas pizza yang belum matang.</code> | <code>0.76</code> |
291
+ * Loss: [<code>CosineSimilarityLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss) with these parameters:
292
+ ```json
293
+ {
294
+ "loss_fct": "torch.nn.modules.loss.MSELoss"
295
+ }
296
+ ```
297
+
298
+ ### Training Hyperparameters
299
+ #### Non-Default Hyperparameters
300
+
301
+ - `eval_strategy`: steps
302
+ - `per_device_train_batch_size`: 16
303
+ - `per_device_eval_batch_size`: 16
304
+ - `learning_rate`: 2e-05
305
+ - `weight_decay`: 0.01
306
+ - `num_train_epochs`: 5
307
+ - `warmup_ratio`: 0.1
308
+ - `fp16`: True
309
+
310
+ #### All Hyperparameters
311
+ <details><summary>Click to expand</summary>
312
+
313
+ - `overwrite_output_dir`: False
314
+ - `do_predict`: False
315
+ - `eval_strategy`: steps
316
+ - `prediction_loss_only`: True
317
+ - `per_device_train_batch_size`: 16
318
+ - `per_device_eval_batch_size`: 16
319
+ - `per_gpu_train_batch_size`: None
320
+ - `per_gpu_eval_batch_size`: None
321
+ - `gradient_accumulation_steps`: 1
322
+ - `eval_accumulation_steps`: None
323
+ - `learning_rate`: 2e-05
324
+ - `weight_decay`: 0.01
325
+ - `adam_beta1`: 0.9
326
+ - `adam_beta2`: 0.999
327
+ - `adam_epsilon`: 1e-08
328
+ - `max_grad_norm`: 1.0
329
+ - `num_train_epochs`: 5
330
+ - `max_steps`: -1
331
+ - `lr_scheduler_type`: linear
332
+ - `lr_scheduler_kwargs`: {}
333
+ - `warmup_ratio`: 0.1
334
+ - `warmup_steps`: 0
335
+ - `log_level`: passive
336
+ - `log_level_replica`: warning
337
+ - `log_on_each_node`: True
338
+ - `logging_nan_inf_filter`: True
339
+ - `save_safetensors`: True
340
+ - `save_on_each_node`: False
341
+ - `save_only_model`: False
342
+ - `restore_callback_states_from_checkpoint`: False
343
+ - `no_cuda`: False
344
+ - `use_cpu`: False
345
+ - `use_mps_device`: False
346
+ - `seed`: 42
347
+ - `data_seed`: None
348
+ - `jit_mode_eval`: False
349
+ - `use_ipex`: False
350
+ - `bf16`: False
351
+ - `fp16`: True
352
+ - `fp16_opt_level`: O1
353
+ - `half_precision_backend`: auto
354
+ - `bf16_full_eval`: False
355
+ - `fp16_full_eval`: False
356
+ - `tf32`: None
357
+ - `local_rank`: 0
358
+ - `ddp_backend`: None
359
+ - `tpu_num_cores`: None
360
+ - `tpu_metrics_debug`: False
361
+ - `debug`: []
362
+ - `dataloader_drop_last`: False
363
+ - `dataloader_num_workers`: 0
364
+ - `dataloader_prefetch_factor`: None
365
+ - `past_index`: -1
366
+ - `disable_tqdm`: False
367
+ - `remove_unused_columns`: True
368
+ - `label_names`: None
369
+ - `load_best_model_at_end`: False
370
+ - `ignore_data_skip`: False
371
+ - `fsdp`: []
372
+ - `fsdp_min_num_params`: 0
373
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
374
+ - `fsdp_transformer_layer_cls_to_wrap`: None
375
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
376
+ - `deepspeed`: None
377
+ - `label_smoothing_factor`: 0.0
378
+ - `optim`: adamw_torch
379
+ - `optim_args`: None
380
+ - `adafactor`: False
381
+ - `group_by_length`: False
382
+ - `length_column_name`: length
383
+ - `ddp_find_unused_parameters`: None
384
+ - `ddp_bucket_cap_mb`: None
385
+ - `ddp_broadcast_buffers`: False
386
+ - `dataloader_pin_memory`: True
387
+ - `dataloader_persistent_workers`: False
388
+ - `skip_memory_metrics`: True
389
+ - `use_legacy_prediction_loop`: False
390
+ - `push_to_hub`: False
391
+ - `resume_from_checkpoint`: None
392
+ - `hub_model_id`: None
393
+ - `hub_strategy`: every_save
394
+ - `hub_private_repo`: False
395
+ - `hub_always_push`: False
396
+ - `gradient_checkpointing`: False
397
+ - `gradient_checkpointing_kwargs`: None
398
+ - `include_inputs_for_metrics`: False
399
+ - `eval_do_concat_batches`: True
400
+ - `fp16_backend`: auto
401
+ - `push_to_hub_model_id`: None
402
+ - `push_to_hub_organization`: None
403
+ - `mp_parameters`:
404
+ - `auto_find_batch_size`: False
405
+ - `full_determinism`: False
406
+ - `torchdynamo`: None
407
+ - `ray_scope`: last
408
+ - `ddp_timeout`: 1800
409
+ - `torch_compile`: False
410
+ - `torch_compile_backend`: None
411
+ - `torch_compile_mode`: None
412
+ - `dispatch_batches`: None
413
+ - `split_batches`: None
414
+ - `include_tokens_per_second`: False
415
+ - `include_num_input_tokens_seen`: False
416
+ - `neftune_noise_alpha`: None
417
+ - `optim_target_modules`: None
418
+ - `batch_eval_metrics`: False
419
+ - `eval_on_start`: False
420
+ - `batch_sampler`: batch_sampler
421
+ - `multi_dataset_batch_sampler`: proportional
422
+
423
+ </details>
424
+
425
+ ### Training Logs
426
+ | Epoch | Step | Training Loss | spearman_cosine | spearman_max |
427
+ |:------:|:----:|:-------------:|:---------------:|:------------:|
428
+ | 0.2778 | 100 | 0.0615 | - | - |
429
+ | 0.5556 | 200 | 0.0336 | - | - |
430
+ | 0.8333 | 300 | 0.0331 | - | - |
431
+ | 1.1111 | 400 | 0.0235 | - | - |
432
+ | 1.3889 | 500 | 0.018 | 0.8472 | - |
433
+ | 1.6667 | 600 | 0.0164 | - | - |
434
+ | 1.9444 | 700 | 0.0159 | - | - |
435
+ | 2.2222 | 800 | 0.0097 | - | - |
436
+ | 2.5 | 900 | 0.0085 | - | - |
437
+ | 2.7778 | 1000 | 0.0084 | 0.8563 | - |
438
+ | 3.0556 | 1100 | 0.0076 | - | - |
439
+ | 3.3333 | 1200 | 0.0056 | - | - |
440
+ | 3.6111 | 1300 | 0.0054 | - | - |
441
+ | 3.8889 | 1400 | 0.0052 | - | - |
442
+ | 4.1667 | 1500 | 0.0047 | 0.8589 | - |
443
+ | 4.4444 | 1600 | 0.0045 | - | - |
444
+ | 4.7222 | 1700 | 0.004 | - | - |
445
+ | 5.0 | 1800 | 0.0042 | - | 0.8123 |
446
+
447
+
448
+ ### Framework Versions
449
+ - Python: 3.10.13
450
+ - Sentence Transformers: 3.0.1
451
+ - Transformers: 4.42.4
452
+ - PyTorch: 2.0.1+cu117
453
+ - Accelerate: 0.32.1
454
+ - Datasets: 2.17.0
455
+ - Tokenizers: 0.19.1
456
+
457
+ ## Citation
458
+
459
+ ### BibTeX
460
+
461
+ #### Sentence Transformers
462
+ ```bibtex
463
+ @inproceedings{reimers-2019-sentence-bert,
464
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
465
+ author = "Reimers, Nils and Gurevych, Iryna",
466
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
467
+ month = "11",
468
+ year = "2019",
469
+ publisher = "Association for Computational Linguistics",
470
+ url = "https://arxiv.org/abs/1908.10084",
471
+ }
472
+ ```
473
+
474
+ <!--
475
+ ## Glossary
476
+
477
+ *Clearly define terms in order to be accessible across audiences.*
478
+ -->
479
+
480
+ <!--
481
+ ## Model Card Authors
482
+
483
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
484
+ -->
485
+
486
+ <!--
487
+ ## Model Card Contact
488
+
489
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
490
  -->