Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,34 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
language:
|
4 |
-
-
|
5 |
- vi
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
language:
|
4 |
+
- lao
|
5 |
- vi
|
6 |
+
metrics:
|
7 |
+
- bleu
|
8 |
+
pipeline_tag: translation
|
9 |
+
---
|
10 |
+
|
11 |
+
## LaoVi-Translation
|
12 |
+
|
13 |
+
Vietnamese-Lao and Lao-Vietnamese Translation models.
|
14 |
+
|
15 |
+
- **Developed by:** Minggz
|
16 |
+
|
17 |
+
|
18 |
+
## How to Use
|
19 |
+
```python
|
20 |
+
|
21 |
+
text = "ສະບາຍດີ, ຂ້ອຍເປັນວິສະວະກອນ NLP"
|
22 |
+
laovi_model_dir = 'laovi_ctranslate2'
|
23 |
+
#viru_model_dir = 'viru_ctranslate2'
|
24 |
+
|
25 |
+
lao_tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = 'laovi_ctranslate2/source.model')
|
26 |
+
vi_tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = 'laovi_ctranslate2/target.model')
|
27 |
+
|
28 |
+
tokenized=lao_tokenizer.tokenize(text)
|
29 |
+
|
30 |
+
translator = ctranslate2.Translator(laovi_model_dir)
|
31 |
+
translated = translator.translate_batch([tokenized[0]])
|
32 |
+
print(vi_tokenizer.detokenize(translated[0][0]['tokens']))
|
33 |
+
|
34 |
+
|