<div dir="ltr">I'm terribly sorry that it seems when I do the calculation following the manual, I messed up with the Ds so I can't get the output right.<div style>Now I can get the g() for the unigram following the manual</div>
<div style>Now my question becomes simple, when computing the bow() for the unigram, there are two ways in the manual:</div><div style><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">Let </span><i style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">Z1 </i><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">be the set {</span><i style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">z</i><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">: </span><i style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">c</i><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">(</span><i style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">a</i><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">_</span><i style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">z</i><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">) > 0}. For highest order N-grams we have:</span><pre style="color:rgb(0,0,0)">
        <i>g</i>(<i>a</i>_<i>z</i>)  = max(0, <i>c</i>(<i>a</i>_<i>z</i>) - <i>D</i>) / <i>c</i>(<i>a</i>_)
        bow(<i>a</i>_) = 1 - Sum_<i>Z1</i> <i>g</i>(<i>a</i>_<i>z</i>)
                = 1 - Sum_<i>Z1</i> <i>c</i>(<i>a</i>_<i>z</i>) / <i>c</i>(<i>a</i>_) + Sum_<i>Z1</i> <i>D</i> / <i>c</i>(<i>a</i>_)
                = <i>D</i> <i>n</i>(<i>a</i>_*) / <i>c</i>(<i>a</i>_)

</pre><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">Let </span><i style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">Z2 </i><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">be the set {</span><i style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">z</i><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">: </span><i style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">n</i><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">(*_</span><i style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">z</i><span style="color:rgb(0,0,0);font-family:'Times New Roman';font-size:medium">) > 0}. For lower order N-grams we have:</span><pre style="color:rgb(0,0,0)">
        <i>g</i>(_<i>z</i>)  = max(0, <i>n</i>(*_<i>z</i>) - <i>D</i>) / <i>n</i>(*_*)
        bow(_) = 1 - Sum_<i>Z2</i> <i>g</i>(_<i>z</i>)
               = 1 - Sum_<i>Z2</i> <i>n</i>(*_<i>z</i>) / <i>n</i>(*_*) + Sum_<i>Z2</i> <i>D</i> / <i>n</i>(*_*)
               = <i>D</i> <i>n</i>(_*) / <i>n</i>(*_*)</pre><pre style="color:rgb(0,0,0)">I don't know which equation to take computing the bow() for the unigram , and for unigram, what does 'a' and '_' means respectively?</pre>
<pre style="color:rgb(0,0,0)">Also, I still don't get hold of the -debug 5 output in my last mail.</pre><pre style="color:rgb(0,0,0)">Terribly sorry again for my mistake, hope didn't waste your time and many thanks</pre>
<pre style="color:rgb(0,0,0)"><br></pre><pre style="color:rgb(0,0,0)">Goose</pre></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/29 ºØÌìÐР<span dir="ltr"><<a href="mailto:cloudygooseg@gmail.com" target="_blank">cloudygooseg@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello, I'm trying to understand how does SRILM gives us the output in the lm file, but I can not figure out how these numbers come from.</div>
<div><br></div><div>ngram-count -order 2 -gt1min 1 -gt2min 1 -gt3min 1 -text test_htx.dat -write1 cnt1 -write2 cnt2 -write3 cnt3 -kndiscount1 -kndiscount2 -kndiscount3 -debug 5 -lm lmtest2</div>
<div>test_htx.dat: line 22: 22 sentences, 67 words, 0 OOVs</div><div>0 zeroprobs, logprob= 0 ppl= 1 ppl1= 1</div><div>using ModKneserNey for 1-grams</div><div>modifying 1-gram counts for Kneser-Ney smoothing</div><div>Kneser-Ney smoothing 1-grams</div>

<div>n1 = 2</div><div>n2 = 4</div><div>n3 = 4</div><div>n4 = 4</div><div>D1 = 0.2</div><div>D2 = 1.4</div><div>D3+ = 2.2</div><div>using ModKneserNey for 2-grams</div><div>Kneser-Ney smoothing 2-grams</div><div>n1 = 34</div>

<div>n2 = 10</div><div>n3 = 3</div><div>n4 = 3</div><div>D1 = 0.62963</div><div>D2 = 1.43333</div><div>D3+ = 0.481481</div><div>CONTEXT  WORD </s> NUMER 9 DENOM 52 DISCOUNT 0.755556 LPROB -0.883494</div><div>CONTEXT  WORD Alice NUMER 3 DENOM 52 DISCOUNT 0.266667 LPROB -1.81291</div>

<div>                                                               ........</div><div>In the lm file:</div><div><div>-99<span style="white-space:pre-wrap">        </span><s><span style="white-space:pre-wrap">       </span>0.1888525</div>

<div>-1.309463<span style="white-space:pre-wrap"> </span>Alice<span style="white-space:pre-wrap">   </span>-0.02817659</div><div>                                                               .........</div><div>
I'm trying to understand the line </div><div><div>CONTEXT  WORD Alice NUMER 3 DENOM 52 DISCOUNT 0.266667 LPROB -1.81291</div><div>I know the NUMBER 3 means </div><div>c(* Alice)=3</div><div>I can't figure out the other parameters, and how are they calculated, and how are the result </div>

<div><div>-1.309463<span style="white-space:pre-wrap">      </span>Alice<span style="white-space:pre-wrap">   </span>-0.02817659</div><div>calculated</div><div><br></div><div>I have referred to Chen's paper and SRILM ngram-discount manual, but I still don't know what's going on </div>

<div><br></div><div>This is my cnt1 file</div><div><div><s><span style="white-space:pre-wrap">  </span>22</div><div></s><span style="white-space:pre-wrap">     </span>9</div><div>Alice<span style="white-space:pre-wrap">   </span>3</div>

<div>loves<span style="white-space:pre-wrap">     </span>4</div><div>Bob<span style="white-space:pre-wrap">     </span>2</div><div>also<span style="white-space:pre-wrap">    </span>3</div><div>Kai<span style="white-space:pre-wrap">     </span>2</div>

<div>KaiKai<span style="white-space:pre-wrap">    </span>3</div><div>KK<span style="white-space:pre-wrap">      </span>3</div><div>hates<span style="white-space:pre-wrap">   </span>2</div><div>YY<span style="white-space:pre-wrap">      </span>5</div>

<div>Miss<span style="white-space:pre-wrap">      </span>4</div><div>MM<span style="white-space:pre-wrap">      </span>1</div><div>b3<span style="white-space:pre-wrap">      </span>4</div><div>a3<span style="white-space:pre-wrap">      </span>4</div>

<div>c3<span style="white-space:pre-wrap">        </span>1</div><div>d3<span style="white-space:pre-wrap">      </span>2</div><div><br></div><div>Thank you very much.</div></div><div><br></div></div></div></div></div>
</blockquote></div><br></div>