Python pocketsphinx 0.1.15 配置与 pocketsphinx_continuous.exe 配置

Python pocketsphinx 0.1.15 configuration versus pocketsphinx_continuous.exe configuration

我有一个解决方案(jsgf、dict、hmm),适用于:

pocketsphinx_continuous -hmm zero_ru.cd_cont_4000 -dict vocabular.dict -jsgf calc.jsgf -inmic yes

现在我正在尝试将其移植到 Python pocketsphinx 0.1.15 (https://pypi.org/project/pocketsphinx/) 并且我在详细输出中看到 Python [=19= 的配置] 与 pocketsphinx_continuous 配置不同。

因此 Python pocketsphinx 进行了很多错误的幻像检测。

我的Python脚本很简单:

speech = LiveSpeech(
    verbose=True,
    hmm='c:/Projects/pocketsphinx-5prealpha-win32/pocketsphinx/bin/Release/x64/zero_ru.cd_cont_4000',
    lm=False,
    jsgf='c:/Projects/pocketsphinx-5prealpha-win32/pocketsphinx/bin/Release/x64/calc.jsgf',
    dic='c:/Projects/pocketsphinx-5prealpha-win32/pocketsphinx/bin/Release/x64/vocabular.dict',
    allphone_ci=False,
    vad_threshold=2.0,
    kws_threshold=1.0,
)

for phrase in speech:
    print(phrase)

通过将文本文件与我看到的输出进行比较,pocketsphinx_continuous 的输出为:

INFO: fe_interface.c(325): Using -1 as the seed.
INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
INFO: cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
INFO: acmod.c(154): Reading linear feature transformation from zero_ru.cd_cont_4000/feature_transform
INFO: mdef.c(518): Reading model definition: zero_ru.cd_cont_4000/mdef
INFO: bin_mdef.c(181): Allocating 145321 * 8 bytes (1135 KiB) for CD tree

但是 Python pocketsphinx 有:

INFO: fe_interface.c(324): Using -1 as the seed.
INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='batch', VARNORM='no', AGC='none'
INFO: acmod.c(152): Reading linear feature transformation from c:/Projects/pocketsphinx-5prealpha-win32/pocketsphinx/bin/Release/x64/zero_ru.cd_cont_4000/feature_transform
INFO: mdef.c(518): Reading model definition: c:/Projects/pocketsphinx-5prealpha-win32/pocketsphinx/bin/Release/x64/zero_ru.cd_cont_4000/mdef

现在我正在尝试使 Python pocketsphinxpocketsphinx_continuous 相同(或 config)。

如何让Pythonpocketsphinx使用CMN='current'而不是CMN='batch'? IE。如何使 Python pocketsphinx 在输出中显示:

INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
INFO: cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
INFO: acmod.c(154): Reading linear feature transformation from zero_ru.cd_cont_4000/feature_transform
INFO: mdef.c(518): Reading model definition: zero_ru.cd_cont_4000/mdef

而不是:

INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='batch', VARNORM='no', AGC='none'
INFO: acmod.c(152): Reading linear feature transformation from c:/Projects/pocketsphinx-5prealpha-win32/pocketsphinx/bin/Release/x64/zero_ru.cd_cont_4000/feature_transform
INFO: mdef.c(518): Reading model definition: c:/Projects/pocketsphinx-5prealpha-win32/pocketsphinx/bin/Release/x64/zero_ru.cd_cont_4000/mdef

batch和current是同一个模式。它只是在某个时间点重命名,它只取决于版本。

幻像检测可能是您的 jsgf 中词汇量非常小的结果,而不是 cmn。