if len(senses)==0:
return None
probs = [self.__prob__(context, self.vs[sense]) for sense in senses]
return senses[np.argmax(probs)], max(probs)
// TODO: manage situation where senses is empty
// Example:
// text = "However , the term mouse can also be applied to species outside of this genus . Mouse often refers to any small muroid rodent , while rat refers to larger muroid rodents"
After Change
return None
context = [ctx for ctx in context if ctx in self.vc] // this check happens in __prob__
prob_dist = [self.__prob__(context, self.vs[sense]) for sense in senses]
e_confidence = self.entropy(prob_dist)
diff_confidence = self.diff_confidence(prob_dist)
// return sense (word//id), probability, entropy confidence, differences confidence, prob_dist and length of context
return senses[np.argmax(prob_dist)], prob_dist, e_confidence, diff_confidence, len(context)
// Example: