<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 2/3/2010 9:18 PM, Sun, Xie (MU-Student) wrote:
<blockquote
 cite="mid:7526A965F8042A4681330F15B8BA201112A8D07C@BL2PRD0102MB027.prod.exchangelabs.com"
 type="cite">
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1">
  <title></title>
  <style type="text/css"></style>
  <style id="owaParaStyle" type="text/css"></style>
  <div
 style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 13px;">
  <div style="">&nbsp;Dear Dr.<font size="2">Andreas Stolcke,<br>
  <span style="font-family: Tahoma;"><br>
  <span style="font-family: Tahoma;">I am PhD student from University
of Missouri. My name is Xie Sun. Right now I am using the SRILM toolkit
to train a language model. I want to use the model adaptation function.
I am using the command as below:<br>
  <span style="font-family: Tahoma;"><br>
ngram -lm main_model&nbsp; -adapt-marginals model_adapted&nbsp; -base-marginals
unigram_model -ppl test_file<br>
  <span style="font-family: Tahoma;"><br>
  <span style="font-family: Tahoma;">where the unigram_model is coming
from the main_model and model_adapted is the mode I want to adapt.<br>
  </span></span></span></span></span></font></div>
  </div>
</blockquote>
I'm assuming model_adapted refers to the marginals of the adaptation
data.&nbsp; Then this command is correct.<br>
Note that -base-marginals needs to be specified only if the unadapted
unigrams are different from the unigrams in main_model.<br>
<blockquote
 cite="mid:7526A965F8042A4681330F15B8BA201112A8D07C@BL2PRD0102MB027.prod.exchangelabs.com"
 type="cite">
  <div
 style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 13px;">
  <div style=""><font size="2"><span style="font-family: Tahoma;"><span
 style="font-family: Tahoma;"><span style="font-family: Tahoma;"><span
 style="font-family: Tahoma;"><span style="font-family: Tahoma;"><span
 style="font-family: Tahoma;"><br>
  <span style="font-family: Tahoma;">I am not sure if what I did is
correct. Besides, one more important question is how I can output the
adapted model. I used the option -write-lm. But it does not work. Could
you give me some hints? I will really appreciate your help.<br>
  </span></span></span></span></span></span></span></font></div>
  </div>
</blockquote>
The AdaptMarginals does not support -write-lm at this point.&nbsp; It should
be very slow as you'd have to compute the normalization for every
context appearing in the LM.<br>
You can simulate the effect of -write-lm by employing the
-rescore-ngram option:<br>
<br>
ngram -lm -main_model -adapt-marginals ... -rescore-ngram main_model
write-lm new_model <br>
<br>
Again, this will take a very long time for regular-sized LMs.<br>
<br>
Andreas<br>
<br>
</body>
</html>