Unified edge-deployable ASR for 6 East African languages (AfriVoices EAC Hackathon) - w2v-bert-2.0 + char CTC + per-language KenLM. Training, decoding, submission & edge-validation scripts.
# AfriVoices Edge ASR — Unified Speech-to-Text for Six East African Languages
Training, decoding, submission and edge-validation code for the
**AfriVoices East Africa ASR Hackathon** (Digital Umuganda / KenCorpus).
A **single, edge-deployable** ASR model covering **Swahili (`swa`), Kikuyu (`kik`),
Dholuo (`luo`), Kalenjin (`kln`), Maasai (`mas`) and Somali (`som`)**.
- 🤗 **Model weights + KenLM + full cards:**
huggingface.co
- 📄 **Technical report:** `TECHNICAL_REPORT.md` · `TECHNICAL_REPORT.pdf`
- 🔧 **Hardware validation:** `HARDWARE_VALIDATION_REPORT.md`
- 🗂️ **Data card:** `DATA_CARD.md` · **Model card:** `MODEL_CARD.md`
## Model
| | |
|---|---|
| **Backbone** | `facebook/w2v-bert-2.0` (Conformer, 580 M, MIT) |
| **Head** | character-level CTC |
| **Decoder** | per-language 4-gram KenLM (shallow fusion, `pyctcdecode`) + per-language α/β |
| **Checkpoint** | `wbertcur-step-16500` |
| **License** | MIT |
## Edge compliance (validated — see hardware report)
| Requirement | Limit | Measured |
|---|---|---|
| Parameters | < 1 B | **0.58 B** |
| Peak RAM | ≤ 8 GB | **5.53 GB** (single language, int8) |
| Compute | CPU only | CPU only |
| Latency (RTF) | ≤ 2.0 | **0.156** (4 cores, Raspberry-Pi-class) |
## Results
| Configuration | Dev macro-WER | Kaggle (public) |
|---|---|---|
| Greedy (no LM) | 0.3547 | — |
| + web-augmented 4-gram KenLM + per-language α/β | **0.2866** | **0.37236** |
Metric = unweighted mean of per-language WER (macro).
## Approach (summary)
- **Length curriculum** — max audio 15 s → 30 s → 45 s → 60 s (training on long clips from scratch collapses to blank).
- **Language re-weighting** — `kln`×4, `mas`×4, `som`×2 (the macro metric is dominated by the low-resource languages).
- **Canonical `normalize()`** applied identically at train / LM-build / inference, incl. a mojibake repair for the Dholuo `ng'` apostrophe.
- **Shallow-fusion KenLM** per language (4-gram, web-augmented for `som`/`kln`), beam 100, …