<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Noor,<br>
      <br>
      please submit your questions to <a class="moz-txt-link-abbreviated" href="mailto:srilm-user@speech.sri.com">srilm-user@speech.sri.com</a> in the
      future (after joining the list).<br>
      <br>
      On 2/12/2013 9:21 AM, Noor Noor wrote:<br>
    </div>
    <blockquote
      cite="mid:1360689684.66935.YahooMailNeo@web28805.mail.ir2.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:verdana, helvetica, sans-serif;font-size:12pt">
        <div><br>
        </div>
        <div style="font-family: verdana, helvetica, sans-serif;
          font-size: 12pt;">
          <div style="font-family: 'times new roman', 'new york', times,
            serif; font-size: 12pt;">
            <div id="yiv804189321">
              <div>
                <div style="color: rgb(0, 0, 0); background-color:
                  rgb(255, 255, 255); font-family: 'times new roman',
                  'new york', times, serif; font-size: 12pt;">
                  <div style="font-size:12pt;"><span style="font-family:
                      verdana, helvetica, sans-serif;">Dear Sir,</span></div>
                  <div style="font-size:12pt;"><span style="font-family:
                      verdana, helvetica, sans-serif;"><br>
                    </span></div>
                  <div style="font-size:16px;color:rgb(0, 0,
                    0);background-color:transparent;font-style:normal;"><span
                      style="font-family: verdana, helvetica,
                      sans-serif;">I want to interpolate LM, I followed
                      this steps:</span></div>
                  <div style="font-size:16px;color:rgb(0, 0,
                    0);background-color:transparent;font-style:normal;"><span
                      style="font-family: verdana, helvetica,
                      sans-serif;"><br>
                    </span></div>
                  <div style="font-size:16px;color:rgb(0, 0,
                    0);background-color:transparent;font-style:normal;"><span
                      style="font-family: verdana, helvetica,
                      sans-serif;">1. ngram -debug 2 -ppl text1.txt >
                      L1.txt</span></div>
                  <div style="font-size:16px;color:rgb(0, 0,
                    0);background-color:transparent;font-style:normal;"><span
                      style="font-family: verdana, helvetica,
                      sans-serif;">    <span style="font-size:12pt;">ngram
                        -debug 2 -ppl text2.txt > L2.txt</span></span></div>
                  <div style="font-size: 12pt; color: rgb(0, 0, 0);
                    background-color: transparent; font-style: normal;
                    font-family: verdana, helvetica, sans-serif;"><span
                      style="font-family: verdana, helvetica,
                      sans-serif;"><span style="font-size:12pt;"><br>
                      </span></span></div>
                  <div style="background-color:transparent;"><span
                      style="font-family: verdana, helvetica,
                      sans-serif;"><span style="color:rgb(0, 0,
                        0);font-size:12pt;font-style:normal;">2. </span><span
                        style="background-color:transparent;"><font>ngram-class
                           -text text1.txt -class-</font></span><span
                        style="background-color:transparent;">counts 3
                        -classes cls1 -numclasses 2 </span></span></div>
                  <div style="
                    background-color:transparent;color:rgb(0, 0,
                    0);font-size:16px;font-style:normal;"><span
                      style="background-color: transparent; font-family:
                      verdana, helvetica, sans-serif;"><span
                        style="font-size:16px;background-color:transparent;"><font> 
                            ngram-class  -text text2.txt -class-</font></span><span
style="font-size:16px;background-color:transparent;">counts 3 -classes
                        cls2 -numclasses 2 </span><br>
                    </span></div>
                  <div style="font-size:16px;font-style:normal;"><span><span
                        style="font-size: 16px; font-family: verdana,
                        helvetica, sans-serif;">to get <span
                          style="color:rgb(0, 96,
                          191);background-color:rgb(255, 255, 0);">allcls</span></span></span></div>
                  <div style="background-color: transparent; color:
                    rgb(0, 0, 0); font-size: 16px; font-style: normal;
                    font-family: verdana, helvetica, sans-serif;"><span
                      style="background-color:transparent;"><span
                        style="font-size: 16px; background-color:
                        transparent; font-family: verdana, helvetica,
                        sans-serif;"><br>
                      </span></span></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:normal;"><span
                      style="background-color:transparent;"><span
                        style="font-size: 16px; background-color:
                        transparent; font-family: verdana, helvetica,
                        sans-serif;">3. How I can use compute-best-mix
                        to combine L1.txt L2.txt and how get the result</span></span></div>
                  <div style="font-size:16px;font-style:normal;"><span><span
                        style="font-size: 16px; font-family: verdana,
                        helvetica, sans-serif;"> Can write to me the
                        right command to my input to get <span
                          style="color:rgb(0, 96,
                          191);background-color:rgb(255, 255, 0);">LP
                          output</span> ?</span></span></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    You run <br>
            compute-best-mix L1.txt L2.txt <br>
    and use the first number after "best lambda" in the output as the
    -lambda value for ngram.<br>
    <br>
    <blockquote
      cite="mid:1360689684.66935.YahooMailNeo@web28805.mail.ir2.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:verdana, helvetica, sans-serif;font-size:12pt">
        <div style="font-family: verdana, helvetica, sans-serif;
          font-size: 12pt;">
          <div style="font-family: 'times new roman', 'new york', times,
            serif; font-size: 12pt;">
            <div id="yiv804189321">
              <div>
                <div style="color: rgb(0, 0, 0); background-color:
                  rgb(255, 255, 255); font-family: 'times new roman',
                  'new york', times, serif; font-size: 12pt;">
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:normal;"><span
                      style="background-color:transparent;"><span
                        style="font-size: 16px; background-color:
                        transparent; font-family: verdana, helvetica,
                        sans-serif;"><br>
                      </span></span></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:normal;"><span
                      style="background-color:transparent;"><span
                        style="font-size: 16px; background-color:
                        transparent; font-family: verdana, helvetica,
                        sans-serif;">4. how I can combine cls1 and cls2?</span></span></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    You need to rename the class labels in the cls1 and cls2 files to
    not clash.  It might be easier (and actually work better) to infer
    classes from the union of text1.txt and text2.txt, and then use
    those classes in both component LMs.<br>
    <br>
    Also, you don't mention the step of training the class-based LMs
    once you have the class definitions.  You need to use something like<br>
    <br>
                replace-words-with-classes classes=allcls text1.txt | \<br>
                ngram-count -text - -lm LM1 ....   <br>
    <br>
    to build your class-based LMs.<br>
    <br>
    <blockquote
      cite="mid:1360689684.66935.YahooMailNeo@web28805.mail.ir2.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:verdana, helvetica, sans-serif;font-size:12pt">
        <div style="font-family: verdana, helvetica, sans-serif;
          font-size: 12pt;">
          <div style="font-family: 'times new roman', 'new york', times,
            serif; font-size: 12pt;">
            <div id="yiv804189321">
              <div>
                <div style="color: rgb(0, 0, 0); background-color:
                  rgb(255, 255, 255); font-family: 'times new roman',
                  'new york', times, serif; font-size: 12pt;">
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:normal;"><span
                      style="background-color:transparent;"><span
                        style="font-size: 16px; background-color:
                        transparent; font-family: verdana, helvetica,
                        sans-serif;">5. Is the following command the
                        right one to interpolate LM?</span></span></div>
                  <div style="font-size:16px;font-style:normal;"><span
                      style="font-family: verdana, helvetica,
                      sans-serif;"><i
                        style="background-color:transparent;color:rgb(0,
                        0, 0);white-space:pre-wrap;">ngram -bayes 0 -lm
                        LM1 -mix-lm LM2 -lambda </i><i
                        style="white-space:pre-wrap;
                        color:rgb(0, 96, 191);background-color:rgb(255,
                        255, 0);">LP</i><i
                        style="background-color:transparent;color:rgb(0,
                        0, 0);white-space:pre-wrap;"> </i><i
                        style="white-space:pre-wrap;"> -mix-lambda2 ...
                        -classes <span style="color:rgb(0, 128,
                          255);background-color:rgb(255, 255, 0);">allcls</span></i></span></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:italic;"><i
                      style="white-space: pre-wrap; font-family:
                      verdana, helvetica, sans-serif;"><br>
                    </i></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:italic;"><span
                      style="font-family: verdana, helvetica,
                      sans-serif;"><i style="white-space:pre-wrap;">what
                      </i><i style="white-space:pre-wrap;"> -mix-lambda2
                        correct value for my input?</i></span></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    With only two models to interpolate, the command would be <br>
    <br>
        ngram -bayes 0 -lm LM1 -mix-lm LM2 -lambda LP  -classes allcls <br>
    <br>
    The second lambda value is inferred from LP since they have to add
    up to 1.<br>
    <br>
    Andreas<br>
    <br>
    <blockquote
      cite="mid:1360689684.66935.YahooMailNeo@web28805.mail.ir2.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff;
        font-family:verdana, helvetica, sans-serif;font-size:12pt">
        <div style="font-family: verdana, helvetica, sans-serif;
          font-size: 12pt;">
          <div style="font-family: 'times new roman', 'new york', times,
            serif; font-size: 12pt;">
            <div id="yiv804189321">
              <div>
                <div style="color: rgb(0, 0, 0); background-color:
                  rgb(255, 255, 255); font-family: 'times new roman',
                  'new york', times, serif; font-size: 12pt;">
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:italic;"><i
                      style="white-space: pre-wrap; font-family:
                      verdana, helvetica, sans-serif;"><br>
                    </i></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:italic;"><i
                      style="white-space: pre-wrap; font-family:
                      verdana, helvetica, sans-serif;"><br>
                    </i></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:italic;"><i
                      style="white-space: pre-wrap; font-family:
                      verdana, helvetica, sans-serif;">please kindly can
                      help me in this matter?</i></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:italic;"><i
                      style="white-space: pre-wrap; font-family:
                      verdana, helvetica, sans-serif;"><br>
                    </i></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:italic;"><i
                      style="white-space: pre-wrap; font-family:
                      verdana, helvetica, sans-serif;">Best Regards,</i></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;
                    font-style:italic;"><i style="white-space: pre-wrap;
                      font-family: verdana, helvetica, sans-serif;"><br>
                    </i></div>
                  <div style="background-color:transparent;color:rgb(0,
                    0, 0);font-size:16px;font-style:italic;"><i
                      style="white-space: pre-wrap; font-family:
                      verdana, helvetica, sans-serif;">Noor</i></div>
                </div>
              </div>
            </div>
            <br>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>