next up previous
Next: Comparison with Dijkstra's algorithm Up: Complications for Ngrams Previous: Complications for Ngrams

Example: nlp_speech_trigram method.

The start state of the graph search now is the vertex (v0, y2y1). Weights are expressed as 4-tuples by extending the triples of the nlp_speech method with a fourth component expressing trigram weights. These trigram weights are expressed using negative logarithms of (estimates of) probabilities. Let tri be the function which returns for a given sequence of three words this number. Moreover, the definition of this function is extended for longer sequences of words in the obvious way by defining tri(w0w1w2x) = tri(w0w1w2) + tri(w1w2x).

The initial weight is defined as $\mbox{\it ini\/}=\langle 0,0,0,0\rangle$. Weights are updated as follows:


\begin{displaymath}\small\begin{minipage}[t]{.9\textwidth}\normalsize\begin{flus...
...edges}\\
\end{array}\right. $\
\end{flushleft} \end{minipage}\end{displaymath} (36)

Finally, we define an ordering on such tuples. The function $\mbox{\it total}$ is defined on tuples as follows. Here $k_{\mbox{\scriptsize nlp}}$ and $k_{\mbox{\scriptsize wg}}$ are constants.


\begin{displaymath}
\mbox{\it total\/}(\langle c_1, c_2, c_3, c_4\rangle) =
c_4...
...{\scriptsize nlp}}*(c_1+c_2) +
k_{\mbox{\scriptsize wg}}*c_3.
\end{displaymath} (37)

We then define the ordering as:
\begin{displaymath}
\langle c_1, c_2, c_3, c_4\rangle \prec \langle c'_1, c'_2,
...
...) <
\mbox{\it total\/}(\langle c'_1, c'_2, c'_3, c'_4\rangle).
\end{displaymath} (38)


next up previous
Next: Comparison with Dijkstra's algorithm Up: Complications for Ngrams Previous: Complications for Ngrams

2000-07-10