Estimate probabilities with known state sequences.
This should be used for direct estimation of emission and transition
probabilities when both the state path and emission sequence are
known for the training examples.
Methods
|
|
__init__
_count_emissions
_count_transitions
train
|
|
__init__
|
__init__ ( self, markov_model )
|
|
_count_emissions
|
_count_emissions (
self,
training_seq,
emission_counts,
)
Add emissions from the training sequence to the current counts.
Arguments:
Exceptions
|
|
KeyError("Unexpected emission (%s, %s)" %( cur_state, cur_emission ) )
|
|
|
_count_transitions
|
_count_transitions (
self,
state_seq,
transition_counts,
)
Add transitions from the training sequence to the current counts.
Arguments:
Exceptions
|
|
KeyError("Unexpected transition (%s, %s)" %( cur_state, next_state ) )
|
|
|
train
|
train ( self, training_seqs )
Estimate the Markov Model parameters with known state paths.
This trainer requires that both the state and the emissions are
known for all of the training sequences in the list of
TrainingSequence objects.
This training will then count all of the transitions and emissions,
and use this to estimate the parameters of the model.
|
|