예제 #1
0
파일: api.py 프로젝트: 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()
예제 #2
0
파일: api.py 프로젝트: 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()