Downloads · 30 days
109
9% of all-time downloads
CLAck/vi-en
vi-en is a translation model from CLAck. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as apache-2.0.
This is a finetuning of a MarianMT pretrained on Chinese-English. The target language pair is Vietnamese-English.
Downloads · 30 days
109
9% of all-time downloads
All-time downloads
1.2K
Public
Repo size
658 MB
Likes
1
Public
Click a slice to open those files.
.bin329 MB · 99%
From the Hugging Face model README
This is a finetuning of a MarianMT pretrained on Chinese-English. The target language pair is Vietnamese-English.
%%capture
!pip install transformers transformers[sentencepiece]
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
# Download the pretrained model for English-Vietnamese available on the hub
model = AutoModelForSeq2SeqLM.from_pretrained("CLAck/vi-en")
tokenizer = AutoTokenizer.from_pretrained("CLAck/vi-en")
sentence = your_vietnamese_sentence
# This token is needed to identify the source language
input_sentence = "<2vi> " + sentence
translated = model.generate(**tokenizer(input_sentence, return_tensors="pt", padding=True))
output_sentence = [tokenizer.decode(t, skip_special_tokens=True) for t in translated]
| Epoch | Bleu |
|---|---|
| 1.0 | 21.3180 |
| 2.0 | 26.8012 |
| 3.0 | 29.3578 |
| 4.0 | 31.5178 |
| 5.0 | 32.8740 |