<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">On 5/15/2013 7:33 AM, tarek abuamer
      wrote:<br>
    </div>
    <blockquote cite="mid:000801ce5179$205224b0$60f66e10$@rdi-eg.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Times New Roman \, serif";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">What I really
            need is to combine the original scores and the LM scores in
            the final score, I don’t know whether  this is rescoring or
            decoding?</span></p>
      </div>
    </blockquote>
    <br>
    I'm cc-ing the list since this might be of general interest.<br>
    <br>
    HTK lattices support an "ngram"   score that is separate from the
    "LM"  score.   This ngram score is passed through unchanged in the
    rescoring process (just like the acoustic scores).<br>
    <br>
    So what you can do is<br>
    <br>
    1) rewrite your input lattice to replace all "l=score"   to use
    "n=score"  instead ("n" is the key for "ngram" scores).<br>
    2) Use lattice-tool -lm to compute new LM scores.<br>
    3) Decode the lattices giving nonzero weight to both the ngram and
    the LM score.  So you will get a log linear combination of the two
    LMs.<br>
    <br>
            lattice-tool -viterbi-decode -read-htk -htk-lmscale L  -htk-ngscale
    N ...<br>
    <br>
    where L is the LM score weight and N is the ngram score weight.   If
    you want to combine the two scores in a different way you can
    postprocess the lattice and insert new scores.  Since all the scores
    appear on one line it should be easy to do this with a gawk / perl /
    python etc. script.<br>
    <br>
    I hope this answers your question.<br>
    <br>
    Andreas<br>
    <br>
    <blockquote cite="mid:000801ce5179$205224b0$60f66e10$@rdi-eg.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
                Andreas Stolcke [<a class="moz-txt-link-freetext" href="mailto:stolcke@icsi.berkeley.edu">mailto:stolcke@icsi.berkeley.edu</a>] <br>
                <b>Sent:</b> Wednesday, May 15, 2013 4:11 PM<br>
                <b>To:</b> tarek abuamer<br>
                <b>Subject:</b> Re: [SRILM User List] lattice-tool with
                HTK lattice with probabilities<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <p class="MsoNormal">On 5/15/2013 4:07 AM, tarek abuamer
            wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="color:#1F497D">This is
              exactly what I am talking about. The weights I put in the
              input lattice have no effect on the weights in the output
              lattice (i.e. if I remove the weights from the input
              lattice it still gives me the same numbers in the output
              lattice) </span><o:p></o:p></p>
        </blockquote>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman","serif"">Yes, because the use of the
            -lm option implies "rescoring" the lattice, i.e.,
            recomputing the LM scores.<br>
            <br>
            If you simply want to extract the hypotheses with the
            highest score, that's called "decoding" and there are
            several other options for that.<br>
            Read the man page.    You probably want -viterbi-decode. <br>
            <br>
            Andreas<br>
            <br>
            <br>
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
        <div>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
                Andreas Stolcke [<a moz-do-not-send="true"
                  href="mailto:stolcke@icsi.berkeley.edu">mailto:stolcke@icsi.berkeley.edu</a>]
                <br>
                <b>Sent:</b> Tuesday, May 14, 2013 9:12 PM<br>
                <b>To:</b> tarek abuamer<br>
                <b>Cc:</b> <a moz-do-not-send="true"
                  href="mailto:srilm-user@speech.sri.com">srilm-user@speech.sri.com</a><br>
                <b>Subject:</b> Re: [SRILM User List] lattice-tool with
                HTK lattice with probabilities</span><o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"> <o:p></o:p></p>
        <div>
          <p class="MsoNormal">On 5/12/2013 5:06 AM, tarek abuamer
            wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal">I want to use lattice-tool to rescore HTK
            format lattices. I need HTK lattices to contain
            probabilities in the form : J=1 S=4 E=2 l=-1.1<o:p></o:p></p>
          <p class="MsoNormal">                                                                                                                                                               &nbsp
 ;
            ;& nbsp;&n
            bsp;                                                             
            J=2 S=4 E=3 l=-0.4<o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal">However, this seems not to have any
            effect when using lattice-tool. <o:p></o:p></p>
          <p class="MsoNormal">Any  clue?<o:p></o:p></p>
        </blockquote>
        <p class="MsoNormal" style="margin-bottom:12.0pt"><span
            style="font-size:12.0pt;font-family:"Times New Roman ,
            serif","serif""><br>
            You don't say what you tried that didn't work.     If you
            invoke <br>
            <br>
                 lattice-tool -in-lattice INPUTLATTICE -read-htk -lm
            LMFILE -order N -out-lattice OUTPUTLATTICE -write-htk <br>
            <br>
            the OUTPUTLATTICE will contain recomputed LM probabilities
            in the form you describe, assuming the input lattice is also
            in HTK format.<br>
            <br>
            Andreas</span><o:p></o:p></p>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman","serif""><o:p> </o:p></span></p>
      </div>
    </blockquote>
    <br>
  </body>
</html>