Menu

pocketsphinx - recognize few words

Help
Alfredo
2017-04-13
2017-04-13
  • Alfredo

    Alfredo - 2017-04-13

    Hi all!

    I have a small dictionary (like 6/7 words) for my project, with words like "go", "stop", "turn left", "turn right". So far i managed to create the dictionary and language model using lmtool. I've tested it in live speech mode and recognized all words without any problems.
    The problem comes when i say a word that are not in the dictionary. For example if i say "car"(that are no in the dictonary) sphinx will return some other word that match to.
    So, there is any solution for this? There is any way to just return a word if sphinx has like 80%(or something like that) sure that is the correct word that was spelled?

    Thanks in advance!

     

    Last edit: Alfredo 2017-04-13
  • Arseniy Gorin

    Arseniy Gorin - 2017-04-13

    For your task it is better to use keyword phrase list instead of LM http://cmusphinx.sourceforge.net.minilinx.com/wiki/tutoriallm

     
    • Alfredo

      Alfredo - 2017-04-13

      Thanks for reply!

      As you suggested, using keyword phrase lead me up (in tutorial) to something like this:

      oh mighty computer /1e-40/
      hello world /1e-30/
      other phrase /1e-20/

      1. What does "1e-40" means?
      2. The using of keyword phrase is the same as dictionary in code? I mean, in my code i have the path to where language model is, so in case i want to use a keyword phrase do i just need to change that path to the file with the keywords phrases?
       

      Last edit: Alfredo 2017-04-13
      • Arseniy Gorin

        Arseniy Gorin - 2017-04-13

        What does "1e-40" means?

        It's threshold that you can tune for each word or phrase

        The using of keyword phrase is the same as dictionary in code? I mean, in my code i have the path to where language model is, so in case i want to use a keyword phrase do i just need to change that path to the file with the keywords phrases?

        You still need the dictionary. Keyword list replaces language model

         
        • Alfredo

          Alfredo - 2017-04-14

          I've said it wrong...nvm

          I forget to say Im using python for this. So far i got something like this

          speech = LiveSpeech(
              verbose=False,
              sampling_rate=16000,
              buffer_size=2048,
              no_search=False,
              full_utt=False,
              hmm= os.path.join(model_path,'en-us'),
              lm=os.path.join(model_path, 'drone.lm.bin'),
              dic=os.path.join(model_path, 'drone.dict')
          )
          

          which is working fine. My doubt is how to use keyword list instead of language model.
          The keyword list is a .txt ? or .list? And then if i have a file with the correct extension, how do i use it in code? Should i do something like "kws = os.path.join(model_path,keyword)" ? Can you describe the steps to change from language model to keyword list?

           
          • Arseniy Gorin

            Arseniy Gorin - 2017-04-14

            You can find an example with kws phrase here
            https://github.com/cmusphinx/pocketsphinx/blob/master/swig/python/test/kws_test.py

            You should replace the phrase with a list. Yes, it is a text file with phrases and thresholds as described in LM tutorial

             

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.