Package nltk :: Package tag :: Module brill :: Class BrillTagger
[hide private]
[frames] | no frames]

YAMLObjectMetaclass BrillTagger

source code

     object --+    
              |    
    api.TaggerI --+
                  |
     object --+   |
              |   |
yaml.YAMLObject --+
                  |
                 BrillTagger

Brill's transformational rule-based tagger. Brill taggers use an initial tagger (such as tag.DefaultTagger) to assign an initial tag sequence to a text; and then apply an ordered list of transformational rules to correct the tags of individual tokens. These transformation rules are specified by the BrillRule interface.

Brill taggers can be created directly, from an initial tagger and a list of transformational rules; but more often, Brill taggers are created by learning rules from a training corpus, using either BrillTaggerTrainer or FastBrillTaggerTrainer.

Nested Classes [hide private]

Inherited from yaml.YAMLObject: yaml_dumper, yaml_loader

Instance Methods [hide private]
 
__init__(self, initial_tagger, rules) source code
 
rules(self) source code
list of (token, tag)
tag(self, tokens)
Determine the most appropriate tag sequence for the given token sequence, and return a corresponding list of tagged tokens.
source code

Inherited from api.TaggerI: batch_tag, evaluate

Inherited from api.TaggerI (private): _check_params

Class Methods [hide private]

Inherited from yaml.YAMLObject: from_yaml, to_yaml

Class Variables [hide private]
  yaml_tag = '!nltk.BrillTagger'

Inherited from yaml.YAMLObject: yaml_flow_style

Method Details [hide private]

__init__(self, initial_tagger, rules)
(Constructor)

source code 
Parameters:
  • initial_tagger (TaggerI) - The initial tagger
  • rules (list of BrillRule) - An ordered list of transformation rules that should be used to correct the initial tagging.
Overrides: object.__init__

tag(self, tokens)

source code 

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 of (token, tag)
Overrides: api.TaggerI.tag
(inherited documentation)