A production-grade, morphology-aware subword tokenizer for the Mizo language (lus_Latn), combining a linguistic morphological pre-segmenter with trained SentencePiece Byte-Pair Encoding (BPE).
zirtirtu $\to$ ['zir', 'tir', 'tu'], darthlalang $\to$ ['dar', 'thla', 'lang']).bulletin, mountain, cheetah, computer) from false suffix peeling.school-ah, WhatsApp-in).strict (preserving tone diacritics â, ê, î, ô, û) and canonical (for dense downstream transfer) while strictly preserving consonant ṭ/Ṭ.from transformers import AutoTokenizer
# Load tokenizer directly from Hugging Face Hub
tokenizer = AutoTokenizer.from_pretrained("Larsson31/mizo-tokenizer-32k", trust_remote_code=True)
# 1. Tokenize into subword pieces
sentence = "Zirlaite chu school-ah an kal a, zirtirtu chuan lehkha a zirtir a."
tokens = tokenizer.tokenize(sentence)
print("Tokens:", tokens)
# -> ['_Zirlai', '_te', '_chu', '_school', '_-', '_ah', '_an', '_kal', '_a', '_,', '_zir', '_tir', '_tu', '_chuan', '_lehkha', '_a', '_zir', '_tir', '_a', '_.']
# 2. Encode to PyTorch / Transformers inputs
inputs = tokenizer(sentence, return_tensors="pt")
print("Input IDs:", inputs["input_ids"])
# 3. Exact lossless reconstruction
reconstructed = tokenizer.decode(inputs["input_ids"][0], skip_special_tokens=True)
print("Decoded:", reconstructed)
# -> "Zirlaite chu school-ah an kal a, zirtirtu chuan lehkha a zirtir a."
| Metric | Meta NLLB-200 (lus_Latn) |
MWirelabs/mizo-roberta | Ours (M-BPE) |
|---|---|---|---|
| Vocab Size | 256,204 | 30,000 | 32,000 |
| Fertility Rate (tokens/word) | 2.14 | 1.82 | 1.38 (🔥 -35.5%) |
| Compression (bytes/token) | 2.78 | 3.25 | 4.31 |
| Root Mutilation Rate | 18.4% | 12.1% | 0.0% (Perfect) |
| Loanword False Peeling | Yes | Yes | 0.0% (Protected) |
If you find this tokenizer helpful in your research or applications, please cite:
@software{mizo_mbpe_tokenizer,
author = {Larsson & Antigravity AI},
title = {M-BPE: Morphology-Aware Subword Tokenizer for the Mizo Language},
year = {2026},
url = {https://github.com/LarssonCodes/Mizo-Tokenizer}
}