chuuhtetnaing/myanmar-text-segmentation-model
481
Myanmar Text Segmentation Model
Fine-tuned FacebookAI/xlm-roberta-base for Myanmar text segmentation (word boundary detection) using token classification.
Training Results
Training Details
Usage
Using Pipeline
from transformers import pipeline
nlp = pipeline("token-classification", model="chuuhtetnaing/myanmar-text-segmentation-model", grouped_entities=True)
segments = nlp("အချစ်ဆိုတာလူတွေရှင်သန်ဖို့သဘာဝကပေးတဲ့လက်နက်လား၊ဒါမှမဟုတ်ယဉ်ကျေးမှုအရတီထွင်ထားတဲ့စိတ်ကူးယဉ်မှုသက်သက်လား။")
segmented_text = []
for segment in segments:
if segment["entity_group"] == "B":
segmented_text.append(segment["word"])
else: # 'I' - append to previous word
segmented_text[-1] += segment["word"]
segmented_text = " ".join(segmented_text)
print(segmented_text)
# အချစ်ဆိုတာ လူတွေရှင်သန်ဖို့ သဘာဝကပေးတဲ့လက်နက်လား၊ ဒါမှမဟုတ် ယဉ်ကျေးမှုအရ တီထွင်ထားတဲ့ စိတ်ကူးယဉ်မှုသက်သက်လား။Label Mapping
B: Beginning of a word/segmentI: Inside a word/segment (continuation)
Dataset
Trained on chuuhtetnaing/myanmar-text-segmentation-dataset dataset.
