Offline Malayalam speech-to-text for sherpa-onnx, made for the Daily Whisper Android notes app (on-device dictation, audio never leaves the phone).
df51f97ec88b14b37a0beede6b547b4e534b50f8, CC-BY-4.0), which credits
sulabhkatiyar/indicconformer-120m-onnx / trysem/indicconformer-120m-onnx for the ONNX weights.tokens.txt has 257 entries.subsampling_factor metadata fixed from 8 to 4. With 8, sherpa-onnx dropped the second half of every
utterance (WER 65%). With 4 the full utterance is decoded.quantize_dynamic (QUInt8, MatMul + Conv). 482 MB -> 138 MB.60 clips (936 s) from the FLEURS ml_in test split, punctuation
stripped, numbers not normalised (the model writes numbers as words, the references use digits, which inflates WER):
| file | size | WER | CER | speed (x86 box, 2 threads) |
|---|---|---|---|---|
| fp32 source, metadata fixed | 482 MB | 25.3% | 6.1% | RTF 0.037 |
| this repo (int8 MatMul+Conv) | 138 MB | 26.7% | 5.8% | RTF 0.057 |
Malayalam is agglutinative, so WER looks high even when most characters are right; CER is the better guide.
eval_fleurs.py is the script used.
import sherpa_onnx
rec = sherpa_onnx.OfflineRecognizer.from_nemo_ctc(model="model.int8.onnx", tokens="tokens.txt", num_threads=2)
s = rec.create_stream(); s.accept_waveform(16000, samples); rec.decode_stream(s); print(s.result.text)
Non-streaming: use a voice-activity detector (e.g. Silero VAD) to cut speech into sentences.
| file | bytes | sha256 |
|---|---|---|
model.int8.onnx |
137677591 | 390b8f9e7092324d9da586829114db62f792e917d59e86e57771f058ff0d6733 |
tokens.txt |
2823 | 6b025c3055708763a952d21b73556ed02c9abd88cc706ff42e3cb94a984bdb88 |
ai4bharat/indicconformer_stt_ml_hybrid_ctc_rnnt_large