SentenceTransformer based on sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 on the allstats-semantic-search-synthetic-dataset-v2-mini 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 Type: Sentence Transformer
- Base model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
- Maximum Sequence Length: 128 tokens
- Output Dimensionality: 384 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: 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/allstats-semantic-search-mini-model-v2-2")
# Run inference
sentences = [
'Perdagangan luar negeri, impor, Oktober 2020',
'Indikator Ekonomi November 1999',
'Indikator Ekonomi September 2005',
]
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
Semantic Similarity
- Datasets:
allstats-semantic-search-mini-v2-eval
andallstat-semantic-search-mini-v2-test
- Evaluated with
EmbeddingSimilarityEvaluator
Metric | allstats-semantic-search-mini-v2-eval | allstat-semantic-search-mini-v2-test |
---|---|---|
pearson_cosine | 0.9617 | 0.9605 |
spearman_cosine | 0.8518 | 0.8481 |
Training Details
Training Dataset
allstats-semantic-search-synthetic-dataset-v2-mini
- Dataset: allstats-semantic-search-synthetic-dataset-v2-mini at 8222b01
- Size: 70,280 training samples
- Columns:
query
,doc
, andlabel
- Approximate statistics based on the first 1000 samples:
query doc label type string string float details - min: 3 tokens
- mean: 10.92 tokens
- max: 50 tokens
- min: 4 tokens
- mean: 14.68 tokens
- max: 59 tokens
- min: 0.0
- mean: 0.52
- max: 1.0
- Samples:
query doc label Statistik perusahaan pembudidaya tanaman kehutanan 2018
Statistik Perusahaan Pembudidaya Tanaman Kehutanan 2018
0.97
Berapa persen pertumbuhan PDB Indonesia pada Triwulan III Tahun 2002?
Inflasi Bulan November 2002 Sebesar 1,85 %
0.0
Perdagangan luar negeri Indonesia, impor 2019, jilid 2
Pendataan Sapi Potong Sapi Perah (PSPK 2011) Sulawesi Barat
0.06
- Loss:
CosineSimilarityLoss
with these parameters:{ "loss_fct": "torch.nn.modules.loss.MSELoss" }
Evaluation Dataset
allstats-semantic-search-synthetic-dataset-v2-mini
- Dataset: allstats-semantic-search-synthetic-dataset-v2-mini at 8222b01
- Size: 15,060 evaluation samples
- Columns:
query
,doc
, andlabel
- Approximate statistics based on the first 1000 samples:
query doc label type string string float details - min: 4 tokens
- mean: 10.96 tokens
- max: 48 tokens
- min: 4 tokens
- mean: 14.74 tokens
- max: 70 tokens
- min: 0.0
- mean: 0.5
- max: 1.0
- Samples:
query doc label Review PDRB daerah di Pulau Sumatera 2010-2013
Statistik Pendidikan 2006
0.12
Analisis data angkatan kerja Agustus 2021
Booklet Survei Angkatan Kerja Nasional Agustus 2021
0.9
Berapa persen inflasi yang terjadi pada Juli 2015?
Inflasi pada bulan lain tidak disebutkan
0.0
- Loss:
CosineSimilarityLoss
with these parameters:{ "loss_fct": "torch.nn.modules.loss.MSELoss" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 64per_device_eval_batch_size
: 64num_train_epochs
: 24warmup_ratio
: 0.1bf16
: True
All Hyperparameters
Click to expand
overwrite_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
: 24max_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
: Truefp16
: Falsefp16_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
: 0dataloader_prefetch_factor
: Nonepast_index
: -1disable_tqdm
: Falseremove_unused_columns
: Truelabel_names
: Noneload_best_model_at_end
: Falseignore_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.0optim
: 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
: Falsehub_always_push
: Falsegradient_checkpointing
: Falsegradient_checkpointing_kwargs
: Noneinclude_inputs_for_metrics
: Falseeval_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
: Falseeval_use_gather_object
: Falseprompts
: Nonebatch_sampler
: batch_samplermulti_dataset_batch_sampler
: proportional
Training Logs
Epoch | Step | Training Loss | Validation Loss | allstats-semantic-search-mini-v2-eval_spearman_cosine | allstat-semantic-search-mini-v2-test_spearman_cosine |
---|---|---|---|---|---|
0.4550 | 500 | 0.0643 | 0.0413 | 0.6996 | - |
0.9099 | 1000 | 0.0348 | 0.0280 | 0.7533 | - |
1.3649 | 1500 | 0.0254 | 0.0238 | 0.7737 | - |
1.8198 | 2000 | 0.0223 | 0.0205 | 0.7831 | - |
2.2748 | 2500 | 0.0181 | 0.0197 | 0.7894 | - |
2.7298 | 3000 | 0.0173 | 0.0184 | 0.7876 | - |
3.1847 | 3500 | 0.0152 | 0.0170 | 0.7954 | - |
3.6397 | 4000 | 0.0123 | 0.0175 | 0.7970 | - |
4.0946 | 4500 | 0.0125 | 0.0163 | 0.8118 | - |
4.5496 | 5000 | 0.01 | 0.0161 | 0.8047 | - |
5.0045 | 5500 | 0.0103 | 0.0157 | 0.8126 | - |
5.4595 | 6000 | 0.0079 | 0.0150 | 0.8224 | - |
5.9145 | 6500 | 0.0087 | 0.0156 | 0.8219 | - |
6.3694 | 7000 | 0.0071 | 0.0152 | 0.8145 | - |
6.8244 | 7500 | 0.0068 | 0.0153 | 0.8172 | - |
7.2793 | 8000 | 0.0061 | 0.0147 | 0.8216 | - |
7.7343 | 8500 | 0.0062 | 0.0146 | 0.8267 | - |
8.1893 | 9000 | 0.0055 | 0.0145 | 0.8325 | - |
8.6442 | 9500 | 0.005 | 0.0146 | 0.8335 | - |
9.0992 | 10000 | 0.0052 | 0.0143 | 0.8356 | - |
9.5541 | 10500 | 0.0043 | 0.0144 | 0.8313 | - |
10.0091 | 11000 | 0.0051 | 0.0144 | 0.8362 | - |
10.4641 | 11500 | 0.004 | 0.0145 | 0.8376 | - |
10.9190 | 12000 | 0.0039 | 0.0142 | 0.8331 | - |
11.3740 | 12500 | 0.0034 | 0.0141 | 0.8397 | - |
11.8289 | 13000 | 0.0033 | 0.0140 | 0.8398 | - |
12.2839 | 13500 | 0.0032 | 0.0143 | 0.8411 | - |
12.7389 | 14000 | 0.003 | 0.0141 | 0.8407 | - |
13.1938 | 14500 | 0.0031 | 0.0141 | 0.8379 | - |
13.6488 | 15000 | 0.0026 | 0.0141 | 0.8419 | - |
14.1037 | 15500 | 0.0028 | 0.0141 | 0.8442 | - |
14.5587 | 16000 | 0.0023 | 0.0138 | 0.8455 | - |
15.0136 | 16500 | 0.0025 | 0.0147 | 0.8359 | - |
15.4686 | 17000 | 0.0021 | 0.0141 | 0.8459 | - |
15.9236 | 17500 | 0.0023 | 0.0140 | 0.8433 | - |
16.3785 | 18000 | 0.002 | 0.0139 | 0.8465 | - |
16.8335 | 18500 | 0.002 | 0.0139 | 0.8461 | - |
17.2884 | 19000 | 0.0018 | 0.0139 | 0.8482 | - |
17.7434 | 19500 | 0.0018 | 0.0138 | 0.8477 | - |
18.1984 | 20000 | 0.0017 | 0.0138 | 0.8503 | - |
18.6533 | 20500 | 0.0016 | 0.0136 | 0.8493 | - |
19.1083 | 21000 | 0.0016 | 0.0139 | 0.8501 | - |
19.5632 | 21500 | 0.0015 | 0.0138 | 0.8478 | - |
20.0182 | 22000 | 0.0015 | 0.0139 | 0.8501 | - |
20.4732 | 22500 | 0.0013 | 0.0139 | 0.8508 | - |
20.9281 | 23000 | 0.0015 | 0.0139 | 0.8511 | - |
21.3831 | 23500 | 0.0013 | 0.0139 | 0.8517 | - |
21.8380 | 24000 | 0.0013 | 0.0139 | 0.8512 | - |
22.2930 | 24500 | 0.0012 | 0.0139 | 0.8512 | - |
22.7480 | 25000 | 0.0012 | 0.0138 | 0.8520 | - |
23.2029 | 25500 | 0.0012 | 0.0139 | 0.8520 | - |
23.6579 | 26000 | 0.0011 | 0.0139 | 0.8518 | - |
24.0 | 26376 | - | - | - | 0.8481 |
Framework Versions
- Python: 3.10.12
- Sentence Transformers: 3.3.1
- Transformers: 4.44.2
- PyTorch: 2.4.1+cu121
- Accelerate: 0.34.2
- Datasets: 3.2.0
- Tokenizers: 0.19.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",
}
- Downloads last month
- 1
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/allstats-semantic-search-mini-model-v2-2
Dataset used to train yahyaabd/allstats-semantic-search-mini-model-v2-2
Evaluation results
- Pearson Cosine on allstats semantic search mini v2 evalself-reported0.962
- Spearman Cosine on allstats semantic search mini v2 evalself-reported0.852
- Pearson Cosine on allstat semantic search mini v2 testself-reported0.960
- Spearman Cosine on allstat semantic search mini v2 testself-reported0.848