<div dir="ltr">bash$ echo $SENTENCE | ngram ... -ppl -<div><br></div><div>However, if you're planning to do this on a per-sentence basis, it's inefficient.</div><div><br></div><div>You should ideally compute it on whole files using ngram -debug 1 and post-process the output to extract ppls for individual sentences. That way you can get away with not having to invoke ngram/load the lm multiple times.</div>

<div><br></div><div>&<br><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 14, 2013 at 8:44 PM, 徐 <span dir="ltr"><<a href="mailto:xulikui123321@163.com" target="_blank">xulikui123321@163.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;font-size:14px;font-family:arial">thank you very much, the problem is solved! if I want to computer perplexity of sentence, not a file, like ngram -lm language.lm -order 4 -ppl " I MISS YOU" ,what's  the command should i use( i want to compute perplexity with ngram on hadoop)?<div>


<div><br><br><br><br><br><div></div><div></div><br>At 2013-10-15 09:29:52,"Anand Venkataraman" <<a href="mailto:venkataraman.anand@gmail.com" target="_blank">venkataraman.anand@gmail.com</a>> wrote:<br>
 <blockquote style="PADDING-LEFT:1ex;MARGIN:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><p dir="ltr">Pipe into the command and use - (hyphen) for the arg to -ppl</p>
<p dir="ltr">&<br>
--<br>
Sent from my Google Nexus</p>
<div class="gmail_quote">On Oct 14, 2013 6:26 PM, "徐" <<a href="mailto:xulikui123321@163.com" target="_blank">xulikui123321@163.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="line-height:1.7;font-size:14px;font-family:arial">when compute perplexity with ngram, the usage is  ngram -lm language.lm -order 4 -ppl test.txt. <div>but now I want  <span style="line-height:1.7">compute perplexity with ngram from stdin, what's  the command should i use?</span></div>



</div><br><br><span title="neteasefooter"><span></span></span><br>_______________________________________________<br>
SRILM-User site list<br>
<a href="mailto:SRILM-User@speech.sri.com" target="_blank">SRILM-User@speech.sri.com</a><br>
<a href="http://www.speech.sri.com/mailman/listinfo/srilm-user" target="_blank">http://www.speech.sri.com/mailman/listinfo/srilm-user</a><br></blockquote></div>
</blockquote></div></div></div><br><br><span title="neteasefooter"><span></span></span></blockquote></div><br></div></div></div>