class documentation
An interface for generating lists of transformational rules that apply at given sentence positions. BrillTemplateI is used by Brill training algorithms to generate candidate rules.
Method | applicable |
Return a list of the transformational rules that would correct the i*th subtoken's tag in the given token. In particular, return a list of zero or more rules that would change *tokens*[i][1] to *correctTag... |
Method | get |
Returns the set of indices i such that applicable_rules(token, i, ...) depends on the value of the index*th token of *token. |
overridden in
nltk.tbl.template.Template
Return a list of the transformational rules that would correct the i*th subtoken's tag in the given token. In particular, return a list of zero or more rules that would change *tokens*[i][1] to *correctTag, if applied to *token*[i].
If the *i*th token already has the correct tag (i.e., if tagged_tokens[i][1] == correctTag), then applicable_rules() should return the empty list.
Parameters | |
tokens:list(tuple) | The tagged tokens being tagged. |
i:int | The index of the token whose tag should be corrected. |
correct | The correct tag for the *i*th token. |
Returns | |
list(BrillRule) | Undocumented |
overridden in
nltk.tbl.template.Template
Returns the set of indices i such that applicable_rules(token, i, ...) depends on the value of the index*th token of *token.
This method is used by the "fast" Brill tagger trainer.
Parameters | |
token:list(tuple) | The tokens being tagged. |
index:int | The index whose neighborhood should be returned. |
Returns | |
set | Undocumented |