<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">I have solved the problem of computer perplexity of per line string by use ngram, as follows(perl script):<div><div>foreach my $line(@lines){</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$str = `echo $line | ngram -lm news.lm -ppl - -debug 1`;</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>print $str ."\n";</div><div><span style="line-height: 1.7;">}</span></div></div><div><span style="line-height: 1.7;">but if the language model too big, I should load the language every line. that's a waste of time, is there some method that I only should load the language model once? like replace the lm file (</span>news<span style="line-height: 1.7;">.lm) with a file pointer?</span></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>