Kaldi / Vosk Welsh Speech Recognition β 2607
A Kaldi chain (LF-MMI) acoustic model with WFST decoding, packaged for Vosk. It runs in real time on CPU, which makes it suited to on-device and streaming use where an end-to-end model is too costly.
Welsh transcription only. Output carries no punctuation or casing.
Evaluation results
WER / CER (lower is better) on the held-out techiaith/asr-benchmark-cy-en-2606 test sets, scored
per-utterance against the same references for every model compared.
Mean across the Welsh test sets: WER 47.25, against 50.52 for the previous release (2503) β an improvement of 3.27 points.
| Test set | WER | CER | WER (2503) |
|---|---|---|---|
cymen-arfor/lleisiau-arfor (spontaneous, mixed dialects) |
55.99 | 28.05 | 54.45 |
techiaith/banc-trawsgrifiadau-bangor (spontaneous, mixed dialects) |
40.23 | 17.49 | 46.03 |
techiaith/commonvoice-23-0-cy (read) |
45.52 | 15.92 | 51.08 |
Training data
Welsh speech corpora used to train this model:
| Dataset | Split | Revision | Access |
|---|---|---|---|
| techiaith/banc-trawsgrifiadau-bangor | train |
26.07 |
public |
| techiaith/corpws-clllc-wlga | clips |
5d00294c31 |
public |
techiaith/commonvoice_23_0_cy |
train+dev[50%:] |
main |
private β |
| cymen-arfor/lleisiau-arfor | train |
main |
public |
| techiaith/commonvoice_vad_cy | train |
main |
public |
β Common Voice data is not redistributed here. techiaith/commonvoice_23_0_cy (Common Voice 23.0 Welsh) is held in a private repository, in line with the Mozilla Foundation's terms for obtaining and sharing Common Voice data. It is listed above for provenance and reproducibility, not as a download.
The Welsh Common Voice corpus is freely available from Mozilla themselves: Mozilla Common Voice β Welsh datasets. Releases are distributed through the Mozilla Data Collective, and the datacollective package offers a programmatic download. With that in hand the rest of this pipeline is reproducible β every other dataset in the table is openly available on the Hugging Face Hub. Our thanks to Mozilla and to the Welsh speakers who contributed their voices.
Welsh transcription audio only, as materialised for training:
| Source | Utterances | Hours |
|---|---|---|
btb |
50,969 | 58.9 |
wlga |
29,222 | 53.4 |
lla |
27,465 | 28.0 |
cv23 |
10,721 | 15.5 |
cv_vad |
8,205 | 3.5 |
| total | 126,582 | 159.4 |
Training configuration
| Parameter | Value |
|---|---|
| Recipe | local/chain/run_tdnn_260412.sh (chain / LF-MMI) |
| Acoustic model | TDNN-F, 12 factorised layers, 5.1M parameters |
| Tree leaves | 3500 |
| Epochs | 5 |
| Features | 40-dim MFCC (hires) + 100-dim online i-vectors |
| SpecAugment | yes (spec-augment-layer in the xconfig) |
| Language model | 3-gram, Witten-Bell discounting, trained on the training transcripts only |
| Lexicon | Geiriadur Ynganu Bangor pronunciations, with grapheme-to-phoneme fallback |
| Decoding vocabulary | 62,392 words |
| Held-out dev WER | 30.91% (BTB 32.60%, Common Voice 24.85%) |
Usage
Install vosk, then unpack the bundle:
pip install vosk
huggingface-cli download techiaith/kaldi-cy model_cy.tar.gz --local-dir .
tar -xzf model_cy.tar.gz # -> ./model/
import json
import wave
from vosk import KaldiRecognizer, Model
model = Model("model")
wf = wave.open("welsh_audio.wav", "rb") # 16 kHz, mono, 16-bit PCM
rec = KaldiRecognizer(model, wf.getframerate())
results = []
while True:
data = wf.readframes(4000)
if len(data) == 0:
break
if rec.AcceptWaveform(data):
results.append(json.loads(rec.Result())["text"])
results.append(json.loads(rec.FinalResult())["text"])
print(" ".join(t for t in results if t).strip())
Feed the audio in chunks and collect Result() each time AcceptWaveform
returns True, as above. A single AcceptWaveform call followed by only
FinalResult() discards everything recognised before the last detected
end-of-utterance, which silently truncates anything longer than one utterance.
Limitations
- Welsh only. English audio is not a supported task.
- Closed vocabulary. WFST decoding can only emit words present in the lexicon (62,392 words), which is built from the training transcripts. Names and loanwords outside it cannot be produced at all β a hard floor on achievable WER.
- No punctuation or casing.
- The language model is a 3-gram trained on the training transcripts only, so the model is weaker on domains and registers unlike its training data.
Acknowledgements
Built with the Kaldi/Vosk recipe developed by Gweltaz Duval-Guennoc, Preben Vangberg and Sasha Wanasky (vosk-cymraeg).
Developed by Uned Technolegau Iaith, Prifysgol Bangor / Language Technologies Unit, Bangor University.
Funded by the Welsh Government.