chuuhtetnaing's picture
Update README.md
1a2db7c verified
metadata
dataset_info:
  features:
    - name: tokens
      list: string
    - name: segment_tags
      list:
        class_label:
          names:
            '0': B
            '1': I
  splits:
    - name: train
      num_bytes: 618033522
      num_examples: 544133
    - name: test
      num_bytes: 32877176
      num_examples: 28639
  download_size: 62316691
  dataset_size: 650910698
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
      - split: test
        path: data/test-*
task_categories:
  - token-classification
language:
  - my
tags:
  - myanmar
  - burmese
  - nlp
  - sequence-labeling
  - text-segmentation
  - chunk-segmentation
pretty_name: Myanmar Text Segmentation Dataset
size_categories:
  - 100K<n<1M

Please visit to the GitHub repository for other Myanmar Langauge datasets.

Myanmar Text Segmentation Dataset

A token classification dataset for Myanmar (Burmese) chunk segmentation, formatted for sequence labeling tasks using the BIO tagging scheme.

πŸ““ Dataset Creation Notebook: myanmar-text-segmentation-dataset.ipynb

πŸ““ Fine-Tuning Notebook: myanmar-text-segmentation-fine-tuning.ipynb (based on the HuggingFace Token Classification Guide)

πŸš€ Try it out: Myanmar Text Segmentation Demo

Dataset Description

This dataset is designed for chunk segmentation of Myanmar text. The input tokens are syllables (for Myanmar) or characters (for English), and the labels indicate chunk boundaries using B (Beginning) / I (Inside) tags.

For example, the unsegmented text မြန်မာနိုင်ငဢတွင် is first broken into syllables ["α€™α€Όα€”α€Ί", "မာ", "နိုင်", "ငဢ", "တွင်"], then labeled as [B, I, B, I, I] to produce the segmented output မြန်မာ နိုင်ငဢတွင်.

Source Data

Derived from chuuhtetnaing/myanmar-wikipedia-dataset.

Processing Pipeline

  1. Paragraph extraction: Each Wikipedia article is split by newlines, preserving full paragraphs as individual rows rather than sentence-by-sentence. This design allows models to handle multi-sentence inputs without requiring line-by-line splitting at inference time.

  2. Language filtering: Each paragraph is classified using Facebook's fastText language identification model. Only paragraphs identified as Myanmar (__label__mya_Mymr) are retained.

  3. Tokenization: Myanmar text is tokenized into syllables using regex-based rules that handle consonants, subscripts (α€Ή), and asat (α€Ί) markers. English text is tokenized into individual characters.

  4. Chunk boundary labeling: Original spacing from the Wikipedia source text is converted to B/I sequence labels, where B marks the first token of each chunk and I marks continuation tokens.

  5. Deduplication: Duplicate token sequences are removed from the final dataset.

Dataset Statistics

Split Examples
Train 544,133
Test 28,639

Data Format

{
    "tokens": ["α€™α€Όα€”α€Ί", "မာ", "နိုင်", "ငဢ", "တွင်"],  # List of tokens
    "segment_tags": [0, 1, 0, 1, 1]  # 0 = B (chunk start), 1 = I (chunk continuation)
}

Features

  • tokens: Sequence[string] - Input tokens (Myanmar syllables or English characters)
  • segment_tags: Sequence[ClassLabel] - Chunk boundary labels (B=0, I=1)

Usage

from datasets import load_dataset
ds = load_dataset("chuuhtetnaing/myanmar-text-segmentation-dataset")

ds["train"].features["segment_tags"].feature.names
# ['B', 'I']
def reconstruct(tokens, labels):
    result = []
    for token, label in zip(tokens, labels):
        if label == 0 and result:  # B tag (chunk boundary)
            result.append(" ")
        result.append(token)
    return "".join(result)

ds["test"][1018]['tokens']
# ['α€œα€»α€Ύα€•α€Ί', 'α€…α€…α€Ί', 'ငါး', 'α€›α€Ύ', 'ဉ့်', '(Electrophorus)', 'α€žα€Šα€Ί', 'α€™α€»α€­α€―α€Έ', 'ရင်း', 'Gymnotidae', 'α€›α€Ύα€­', 'α€›α€±', 'ချို', 'α€”α€±', 'ငါး', 'α€›α€Ύ', 'ဉ့်', 'α€™α€»α€­α€―α€Έ', 'α€…α€―', 'တ', 'ခု', 'α€–α€Όα€…α€Ί', 'α€žα€Šα€Ί', '။', ...]

ds["test"][1018]['segment_tags']
# [0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, ...]

reconstruct(ds["test"][1018]['tokens'], ds["test"][1018]['segment_tags'])
# 'α€œα€»α€Ύα€•α€Ία€…α€…α€Ία€„α€«α€Έα€›α€Ύα€‰α€·α€Ί (Electrophorus) α€žα€Šα€Ί မျိုးရင်း Gymnotidae α€›α€Ύα€­ ရေချိုနေ ငါးရှဉ့် α€™α€»α€­α€―α€Έα€…α€―α€α€α€―α€–α€Όα€…α€Ία€žα€Šα€Ία‹ ...'

Intended Use