Translation
Transformers
Safetensors
Vietnamese
mbart
text2text-generation
dialect-normalization
vietnamese-dialect
social-media
low-resource
Run this model with HF Jobs
Run Biu3010/dialect-normalizer on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Biu3010/dialect-normalizer. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Biu3010/dialect-normalizer on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Biu3010/dialect-normalizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Biu3010/dialect-normalizer with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("translation", model="Biu3010/dialect-normalizer")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Biu3010/dialect-normalizer") model = AutoModelForSeq2SeqLM.from_pretrained("Biu3010/dialect-normalizer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384---license: cc-by-nc-4.0language:- vipipeline_tag: translationtags:- dialect-normalization- vietnamese-dialect- mbart- social-media- low-resourcedatasets:- Biu3010/ViDia2Stdbase_model: facebook/mbart-large-50library_name: transformers---
# mBART-ViDia2Std
<p align="center"> <a href="https://huggingface.co/datasets/Biu3010/ViDia2Std">ViDia2Std Dataset</a> | <a href="https://ojs.aaai.org/index.php/AAAI/article/view/40247">AAAI-26 Paper</a></p>
This is a version of [mBART-large-50](https://huggingface.co/facebook/mbart-large-50) fine-tuned on the entire [ViDia2Std](https://huggingface.co/datasets/Biu3010/ViDia2Std) corpus (13,657 pairs, all 63 Vietnamese provinces) plus data augmentation, to translate Vietnamese dialects and non-standard social media text into standard Vietnamese. It is released as the strongest version for real-world use, e.g. as a preprocessing step for downstream Vietnamese NLP tasks.
> **Warning — data leakage.** This model was trained on **all splits of ViDia2Std, including `test`**. Do not use it as a baseline on the ViDia2Std test set; to reproduce the paper's baselines, train on the `train` split only.
## Usage
```pythonimport torchfrom transformers import AutoTokenizer, AutoModelForSeq2SeqLM
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_path = "Biu3010/dialect-normalizer"tokenizer = AutoTokenizer.from_pretrained(model_path)model = AutoModelForSeq2SeqLM.from_pretrained(model_path).to(device)
def normalize_text(text): inputs = tokenizer(text, return_tensors="pt", max_length=128, truncation=True) input_ids = inputs.input_ids.to(device) attention_mask = inputs.attention_mask.to(device)
with torch.no_grad(): outputs = model.generate( input_ids=input_ids, attention_mask=attention_mask, max_length=128, num_beams=3, early_stopping=True, )
return tokenizer.decode(outputs[0], skip_special_tokens=True)
dialect_text = "răng mà bựa ni trời nắng rứa hề"print(f"Dialect : {dialect_text}")print(f"Standard: {normalize_text(dialect_text)}")# Expected output: "sao mà hôm nay trời nắng thế nhỉ"```
If you encounter language-token issues, set `tokenizer.src_lang = "vi_VN"` and pass `forced_bos_token_id=tokenizer.lang_code_to_id["vi_VN"]` to `model.generate()`.
## Reference results
The paper's mBART-large-50 baseline (trained on the `train` split only) achieves **BLEU 0.8166 · ROUGE-L 0.9384 · METEOR 0.8925** on ViDia2Std. This full-corpus model cannot be legitimately evaluated on that test set.
## Citation
```bibtex@article{Anh_Ta_Van_Dinh_Nguyen_2026, title = {ViDia2Std: A Parallel Corpus and Methods for Low-Resource Vietnamese Dialect-to-Standard Translation}, author = {Anh Ta, Khoa and Van Dinh, Nguyen and Nguyen, Kiet Van}, journal = {Proceedings of the AAAI Conference on Artificial Intelligence}, volume = {40}, number = {36}, pages = {29995--30004}, year = {2026}, month = {Mar.}, url = {https://ojs.aaai.org/index.php/AAAI/article/view/40247}, doi = {10.1609/aaai.v40i36.40247}}```README.mdAdded+84