简体   繁体   中英

How to get the confidence of a Sphinx4 result hypothesis?

I'm using Sphinx4 as a word reconizer. I've made a little dictionnary and a little grammar for the few words that i want to reconize. The SpeechResult result.getHypothesis() method works fine when i say a word from my grammar but it always give me a grammar result even if I make a sound or I say a random word.

My question is: Is there a way to test the accuracy of the hypothesis? To know if the word said by the user is actually in my grammar or not.

For example imagine a grammar with a single word: car. Is there a way to have a binary result: "user said car"/ "user didn't say car"?

Thanks a lot for your help

I suppose you forgot to enable using the grammar:

configuration.setUseGrammar(true);

Or something similar. To get the confidence you have to use ConfidenceScorer. http://cmusphinx.sourceforge.net/doc/sphinx4/edu/cmu/sphinx/result/ConfidenceScorer.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM