Menu

use dynamic language model in sphinx3?

Help
chris
2007-10-06
2012-09-22
  • chris

    chris - 2007-10-06

    Hi,
    I want to know if I can change sphinx3 language model(fsg) dynamiclly?you know,first I can use cmd_ln_appl_enter to init the decoder,then I recognize some voice through the microphone,then I want to use another grammar to recognize,is there any api to change language model?or I jusr kill the thread and make a new one? which one is better?

    Best Regards
    Chris

     
    • chris

      chris - 2008-01-03

      Hi David,
      I have checked some part of the source code,I want to add changing fsg on fly feature on sphinx3.But I need some advice.You know,sphinx3 now use hash table to hold the cmd line parameter,and when you use strict mode,you can't provide parameter twice(non strict mode just replace the old one) right?I want to provide many fsg at the begining,and use fsg_search_add_fsg function add all of them to the fsg_search_t,then I can use some function(like you have written)to switch them.In order to do this I have to add a new parameter like -fsg_list,the value of this parameter is a path of a file,this file contains many lines,each line is a path of a fsg file.then I can parse the file,and add them to the fsglist.And I also noticed I have no need to add additional code to care about the destory part(free the memory),the existed code can handle this.Am I right?
      Is this the right way to do this?can you give me more advice to this?I really want to contribute some code to sphinx project.Thanks!

      Regards
      Chris

       
    • chris

      chris - 2008-01-07

      I have changed some code,if I stored many fsg grammar in one file,they will be loaded together.then I can use the function to switch fsg,it seems working well.:)

       
    • Nickolay V. Shmyrev

      Sadly it seems that currently you can't change fsg with sphinx3, you can change LM's with s3_decode_set_lm but not fsg with any good function. Of course you can rely on a lot of private headers and do something like this:

      s3_decode_set_fsgname(s3_decode_t * _decode, const char fsg_name)
      {
      srch_t
      s;
      fsg_search_t *fsg_search;

      s = (srch_t *) _decode->kb.srch;
      fsg_search = s->grh->graph_struct
      
      fsg_search_set_current_fsg(fsg_search, fsg_name);
      

      }

      Heh, it would be nice to hack this somehow. Although probable sphinx3 should be just a dication decoder without any FSG capabilities. Pocketsphinx can change fsg on the fly more easily.

       
    • chris

      chris - 2007-10-07

      Hi Nickolay,
      Thanks for replying.I will review my requirement to check which way I should use.If I only need kill the recognizer and generate a new one,that would be fine,I guess it will waste more resource compared to change the fsg on fly,right?If I have to change the fsg on fly,I should do some hack work,but is there any api reference for sphinx3?otherwise I do't know what will be happend when I use this api,that makes me be scared when somebody try to use my application.

      BestRegards
      Chris

       
      • Nickolay V. Shmyrev

        I suppose the proper way will be the following - implement required API in sphinx3 and submit a patch, then you won't care about later functional changes.

         
    • chris

      chris - 2007-10-07

      Ok,I will try,but it seems I do't have right to submit the patch :(

       
      • David Huggins-Daines

        Send the patch to cmusphinx-sdmeet@lists.sourceforge.net - we'll be happy to look at it and integrate it.

         

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.