Kakar
Kakar

Reputation: 5609

Large vocabulary speech recognition in sphinx4

As far as I know till now, sphinx4 requires grammar to identify the words. Is there anyway to get the input without using grammar rules, that is not in the grammar, somewhat like I am dictating and it will write what I will say?

Upvotes: 1

Views: 379

Answers (1)

Nikolay Shmyrev
Nikolay Shmyrev

Reputation: 25220

As far as I know till now, sphinx4 requires grammar to identify the words.

No, sphinx4 supports large vocabulary speech recognition

Is there anyway to get the input without using grammar rules, that is not in the grammar, somewhat like I am dictating and it will write what I will say? Or any algorithm maybe to check it?

You need to update sphinx4-5prealpha version.

You can check transcriber demo for example of large vocabulary speech recognition setup.

The code should look like this:

package com.example;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

import edu.cmu.sphinx.api.Configuration;
import edu.cmu.sphinx.api.SpeechResult;
import edu.cmu.sphinx.api.LiveSpeechRecognizer;

public class TranscriberDemo {       

    public static void main(String[] args) throws Exception {

        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");

        LiveSpeechRecognizer recognizer = new LiveSpeechRecognizer(configuration);
        recognizer.startRecognition(true);

        SpeechResult result;
        while ((result = recognizer.getResult()) != null) {
            System.out.format("Hypothesis: %s\n", result.getHypothesis());
        }
        recognizer.stopRecognition();
    }
}

Upvotes: 1

Related Questions