spellmtei / README.md
helloboyn's picture
spellmtei
660daeb verified
|
Raw History Blame Contribute Delete
3.58 kB
---
language:
- mni
license: other
base_model: google/byt5-small
library_name: transformers
pipeline_tag: text-generation
tags:
- spelling-correction
- grammatical-error-correction
- meetei-mayek
- manipuri
- byt5
---
# SpellMtei: ByT5 spelling corrector for Manipuri (Meetei Mayek)
A spelling corrector for **Manipuri (Meetei) written in Meetei Mayek script**. It is
[`google/byt5-small`](https://huggingface.co/google/byt5-small) (~300M parameters)
fine-tuned to rewrite a misspelled sentence into its corrected form. ByT5 works on raw
UTF-8 bytes, so it needs no vocabulary for the script.
## Usage
```python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
repo = "helloboyn/spellmtei"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSeq2SeqLM.from_pretrained(repo).eval()
text = "ꯑꯩꯈꯣꯏꯒꯤ ꯅꯥꯛꯇꯥ ꯍꯧꯖꯤꯛ ꯂꯔꯦ" # one sentence per input
enc = tok(text, return_tensors="pt", truncation=True, max_length=1024)
out = model.generate(**enc, max_length=1024, num_beams=4)
print(tok.decode(out[0], skip_special_tokens=True))
```
Pass `max_length` (or `max_new_tokens`) explicitly: the saved generation config keeps
the library default of 20, which would cut output short. Byte length is about 3× the
character count for Meetei Mayek, so 1024 covers sentences of roughly 340 characters.
## Training
- **Supervision is synthetic:** correct sentences are corrupted by an error model built
from the script and Meetei phonology, and the model learns to restore the original.
Error types: final-letter (*lonsum*) ⇄ consonant + *apun*, vowel-sign (*cheitap*)
confusion, dropping, insertion and reordering, stop-series and *s ∼ h* confusions,
tone mark, character delete / transpose / duplicate, and split or merged words.
- **Recipe:** a mixture of corruption rates (0.01, 0.02, 0.05, 0.10, 0.18 per character),
with 20% of sentences left uncorrupted so the model learns to keep clean text.
6 epochs (best checkpoint at step 23,000, ~5.0 epochs), batch 8 × grad-accum 4,
learning rate 3e-4, max length 1024 bytes.
## Evaluation
Held-out test set with synthetic errors (CER = character error rate).
P / R / F0.5 are span-aligned, edit-based and corpus-level. FP-clean is the share of
already-correct sentences the system changes.
| System | P | R | F0.5 | chrF | CER % ↓ | FP-clean % ↓ |
|---|---|---|---|---|---|---|
| Uncorrected input | – | – | – | 85.0 | 6.26 | 0.0 |
| **This model (ByT5-small)** | **35.4** | **41.3** | **36.5** | **91.4** | **2.86** | **60.0** |
| Character edit tagger (from scratch) | 24.7 | 33.8 | 26.1 | 87.8 | 3.78 | 86.1 |
| Noisy-channel char n-gram (tuned) | 6.4 | 9.7 | 6.9 | 76.9 | 8.83 | 97.4 |
## Limitations
- **Synthetic errors only.** The test errors come from the same error model as the
training errors. Accuracy on real typing errors has not been measured yet.
- **Over-correction.** The model changes 60% of sentences that were already correct.
Review its output rather than applying it blindly.
- **Meetei Mayek only.** It does not handle Manipuri in Bengali or Latin script.
## Citation
If you use this model, please cite:
```bibtex
@inproceedings{singh-etal-2026-spellmtei,
title = "{S}pell{M}tei: Towards Automated Spelling Correction in {M}anipuri {M}eetei {M}ayek Using Neural Models",
author = "Singh, Kshetrimayum Boynao and Mutum, Lenin and Ekbal, Asif and Pakray, Partha",
booktitle = "Proceedings of the International Conference on Natural Language Processing (ICON)",
year = "2026",
}
```