gpt4 book ai didi

linux - 指定 pocketsphinx 语言模型或语法

转载 作者:太空宇宙 更新时间:2023-11-04 12:47:55 32 4
gpt4 key购买 nike

在 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

和:

To check that pocketsphinx is installed properly, just run 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

教程说:

To test installation, run 'pocketsphinx_continuous -inmic yes' and check that it recognizes words you are saying to the microphone.

但是:

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 ]

最佳答案

您需要从 Debian 中删除过时的 pocketsphinx 软件包,无论如何它的准确度都是零。

您需要按照 tutorial 中所述从源安装 pocketsphinx并进一步按照教程进行操作。要了解语音识别中的模型,您可以阅读 other part of tutorial .

关于linux - 指定 pocketsphinx 语言模型或语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38181946/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com