SentenceTransformer based on sentence-transformers/paraphrase-multilingual-mpnet-base-v2
This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-multilingual-mpnet-base-v2 on the allstats-search-pairs-dataset 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.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: sentence-transformers/paraphrase-multilingual-mpnet-base-v2
- Maximum Sequence Length: 128 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Training Dataset:
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
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})
)
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/test-model")
# Run inference
sentences = [
'Biaya hidup kelompok perumahan Indonesia 2017',
'Statistik Upah 2013',
'Survei Biaya Hidup (SBH) 2018 Bulukumba, Watampone, Makassar, Pare-Pare, dan Palopo',
]
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]
Evaluation
Metrics
Semantic Similarity
- Datasets:
allstats-semantic-mpnet-eval
andallstats-semantic-mpnet-test
- Evaluated with
EmbeddingSimilarityEvaluator
Metric | allstats-semantic-mpnet-eval | allstats-semantic-mpnet-test |
---|---|---|
pearson_cosine | 0.9831 | 0.9832 |
spearman_cosine | 0.841 | 0.8379 |
Training Details
Training Dataset
allstats-search-pairs-dataset
- Dataset: allstats-search-pairs-dataset at 6712cb1
- Size: 79,621 training samples
- Columns:
query
,doc
, andlabel
- Approximate statistics based on the first 1000 samples:
query doc label type string string float details - min: 5 tokens
- mean: 10.78 tokens
- max: 39 tokens
- min: 5 tokens
- mean: 13.73 tokens
- max: 58 tokens
- min: 0.0
- mean: 0.44
- max: 0.99
- Samples:
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
- Loss:
CosineSimilarityLoss
with these parameters:{ "loss_fct": "torch.nn.modules.loss.MSELoss" }
Evaluation Dataset
allstats-search-pairs-dataset
- Dataset: allstats-search-pairs-dataset at 6712cb1
- Size: 9,952 evaluation samples
- Columns:
query
,doc
, andlabel
- Approximate statistics based on the first 1000 samples:
query doc label type string string float details - min: 5 tokens
- mean: 10.75 tokens
- max: 40 tokens
- min: 4 tokens
- mean: 14.09 tokens
- max: 49 tokens
- min: 0.01
- mean: 0.48
- max: 0.99
- Samples:
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
- Loss:
CosineSimilarityLoss
with these parameters:{ "loss_fct": "torch.nn.modules.loss.MSELoss" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 32per_device_eval_batch_size
: 32num_train_epochs
: 6warmup_ratio
: 0.1fp16
: Truedataloader_num_workers
: 4load_best_model_at_end
: Truelabel_smoothing_factor
: 0.01eval_on_start
: True
All Hyperparameters
Click to expand
overwrite_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
: 6max_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
Training Logs
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.1004 | 250 | 0.0482 | 0.0269 | 0.7685 | - |
0.2009 | 500 | 0.0249 | 0.0200 | 0.7737 | - |
0.3013 | 750 | 0.0196 | 0.0172 | 0.7768 | - |
0.4018 | 1000 | 0.0184 | 0.0172 | 0.7744 | - |
0.5022 | 1250 | 0.0185 | 0.0159 | 0.7751 | - |
0.6027 | 1500 | 0.0155 | 0.0156 | 0.7825 | - |
0.7031 | 1750 | 0.0165 | 0.0149 | 0.7826 | - |
0.8035 | 2000 | 0.0146 | 0.0136 | 0.7791 | - |
0.9040 | 2250 | 0.0132 | 0.0127 | 0.7825 | - |
1.0044 | 2500 | 0.0127 | 0.0129 | 0.7818 | - |
1.1049 | 2750 | 0.0104 | 0.0114 | 0.7849 | - |
1.2053 | 3000 | 0.009 | 0.0108 | 0.7870 | - |
1.3057 | 3250 | 0.0091 | 0.0112 | 0.7877 | - |
1.4062 | 3500 | 0.009 | 0.0104 | 0.7888 | - |
1.5066 | 3750 | 0.009 | 0.0101 | 0.7937 | - |
1.6071 | 4000 | 0.0084 | 0.0099 | 0.7924 | - |
1.7075 | 4250 | 0.008 | 0.0097 | 0.7942 | - |
1.8080 | 4500 | 0.0079 | 0.0094 | 0.7946 | - |
1.9084 | 4750 | 0.0078 | 0.0092 | 0.7928 | - |
2.0088 | 5000 | 0.0081 | 0.0088 | 0.7986 | - |
2.1093 | 5250 | 0.0056 | 0.0079 | 0.8025 | - |
2.2097 | 5500 | 0.0052 | 0.0080 | 0.8019 | - |
2.3102 | 5750 | 0.0048 | 0.0079 | 0.8073 | - |
2.4106 | 6000 | 0.0053 | 0.0081 | 0.8058 | - |
2.5110 | 6250 | 0.0049 | 0.0079 | 0.8091 | - |
2.6115 | 6500 | 0.0053 | 0.0077 | 0.8081 | - |
2.7119 | 6750 | 0.0052 | 0.0075 | 0.8075 | - |
2.8124 | 7000 | 0.0049 | 0.0077 | 0.8089 | - |
2.9128 | 7250 | 0.0051 | 0.0076 | 0.8066 | - |
3.0133 | 7500 | 0.0048 | 0.0074 | 0.8127 | - |
3.1137 | 7750 | 0.0034 | 0.0069 | 0.8162 | - |
3.2141 | 8000 | 0.0033 | 0.0070 | 0.8164 | - |
3.3146 | 8250 | 0.0036 | 0.0068 | 0.8194 | - |
3.4150 | 8500 | 0.0032 | 0.0069 | 0.8156 | - |
3.5155 | 8750 | 0.0032 | 0.0068 | 0.8196 | - |
3.6159 | 9000 | 0.0032 | 0.0067 | 0.8197 | - |
3.7164 | 9250 | 0.0034 | 0.0068 | 0.8194 | - |
3.8168 | 9500 | 0.0034 | 0.0066 | 0.8194 | - |
3.9172 | 9750 | 0.0032 | 0.0063 | 0.8239 | - |
4.0177 | 10000 | 0.0032 | 0.0065 | 0.8229 | - |
4.1181 | 10250 | 0.0023 | 0.0063 | 0.8258 | - |
4.2186 | 10500 | 0.0022 | 0.0062 | 0.8293 | - |
4.3190 | 10750 | 0.002 | 0.0063 | 0.8283 | - |
4.4194 | 11000 | 0.0023 | 0.0060 | 0.8306 | - |
4.5199 | 11250 | 0.0021 | 0.0061 | 0.8318 | - |
4.6203 | 11500 | 0.0021 | 0.0060 | 0.8290 | - |
4.7208 | 11750 | 0.0022 | 0.0058 | 0.8329 | - |
4.8212 | 12000 | 0.0021 | 0.0058 | 0.8342 | - |
4.9217 | 12250 | 0.0021 | 0.0058 | 0.8360 | - |
5.0221 | 12500 | 0.0017 | 0.0057 | 0.8355 | - |
5.1225 | 12750 | 0.0014 | 0.0057 | 0.8377 | - |
5.2230 | 13000 | 0.0015 | 0.0058 | 0.8363 | - |
5.3234 | 13250 | 0.0015 | 0.0058 | 0.8369 | - |
5.4239 | 13500 | 0.0014 | 0.0057 | 0.8386 | - |
5.5243 | 13750 | 0.0014 | 0.0057 | 0.8387 | - |
5.6247 | 14000 | 0.0015 | 0.0057 | 0.8392 | - |
5.7252 | 14250 | 0.0014 | 0.0056 | 0.8409 | - |
5.8256 | 14500 | 0.0014 | 0.0056 | 0.8410 | - |
5.9261 | 14750 | 0.0014 | 0.0056 | 0.8410 | - |
6.0 | 14934 | - | - | - | 0.8379 |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.10.12
- Sentence Transformers: 3.3.1
- Transformers: 4.48.0
- PyTorch: 2.5.1+cu121
- Accelerate: 1.2.1
- Datasets: 3.2.0
- Tokenizers: 0.21.0
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",
}
- Downloads last month
- 16
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.
Model tree for yahyaabd/test-model
Dataset used to train yahyaabd/test-model
Evaluation results
- Pearson Cosine on allstats semantic mpnet evalself-reported0.983
- Spearman Cosine on allstats semantic mpnet evalself-reported0.841
- Pearson Cosine on allstats semantic mpnet testself-reported0.983
- Spearman Cosine on allstats semantic mpnet testself-reported0.838