class documentation
class StanfordTagger(TaggerI): (source)
Known subclasses: nltk.tag.stanford.StanfordNERTagger
, nltk.tag.stanford.StanfordPOSTagger
Constructor: StanfordTagger(model_filename, path_to_jar, encoding, verbose, java_options)
An interface to Stanford taggers. Subclasses must define:
- _cmd property: A property that returns the command that will be executed.
- _SEPARATOR: Class constant that represents that character that is used to separate the tokens from their tags.
- _JAR file: Class constant that represents the jar file name.
Method | __init__ |
Undocumented |
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 |
Constant | _JAR |
Undocumented |
Constant | _SEPARATOR |
Undocumented |
Instance Variable | _encoding |
Undocumented |
Instance Variable | _input |
Undocumented |
Instance Variable | _stanford |
Undocumented |
Instance Variable | _stanford |
Undocumented |
Property | _cmd |
A property that returns the command that will be executed. |
Inherited from TaggerI
:
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 |
def __init__(self, model_filename, path_to_jar=None, encoding='utf8', verbose=False, java_options='-mx1000m'):
(source)
¶
Undocumented
overrides
nltk.tag.api.TaggerI.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).
Returns | |
list(tuple(str, str)) | Undocumented |
overrides
nltk.tag.api.TaggerI.tag_sents
Apply self.tag() to each element of sentences. I.e.:
return [self.tag(sent) for sent in sentences]