RuVi-Translation
Vietnamese-Russian and Russian-Vietnamese Translation models.
- Developed by: Minggz
How to Use
import ctranslate2
import pyonmttok
text = "Всем привет, я NLP-инженер"
ruvi_model_dir = 'ruvi_ctranslate2'
#viru_model_dir = 'viru_ctranslate2'
ru_tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = 'ru_spm.model')
vi_tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = 'vi_spm.model')
tokenized=ru_tokenizer.tokenize(text)
translator = ctranslate2.Translator(ruvi_model_dir)
translated = translator.translate_batch([tokenized[0]])
print(vi_tokenizer.detokenize(translated[0][0]['tokens']))