Menu

How to set Threshold for keyphrase

Help
Vamsidhar
2016-07-27
2016-07-28
  • Vamsidhar

    Vamsidhar - 2016-07-27

    I am following this link http://cmusphinx.sourceforge.net/wiki/tutoriallm%23keyword_lists for recognizing key phrases.

    I have no issues with spotting single keyword. I am having issue with spotting key phrase with multiple keywords.

    Here are my key phrases: options.gram

    open browser 
    new e-mail 
    forward 
    backward 
    next window 
    last window 
    open music player 
    

    Now, I got pocket_sphinix from subversion and successfully build in my system. I created a wav file of lenghth 60 minutues with above phrases. (I set Bit resolution to 16 bit, Sampling rate 16000, audio channel: mono)

    Now, I run command like below
    pocketsphinx_continuous.exe -infile E:\CMUSphinx\shntool-3.0.0\joined.wav -keyphrase "open browser" -kws_threshold \1e-45 -hmm E:\CMUSphinx\pocketsphinx\model\en-us\en-us -dict E:\CMUSphinx\pocketsphinx\model\en-us\cmudict-en-us.dict

    It ran contionously for 3-4 minutes. Attached is ouput. (this file contains final lines of output. when I tried console out put to text file it is only writing my keyphrase.)
    1. This command ran continously fpr 3-4 mins. Is it correct behaviour?
    2. I am not getting how to identify valid threshold value for given phrase. Can you help me with this?
    3. what should be ideal value to feed -kws_threshold?
    4. Just to know, Is there any command or any other way, to get threshold value for the given phrase and wav file?

    Here is my code:

     SpeechRecognizerSetup setUp = SpeechRecognizerSetup.DefaultSetup();
                    setUp.SetAcousticModel(new File(assetsDir, "en-us-ptm"));
                    setUp.SetDictionary(new File(assetsDir, "cmudict-en-us.dict"));
                    _speechRecognizer = setUp.Recognizer;                
                    _speechRecognizer.AddListener(this);
                    File menuGrammar = new File(assetsDir, "options.gram");
                    _speechRecognizer.AddKeywordSearch(OPTIONS_SEARCH, menuGrammar);
    
     

    Last edit: Vamsidhar 2016-07-27
    • Nickolay V. Shmyrev

      1. This command ran continously fpr 3-4 mins. Is it correct behaviour?

      Running continuously is not a behavior, it shoudl be doing something.

      1. I am not getting how to identify valid threshold value for given phrase. Can you help me with this?
      2. what should be ideal value to feed -kws_threshold?
      3. Just to know, Is there any command or any other way, to get threshold value for the given phrase and wav file?

      This issue is covered in tutorial

      http://cmusphinx.sourceforge.net/wiki/tutoriallm#keyword_lists

       
    • Andrea Lisi

      Andrea Lisi - 2016-07-28
      1. what should be ideal value to feed -kws_threshold?

      Now that pocket_continuous is working, I just try different values and I see how many times the keyprhases are recognized.
      For example, from my trials I am doing now, I noticed that it gives good results (it recognized almost exactly all the occurences of my keyphrase) if the exponent is = (keyprhase_number_of_syllabus + 1) * 5
      For example 3 syllabus -> 1e-20.
      This with spanish words.

      But in realtime appliation (speak to microphone and process audio) it looks to work better if for a 3 syllabus word I use as threshold 1e-15 (syllabus * 5).

      I am still trying to experiment with keyprhases.
      Maybe can be helpful adapt the acoustic model too.

       
  • Andrea Lisi

    Andrea Lisi - 2016-07-27

    I am going to the same thing.
    But the point is that when I run pocketsphinx_continuous.exe it crashes after printing this line:

    INFO: tmat.c<206>: Reading HMM transition probability matrices: hmm/transition_matrices

    saying

    Debug Assertion Failed!
    Program:
    ..in32/pocketsphinx/bin/debug/Win32/pocketsphinx_continuos.exe
    File: ../read.c
    Line 85

    I am using the Spanish acousti model provided in the download page.

    So I tried to put by hand values, but I have no idea which to put, because keywords with threshold like 1e-5 aren't recognized; keywords with threshold around 1e-40 are recognized mixed.
    For example:

    no pasa nada /1e-50/
    ve izquierda /1e-50/
    que quieres /1e-45/
    ve derecha /1e-40/

    the output is a mixture of those keyphrases.

    (I set Bit resolution to 16 bit, Sampling rate 1600, audio channel: mono)

    I guess it's a typing error, because the sample rate should be 16000. Right? XD

     

    Last edit: Andrea Lisi 2016-07-27
    • Nickolay V. Shmyrev

      This issue is covered in FAQ. Crash is caused by runtime mismatch between pocketsphinx dll and sphinxbase dll.

       
      • Andrea Lisi

        Andrea Lisi - 2016-07-28

        Thanks!
        With the pre-compiled version is working

         
  • Vamsidhar

    Vamsidhar - 2016-07-27

    Yes. Thats type error. I just updated.

    NFO: tmat.c<206>: Reading HMM transition probability matrices: hmm/transition_matrices
    saying
    Debug Assertion Failed!
    Program:
    ..in32/pocketsphinx/bin/debug/Win32/pocketsphinx_continuos.exe
    File: ../read.c
    Line 85

    do you have sphinixbase.dll in the same folder where you are running pocketsphinx_continuos.exe? It wont be there unless you copy it.

     
  • Andrea Lisi

    Andrea Lisi - 2016-07-27

    Yes

    It gives you "dll missing error" if there isn't..

    I am still troubleshooting about assigning thresholds. I am trying this "keyphrase" since this morning.
    So I will keep on following your question!
    Thanks for asking!

     

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.