kalixlouiis commited on
Commit
afcaac7
·
verified ·
1 Parent(s): d2d25cd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +151 -3
README.md CHANGED
@@ -1,10 +1,158 @@
1
  ---
2
- license: apache-2.0
3
  language:
4
  - my
5
  - en
6
  - pi
7
- pipeline_tag: token-classification
8
  tags:
9
  - tokenizer
10
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  language:
3
  - my
4
  - en
5
  - pi
 
6
  tags:
7
  - tokenizer
8
+ - sentencepiece
9
+ - unigram
10
+ - myanmar
11
+ - burmese
12
+ - nlp
13
+ license: apache-2.0
14
+ datasets:
15
+ - kalixlouiis/HFcourse-english-burmese-parallel-corpus
16
+ - kalixlouiis/Myanmar-English-general-text-translation
17
+ - kalixlouiis/myanmar-written-spoken-text-pairs
18
+ - kalixlouiis/myanmar-linguistic-ambiguitie-001
19
+ - kalixlouiis/general-burmese-sentences
20
+ - DatarrX/Burmese-English-Code-Mixed-Corpus
21
+ - DatarrX/tipitaka-dataset
22
+ - agentlans/high-quality-english-sentences
23
+ - DatarrX/myX-Burmese-Morpho-Synthetic
24
+ library_name: sentencepiece
25
+ pipeline_tag: feature-extraction
26
+ ---
27
+
28
+ # myX-Tokenizer: A Specialized Unigram Tokenizer for Myanmar NLP
29
+
30
+ **myX-Tokenizer** is a high-efficiency tokenizer specifically engineered for the Burmese (Myanmar) language, with extended support for English and Pali. It is designed to overcome the "fertility" issues common in multilingual tokenizers (like mBERT and XLM-R), where Burmese text is often over-fragmented into nearly character-level subwords.
31
+
32
+ Developed by **Khant Sint Heinn (Kalix Louis)** and released under **DatarrX**, this tokenizer provides a balanced representation of the Burmese language, optimized for modern Large Language Models (LLMs) and Embedding models.
33
+
34
+ ## Technical Specifications
35
+
36
+ - **Algorithm**: Unigram (SentencePiece)
37
+ - **Vocabulary Size**: 128,000
38
+ - **Normalization**: NMT NFKC Case-Folding (`nmt_nfkc_cf`)
39
+ - **Byte Fallback**: Enabled (to prevent Unknown `<unk>` tokens)
40
+ - **Split Digits**: False (Treats numbers as atomic units or logical groups)
41
+ - **Special Tokens**: Includes 20+ specialized control tokens for ChatML, RAG, Tool Use, and Reasoning.
42
+
43
+ ## Data Composition & Focus
44
+
45
+ The tokenizer was trained on a massive 40M+ line corpus with a strategic weight distribution to ensure cross-domain robustness:
46
+
47
+ | Language/Domain | Percentage | Sources |
48
+ | :--- | :--- | :--- |
49
+ | **Burmese (General)** | ~70% | Wikipedia, News (BBC Burmese), Literature, Written/Spoken Text |
50
+ | **English** | ~20% | High-quality English general sentences |
51
+ | **Pali** | ~10% | Tipitaka Dataset (Religious and Historical texts) |
52
+
53
+ ### Training Nuances
54
+ While the model is highly capable in Unicode formal and informal Burmese, users should note:
55
+ - **Modern Slang/Non-standard Spelling**: Quality may decrease for highly colloquial internet slang or intentional misspellings.
56
+ - **Encoding Issues**: Specifically optimized for Unicode. Performance on Zawgyi-encoded text or texts with severe Unicode sequence errors may be suboptimal.
57
+
58
+ ## Efficiency Benchmark
59
+
60
+ The primary goal of **myX-Tokenizer** is to optimize the "Token-to-Character" ratio for Myanmar NLP. By reducing the **Fertility Rate**, the model can process significantly more semantic information within the same context window compared to general multilingual tokenizers.
61
+
62
+ ### Quantitative Evaluation
63
+ To ensure an unbiased evaluation, we benchmarked the tokenizers using the **jojo-ai-mst/Myanmar-Agricutlure-1K** dataset (specifically the "Output" column with 1,053 rows). **Note:** This dataset was held out during the training phase of myX-Tokenizer to serve as a clean test set.
64
+
65
+ ![Efficiency Benchmark](https://huggingface.co/DatarrX/myX-Tokenizer/blob/main/benchmark.png)
66
+
67
+ | Tokenizer | Avg Tokens per Sentence | Efficiency Score (Fertility) |
68
+ | :--- | :---: | :---: |
69
+ | **myX-Tokenizer** | **34.2** | **Most Efficient** |
70
+ | XLM-R | 64.05 | - |
71
+ | mBERT | 109.59 | - |
72
+
73
+ ---
74
+
75
+ ### Qualitative Comparison: Segmentation Showcase
76
+ The following example demonstrates how each model segments a complex Burmese sentence. While multilingual models struggle with Burmese character boundaries, **myX-Tokenizer** preserves morphological and semantic integrity.
77
+
78
+ **Test Sentence:**
79
+ > "လူမျိုးတစ်မျိုး၏ စာပေယဉ်ကျေးမှု တိမ်ကောပျောက်ကွယ်ခြင်းသည် ထိုလူမျိုး ကမ္ဘာ့မြေပုံပေါ်မှ ပျောက်ကွယ်သွားခြင်းပင် ဖြစ်သည်။"
80
+
81
+ * **myX-Tokenizer** (17 tokens):
82
+ `['▁လူမျိုး', 'တစ်မျိုး', '၏', '▁စာပေ', 'ယဉ်ကျေးမှု', '▁တိမ်ကော', 'ပျောက်ကွယ်', 'ခြင်းသည်', '▁ထို', 'လူမျိုး', '▁ကမ္ဘာ့', 'မြေပုံ', 'ပေါ်မှ', '▁ပျောက်ကွယ်', 'သွားခြင်း', 'ပင်', '▁ဖြစ်သည်။']`
83
+ *(Observation: Highly semantic and readable units.)*
84
+
85
+ * **XLM-R** (36 tokens):
86
+ `['▁', 'လူမျိုး', 'တစ်', 'မျိုး', '၏', '▁စာ', 'ပေ', 'ယ', 'ဉ', '်', 'ကျ', 'ေး', 'မှု', '▁', 'တိ', 'မ်', 'ကော', 'ပျောက်', 'ကွယ်', 'ခြင်း', 'သည်', '▁ထို', 'လူမျိုး', '▁ကမ္ဘာ့', 'မြေ', 'ပုံ', 'ပေါ်', 'မှ', '▁', 'ပျောက်', 'ကွယ်', 'သွား', 'ခြင်း', 'ပင်', '▁', 'ဖြစ်သည်။']`
87
+ *(Observation: Excessive fragmentation of simple words like 'ယဉ်ကျေးမှု'.)*
88
+
89
+ * **mBERT** (68 tokens):
90
+ `['လ', '##ူ', '##မ', '##ျိုး', '##တ', '##စ်', '##မ', '##ျိုး', '၏', 'စ', '##ာ', '##ပ', '##ေ', '##ယ', '##ဉ', '##်', '##က', '##ျ', '##ေး', '##မှု', 'တ', '##ိ', '##မ', '##်', '##က', '##ော', '##ပ', '##ျ', '##ောက်', '##က', '##ွ', '##ယ်', '##ခြင်း', '##သည်', 'ထ', '##ို', '##လ', '##ူ', '##မ', '##ျိုး', 'က', '##မ', '##္', '##ဘ', '##ာ', '##့', '##မ', '##ြ', '##ေ', '##ပ', '##ုံ', '##ပ', '##ေါ်', '##မှ', 'ပ', '##ျ', '##ောက်', '##က', '##ွ', '##ယ်', '##သ', '##ွ', '##ား', '##ခြင်း', '##ပ', '##င်', 'ဖြစ်သည်', '။']`
91
+ *(Observation: Severe over-fragmentation; almost character-level, leading to high computational cost and loss of context.)*
92
+
93
+ ## Usage
94
+
95
+ For the best results in your Myanmar NLP projects, we recommend using the `tokenizer.model` file directly with the `sentencepiece` library.
96
+
97
+ ### Python (SentencePiece)
98
+ ```python
99
+ import sentencepiece as spm
100
+
101
+ # Load the model
102
+ sp = spm.SentencePieceProcessor(model_file='tokenizer.model')
103
+
104
+ # Encode
105
+ text = "မြန်မာနိုင်ငံ၏ သတင်းထူးများ နှင့် Artificial Intelligence နည်းပညာ"
106
+ tokens = sp.encode_as_pieces(text)
107
+ ids = sp.encode_as_ids(text)
108
+
109
+ print(f"Tokens: {tokens}")
110
+ print(f"IDs: {ids}")
111
+ ```
112
+
113
+ ### Integrated Special Tokens
114
+ The tokenizer includes pre-defined IDs for modern AI workflows:
115
+ - **Chat**: `<|im_start|>`, `<|im_end|>`, `<|system|>`, `<|user|>`, `<|assistant|>`
116
+ - **Reasoning**: `<|thought|>`, `<|reflection|>`
117
+ - **RAG/Tools**: `<|context_start|>`, `<|tool_call|>`, `<|tool_response|>`
118
+
119
+ ## Quality Report (BBC News Benchmark)
120
+
121
+ | Metric | Ultra Result |
122
+ | :--- | :--- |
123
+ | Total Characters | 40,000,000+ |
124
+ | Density (Chars/Token) | ~2.5 - 3.1 |
125
+ | Vocab Coverage (%) | 100% (Byte Fallback active) |
126
+
127
+ ## Development & Distribution
128
+ * **Developed by:** [Khant Sint Heinn (Kalix Louis)](https://huggingface.co/kalixlouiis)
129
+ * **Published by:** [DatarrX (Myanmar Open Source NGO)](https://huggingface.co/DatarrX)
130
+ - **License**: Apache License 2.0
131
+
132
+ ## Citation
133
+ If you utilize this tokenizer in your research or applications, please use the following citation:
134
+ ```bibtex
135
+ @software{khantsintheinn2026myxtokenizer,
136
+ author = {Khant Sint Heinn},
137
+ title = {myX-Tokenizer: A Specialized Unigram Tokenizer for Myanmar NLP},
138
+ year = {2026},
139
+ publisher = {DatarrX},
140
+ url = {https://huggingface.co/DatarrX/myX-Tokenize)}
141
+ }
142
+ ```
143
+
144
+ ## About the Author
145
+
146
+ **Khant Sint Heinn**, working under the name **Kalix Louis**, is a **Machine Learning Engineer focused on Natural Language Processing (NLP), data foundations, and open-source AI development**. His work is centered on improving support for the Burmese (Myanmar) language in modern AI systems by building high-quality datasets, practical tools, and scalable infrastructure for language technology.
147
+
148
+ He is currently the **Lead Developer at DatarrX**, where he develops data pipelines, manages large-scale data collection workflows, and helps create open-source resources for researchers, developers, and organizations. His experience includes data engineering, web scripting, dataset curation, and building systems that support real-world machine learning applications.
149
+
150
+ Khant Sint Heinn is especially interested in advancing low-resource languages and making AI more accessible to underrepresented communities. Through his open-source contributions, he works to strengthen the Burmese (Myanmar) tech ecosystem and provide reliable building blocks for future language models, search systems, and intelligent applications.
151
+
152
+ His goal is simple: to turn limited language resources into practical opportunities through clean data, useful tools, and community-driven innovation.
153
+
154
+ **Connect with the Author:**
155
+ [GitHub](https://github.com/kalixlouiis) | [Hugging Face](https://huggingface.co/kalixlouiis) | [Kaggle](https://www.kaggle.com/organizations/kalixlouiis)
156
+
157
+ ---
158
+ *Disclaimer: This project is an ongoing effort to improve Myanmar language support in AI. We welcome feedback and contributions via the Community tab.*