您可以这样做,但是唯一的事情是您需要在sphinx4中启用OOG发现。基本上以任何sphinx4语法示例为例,并根据此wiki页面在配置文件中启用OOG:
<component name="flatLinguist"type="edu.cmu.sphinx.linguist.flat.FlatLinguist"> .... <property name="addOutOfGrammarBranch" value="true"/> <property name="outOfGrammarProbability" value="1E-20"/> <property name="phoneInsertionProbability" value="1E-10"/> <property name="phoneLoopAcousticModel" value="wsj"/> ...</component>
之后,
<unk>如果只记录了随机单词,它将返回您的单词,如果记录了您语法中的单词,它将返回您的关键短语。
您需要调整outOfGrammar概率以获得可靠的检测。有关更多详细信息,请参见
http://cmusphinx.sourceforge.net/wiki/sphinx4:rejectionhandling



