Home | Trees | Indices | Help |
---|
|
Code implementing the viterbi best paths algorithm for HMMs.
Usage is as follows
To use Machine 1 (coin tossing machine):
>>> decode_line('httt',A1, B1, states1, start1)
The variables A1
, B1
, states1
,
and start1
are all globals vars defined in viterbi.viterbi_search.
To use Machine 2 (Jurafsky and Martin word decoder):
>>> X = decode_line(Stringseq,A2, B2, states2, start2, False)
The variables Stringseq
, A2
,
B2
, states2
, and start2
are also
defined in viterbi.viterbi_search. To print the Viterbi table for
this decoding, run:
>>> print_viterbi_table(X[0],Stringseq,states2, start2,9)
X
here is the tuple returned by decode_line
,
the first member of which is the viterbi table. "9" is the
precision level for printing floats. This is the precision level needed
to reproduce Figure 7.10.
To use Machine 3 (Eisner diary ice cream machine):
>>> decode_line('313',A3, B3, states3, start3)
This runs with Machine 3, the ice cream/weather machine of Chapter 6, Jurafsky & Martin, with the input diagrammed in Fig 6.10.
|
|||
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Mar 26 10:24:32 2009 | http://epydoc.sourceforge.net |