class documentation

A processing interface for labeling tokens with a single category label (or "class"). Labels are typically strs or ints, but can be any immutable type. The set of labels that the classifier chooses from must be fixed and finite.

Subclasses must define:
  • labels()
  • either classify() or classify_many() (or both)
Subclasses may define:
  • either prob_classify() or prob_classify_many() (or both)
Method classify No summary
Method classify_many Apply self.classify() to each element of featuresets. I.e.:
Method labels No summary
Method prob_classify No summary
Method prob_classify_many Apply self.prob_classify() to each element of featuresets. I.e.:
def classify(self, featureset): (source)
def classify_many(self, featuresets): (source)

Apply self.classify() to each element of featuresets. I.e.:

return [self.classify(fs) for fs in featuresets]
Returns
list(label)Undocumented
def prob_classify(self, featureset): (source)
Returns
ProbDistIa probability distribution over labels for the given featureset.
def prob_classify_many(self, featuresets): (source)

Apply self.prob_classify() to each element of featuresets. I.e.:

return [self.prob_classify(fs) for fs in featuresets]
Returns
list(ProbDistI)Undocumented