class documentation
class StanfordPOSTagger(StanfordTagger): (source)
Constructor: StanfordPOSTagger(*args, **kwargs)
- A class for pos tagging with Stanford Tagger. The input is the paths to:
- a model trained on training data
- (optionally) the path to the stanford tagger jar file. If not specified here, then this jar file must be specified in the CLASSPATH envinroment variable.
- (optionally) the encoding of the training data (default: UTF-8)
Example:
>>> from nltk.tag import StanfordPOSTagger >>> st = StanfordPOSTagger('english-bidirectional-distsim.tagger') >>> st.tag('What is the airspeed of an unladen swallow ?'.split()) [('What', 'WP'), ('is', 'VBZ'), ('the', 'DT'), ('airspeed', 'NN'), ('of', 'IN'), ('an', 'DT'), ('unladen', 'JJ'), ('swallow', 'VB'), ('?', '.')]
Method | __init__ |
Undocumented |
Constant | _JAR |
Undocumented |
Constant | _SEPARATOR |
Undocumented |
Property | _cmd |
A property that returns the command that will be executed. |
Inherited from StanfordTagger
:
Method | parse |
Undocumented |
Method | tag |
Determine the most appropriate tag sequence for the given token sequence, and return a corresponding list of tagged tokens. A tagged token is encoded as a tuple (token, tag). |
Method | tag |
Apply self.tag() to each element of sentences. I.e.: |
Instance Variable | java |
Undocumented |
Instance Variable | _encoding |
Undocumented |
Instance Variable | _input |
Undocumented |
Instance Variable | _stanford |
Undocumented |
Instance Variable | _stanford |
Undocumented |
Inherited from TaggerI
(via StanfordTagger
):
Method | evaluate |
Score the accuracy of the tagger against the gold standard. Strip the tags from the gold standard text, retag it using the tagger, then compute the accuracy score. |
Method | _check |
Undocumented |
overrides
nltk.tag.stanford.StanfordTagger._cmd
A property that returns the command that will be executed.