[SRILM User List] ngam stdin/stdout

Andreas Stolcke stolcke at icsi.berkeley.edu
Mon Oct 14 21:42:44 PDT 2013


On 10/14/2013 9:26 PM, Anand Venkataraman wrote:
> bash$ echo $SENTENCE | ngram ... -ppl -
>
> However, if you're planning to do this on a per-sentence basis, it's 
> inefficient.
>
> 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.
FYI, the ngram -escape option was created to embed useful 
metainformation in the input that is passed through to the output. This 
allows you post-process the output and associate the ppl information 
with subdivisions of the input stream, if needed.

Andreas

>
> &
>
>
> On Mon, Oct 14, 2013 at 8:44 PM, 徐 <xulikui123321 at 163.com 
> <mailto:xulikui123321 at 163.com>> wrote:
>
>     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)?
>
>
>
>
>
>
>     At 2013-10-15
>     09:29:52,"Anand Venkataraman" <venkataraman.anand at gmail.com
>     <mailto:venkataraman.anand at gmail.com>> wrote:
>
>         Pipe into the command and use - (hyphen) for the arg to -ppl
>
>         &
>         --
>         Sent from my Google Nexus
>
>         On Oct 14, 2013 6:26 PM, "徐" <xulikui123321 at 163.com
>         <mailto:xulikui123321 at 163.com>> wrote:
>
>             when compute perplexity with ngram, the usage is  ngram
>             -lm language.lm -order 4 -ppl test.txt.
>             but now I want compute perplexity with ngram from stdin,
>             what's  the command should i use?
>
>
>
>             _______________________________________________
>             SRILM-User site list
>             SRILM-User at speech.sri.com <mailto:SRILM-User at speech.sri.com>
>             http://www.speech.sri.com/mailman/listinfo/srilm-user
>
>
>
>
>
>
> _______________________________________________
> SRILM-User site list
> SRILM-User at speech.sri.com
> http://www.speech.sri.com/mailman/listinfo/srilm-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.speech.sri.com/pipermail/srilm-user/attachments/20131014/e1077a6a/attachment.html>


More information about the SRILM-User mailing list