Views
No views yet
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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("yahyaabd/allstats-search-mini-v1-1-mnrl-v3")
5# Run inference
6sentences = [
7 'Statistik penduduk berdasarkan kelompok umur dan jenis kelamin',
8 'Direktori Perusahaan Industri Pengolahan Skala Kecil Buku II Hasil Se 2006',
9 'Indikator Ekonomi Desember 2004',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 384]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]sts-dev and sts-testEmbeddingSimilarityEvaluator| Metric | sts-dev | sts-test |
|---|---|---|
| pearson_cosine | 0.9663 | 0.9698 |
| spearman_cosine | 0.856 | 0.8591 |
query, title, and score| query | title | score | |
|---|---|---|---|
| type | string | string | float |
| details |
|
|
|
| query | title | score |
|---|---|---|
Nilai Tukar Nelayan | Statistik Hotel dan Akomodasi Lainnya di Indonesia 2013 | 0.1 |
Berapa angka statistik pertambangan non migas Indonesia periode 2012? | Statistik Pertambangan Non Minyak dan Gas Bumi 2011-2015 | 0.9 |
Bagaimana situasi angkatan kerja Indonesia di bulan Februari 2021? | Keadaan Angkatan Kerja di Indonesia Februari 2021 | 0.9 |
CosineSimilarityLoss with these parameters:
1{
2 "loss_fct": "torch.nn.modules.loss.MSELoss"
3}query, title, and score| query | title | score | |
|---|---|---|---|
| type | string | string | float |
| details |
|
|
|
| query | title | score |
|---|---|---|
Sosek Desember 2021 | Laporan Bulanan Data Sosial Ekonomi Desember 2021 | 0.9 |
Ekspor Indonesia menurut SITC 2019-2020 | Statistik Perdagangan Luar Negeri Indonesia Ekspor Menurut Kode SITC, 2019-2020 | 0.9 |
Pengeluaran konsumsi penduduk Indonesia Maret 2018 | Pengeluaran untuk Konsumsi Penduduk Indonesia, Maret 2018 | 0.9 |
CosineSimilarityLoss with these parameters:
1{
2 "loss_fct": "torch.nn.modules.loss.MSELoss"
3}eval_strategy: stepsper_device_train_batch_size: 32per_device_eval_batch_size: 32learning_rate: 1e-05warmup_ratio: 0.1fp16: Trueload_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: 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: 1e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 3max_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: 0dataloader_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 | sts-dev_spearman_cosine | sts-test_spearman_cosine |
|---|---|---|---|---|---|
| 0 | 0 | - | 0.0372 | 0.8428 | - |
| 0.0394 | 10 | 0.0437 | 0.0367 | 0.8430 | - |
| 0.0787 | 20 | 0.0382 | 0.0351 | 0.8436 | - |
| 0.1181 | 30 | 0.0392 | 0.0327 | 0.8447 | - |
| 0.1575 | 40 | 0.0343 | 0.0304 | 0.8460 | - |
| 0.1969 | 50 | 0.0286 | 0.0287 | 0.8469 | - |
| 0.2362 | 60 | 0.0289 | 0.0271 | 0.8480 | - |
| 0.2756 | 70 | 0.0272 | 0.0257 | 0.8492 | - |
| 0.3150 | 80 | 0.0289 | 0.0243 | 0.8501 | - |
| 0.3543 | 90 | 0.0232 | 0.0228 | 0.8509 | - |
| 0.3937 | 100 | 0.0251 | 0.0216 | 0.8515 | - |
| 0.4331 | 110 | 0.0202 | 0.0205 | 0.8520 | - |
| 0.4724 | 120 | 0.0229 | 0.0198 | 0.8525 | - |
| 0.5118 | 130 | 0.0195 | 0.0191 | 0.8531 | - |
| 0.5512 | 140 | 0.0191 | 0.0185 | 0.8533 | - |
| 0.5906 | 150 | 0.0238 | 0.0179 | 0.8536 | - |
| 0.6299 | 160 | 0.0193 | 0.0175 | 0.8538 | - |
| 0.6693 | 170 | 0.0174 | 0.0171 | 0.8540 | - |
| 0.7087 | 180 | 0.0189 | 0.0169 | 0.8541 | - |
| 0.7480 | 190 | 0.0192 | 0.0167 | 0.8542 | - |
| 0.7874 | 200 | 0.0161 | 0.0164 | 0.8543 | - |
| 0.8268 | 210 | 0.0173 | 0.0160 | 0.8545 | - |
| 0.8661 | 220 | 0.0143 | 0.0156 | 0.8547 | - |
| 0.9055 | 230 | 0.0119 | 0.0155 | 0.8547 | - |
| 0.9449 | 240 | 0.0183 | 0.0154 | 0.8548 | - |
| 0.9843 | 250 | 0.0149 | 0.0152 | 0.8548 | - |
| 1.0236 | 260 | 0.0157 | 0.0147 | 0.8550 | - |
| 1.0630 | 270 | 0.0141 | 0.0146 | 0.8550 | - |
| 1.1024 | 280 | 0.0127 | 0.0146 | 0.8550 | - |
| 1.1417 | 290 | 0.0163 | 0.0144 | 0.8550 | - |
| 1.1811 | 300 | 0.012 | 0.0142 | 0.8550 | - |
| 1.2205 | 310 | 0.0138 | 0.0140 | 0.8551 | - |
| 1.2598 | 320 | 0.0112 | 0.0139 | 0.8551 | - |
| 1.2992 | 330 | 0.0119 | 0.0136 | 0.8552 | - |
| 1.3386 | 340 | 0.0115 | 0.0133 | 0.8553 | - |
| 1.3780 | 350 | 0.0109 | 0.0131 | 0.8553 | - |
| 1.4173 | 360 | 0.0157 | 0.0129 | 0.8553 | - |
| 1.4567 | 370 | 0.0119 | 0.0129 | 0.8553 | - |
| 1.4961 | 380 | 0.0129 | 0.0129 | 0.8553 | - |
| 1.5354 | 390 | 0.0094 | 0.0127 | 0.8554 | - |
| 1.5748 | 400 | 0.0142 | 0.0127 | 0.8554 | - |
| 1.6142 | 410 | 0.0115 | 0.0125 | 0.8555 | - |
| 1.6535 | 420 | 0.0135 | 0.0123 | 0.8555 | - |
| 1.6929 | 430 | 0.01 | 0.0122 | 0.8556 | - |
| 1.7323 | 440 | 0.0109 | 0.0121 | 0.8556 | - |
| 1.7717 | 450 | 0.0148 | 0.0119 | 0.8557 | - |
| 1.8110 | 460 | 0.0126 | 0.0117 | 0.8558 | - |
| 1.8504 | 470 | 0.0104 | 0.0116 | 0.8558 | - |
| 1.8898 | 480 | 0.0095 | 0.0116 | 0.8559 | - |
| 1.9291 | 490 | 0.0098 | 0.0115 | 0.8558 | - |
| 1.9685 | 500 | 0.0118 | 0.0115 | 0.8558 | - |
| 2.0079 | 510 | 0.0092 | 0.0114 | 0.8558 | - |
| 2.0472 | 520 | 0.0113 | 0.0114 | 0.8558 | - |
| 2.0866 | 530 | 0.0103 | 0.0113 | 0.8558 | - |
| 2.1260 | 540 | 0.0107 | 0.0112 | 0.8558 | - |
| 2.1654 | 550 | 0.009 | 0.0111 | 0.8558 | - |
| 2.2047 | 560 | 0.0095 | 0.0110 | 0.8559 | - |
| 2.2441 | 570 | 0.0091 | 0.0110 | 0.8559 | - |
| 2.2835 | 580 | 0.008 | 0.0110 | 0.8559 | - |
| 2.3228 | 590 | 0.0108 | 0.0109 | 0.8559 | - |
| 2.3622 | 600 | 0.008 | 0.0110 | 0.8559 | - |
| 2.4016 | 610 | 0.008 | 0.0109 | 0.8559 | - |
| 2.4409 | 620 | 0.0082 | 0.0109 | 0.8560 | - |
| 2.4803 | 630 | 0.0084 | 0.0108 | 0.8560 | - |
| 2.5197 | 640 | 0.0076 | 0.0108 | 0.8560 | - |
| 2.5591 | 650 | 0.01 | 0.0107 | 0.8560 | - |
| 2.5984 | 660 | 0.0101 | 0.0107 | 0.8560 | - |
| 2.6378 | 670 | 0.0089 | 0.0107 | 0.8560 | - |
| 2.6772 | 680 | 0.01 | 0.0107 | 0.8560 | - |
| 2.7165 | 690 | 0.0097 | 0.0106 | 0.8560 | - |
| 2.7559 | 700 | 0.0092 | 0.0106 | 0.8560 | - |
| 2.7953 | 710 | 0.0085 | 0.0106 | 0.8560 | - |
| 2.8346 | 720 | 0.0119 | 0.0106 | 0.8560 | - |
| 2.8740 | 730 | 0.0096 | 0.0106 | 0.8560 | - |
| 2.9134 | 740 | 0.008 | 0.0106 | 0.8560 | - |
| 2.9528 | 750 | 0.0078 | 0.0106 | 0.8560 | - |
| 2.9921 | 760 | 0.0093 | 0.0106 | 0.856 | - |
| -1 | -1 | - | - | - | 0.8591 |
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}