class documentation
class StanfordNERTagger(StanfordTagger): (source)
Constructor: StanfordNERTagger(*args, **kwargs)
A class for Named-Entity 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 StanfordNERTagger >>> st = StanfordNERTagger('english.all.3class.distsim.crf.ser.gz') # doctest: +SKIP >>> st.tag('Rami Eid is studying at Stony Brook University in NY'.split()) # doctest: +SKIP [('Rami', 'PERSON'), ('Eid', 'PERSON'), ('is', 'O'), ('studying', 'O'), ('at', 'O'), ('Stony', 'ORGANIZATION'), ('Brook', 'ORGANIZATION'), ('University', 'ORGANIZATION'), ('in', 'O'), ('NY', 'LOCATION')]
Method | __init__ |
Undocumented |
Method | parse |
Undocumented |
Constant | _FORMAT |
Undocumented |
Constant | _JAR |
Undocumented |
Constant | _SEPARATOR |
Undocumented |
Property | _cmd |
A property that returns the command that will be executed. |
Inherited from StanfordTagger
:
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.