Building Hidden Markov Models
We are now ready to discuss speech recognition. We will use Hidden Markov Models (HMMs) to perform speech recognition. HMMs are great at modeling time series data. As an audio signal is a time series signal, HMMs perfectly suit our needs. An HMM is a model that represents probability distributions over sequences of observations. We assume that the outputs are generated by hidden states. So, our goal is to find these hidden states so that we can model the signal. You can learn more about it at https://www.robots.ox.ac.uk/~vgg/rg/slides/hmm.pdf. Before you proceed, you need to install the hmmlearn
package. You can find the installation instructions at http://hmmlearn.readthedocs.org/en/latest. Let's take a look at how to build HMMs.
How to do it…
Create a new Python file. Let's define a class to model HMMs:
# Class to handle all HMM related processing class HMMTrainer(object):
Let's initialize the class. We will use Gaussian HMMs to model our data. The
n_components...