Using KenLM ARPA language model with beam search to decode audio files and show the most probable transcriptions.
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 wav2vec2_kenlm.py
:
lm_path = "YOUR ARPA LANGUAGE MODEL PATH"
You may download a pretrained ARPA English Language model from this link.
To find words boundaries, you need to install the CTC segmentation library:
pip install ctc-segmentation
Finally, run the script and see the result:
python wav2vec2_kenlm.py
This project uses the functionalities of different open-source projects that are mentioned below.