Downloads · 30 days
31
4% of all-time downloads
yammdd/vietnamese-diacritic-restoration-v2
vietnamese-diacritic-restoration-v2 is a machine learning model from yammdd. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
This model is a full fine-tuned version of vinai/bartpho-syllable specifically designed for Vietnamese Diacritic Restoration.
Downloads · 30 days
31
4% of all-time downloads
All-time downloads
712
Public
Repo size
1.6 GB
Likes
0
Public
Click a slice to open those files.
.h51.6 GB · 100%
From the Hugging Face model README
This model is a full fine-tuned version of vinai/bartpho-syllable specifically designed for Vietnamese Diacritic Restoration.
The model focuses exclusively on restoring missing Vietnamese diacritics in text written without tone marks (e.g., "trang phuc" → "trang phục"). It does not handle teencode, slang, spelling mistakes, or grammatical errors beyond diacritic restoration.
vinai/bartpho-syllableKey differences from LoRA/PEFT versions:
The model takes Vietnamese text without diacritics as input and outputs text with correct tone marks restored.
Example:
from transformers import AutoTokenizer, TFAutoModelForSeq2SeqLM, pipeline
path = "yammdd/vietnamese-diacritic-restoration-v2"
tokenizer = AutoTokenizer.from_pretrained(path)
model = TFAutoModelForSeq2SeqLM.from_pretrained(path, from_pt=False)
pipe = pipeline(
task="text2text-generation",
model=model,
tokenizer=tokenizer,
framework="tf",
)
text = "hom nay toi rat vui khi hoc xu ly ngon ngu tu nhien"
out = pipe(text, max_new_tokens=256)
print(out[0]["generated_text"])
# Output: hôm nay tôi rất vui khi học xử lý ngôn ngữ tự nhiên
| Split | Samples |
|---|---|
| Train | 10,039,717 |
| Validation | 1,254,965 |
| Test | 1,254,965 |
no_diacritics → with_diacritics| Parameter | Value |
|---|---|
| Batch Size | 64 per replica (512 total) |
| Learning Rate | 2e-5 |
| Epochs | 1 |
| Max Length | 128 tokens |
| Optimizer | AdamW with linear warmup + decay |
| Warmup Steps | 10% of total steps |
| Weight Decay | 0.01 |
Evaluated on 5,000 test samples using 4-beam search with TensorFlow.
| Metric | Score | Note |
|---|---|---|
| Exact Match (Accuracy) | 82.86% | Perfect sentence restoration |
| BLEU | 95.29 | Excellent n-gram overlap |
| WER | 0.0535 | 5.35% word error rate |
| CER | 0.0433 | 4.33% character error rate |
tf_model.h5 - Full fine-tuned weightsconfig.json - Model configurationtokenizer.json - BARTpho syllable tokenizerThis model achieved state-of-the-art results for Vietnamese diacritic restoration through full fine-tuning on TPU with massive dataset scaling.