指定pocketsphinx语言模型或语法

时间:2016-07-04 10:04:19

标签: linux grammar pocketsphinx

在Debian上我试图用这个参数启动pocketsphinx_continuous

pocketsphinx_continuous -inmic yes -hmm /usr/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k -adcdev plughw:0,0 -dict /usr/share/pocketsphinx/model/lm/en_US/cmu07a.dic 

这是输出的最后一部分:

INFO: dict.c(320): Allocating 137543 * 20 bytes (2686 KiB) for word entries
INFO: dict.c(333): Reading main dictionary: /usr/share/pocketsphinx/model/lm/en_US/cmu07a.dic
INFO: dict.c(213): Allocated 1010 KiB for strings, 1664 KiB for phones
INFO: dict.c(336): 133436 words read
INFO: dict.c(358): Reading filler dictionary: /usr/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/noisedict
INFO: dict.c(213): Allocated 0 KiB for strings, 0 KiB for phones
INFO: dict.c(361): 11 words read
INFO: dict2pid.c(396): Building PID tables for dictionary
INFO: dict2pid.c(406): Allocating 50^3 * 2 bytes (244 KiB) for word-initial triphones
INFO: dict2pid.c(132): Allocated 30200 bytes (29 KiB) for word-final triphones
INFO: dict2pid.c(196): Allocated 30200 bytes (29 KiB) for single-phone word triphones
INFO: continuous.c(305): pocketsphinx_continuous COMPILED ON: May 22 2016, AT: 22:01:16

ERROR: "pocketsphinx.c", line 957: No search module is selected, did you forget to specify a language model or grammar?
FATAL: "continuous.c", line 250: Failed to start utterance

我不知道如何按要求指定语言模型或语法。 我也有这些文件,但我不知道它们是否相关:

ls -l ~/phonetisaurus/
totale 318644
-rwxr-xr-x 1 pi pi       498 mag 15  2012 compile-fst.sh
-rw-r--r-- 1 pi pi  68172496 mag 15  2012 g014b2b.arpa
-rw-r--r-- 1 pi pi   3544610 mag 15  2012 g014b2b.corpus
-rw-r--r-- 1 pi pi  51190845 lug  4 08:49 g014b2b.fst
-rw-r--r-- 1 pi pi 163490139 mag 15  2012 g014b2b.fst.txt
-rw-r--r-- 1 pi pi    380388 mag 15  2012 g014b2b.hyp
-rw-r--r-- 1 pi pi      1223 mag 15  2012 g014b2b.isyms
-rw-r--r-- 1 pi pi      1128 mag 15  2012 g014b2b.osyms
-rw-r--r-- 1 pi pi    299283 mag 15  2012 g014b2b.ref
-rw-r--r-- 1 pi pi  35625073 mag 15  2012 g014b2b.ssyms
-rw-r--r-- 1 pi pi   3452982 mag 15  2012 g014b2b.train
-rw-r--r-- 1 pi pi    101264 mag 15  2012 g014b2b.words
-rw-r--r-- 1 pi pi      1327 mag 15  2012 README.txt

我阅读了文档和帮助,提供了启动命令而没有任何参数,但我无法理解我实际上缺少的是什么。

编辑:

正如我所建议的那样:

wget http://downloads.sourceforge.net/project/cmusphinx/sphinxbase/5prealpha/sphinxbase-5prealpha.tar.gz
wget http://downloads.sourceforge.net/project/cmusphinx/pocketsphinx/5prealpha/pocketsphinx-5prealpha.tar.gz

对于每个文件:

tar xzf <filename>
./configure
make
sudo make install

确定已安装:

which pocketsphinx_continuous 
/usr/local/bin/pocketsphinx_continuous

  

要检查pocketphinx是否安装正确,只需运行pkg-config -cflags -libs pocketsphinx sphinxbase

pkg-config --cflags --libs pocketsphinx sphinxbase
-I/usr/local/include -I/usr/local/include/sphinxbase -I/usr/local/include/pocketsphinx -I/usr/local/include -I/usr/local/include/sphinxbase -L/usr/local/lib -lpocketsphinx -lsphinxbase -lsphinxad -lpulse -lpulse-simple -lpthread -lm 

教程说:

  

要测试安装,请运行'pocketsphinx_continuous -inmic yes'并检查它是否识别您对麦克风说的话。

可是:

ERROR: "acmod.c", line 80: Acoustic model definition is not specified either with -mdef option or with -hmm

[完整日志:http://pastebin.com/HK6xBgVk]

使用此命令,我可以启动它:

pocketsphinx_continuous -inmic yes -hmm model/en-us/en-us -lm model/en-us/en-us.lm.bin -dict model/en-us/cmudict-en-us.dict -adcdev plughw:0,0

(没有adcdev字段,它找不到默认的音频输入)

但它不承认任何一个字(我说:“天气怎么样?”)

[完整日志:http://pastebin.com/nfst5NQD]

1 个答案:

答案 0 :(得分:0)

你需要从Debian中删除过时的pocketsphinx软件包,无论如何都不会有准确性。

您需要按照tutorial中的说明从源代码安装pocketsphinx,然后再按照教程进行操作。要了解语音识别中的模型,您可以阅读other part of tutorial