2013-10-24 42 views
2

我當前使用pocketsphinx,和我自己的語言模型的離線建立,而不是使用lmtool online不正確的解碼結果

我按照sphinx tutoriallm wiki 這裏的步驟是我的步驟:

#!/bin/bash 
text2wfreq < 1.txt | wfreq2vocab > 1.vocab 
text2idngram -vocab 1.vocab -idngram 1.idngram < 1.txt 
idngram2lm -vocab_type 0 -idngram 1.idngram -vocab 1.vocab -arpa 1.arpa 
sphinx_lm_convert -i 1.arpa -o 1.lm.DMP 
sphinx_lm_convert -i 1.lm.DMP -ifmt dmp -o 1.lm -ofmt arpa 
#pocketsphinx_continuous -lm 1.lm -dict 1.dic 

1.TXT:

<s> Children I want you to draw your bedroom </s> 
<s> In my room there is a big bed next to the window and a picture on the door </s> 
.... #more 

然而,當我經營的p ocketsphinx_continuous -lm 1.lm -dict 1.dic,結果是不正確的,我的步驟有什麼問題。

,我發現我有完全錯誤的輸出我自己流明的文件,具有在線建造LM文件進行比較:

INFO: ngram_search_fwdflat.c(951): fwdflat 0.01 wall 0.006 xRT 
**INFO: ngram_search.c(1214): </s> not found in last frame, using OK.150 instead** 
INFO: ngram_search.c(1266): lattice start node <s>.0 end node OK.115 
INFO: ngram_search.c(1294): Eliminated 1 nodes before end node 
INFO: ngram_search.c(1399): Lattice has 30 nodes, 18 links 
INFO: ps_lattice.c(1365): Normalizer P(O) = alpha(OK:115:150) = -1308625 
INFO: ps_lattice.c(1403): Joint P(O,S) = -1309458 P(S|O) = -833 
INFO: ngram_search.c(888): bestpath 0.00 CPU 0.000 xRT 
INFO: ngram_search.c(891): bestpath 0.00 wall 0.000 xRT 
000000001: TV OK 

READY.... 

,我嘗試用我自己的LM和系統,DIC和顯示它完全不匹配的結果。

回答

2

我們需要更多地瞭解您所做的事情。 發佈一個指向你的1.txt和1.dic文件的指針,以及你的1.lm文件。 這是一個(隨機)想法:你的.lm看起來是混合大小寫。你的.dic是大寫嗎?

我不知道這是怎麼回事:

sphinx_lm_convert -i 1.arpa -o 1.lm.DMP 
sphinx_lm_convert -i 1.lm.DMP -ifmt dmp -o 1.lm -ofmt arpa 

.arpa和.lm基本上是相同的文件; .DMP文件旨在爲語言模型的在線表示預先計算一些內容。

+0

Myy dictionay(1.dic)是大寫字母,而我的txt(1.txt)是混合大小寫。在我將它們全部更改爲大寫字母后,它就起作用。儘管我高達70%。 – no7dw