Hello,
in my application I use pocketsphinx 0.7 with fsg (defined through a jsgf
file). While an utterance is being pronounced I wish to detect when the best
path hypotesis is a complete sentence of the rules defined in the jsgf, so
that I can end the utterance after a shorter period of silence after user's
voice when the sentence seems to be completed, and a longer period when the
sentence is half way.
I know that the string returned by ps_get_hyp() just before calling
ps_end_utt() can be different from the one returned after, but for my grammar
it happens almost never, so it is not be a problem for me.
A trivial solution could be to have my application continously check if the
string returned by ps_get_hyp() matches some of the complete phrases of the
grammar, but to do this I would have to parse the jsgf file myself, so it
would be much more convenient if I can get this information from somewhere
inside sphinx.
Thanks for any help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
know that the string returned by ps_get_hyp() just before calling
ps_end_utt() can be different from the one returned after, but for my grammar
it happens almost never, so it is not be a problem for me.
And I recommend you to disable fwdflat and bestpath, they aren't really usable
for small vocabulary.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you very much for the help.
I set fwdflat and bestpath to false and now it is much better.
I tried ps_get_hyp_final and it works when I use a grammar without nested
rules, for example:
public<first_rule>=goaway;
but if I use a grammar with nested rules ps_get_hyp_final always says that the
hyp is not final, for example:
Hello,
in my application I use pocketsphinx 0.7 with fsg (defined through a jsgf
file). While an utterance is being pronounced I wish to detect when the best
path hypotesis is a complete sentence of the rules defined in the jsgf, so
that I can end the utterance after a shorter period of silence after user's
voice when the sentence seems to be completed, and a longer period when the
sentence is half way.
I know that the string returned by ps_get_hyp() just before calling
ps_end_utt() can be different from the one returned after, but for my grammar
it happens almost never, so it is not be a problem for me.
A trivial solution could be to have my application continously check if the
string returned by ps_get_hyp() matches some of the complete phrases of the
grammar, but to do this I would have to parse the jsgf file myself, so it
would be much more convenient if I can get this information from somewhere
inside sphinx.
Thanks for any help.
Hello
I've just added API call to find this (ps_get_hyp_final) to pocketsphinx
trunk.
And I recommend you to disable fwdflat and bestpath, they aren't really usable
for small vocabulary.
Thank you very much for the help.
I set fwdflat and bestpath to false and now it is much better.
I tried ps_get_hyp_final and it works when I use a grammar without nested
rules, for example:
but if I use a grammar with nested rules ps_get_hyp_final always says that the
hyp is not final, for example:
These are the two fsgs produced:
Without nesting
With nesting
Hello
This issue should be fixed in trunk, please update.
Thank you very much! Now it works well for me. Very useful feature.