Skip to content

Incorporating KenLM language model with HuggingFace implementation of Wav2Vec2CTC Model using beam search decoding

License

Notifications You must be signed in to change notification settings

farisalasmary/wav2vec2-kenlm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wav2Vec2CTC With KenLM

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

Acknowledgments

This project uses the functionalities of different open-source projects that are mentioned below.

About

Incorporating KenLM language model with HuggingFace implementation of Wav2Vec2CTC Model using beam search decoding

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages