Downloads · 30 days
71
33% of all-time downloads
yahyaabd/allstats-semantic-mpnet
allstats-semantic-mpnet is a sentence similarity model from yahyaabd. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-multilingual-mpnet-base-v2 on the allstats-semantic-dataset-v4 dataset. It maps sentences & paragraphs to a 768-dimensional dense v…
Downloads · 30 days
71
33% of all-time downloads
All-time downloads
218
Public
Parameters
278M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-multilingual-mpnet-base-v2 on the allstats-semantic-dataset-v4 dataset. 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.
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})
)
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/allstats-semantic-mpnet")
# Run inference
sentences = [
'Pernikahan usia anak di Indonesia periode 2013-2015',
'Jumlah penduduk Indonesia 2013-2015',
'Indeks Tendensi Bisnis dan Indeks Tendensi Konsumen 2013',
]
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.*
-->
allstats-semantic-mpnet-eval and allstats-semantic-mpnet-test| Metric | allstats-semantic-mpnet-eval | allstats-semantic-mpnet-test |
|---|---|---|
| pearson_cosine | 0.9714 | 0.9723 |
| spearman_cosine | 0.8934 | 0.8932 |
| query | doc | label | |
|---|---|---|---|
| type | string | string | float |
| details | <ul><li>min: 4 tokens</li><li>mean: 11.38 tokens</li><li>max: 46 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 14.48 tokens</li><li>max: 67 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.51</li><li>max: 1.0</li></ul> |
| query | doc | label |
|---|---|---|
| <code>Industri teh Indonesia tahun 2021</code> | <code>Statistik Transportasi Laut 2014</code> | <code>0.1</code> |
| <code>Tahun berapa data pertumbuhan ekonomi Indonesia tersebut?</code> | <code>Nilai Tukar Petani (NTP) November 2023 sebesar 116,73 atau naik 0,82 persen. Harga Gabah Kering Panen di Tingkat Petani turun 1,94 persen dan Harga Beras Premium di Penggilingan turun 0,91 persen.</code> | <code>0.0</code> |
| <code>Kemiskinan di Indonesia Maret</code> | <code>2018 Feb Tenaga Kerja</code> | <code>0.1</code> |
{
"loss_fct": "torch.nn.modules.loss.MSELoss"
}
| query | doc | label | |
|---|---|---|---|
| type | string | string | float |
| details | <ul><li>min: 5 tokens</li><li>mean: 11.35 tokens</li><li>max: 33 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 14.25 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.49</li><li>max: 1.0</li></ul> |
| query | doc | label |
|---|---|---|
| <code>nAalisis keuangam deas tshun 019</code> | <code>Statistik Migrasi Nusa Tenggara Barat Hasil Survei Penduduk Antar Sensus 2015</code> | <code>0.1</code> |
| <code>Data tanaman buah dan sayur Indonesia tahun 2016</code> | <code>Statistik Penduduk Lanjut Usia 2010</code> | <code>0.1</code> |
| <code>Pasar beras di Indonesia tahun 2018</code> | <code>Buletin Statistik Perdagangan Luar Negeri Ekspor Menurut Kelompok Komoditi dan Negara, April 2021</code> | <code>0.2</code> |
{
"loss_fct": "torch.nn.modules.loss.MSELoss"
}
eval_strategy: stepsper_device_train_batch_size: 32per_device_eval_batch_size: 32num_train_epochs: 8warmup_ratio: 0.1fp16: Truedataloader_num_workers: 4load_best_model_at_end: Truelabel_smoothing_factor: 0.05eval_on_start: Trueoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 32per_device_eval_batch_size: 32per_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: 8max_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.05optim: 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.0979 | 0.6119 | - |
| 0.0906 | 250 | 0.0646 | 0.0427 | 0.7249 | - |
| 0.1813 | 500 | 0.039 | 0.0324 | 0.7596 | - |
| 0.2719 | 750 | 0.032 | 0.0271 | 0.7860 | - |
| 0.3626 | 1000 | 0.0276 | 0.0255 | 0.7920 | - |
| 0.4532 | 1250 | 0.0264 | 0.0230 | 0.8072 | - |
| 0.5439 | 1500 | 0.0249 | 0.0222 | 0.8197 | - |
| 0.6345 | 1750 | 0.0226 | 0.0210 | 0.8200 | - |
| 0.7252 | 2000 | 0.0218 | 0.0209 | 0.8202 | - |
| 0.8158 | 2250 | 0.0208 | 0.0201 | 0.8346 | - |
| 0.9065 | 2500 | 0.0209 | 0.0211 | 0.8240 | - |
| 0.9971 | 2750 | 0.0211 | 0.0190 | 0.8170 | - |
| 1.0877 | 3000 | 0.0161 | 0.0182 | 0.8332 | - |
| 1.1784 | 3250 | 0.0158 | 0.0179 | 0.8393 | - |
| 1.2690 | 3500 | 0.0167 | 0.0189 | 0.8341 | - |
| 1.3597 | 3750 | 0.0152 | 0.0168 | 0.8371 | - |
| 1.4503 | 4000 | 0.0151 | 0.0165 | 0.8435 | - |
| 1.5410 | 4250 | 0.0143 | 0.0156 | 0.8365 | - |
| 1.6316 | 4500 | 0.0147 | 0.0157 | 0.8467 | - |
| 1.7223 | 4750 | 0.0138 | 0.0155 | 0.8501 | - |
| 1.8129 | 5000 | 0.0147 | 0.0154 | 0.8457 | - |
| 1.9036 | 5250 | 0.0137 | 0.0152 | 0.8498 | - |
| 1.9942 | 5500 | 0.0144 | 0.0143 | 0.8485 | - |
| 2.0848 | 5750 | 0.0108 | 0.0139 | 0.8439 | - |
| 2.1755 | 6000 | 0.01 | 0.0146 | 0.8563 | - |
| 2.2661 | 6250 | 0.011 | 0.0141 | 0.8558 | - |
| 2.3568 | 6500 | 0.0107 | 0.0144 | 0.8497 | - |
| 2.4474 | 6750 | 0.01 | 0.0138 | 0.8577 | - |
| 2.5381 | 7000 | 0.0097 | 0.0136 | 0.8585 | - |
| 2.6287 | 7250 | 0.0102 | 0.0135 | 0.8521 | - |
| 2.7194 | 7500 | 0.0106 | 0.0133 | 0.8537 | - |
| 2.8100 | 7750 | 0.0098 | 0.0133 | 0.8643 | - |
| 2.9007 | 8000 | 0.0105 | 0.0138 | 0.8543 | - |
| 2.9913 | 8250 | 0.009 | 0.0129 | 0.8555 | - |
| 3.0819 | 8500 | 0.0071 | 0.0121 | 0.8692 | - |
| 3.1726 | 8750 | 0.006 | 0.0120 | 0.8709 | - |
| 3.2632 | 9000 | 0.0078 | 0.0120 | 0.8660 | - |
| 3.3539 | 9250 | 0.0072 | 0.0122 | 0.8656 | - |
| 3.4445 | 9500 | 0.007 | 0.0123 | 0.8696 | - |
| 3.5352 | 9750 | 0.0075 | 0.0117 | 0.8707 | - |
| 3.6258 | 10000 | 0.0081 | 0.0115 | 0.8682 | - |
| 3.7165 | 10250 | 0.0083 | 0.0116 | 0.8617 | - |
| 3.8071 | 10500 | 0.0075 | 0.0116 | 0.8665 | - |
| 3.8978 | 10750 | 0.0077 | 0.0119 | 0.8733 | - |
| 3.9884 | 11000 | 0.008 | 0.0113 | 0.8678 | - |
| 4.0790 | 11250 | 0.0051 | 0.0110 | 0.8760 | - |
| 4.1697 | 11500 | 0.0052 | 0.0108 | 0.8729 | - |
| 4.2603 | 11750 | 0.0056 | 0.0108 | 0.8771 | - |
| 4.3510 | 12000 | 0.0052 | 0.0109 | 0.8793 | - |
| 4.4416 | 12250 | 0.0049 | 0.0109 | 0.8766 | - |
| 4.5323 | 12500 | 0.0055 | 0.0114 | 0.8742 | - |
| 4.6229 | 12750 | 0.0061 | 0.0108 | 0.8749 | - |
| 4.7136 | 13000 | 0.0058 | 0.0109 | 0.8833 | - |
| 4.8042 | 13250 | 0.0049 | 0.0108 | 0.8767 | - |
| 4.8949 | 13500 | 0.0046 | 0.0108 | 0.8839 | - |
| 4.9855 | 13750 | 0.0052 | 0.0104 | 0.8790 | - |
| 5.0761 | 14000 | 0.0041 | 0.0102 | 0.8826 | - |
| 5.1668 | 14250 | 0.004 | 0.0103 | 0.8775 | - |
| 5.2574 | 14500 | 0.0036 | 0.0102 | 0.8855 | - |
| 5.3481 | 14750 | 0.0037 | 0.0104 | 0.8841 | - |
| 5.4387 | 15000 | 0.0036 | 0.0101 | 0.8860 | - |
| 5.5294 | 15250 | 0.0043 | 0.0104 | 0.8852 | - |
| 5.6200 | 15500 | 0.004 | 0.0100 | 0.8856 | - |
| 5.7107 | 15750 | 0.0043 | 0.0101 | 0.8842 | - |
| 5.8013 | 16000 | 0.0043 | 0.0099 | 0.8835 | - |
| 5.8920 | 16250 | 0.0041 | 0.0099 | 0.8852 | - |
| 5.9826 | 16500 | 0.0036 | 0.0101 | 0.8866 | - |
| 6.0732 | 16750 | 0.0031 | 0.0100 | 0.8881 | - |
| 6.1639 | 17000 | 0.0031 | 0.0098 | 0.8880 | - |
| 6.2545 | 17250 | 0.0027 | 0.0098 | 0.8886 | - |
| 6.3452 | 17500 | 0.0032 | 0.0097 | 0.8868 | - |
| 6.4358 | 17750 | 0.0027 | 0.0097 | 0.8876 | - |
| 6.5265 | 18000 | 0.0031 | 0.0097 | 0.8893 | - |
| 6.6171 | 18250 | 0.0032 | 0.0096 | 0.8903 | - |
| 6.7078 | 18500 | 0.003 | 0.0096 | 0.8898 | - |
| 6.7984 | 18750 | 0.0029 | 0.0098 | 0.8907 | - |
| 6.8891 | 19000 | 0.003 | 0.0096 | 0.8896 | - |
| 6.9797 | 19250 | 0.0026 | 0.0096 | 0.8913 | - |
| 7.0703 | 19500 | 0.0024 | 0.0096 | 0.8921 | - |
| 7.1610 | 19750 | 0.0021 | 0.0097 | 0.8920 | - |
| 7.2516 | 20000 | 0.0023 | 0.0096 | 0.8910 | - |
| 7.3423 | 20250 | 0.002 | 0.0096 | 0.8920 | - |
| 7.4329 | 20500 | 0.0022 | 0.0096 | 0.8924 | - |
| 7.5236 | 20750 | 0.002 | 0.0097 | 0.8917 | - |
| 7.6142 | 21000 | 0.0024 | 0.0096 | 0.8923 | - |
| 7.7049 | 21250 | 0.0025 | 0.0095 | 0.8928 | - |
| 7.7955 | 21500 | 0.0022 | 0.0095 | 0.8931 | - |
| 7.8861 | 21750 | 0.0023 | 0.0095 | 0.8932 | - |
| 7.9768 | 22000 | 0.0022 | 0.0095 | 0.8934 | - |
| 8.0 | 22064 | - | - | - | 0.8932 |
@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",
}
<!--
## 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.*
-->