Skip to content

Some simple wrappers around kaldi-asr intended to make using kaldi's (online) decoders as convenient as possible.

License

Notifications You must be signed in to change notification settings

mariasmo/py-kaldi-simple

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-kaldi-simple

Some simple wrappers around kaldi-asr intended to make using kaldi's (online) decoders as convenient as possible.

Target audience are developers who would like to use kaldi-asr as-is for speech recognition in their application on GNU/Linux operating systems.

Constructive comments, patches and pull-requests are very welcome.

Example

Simple wav file decoding:

from kaldisimple.nnet3 import KaldiNNet3OnlineDecoder

MODELDIR    = 'data/models/kaldi-nnet3-voxforge-de-r20161117'
MODEL       = 'nnet_tdnn_a'
WAVFILE     = 'data/single.wav'

decoder = KaldiNNet3OnlineDecoder (MODELDIR, model)

if decoder.decode_wav_file(WAVFILE):

    print '%s decoding worked!' % model

    s = decoder.get_decoded_string()
    print
    print "*****************************************************************"
    print "**", s
    print "** %s likelihood:" % model, decoder.get_likelihood()
    print "*****************************************************************"
    print

else:
    print '%s decoding did not work :(' % model

Please check the examples directory for more example code.

Links

Requirements

Note: very incomplete.

  • Python 2.7 with numpy, ...
  • Cython
  • kaldi-asr

Setup Notes

At the time of this writing kaldi-asr does not seem to have an official way to install it on a system. So, for now you will have to modify the supplied Makefile and make sure the KALDI_ROOT variable points to wherever your kaldi checkout lives in your filesystem.

License

My own code is Apache licensed unless otherwise noted in the scritp's copyright headers.

Some scripts and files are based on works of others, in those cases it is my intention to keep the original license intact. Please make sure to check the copyright headers inside for more information.

Author

Guenter Bartsch guenter@zamia.org

About

Some simple wrappers around kaldi-asr intended to make using kaldi's (online) decoders as convenient as possible.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 62.0%
  • Python 33.8%
  • Makefile 4.2%