- This topic has 10 replies, 2 voices, and was last updated 7 years, 7 months ago by Halle Winkler.
-
AuthorPosts
-
April 8, 2016 at 6:13 am #1029990PowerkeyParticipant
I am trying to utilize OpenEars in an iOS app with Swift. Be forewarned, I am a new iOS programmer and the answer is probably something obvious.
I am getting an error loading the lookup Dictionary. Here is the log…
2016-04-07 20:39:14.597 TalkApp[2446:705474] Starting OpenEars logging for OpenEars version 2.501 on 64-bit device (or build): iPhone running iOS version: 9.300000 2016-04-07 20:39:38.939 TalkApp[2446:705474] Starting dynamic language model generation 2016-04-07 20:39:38.986 TalkApp[2446:705474] Done creating language model with CMUCLMTK in 0.046453 seconds. 2016-04-07 20:39:38.987 TalkApp[2446:705474] Since there is no cached version, loading the language model lookup list for the acoustic model called AcousticModelEnglish 2016-04-07 20:39:38.987 TalkApp[2446:705474] Error: an attempt was made to load the lookup dictionary for the acoustic model at the path AcousticModelEnglish and it wasn't possible to complete. This file does not appear to exist. Please ask for help in the forums and be sure to turn on all logging. An exception or unpredictable behavior should be expected now since this file is a requirement. 2016-04-07 20:39:38.991 TalkApp[2446:705474] Additionally, there was an error of Error Domain=NSCocoaErrorDomain Code=260 "The file “LanguageModelGeneratorLookupList.text” couldn’t be opened because there is no such file." UserInfo={NSFilePath=AcousticModelEnglish/LanguageModelGeneratorLookupList.text, NSUnderlyingError=0x13455bb10 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2016-04-07 20:39:48.857 TalkApp[2446:705474] Creating shared instance of OEPocketsphinxController
April 8, 2016 at 6:25 pm #1029993Halle WinklerPolitepixWelcome,
The log looks a little odd, are you sure nothing has been accidentally removed from it?
April 8, 2016 at 7:33 pm #1029996PowerkeyParticipantI spaced the message out to be more readable and changed the name of the app. No other edits. After I posted, I noticed that there are other logging routines that I had not enabled. Should I do that and re-submit the log?
April 8, 2016 at 7:37 pm #1029997PowerkeyParticipantJust in case I did accidentally delete something, here is the log as-is…
2016-04-08 10:33:02.560 TalkApp[2769:807010] Starting OpenEars logging for OpenEars version 2.501 on 64-bit device (or build): iPhone running iOS version: 9.300000 2016-04-08 10:33:04.202 TalkApp[2769:807010] Starting dynamic language model generation 2016-04-08 10:33:04.293 TalkApp[2769:807010] Done creating language model with CMUCLMTK in 0.091069 seconds. 2016-04-08 10:33:04.294 TalkApp[2769:807010] Since there is no cached version, loading the language model lookup list for the acoustic model called AcousticModelEnglish 2016-04-08 10:33:04.295 TalkApp[2769:807010] Error: an attempt was made to load the lookup dictionary for the acoustic model at the path AcousticModelEnglish and it wasn't possible to complete. This file does not appear to exist. Please ask for help in the forums and be sure to turn on all logging. An exception or unpredictable behavior should be expected now since this file is a requirement. 2016-04-08 10:33:04.298 TalkApp[2769:807010] Additionally, there was an error of Error Domain=NSCocoaErrorDomain Code=260 "The file “LanguageModelGeneratorLookupList.text” couldn’t be opened because there is no such file." UserInfo={NSFilePath=AcousticModelEnglish/LanguageModelGeneratorLookupList.text, NSUnderlyingError=0x15457add0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2016-04-08 10:33:10.254 TalkApp[2769:807010] Creating shared instance of OEPocketsphinxController 2016-04-08 10:33:10.266 TalkApp[2769:807010] Attempting to start listening session from startListeningWithLanguageModelAtPath: 2016-04-08 10:33:10.267 TalkApp[2769:807010] Error: you have invoked the method: startListeningWithLanguageModelAtPath:(NSString *)languageModelPath dictionaryAtPath:(NSString *)dictionaryPath acousticModelAtPath:(NSString *)acousticModelPath languageModelIsJSGF:(BOOL)languageModelIsJSGF with a dictionaryPath which is nil. If your call to OELanguageModelGenerator did not return an error when you generated this language model or grammar, that means the correct path to your phonetic dictionary that you should pass to this method's dictionaryPath argument is as follows: NSString *correctPathToMyPhoneticDictionaryFile = [myLanguageModelGenerator pathToSuccessfullyGeneratedDictionaryWithRequestedName:@"TheNameIChoseForMyVocabulary"]; Feel free to copy and paste this code for your path to your phonetic dictionary, but remember to replace the part that says "TheNameIChoseForMyVocabulary" with the name you actually chose for your grammar or language model or you will get this error again (and replace myLanguageModelGenerator with the name of your OELanguageModelGenerator instance). Since this file is required, expect an exception or undocumented behavior shortly.
April 8, 2016 at 7:40 pm #1029998Halle WinklerPolitepixSure, it couldn’t hurt to see the complete logging with all logging options on. Please leave everything in the log as-is – it’s OK to change the app name only, as long as you do a search-and-replace to change it everywhere in the log so it isn’t confusing.
April 8, 2016 at 7:57 pm #1029999PowerkeyParticipantOkay, OELogging and verbosePocketSphinx are enabled…
2016-04-08 10:53:47.992 TalkApp[2774:811646] Starting OpenEars logging for OpenEars version 2.501 on 64-bit device (or build): iPhone running iOS version: 9.300000 2016-04-08 10:53:47.993 TalkApp[2774:811646] Creating shared instance of OEPocketsphinxController 2016-04-08 10:53:48.039 TalkApp[2774:811646] Starting dynamic language model generation INFO: ngram_model_arpa_legacy.c(504): ngrams 1=37, 2=70, 3=35 INFO: ngram_model_arpa_legacy.c(136): Reading unigrams INFO: ngram_model_arpa_legacy.c(543): 37 = #unigrams created INFO: ngram_model_arpa_legacy.c(196): Reading bigrams INFO: ngram_model_arpa_legacy.c(561): 70 = #bigrams created INFO: ngram_model_arpa_legacy.c(562): 3 = #prob2 entries INFO: ngram_model_arpa_legacy.c(570): 3 = #bo_wt2 entries INFO: ngram_model_arpa_legacy.c(293): Reading trigrams INFO: ngram_model_arpa_legacy.c(583): 35 = #trigrams created INFO: ngram_model_arpa_legacy.c(584): 2 = #prob3 entries INFO: ngram_model_dmp_legacy.c(521): Building DMP model... INFO: ngram_model_dmp_legacy.c(551): 37 = #unigrams created INFO: ngram_model_dmp_legacy.c(652): 70 = #bigrams created INFO: ngram_model_dmp_legacy.c(653): 3 = #prob2 entries INFO: ngram_model_dmp_legacy.c(660): 3 = #bo_wt2 entries INFO: ngram_model_dmp_legacy.c(664): 35 = #trigrams created INFO: ngram_model_dmp_legacy.c(665): 2 = #prob3 entries 2016-04-08 10:53:48.086 TalkApp[2774:811646] Done creating language model with CMUCLMTK in 0.045739 seconds. 2016-04-08 10:53:48.086 TalkApp[2774:811646] Since there is no cached version, loading the language model lookup list for the acoustic model called AcousticModelEnglish 2016-04-08 10:53:48.087 TalkApp[2774:811646] Error: an attempt was made to load the lookup dictionary for the acoustic model at the path AcousticModelEnglish and it wasn't possible to complete. This file does not appear to exist. Please ask for help in the forums and be sure to turn on all logging. An exception or unpredictable behavior should be expected now since this file is a requirement. 2016-04-08 10:53:48.091 TalkApp[2774:811646] Additionally, there was an error of Error Domain=NSCocoaErrorDomain Code=260 "The file “LanguageModelGeneratorLookupList.text” couldn’t be opened because there is no such file." UserInfo={NSFilePath=AcousticModelEnglish/LanguageModelGeneratorLookupList.text, NSUnderlyingError=0x13e667d10 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} 2016-04-08 10:53:48.091 TalkApp[2774:811646] Attempting to start listening session from startListeningWithLanguageModelAtPath: 2016-04-08 10:53:48.092 TalkApp[2774:811646] Error: you have invoked the method: startListeningWithLanguageModelAtPath:(NSString *)languageModelPath dictionaryAtPath:(NSString *)dictionaryPath acousticModelAtPath:(NSString *)acousticModelPath languageModelIsJSGF:(BOOL)languageModelIsJSGF with a dictionaryPath which is nil. If your call to OELanguageModelGenerator did not return an error when you generated this language model or grammar, that means the correct path to your phonetic dictionary that you should pass to this method's dictionaryPath argument is as follows: NSString *correctPathToMyPhoneticDictionaryFile = [myLanguageModelGenerator pathToSuccessfullyGeneratedDictionaryWithRequestedName:@"TheNameIChoseForMyVocabulary"]; Feel free to copy and paste this code for your path to your phonetic dictionary, but remember to replace the part that says "TheNameIChoseForMyVocabulary" with the name you actually chose for your grammar or language model or you will get this error again (and replace myLanguageModelGenerator with the name of your OELanguageModelGenerator instance). Since this file is required, expect an exception or undocumented behavior shortly.
April 8, 2016 at 7:59 pm #1030000Halle WinklerPolitepixIt looks like the acoustic model isn’t really added to the app target.
April 10, 2016 at 3:20 am #1030015PowerkeyParticipantWell, I have looked it over a bunch of times and re-built the app from the tutorial and I always get the same error.
I checked the AcousticModelEnglish.bundle and it appears to be properly added to the project (well, as fas as I can tell, anyway). I went through the steps in the tutorial again with a brand new project and followed the steps exactly. I checked the built application that is downloaded to the phone and the AcousticModelEnglish.bundel is at the root level of the app bundle. It is also selected as a member of the target in Xcode. The Framework Search paths are updated automatically when it was added to the project.
Any suggestions?
I have included the log from the recent re-built project which is simplified. It looks mostly the same as the previous one, but maybe there is something in it that will help determine what I am doing wrong.
2016-04-09 17:56:02.934 TalkApp[3460:1095599] Starting OpenEars logging for OpenEars version 2.501 on 64-bit device (or build): iPhone running iOS version: 9.300000 2016-04-09 17:56:02.989 TalkApp[3460:1095599] Starting dynamic language model generation INFO: ngram_model_arpa_legacy.c(504): ngrams 1=7, 2=9, 3=6 INFO: ngram_model_arpa_legacy.c(136): Reading unigrams INFO: ngram_model_arpa_legacy.c(543): 7 = #unigrams created INFO: ngram_model_arpa_legacy.c(196): Reading bigrams INFO: ngram_model_arpa_legacy.c(561): 9 = #bigrams created INFO: ngram_model_arpa_legacy.c(562): 4 = #prob2 entries INFO: ngram_model_arpa_legacy.c(570): 5 = #bo_wt2 entries INFO: ngram_model_arpa_legacy.c(293): Reading trigrams INFO: ngram_model_arpa_legacy.c(583): 6 = #trigrams created INFO: ngram_model_arpa_legacy.c(584): 2 = #prob3 entries INFO: ngram_model_dmp_legacy.c(521): Building DMP model... INFO: ngram_model_dmp_legacy.c(551): 7 = #unigrams created INFO: ngram_model_dmp_legacy.c(652): 9 = #bigrams created INFO: ngram_model_dmp_legacy.c(653): 4 = #prob2 entries INFO: ngram_model_dmp_legacy.c(660): 5 = #bo_wt2 entries INFO: ngram_model_dmp_legacy.c(664): 6 = #trigrams created INFO: ngram_model_dmp_legacy.c(665): 2 = #prob3 entries 2016-04-09 17:56:03.060 TalkApp[3460:1095599] Done creating language model with CMUCLMTK in 0.070624 seconds. 2016-04-09 17:56:03.060 TalkApp[3460:1095599] Since there is no cached version, loading the language model lookup list for the acoustic model called AcousticModelEnglish 2016-04-09 17:56:03.061 TalkApp[3460:1095599] Error: an attempt was made to load the lookup dictionary for the acoustic model at the path AcousticModelEnglish and it wasn't possible to complete. This file does not appear to exist. Please ask for help in the forums and be sure to turn on all logging. An exception or unpredictable behavior should be expected now since this file is a requirement. 2016-04-09 17:56:03.065 TalkApp[3460:1095599] Additionally, there was an error of Error Domain=NSCocoaErrorDomain Code=260 "The file “LanguageModelGeneratorLookupList.text” couldn’t be opened because there is no such file." UserInfo={NSFilePath=AcousticModelEnglish/LanguageModelGeneratorLookupList.text, NSUnderlyingError=0x147d51ce0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} Error: Not possible to create a dictionary for this wordset. 2016-04-09 17:56:03.069 TalkApp[3460:1095599] Attempting to start listening session from startListeningWithLanguageModelAtPath: 2016-04-09 17:56:03.070 TalkApp[3460:1095599] 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 = [myLanguageModelGenerator pathToSuccessfullyGeneratedLanguageModelWithRequestedName:@"TheNameIChoseForMyVocabulary"]; Feel free to copy and paste this code for your path to your language model, but remember to replace the part that says "TheNameIChoseForMyVocabulary" with the name you actually chose for your language model or you will get this error again (and replace myLanguageModelGenerator with the name of your OELanguageModelGenerator instance). Since this file is required, expect an exception or undocumented behavior shortly.
April 10, 2016 at 10:28 am #1030016Halle WinklerPolitepixThe best bet is to make as brief an example as you can, which replicates the issue and show me the smallest amount of code possible that causes it. Swift isn’t supported here by me yet, but I’m up for taking a look at a non-enormous code example and seeing if anything jumps out at me.
April 11, 2016 at 6:45 pm #1030027PowerkeyParticipantAs I was copying the code I found the problem.
Apparently,
generateLanguageModelFromArray(words, withFilesNamed: name, forAcousticModelAtPath: "AcousticModelEnglish")
is not the same as
generateLanguageModelFromArray(words, withFilesNamed: name, forAcousticModelAtPath: OEAcousticModel.pathToModel("AcousticModelEnglish"))
(damn noobie)
Thanks for your help.
April 11, 2016 at 6:58 pm #1030028Halle WinklerPolitepixI’m happy to hear you found the issue!
-
AuthorPosts
- You must be logged in to reply to this topic.