Example #1
0
File: api.py Project: jcnelson/iftd
 def classify(self, featureset):
     """
     @return: the most appropriate label for the given featureset.
     @rtype: label
     """
     if overridden(self.batch_classify):
         return self.batch_classify([featureset])[0]
     else:
         raise NotImplementedError()
Example #2
0
File: api.py Project: jcnelson/iftd
 def prob_classify(self, featureset):
     """
     @return: a probability distribution over labels for the given
         featureset.
     @rtype: L{ProbDistI <nltk.probability.ProbDistI>}
     """
     if overridden(self.batch_prob_classify):
         return self.batch_prob_classify([featureset])[0]
     else:
         raise NotImplementedError()