Machine translation for ancient Vietnamese
How to use
from transformers import T5ForConditionalGeneration, T5Tokenizer
model = T5ForConditionalGeneration.from_pretrained("huyg1108/t5-ancient_vie-eng-base")
tokenizer = T5Tokenizer.from_pretrained("huyg1108/t5-ancient_vie-eng-base", legacy=False)
model.eval()
src = "Đạo chi vi vật, duy hoảng duy hốt."
tokenized_text = tokenizer.encode(src, return_tensors="pt")
summary_ids = model.generate(
tokenized_text,
max_length=64,
num_beams=7,
repetition_penalty=2.5,
length_penalty=1.0,
early_stopping=True
)
output = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
output
The Way governs things, only they are alarmed and sudden.
- Downloads last month
- 47
Model tree for huyg1108/t5-ancient_vie-eng-base
Base model
NlpHUST/t5-vi-en-base