Menu

Need help using sphinx 4-5prealpha

2014-09-21
2014-09-23
  • August Retumban

    August Retumban - 2014-09-21

    Hi need help here in using sphinx 4-5 on a NetBeans project. I've used a previous version of sphinx 4 before and was able to get what I want but with little accuracy. I was just trying variations of language models and dictionaries with the demo provided (HelloNGram specifically) just to get familiar with it but the result was okay.

    Now (changing some lines in the HelloNgram demo again ) I want to use sphinx4-5 prealpha and and I'm encountering a problem when instantiating Context ct. here's a sample of my code:

    Configuration c=new Configuration();
    c.setAcousticModelPath("resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model");
    c.setDictionaryPath("resource:/demo.sphinx.hellongram.HelloNGram!/demo/sphinx/hellongram/cmu07a.dic");
    c.setLanguageModelPath("resource:/demo.sphinx.hellongram.HelloNGram!/demo/sphinx/hellongram/language_model.arpaformat.DMP");
    Context ct=new Context(c);
    Recognizer recognizer = ct.getInstance(Recognizer.class);
    Microphone microphone = ct.getInstance(Microphone.class);
    // some code here....

    I got this error

    java.lang.NoSuchMethodError: edu.cmu.sphinx.util.props.ConfigurationManager.getComponentNames()Ljava/util/Set;
    at edu.cmu.sphinx.util.props.ConfigurationManagerUtils.listAllsPropNames(ConfigurationManagerUtils.java:553)
    at edu.cmu.sphinx.util.props.ConfigurationManagerUtils.setProperty(ConfigurationManagerUtils.java:607)
    at edu.cmu.sphinx.api.Context.setLocalProperty(Context.java:187)
    at edu.cmu.sphinx.api.Context.setAcousticModel(Context.java:92)
    at edu.cmu.sphinx.api.Context.<init>(Context.java:67)
    at edu.cmu.sphinx.api.Context.<init>(Context.java:49)
    at demo.sphinx.hellongram.HelloNGram.main(HelloNGram.java:45)</init></init>

    Thanks in advance for helping!

    And one more thing I've just downloaded the recent sphinx 4-5 prealpha here and there was a part of the tutorial in http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4 where there was a context.useMicrophone() line. I was about to put that line after I instantiate the Context object making it like this:

    Context ct=new Context(c);
    ct.useMicrophone();

    Just like in the example stated there on the site. But I can't seem to find any useMicrophone() method in the Context class of sphinx 4-5 prealpha. I don't know if I've just downloaded the wrong library but I think it would be impossible because I've downloaded it from here.

     
  • Nickolay V. Shmyrev

    was just trying variations of language models and dictionaries with the demo provided (HelloNGram specifically) just to get familiar with it but the result was okay.

    Sorry, there is no HelloNGram demo in sphinx4-5prealpha. Maybe you can try first the demos provided and ask questions on them (Dialog and Transcriber demos).

    But I can't seem to find any useMicrophone() method in the Context class of sphinx 4-5 prealpha. I don't know if I've just downloaded the wrong library but I think it would be impossible because I've downloaded it from here.

    The library is under active development and the API changes quickly. Some things might be missing. You need to look on existing demos as the example.

    For the latest version you can checkout sphinx4 from github

    http://github.com/cmusphinx/sphinx4

    I got this error
    java.lang.NoSuchMethodError: edu.cmu.sphinx.util.props.ConfigurationManager.getComponentNames()Ljava/util/Set;

    This error means you still have old jars in your classpath. You need to make sure you do not have old classes and jars (run clean properly).

     
    • Nickolay V. Shmyrev

      To get started with latest sphinx4

      1) Download sphinx4 from github under link above
      2) Build and run the demos
      3) Include jars into your application (with pom or just in classpath)
      4) Use most accurate en-us generic acoustic model for best accuracy
      5) Create a language model that fits your vocabulary or use generic one
      6) Create a test set to debug accuracy issues

       
  • August Retumban

    August Retumban - 2014-09-23

    Nikolay,

    Hi. The HelloNGram I was referring to was from the previous version of sphinx. I was trying to use it with the prealpha version but as what you have mentioned earlier it would not work. I will try the demos you mentioned. Anyways, thank you so much for the help. I would post again if I need help. Your assistance is much appreciated.

     

Log in to post a comment.

Auth0 Logo