【问题标题】:Failed to load en-us-semi model in sphinx4无法在 sphinx4 中加载 en-us-semi 模型
【发布时间】:2015-03-16 14:55:57
【问题描述】:

我最近的任务是用 Java 重写 C 服务器,这意味着将其语音识别功能从 Pocketsphinx C api 迁移到 Sphinx4 Java API,使用与工作相同的字典和语言模型文件使用 Pocketsphinx 以及 CMU Sphinx 在其网站上提供的默认 en-us-semi 声学模型。注意:使用 Pocketsphinx 不需要声学模型,所以我选择了 en-us-semi 模型,认为它可以满足我的需求。这样做时,我在使用以下代码将 StreamSpeechRecognizer 初始化为 Spring bean 时遇到错误:

@Bean
@Autowired
public StreamSpeechRecognizer streamSpeechRecognizer(SphinxProperties sphinxProperties) throws
                                                                                      IOException {
edu.cmu.sphinx.api.Configuration sphinxConfiguration = new edu.cmu.sphinx.api.Configuration();
sphinxConfiguration.setAcousticModelPath("resource:/" + sphinxProperties.getAcousticModelPath());
sphinxConfiguration.setDictionaryPath("resource:/" +  sphinxProperties.getDictionaryPath());
sphinxConfiguration.setLanguageModelPath("resource:/" + sphinxProperties.getLanguageModelPath());

return new StreamSpeechRecognizer(sphinxConfiguration);

}

我得到的错误如下:

Caused by: java.lang.AssertionError
at edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader.createSenonePool(Sphinx3Loader.java:484)
at edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader.loadModelFiles(Sphinx3Loader.java:386)
at edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader.load(Sphinx3Loader.java:315)
at edu.cmu.sphinx.frontend.AutoCepstrum.newProperties(AutoCepstrum.java:118)
at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:508)

它是由StreamSpeechRecongizer 的构造函数抛出的。

断言失败是assert numVariances == numSenones * numGaussiansPerSenone;

另外,如果您知道我使用的字典文件包含普通的英语单词(例如土豆)以及 Internet 服务名称(例如 Hotmail、Facebook、Twitter 等),您可能会有所帮助。

任何帮助都将不胜感激。非常感谢。

【问题讨论】:

    标签: java c cmusphinx sphinx4 pocketsphinx


    【解决方案1】:

    您需要使用最新版本的 sphinx4-5prealpha,如 http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4 中所述

    它与默认的 en-us 通用 ptm 5.2 模型一起使用,这是可用的最准确的模型。您需要使用默认的 sphinx4 模型,而不是 en-us semi。最新的 pocketsphinx 使用相同的模型。

    sphinx4 不支持 en-us-semi

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-03
      • 2022-10-07
      • 1970-01-01
      • 2013-12-05
      • 2021-06-10
      • 2021-11-30
      • 1970-01-01
      相关资源
      最近更新 更多