Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calculate and return hypothesis confidence number #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

farmnerd
Copy link

This PR is a proposal for including a confidence number in the HTTP JSON response. The confidence algorithm is from some commits to the sample full postprocessor: a hypothesis whose kaldi likelihood is relatively much higher than the next hypothesis's likelihood gets a higher confidence number; hypotheses whose likelihoods are closer together get a lower confidence number.

A couple points to notice when considering this PR:

  • If a result contains multiple segments, the overall confidence is the average of all segments' confidences (not sure if there's a better or more standard approach there)
  • It's not exposed in the final result, but I am calculating confidences for all the n-best hypotheses for each segment. The algorithm is the same, except a confidence won't ever be higher than the previous n-best hypothesis's confidence. For example for a 3rd-best hypothesis, I'm not sure if "confidence" means "I'm confident that this is the 3rd best", or if it means "I'm confident that this is the right answer overall". I went with the latter, meaning confidences of later hypotheses will not be greater than confidences of hypotheses earlier in the n-best list.

Comments or suggestions welcome - thanks!

…od numbers. Confidence algorithm borrowed from the sample_full_post_processor commits 2d1be9d and ea87b6a, and implemented in the main master/worker code.
@alumae
Copy link
Owner

alumae commented Jun 17, 2016

Sorry for not checking out this PR earlier.
This seems like a good idea. However, it seems to me that the confidence for the mult-segment hyp should be the product of the confidences of the individual segments. Confidences are like probabilities, and when you combine the probabilities of multiple events, you need to multiply their probabilities. Or do you have any other viewpoint, perhaps from a practical perspective. Of course, this would mean that the confidence of long multi-segment utterance will be very small, but it seems to me that this reflects the reality (after all, you cannot be so sure that at least one word is not correct).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants