----------------------------------------------------------------------------------- -- PYHTK -- -- A Python package for building GMM-HMM models for speech recognition using HTK -- -- -- -- Initial code written by: Daniel Gillick (dgillick@gmail.com) -- -- -- -- Code (.py files) licensed under the New BSD License -- -- (http://www.opensource.org/licenses/bsd-license.php) -- ----------------------------------------------------------------------------------- To create a model: 1. Use make_setup.py or your own script to create a setup file. Look at the examples in the Setups directory. Each line consists of an audio file, its transcription, and a config file used to process the audio. 2. Create a config file, using the examples in the Configs directory as templates. Configs/si84.config is a training config, while Configs/nov92.config is a testing config. See model.py to understand in more detail what each variable in the config file means. 3. Put a pronunciation dictionary in the Common directory. The CMU dictionary is available here: https://cmusphinx.svn.sourceforge.net/svnroot/cmusphinx/trunk/cmudict/cmudict.0.7a Make sure your config file references this file. 4. Make sure the project dependencies are setup properly. - Python 2.5+ - HTK 3.4 - SRILM - sph2pipe You should be able to run these tools from the command line, so make sure they're in your path. 5. Run model.py to build a model. For example: python model.py Configs/si84.config 6. Test your model. For example: python test.py -g 8 -i 6 Configs/si84.config Configs/nov92.config > gives WER: 13.55 python test.py -g 8 -i 6 -m Configs/si84.config Configs/nov92.config > gives WER: 12.65 Note that by default, the testing code is ignoring over 100 of the test utterances (330 -> 216) because they contain at least one word that wasn't in the training data. The WSJ corpus ships with a standard 5k dictionary and LM. Using these, the WER is 8.59 with 8 MLE-trained Gaussians, and 7.81 using MPE. -------------------------- Copyright (c) 2011, Daniel Gillick All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the International Computer Science Institute nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DANIEL GILLICK BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.