-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSGF tag specification not supported #13
Comments
I think we can implement it one day, but it's low priority for sure |
Can we expect tag support in the near future? |
No |
Is this feature available in sphinx4? Or not in any sphinx version? |
We are not going to support this, we probably will even drop grammars support altogether in favor of natural language. Grammars are very complex to develop properly, it is much better to develop example-based language model than grammar. To analyze speech recognition results you can use regular expressions, they provide equivalent of tags. |
@nshmyrev - Could you please reconsider? JSGF support is pretty easy to add, and makes processing a whole lot easier! http://jvoicexml.sourceforge.net/ includes a JSGF parser and it's under a compatible license, so the code can be incorporated directly into Sphinx. I copied this parser and integrated with Sphinx in my own project - please take a look and consider adding this to Sphinx itself? https://github.com/candrews/commander/blob/master/plugins/sphinx4/src/main/java/com/integralblue/commander/plugins/sphinx4/RuleParse.java is a simple support class // jsgfGrammar is a edu.cmu.sphinx.jsgf.JSGFGrammar instance that can be be retrieved using the existing Sphinx APIs
// text is a java.lang.String of the text you want to match against the grammar
RuleParse ruleParse = RuleParser.parse(text, jsgfGrammar, null);
// if ruleParse is null, then the text didn't match the grammar
// if ruleParse is not null, then you can get the name of the matched rule using ruleParse.getRuleReference().getRuleName() or the tags using ruleParse.getTags() So really, all Sphinx needs to to add 2 classes. |
Named regular expressions is a universal solution which does not depend on search module, you can use it with grammar or with language models.
See for more details https://blogs.oracle.com/xuemingshen/entry/named_capturing_group_in_jdk7 |
In case you need something more complex consider: |
Except with regular expressions, you have to define a grammar (so Sphinx knows what to expect) totally separately from the parser (which you're saying to do using regular expressions). That repetition is a major problem - why force all users of Sphinx to have to express their grammar in 2 different languages? |
Right, and this is a reason we do not consider grammars as a future of voice interfaces. Writing a good grammar is hard and requires too many experiments. Users never follow the grammar precisely, they can repeat words, they can stop in the middle, they can say something arbitrary. And complex grammars do not increase the accuracy, users just do not follow them. I wrote few posts on that before: http://cmusphinx.sourceforge.net/2014/05/openears-introduces-easy-grammars-for-pocketsphinx/ Also there is a nice discussion here: https://www.linkedin.com/groups/78206/78206-6025612581136326658 With the link to http://videsign.wikispaces.com/How+to+Pick+Synonyms Parsing user intent is also not a trivial thing, but I consider it has to be solved in separate module. If you design voice user interface today, consider using language models instead of grammars. |
@candrews In my experiments with voice command applications, I found that it's better to use a richer formalism than JSGF+tags, namely Grammatical Framework (GF). GF allows you to write a single grammar that converts from natural language to some application format. Part of this grammar can be automatically converted to JSGF to constrain the recognizer. Maybe this could be a solution for you as well. See more at http://kaljurand.github.io/Grammars/ |
GS is great. Another thing to link is https://github.com/plison/opendial, which makes sense in case you look for dialog framework. |
Interesting thing that microsoft also went away from grammars. Now they use constrains. |
which one is the best method either .lm or jsgf grammar for accurate speech recognition |
You're supposed to be able to do things like this:
So if i say, "howdy | good morning", it should return the text "hi". This does not appear to work.
The text was updated successfully, but these errors were encountered: