Speech to IPA phonemes for 42 Ghanaian and West African languages — CTC model, CPU/GPU/mobile inference via sherpa-onnx
# ghana-ipa-asr
Speech to **IPA phonemes** for **42 Ghanaian and West African languages**, in one model.
```bash
pip install git+
github.com
ghana-ipa-asr utterance.wav
```
```
m f ia s e n o o ɲ a n kʰ o pʰ ɔ n b ɔ ɔ ɔ s o ɾ o .
```
| | |
|---|---|
| Languages | 42, one shared model |
| Output | IPA phoneme stream, with punctuation |
| Accuracy | 16.64% UER held-out (15.39% excluding punctuation) |
| Size | **349 MB** int8, 1.3 GB fp32 |
| Runs on | CPU, NVIDIA GPU, Apple CoreML, Android/iOS |
| Corpus scale | `ghana-ipa-asr batch` — **~2100× realtime** on one H200 |
It is a CTC model, so its alignment is **monotonic — it cannot emit phonemes that are not in
the audio**. For phonetic work that guarantee matters more than raw accuracy: an invented
symbol is worse than a missing one.
## Output formats
The model emits a flat list of units; every format is a view over that list, so switching
costs nothing and never re-runs the model.
```python
from ghana_ipa_asr import GhanaIPAASR
asr = GhanaIPAASR.load()
t = asr.transcribe("utterance.wav")
t.spaced() # 'm f ia s e n o o ɲ a n kʰ o pʰ ɔ n' every unit separated
t.continuous() # 'mfiasenooɲankʰopʰɔnbɔɔɔsoɾo' no separators at all
t.units() # ['m', 'f', 'ia', 's', 'e', ...] as a list
t.spaced(punctuation=False) # drop . , ? ! and the rest
```
From the command line:
```bash
ghana-ipa-asr audio.wav --format spaced # default; also what forced alignment needs
ghana-ipa-asr audio.wav --format continuous # bare phoneme string
ghana-ipa-asr audio.wav --format json # every format at once
ghana-ipa-asr *.wav --no-punctuation
```
**Which format to use**
| you want | use | why |
|---|---|---|
| forced alignment, per-phoneme timings | `spaced()` | units like `kʰ` and `k͡p` are more than one character, so a character-level split would turn one sound into two |
| a bare phoneme string | `continuous()` | no separators; note un …