class_docstr: Greedy Averaged Perceptron tagger, as implemented by Matthew Honnibal.
  See more implementation details here:
  https://explosion.ai/blog/part-of-speech-pos-tagger-in-python
  
  >>> from nltk.tag.perceptron import PerceptronTagger
  
  Train the model
  
  >>> tagger = PerceptronTagger(load=False)
  
  >>> tagger.train([[('today','NN'),('is','VBZ'),('good','JJ'),('day','NN')],
  ... [('yes','NNS'),('it','PRP'),('beautiful','JJ')]])
  
  >>> tagger.tag(['today','is','a','beautiful','day'])
  [('today', 'NN'), ('is', 'PRP'), ('a', 'PRP'), ('beautiful', 'JJ'), ('day', 'NN')]
  
  Use the pretrain model (the default constructor)
  
  >>> pretrain = PerceptronTagger()
  
  >>> pretrain.tag('The quick brown fox jumps over the lazy dog'.split())
  [('The', 'DT'), ('quick', 'JJ'), ('brown', 'NN'), ('fox', 'NN'), ('jumps', 'VBZ'), ('over', 'IN'), ('the', 'DT'), ('lazy', 'JJ'), ('dog', 'NN')]
  
  >>> pretrain.tag("The red cat".split())
  [('The', 'DT'), ('red', 'JJ'), ('cat', 'NN')]
class_docstr_tok: ["Greedy","Averaged","Perceptron","tagger",",","as","implemented","by","Matthew","Honnibal",".","See","more","implementation","details","here",":","https",":","\/\/explosion.ai\/blog\/part-of-speech-pos-tagger-in-python",">",">",">","from","nltk.tag.perceptron","import","PerceptronTagger","Train","the","model",">",">",">","tagger","=","PerceptronTagger","(","load=False",")",">",">",">","tagger.train","(","[","[","(","'today","'",",","'NN","'",")",",","(","'is","'",",","'VBZ","'",")",",","(","'good","'",",","'JJ","'",")",",","(","'day","'",",","'NN","'",")","]",",","...","[","(","'yes","'",",","'NNS","'",")",",","(","'it","'",",","'PRP","'",")",",","(","'beautiful","'",",","'JJ","'",")","]","]",")",">",">",">","tagger.tag","(","[","'today","'",",","'is","'",",","'","a","'",",","'beautiful","'",",","'day","'","]",")","[","(","'today","'",",","'NN","'",")",",","(","'is","'",",","'PRP","'",")",",","(","'","a","'",",","'PRP","'",")",",","(","'beautiful","'",",","'JJ","'",")",",","(","'day","'",",","'NN","'",")","]","Use","the","pretrain","model","(","the","default","constructor",")",">",">",">","pretrain","=","PerceptronTagger","(",")",">",">",">","pretrain.tag","(","'The","quick","brown","fox","jumps","over","the","lazy","dog'.split","(",")",")","[","(","'The","'",",","'DT","'",")",",","(","'quick","'",",","'JJ","'",")",",","(","'brown","'",",","'NN","'",")",",","(","'fox","'",",","'NN","'",")",",","(","'jumps","'",",","'VBZ","'",")",",","(","'over","'",",","'IN","'",")",",","(","'the","'",",","'DT","'",")",",","(","'lazy","'",",","'JJ","'",")",",","(","'dog","'",",","'NN","'",")","]",">",">",">","pretrain.tag","(","``","The","red","cat","''",".split","(",")",")","[","(","'The","'",",","'DT","'",")",",","(","'red","'",",","'JJ","'",")",",","(","'cat","'",",","'NN","'",")","]"]
docstr: :param load: Load the pickled model upon instantiation.
docstr_tok: [":","param","load",":","Load","the","pickled","model","upon","instantiation","."]
code: def __init__(self, load=True):
      """
      :param load: Load the pickled model upon instantiation.
      """
      self.model = AveragedPerceptron()
      self.tagdict = {}
      self.classes = set()
      if load:
          AP_MODEL_LOC = "file:" + str(
              find("taggers/averaged_perceptron_tagger/" + PICKLE)
          )
          self.load(AP_MODEL_LOC)
  
imports: import logging
  import pickle
  import random
  from collections import defaultdict
  from nltk import jsontags
  from nltk.data import find, load
  from nltk.tag.api import TaggerI
label_desc: Use image node_id 1 to create a new PerceptronTagger object from inherited base classes: TaggerI with example: obj = PerceptronTagger(load)