Views
No views yet
burmese-pos-xlmr-base. This is a robust Part-of-Speech (POS) Tagging model specifically trained and optimized for the Burmese (Myanmar) language.xlm-roberta-base and adapts it to the specific grammatical nuances of Burmese syntax. The primary goal of this model is to reliably break down raw Burmese sentences and classify each token into its correct grammatical category (Nouns, Verbs, Adjectives, etc.), serving as a foundational tool for downstream NLP pipelines, data augmentation, and linguistic analysis.ပိဋကတ်သုံးပုံ/n|စာပေ/n).ပိဋကတ်သုံးပုံ/n|စာပေ/n is unified into a single, cohesive noun entity (ပိဋကတ်သုံးပုံစာပေ/n). This ensures that the model learns semantically meaningful representations rather than fragmented sub-tokens, greatly improving its contextual awareness.xlm-roberta-base was chosen for its proven capability in cross-lingual transfer learning, providing a strong initialization for low-resource languages.per_device_train_batch_size was set to 16, paired with gradient_accumulation_steps of 2. This results in an effective batch size of 32, which stabilizes the gradient updates and helps the model converge smoothly without exceeding standard GPU memory limits (such as Kaggle's T4 GPUs).128 tokens, which comfortably accommodates the vast majority of standard Burmese sentence structures while avoiding wasted compute on heavy padding.3e-5 was used to ensure the pre-trained backbone slowly adapts to the POS task without catastrophic forgetting of its original language understanding.3 Epochs with a weight decay of 0.01 to prevent overfitting.seqeval metric to ensure sequence-level integrity. The training logs demonstrate a steady, stable convergence:| Epoch | Training Loss | Validation Loss | Precision | Recall | F1-Score | Accuracy |
|---|---|---|---|---|---|---|
| 1 | 0.6850 | 0.2706 | 94.09% | 95.08% | 94.58% | 96.03% |
| 2 | 0.5245 | 0.2095 | 95.33% | 96.00% | 95.66% | 96.84% |
| 3 | 0.4424 | 0.1871 | 95.64% | 96.36% | 96.00% | 97.14% |
pyidaungsu) before running inference.pipeline. Since XLM-RoBERTa uses subword tokenization, we have included a helper function to aggregate the subwords back into coherent words.Note: As Burmese is traditionally written without spaces, this model performs best when the input text is pre-segmented into words.
1from transformers import pipeline
2
3# 1. Load the POS Tagger pipeline
4nlp = pipeline("token-classification", model="kalixlouiis/burmese-pos-xlmr-base")
5
6# 2. Define aggregation function to clean subwords and merge tokens
7def clean_and_aggregate(results):
8 clean_results = []
9 current_word = ""
10 current_tag = ""
11
12 for entity in results:
13 # XLM-R subword prefix '▁' (or ' ') and spaces are removed
14 word = entity['word'].replace(' ', '').replace('▁', '')
15 tag = entity['entity']
16
17 if word:
18 if not current_word:
19 current_word = word
20 current_tag = tag
21 else:
22 # If the tag is the same, aggregate the subwords
23 if tag == current_tag:
24 current_word += word
25 else:
26 clean_results.append((current_word, current_tag))
27 current_word = word
28 current_tag = tag
29
30 if current_word:
31 clean_results.append((current_word, current_tag))
32 return clean_results
33
34# 3. Test with a pre-segmented Burmese sentence
35text = "တော်သလင်း ကို ရာသီ အား ဖြင့် ကန်ရာသီ ဟု ခေါ် သည် ။ "
36results = nlp(text)
37
38# 4. Process and view the extracted grammatical tags
39final_output = clean_and_aggregate(results)
40
41for word, tag in final_output:
42 print(f"Word: {word:<15} | POS Tag: {tag}")
43
44# output
45# Word: တော်သလင်း | POS Tag: n
46# Word: ကို | POS Tag: ppm
47# Word: ရာသီ | POS Tag: n
48# Word: အားဖြင့် | POS Tag: ppm
49# Word: ကန်ရာသီ | POS Tag: n
50# Word: ဟု | POS Tag: part
51# Word: ခေါ် | POS Tag: v
52# Word: သည် | POS Tag: ppm
53# Word: ။ | POS Tag: puncLULab/myPOS tagset. Here are some of the most common tags you will encounter:n : Noun (နာမ်)v : Verb (ကြိယာ)adj : Adjective (နာမဝိသေသန)pron : Pronoun (နာမ်စား)part : Particle (ပစ္စည်း)ppm : Postpositional Marker (ဝိဘတ်)conj : Conjunction (သမ္ဗန္ဓ)1@misc{kalixlouiis2026burmesepos,
2 author = {Khant Sint Heinn},
3 title = {burmese-pos-xlmr-base: A high-accuracy Part-of-Speech tagging model for Burmese},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{[https://huggingface.co/kalixlouiis/burmese-pos-xlmr-base](https://huggingface.co/kalixlouiis/burmese-pos-xlmr-base)}}
7}1@misc{lulab2024mypos,
2 author = {Language Understanding Laboratory (LULab)},
3 title = {myPOS: A Part-of-Speech Dataset for Myanmar Language},
4 publisher = {Hugging Face},
5 howpublished = {\url{[https://huggingface.co/datasets/LULab/myPOS](https://huggingface.co/datasets/LULab/myPOS)}}
6}