|
|
--- |
|
|
license: apache-2.0 |
|
|
datasets: |
|
|
- Ko-Yin-Maung/Eng2Mm-Translation |
|
|
language: |
|
|
- en |
|
|
- my |
|
|
base_model: |
|
|
- Helsinki-NLP/opus-mt-tc-bible-big-mul-mul |
|
|
pipeline_tag: translation |
|
|
library_name: transformers |
|
|
tags: |
|
|
- Machine-Translation |
|
|
- Text-Generation |
|
|
- Text-to-Text |
|
|
--- |
|
|
|
|
|
# 👨💻 English to Myanmar Translation Model |
|
|
|
|
|
- အင်္ဂလိပ် ဘာသာစကားမှ မြန်မာ ဘာသာစကားသို့ ဘာသာပြန်ဆိုပေးနိုင်သော LLM based model တစ်ခု ဖြစ်ပါတယ်။ |
|
|
- Opus MT ကို custom dataset ဖြစ် tuning လုပ်ယူထားတာ ဖြစ်ပါတယ်။ |
|
|
- Total parameter 249M ရှိပါတယ်။ |
|
|
- Finetuning ကို Batch size = 16 နဲ့ Epochs = 50 ထိ သုံးထားပါတယ်။ |
|
|
|
|
|
## Reference |
|
|
* [Based Model](https://huggingface.co/Helsinki-NLP/opus-mt-tc-bible-big-mul-mul) |
|
|
* [Dataset](https://huggingface.co/datasets/Ko-Yin-Maung/mig-english-myanmar-translation) |
|
|
|
|
|
## Inference |
|
|
```python |
|
|
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM |
|
|
|
|
|
## load our model |
|
|
model_name = "Ko-Yin-Maung/mig-mt-2.5b-eng-mya" |
|
|
model = AutoModelForSeq2SeqLM.from_pretrained(model_name) |
|
|
tokenizer = AutoTokenizer.from_pretrained(model_name) |
|
|
|
|
|
## Get the total number of parameters |
|
|
total_params = sum(p.numel() for p in model.parameters()) |
|
|
print(f"Total number of parameters: {total_params}") |
|
|
``` |
|
|
output |
|
|
```console |
|
|
Total number of parameters: 249793536 |
|
|
``` |
|
|
|
|
|
## Usage 1 |
|
|
```python |
|
|
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM |
|
|
|
|
|
model_name = "Ko-Yin-Maung/mig-mt-2.5b-eng-mya" |
|
|
model = AutoModelForSeq2SeqLM.from_pretrained(model_name) |
|
|
tokenizer = AutoTokenizer.from_pretrained(model_name) |
|
|
|
|
|
input_text = "Make up your own mind. It is fine by me if you want to do it." |
|
|
inputs = tokenizer(input_text, return_tensors="pt") |
|
|
outputs = model.generate(**inputs) |
|
|
translated_text = tokenizer.decode(outputs[0], skip_special_tokens=True) |
|
|
print(translated_text) |
|
|
``` |
|
|
output |
|
|
```console |
|
|
ကိုယ့်ဟာကိုယ် ဆုံးဖြတ်ပါ။ အဆင်ပြေပါတယ် ၊ ခင်ဗျား လုပ်ချင်တယ်ဆိုရင် အဆင်ပြေပါတယ် ။ |
|
|
``` |
|
|
|
|
|
## Usage 2 |
|
|
```python |
|
|
from transformers import pipeline |
|
|
pipe = pipeline("translation", model="Ko-Yin-Maung/mig-mt-2.5b-eng-mya") |
|
|
print(pipe(">>mya<< Would you please ask him to call me tomorrow?")[0]) |
|
|
``` |
|
|
output |
|
|
```console |
|
|
ကျွန်တော့် ဆီ မနက်ဖြန် ဖုန်းဆက်ဖို့ သူ့ကို ပြောပေးနိုင်မလား ။ |
|
|
``` |
|
|
|
|
|
လွတ်လပ်စွာ ကူးယူ လေ့လာခွင့် ရှိသည်။ |
|
|
|
|
|
(လေ့လာခြင်းဖြင့် ကျွန်ုပ်တို့၏ မနက်ဖြန်များကို ဖြတ်သန်းကြပါစို့..။) |
|
|
|
|
|
@Created by Myanmar Innovative Group (MIG) |
|
|
|
|
|
|
|
|
|