<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>In fact, I believe it is necessary to use the "add-dummy-bows" script too which is a part of srilm.</div><div>lm3g2dmp waits for a value for each low-order ngrams. This script adds the value 0 to missing back-off weights.</div><div><br></div><div>So you have to do something like that:</div><div><div><br></div><div>#srilm tools</div><div>gunzip -c lm.arpa.gz | gawk -f sort-lm | gzip -c > lm.sorted.arpa.gz</div><div>gunzip -c&nbsp;lm.sorted.arpa.gz&nbsp;| gawk -f add-dummy-bows | gzip -c >&nbsp;lm.sphinx.arpa.gz</div><div><br></div><div>and then:</div><div>#cmu sphinx tools</div><div>lm3g2dmp&nbsp;lm.sphinx.arpa.gz .</div><div><br></div><div><br></div><div><br></div></div><div>Notice that only 3-gram LMs work with Sphinx. LIUM distributes a open source tool which allows to rescore sphinx3 word-lattices with a 4-gram LM.</div><div><br></div><div>This is available here:</div><div><a href="http://www-lium.univ-lemans.fr/tools/index.php?option=com_content&amp;task=blogcategory&amp;id=21&amp;Itemid=47">http://www-lium.univ-lemans.fr/tools/index.php?option=com_content&amp;task=blogcategory&amp;id=21&amp;Itemid=47</a></div><div><br></div><div><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Best regards,</div><div>-Yannick</div><div><br></div></div><div><html>Le 16 avr. 08 à 12:40, Sopheap SENG a écrit :</html><br class="Apple-interchange-newline"><blockquote type="cite">Hello, <br><br>On the Sphinx website (<a href="http://cmusphinx.sourceforge.net/html/cmusphinx.php">http://cmusphinx.sourceforge.net/html/cmusphinx.php</a>)&nbsp; there is a tool called&nbsp; lm3g2dmp&nbsp; that converts a 3-gram lm to binary DMP format to use in Sphinx 3 decoder.<br> <br>The ngram-count doesnt output n-gram in the rigth order for Sphinx's lm3g2dmp utility. You will need to resort the lm somehow.<br><br>sort-lm could do that but I used a script written by <a href="mailto:fuegen@ira.uka.de">fuegen@ira.uka.de</a> to convert before passing to lm3g2dmp.<br> <br>if you could not find this script on the net, please e-mail me.<br><br>Best, <br><br>Sopheap<br><br><br><br><div class="gmail_quote">On Tue, Apr 15, 2008 at 9:24 PM, Andreas Stolcke &lt;<a href="mailto:stolcke@speech.sri.com" target="_blank">stolcke@speech.sri.com</a>> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Christian Schrumpf wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> Dear Mr. Stolcke,<br> &nbsp;how can I convert an n-gram lm prduced with the ngram-count program of SRILM to a lm I can use in Sphinx 3?<br> Thank you in advance.<br> </blockquote> I understand Sphinx LMs require the N-grams to be sorted in a certain way.<br> The "sort-lm" command described in the lm-scripts man page was made for this reason.<br> <br> If you google "srilm sphinx" you will find several mentions of apparently successful use of SRILM in combination with Sphinx.<br><font color="#888888"> <br> Andreas<br> <br> <br> </font></blockquote></div><br><br clear="all"><br>-- <br>---------------------------------------------<br>Sopheap SENG<br><br>Laboratoire d'Informatique de Grenoble (LIG)<br>Equipe GETALP Bureau C118 <br>220, avenue de la Chimie<br> Campus Scientifique, BP53<br>38041 GRENOBLE Cedex 9, FRANCE<br>Tél : (33)-4-76-63-55-81 <br>Télécopie : (33)-4-76-63-55-52<br>Courriel : <a href="mailto:sopheap.seng@imag.f">sopheap.seng@imag.f</a><br>URL : <a href="http://www-geod.imag.fr" target="_blank">http://www-geod.imag.fr</a><br> ---------------------------------------------<br>Enseignant<br>Institut de Technologie du Cambodge<br>BP 86, Bd de Pochentong<br>Phnom Penh - Cambodge<br>Tél : (855)-23-88-03-70/98-24-45<br>Télécopie : (855)-23-88-03-69<br> Courriel : <a href="mailto:sopheap.seng@itc.edu.kh" target="_blank">sopheap.seng@itc.edu.kh</a><br>URL : <a href="http://www.itc.edu.kh" target="_blank">http://www.itc.edu.kh</a><br>---------------------------------------------</blockquote></div><br></body></html>