Xaiowu/burmese-asr
Burmese Speech-to-Text (ASR)
A minimal Gradio Space that transcribes Burmese (မြန်မာ) speech using the community model `YonaKhine/finetuned-w2v2-bert-burmese-asr` — a Wav2Vec2-BERT model fine-tuned on the OpenSLR-80 Burmese dataset.
Record from the microphone or upload an audio file, then press Transcribe.
Run locally
pip install -r requirements.txt
python app.pyDeploy to Hugging Face Spaces
- Create a new Space at https://huggingface.co/new-space and choose the Gradio SDK.
- Upload
app.py,requirements.txt, and thisREADME.md(or push with git):
git clone https://huggingface.co/spaces/<your-username>/burmese-asr
cp app.py requirements.txt README.md burmese-asr/
cd burmese-asr
git add . && git commit -m "Add Burmese ASR demo"
git push- The Space builds automatically. CPU is fine; a GPU makes it faster.
Myanmar NLP post-processing (offline)
Raw CTC ASR output has predictable surface problems. The optional post-processing toggle (offline, no dependencies — see `myanmar_postprocess.py`) fixes the ones rules can handle reliably:
Two output modes:
raw : မြန်မာ နိုင်ငံ သည် မတည်ငြိမ်သော နိုင်ငံ ဖြစ်သည် သိုး လည်း မတိုးတက်ဘူး
readable : မြန်မာနိုင်ငံသည်မတည်ငြိမ်သောနိုင်ငံဖြစ်သည်။ သိုးလည်းမတိုးတက်ဘူး။
segmented : မြန်မာ နိုင်ငံ သည် မ တည်ငြိမ် သော နိုင်ငံ ဖြစ် သည် ။ သိုး လည်း မ တိုးတက် ဘူး ။Run python myanmar_postprocess.py to see both.
Bundled word segmenter (myWord)
Word-segmented mode uses ye-kyaw-thu/myWord (MIT, © 2021 Ye Kyaw Thu) — a Viterbi segmenter over unigram + bigram probability models. It is vendored under `vendor/myword/` (word_segment.py + dict_ver1/*.bin + its LICENSE) and runs fully offline. The bigram dictionary is ~56 MB, so it is loaded lazily on first use and the repo tracks *.bin via Git LFS (see .gitattributes).
Deliberate limit: neither mode fixes context-dependent homophones such as သိုး (sheep) ↔ သို့ (thus). The segmenter only places word boundaries; it cannot change wrong characters into right ones. Disambiguating meaning requires an LLM or a fine-tuned seq2seq model — out of scope for the offline path.
Notes & caveats
- Unofficial wrapper. Verify the upstream model's license and evaluate its accuracy on your own data before any production use.
- The model expects 16 kHz mono audio; the app resamples for you.
- Long clips are chunked (20 s windows) so memory stays bounded.
