Search code examples
javacmusphinx

Improving CMUSphinx 5 speed and accuracy


I am getting poor result using Sphinx 5 for example If I say "main" I get the result after 4 min "mate". So is there a way I can Improve speed and accuracy of CMUSphinx 5 ? Here is the code I am using :

    Configuration configuration = new Configuration();
            configuration
            .setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us");
    configuration
            .setDictionaryPath("resource:/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict");
    configuration
            .setLanguageModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us.lm.bin");

    try {

        LiveSpeechRecognizer live = new LiveSpeechRecognizer(configuration);
        live.startRecognition(true);
        System.out.println("Start Talking");

        while (true) {
            SpeechResult res = live.getResult();
           System.out.println("Result:    " + res.getResult().getBestResultNoFiller());
        }

    }
    catch (IOException e){e.printStackTrace();}

Solution

  • Sphinx4 is too slow to work in realtime with large vocabulary. You can not use it in live mode for now.

    You can use pocketsphinx or you can reduce the vocabulary of the language model.