class documentation

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_output 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_sents Apply self.tag() to each element of sentences. I.e.:
Instance Variable java_options Undocumented
Instance Variable _encoding Undocumented
Instance Variable _input_file_path Undocumented
Instance Variable _stanford_jar Undocumented
Instance Variable _stanford_model 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_params Undocumented
def __init__(self, *args, **kwargs): (source)
def parse_output(self, text, sentences): (source)
_FORMAT: str = (source)

Undocumented

Value
'slashTags'
_JAR: str = (source)

Undocumented

Value
'stanford-ner.jar'
_SEPARATOR: str = (source)

Undocumented

Value
'/'
@property
_cmd = (source)

A property that returns the command that will be executed.