Übung zur Vorlesung Maschinelles Lernen

Übung vom 8.6.2000

Assistentin:  Julia Vogel
 


Using a Hidden Markov Model


Description: In this exercise, we use a hidden Markov model (HMM) as a model of word generation from part-of-speech sequences. We will:

Credits: The HMM package we are using in this exercise was written by Tapas Kanungo, and this exercise, the accompanying scripts, etc. were written by by Philip Resnik.
 


Getting the code

         % tar xvf hmm.tar
         %  cd example0
         %  ./llink

Creating the Training Data


Training the HMM

(Problem 3: estimate model parameters from given training sequence using the Baum-Welch method)

Inspecting the Model


Generating Sentences at Random from the Model

("Problem" 4: generator of observations)

Finding the Hidden State Sequence for a Test Sentence

(Problem 2: uncover most likely state sequence to a given observation using the Viterbi algorithm)

Time for Fun

Now that you've gone through this exercise, here are some suggestions for further exploration:

 

Information concerning the software


This software contains code for understanding the basics of hidden Markov models (HMM). The notation used is very similar to that used by Rabiner and Juang in:


Executables:


Note:

The model test.hmm and the sequence test.seq solve exercise 1.5 of the HMM exercise. Just execute the command:
     %  ./testvit test.hmm test.seq
The output is the solution of the exercise
 


HMM file format:

M = <number of symbols>
N = <number of states>
A:
a11 a12 ... a1N
a21 a22 ... a2N
 .   .   .   .
 .   .   .   .
 .   .   .   .
aN1 aN2 ... aNN
B:
b11 b12 ... b1M
b21 b22 ... b2M
 .   .   .   .
 .   .   .   .
 .   .   .   .
bN1 bN2 ... bNM
pi:
pi1 pi2 ... piN


Sample HMM file:

M= 2
N= 3
A:
0.333 0.333 0.333
0.333 0.333 0.333
0.333 0.333 0.333
B:
0.5   0.5
0.75  0.25
0.25  0.75
pi:
0.333 0.333 0.333


Sequence file format:

T=<seqence lenght>
o1 o2 o3 . . . oT


Sample sequence file:

T= 10
1 1 1 1 2 1 2 2 2 2