ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ROS-PocketSphinx: Getting the probabilities of the words

asked 2015-03-16 08:47:15 -0500

Mosa gravatar image

I use PocketSphinx to do voice recognition. For example I use a language model like this:


I say "Hello world", now I want the list of the probabilities/scores of the recognition. Like for the first word "Hello" a possible match could be:

"Hello" 90%
"Hi" 10%
"World" 30%
"Earth" 30%

I don't know how PocketSphinx represents the probabilities. It is only an example. Has someone a clue? I use this example



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-10-07 12:39:10 -0500

PankajBaranwal gravatar image

updated 2017-10-09 06:21:38 -0500

You asked the same question on stack overflow and Nikolay had posted an answer there.
So, I am just adding a link to that post so that others may find his apt answer.
Correct answer here
The answer says the following:
"You can retrieve individual segments of hypothesis with iterator:
print 'Best hypothesis segments: ', [(seg.word, seg.prob) for seg in decoder.seg()]

seg.prob contains the confidence score. To have a meaningful confidence score you need to make sure your language model is large enough."
Also, there is an updated version of pocketsphinx available for ROS. You can find it here:
You should use that instead.

edit flag offensive delete link more


Its the "uttid" value in partial_result() and final_result() of, also see Using PocketSphinx with GStreamer and Python

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-10-09 02:09:38 -0500 )edit

Do you have any explanation why your linked repository should be used instead?

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-10-09 11:51:50 -0500 )edit

It has updated pocketsphinx features like kws mode, grammar mode etc, has much better wiki, a blog post to explain everything and is being maintained actively
Doesnt need external dependencies like GStreamer
CMUSphinx endorses it: MaxCharLimitReached

PankajBaranwal gravatar image PankajBaranwal  ( 2017-10-09 12:07:52 -0500 )edit

So I guess what that means is that the gstreamer plugin needs some updates?

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-10-30 09:47:09 -0500 )edit

If that's what you got from all of that, then there's nothing left to say.
I just sometimes wish there were as many active code-maintainers in the community as there are fusspots.

PankajBaranwal gravatar image PankajBaranwal  ( 2017-10-31 11:07:33 -0500 )edit

verbose please?

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-10-31 12:50:35 -0500 )edit

Question Tools

1 follower


Asked: 2015-03-16 08:47:15 -0500

Seen: 854 times

Last updated: Oct 09 '17