CoolFace
Modelpublic

cassador/indobert-t4

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes85downloads
Model Card

SentenceTransformer based on indobenchmark/indobert-base-p2

This is a sentence-transformers model finetuned from 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.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: indobenchmark/indobert-base-p2 <!-- at revision 94b4e0a82081fa57f227fcc2024d1ea89b57ac1f -->
  • Maximum Sequence Length: 200 tokens
  • Output Dimensionality: 768 tokens
  • Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 200, 'do_lower_case': False}) with Transformer model: BertModel 
  (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})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
    'Penduduk kabupaten Raja Ampat mayoritas memeluk agama Kristen.',
    'Masyarakat kabupaten Raja Ampat mayoritas memeluk agama Islam.',
    'Gereja Baptis biasanya cenderung membentuk kelompok sendiri.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Semantic Similarity
MetricValue
pearson_cosine-0.0979
spearman_cosine-0.1037
pearson_manhattan-0.0987
spearman_manhattan-0.1005
pearson_euclidean-0.0981
spearman_euclidean-0.0998
pearson_dot-0.0822
spearman_dot-0.0821
pearson_max-0.0822
spearman_max-0.0821
Semantic Similarity
MetricValue
pearson_cosine-0.0278
spearman_cosine-0.035
pearson_manhattan-0.0355
spearman_manhattan-0.0387
pearson_euclidean-0.0356
spearman_euclidean-0.0389
pearson_dot-0.0092
spearman_dot-0.0066
pearson_max-0.0092
spearman_max-0.0066

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

Unnamed Dataset
  • Size: 10,330 training samples
  • Columns: <code>sentence0</code>, <code>sentence1</code>, and <code>label</code>
  • Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | label | |:--------|:------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------| | type | string | string | int | | details | <ul><li>min: 10 tokens</li><li>mean: 30.59 tokens</li><li>max: 128 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 11.93 tokens</li><li>max: 37 tokens</li></ul> | <ul><li>0: ~33.50%</li><li>1: ~32.70%</li><li>2: ~33.80%</li></ul> |
  • Samples: | sentence0 | sentence1 | label | |:-----------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------|:---------------| | <code>Ini adalah coup de grâce dan dorongan yang dibutuhkan oleh para pendatang untuk mendapatkan kemerdekaan mereka.</code> | <code>Pendatang tidak mendapatkan kemerdekaan.</code> | <code>2</code> | | <code>Dua bayi almarhum Raja, Diana dan Suharna, diculik.</code> | <code>Jumlah bayi raja yang diculik sudah mencapai 2 bayi.</code> | <code>1</code> | | <code>Sebuah penelitian menunjukkan bahwa mengkonsumsi makanan yang tinggi kadar gulanya bisa meningkatkan rasa haus.</code> | <code>Tidak ada penelitian yang bertopik makanan yang kadar gulanya tinggi.</code> | <code>2</code> |
  • Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • eval_strategy: steps
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • num_train_epochs: 20
  • multi_dataset_batch_sampler: round_robin
All Hyperparameters

<details><summary>Click to expand</summary>

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 4
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 20
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: False
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining Losssts-dev_spearman_max
0.0998129--0.0821
0.0999258--0.0541
0.19365000.0322-
0.1998516--0.0474
0.2997774--0.0369
0.387110000.0157-
0.39951032--0.0371
0.49941290--0.0388
0.580715000.0109-
0.59931548--0.0284
0.69921806--0.0293
0.774320000.0112-
0.79912064--0.0176
0.89902322--0.0290
0.967925000.0104-
0.99882580--0.0128
1.02583--0.0123
1.09872838--0.0200
1.161430000.0091-
1.19863096--0.0202
1.29853354--0.0204
1.355035000.0052-
1.39843612--0.0231
1.49833870--0.0312
1.548640000.0017-
1.59814128--0.0277
1.69804386--0.0366
1.742245000.0054-
1.79794644--0.0192
1.89784902--0.0224
1.935750000.0048-
1.99775160--0.0240
2.05166--0.0248
2.09765418--0.0374
2.129355000.0045-
2.19745676--0.0215
2.29735934--0.0329
2.322960000.0047-
2.39726192--0.0284
2.49716450--0.0370
2.516565000.0037-
2.59706708--0.0390
2.69696966--0.0681
2.710070000.0128-
2.79677224--0.0343
2.89667482--0.0413
2.903675000.0055-
2.99657740--0.0416
3.07749--0.0373
3.09647998--0.0630
3.097280000.0016-
3.19638256--0.0401
3.290785000.0018-
3.29628514--0.0303
3.39618772--0.0484
3.484390000.0017-
3.49599030--0.0619
3.59589288--0.0411
3.677995000.007-
3.69579546--0.0408
3.79569804--0.0368
3.8715100000.0029-
3.895510062--0.0429
3.995410320--0.0526
4.010332--0.0494
4.0650105000.0004-
4.095210578--0.0385
4.195110836--0.0467
4.2586110000.0004-
4.295011094--0.0500
4.394911352--0.0458
4.4522115000.0011-
4.494811610--0.0389
4.594711868--0.0401
4.6458120000.0046-
4.694512126--0.0370
4.794412384--0.0495
4.8393125000.0104-
4.894312642--0.0504
4.994212900--0.0377
5.012915--0.0379
5.0329130000.0005-
5.094113158--0.0617
5.194013416--0.0354
5.2265135000.0006-
5.293813674--0.0514
5.393713932--0.0615
5.4201140000.0014-
5.493614190--0.0574
5.593514448--0.0503
5.6136145000.0025-
5.693414706--0.0512
5.793314964--0.0316
5.8072150000.0029-
5.893115222--0.0475
5.993015480--0.0429
6.015498--0.0377
6.0008155000.0003-
6.092915738--0.0486
6.192815996--0.0512
6.1943160000.0002-
6.292716254--0.0383
6.3879165000.0017-
6.392616512--0.0460
6.492516770--0.0439
6.5815170000.0046-
6.592317028--0.0378
6.692217286--0.0289
6.7751175000.0081-
6.792117544--0.0415
6.892017802--0.0451
6.9686180000.0021-
6.991918060--0.0386
7.018081--0.0390
7.091818318--0.0460
7.1622185000.0001-
7.191618576--0.0510
7.291518834--0.0566
7.3558190000.0009-
7.391419092--0.0479
7.491319350--0.0456
7.5494195000.0019-
7.591219608--0.0371
7.691119866--0.0184
7.7429200000.003-
7.790920124--0.0312
7.890820382--0.0307
7.9365205000.0008-
7.990720640--0.0291
8.020664--0.0298
8.090620898--0.0452
8.1301210000.0001-
8.190521156--0.0405
8.290421414--0.0417
8.3237215000.0007-
8.390221672--0.0430
8.490121930--0.0487
8.5172220000.0-
8.590022188--0.0471
8.689922446--0.0361
8.7108225000.0037-
8.789822704--0.0443
8.889722962--0.0404
8.9044230000.0009-
8.989523220--0.0421
9.023247--0.0425
9.089423478--0.0451
9.0979235000.0001-
9.189323736--0.0458
9.289223994--0.0479
9.2915240000.0-
9.389124252--0.0400
9.4851245000.0014-
9.489024510--0.0374
9.588924768--0.0454
9.6787250000.0075-
9.688725026--0.0230
9.788625284--0.0345
9.8722255000.0007-
9.888525542--0.0301
9.988425800--0.0363
10.025830--0.0375
10.0658260000.0001-
10.088326058--0.0381
10.188226316--0.0386
10.2594265000.0-
10.288026574--0.0390
10.387926832--0.0366
10.4530270000.0007-
10.487827090--0.0464
10.587727348--0.0509
10.6465275000.0021-
10.687627606--0.0292
10.787527864--0.0514
10.8401280000.0017-
10.887328122--0.0485
10.987228380--0.0471
11.028413--0.0468
11.0337285000.0-
11.087128638--0.0460
11.187028896--0.0450
11.2273290000.0-
11.286929154--0.0457
11.386829412--0.0450
11.4208295000.0008-
11.486629670--0.0440
11.586529928--0.0384
11.6144300000.0028-
11.686430186--0.0066

</details>

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.0.1
  • Transformers: 4.41.2
  • PyTorch: 2.3.0+cu121
  • Accelerate: 0.31.0
  • Datasets: 2.19.2
  • Tokenizers: 0.19.1

Citation

BibTeX

Sentence Transformers
bibtex
@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
MultipleNegativesRankingLoss
bibtex
@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply}, 
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->