- Notifications
You must be signed in to change notification settings - Fork53
Some simple wrappers around kaldi-asr intended to make using kaldi's (online) decoders as convenient as possible.
License
gooofy/py-kaldi-asr
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Some simple wrappers around kaldi-asr intended to make using kaldi's online nnet3-chaindecoders as convenient as possible. Kaldi's online GMM decoders are also supported.
Target audience are developers who would like to use kaldi-asr as-is for speechrecognition in their application on GNU/Linux operating systems.
Constructive comments, patches and pull-requests are very welcome.
We recommend using pre-trained modules from thezamia-speech projectto get started. There you will also find a tutorial complete with links to pre-built binary packagesto get you up and running with free and open source speech recognition in a matter of minutes:
Simple wav file decoding:
fromkaldiasr.nnet3importKaldiNNet3OnlineModel,KaldiNNet3OnlineDecoderMODELDIR='data/models/kaldi-generic-en-tdnn_sp-latest'WAVFILE='data/dw961.wav'kaldi_model=KaldiNNet3OnlineModel (MODELDIR)decoder=KaldiNNet3OnlineDecoder (kaldi_model)ifdecoder.decode_wav_file(WAVFILE):s,l=decoder.get_decoded_string()printprintu"*****************************************************************"printu"**",WAVFILEprintu"**",sprintu"** %s likelihood:"%MODELDIR,lprintu"*****************************************************************"printelse:print"***ERROR: decoding of %s failed."%WAVFILE
Please check the examples directory for more example code.
- Python 2.7 or 3.5+
- NumPy
- Cython
- kaldi-asr
At the time of this writing kaldi-asr does not seem to have an official way toinstall it on a system.
So, for now we will rely on pkg-config to provide LIBS and CFLAGS for compilation:Create a file calledkaldi-asr.pc somewhere in yourPKG_CONFIG_PATH that providesthis information - here is what such a file could look like (details depend on your OS environment):
kaldi_root=/opt/kaldiName: kaldi-asrDescription: kaldi-asr speech recognition toolkitVersion: 5.2Requires: atlasLibs: -L${kaldi_root}/tools/openfst/lib -L${kaldi_root}/src/lib -lkaldi-decoder -lkaldi-lat -lkaldi-fstext -lkaldi-hmm -lkaldi-feat -lkaldi-transform -lkaldi-gmm -lkaldi-tree -lkaldi-util -lkaldi-matrix -lkaldi-base -lkaldi-nnet3 -lkaldi-online2 -lkaldi-cudamatrix -lkaldi-ivector -lfstCflags: -I${kaldi_root}/src -I${kaldi_root}/tools/openfst/include
make surekaldi_root points to wherever your kaldi checkout lives in your filesystem.
You may need to install ATLAS headers even if you didn't need them to compile Kaldi.
$ sudo apt install libatlas-devMy own code is Apache licensed unless otherwise noted in the script's copyrightheaders.
Some scripts and files are based on works of others, in those cases it is myintention to keep the original license intact. Please make sure to check thecopyright headers inside for more information.
Guenter Bartschguenter@zamia.org
Kaldi 5.1 adaptation contributed by mariasmohttps://github.com/mariasmo
Kaldi GMM model support contributed by David Zurowhttps://github.com/daanzu
Python > 3.5 support contributed by Jakob Krusehttps://github.com/jakob1111996
About
Some simple wrappers around kaldi-asr intended to make using kaldi's (online) decoders as convenient as possible.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.