<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix"><br>
What I call "scores" are usually log likelihoods or log
probabilities, sometimes scaled in some fashion. lattice-tool
does not care about the probabilistic interpretation of such
scores, it just combines the scores according to their weights and
finds the path with the highest overall score.<br>
<br>
In the case of HTK lattices, the scores typically encoded in the
lattices are acoustic model (a=), ngram model (n=), general
language model (l=), and sometimes pronunciation weights (r=). <br>
The HTK lattice format has been generalized to allow up to 9
additional scores to be encoded (x1= through x9=) on nodes or
links.<br>
<br>
The header of the lattice file can define the weights for these
scores (acscale=, ngscale=, lmscale=, prscale=). There is also a
word insertion penalty (wdpenalty=) that implies a constant
additional score on each word hypothesis.<br>
<br>
Score weights can be overridden on the command line (-htk-scscale,
-htk-lmscale, etc.). If no score weights are given they default
to 1 (or 0 for the word penalty).<br>
<br>
If you specify an external language model that will override the
l= (general lm) scores in the lattice, but that is optional.<br>
<br>
lattice-tool will generate an aggregate score from the weighted
combination of all scores, and decode the lattice path with the
highest overall score (from both nodes and links).<br>
<br>
Andreas<br>
<br>
<br>
On 6/6/2018 2:44 PM, Andreas Stolcke wrote:<br>
</div>
<blockquote type="cite"
cite="mid:MW2PR2101MB1052F5B3A159842FD160287BE8650@MW2PR2101MB1052.namprd21.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Menlo;
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;}
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;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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"><o:p> </o:p></p>
<p class="MsoNormal"><b>From:</b> Michael Campbell
<a class="moz-txt-link-rfc2396E" href="mailto:mcampbell@veritone.com"><mcampbell@veritone.com></a> <br>
<b>Sent:</b> Wednesday, June 6, 2018 2:31 PM<br>
<b>To:</b> Andreas Stolcke
<a class="moz-txt-link-rfc2396E" href="mailto:Andreas.Stolcke@microsoft.com"><Andreas.Stolcke@microsoft.com></a><br>
<b>Subject:</b> Re: question about lattice-tool<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">By scores, you mean probabilities of
words?<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The lattice I input consists of edges
representing multiple word candidates per time step =
node. I use the HTK lattice format and do not assign any
probabilities to edges in my lattice.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">For example,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<pre><i><span style="font-size:9.0pt;font-family:"Menlo",serif;color:gray"> __their_____
/ \
*----there----*---going---*
t=0 \____they're_/t=1 t=2</span></i><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></pre>
<pre><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black"><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">I thought lattice-tool would choose the path of highest probability based on a built-in language model. For example, that it would produce output from above as "they're going" since it would have the highest probability.</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">It is interesting that lattice-tool *does* produce output for such a lattice (without probabilities or scores). How does it compute that output?</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></pre>
<pre><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black"><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">best,</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">Mike </span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></pre>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Jun 6, 2018 at 1:27 PM, Andreas
Stolcke <<a href="mailto:Andreas.Stolcke@microsoft.com"
target="_blank" moz-do-not-send="true">Andreas.Stolcke@microsoft.com</a>>
wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Michael,<o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Lattice-tool
does not require a language model. If non is
given, the scores contained in the lattice will be
used for decoding (-viterbi-decode, -nbest-decode,
-posterior-decode) and confusion network building
(-write-mesh).<o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Andreas<o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>From:</b>
Michael Campbell <<a
href="mailto:mcampbell@veritone.com"
target="_blank" moz-do-not-send="true">mcampbell@veritone.com</a>>
<br>
<b>Sent:</b> Wednesday, June 6, 2018 1:10 PM<br>
<b>To:</b> Andreas Stolcke <<a
href="mailto:Andreas.Stolcke@microsoft.com"
target="_blank" moz-do-not-send="true">Andreas.Stolcke@microsoft.com</a>><br>
<b>Subject:</b> question about lattice-tool<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello
Andreas,<o:p></o:p></p>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I
am using the SRILM "lattice-tool" utility,
for which you are listed as an author.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I
am new to this, and the documentation does
not say whether or not "lattice-tool"
requires<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">a
Language Model to be input in order to use
Viterbi or Posterior algorithms on a lattice
of words.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">
* I created a lattice of words, and would
like to see the most probable sentence. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">
* If I use Viterbi, I get a result,
<b>without using any language model options</b>.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>Does
"lattice-tool" use a built-in language
model to give that result, or is the
result 'nonsense' since I am not inputting
a language model into "lattice-tool"? </b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thank
you very much for any feedback.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">All
the best,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Mike<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">--
<o:p></o:p></p>
<div>
<div>
<p
style="margin-bottom:30.0pt;line-height:13.5pt"><b><span
style="font-size:10.5pt;font-family:"Helvetica",sans-serif">Michael
Campbell</span></b><span
style="font-size:10.5pt;font-family:"Helvetica",sans-serif"><br>
mcampbell<a
href="mailto:youremail@veritone.com"
target="_blank"
moz-do-not-send="true"><span
style="text-decoration:none">@veritone.com</span></a></span><o:p></o:p></p>
<p
style="margin-bottom:7.5pt;line-height:13.5pt"><span
style="font-size:10.5pt;font-family:"Helvetica",sans-serif;color:black"><a
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.veritone.com%2F&data=02%7C01%7Candreas.stolcke%40microsoft.com%7C5372e4261e8a4949118308d5cbe9845f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636639126171722470&sdata=%2B%2FgJZobo%2ByG2E1qfHJv44L41%2FCM2TeTDOos4YonJpBE%3D&reserved=0"
target="_blank"
moz-do-not-send="true"><span
style="text-decoration:none"><img
style="width:1.875in;height:.3583in"
id="m_3195958008067931133_x005f_x0000_i1025"
src="https://static.veritone.com/logo/veritone-logo.png" alt="Veritone"
moz-do-not-send="true"
height="34" width="180"
border="0"></span></a><br>
<b>Veritone, Inc.</b><br>
<a
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmaps.google.com%2F%3Fq%3D575%2BAnton%2BBlvd.%2BSuite%2B100%2C%2BCosta%2BMesa%2C%2BCA.%2B92626%26entry%3Dgmail%26source%3Dg&data=02%7C01%7CAndreas.Stolcke%40microsoft.com%7C62343e8765c0435d255208d5cbf4bda3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636639174377239258&sdata=6z1l6Q9HvpZaRao5lfZoBLIbPTNchLm2Nw0tdpqVN2Y%3D&reserved=0"
moz-do-not-send="true">575 Anton
Blvd. Suite 100, Costa Mesa, CA.
92626</a><br>
<a
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.veritone.com%2F&data=02%7C01%7Candreas.stolcke%40microsoft.com%7C5372e4261e8a4949118308d5cbe9845f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636639126171732475&sdata=LJFiuKplRH9lC%2BY%2Fy6tDc9jNvRIcJKD7UC7AdpYiMVE%3D&reserved=0"
target="_blank"
moz-do-not-send="true"><span
style="text-decoration:none">www.veritone.com</span></a></span><o:p></o:p></p>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p style="margin-bottom:30.0pt;line-height:13.5pt"><b><span
style="font-size:10.5pt;font-family:"Helvetica",sans-serif">Michael
Campbell</span></b><span
style="font-size:10.5pt;font-family:"Helvetica",sans-serif"><br>
mcampbell<a href="mailto:youremail@veritone.com"
target="_blank" moz-do-not-send="true"><span
style="text-decoration:none">@veritone.com</span></a><o:p></o:p></span></p>
<p style="margin-bottom:7.5pt;line-height:13.5pt"><span
style="font-size:10.5pt;font-family:"Helvetica",sans-serif;color:black"><a
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.veritone.com%2F&data=02%7C01%7CAndreas.Stolcke%40microsoft.com%7C62343e8765c0435d255208d5cbf4bda3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636639174377239258&sdata=eKT48dBBohsLkdUtK7zvfH9qto7l4YEymlGFkzFyLkI%3D&reserved=0"
target="_blank" moz-do-not-send="true"><span
style="text-decoration:none"><img
style="width:1.875in;height:.3583in"
id="_x0000_i1026"
src="https://static.veritone.com/logo/veritone-logo.png"
alt="Veritone" moz-do-not-send="true"
height="34" width="180" border="0"></span></a><br>
<b>Veritone, Inc.</b><br>
575 Anton Blvd. Suite 100, Costa Mesa, CA. 92626<br>
<a
href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.veritone.com%2F&data=02%7C01%7CAndreas.Stolcke%40microsoft.com%7C62343e8765c0435d255208d5cbf4bda3%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636639174377249272&sdata=6a3lUiV%2BQ%2B4fWOu0zF813u52Ken1Vz8aRdYt%2FZsezVw%3D&reserved=0"
target="_blank" moz-do-not-send="true"><span
style="text-decoration:none">www.veritone.com</span></a><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>