class documentation
class ClassifierBasedPOSTagger(ClassifierBasedTagger): (source)
Constructor: ClassifierBasedPOSTagger(feature_detector, train, classifier_builder, classifier, ...)
A classifier based part of speech tagger.
Method | feature |
Return the feature detector that this tagger uses to generate featuresets for its classifier. The feature detector is a function with the signature: |
Inherited from ClassifierBasedTagger
:
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | choose |
Decide which tag should be used for the specified token, and return that tag. If this tagger is unable to determine a tag for the specified token, return None -- do not consult the backoff tagger. This method should be overridden by subclasses of SequentialBackoffTagger. |
Method | classifier |
Return the classifier that this tagger uses to choose a tag for each word in a sentence. The input for this classifier is generated using this tagger's feature detector. See feature_detector() |
Method | _train |
Build a new classifier, based on the given training data tagged_corpus. |
Instance Variable | _classifier |
The classifier used to choose a tag for each token. |
Instance Variable | _cutoff |
Cutoff probability for tagging -- if the probability of the most likely tag is less than this, then use backoff. |
Instance Variable | _feature |
Undocumented |
Inherited from SequentialBackoffTagger
(via ClassifierBasedTagger
):
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 |
Determine an appropriate tag for the specified token, and return that tag. If this tagger is unable to determine a tag for the specified token, then its backoff tagger is consulted. |
Property | backoff |
The backoff tagger for this tagger. |
Instance Variable | _taggers |
A list of all the taggers that should be tried to tag a token (i.e., self and its backoff taggers). |
Inherited from TaggerI
(via ClassifierBasedTagger
, SequentialBackoffTagger
, FeaturesetTaggerI
):
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 | tag |
Apply self.tag() to each element of sentences. I.e.: |
Method | _check |
Undocumented |