yzkhant commited on
Commit
7679cfb
·
verified ·
1 Parent(s): 34e2d3f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +106 -3
README.md CHANGED
@@ -1,3 +1,106 @@
1
- ---
2
- license: cc-by-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+
4
+ datasets:
5
+ - matbahasa/TALPCo
6
+
7
+ language:
8
+ - my
9
+ - en
10
+ - ja
11
+
12
+ base_model:
13
+ - google/mt5-small
14
+
15
+ tags:
16
+ - translation
17
+ - seq2seq
18
+ - fine-tuned
19
+ - text-to-text
20
+
21
+ training_info:
22
+ optimizer: AdamW
23
+ epochs: 5
24
+ batch_size: 4
25
+ learning_rate: 1e-5
26
+ max_length: 256
27
+ ---
28
+
29
+ #ShweYi-17K-mt5-small
30
+
31
+ Fine-tuned [`google/mt5-small`](https://huggingface.co/google/mt5-small) model for multilingual translation between **English**, **Myanmar (Burmese)**, and **Japanese**, using the [TALPCo dataset](https://github.com/matbahasa/TALPCo) (CC BY 4.0).
32
+
33
+ ##Training Info
34
+
35
+ - Optimizer: AdamW
36
+ - Epochs: 5
37
+ - Batch Size: 4
38
+ - Learning Rate: 1e-5
39
+ - Max Length: 256
40
+
41
+ ##How to Use
42
+
43
+ ```python
44
+ from transformers import AutoTokenizer, MT5ForConditionalGeneration
45
+ import torch
46
+
47
+ MAX_LENGTH = 256
48
+
49
+ tokenizer = AutoTokenizer.from_pretrained("flexavior/ShweYi-17K-mt5-small", legacy=True)
50
+ model = MT5ForConditionalGeneration.from_pretrained("flexavior/ShweYi-17K-mt5-small")
51
+
52
+ if torch.cuda.is_available():
53
+ model = model.to("cuda")
54
+
55
+ print("Multilingual MT5 Translator is ready!")
56
+ print("Format: translate myn to jpn: အခု ဘယ်အချိန် ရှိပြီလဲ.")
57
+ print("Type 'exit' to quit.\n")
58
+
59
+ while True:
60
+ user_input = input(">>> ")
61
+ if user_input.strip().lower() == "exit":
62
+ break
63
+
64
+ input_ids = tokenizer(
65
+ user_input,
66
+ return_tensors="pt",
67
+ max_length=MAX_LENGTH,
68
+ padding="max_length",
69
+ truncation=True
70
+ ).input_ids
71
+
72
+ if torch.cuda.is_available():
73
+ input_ids = input_ids.to("cuda")
74
+
75
+ with torch.no_grad():
76
+ output_ids = model.generate(
77
+ input_ids=input_ids,
78
+ max_length=MAX_LENGTH,
79
+ num_beams=4,
80
+ early_stopping=True
81
+ )
82
+
83
+ output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
84
+ print(f" Translation: {output_text}\n")
85
+
86
+ #Citations
87
+ If you use ShweYi-17K-mt5-small in your research, cite:
88
+
89
+ @misc{flexavior2025shweyi17kmultilingual,
90
+ author = {Flexavior},
91
+ title = {Flexavior: shweyi-17k-multilingual-en-my-ja},
92
+ year = {2025},
93
+ url = {https://huggingface.co/flexavior/ShweYi-17K-mt5-small},
94
+ note = {Fine-tuned mT5 for English, Myanmar, and Japanese translation. Dataset: TALPCO.}
95
+ }
96
+
97
+ And the dataset source:
98
+
99
+ @article{published_papers/22434604,
100
+ title = {TUFS Asian Language Parallel Corpus (TALPCo)},
101
+ author = {Hiroki Nomoto and Kenji Okano and David Moeljadi and Hideo Sawada},
102
+ journal = {言語処理学会 第24回年次大会 発表論文集},
103
+ pages = {436--439},
104
+ year = {2018}
105
+ }
106
+