android中的pocketsphinx引发的警报不正确

时间:2016-04-25 13:31:52

标签: pocketsphinx pocketsphinx-android

我在我的Android应用程序中实现了pocketsphinx来识别语音命令并创建一些自定义字典和单词来识别。这是我的实施:

 private void setupRecognizer(File assetsDir) throws IOException {
    recognizer = defaultSetup()
            .setAcousticModel(new File(assetsDir, "en-us-ptm"))
            .setDictionary(new File(assetsDir, "cmudict-en-us.dict"))
            //.setRawLogDir(assetsDir)
            .setKeywordThreshold(1e-10f)
            .setBoolean("-allphone_ci", true)

            .getRecognizer();
    recognizer.addListener(this);

    // Create keyword-activation search.
    // recognizer.addKeyphraseSearch(KWS_SEARCH, KEYPHRASE);

    File menuGrammar = new File(assetsDir, "target-words.gram");
    recognizer.addKeywordSearch(KWS_SEARCH, menuGrammar);

}

对于单词列表:

yalp /1-0/
yaalp /1-0/
yeelp /1e-1/
yelp /1e-1/

和语法:

yalp Y AE L P
yaalp Y AA L P
yealp Y EH L P
yeelp Y IY L P
yelp Y EH L P

但是我得到了错误的结果,意味着如果我不说话或发出声音(即使拍手)我也会像Yelp Yealp等那样获得部分结果。我尝试调整setKeywordThreshold()// 1e-10f,1e-20f,1e-30f等与单词列表相同,以添加不同的范围,如1-0 / 1e-1,但没有任何方法可以使其正确。有人可以告诉我为什么这会产生错误的结果..

以下是我资产的图片: enter image description here

0 个答案:

没有答案