Question about using a custom dictionary

Home Forums OpenEars Question about using a custom dictionary

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

  • Author
  • #1021183

    I was reading this blog post:

    I know Halle mentioned previously that the cmu07 file mentioned in now located in the audio bundles and named “LanguageModelGeneratorLookupList.text’. I seem to have hit another snag though. In the blog post it mentions being able to redirect to a custom version of that file by using the ‘dictionaryPathAsString’ property. From looking at the code though, the dictionary path seems to be hard coded now (see line 420 of LanguageModelGenerator.m). Is there another way to do this other than replacing the actual file in the audio bundle?

    Halle Winkler

    Yup, thank you for giving me the heads-up about how out-of-date that post is – I will put it on the list for revision when there is time.

    I removed dictionaryPathAsString when OpenEars became bilingual because it threatened to heavily complicate the new acoustic model bundle code and my sense was that the method wasn’t being used (which I think was probably the correct call since this is to the best of my knowledge the first time I’ve been asked about using it since it was removed). However, it is still possible to use your own lookup dictionary by using the standard method.

    If you take a look at the generation method:

    - (NSError *) generateLanguageModelFromArray:(NSArray *)languageModelArray withFilesNamed:(NSString *)fileName forAcousticModelAtPath:(NSString *)acousticModelPath;

    It takes a path to an acoustic model. The only thing it does with this path is find LanguageModelGeneratorLookupList.text inside of an acoustic model bundle – LanguageModelGenerator doesn’t make use of any of the other items in the acoustic model bundles. So if you want to use a custom lookup dictionary that you can also write to as described in that blog post, you only have to make your own acoustic model bundle that has nothing in it but your LanguageModelGeneratorLookupList.text and have it in a writable location (such as Caches or Documents). As long as the lookup dictionary follows the same rules as the one in the acoustic model you’re going to use for your listening session (i.e. uses exactly the same formatting and the same phonemes, is alphabetized, etc) it will work fine.

    Here is where to read about making your own acoustic model, although all you need in the bundle in this case is your LanguageModelGeneratorLookupList.text:

    You may end up needing to do a bit of troubleshooting making sure that the right path gets passed in the end – just ask for more help with specifics if you need it later.

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