File size: 784 Bytes
231afa2 24b1847 231afa2 24b1847 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
---
license: mit
language:
- lao
- vi
metrics:
- bleu
pipeline_tag: translation
---
## LaoVi-Translation
Vietnamese-Lao and Lao-Vietnamese Translation models.
- **Developed by:** Minggz
## How to Use
```python
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']))
|