Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
(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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("yahyaabd/allstats-v1-2")
5# Run inference
6sentences = [
7 'Biaya hidup kelompok perumahan Indonesia 2017',
8 'Statistik Upah 2013',
9 'Survei Biaya Hidup (SBH) 2018 Bulukumba, Watampone, Makassar, Pare-Pare, dan Palopo',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 768]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]allstats-semantic-mpnet-eval and allstats-semantic-mpnet-testEmbeddingSimilarityEvaluator| Metric | allstats-semantic-mpnet-eval | allstats-semantic-mpnet-test |
|---|---|---|
| pearson_cosine | 0.9832 | 0.984 |
| spearman_cosine | 0.8582 | 0.8555 |
query, doc, and label| query | doc | label | |
|---|---|---|---|
| type | string | string | float |
| details |
|
|
|
| query | doc | label |
|---|---|---|
Produksi jagung di Indonesia tahun 2009 | Indeks Unit Value Ekspor Menurut Kode SITC Bulan Februari 2024 | 0.1 |
Data produksi industri manufaktur 2021 | Perkembangan Indeks Produksi Industri Manufaktur 2021 | 0.96 |
direktori perusahaan industri penggilingan padi tahun 2012 provinsi sulawesi utara dan gorontalo | Neraca Pemerintahan Umum Indonesia 2007-2012 | 0.03 |
CosineSimilarityLoss with these parameters:
1{
2 "loss_fct": "torch.nn.modules.loss.MSELoss"
3}query, doc, and label| query | doc | label | |
|---|---|---|---|
| type | string | string | float |
| details |
|
|
|
| query | doc | label |
|---|---|---|
Daftar perusahaan industri pengolahan skala kecil 2006 | Statistik Migrasi Nusa Tenggara Barat Hasil SP 2010 | 0.05 |
Populasi Indonesia per provinsi 2000-2010 | Indikator Ekonomi Desember 2023 | 0.08 |
Data harga barang desa non-pangan tahun 2022 | Statistik Kunjungan Tamu Asing 2004 | 0.1 |
CosineSimilarityLoss with these parameters:
1{
2 "loss_fct": "torch.nn.modules.loss.MSELoss"
3}eval_strategy: stepsper_device_train_batch_size: 64per_device_eval_batch_size: 64num_train_epochs: 16warmup_ratio: 0.1fp16: Truedataloader_num_workers: 4load_best_model_at_end: Truelabel_smoothing_factor: 0.01eval_on_start: Trueoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 64per_device_eval_batch_size: 64per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 16max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Truefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 4dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.01optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Trueuse_liger_kernel: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | Validation Loss | allstats-semantic-mpnet-eval_spearman_cosine | allstats-semantic-mpnet-test_spearman_cosine |
|---|---|---|---|---|---|
| 0 | 0 | - | 0.0958 | 0.6404 | - |
| 0.2008 | 250 | 0.0493 | 0.0262 | 0.7681 | - |
| 0.4016 | 500 | 0.0232 | 0.0187 | 0.7719 | - |
| 0.6024 | 750 | 0.0182 | 0.0157 | 0.7784 | - |
| 0.8032 | 1000 | 0.0163 | 0.0142 | 0.7805 | - |
| 1.0040 | 1250 | 0.0141 | 0.0137 | 0.7782 | - |
| 1.2048 | 1500 | 0.0114 | 0.0121 | 0.7815 | - |
| 1.4056 | 1750 | 0.0108 | 0.0115 | 0.7848 | - |
| 1.6064 | 2000 | 0.0109 | 0.0111 | 0.7873 | - |
| 1.8072 | 2250 | 0.0101 | 0.0103 | 0.7923 | - |
| 2.0080 | 2500 | 0.0096 | 0.0103 | 0.7931 | - |
| 2.2088 | 2750 | 0.0074 | 0.0092 | 0.7941 | - |
| 2.4096 | 3000 | 0.0067 | 0.0089 | 0.7985 | - |
| 2.6104 | 3250 | 0.0065 | 0.0086 | 0.8016 | - |
| 2.8112 | 3500 | 0.0064 | 0.0083 | 0.8017 | - |
| 3.0120 | 3750 | 0.0064 | 0.0084 | 0.8049 | - |
| 3.2129 | 4000 | 0.0045 | 0.0078 | 0.8090 | - |
| 3.4137 | 4250 | 0.0046 | 0.0078 | 0.8078 | - |
| 3.6145 | 4500 | 0.0043 | 0.0075 | 0.8111 | - |
| 3.8153 | 4750 | 0.0047 | 0.0074 | 0.8103 | - |
| 4.0161 | 5000 | 0.0047 | 0.0077 | 0.8084 | - |
| 4.2169 | 5250 | 0.0036 | 0.0072 | 0.8161 | - |
| 4.4177 | 5500 | 0.0034 | 0.0070 | 0.8187 | - |
| 4.6185 | 5750 | 0.0033 | 0.0068 | 0.8186 | - |
| 4.8193 | 6000 | 0.0035 | 0.0068 | 0.8220 | - |
| 5.0201 | 6250 | 0.0033 | 0.0071 | 0.8193 | - |
| 5.2209 | 6500 | 0.0027 | 0.0067 | 0.8239 | - |
| 5.4217 | 6750 | 0.0026 | 0.0069 | 0.8269 | - |
| 5.6225 | 7000 | 0.0027 | 0.0064 | 0.8275 | - |
| 5.8233 | 7250 | 0.0026 | 0.0066 | 0.8278 | - |
| 6.0241 | 7500 | 0.0026 | 0.0064 | 0.8293 | - |
| 6.2249 | 7750 | 0.0019 | 0.0064 | 0.8298 | - |
| 6.4257 | 8000 | 0.0019 | 0.0062 | 0.8319 | - |
| 6.6265 | 8250 | 0.0021 | 0.0064 | 0.8300 | - |
| 6.8273 | 8500 | 0.0022 | 0.0061 | 0.8338 | - |
| 7.0281 | 8750 | 0.0021 | 0.0063 | 0.8330 | - |
| 7.2289 | 9000 | 0.0016 | 0.0061 | 0.8374 | - |
| 7.4297 | 9250 | 0.0016 | 0.0059 | 0.8394 | - |
| 7.6305 | 9500 | 0.0016 | 0.0060 | 0.8379 | - |
| 7.8313 | 9750 | 0.0017 | 0.0062 | 0.8371 | - |
| 8.0321 | 10000 | 0.0017 | 0.0061 | 0.8392 | - |
| 8.2329 | 10250 | 0.0013 | 0.0061 | 0.8407 | - |
| 8.4337 | 10500 | 0.0013 | 0.0059 | 0.8418 | - |
| 8.6345 | 10750 | 0.0014 | 0.0060 | 0.8400 | - |
| 8.8353 | 11000 | 0.0014 | 0.0064 | 0.8415 | - |
| 9.0361 | 11250 | 0.0013 | 0.0060 | 0.8428 | - |
| 9.2369 | 11500 | 0.001 | 0.0058 | 0.8435 | - |
| 9.4378 | 11750 | 0.0011 | 0.0058 | 0.8458 | - |
| 9.6386 | 12000 | 0.0011 | 0.0060 | 0.8460 | - |
| 9.8394 | 12250 | 0.0011 | 0.0060 | 0.8468 | - |
| 10.0402 | 12500 | 0.0011 | 0.0060 | 0.8448 | - |
| 10.2410 | 12750 | 0.0009 | 0.0060 | 0.8476 | - |
| 10.4418 | 13000 | 0.0008 | 0.0059 | 0.8489 | - |
| 10.6426 | 13250 | 0.0009 | 0.0058 | 0.8485 | - |
| 10.8434 | 13500 | 0.0009 | 0.0059 | 0.8496 | - |
| 11.0442 | 13750 | 0.0008 | 0.0059 | 0.8492 | - |
| 11.2450 | 14000 | 0.0007 | 0.0058 | 0.8489 | - |
| 11.4458 | 14250 | 0.0007 | 0.0058 | 0.8507 | - |
| 11.6466 | 14500 | 0.0007 | 0.0057 | 0.8515 | - |
| 11.8474 | 14750 | 0.0007 | 0.0058 | 0.8505 | - |
| 12.0482 | 15000 | 0.0007 | 0.0058 | 0.8515 | - |
| 12.2490 | 15250 | 0.0006 | 0.0058 | 0.8523 | - |
| 12.4498 | 15500 | 0.0006 | 0.0057 | 0.8525 | - |
| 12.6506 | 15750 | 0.0006 | 0.0056 | 0.8542 | - |
| 12.8514 | 16000 | 0.0006 | 0.0056 | 0.8545 | - |
| 13.0522 | 16250 | 0.0006 | 0.0056 | 0.8550 | - |
| 13.2530 | 16500 | 0.0005 | 0.0056 | 0.8550 | - |
| 13.4538 | 16750 | 0.0005 | 0.0056 | 0.8553 | - |
| 13.6546 | 17000 | 0.0005 | 0.0055 | 0.8556 | - |
| 13.8554 | 17250 | 0.0005 | 0.0056 | 0.8559 | - |
| 14.0562 | 17500 | 0.0005 | 0.0056 | 0.8561 | - |
| 14.2570 | 17750 | 0.0004 | 0.0055 | 0.8570 | - |
| 14.4578 | 18000 | 0.0004 | 0.0055 | 0.8567 | - |
| 14.6586 | 18250 | 0.0004 | 0.0055 | 0.8575 | - |
| 14.8594 | 18500 | 0.0004 | 0.0055 | 0.8575 | - |
| 15.0602 | 18750 | 0.0004 | 0.0055 | 0.858 | - |
| 15.2610 | 19000 | 0.0004 | 0.0055 | 0.8583 | - |
| 15.4618 | 19250 | 0.0003 | 0.0055 | 0.8583 | - |
| 15.6627 | 19500 | 0.0004 | 0.0055 | 0.8581 | - |
| 15.8635 | 19750 | 0.0004 | 0.0055 | 0.8582 | - |
| 16.0 | 19920 | - | - | - | 0.8555 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}