CoolFace
Apppublic

Xaiowu/burmese-asr

sourceHugging Faceapache-2.0updated 12d agoView on Hugging Face
0likes
App README

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

bash
pip install -r requirements.txt
python app.py

Deploy to Hugging Face Spaces

  1. 1.Create a new Space at https://huggingface.co/new-space and choose the Gradio SDK.
  2. 2.Upload app.py, requirements.txt, and this README.md (or push with git):
bash
   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
  1. 1.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:

StageFixes
Special-token cleanupstrips leaked [UNK] / [PAD] markers
Whitespace normalizecollapses stray spaces
Sentence split + punctuationgroups tokens into sentences and inserts after clause-final verb markers
Word re-joining / segmentationReadable mode joins into continuous Burmese; Word-segmented mode uses the bundled myWord Viterbi segmenter for proper word boundaries

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.