CoolFace
Modelpublic

yahyaabd/allstats-semantic-search-model-v1-3

sourceHugging Faceupdated 2y agoView on Hugging Face
3likes106downloads
Model Card

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-semantic-search-synthetic-dataset-v1 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 Sources

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:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("yahyaabd/allstats-semantic-search-model-v1-3")
# Run inference
sentences = [
    'perubahan nilai tukar petani bulan mei 2017',
    'Perkembangan Nilai Tukar Petani Mei 2017',
    'Statistik Restoran/Rumah Makan Tahun 2014',
]
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. -->

Evaluation

Metrics

Semantic Similarity
Metricallstats-semantic-search-v1-3-devallstat-semantic-search-v1-3-test
pearson_cosine0.99590.9961
spearman_cosine0.96410.9648

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

allstats-semantic-search-synthetic-dataset-v1
  • Dataset: allstats-semantic-search-synthetic-dataset-v1 at b13c0a7
  • Size: 212,940 training samples
  • Columns: <code>query</code>, <code>doc</code>, and <code>label</code>
  • Approximate statistics based on the first 1000 samples: | | query | doc | label | |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 5 tokens</li><li>mean: 11.46 tokens</li><li>max: 34 tokens</li></ul> | <ul><li>min: 5 tokens</li><li>mean: 14.47 tokens</li><li>max: 54 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.5</li><li>max: 1.05</li></ul> |
  • Samples: | query | doc | label | |:---------------------------------------------------------------|:-----------------------------------------------------------------------|:------------------| | <code>aDta industri besar dan sedang Indonesia 2008</code> | <code>Statistik Industri Besar dan Sedang Indonesia 2008</code> | <code>0.9</code> | | <code>profil bisnis konstruksi individu jawa barat 2022</code> | <code>Statistik Industri Manufaktur Indonesia 2015 - Bahan Baku</code> | <code>0.15</code> | | <code>data statistik ekonomi indonesia</code> | <code>Nilai Tukar Valuta Asing di Indonesia 2014</code> | <code>0.08</code> |
  • Loss: <code>CosineSimilarityLoss</code> with these parameters:
json
  {
      "loss_fct": "torch.nn.modules.loss.MSELoss"
  }

Evaluation Dataset

allstats-semantic-search-synthetic-dataset-v1
  • Dataset: allstats-semantic-search-synthetic-dataset-v1 at b13c0a7
  • Size: 26,618 evaluation samples
  • Columns: <code>query</code>, <code>doc</code>, and <code>label</code>
  • Approximate statistics based on the first 1000 samples: | | query | doc | label | |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 5 tokens</li><li>mean: 11.38 tokens</li><li>max: 34 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 14.63 tokens</li><li>max: 55 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.51</li><li>max: 1.0</li></ul> |
  • Samples: | query | doc | label | |:-------------------------------------------------------------------|:---------------------------------------------------------------------------|:------------------| | <code>tahun berapa ekspor naik 2,37% dan impor naik 30,30%?</code> | <code>Bulan November 2006 Ekspor Naik 2,37 % dan Impor Naik 30,30 %</code> | <code>1.0</code> | | <code>Berapa produksi padi pada tahun 2023?</code> | <code>Produksi padi tahun lainnya</code> | <code>0.0</code> | | <code>data statistik solus per aqua 2015</code> | <code>Statistik Solus Per Aqua (SPA) 2015</code> | <code>0.97</code> |
  • Loss: <code>CosineSimilarityLoss</code> with these parameters:
json
  {
      "loss_fct": "torch.nn.modules.loss.MSELoss"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • eval_strategy: steps
  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 64
  • num_train_epochs: 16
  • warmup_ratio: 0.1
  • fp16: True
All Hyperparameters

<details><summary>Click to expand</summary>

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 64
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 16
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining LossValidation Lossallstats-semantic-search-v1-3-dev_spearman_cosineallstat-semantic-search-v1-3-test_spearman_cosine
0.15025000.05790.03510.7132-
0.300510000.030.02250.7589-
0.450715000.02190.01850.7834-
0.601020000.01810.01630.7946-
0.751225000.01620.01470.7941-
0.901430000.0150.01470.8050-
1.051735000.0140.01310.7946-
1.201940000.01190.01260.8038-
1.352245000.01210.01280.8213-
1.502450000.01170.01160.8268-
1.652655000.01240.01170.8269-
1.802960000.01110.01090.8421-
1.953165000.01050.01080.8278-
2.103470000.00910.00930.8460-
2.253675000.00850.00910.8469-
2.403880000.00790.00830.8595-
2.554185000.00750.00850.8495-
2.704390000.00730.00820.8614-
2.854695000.00680.00770.8696-
3.0048100000.00660.00760.8669-
3.1550105000.00580.00720.8678-
3.3053110000.00560.00670.8703-
3.4555115000.00540.00670.8766-
3.6058120000.00540.00630.8678-
3.7560125000.00510.00610.8786-
3.9062130000.00520.00770.8699-
4.0565135000.0050.00550.8859-
4.2067140000.00410.00540.8900-
4.3570145000.00380.00520.8892-
4.5072150000.00390.00500.8895-
4.6575155000.0040.00520.8972-
4.8077160000.00420.00510.8927-
4.9579165000.00410.00520.8930-
5.1082170000.00340.00530.8998-
5.2584175000.0030.00470.9023-
5.4087180000.00320.00450.9039-
5.5589185000.00320.00440.8996-
5.7091190000.00320.00410.9085-
5.8594195000.00320.00470.9072-
6.0096200000.00290.00370.9104-
6.1599205000.00240.00370.9112-
6.3101210000.00260.00390.9112-
6.4603215000.00240.00370.9157-
6.6106220000.00220.00380.9122-
6.7608225000.00250.00340.9170-
6.9111230000.00230.00340.9179-
7.0613235000.0020.00310.9244-
7.2115240000.00190.00300.9250-
7.3618245000.00180.00320.9249-
7.5120250000.00220.00310.9162-
7.6623255000.00190.00300.9266-
7.8125260000.00190.00280.9297-
7.9627265000.00180.00280.9282-
8.1130270000.00150.00250.9324-
8.2632275000.00140.00270.9337-
8.4135280000.00150.00270.9327-
8.5637285000.00160.00270.9313-
8.7139290000.00160.00270.9333-
8.8642295000.00150.00250.9382-
9.0144300000.00140.00250.9375-
9.1647305000.00110.00240.9398-
9.3149310000.00120.00250.9384-
9.4651315000.00140.00250.9383-
9.6154320000.00130.00230.9410-
9.7656325000.00110.00230.9409-
9.9159330000.00120.00210.9432-
10.0661335000.00110.00210.9432-
10.2163340000.0010.00210.9442-
10.3666345000.00090.00220.9436-
10.5168350000.0010.00210.9468-
10.6671355000.0010.00200.9471-
10.8173360000.0010.00210.9467-
10.9675365000.00110.00210.9478-
11.1178370000.00080.00200.9493-
11.2680375000.00080.00190.9509-
11.4183380000.00080.00190.9504-
11.5685385000.00080.00190.9512-
11.7188390000.00080.00190.9516-
11.8690395000.00070.00190.9534-
12.0192400000.00070.00180.9539-
12.1695405000.00060.00180.9555-
12.3197410000.00060.00190.9551-
12.4700415000.00070.00190.9550-
12.6202420000.00080.00180.9552-
12.7704425000.00060.00170.9559-
12.9207430000.00060.00170.9568-
13.0709435000.00060.00170.9577-
13.2212440000.00050.00170.9581-
13.3714445000.00060.00170.9586-
13.5216450000.00050.00170.9587-
13.6719455000.00050.00170.9591-
13.8221460000.00060.00160.9600-
13.9724465000.00050.00160.9603-
14.1226470000.00050.00160.9609-
14.2728475000.00050.00160.9612-
14.4231480000.00050.00160.9611-
14.5733485000.00050.00160.9616-
14.7236490000.00040.00150.9625-
14.8738495000.00040.00160.9628-
15.0240500000.00040.00160.9631-
15.1743505000.00040.00160.9632-
15.3245510000.00040.00160.9633-
15.4748515000.00040.00160.9635-
15.625520000.00040.00150.9638-
15.7752525000.00040.00150.9640-
15.9255530000.00040.00150.9641-
16.053248---0.9648

</details>

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.3.1
  • Transformers: 4.47.1
  • PyTorch: 2.2.2+cu121
  • Accelerate: 1.2.1
  • Datasets: 3.2.0
  • Tokenizers: 0.21.0

Citation

BibTeX

Sentence Transformers
bibtex
@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. -->