Commit ea4c58d0 by xiaotong

minor updates (sec 5, N => K)

parent c446bdaf
......@@ -10,8 +10,8 @@
\node [anchor=west,inner sep=2pt] (eq1) at (0,0) {$f(s_u|t_v)$};
\node [anchor=west] (eq2) at (eq1.east) {$=$\ };
\draw [-] ([xshift=0.3em]eq2.east) -- ([xshift=11.6em]eq2.east);
\node [anchor=south west] (eq3) at ([xshift=1em]eq2.east) {$\sum_{i=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})$};
\node [anchor=north west] (eq4) at (eq2.east) {$\sum_{s_u} \sum_{i=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})$};
\node [anchor=south west] (eq3) at ([xshift=1em]eq2.east) {$\sum_{i=1}^{K} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})$};
\node [anchor=north west] (eq4) at (eq2.east) {$\sum_{s_u} \sum_{i=1}^{K} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})$};
{
\node [anchor=south] (label1) at ([yshift=-6em,xshift=3em]eq1.north west) {利用这个公式计算};
......
......@@ -6,17 +6,17 @@
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=north west] (line1) at (0,0) {\small\sffamily\bfseries{IBM模型1的训练(EM算法)}};
\node [anchor=north west] (line2) at ([yshift=-0.3em]line1.south west) {输入: 平行语料${(\seq{s}^{[1]},\seq{t}^{[1]}),...,(\seq{s}^{[N]},\seq{t}^{[N]})}$};
\node [anchor=north west] (line2) at ([yshift=-0.3em]line1.south west) {输入: 平行语料${(\seq{s}^{[1]},\seq{t}^{[1]}),...,(\seq{s}^{[K]},\seq{t}^{[K]})}$};
\node [anchor=north west] (line3) at ([yshift=-0.1em]line2.south west) {输出: 参数$f(\cdot|\cdot)$的最优值};
\node [anchor=north west] (line4) at ([yshift=-0.1em]line3.south west) {1: \textbf{Function} \textsc{EM}($\{(\seq{s}^{[1]},\seq{t}^{[1]}),...,(\seq{s}^{[N]},\seq{t}^{[N]})\}$) };
\node [anchor=north west] (line4) at ([yshift=-0.1em]line3.south west) {1: \textbf{Function} \textsc{EM}($\{(\seq{s}^{[1]},\seq{t}^{[1]}),...,(\seq{s}^{[K]},\seq{t}^{[K]})\}$) };
\node [anchor=north west] (line5) at ([yshift=-0.1em]line4.south west) {2: \ \ Initialize $f(\cdot|\cdot)$ \hspace{5em} $\rhd$ 比如给$f(\cdot|\cdot)$一个均匀分布};
\node [anchor=north west] (line6) at ([yshift=-0.1em]line5.south west) {3: \ \ Loop until $f(\cdot|\cdot)$ converges};
\node [anchor=north west] (line7) at ([yshift=-0.1em]line6.south west) {4: \ \ \ \ \textbf{foreach} $k = 1$ to $N$ \textbf{do}};
\node [anchor=north west] (line7) at ([yshift=-0.1em]line6.south west) {4: \ \ \ \ \textbf{foreach} $k = 1$ to $K$ \textbf{do}};
\node [anchor=north west] (line8) at ([yshift=-0.1em]line7.south west) {5: \ \ \ \ \ \ \ \footnotesize{$c_{\mathbb{E}}(\seq{s}_u|\seq{t}_v;\seq{s}^{[k]},\seq{t}^{[k]}) = \sum\limits_{j=1}^{|\seq{s}^{[k]}|} \delta(s_j,s_u) \sum\limits_{i=0}^{|\seq{t}^{[k]}|} \delta(t_i,t_v) \cdot \frac{f(s_u|t_v)}{\sum_{i=0}^{l}f(s_u|t_i)}$}\normalsize{}};
\node [anchor=north west] (line9) at ([yshift=-0.1em]line8.south west) {6: \ \ \ \ \textbf{foreach} $t_v$ appears at least one of $\{\seq{t}^{[1]},...,\seq{t}^{[N]}\}$ \textbf{do}};
\node [anchor=north west] (line10) at ([yshift=-0.1em]line9.south west) {7: \ \ \ \ \ \ \ $\lambda_{t_v}^{'} = \sum_{s_u} \sum_{k=1}^{N} c_{\mathbb{E}}(s_u|t_v;\seq{s}^{[k]},\seq{t}^{[k]})$};
\node [anchor=north west] (line11) at ([yshift=-0.1em]line10.south west) {8: \ \ \ \ \ \ \ \textbf{foreach} $s_u$ appears at least one of $\{\seq{s}^{[1]},...,\seq{s}^{[N]}\}$ \textbf{do}};
\node [anchor=north west] (line12) at ([yshift=-0.1em]line11.south west) {9: \ \ \ \ \ \ \ \ \ $f(s_u|t_v) = \sum_{k=1}^{N} c_{\mathbb{E}}(s_u|t_v;\seq{s}^{[k]},\seq{t}^{[k]}) \cdot (\lambda_{t_v}^{'})^{-1}$};
\node [anchor=north west] (line9) at ([yshift=-0.1em]line8.south west) {6: \ \ \ \ \textbf{foreach} $t_v$ appears at least one of $\{\seq{t}^{[1]},...,\seq{t}^{[K]}\}$ \textbf{do}};
\node [anchor=north west] (line10) at ([yshift=-0.1em]line9.south west) {7: \ \ \ \ \ \ \ $\lambda_{t_v}^{'} = \sum_{s_u} \sum_{k=1}^{K} c_{\mathbb{E}}(s_u|t_v;\seq{s}^{[k]},\seq{t}^{[k]})$};
\node [anchor=north west] (line11) at ([yshift=-0.1em]line10.south west) {8: \ \ \ \ \ \ \ \textbf{foreach} $s_u$ appears at least one of $\{\seq{s}^{[1]},...,\seq{s}^{[K]}\}$ \textbf{do}};
\node [anchor=north west] (line12) at ([yshift=-0.1em]line11.south west) {9: \ \ \ \ \ \ \ \ \ $f(s_u|t_v) = \sum_{k=1}^{K} c_{\mathbb{E}}(s_u|t_v;\seq{s}^{[k]},\seq{t}^{[k]}) \cdot (\lambda_{t_v}^{'})^{-1}$};
\node [anchor=north west] (line13) at ([yshift=-0.1em]line12.south west) {10: \ \textbf{return} $f(\cdot|\cdot)$};
\begin{pgfonlayer}{background}
......
......@@ -50,7 +50,7 @@ IBM模型由Peter F. Brown等人于上世纪九十年代初提出\upcite{DBLP:jo
\end{figure}
%----------------------------------------------
\parinterval 上面的例子反映了人在做翻译时所使用的一些知识:首先,两种语言单词的顺序可能不一致,而且译文需要符合目标语的习惯,这也就是常说的翻译的{\small\sffamily\bfseries{流畅度}}\index{流畅度}问题(Fluency)\index{Fluency};其次,源语言单词需要准确地被翻译出来,也就是常说的翻译的{\small\sffamily\bfseries{准确性}}\index{准确性}(Accuracy)\index{Accuracy}问题和{\small\sffamily\bfseries{充分性}}\index{充分性}(Adequacy)\index{Adequacy}问题。为了达到以上目的,传统观点认为翻译过程需要包含三个步骤\upcite{parsing2009speech}
\parinterval 上面的例子反映了人在做翻译时所使用的一些知识:首先,两种语言单词的顺序可能不一致,而且译文需要符合目标语的习惯,这也就是常说的翻译的{\small\sffamily\bfseries{流畅度}}\index{流畅度}问题(Fluency)\index{Fluency};其次,源语言单词需要准确地被翻译出来,也就是常说的翻译的{\small\sffamily\bfseries{准确性}}\index{准确性}(Accuracy)\index{Accuracy}问题和{\small\sffamily\bfseries{充分性}}\index{充分性}(Adequacy)\index{Adequacy}问题。为了达到以上目的,传统观点认为翻译过程需要包含三个步骤\upcite{parsing2009speech}
\begin{itemize}
\vspace{0.5em}
......@@ -633,7 +633,7 @@ g(\seq{s},\seq{t}) \equiv \prod_{j,i \in \widehat{A}}{\funp{P}(s_j,t_i)} \times
\end{figure}
%----------------------------------------------
\item 源语言单词可以翻译为空,这时它对应到一个虚拟或伪造的目标语单词$t_0$。在图\ref{fig:5-16}所示的例子中,``在''没有对应到``on the table''中的任意一个词,而是把它对应到$t_0$上。这样,所有的源语言单词都能找到一个目标语单词对应。这种设计也很好地引入了{\small\sffamily\bfseries{空对齐}}\index{空对齐}的思想,即源语言单词不对应任何真实存在的单词的情况。而这种空对齐的情况在翻译中是频繁出现的,比如虚词的翻译。
\item 源语言单词可以翻译为空,这时它对应到一个虚拟或伪造的目标语单词$t_0$。在图\ref{fig:5-16}所示的例子中,``在''没有对应到``on the table''中的任意一个词,而是把它对应到$t_0$上。这样,所有的源语言单词都能找到一个目标语单词对应。这种设计也很好地引入了{\small\sffamily\bfseries{空对齐}}\index{空对齐}(Empty Alignment\index{Empty Alignment}的思想,即源语言单词不对应任何真实存在的单词的情况。而这种空对齐的情况在翻译中是频繁出现的,比如虚词的翻译。
%----------------------------------------------
\begin{figure}[htp]
......@@ -703,7 +703,7 @@ g(\seq{s},\seq{t}) \equiv \prod_{j,i \in \widehat{A}}{\funp{P}(s_j,t_i)} \times
\subsection{基于词对齐的翻译实例}
\parinterval 用前面图\ref{fig:5-16}中例子来对公式\ref{eq:5-18}进行说明。例子中,源语言句子``在\ \ 桌子\ \ 上''目标语译文``on the table''之间的词对齐为$\seq{a}=\{\textrm{1-0, 2-3, 3-1}\}$。公式\ref{eq:5-18}的计算过程如下:
\parinterval 用前面图\ref{fig:5-16}中例子来对公式\ref{eq:5-18}进行说明。例子中,源语言句子``在\ \ 桌子\ \ 上''目标语译文``on the table''之间的词对齐为$\seq{a}=\{\textrm{1-0, 2-3, 3-1}\}$ 公式\ref{eq:5-18}的计算过程如下:
\begin{itemize}
\vspace{0.5em}
......@@ -720,11 +720,11 @@ g(\seq{s},\seq{t}) \equiv \prod_{j,i \in \widehat{A}}{\funp{P}(s_j,t_i)} \times
\funp{P}(\seq{s},\seq{a}|\seq{t})\; &= & \funp{P}(m|\seq{t}) \prod\limits_{j=1}^{m} \funp{P}(a_j|a_{1}^{j-1},s_{1}^{j-1},m,\seq{t}) \funp{P}(s_j|a_{1}^{j},s_{1}^{j-1},m,\seq{t}) \nonumber \\
&=&\funp{P}(m=3 \mid \textrm{$t_0$ on the table}){\times} \nonumber \\
&&{\funp{P}(a_1=0 \mid \phi,\phi,3,\textrm{$t_0$ on the table}){\times} } \nonumber \\
&&{\funp{P}(f_1=\textrm{} \mid \textrm{\{1-0\}},\phi,3,\textrm{$t_0$ on the table}){\times} } \nonumber \\
&&{\funp{P}(s_1=\textrm{} \mid \textrm{\{1-0\}},\phi,3,\textrm{$t_0$ on the table}){\times} } \nonumber \\
&&{\funp{P}(a_2=3 \mid \textrm{\{1-0\}},\textrm{},3,\textrm{$t_0$ on the table}) {\times}} \nonumber \\
&&{\funp{P}(f_2=\textrm{桌子} \mid \textrm{\{1-0, 2-3\}},\textrm{},3,\textrm{$t_0$ on the table}) {\times}} \nonumber \\
&&{\funp{P}(s_2=\textrm{桌子} \mid \textrm{\{1-0, 2-3\}},\textrm{},3,\textrm{$t_0$ on the table}) {\times}} \nonumber \\
&&{\funp{P}(a_3=1 \mid \textrm{\{1-0, 2-3\}},\textrm{\ \ 桌子},3,\textrm{$t_0$ on the table}) {\times}} \nonumber \\
&&{\funp{P}(f_3=\textrm{} \mid \textrm{\{1-0, 2-3, 3-1\}},\textrm{\ \ 桌子},3,\textrm{$t_0$ on the table}) }
&&{\funp{P}(s_3=\textrm{} \mid \textrm{\{1-0, 2-3, 3-1\}},\textrm{\ \ 桌子},3,\textrm{$t_0$ on the table}) }
\label{eq:5-19}
\end{eqnarray}
......@@ -1065,9 +1065,9 @@ f(s_u|t_v)=\frac{c_{\mathbb{E}}(s_u|t_v;\seq{s},\seq{t})} { \sum\limits_{s_u} c
%----------------------------------------------
\parinterval 进一步,假设有$N$个互译的句对(称作平行语料):
$\{(\seq{s}^{[1]},\seq{t}^{[1]}),...,(\seq{s}^{[N]},\seq{t}^{[N]})\}$$f(s_u|t_v)$的期望频次为:
$\{(\seq{s}^{[1]},\seq{t}^{[1]}),...,(\seq{s}^{[K]},\seq{t}^{[K]})\}$$f(s_u|t_v)$的期望频次为:
\begin{eqnarray}
c_{\mathbb{E}}(s_u|t_v)=\sum\limits_{i=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})
c_{\mathbb{E}}(s_u|t_v)=\sum\limits_{i=1}^{K} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})
\label{eq:5-46}
\end{eqnarray}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论