Downloads · 30 days
0
Minggz/Lao-Vi-Translation
Lao-Vi-Translation is a translation model from Minggz. Use it when you need text moved from one language to another. The card lists the license as mit.
Vietnamese-Lao and Lao-Vietnamese Translation models.
Downloads · 30 days
0
Access
Public
Updated Apr 26, 2023
Repo size
497 MB
Likes
0
Public
Click a slice to open those files.
.bin494 MB · 99%
From the Hugging Face model README
Vietnamese-Lao and Lao-Vietnamese Translation models.
text = "ສະບາຍດີ, ຂ້ອຍເປັນວິສະວະກອນ NLP"
laovi_model_dir = 'laovi_ctranslate2'
#viru_model_dir = 'viru_ctranslate2'
lao_tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = 'laovi_ctranslate2/source.model')
vi_tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = 'laovi_ctranslate2/target.model')
tokenized=lao_tokenizer.tokenize(text)
translator = ctranslate2.Translator(laovi_model_dir)
translated = translator.translate_batch([tokenized[0]])
print(vi_tokenizer.detokenize(translated[0][0]['tokens']))