nltk.tag.PerceptronTagger.train

PerceptronTagger.train(sentences, save_loc=None, nr_iter=5)[source]

Train a model from sentences, and save it at save_loc. nr_iter controls the number of Perceptron training iterations.

Parameters:
  • sentences – A list of (words, tags) tuples.
  • save_loc – If not None, saves a pickled model in this location.
  • nr_iter – Number of training iterations.