metadata
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:20554
- loss:MultipleNegativesRankingLoss
base_model: AITeamVN/Vietnamese_Embedding_v2
widget:
- source_sentence: bon
sentences:
- cây mon
- đổ chậu nước
- yên phận làm ăn
- source_sentence: Tua cáy chọt oóc khói doòng
sentences:
- chăn
- hen thở khò khè
- con gà xổng ra khỏi lồng
- source_sentence: Khảm
sentences:
- kiểm tra
- treo
- rạo rực
- source_sentence: khẩu hảo Bẩu
sentences:
- mẹ mắng không bằng bố sa sầm mặt
- cạo trọc đầu
- thóc chưa khô hẳn
- source_sentence: Các
sentences:
- mập mạp
- chân tay mập
- bắc
datasets:
- HeyDunaX/tay-vietnamese-nmt
pipeline_tag: sentence-similarity
library_name: sentence-transformers
SentenceTransformer based on AITeamVN/Vietnamese_Embedding_v2
This is a sentence-transformers model finetuned from AITeamVN/Vietnamese_Embedding_v2 on the tay-vietnamese-nmt dataset. It maps sentences & paragraphs to a 1024-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: AITeamVN/Vietnamese_Embedding_v2
- Maximum Sequence Length: 8192 tokens
- Output Dimensionality: 1024 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': 8192, 'do_lower_case': False, 'architecture': 'XLMRobertaModel'})
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)
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("HeyDunaX/Tay_Embedding")
# Run inference
sentences = [
'Các',
'bắc',
'chân tay mập',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[ 1.0000, 0.3147, -0.0254],
# [ 0.3147, 1.0000, -0.1489],
# [-0.0254, -0.1489, 1.0000]])
Training Details
Training Dataset
tay-vietnamese-nmt
- Dataset: tay-vietnamese-nmt at 2b04e13
- Size: 20,554 training samples
- Columns:
sentence1andsentence2 - Approximate statistics based on the first 1000 samples:
sentence1 sentence2 type string string details - min: 3 tokens
- mean: 6.77 tokens
- max: 21 tokens
- min: 3 tokens
- mean: 5.85 tokens
- max: 17 tokens
- Samples:
sentence1 sentence2 mebà cônoọng ấc cảiem ngực bựnoọngem gái - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim", "gather_across_devices": false }
Evaluation Dataset
tay-vietnamese-nmt
- Dataset: tay-vietnamese-nmt at 2b04e13
- Size: 2,295 evaluation samples
- Columns:
sentence1andsentence2 - Approximate statistics based on the first 1000 samples:
sentence1 sentence2 type string string details - min: 3 tokens
- mean: 7.24 tokens
- max: 26 tokens
- min: 3 tokens
- mean: 6.02 tokens
- max: 22 tokens
- Samples:
sentence1 sentence2 Hết fiệc áclàm việc khoẻslấc ácgiặc độc ácái chin mác rèo năm mạyMuốn ăn quả thì phải trồng cây - Loss:
MultipleNegativesRankingLosswith these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim", "gather_across_devices": false }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: epochgradient_accumulation_steps: 4learning_rate: 1e-05num_train_epochs: 10warmup_ratio: 0.1warmup_steps: 0.1fp16: Trueload_best_model_at_end: True
All Hyperparameters
Click to expand
do_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 8per_device_eval_batch_size: 8gradient_accumulation_steps: 4eval_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: 10max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_ratio: 0.1warmup_steps: 0.1log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Trueenable_jit_checkpoint: Falsesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseuse_cpu: Falseseed: 42data_seed: Nonebf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: -1ddp_backend: Nonedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonedisable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Nonegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Truepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_for_metrics: []eval_do_concat_batches: Trueauto_find_batch_size: Falsefull_determinism: Falseddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueuse_cache: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}
Training Logs
| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.1556 | 100 | 1.7414 | - |
| 0.3113 | 200 | 1.3566 | - |
| 0.4669 | 300 | 1.1332 | - |
| 0.6226 | 400 | 1.0198 | - |
| 0.7782 | 500 | 0.8943 | - |
| 0.9339 | 600 | 0.7909 | - |
| 1.0 | 643 | - | 0.7135 |
| 1.0887 | 700 | 0.7070 | - |
| 1.2444 | 800 | 0.6029 | - |
| 1.4 | 900 | 0.6095 | - |
| 1.5556 | 1000 | 0.5436 | - |
| 1.7113 | 1100 | 0.5534 | - |
| 1.8669 | 1200 | 0.5363 | - |
| 2.0 | 1286 | - | 0.5121 |
| 2.0218 | 1300 | 0.4886 | - |
| 2.1774 | 1400 | 0.3853 | - |
| 2.3331 | 1500 | 0.3940 | - |
| 2.4887 | 1600 | 0.3859 | - |
| 2.6444 | 1700 | 0.4035 | - |
| 2.8 | 1800 | 0.3686 | - |
| 2.9556 | 1900 | 0.3662 | - |
| 3.0 | 1929 | - | 0.4505 |
| 3.1105 | 2000 | 0.3276 | - |
| 3.2661 | 2100 | 0.2877 | - |
| 3.4218 | 2200 | 0.2991 | - |
| 3.5774 | 2300 | 0.2898 | - |
| 3.7331 | 2400 | 0.2704 | - |
| 3.8887 | 2500 | 0.2807 | - |
| 4.0 | 2572 | - | 0.4247 |
| 4.0436 | 2600 | 0.2879 | - |
| 4.1992 | 2700 | 0.2300 | - |
| 4.3549 | 2800 | 0.2233 | - |
| 4.5105 | 2900 | 0.2169 | - |
| 4.6661 | 3000 | 0.2273 | - |
| 4.8218 | 3100 | 0.2149 | - |
| 4.9774 | 3200 | 0.2277 | - |
| 5.0 | 3215 | - | 0.4163 |
| 5.1323 | 3300 | 0.1973 | - |
| 5.2879 | 3400 | 0.1856 | - |
| 5.4436 | 3500 | 0.1686 | - |
| 5.5992 | 3600 | 0.1797 | - |
| 5.7549 | 3700 | 0.1830 | - |
| 5.9105 | 3800 | 0.1701 | - |
| 6.0 | 3858 | - | 0.4066 |
| 6.0654 | 3900 | 0.1620 | - |
| 6.2210 | 4000 | 0.1453 | - |
| 6.3767 | 4100 | 0.1593 | - |
| 6.5323 | 4200 | 0.1481 | - |
| 6.6879 | 4300 | 0.1506 | - |
| 6.8436 | 4400 | 0.1534 | - |
| 6.9992 | 4500 | 0.1554 | - |
| 7.0 | 4501 | - | 0.3907 |
| 7.1541 | 4600 | 0.1284 | - |
| 7.3097 | 4700 | 0.1266 | - |
| 7.4654 | 4800 | 0.1392 | - |
| 7.6210 | 4900 | 0.1292 | - |
| 7.7767 | 5000 | 0.1309 | - |
| 7.9323 | 5100 | 0.1318 | - |
| 8.0 | 5144 | - | 0.3922 |
| 8.0872 | 5200 | 0.1263 | - |
| 8.2428 | 5300 | 0.1136 | - |
| 8.3984 | 5400 | 0.1161 | - |
| 8.5541 | 5500 | 0.1137 | - |
| 8.7097 | 5600 | 0.1231 | - |
| 8.8654 | 5700 | 0.1187 | - |
| 9.0 | 5787 | - | 0.3875 |
| 9.0202 | 5800 | 0.1182 | - |
| 9.1759 | 5900 | 0.1059 | - |
| 9.3315 | 6000 | 0.1062 | - |
| 9.4872 | 6100 | 0.1044 | - |
| 9.6428 | 6200 | 0.0992 | - |
| 9.7984 | 6300 | 0.1057 | - |
| 9.9541 | 6400 | 0.1048 | - |
| 10.0 | 6430 | - | 0.3878 |
Framework Versions
- Python: 3.12.12
- Sentence Transformers: 5.2.2
- Transformers: 5.0.0
- PyTorch: 2.9.0+cu126
- Accelerate: 1.12.0
- Datasets: 4.0.0
- Tokenizers: 0.22.2
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",
}
MultipleNegativesRankingLoss
@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}
}