Package nltk :: Package classify :: Module api :: Class MultiClassifierI
[hide private]
[frames] | no frames]

Class MultiClassifierI

source code

object --+
         |
        MultiClassifierI

A processing interface for labeling tokens with zero or more category labels (or labels). Labels are typically strings or integers, but can be any immutable type. The set of labels that the multi-classifier chooses from must be fixed and finite.

Subclasses must define:

Subclasses may define:

Instance Methods [hide private]
list of (immutable)
labels(self)
Returns: the list of category labels used by this classifier.
source code
set of label
classify(self, featureset)
Returns: the most appropriate set of labels for the given featureset.
source code
ProbDistI
prob_classify(self, featureset)
Returns: a probability distribution over sets of labels for the given featureset.
source code
list of (set of label)
batch_classify(self, featuresets)
Apply self.classify() to each element of featuresets.
source code
list of ProbDistI
batch_prob_classify(self, featuresets)
Apply self.prob_classify() to each element of featuresets.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

    Deprecated
 
batch_probdist(*args, **kwargs) source code
 
probdist(*args, **kwargs) source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

labels(self)

source code 
Returns: list of (immutable)
the list of category labels used by this classifier.

classify(self, featureset)

source code 
Returns: set of label
the most appropriate set of labels for the given featureset.

prob_classify(self, featureset)

source code 
Returns: ProbDistI
a probability distribution over sets of labels for the given featureset.

batch_classify(self, featuresets)

source code 

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

>>> return [self.classify(fs) for fs in featuresets]
Returns: list of (set of label)

batch_prob_classify(self, featuresets)

source code 

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

>>> return [self.prob_classify(fs) for fs in featuresets]
Returns: list of ProbDistI

batch_probdist(*args, **kwargs)

source code 
Decorators:
  • @deprecated("Use .batch_prob_classify() instead.")

Deprecated: Use .batch_prob_classify() instead.

probdist(*args, **kwargs)

source code 
Decorators:
  • @deprecated("Use .prob_classify() instead.")

Deprecated: Use .prob_classify() instead.