Search code examples
grammarpocketsphinx

PocketSphinx differences between key phrase and grammar


I'm analyzing the PocketSphinx demo and playing with it to understand better how it works.

I don't understand the main difference between key phrase (in the demo "oh migthy computer") and grammar. I noticed in particular that:

  • key phrase is more robust: the words had to be exactly BUT if the key phrase is made by only one word... just say a single word , and this is interpreted as correct!!!

  • in grammar case, I noticed that I can say every possible word (out of the grammar) and PocketSphinx try to "bring back" a word to its grammar... so if the gramma is i.e. "bye bye baby" if I say "dog cat banana" it understand "bye bye baby"...

So, the question is: how to create a robust grammar (like key phrase) in a way to avoid false positives? Is it perhaps a threshold problem?


Solution

  • It is currently not possible to create robust grammar, this feature is not supported. For that reason it is recommended to use keyword spotting mode if you want to listen continuously.

    Keyphrase can be multiple words and you can also use multiple keyphrases, the sample for that is covered in

    Recognizing multiple keywords using PocketSphinx