Sphinx-4 Confidence Score Demo |
This is a simple command line program that shows how to obtain confidence
scores using Sphinx-4.
NOTE: this work on confidence scores
is still experimental, so please use it with precaution.
When you start up the demo program the following will show:
Loading Recognizer... Sample sentences: the green one right in the middle the purple one on the lower right side the closest purple one on the far left side the only one left on the left Refer to the file confidence.test for a complete list. Start speaking. Press Ctrl-C to quit. <s> <sil> <sil> a purple one on the top right corner </s> (confidence: 0.6045) <s> (confidence: 1) <sil> (confidence: 1) <sil> (confidence: 1) a (confidence: 0.6045) purple (confidence: 1) one (confidence: 1) on (confidence: 1) the (confidence: 1) top (confidence: 1) right (confidence: 1) corner (confidence: 1) </s> (confidence: 1)
As you can see, it will show the confidence of the result as a value between 0 and 1 (in this case its 0.6045). It will also show the confidence of each word in the result. In this case, its all 1's except for the word 'a' (0.6045). Note that the confidence of the result is computed as a product of the confidence of its constituent words, which is why the confidence of the result is 0.6045 in this case.
There is a test file which contains a list of sentences you can say to test the application.
The code for this demo is in Confidence.java, which can serve as example code on how to obtain confidence scores.
Check the bin
directory to see if it has the file
Confidence.jar
. If not, type the following at the top level
directory:
ant -find demo.xml
First make sure that you have JSAPI setup correctly. Then, To run the demo, type:
sphinx4> java -mx200m -jar bin/Confidence.jar
Use the sentences in the test file to test the demo.
NOTE:
lib/sphinx4.jar
is built. If not, go to the top level
directory and type: ant