Accuracy with just one word in the dictionary

Home Forums OpenEars Accuracy with just one word in the dictionary

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

  • Author
    Posts
  • #1025270
    maxgarmar
    Participant

    Hi Halle,

    I am back again. I would like to know something.

    My dictionary is created by the user, ok so when for instance there is just one word inside of it then almost every word (99% of times) I speak to the engine, it returns always a result of the word that is already inside with a score of 0 which mean that the recognition is perfect.

    Example, if you would like to try: I have only “water” word in my Dict and then I speak to the engine and I say “Kiosk”, then the result is “Water” with “0” scored.
    To me it is not a good result because if the user says a word different to the one which is in the Dict then it should return with a message “please add your new word to the dictionary please”. Even sometimes if I just say “aaaaa” then it returns “water” with “0” scored as well…

    What am I doing wrong ?

    My configuration for setVadThreshold is 3.0 for iPhone 5 or simulator, if this helps you, and the dictionary selected is English.

    Thank you very much.

    Maxi

    #1025287
    Halle Winkler
    Politepix

    Hi Max,

    This is called the out-of-vocabulary problem and is a general problem with speech recognition with such small vocabularies. You can create a grammar and see if that works better for you, or consider trying out Rejecto since it was designed to help with this challenge.

    #1025289
    maxgarmar
    Participant

    Hi Halle,

    Thanks for the answer.
    Ok I will think about using rejecto but what do you mean creating a grammar ? How can I create it ?

    Thanks

    #1025290
    Halle Winkler
    Politepix

    Sure, check this out:

    https://www.politepix.com/2014/04/10/openears-1-7-introducing-dynamic-grammar-generation/

    and then take a look at the grammar-related methods in the OELanguageModelGenerator and OEPocketsphinxController headers/docs.

    #1025338
    maxgarmar
    Participant

    Hi Halle,

    Trying to create the dictionary with grammar like this:

     NSDictionary *grammar = @{
                                          ThisWillBeSaidOnce : @[
                                                  @{ OneOfTheseWillBeSaidOnce : @[@"CREATE A TASK", @"CREATE A TASK FOR", @"TASK FOR"]},
                                                  @{ OneOfTheseWillBeSaidOnce : @[@"YURIY", @"JOHN", @"ANN"]},
                                                  ]
                                          };
                
                [dictRecognition setObject:array forKey:@"OneOfTheseCanBeSaidOnce"];
    
                
                //err = [lmGenerator generateLanguageModelFromArray:words withFilesNamed:name forAcousticModelAtPath:[OEAcousticModel pathToModel:voiceLanguage]]; // Change "AcousticModelEnglish" to "AcousticModelSpanish" to create a Spanish language model instead of an English one.
                
                 err = [lmGenerator generateGrammarFromDictionary:grammar withFilesNamed:name forAcousticModelAtPath:[OEAcousticModel pathToModel:voiceLanguage]];
                
                
            }
            
            // Call this once before setting properties of the OEPocketsphinxController instance.
            
            
            
            
            if([err code] == noErr) {
                
                
               self.pathToFirstDynamicallyGeneratedLanguageModel = [lmGenerator pathToSuccessfullyGeneratedLanguageModelWithRequestedName:@"NameIWantForMyLanguageModelFiles"];
               self.pathToFirstDynamicallyGeneratedDictionary =  [lmGenerator pathToSuccessfullyGeneratedDictionaryWithRequestedName:@"NameIWantForMyLanguageModelFiles"];
                
                NSLog(@"path1: %@", self.pathToFirstDynamicallyGeneratedLanguageModel);
                
                NSLog(@"path2: %@", self.pathToFirstDynamicallyGeneratedDictionary);
                
                
            } else {
                NSLog(@"Error: %@",[err localizedDescription]);
            }
            
            ///FIN openEars
            
            [self.openEarsEventsObserver setDelegate:self];
    
            if(![OEPocketsphinxController sharedInstance].isListening){
                
                
                
                [self.pocketsphinxController            startListeningWithLanguageModelAtPath:self.pathToFirstDynamicallyGeneratedLanguageModel dictionaryAtPath:self.pathToFirstDynamicallyGeneratedDictionary acousticModelAtPath:[OEAcousticModel pathToModel:voiceLanguage] languageModelIsJSGF:TRUE];
                
                 }
    

    I get this error:

    2015-04-07 14:46:13.783 QuickCart[8478:256415] Error: you have invoked the method:

    startListeningWithLanguageModelAtPath:(NSString *)languageModelPath dictionaryAtPath:(NSString *)dictionaryPath acousticModelAtPath:(NSString *)acousticModelPath languageModelIsJSGF:(BOOL)languageModelIsJSGF

    with a languageModelPath which is nil. If your call to OELanguageModelGenerator did not return an error when you generated this language model, that means the correct path to your language model that you should pass to this method’s languageModelPath argument is as follows:

    NSString *correctPathToMyLanguageModelFile = [NSString stringWithFormat:@”%@/TheNameIChoseForMyLanguageModelAndDictionaryFile.%@”,[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0],@”DMP”];

    Feel free to copy and paste this code for your path to your language model, but remember to replace the part that says “TheNameIChoseForMyLanguageModelAndDictionaryFile” with the name you actually chose for your language model and dictionary file or you will get this error again.

    What am I doing wrong ? I tried also with

    languageModelIsJSGF

    to

    false

    but does not help.

    Thanks

    #1025341
    Halle Winkler
    Politepix

    Hello,

    This:

    [lmGenerator pathToSuccessfullyGeneratedLanguageModelWithRequestedName:@”NameIWantForMyLanguageModelFiles”];

    should be this:

    [lmGenerator pathToSuccessfullyGeneratedGrammarWithRequestedName:@”NameIWantForMyLanguageModelFiles”];

    Not your fault; I need to call this out more in the instructions since it is coming up a lot.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.