Trying to get kws working via java. It's almost working except I get a null hypothesis every time.
This is from the cmusphinx faq on how to implement this.
ps_set_keyphrase(ps, "keyphrase_search", "oh mighty computer");
ps_set_search(ps, "keyphrase_search);
ps_start_utt();
/* process data */
There is a setKeyphrase, and a setKws method in decoder.java. That being said the only example I really found was set using config. This is my "working" code below. Doesn't error but is always null. ( If there is an examply of kws in java I cannot find it. The ONLY thing I have really found is the decodertest in the github repo. )
Trying to get kws working via java. It's almost working except I get a null hypothesis every time.
This is from the cmusphinx faq on how to implement this.
There is a setKeyphrase, and a setKws method in decoder.java. That being said the only example I really found was set using config. This is my "working" code below. Doesn't error but is always null. ( If there is an examply of kws in java I cannot find it. The ONLY thing I have really found is the decodertest in the github repo. )
I've also tried adding the line:
I know that kws works via commandline using the same above keyword list which contains:
When run, it hits almost every time.
When I run the above java code I get output every time I speak.
The numbers change slightly. You never see any output of kws as you do when doing it via commandline.
Also. If I add in a line:
Then I get hypothesis every time. It's totally wrong every time but I get one.
Thanks
This is the output when run. -kws is not set.
I found reference to why you don't need the -lm line here.
That answers that.
If I change the above code and remove:
and add:
Now the output shows -kws set and I get this in the output:
Still though, null result.
Am I assuming wrong that kws doesn't return a hyp? There is a great python example but nada for java regarding kws.
I don't even know what to try next.
You already asked your question here:
http://stackoverflow.com/questions/38835583/why-is-pocketsphinx-returning-a-null-hypothesis-via-java-with-kws-works-via-com
and here:
https://sourceforge.net/p/cmusphinx/discussion/help/thread/ffb9fa17/?limit=25
There is no need to ask so many times.