Commit 5acc4f13 by xiaotong

new pages

parent d9d8616e
......@@ -256,6 +256,13 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
%%% 规则的组装对应翻译过程
\begin{frame}{使用规则定义翻译过程}
\begin{itemize}
\item 规则的推导描述双语句子同步生成(和分析)的过程
\begin{itemize}
\item \raisebox{0.3em}{\tikz{\draw[*-*] (0,0)--(0.5,0);}}表示对边缘阶段(变量)的替换操作
\end{itemize}
\end{itemize}
\begin{tikzpicture}
% target side
......@@ -263,11 +270,11 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
\node[scale=0.8] at (1.5, 2.2) {目标语言};
\node[scale=0.6, inner sep=0.1cm, draw] (tfrag1) at
\node[scale=0.6, inner sep=0.1cm, draw,xshift=1em] (tfrag1) at
(0,0.05) {\Tree[.NP [.DT the ] [.NNS imports ]]};
\visible<4->{
\node[scale=0.6, inner sep=0.1cm, draw, sibling distance=115pt] (tfrag2) at
\node[scale=0.6, inner sep=0.1cm, draw, sibling distance=100pt] (tfrag2) at
(1.4,1.4) {\Tree[.S [.NP ] [.VP ]]};
}
......@@ -281,9 +288,9 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
(2.8,-1.8) {\Tree[.RB drastically ]};
}
\visible<4->{\draw[<->] (0.00,0.7) -- (0.00,1.0);}
\visible<4->{\draw[<->] (2.9,0.7) -- (2.9,1.0);}
\visible<3->{\draw[<->] (2.4,-1.4) .. controls +(north:0.6) and +(south:0.6) .. (3.0,-0.6);}
\visible<4->{\draw[*-*] (0.15,0.7) -- (0.15,1.05);}
\visible<4->{\draw[*-*] (2.7,0.7) -- (2.7,1.05);}
\visible<3->{\draw[*-*] (2.4,-1.4) .. controls +(north:0.6) and +(south:0.6) .. (3.0,-0.6);}
\end{scope}
% source side
......@@ -311,14 +318,14 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
(1.3,-1.3) {\Tree[.AD 大幅度 ]};
}
\visible<4->{\draw[<->] (0.05,0.5) -- (0.05,0.95);}
\visible<4->{\draw[<->] (4.15,0.5) -- (4.15,0.95);}
\visible<3->{\draw[<->] (1.55,-0.95) .. controls +(east:1.0) and +(south:0.4) .. (3.5,-0.6);}
\visible<4->{\draw[*-*] (0.05,0.5) -- (0.05,0.95);}
\visible<4->{\draw[*-*] (4.15,0.5) -- (4.15,0.95);}
\visible<3->{\draw[*-*] (1.55,-0.95) .. controls +(east:1.0) and +(south:0.4) .. (3.5,-0.6);}
\end{scope}
% rule 1
\begin{scope}[scale=0.6, xshift=-22em, yshift=-13em, level distance=20pt]
\begin{scope}[scale=0.6, xshift=-22em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.NN 进口 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
......@@ -327,7 +334,7 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
\end{scope}
% rule 2
\begin{scope}[scale=0.6, xshift=-10em, yshift=-13em, level distance=20pt]
\begin{scope}[scale=0.6, xshift=-11em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.AD 大幅度 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
......@@ -336,7 +343,7 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
\end{scope}
% rule 3
\begin{scope}[scale=0.6, xshift=3em, yshift=-13em, level distance=20pt]
\begin{scope}[scale=0.6, xshift=2em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-7em] \Tree[.VP [.AD ] [.ADVP [.VV 下降 ] [.AS 了 ]]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
......@@ -345,7 +352,7 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
\end{scope}
% rule 4
\begin{scope}[scale=0.6, xshift=17em, yshift=-13em, level distance=20pt]
\begin{scope}[scale=0.6, xshift=16em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.IP [.NN ] [.VP ]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
......@@ -354,7 +361,7 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
\end{scope}
% red rule 1
\begin{scope}[red, scale=0.6, xshift=-22em, yshift=-13em, level distance=20pt]
\begin{scope}[red, scale=0.6, xshift=-22em, yshift=-12em, level distance=20pt]
\visible<1>{
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.NN 进口 ] \end{scope}
......@@ -366,7 +373,7 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
\visible<2>{
% red rule 2
\begin{scope}[red, scale=0.6, xshift=-10em, yshift=-13em, level distance=20pt]
\begin{scope}[red, scale=0.6, xshift=-11em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.AD 大幅度 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
......@@ -377,7 +384,7 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
\visible<3>{
% red rule 3
\begin{scope}[red, scale=0.6, xshift=3em, yshift=-13em, level distance=20pt]
\begin{scope}[red, scale=0.6, xshift=2em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-7em] \Tree[.VP [.AD ] [.ADVP [.VV 下降 ] [.AS 了 ]]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
......@@ -388,7 +395,7 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
\visible<4>{
% rule 4
\begin{scope}[red, scale=0.6, xshift=17em, yshift=-13em, level distance=20pt]
\begin{scope}[red, scale=0.6, xshift=16em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.IP [.NN ] [.VP ]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
......
......@@ -1106,15 +1106,16 @@ $d$是一个$(\textbf{s},\textbf{t})$上基于短语的翻译推导,$\textrm{P
\item 调序模型:描述翻译中的调序现象
\end{enumerate}
\item<2-> 希望有这样一种模型可以对任意的因素进行方便的建模。经典的判别式模型成为了不二的选择
\end{itemize}
\item<2-> 希望有这样一种模型可以对任意的因素进行方便的建模。经典的判别式模型成为了不二的选择\\
\vspace{-0.2em}
\vspace{0.5em}
\visible<2->{
\textbf{Discriminative Training and Maximum Entropy Models for Statistical Machine Translation}\\
\textbf{Franz Och and Hermann Ney, 2002, In Proc of ACL}
}
\end{itemize}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
......@@ -2367,6 +2368,272 @@ d = r_1 \circ r_2 \circ r_3 \circ r_4
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 规则实例(树到树)
\begin{frame}{基于树的翻译规则}
\begin{itemize}
\item 上述文法定义了一种树结构到树结构的映射,例子:
\end{itemize}
\begin{center}
\begin{tikzpicture}
{\scriptsize
\begin{scope}[sibling distance=5pt, level distance = 22pt]
\Tree[.\node(s1){VP}; [.\node(s2){PP}; ] [.\node(s3){VP}; [.\node(s4){VV}; \node[fill=white](w1){表示}; ] [.\node(s5){NN}; ] ] ]
\end{scope}
\begin{scope}[xshift=2in,sibling distance=5pt, level distance = 22pt]
\Tree[.\node(t1){VP}; [.\node(t2){VBZ}; \node(w2){was}; ] [.\node(t3){VP}; [.\node(t4){VBN}; ] [.\node(t5){PP}; ] ] ]
\end{scope}
\begin{pgfonlayer}{background}
\node [anchor=west] (arrow) at ([xshift=3em]s5.east) {\Large{\textbf{$\to$}}};
\visible<2->{
\node [inner sep=0,fill=orange!20] [fit = (s2)] (snode1) {};
\node [inner sep=0,fill=green!20] [fit = (s5)] (snode2) {};
\node [inner sep=0,fill=green!20] [fit = (t4)] (tnode1) {};
\node [inner sep=0,fill=orange!20] [fit = (t5)] (tnode2) {};
\draw [<->,dotted,thick] (snode2.south) ..controls +(south:2.5em) and +(south:2.5em).. (tnode1.south);
\draw [<->,dotted,thick] (snode1.south) ..controls +(south:8em) and +(south:4.5em).. (tnode2.south);
}
\end{pgfonlayer}
}
\end{tikzpicture}
\end{center}
\vspace{-2.0em}
\begin{itemize}
\item 由规则定义$\langle\ \alpha_h, \beta_h\ \rangle \to \langle\ \alpha_r, \beta_r, \sim\ \rangle$知道
\vspace{-1.3em}
{\small
\begin{eqnarray}
\langle\ \alpha_h,\beta_h\ \rangle & = & \langle\ \textrm{VP}, \textrm{VP}\ \rangle \nonumber \\
\alpha_r & = & \textrm{VP(PP:}x\ \textrm{VP(VV(表示) NN:}x)) \nonumber \\
\beta_r & = & \textrm{VP(VBZ(was) VP(VBZ:}x\ \textrm{PP:}x)) \nonumber \\
\sim & = & \{1-2,2-1\} \nonumber
\end{eqnarray}
}
\vspace{-1.7em}
\visible<2->{
$x$表示叶子非终结符(可替换的变量),显然这是调序规则
}
\end{itemize}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 规则实例(树到树)
\begin{frame}{基于树的翻译规则(续)}
\begin{itemize}
\item 可以省略``$\sim$'',把规则重新写为易于计算机处理的格式 \\
\vspace{-1em}
\begin{eqnarray}
\langle\ \textrm{VP}, \textrm{VP}\ \rangle & \to & \langle\ \textrm{VP(PP}_{\alert{1}}\ \textrm{VP(VV(表示) NN}_{\alert{2}})), \nonumber \\
& & \ \ \textrm{VP(VBZ(was) VP(VBZ}_{\alert{2}}\ \textrm{PP}_{\alert{1}}))\ \rangle \nonumber
\end{eqnarray}
其中变量的对应关系用下标数字表示,比如:$\textrm{PP}_1 \leftrightarrow \textrm{PP}_1$$\textrm{NN}_2 \leftrightarrow \textrm{VBZ}_2$
\item<2-> 在这个规则的树结构中,每个叶子非终结符本质上定义了一个变量,这个节点也被称作边缘节点(frontier node)。边缘节点可以被其它树结构替换,组合为更大的树结构,这个操作被称作组合(composition) 或树替换
\end{itemize}
\visible<2->{
\begin{center}
\begin{tikzpicture}
{\scriptsize
\begin{scope}[sibling distance=5pt, level distance = 22pt]
\Tree[.\node(s1){VP}; [.\node(s2){PP}; ] [.\node(s3){VP}; [.\node(s4){VV}; \node[fill=white](w1){表示}; ] [.\node(s5){NN}; ] ] ]
\end{scope}
\begin{scope}[xshift=1.2in, yshift=-0.2in, sibling distance=5pt, level distance = 22pt]
\Tree[.\node(ws1){NN}; \node(ws2){满意}; ]
\end{scope}
\node (anchor=west] (arrow) at ([xshift=0.4in]ws2.east) {\large{$\Rightarrow$}};
\begin{pgfonlayer}{background}
\node [inner sep=0,fill=green!20] [fit = (ws1)] (snode1) {};
\node [inner sep=0,fill=green!20] [fit = (s5)] (snode2) {};
\draw [<-,thick,dotted] ([xshift=0.1em]s5.east) ..controls +(east:3em) and +(west:3em).. ([xshift=-0.1em]ws1.west);
\end{pgfonlayer}
\begin{scope}[xshift=2.5in, sibling distance=5pt, level distance = 22pt]
\Tree[.\node(s1){VP}; [.\node(s2){PP}; ] [.\node(s3){VP}; [.\node(s4){VV}; \node[fill=white](w1){表示}; ] [.\node(s5){NN}; \node(w2){满意}; ] ] ]
\end{scope}
}
\end{tikzpicture}
\end{center}
}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 规则的组装对应翻译过程
\begin{frame}{使用规则定义翻译过程}
\begin{itemize}
\item 规则的推导描述双语句子同步生成(和分析)的过程
\begin{itemize}
\item \raisebox{0.3em}{\tikz{\draw[*-*] (0,0)--(0.5,0);}}表示对边缘阶段(变量)的替换操作
\end{itemize}
\end{itemize}
\begin{tikzpicture}
% target side
\begin{scope}[xshift=-1em, level distance=25pt]
\node[scale=0.8] at (1.5, 2.2) {目标语言};
\node[scale=0.6, inner sep=0.1cm, draw,xshift=1em] (tfrag1) at
(0,0.05) {\Tree[.NP [.DT the ] [.NNS imports ]]};
\visible<4->{
\node[scale=0.6, inner sep=0.1cm, draw, sibling distance=100pt] (tfrag2) at
(1.4,1.4) {\Tree[.S [.NP ] [.VP ]]};
}
\visible<3->{
\node[scale=0.6, inner sep=0.1cm, draw, sibling distance=30pt] (tfrag3) at
(3,-0.2) {\Tree[.VP [.VBZ have ] [.ADVP [.RB ] [.VBN fallen ]]]};
}
\visible<2->{
\node[scale=0.6, inner sep=0.1cm, draw,xshift=-1.5em] (tfrag4) at
(2.8,-1.8) {\Tree[.RB drastically ]};
}
\visible<4->{\draw[*-*] (0.15,0.7) -- (0.15,1.05);}
\visible<4->{\draw[*-*] (2.7,0.7) -- (2.7,1.05);}
\visible<3->{\draw[*-*] (2.4,-1.4) .. controls +(north:0.6) and +(south:0.6) .. (3.0,-0.6);}
\end{scope}
% source side
\begin{scope}[scale=0.8, level distance=25pt, xshift=-20em, yshift=1em]
\node[scale=0.8] at (2.1, 2.45) {源语言};
\visible<1->{
\node[scale=0.6, inner sep=0.1cm, draw] (sfrag1) at
(0,0) {\Tree[.NN 进口 ]};
}
\visible<4->{
\node[scale=0.6, inner sep=0.1cm, draw, sibling distance=135pt] (sfrag2) at
(2.0,1.4) {\Tree[.IP [.NN ] [.VP ]]};
}
\visible<3->{
\node[scale=0.6, inner sep=0.1cm, xshift=1em, draw] (sfrag3) at
(4,-0.7) {\Tree[.VP [.AD ] [.ADVP [.VV 下降 ] [.AS 了 ]]]};
}
\visible<2->{
\node[scale=0.6, inner sep=0.1cm, draw] (sfrag4) at
(1.3,-1.3) {\Tree[.AD 大幅度 ]};
}
\visible<4->{\draw[*-*] (0.05,0.5) -- (0.05,0.95);}
\visible<4->{\draw[*-*] (4.15,0.5) -- (4.15,0.95);}
\visible<3->{\draw[*-*] (1.55,-0.95) .. controls +(east:1.0) and +(south:0.4) .. (3.5,-0.6);}
\end{scope}
% rule 1
\begin{scope}[scale=0.6, xshift=-22em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.NN 进口 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west] \Tree[.NP [.DT the ] [.NNS imports ]] \end{scope}
\end{scope}
% rule 2
\begin{scope}[scale=0.6, xshift=-11em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.AD 大幅度 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west] \Tree[.RB drastically ] \end{scope}
\end{scope}
% rule 3
\begin{scope}[scale=0.6, xshift=2em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-7em] \Tree[.VP [.AD ] [.ADVP [.VV 下降 ] [.AS 了 ]]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west, xshift=1em] \Tree[.VP [.VBZ have ] [.ADVP [.RB ] [.VBN fallen ]]] \end{scope}
\end{scope}
% rule 4
\begin{scope}[scale=0.6, xshift=16em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.IP [.NN ] [.VP ]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west,xshift=-1em] \Tree[.S [.NP ] [.VP ]] \end{scope}
\end{scope}
% red rule 1
\begin{scope}[red, scale=0.6, xshift=-22em, yshift=-12em, level distance=20pt]
\visible<1>{
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.NN 进口 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west] \Tree[.NP [.DT the ] [.NNS imports ]] \end{scope}
}
\end{scope}
\visible<2>{
% red rule 2
\begin{scope}[red, scale=0.6, xshift=-11em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.AD 大幅度 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west] \Tree[.RB drastically ] \end{scope}
\end{scope}
}
\visible<3>{
% red rule 3
\begin{scope}[red, scale=0.6, xshift=2em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-7em] \Tree[.VP [.AD ] [.ADVP [.VV 下降 ] [.AS 了 ]]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west, xshift=1em] \Tree[.VP [.VBZ have ] [.ADVP [.RB ] [.VBN fallen ]]] \end{scope}
\end{scope}
}
\visible<4>{
% rule 4
\begin{scope}[red, scale=0.6, xshift=16em, yshift=-12em, level distance=20pt]
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.IP [.NN ] [.VP ]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west,xshift=-1em] \Tree[.S [.NP ] [.VP ]] \end{scope}
\end{scope}
}
\end{tikzpicture}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
\subsection{翻译规则抽取}
%%%------------------------------------------------------------------------------------------------------------
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论