I'm writing a small program that implements a trigram HMM model and apply it by using Viterbi Algorithm. It's very standardized. However, I have never written anything like this before, and I get confused of what I should use as the
START (*) and
I tried to search for the answer online but apparently people who know the answer don't need to ask online, and people who don't know the answer don't need to know.
I primarily use Scala as my choice of implementation language. Scala has a program called ScalaNLP, but it's nowhere being mature, and it does not have HMM implementation as far as I can tell. So I decide to include a statistic package of Scala and write one by myself.
I recently watched Michael Collins' NLP class on Coursera and I thought he explained HMM model very well and I could possibly try to implement that by myself.
The "apply-part" of program itself on the outmost surface (structure) should look like the Viterbi Algorithm described in Collins' video. I do need to explain. HMM has two parts: training and applying. Training part is implemented to get emission variable: $e - e(x^i|y^i)$ and the parameter $q(v|w, u)$. The applying part is to take in a sentence: x1x2...xn and add two start symbols
** to the beginning of the sentence and a
STOP symbol at the end.
I don't know if I am truly capable of doing such, but these great professors never mentioned any real implementation because people will just go and use a library created by someone else.