This model is an encoder–decoder Transformer designed for text-to-text generation tasks such as translation.
It is fine-tuned from VietAI/vit5-base, a pretrained multilingual T5 variant optimized for Vietnamese NLP tasks.
In addition to real bilingual corpora, this model was also trained using a synthetic English–Vietnamese dataset created to improve translation robustness and domain diversity.
Synthetic data was generated using a large language model (LLM) through a multi-step workflow:
-
Prompting a large LLM (e.g., GPT or Qwen) to generate bilingual sentence pairs with:
- correct semantic alignment
- natural fluency in both languages
- diverse sentence structures
- a variety of writing styles (formal, casual, conversational, instructional)
-
Filtering and Cleaning
- removed low-quality or incomplete generations
- removed hallucinated or irrelevant translations
- used automatic scoring (LLM-based + heuristic rules) to ensure source–target consistency
- deduplicated repeated patterns
-
Formatting
- normalized Unicode
- standardized punctuation
- removed extremely short or extremely long sentences
- converted examples into a clean parallel translation format compatible with Seq2Seq training
Users should manually review the translations when used in professional, safety-critical, or high-importance scenarios.
1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3model_name = "tnguyen20604/vit5-translation-vi2en-v1.1"
4tokenizer = AutoTokenizer.from_pretrained(model_name)
5model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
6
7text = "Tôi yêu học máy."
8inputs = tokenizer(text, return_tensors="pt")
9outputs = model.generate(**inputs)
10
11print(tokenizer.decode(outputs[0], skip_special_tokens=True))