如果狮身人面像完全不准确怎么办?

时间:2014-12-19 00:00:06

标签: cmusphinx sphinx4

为了清晰起见编辑:我从sphinx获得的输出甚至不接近我的声音文件中的实际单词。我需要做些什么来使其更准确?

Here's the file我试图从中获取成绩单。它应该是8K的采样率。

文件中的演讲是"如果您的iPod"遇到问题,该怎么办? 作为输出,我得到:

<s> <sil> well how how [um] [cough] [um] old [cough] [noise] [cough] <sil> [noise]
[um] <sil> [um] <sil> [uh] [cough] [noise] [cough] [um]

这是我的代码:

package com.test.sphinxtest;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

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

public class App 
{
    public static void main( String[] args )
    {
        Configuration configuration = new Configuration();

        configuration.setAcousticModelPath("models/acousticmodel/en-us-8khz");
        configuration.setDictionaryPath("dictionary/cmudict-0.6d");
        configuration.setLanguageModelPath("models/languagemodel/en-us.lm");
        configuration.setSampleRate(8000);
        try {
            StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(configuration);
            recognizer.startRecognition(new FileInputStream("speech/speech8k.wav"));
            System.out.println("Starting recognition");
            SpeechResult result = recognizer.getResult();
            System.out.println("Stopping recognition");
            recognizer.stopRecognition();
            System.out.println("number of words " + result.getWords().size());
            for(int i=0;i<result.getWords().size();i++){
                System.out.println(result.getWords().get(i).getWord());
            }       
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

1 个答案:

答案 0 :(得分:2)

我查看了这个页面: http://cmusphinx.sourceforge.net/wiki/faq#qwhy_my_accuracy_is_poor

我看到我必须将我的音频文件设置为单通道。

在我这样做之后,我得到了合理的输出。