【发布时间】:2015-04-19 18:52:29
【问题描述】:
我正在尝试使用这个袖珍 sphinx android 库在片段中测试一些基本的关键字识别。我已设置项目 jar 并正确添加为依赖项,我已按照本教程中的说明将 .so 文件添加到 jniLibs 文件夹 http://cmusphinx.sourceforge.net/wiki/tutorialandroid
就其他搜索(数字等)而言,一切似乎都很好。但由于某种原因,我无法让关键字搜索工作。我遇到了一个非常清晰和明确的错误消息。基本上就是说一堆词在字典里找不到。
04-19 14:35:59.930 6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'EH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'SH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'Z' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'SH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'ZH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'ZH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'ZH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'ZH' is missing in the dictionary
04-19 14:35:59.930 6086-6107/? E/cmusphinx﹕ ERROR: "kws_search.c", line 165: The word 'SH' is missing in the dictionary
我正在使用库附带的字典“cmu-en-us.dict”,实际上它似乎根本没有包含这些大写单词。
然后我四处寻找,找到了这个 http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b
当我将它添加到项目中并尝试引用该字典时。我遇到了与以前相同的错误,但现在说我使用的 previous 字典中的单词(cmu-en-us.dict)丢失了。
我不确定我做错了什么。但是我只是按照设置教程进行操作,并且还使用了演示项目的 Activity 中的代码 https://github.com/cmusphinx/pocketsphinx-android-demo/blob/master/app/src/main/java/edu/cmu/pocketsphinx/demo/PocketSphinxActivity.java
哦,这就是我设置 SpeechRecognizer 的方法
private void setupRecognizer(File assetsDir) throws IOException {
// The recognizer can be configured to perform multiple searches
// of different kind and switch between them
Log.d("RecipeSearchFragment", "setupRecognizer");
mRecognizer = defaultSetup()
.setAcousticModel(new File(assetsDir, "en-us-ptm"))
.setDictionary(new File(assetsDir, "cmudict-en-us.dict"))
// To disable logging of raw audio comment out this call (takes a lot of space on the device)
.setRawLogDir(assetsDir)
// Threshold to tune for keyphrase to balance between false alarms and misses
.setKeywordThreshold(1e-45f)
// Use context-independent phonetic search, context-dependent is too slow for mobile
.setBoolean("-allphone_ci", true)
.getRecognizer();
mRecognizer.addListener(this);
/** In your application you might not need to add all those searches.
* They are added here for demonstration. You can leave just one.
*/
mRecognizer.addKeywordSearch(KWS_SEARCH, new File(assetsDir, "cmudict-en-us.dict"));
mRecognizer.startListening(KWS_SEARCH);
}
还有其他人遇到过这种情况吗?我在这里做错了什么?
【问题讨论】:
标签: android speech-recognition pocketsphinx-android pocketsphinx