In this project we implemented a Hidden Markov Model that recognized english sentences and decides wether a sentence is valid or not
There are three parts to this project:
Pattern Recognition: Implements the forward part of the forward/backwards procedure used in Hidden Markov Models
State-Path Determination: Implements the Viterbi Algorithm to determine the optimal state path for each observation set and it reports the probability
Model Optimization: Implements the Baum-Welch algorithm and reports the probabilities before and after optimization
This project consists of one overhead class (MM.h) that contains the methods for the recognize, statepath, and optimize functions. The recognize function essentially iterates through the possible combinations that will give you the given sentence through induction. It uses a function findAlpha on each sentence that implements the induction process, then adds all of the alpha values together for the total probability. The statepath function uses a similar technique but only return the maximum alpha value, as well as the statepath used to obtain said value. The optimize function takes the HMM and a sample observation and finds the gamma, eta, and beta values for the given observation. These values are used to change the a, b, and pi matrices that define the HMM. The program then writes back a .hmm file containing the new matrices.
Also in the downloads section you can find a .zip file with all the source code, and executables for each part as well as the example files you'll need to run the program






