HomeForumsOpenEarsusing JSGF only reads one public grammar

Tagged: ,

This topic has 3 voices, contains 3 replies, and was last updated by  Joseph S. Wisniewski 172 days ago.

Viewing 4 posts - 1 through 4 (of 4 total)
Author Posts
Author Posts
November 25, 2011 at 10:52 am #8184

JappDev

Hi,

First of all, thank you so much for all your hard work, Halle. I’m really enjoying exploring your code and trying things out.
Currently, I’m having problems with my JSGF .gram file. It’s able to read one (either the first or the last randomly) grammar but skips the rest. Here is my sample .gram file.
—-
#JSGF V1.0;

grammar simpleExample;

public = WHAT IS A ( BUS | BIKE | CARPET | CARD | HAT | CAP | CHICKEN | HORSE);

public = WHAT IS THE TIME;

public = WHERE ARE WE;

—-

Just to note, WordPress stripped out the pointy brackets with the name of the grammar from my example above so they’re in there too.

Am I doing something wrong here? I’ve read a lot of documentation on how to write them and I think I’ve done it correctly. If it is correct, is anyone else having the same problem?

I’d appreciate any help with this.

Regards,

Me.

  • This reply was modified 175 days ago by  JappDev.
November 25, 2011 at 12:05 pm #8186

Halle

Hi,

I don’t give support for writing JSGF here, but I can at least reassure you that other developers’ JSGFs work with OpenEars (other than rules importing, which isn’t supported) so I would investigate your syntax further. I think that the CMU Sphinx board might be a better place to get JSGF writing support, especially since they don’t strip html formatting, but otherwise it’s possible that another OpenEars user might help you out.

November 26, 2011 at 2:01 am #8187

JappDev

Thanks, Halle, I’ll look into that. I’m pretty sure my syntax is fine though so I’m looking forward to receiving feedback from others as to whether they’ve experienced the same problem.

November 28, 2011 at 3:35 pm #8192

Joseph S. Wisniewski

The Pocketsphinx JSGF compiler is incomplete. It only supports one public grammar per file, and it does not support importing.

The Sphinx folks really treat JSGF as a second class citizen. Aside from the incomplete JSGF implementation, every nesting feature (parenthesis, brackets, etc.) is slightly broken in that they all insert excess null arcs (a path with no word on it) into the FSG graph (the “network” of what word can follow another). This wouldn’t normally be a problem, but Pocketsphinx is a three-pass recognizer, and it generates a quick bigram and trigram language model (list of what word can follow another) from the FSG for the first and second passes, and only uses the actual FSG for the third pass, so the extra null arcs make it waste time evaluating things that can’t actually happen.

In your grammar, if you said “what is a chicken”, Pocketsphinx would explore things like “what is a cap hat” or even “bike bus chicken” in the first and second pass, in addition to the “legal” phrases like “what is a chicken” or “what is a bike”. The last pass, through the actual FSG, should weed out everything but “what is a chicken”, but it does slow things down. There’s also occasional cases where searching through “junk” in the first or second pass fills the recognizer memory totally and it doesn’t have room for the “right answer”. For my particular grammar, using a Sphinx JSGF instead of using my own FSG doubles recognition time and increases errors about 5%.

Not much we can do, aside from taking Spkinx JSGF support as it is. They’re not going to fix it.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.