Downloads · 30 days
33
24% of all-time downloads
tintnguyen/bert-base-vietnamese-uncased-st
bert-base-vietnamese-uncased-st is a sentence similarity model from tintnguyen. 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 trituenhantaoio/bert-base-vietnamese-uncased. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity…
Downloads · 30 days
33
24% of all-time downloads
All-time downloads
137
Public
Parameters
111M
442 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors442 MB · 100%
From the Hugging Face model README
This is a sentence-transformers model finetuned from trituenhantaoio/bert-base-vietnamese-uncased. 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': 512, 'do_lower_case': False}) with Transformer model: BertModel
(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("tintnguyen/bert-base-vietnamese-uncased-st")
# Run inference
sentences = [
'tên thật của tỉnh drava banovina là gì',
'Drava Banovina ::: Drava Banovina hoặc Drava Banate (tiếng Slovenia: Dravska banovina) là một tỉnh (banovina) của Vương quốc Nam Tư từ năm 1929 đến năm 1941. Tỉnh này bao gồm hầu hết ngày nay Slovenia và được đặt tên cho Drava sông. Thành phố thủ đô của Drava Banovina là Ljubljana.',
'Mùa bão Tây Bắc Thái Bình Dương 1986 ::: Mùa bão năm 1986 ở Tây Bắc Thái Bình Dương không có giới hạn chính thức; nó chạy quanh năm vào năm 1986, nhưng hầu hết các cơn bão nhiệt đới có xu hướng hình thành ở tây bắc Thái Bình Dương giữa tháng Năm và tháng Mười Hai. Những ngày này thường phân định thời kỳ mỗi năm khi hầu hết các cơn bão nhiệt đới hình thành ở tây bắc Thái Bình Dương. Bão nhiệt đới hình thành trong toàn bộ lưu vực phía tây Thái Bình Dương đã được Trung tâm Cảnh báo Bão chung đặt tên. Áp thấp nhiệt đới xâm nhập hoặc hình thành trong khu vực trách nhiệm của Philippines được đặt tên bởi Cơ quan Dịch vụ Khí quyển, Địa vật lý và Thiên văn học Philippines hoặc PAGASA. Điều này thường có thể dẫn đến cùng một cơn bão có hai tên.',
]
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.*
-->
<!--
## 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.*
-->
| anchor | positive | |
|---|---|---|
| type | string | string |
| details | <ul><li>min: 5 tokens</li><li>mean: 12.52 tokens</li><li>max: 34 tokens</li></ul> | <ul><li>min: 25 tokens</li><li>mean: 135.09 tokens</li><li>max: 357 tokens</li></ul> |
| anchor | positive |
|---|---|
| <code>đặng văn hoàn từng giữ chức vụ nào</code> | <code>Đặng Văn Hoàn ::: Đặng Văn Hoàn là chính trị gia người Việt Nam. Ông từng giữ chức vụ Chủ tịch Ủy ban Mặt trận Tổ quốc Việt Nam tỉnh Quảng Bình.</code> |
| <code>đặng văn hoàn là người nào</code> | <code>Đặng Văn Hoàn ::: Đặng Văn Hoàn là chính trị gia người Việt Nam. Ông từng giữ chức vụ Chủ tịch Ủy ban Mặt trận Tổ quốc Việt Nam tỉnh Quảng Bình.</code> |
| <code>đặng văn hoàn là ai</code> | <code>Đặng Văn Hoàn ::: Đặng Văn Hoàn là chính trị gia người Việt Nam. Ông từng giữ chức vụ Chủ tịch Ủy ban Mặt trận Tổ quốc Việt Nam tỉnh Quảng Bình.</code> |
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
per_device_train_batch_size: 64per_device_eval_batch_size: 32learning_rate: 2e-05num_train_epochs: 2warmup_ratio: 0.1fp16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 64per_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: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 2max_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: 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: 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: Falseuse_liger_kernel: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss |
|---|---|---|
| 0.0202 | 500 | 1.2155 |
| 0.0404 | 1000 | 0.6001 |
| 0.0606 | 1500 | 0.9561 |
| 0.0809 | 2000 | 0.2795 |
| 0.1011 | 2500 | 0.2862 |
| 0.1213 | 3000 | 0.2602 |
| 0.1415 | 3500 | 0.2055 |
| 0.1617 | 4000 | 0.2193 |
| 0.1819 | 4500 | 0.173 |
| 0.2021 | 5000 | 0.206 |
| 0.2223 | 5500 | 0.2145 |
| 0.2426 | 6000 | 0.2737 |
| 0.2628 | 6500 | 0.1864 |
| 0.2830 | 7000 | 0.1821 |
| 0.3032 | 7500 | 0.2188 |
| 0.3234 | 8000 | 0.1846 |
| 0.3436 | 8500 | 0.1669 |
| 0.3638 | 9000 | 0.2594 |
| 0.3841 | 9500 | 0.2418 |
| 0.4043 | 10000 | 0.1964 |
| 0.4245 | 10500 | 0.3534 |
| 0.4447 | 11000 | 0.7956 |
| 0.4649 | 11500 | 0.6488 |
| 0.4851 | 12000 | 0.972 |
| 0.5053 | 12500 | 0.3635 |
| 0.5255 | 13000 | 0.5703 |
| 0.5458 | 13500 | 0.6628 |
| 0.5660 | 14000 | 0.5 |
| 0.5862 | 14500 | 0.958 |
| 0.6064 | 15000 | 0.9945 |
| 0.6266 | 15500 | 0.5237 |
| 0.6468 | 16000 | 0.219 |
| 0.6670 | 16500 | 0.4622 |
| 0.6873 | 17000 | 0.326 |
| 0.7075 | 17500 | 0.2906 |
| 0.7277 | 18000 | 0.2796 |
| 0.7479 | 18500 | 0.3304 |
| 0.7681 | 19000 | 0.4298 |
| 0.7883 | 19500 | 0.3333 |
| 0.8085 | 20000 | 0.3124 |
| 0.8288 | 20500 | 0.2577 |
| 0.8490 | 21000 | 0.2741 |
| 0.8692 | 21500 | 0.3273 |
| 0.8894 | 22000 | 0.1356 |
| 0.9096 | 22500 | 0.0933 |
| 0.9298 | 23000 | 0.08 |
| 0.9500 | 23500 | 0.0767 |
| 0.9702 | 24000 | 0.0702 |
| 0.9905 | 24500 | 0.0661 |
| 1.0107 | 25000 | 0.12 |
| 1.0309 | 25500 | 0.1606 |
| 1.0511 | 26000 | 0.6142 |
| 1.0713 | 26500 | 0.4077 |
| 1.0915 | 27000 | 0.1482 |
| 1.1117 | 27500 | 0.1601 |
| 1.1320 | 28000 | 0.1061 |
| 1.1522 | 28500 | 0.1095 |
| 1.1724 | 29000 | 0.1006 |
| 1.1926 | 29500 | 0.1138 |
| 1.2128 | 30000 | 0.097 |
| 1.2330 | 30500 | 0.0993 |
| 1.2532 | 31000 | 0.166 |
| 1.2734 | 31500 | 0.0771 |
| 1.2937 | 32000 | 0.1411 |
| 1.3139 | 32500 | 0.0784 |
| 1.3341 | 33000 | 0.0963 |
| 1.3543 | 33500 | 0.0894 |
| 1.3745 | 34000 | 0.1603 |
| 1.3947 | 34500 | 0.0911 |
| 1.4149 | 35000 | 0.1813 |
| 1.4352 | 35500 | 0.3146 |
| 1.4554 | 36000 | 0.9285 |
| 1.4756 | 36500 | 0.6265 |
| 1.4958 | 37000 | 0.5264 |
| 1.5160 | 37500 | 0.3998 |
| 1.5362 | 38000 | 0.7266 |
| 1.5564 | 38500 | 0.2629 |
| 1.5766 | 39000 | 0.9727 |
| 1.5969 | 39500 | 0.5213 |
| 1.6171 | 40000 | 0.9327 |
| 1.6373 | 40500 | 0.1096 |
| 1.6575 | 41000 | 0.2035 |
| 1.6777 | 41500 | 0.3639 |
| 1.6979 | 42000 | 0.2284 |
| 1.7181 | 42500 | 0.1631 |
| 1.7384 | 43000 | 0.1688 |
| 1.7586 | 43500 | 0.3155 |
| 1.7788 | 44000 | 0.2943 |
| 1.7990 | 44500 | 0.253 |
| 1.8192 | 45000 | 0.1851 |
| 1.8394 | 45500 | 0.1784 |
| 1.8596 | 46000 | 0.2623 |
| 1.8799 | 46500 | 0.1054 |
| 1.9001 | 47000 | 0.0491 |
| 1.9203 | 47500 | 0.0445 |
| 1.9405 | 48000 | 0.0418 |
| 1.9607 | 48500 | 0.0399 |
| 1.9809 | 49000 | 0.0396 |
@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",
}
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
<!--
## 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.*
-->