Wav2Vec2CTC With KenLM
Using KenLM ARPA language model with beam search to decode audio files and show the most probable transcription.
Assuming you’ve already installed HuggingFace transformers library, you need also to install the ctcdecode library:
git clone --recursive https://github.com/parlance/ctcdecode.git cd ctcdecode && pip install .
Then, you need to change the language model path from inside the script
lm_path = "YOUR ARPA LANGUAGE MODEL PATH"
You may download a pretrained ARPA English Language model from this link.
Finally, run the script and see the result:
This project uses the functionalities of different open-source projects that are mentioned below.
- CTC beam search decoder in C++ with PyTorch bindings
- Another implementation of beam search decoder in pure Python