Tagged: dynamic grammar, jsgf
- This topic has 16 replies, 2 voices, and was last updated 9 years, 7 months ago by Halle Winkler.
-
AuthorPosts
-
August 14, 2014 at 11:02 pm #1022221hg111Participant
Hi Halle,
You mentioned that OpenEarsSampleApp already has a .gram and .dic files but I’m unable to find them. Can you direct me to these files and if you have any example of how they are used that will be great,
Thank you in advance,
Kind regards
Hg
August 14, 2014 at 11:16 pm #1022222Halle WinklerPolitepixWelcome,
Check out this blog post to learn how to use OpenEars’ grammar tools:
https://www.politepix.com/2014/04/10/openears-1-7-introducing-dynamic-grammar-generation/
There is also a grammar example in the tutorial now.
August 15, 2014 at 12:33 am #1022233hg111ParticipantYes, nice post.
After turning the flag LanguageModelIsJSGF:TRUE
I get:“The file you have sent to the decoder appears to be an ARPA-style language model, but you have set LanguageModelIsJSGF to true…”
So what am I doing wrong?
Hv
August 15, 2014 at 8:19 am #1022242Halle WinklerPolitepixDid you successfully create your grammar?
August 15, 2014 at 10:23 pm #1022256hg111Participantnot yet. I was hoping to first try the grammar that comes with the example. I was hoping to see it in action before I add or modify anything.
Should I not expect to be able and distinguish between background noise and the example (English) model by simply running the example?
August 16, 2014 at 6:54 pm #1022265Halle WinklerPolitepixnot yet. I was hoping to first try the grammar that comes with the example.
Which grammar are you referring to? The issue is that you set LanguageModelIsJSGF to TRUE but it is still an ARPA language model being sent to the PocketsphinxController instance, so we just have to figure out why it isn’t a grammar being submitted.
August 17, 2014 at 10:40 pm #1022278hg111ParticipantSorry for the late reply…
The grammar I was trying to use is the first default English model, so using words like Go, left, right, backward, forward…
August 18, 2014 at 8:14 am #1022279Halle WinklerPolitepixOK, the error is because that isn’t a grammar, it’s an ARPA language model. If you read through the blog post it explains how to make your own grammar and use it with PocketsphinxController.
August 19, 2014 at 11:24 pm #1022301hg111ParticipantOkay thx, let me try and create new grammar…
August 28, 2014 at 7:24 am #1022390hg111ParticipantHi Halle,
It appears that I am now able to generate the grammar (as below) but if I turn LanguageModelIsJSGF to TRUE, it won’t start speech recognition. Also, the content of the generated grammar in the .dic file looks like the array and not the dictionary file I created (based on your blog example) It seems to always generate the file based on the Array and not the dictionary. Not sure what I’m doing wrong? Can you tell?
Thank you
hg
2014-08-27 23:09:18.165 OpenEarsTest[2296:793421] Dynamic language generator completed successfully, you can find your new files FirstOpenEarsDynamicLanguageModel.DMP
and
FirstOpenEarsDynamicLanguageModel.dic
at the paths
/var/mobile/Containers/Data/Application/20681198-FA77-4878-9109-57CBC02524C6/Library/Caches/FirstOpenEarsDynamicLanguageModel.DMP
and
/var/mobile/Containers/Data/Application/20681198-FA77-4878-9109-57CBC02524C6/Library/Caches/FirstOpenEarsDynamicLanguageModel.diccontent of .dic file:
BACKWARD B AE K W ER D
CENTER S EH N T ER
CENTER(2) S EH N ER
CHANGE CH EY N JH
FORWARD F AO R W ER D
GO G OW
LEFT L EH F T
MODEL M AA D AH L
RIGHT R AY T
TURN T ER NAugust 28, 2014 at 7:29 am #1022391Halle WinklerPolitepixHello,
That is still generating a language model. The blog post and the docs show how to generate a grammar instead. To troubleshoot, always show your generation code and all of your OpenEarsLogging and your verbosePocketsphinx output.
August 28, 2014 at 8:16 am #1022392hg111ParticipantHalle,
You are right of course. I just realized from your last email when you said ‘and the docs’ that I am missing the main openears docs. (shame on me :) I was unfamiliar with ‘webloc’ …) As soon as I downloaded the docs I see the class I need to use generateGrammarFromDictionary instead of generateLanguageModelFromArray. I should be able to get it right now.
Thank you
hg
August 28, 2014 at 8:42 am #1022395Halle WinklerPolitepixSuper, glad the docs helped!
August 28, 2014 at 8:39 pm #1022402hg111ParticipantHi Halle,
Now getting some initial success with the new grammar I generated although it still seems to get confused by spoken words or phrases that are not in the dictionary. Is there a way to exclude these better? Can they not be excluded without ‘Reject’bv
I read something about Rejecto which I don’t mind to purchase if there is no other way to filter non-relevant words, but I’m unclear about the bundle ID restriction. Right now I am using 2 different bundle IDs in development. I may need another one when I go for deployment. Does that mean that I will have to purchase 3 licenses?
August 29, 2014 at 8:55 am #1022407Halle WinklerPolitepixRejecto doesn’t currently work with grammars, but yes, you would need a license for each bundle ID. Generally in these cases I can give you a discount if it’s very clear that the bundles are for the same shipping app, so email to discuss that.
If your grammar is frequently picking up random utterances that can sometimes indicate that it doesn’t have a lot of complexity – can you tell me a bit about the grammar? How many words/syllables are in a legal utterance in your grammar?
September 1, 2014 at 4:55 pm #1022432hg111ParticipantHi Halle,
Thank you very much for offering a discount and sorry for the delay in response. Are you able to email me directly regarding the details? (I rather not publish my email) I plan to purchase as soon as I’m done testing the grammar, even if it can’t work with the grammar model for now. You are right that I don’t have a lot of complexity and was in fact trying to keep it as simple as possible. So for now, the basic ‘robotic commands’ that you had by default in the given example will suffice for, as bellow:
NSDictionary *grammarDictionary = @{
ThisWillBeSaidOnce : @[
@{ OneOfTheseCanBeSaidOnce : @[@”HELLO ROBOT”, @”GREETINGS ROBOT”]},
@{ThisWillBeSaidOnce : @[
@{ OneOfTheseCanBeSaidOnce : @[@”GO”, @”MOVE”, @”TURN”]},
@{ OneOfTheseWillBeSaidOnce : @[@”LEFT”, @”RIGHT”, @”FORWARD”, @”BACKWARD”, @”CENTER”, @”FACE ME”]}
]},
]
};So, having the system recognize a few simple words or at most two words phrases (which I’ll want to customize further and add a few more later), rather than complex sentences is preferred for my case. But is should not confuse for example: “THAT’S RIGHT” with “MOVE RIGHT”.
What do you think?
Haggai
September 2, 2014 at 8:06 am #1022435Halle WinklerPolitepixHi,
It’s fine to get in touch with my via the contact form here:
https://www.politepix.com/contact
What do you think?
The most important thing is to develop and test for your real usage case, because a speech UI is one of those things where the best approach may be very different depending on the purpose of your app. It’s good to use a grammar if your ideal interaction can be described by rules, which might not be the case if it is very simple – if you want to pick up individual words you don’t really get ahead by using a grammar. Two-word phrases are a reasonable use for a grammar, but if you are trying to distinguish between a small number of different phrases and each phrase has the same number of syllables, there is a heightened probability of phrases being mistaken for each other under adverse conditions. Is this the issue? Can we talk more concretely about your actual grammar?
-
AuthorPosts
- You must be logged in to reply to this topic.