Large vocabulary speech recognition in sphinx4

瘦欲@ 提交于 2019-12-11 09:48:08

问题


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?


回答1:


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();
    }
}


来源:https://stackoverflow.com/questions/26023864/large-vocabulary-speech-recognition-in-sphinx4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!