Class Brill
source code
object --+
|
yaml.YAMLObject --+
|
tag.TagI --+
|
Brill
Brill's transformational rule-based tagger. Brill taggers use an initial tagger
(such as tag.Default) to assign an intial 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 BrillRuleI 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 BrillTrainer or FastBrillTrainer.
|
__init__(self,
initial_tagger,
rules)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
|
tag(self,
tokens)
Assign a tag to each token in tokens , and yield a tagged
token of the form (token, tag) |
source code
|
|
|
marshal(self,
filename)
Marshals (saves to a plain text file) the tagger model. |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|
Inherited from yaml.YAMLObject :
from_yaml ,
to_yaml
|
|
_classname = ' BrillTagger '
|
Inherited from yaml.YAMLObject :
yaml_flow_style ,
yaml_tag
|
__init__(self,
initial_tagger,
rules)
(Constructor)
| source code
|
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
- Parameters:
initial_tagger (TagI) - The initial tagger
rules (list of BrillRuleI) - An ordered list of transformation rules that should be used to
correct the initial tagging.
- Overrides:
object.__init__
|
Assign a tag to each token in tokens , and yield a tagged
token of the form (token, tag)
- Overrides:
tag.TagI.tag
- (inherited documentation)
|
Marshals (saves to a plain text file) the tagger model.
- Parameters:
filename (string ) - Name of the file to which save the model (will be overwritten if
it already exists).
|
Unmarshals (loads from a plain text file) the tagger model. This
operation will override any previously stored rules.
- Parameters:
filename (string ) - Name of the file from which the model will be read.
|