classmethod HiddenMarkovModelTagger.train(labeled_sequence, test_sequence=None, unlabeled_sequence=None, **kwargs)[source]

Train a new HiddenMarkovModelTagger using the given labeled and unlabeled training instances. Testing will be performed if test instances are provided.


a hidden markov model tagger

Return type:


  • labeled_sequence (list(list)) – a sequence of labeled training instances, i.e. a list of sentences represented as tuples
  • test_sequence (list(list)) – a sequence of labeled test instances
  • unlabeled_sequence (list(list)) – a sequence of unlabeled training instances, i.e. a list of sentences represented as words
  • transform (function) – an optional function for transforming training instances, defaults to the identity function, see transform()
  • estimator (class or function) – an optional function or class that maps a condition’s frequency distribution to its probability distribution, defaults to a Lidstone distribution with gamma = 0.1
  • verbose (bool) – boolean flag indicating whether training should be verbose or include printed output
  • max_iterations (int) – number of Baum-Welch interations to perform