Kaldi / Vosk Welsh Speech Recognition β 2610
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.
What changed in this release
The language model is estimated with pocolm instead of SRILM. The training data, recipe, lexicon and acoustic model are those of the 2607 release; only the 3-gram language model was re-estimated, and the decoding graph rebuilt from it. This has two consequences.
- Licence. SRILM's Research Community License permits non-commercial research use only, so every earlier Kaldi/Vosk release from the Unit (2503, 2607) was published under CC-BY-NC. pocolm is Apache-2.0, as are Kaldi and Vosk, and the training speech is all CC0, so nothing in this model's toolchain or data restricts its use. This is the first Kaldi/Vosk model from the Unit released under the Apache License 2.0 (see Licence below), and it may be used commercially.
- Accuracy. pocolm tunes its discounting against the held-out dev transcripts
instead of applying fixed Witten-Bell discounting, and keeps the n-grams that SRILM's
default count cut-offs discard. Held-out dev WER falls from 30.91% to 30.05%, and the
benchmark improves on every Welsh test set (table below). The larger language model
makes the decoding graph (
HCLG.fst) three times the size, 242 MB against 82 MB, so the bundle grows from 70 MB to 121 MB and decoding needs correspondingly more memory.
Evaluation results
WER / CER (lower is better) on the held-out test sets, scored per utterance against the same references for every model compared.
The references are the test sets' transcripts as published, with their capitalisation and punctuation intact; only transcription-convention markers (such as <chwerthin>) are removed before scoring. This model emits lowercase text without punctuation, so every reference word that carries a capital letter or attached punctuation is scored as an error. The figures are therefore conservative, and higher than a normalised comparison would give, but every model in the table is scored the same way, so the comparison between them holds.
Mean across the Welsh test sets: WER 47.30, against 48.20 for the previous release (2607-SRILM) β an improvement of 0.90 points.
| Test set | WER | CER | WER (2607-SRILM) |
|---|---|---|---|
cymen-arfor/lleisiau-arfor (spontaneous, mixed dialects) |
55.10 | 27.55 | 55.99 |
google/fleurs/cy-gb |
49.89 | 20.25 | 51.06 |
techiaith/banc-trawsgrifiadau-bangor (spontaneous, mixed dialects) |
39.69 | 17.25 | 40.23 |
techiaith/commonvoice-23-0-cy (read) |
44.54 | 15.48 | 45.52 |
Training data
Welsh speech corpora used to train this model:
| Dataset | Split | Revision | Licence | Access | Datasheet |
|---|---|---|---|---|---|
| techiaith/banc-trawsgrifiadau-bangor | train |
26.07 |
CC0 1.0 | public | datasheet |
| techiaith/corpws-clllc-wlga | clips |
5d00294c31 |
CC0 1.0 | public | datasheet |
techiaith/commonvoice_23_0_cy |
train+dev[50%:] |
main |
CC0 1.0 | private β | datasheet |
| cymen-arfor/lleisiau-arfor | train |
main |
CC0 1.0 | public | datasheet |
techiaith/commonvoice_vad_cy |
train |
main |
CC0 1.0 | private β | datasheet |
β Common Voice data is not redistributed here. techiaith/commonvoice_23_0_cy (Common Voice 23.0 Welsh), techiaith/commonvoice_vad_cy (Common Voice Welsh, re-segmented with voice activity detection) are held in private repositories, in line with the Mozilla Foundation's terms for obtaining and sharing Common Voice data. They are 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 estimated with pocolm on the training transcripts only, discounting tuned on the dev transcripts (dev perplexity 292.8) |
| Lexicon | Geiriadur Ynganu Bangor pronunciations, with grapheme-to-phoneme fallback |
| Decoding vocabulary | 62,392 words |
| Held-out dev WER | 30.05% |
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.
Intended use and limitations
The model transcribes Welsh speech to text. It is a research model, not a certified product, and is not a substitute for a qualified transcriber.
Automatic transcription makes mistakes. Output can be wrong while appearing fluent and confident. Known failure modes include omitted, inserted or substituted words; incorrect names, numbers and place names; words outside its fixed vocabulary replaced by similar-sounding ones; and reduced accuracy on dialect, overlapping speakers, noisy or distant audio, and subjects outside the training data. Output carries no punctuation or capitalisation. Treat output as provisional and have it checked and corrected by a competent person before it is relied on as a record, used in any decision affecting a person, or shared or published. Where the model is used interactively or in real time (live captions, dictation), tell users that what they see is an automatic transcription and may be wrong.
Not fit for medical, legal, financial, safety-critical or emergency settings, or any decision affecting a person's rights, health, liberty or livelihood, unless a qualified person reviews every output.
Use in Wales. The model was developed to help organisations provide services in Welsh that are as good as those they provide in English, not to replace Welsh-language provision. Under section 1 of the Welsh Language (Wales) Measure 2011 (2011 nawm 1), Welsh has official status in Wales, and that status is given legal effect by, among other things, the treatment of Welsh no less favourably than English (s. 1(2)(b)) and by standards of conduct relating to the use of Welsh (s. 1(3)(e)). These standards are made and enforced under Part 4 of the Measure. Bodies still operating a Welsh language scheme under Part II of the Welsh Language Act 1993 (c. 38) must give effect to the principle in section 5 of that Act that, in the conduct of public business and the administration of justice in Wales, Welsh and English should be treated on a basis of equality. Which duties apply depends on the body and the regulations or scheme that cover it, and responsibility for compliance rests with the body deploying the model. See the Welsh Language Commissioner's regulatory policy statement on artificial intelligence and the Welsh language, Technology, Websites and Software: Welsh Language Considerations, and the advice document Bilingual drafting, translation and using Welsh face to face. The legislation is at legislation.gov.uk/mwa/2011/1 and legislation.gov.uk/ukpga/1993/38.
Further 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 and this represents 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 that differ from its training data.
Licence
Released under the Apache License 2.0. The accompanying NOTICE file
carries the University's attribution, the warning that automatic transcription makes
mistakes, and the attributions required by the training-data and pronunciation-dictionary
licences. Section 4 of the licence requires anyone who redistributes the model or a
derivative to keep that NOTICE. Both files are also inside model_cy.tar.gz, in the model/
directory, so they travel with the unpacked model.
One-line attribution: Includes kaldi-cy 2610, developed by the Language Technologies Unit, Bangor University, and released under the Apache License 2.0.
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.