SentenceTransformer based on yahyaabd/bps-custom-tokenizer-paraphrase-multilingual-MiniLM-L12-v2

This is a sentence-transformers model finetuned from yahyaabd/bps-custom-tokenizer-paraphrase-multilingual-MiniLM-L12-v2 on the statictable-triplets-all dataset. It maps sentences & paragraphs to a 384-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 Sources

Full Model Architecture

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

pip install -U sentence-transformers

Then you can load this model and run inference.

from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("yahyaabd/bps-custom-tokenizer-paraphrase-multilingual-MiniLM-L12-v2-mnrl-2")
# Run inference
sentences = [
    'Informasi lengkap dan terbaru mengenai statistik edukasi',
    'Statistik Pendidikan Tahunan',
    'Struktur Ongkos Riil Usaha Ternak dan Unggas di Rumah Tangga dengan Pola Pemeliharaan Dikandangkan, 2017',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

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

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.8599
cosine_accuracy@5 0.9805
cosine_accuracy@10 0.987
cosine_precision@1 0.8599
cosine_precision@5 0.2326
cosine_precision@10 0.1391
cosine_recall@1 0.6663
cosine_recall@5 0.7919
cosine_recall@10 0.8157
cosine_ndcg@1 0.8599
cosine_ndcg@5 0.8115
cosine_ndcg@10 0.8116
cosine_mrr@1 0.8599
cosine_mrr@5 0.9119
cosine_mrr@10 0.9128
cosine_map@1 0.8599
cosine_map@5 0.7617
cosine_map@10 0.7558

Training Details

Training Dataset

statictable-triplets-all

  • Dataset: statictable-triplets-all at 0ef226c
  • Size: 10,998 training samples
  • Columns: query, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    query positive negative
    type string string string
    details
    • min: 6 tokens
    • mean: 17.25 tokens
    • max: 33 tokens
    • min: 5 tokens
    • mean: 25.66 tokens
    • max: 58 tokens
    • min: 4 tokens
    • mean: 25.64 tokens
    • max: 58 tokens
  • Samples:
    query positive negative
    Neraca arus kas triwulan II 2005 (ringkasan, ) Ringkasan Neraca Arus Dana, Triwulan Kedua, 2005, (Miliar Rupiah) Rata-rata Upah/Gaji Bersih Sebulan Buruh/Karyawan/Pegawai Menurut Provinsi dan Jenis Pekerjaan Utama (Rupiah), 2017
    Hasil tangkapan ikan per provinsi, bedakan jenis penangkapan, 2013 Produksi Perikanan Tangkap Menurut Provinsi dan Jenis Penangkapan, 2000-2020 Ringkasan Neraca Arus Dana, Triwulan II, 2006, (Miliar Rupiah)
    Bagaimana perubahan distribusi pengeluaran? Persentase Perkembangan Distribusi Pengeluaran Angka Kematian Bayi/AKB (Infant Mortality Rate/IMR) Menurut Provinsi, 1971-2020
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Evaluation Dataset

statictable-triplets-all

  • Dataset: statictable-triplets-all at 0ef226c
  • Size: 10,998 evaluation samples
  • Columns: query, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    query positive negative
    type string string string
    details
    • min: 4 tokens
    • mean: 17.25 tokens
    • max: 34 tokens
    • min: 4 tokens
    • mean: 25.44 tokens
    • max: 58 tokens
    • min: 5 tokens
    • mean: 25.23 tokens
    • max: 58 tokens
  • Samples:
    query positive negative
    Data total penghasilan berbagai golongan rumah tangga setelah dipotong pajak, tahun 2000 (dalam ) Jumlah Pendapatan Setelah Pajak Menurut Golongan Rumah Tangga (miliar rupiah), 2000, 2005, dan 2008 Indeks Harga Konsumen per Kelompok di 82 Kota 1 (2012=100)
    Bagaimana perkembangan impor barang modal pada tahun 2020 Impor Barang Modal, 1996-2023 Indeks Harga yang Diterima Petani (It), Indes Harga yang Dibayar Petani (Ib), dan Nilai Tukar Petani Subsektor Hortikultura (NTPH) di Indonesia (2007=100), 2008-2016
    Konsumsi makanan per orang di Kalut: data mingguan, beda kelompok pengeluaran (2018) Rata-rata Konsumsi dan Pengeluaran Perkapita Seminggu Menurut Komoditi Makanan dan Golongan Pengeluaran per Kapita Seminggu di Provinsi Kalimantan Utara, 2018-2023 Ekspor Kimia Dasar Organik yang Bersumber dari Hasil Pertanian menurut Negara Tujuan Utama, 2012-2023
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 32
  • per_device_eval_batch_size: 32
  • weight_decay: 0.01
  • warmup_ratio: 0.1
  • save_on_each_node: True
  • fp16: True
  • dataloader_num_workers: 2
  • load_best_model_at_end: True
  • eval_on_start: True
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 32
  • per_device_eval_batch_size: 32
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.01
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 3
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • 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: True
  • 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: True
  • 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: 2
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: True
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • tp_size: 0
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': 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: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • 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
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: True
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional

Training Logs

Epoch Step Training Loss Validation Loss bps-statictable-ir_cosine_ndcg@10
0 0 - 2.2208 0.3476
0.0645 20 1.7839 0.9899 0.5271
0.1290 40 0.7326 0.4401 0.7019
0.1935 60 0.3811 0.2612 0.7584
0.2581 80 0.2068 0.2111 0.7612
0.3226 100 0.2206 0.1526 0.7748
0.3871 120 0.1547 0.1065 0.7934
0.4516 140 0.1196 0.0895 0.7880
0.5161 160 0.1107 0.0821 0.8045
0.5806 180 0.1253 0.0737 0.7828
0.6452 200 0.0915 0.0636 0.8081
0.7097 220 0.0592 0.0555 0.8140
0.7742 240 0.055 0.0535 0.7992
0.8387 260 0.0531 0.0487 0.8005
0.9032 280 0.0626 0.0429 0.8035
0.9677 300 0.0406 0.0407 0.8033
1.0323 320 0.034 0.0430 0.8058
1.0968 340 0.0327 0.0392 0.8070
1.1613 360 0.0385 0.0425 0.8006
1.2258 380 0.0233 0.0347 0.8053
1.2903 400 0.027 0.0339 0.8111
1.3548 420 0.0323 0.0300 0.8046
1.4194 440 0.0308 0.0262 0.8126
1.4839 460 0.0343 0.0277 0.7961
1.5484 480 0.0192 0.0232 0.8080
1.6129 500 0.0248 0.0248 0.8057
1.6774 520 0.0178 0.0250 0.8062
1.7419 540 0.0158 0.0228 0.8096
1.8065 560 0.0171 0.0233 0.8073
1.8710 580 0.0204 0.0218 0.8178
1.9355 600 0.0261 0.0214 0.8204
2.0 620 0.0132 0.0215 0.8166
2.0645 640 0.0174 0.0189 0.8169
2.1290 660 0.0095 0.0185 0.8202
2.1935 680 0.0186 0.0173 0.8173
2.2581 700 0.0241 0.0168 0.8174
2.3226 720 0.0152 0.0158 0.8163
2.3871 740 0.0197 0.0158 0.8128
2.4516 760 0.0119 0.0156 0.8122
2.5161 780 0.0128 0.0151 0.8118
2.5806 800 0.0162 0.0148 0.8114
2.6452 820 0.011 0.0143 0.8117
2.7097 840 0.0098 0.0138 0.8128
2.7742 860 0.0092 0.0135 0.8111
2.8387 880 0.0102 0.0127 0.8109
2.9032 900 0.0118 0.0126 0.8115
2.9677 920 0.0128 0.0126 0.8116
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.11.12
  • Sentence Transformers: 3.4.0
  • Transformers: 4.51.3
  • PyTorch: 2.6.0+cu124
  • Accelerate: 1.6.0
  • Datasets: 3.2.0
  • Tokenizers: 0.21.1

Citation

BibTeX

Sentence Transformers

@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

@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}
}
Downloads last month
6
Safetensors
Model size
118M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yahyaabd/bps-custom-tokenizer-paraphrase-multilingual-MiniLM-L12-v2-mnrl-2

Dataset used to train yahyaabd/bps-custom-tokenizer-paraphrase-multilingual-MiniLM-L12-v2-mnrl-2

Evaluation results