<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 10/14/2013 9:26 PM, Anand
      Venkataraman wrote:<br>
    </div>
    <blockquote
cite="mid:CAF6FMTWTQv92t8nkC-unq0-5Tj3EFDvrwO5fauKQ+SYKtvPrrg@mail.gmail.com"
      type="cite">
      <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>
    </blockquote>
    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.<br>
    <br>
    Andreas<br>
    <br>
    <blockquote
cite="mid:CAF6FMTWTQv92t8nkC-unq0-5Tj3EFDvrwO5fauKQ+SYKtvPrrg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <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 moz-do-not-send="true"
                  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>
                      <br>
                      At 2013-10-15 09:29:52,"Anand Venkataraman" <<a
                        moz-do-not-send="true"
                        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 moz-do-not-send="true"
                            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 moz-do-not-send="true"
                              href="mailto:SRILM-User@speech.sri.com"
                              target="_blank">SRILM-User@speech.sri.com</a><br>
                            <a moz-do-not-send="true"
                              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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SRILM-User site list
<a class="moz-txt-link-abbreviated" href="mailto:SRILM-User@speech.sri.com">SRILM-User@speech.sri.com</a>
<a class="moz-txt-link-freetext" href="http://www.speech.sri.com/mailman/listinfo/srilm-user">http://www.speech.sri.com/mailman/listinfo/srilm-user</a></pre>
    </blockquote>
    <br>
  </body>
</html>