Package nltk_lite :: Package contrib :: Module marshalbrill :: Class BrillTemplateI
[show private | hide private]
[frames | no frames]

Type BrillTemplateI

object --+
         |
        BrillTemplateI

Known Subclasses:
ProximateTokensTemplate, SymmetricProximateTokensTemplate

An interface for generating lists of transformational rules that apply at given corpus positions. BrillTemplateI is used by Brill training algorithms to generate candidate rules.
Method Summary
  __init__(self)
list of BrillRuleI applicable_rules(self, tokens, i, correctTag)
Return a list of the transformational rules that would correct the ith subtoken's tag in the given token.
Set get_neighborhood(self, token, index)
Returns the set of indices i such that applicable_rules(token, index, ...) depends on the value of the ith subtoken of token.
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Method Details

applicable_rules(self, tokens, i, correctTag)

Return a list of the transformational rules that would correct the ith subtoken's tag in the given token. In particular, return a list of zero or more rules that would change tagged_tokens[i][1] to correctTag, if applied to token.

If the ith subtoken already has the correct tag (i.e., if tagged_tokens[i][1] == correctTag), then applicable_rules should return the empty list.
Parameters:
i - The index of the token whose tag should be corrected.
           (type=int)
correctTag - The correct tag for the ith token.
           (type=(any))
Returns:
list of BrillRuleI

get_neighborhood(self, token, index)

Returns the set of indices i such that applicable_rules(token, index, ...) depends on the value of the ith subtoken of token.

This method is used by the "fast" Brill tagger trainer.
Parameters:
token - The tokens being tagged.
           (type=list of tuple)
index - The index whose neighborhood should be returned.
           (type=int)
Returns:
Set

Generated by Epydoc 2.1 on Tue Sep 5 09:37:21 2006 http://epydoc.sf.net