Commit 15f965f0 by xiaotong

new update

parent 8c966f51
......@@ -49,7 +49,8 @@
\setbeamercolor{uppercol}{fg=white,bg=ugreen}
\setbeamercolor{lowercol}{fg=black,bg=xtgreen}
%\definecolor{ublue}{rgb}{0,0.298,0.525}
\definecolor{darkred}{rgb}{0.55, 0.0, 0.0}
\definecolor{alizarin}{rgb}{0.82, 0.1, 0.26}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\setbeamercolor{uppercolblue}{fg=white,bg=ublue}
\setbeamercolor{lowercolblue}{fg=black,bg=blue!10}
......@@ -124,57 +125,49 @@
\section{基于层次短语的模型}
%%%------------------------------------------------------------------------------------------------------------
%%% 一个完整文法的例子
\begin{frame}{一个完整的文法}
%%% 文法驱动的统计机器翻译流程
\begin{frame}{文法驱动的机器翻译流程}
\begin{itemize}
\item 对于一个中文-英文句对,假设可以得到如下同步上下文无关文法\\
\vspace{0.3em}
\textbf{源语}\ \ \ 进口 大幅度 下降 了 \\
\vspace{0.3em}
\textbf{目标语}:The imports have drastically fallen \\
\vspace{1.0em}
\textbf{SCFG}\\
\vspace{-1.5em}
\begin{eqnarray}
r_1:\ \ \ \textrm{X} & \to & \langle\ \textrm{进口}\ \textrm{X}_1,\ \textrm{The imports}\ \textrm{X}_1\ \rangle \nonumber \\
r_2:\ \ \ \textrm{X}& \to & \langle\ \textrm{X}_1\ \textrm{下降}\ \textrm{X}_2,\ \textrm{X}_2\ \textrm{X}_1\ \textrm{fallen}\ \rangle \nonumber \\
r_3:\ \ \ \textrm{X} & \to & \langle\ \textrm{大幅度},\ \textrm{drastically}\ \rangle \nonumber \\
r_4:\ \ \ \textrm{X} & \to & \langle\ \textrm{},\ \textrm{have}\ \rangle \nonumber
\end{eqnarray}
其中,规则$r_1$$r_2$是右部含有变量的规则,这些变量可以被其它规则的右部替换;规则$r_2$是调序规则;规则$r_3$$r_4$是纯词汇化规则,表示单词或者短语的翻译
\item 同步翻译文法给我们带来了新的思路:可以通过不断使用文法规则完成翻译过程。这类模型的基本流程如下:
\end{itemize}
\begin{center}
\begin{tikzpicture}
\begin{scope}
\tikzstyle{datanode} = [minimum width=10em,minimum height=1.7em,fill=ublue,rounded corners=0.7em];
\tikzstyle{modelnode} = [minimum width=10em,minimum height=1.7em,fill=darkred,rounded corners=0.2em];
\tikzstyle{decodingnode} = [minimum width=10em,minimum height=1.7em,fill=ugreen,rounded corners=0.2em];
\node [datanode,anchor=north west] (bitext) at (0,0) {{\color{white} \scriptsize{训练用双语数据}}};
\node [modelnode, anchor=north west] (gi) at ([xshift=2em,yshift=-0.2em]bitext.south east) {{\color{white} \scriptsize{文法(规则)抽取}}};
\node [datanode,anchor=north east] (birules) at ([xshift=-2em,yshift=-0.2em]gi.south west) {{\color{white} \scriptsize{同步翻译文法}}};
\node [modelnode, anchor=north west] (training) at ([xshift=2em,yshift=-0.2em]birules.south east) {{\color{white} \scriptsize{特征值学习}}};
\node [datanode,anchor=north east] (model) at ([xshift=-2em,yshift=-0.2em]training.south west) {{\color{white} \scriptsize{翻译模型}}};
\node [decodingnode, anchor=north west] (tuning) at ([xshift=2em,yshift=-0.2em]model.south east) {{\color{white} \scriptsize{特征权重调优}}};
\node [datanode,anchor=north east] (tuningdata) at ([xshift=-2em,yshift=-0.2em]tuning.south west) {{\color{white} \scriptsize{调优用双语数据}}};
\node [decodingnode, anchor=north west] (decoding) at ([xshift=2em,yshift=-0.2em]tuningdata.south east) {{\color{white} \scriptsize{解码新句子}}};
\draw [->,very thick] ([yshift=-0.3em,xshift=0.1em]bitext.east) -- ([yshift=0.1em]gi.north west);
\draw [->,very thick] ([yshift=-0.1em]gi.south west) -- ([yshift=0.3em,xshift=0.1em]birules.east);
\draw [->,very thick] ([yshift=-0.3em,xshift=0.1em]birules.east) -- ([yshift=0.1em]training.north west);
\draw [->,very thick] ([yshift=-0.1em]training.south west) -- ([yshift=0.3em,xshift=0.1em]model.east);
\draw [->,very thick] ([yshift=-0.3em,xshift=0.1em]model.east) -- ([yshift=0.1em]tuning.north west);
\draw [->,very thick] ([yshift=-0.1em]tuning.south) -- ([yshift=0.1em]decoding.north);
\draw [->,very thick] ([yshift=0.3em,xshift=0.1em]tuningdata.east) -- ([yshift=-0.1em]tuning.south west);
\end{scope}
\end{tikzpicture}
\end{center}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 推导
\begin{frame}{翻译规则的推导}
\begin{itemize}
\item 使用SCFG规则的过程构成了一个\alert{推导},每次规则的使用都会同步替换源语言和目标语言串中的一个非终结符\\
\vspace{-2.0em}
\begin{eqnarray}
& & \langle\ \textrm{X}, \textrm{X}\ \rangle \nonumber \\
\visible<2->{& \xrightarrow[]{r_1} & \langle\ \alert{\textrm{进口}\ \textrm{X}_1},\ \alert{\textrm{The imports}\ \textrm{X}_1}\ \rangle \nonumber \\}
\visible<3->{& \xrightarrow[]{r_2} & \langle\ \textrm{进口}\ \alert{\textrm{X}_1\ \textrm{下降}\ \textrm{X}_2},\ \textrm{The imports}\ \alert{\textrm{X}_2\ \textrm{X}_1\ \textrm{fallen}}\ \rangle \nonumber \\}
\visible<4->{& \xrightarrow[]{r_3} & \langle\ \textrm{进口}\ \alert{\textrm{大幅度}}\ \textrm{下降}\ \textrm{X}_1, \nonumber \\}
\visible<4->{& & \ \textrm{The imports}\ \textrm{X}_1\ \alert{\textrm{drastically}}\ \textrm{fallen}\ \rangle \nonumber \\}
\visible<5->{& \xrightarrow[]{r_3} & \langle\ \textrm{进口}\ \textrm{大幅度}\ \textrm{下降}\ \alert{\textrm{}}, \nonumber \\}
\visible<5->{& & \ \textrm{The imports}\ \alert{\textrm{have}}\ \textrm{drastically}\ \textrm{fallen}\ \rangle \nonumber}
\end{eqnarray}
\visible<6->{
这里把$d$定义为由规则$r_1, r_2, r_3, r_4$构成的SCFG推导,记作
\begin{displaymath}
d = r_1 \circ r_2 \circ r_3 \circ r_4
\end{displaymath}
显然$d$定义了从源于句子生成目标语译文的一个过程
}
\end{itemize}
%%% 文法驱动的统计机器翻译流程
\begin{frame}{文法驱动的机器翻译流程}
% Manual第42页
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
\subsection{同步上下文无关文法}
......
......@@ -46,7 +46,8 @@
\setbeamercolor{uppercol}{fg=white,bg=ugreen}
\setbeamercolor{lowercol}{fg=black,bg=xtgreen}
%\definecolor{ublue}{rgb}{0,0.298,0.525}
\definecolor{darkred}{rgb}{0.55, 0.0, 0.0}
\definecolor{alizarin}{rgb}{0.82, 0.1, 0.26}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\setbeamercolor{uppercolblue}{fg=white,bg=ublue}
\setbeamercolor{lowercolblue}{fg=black,bg=blue!10}
......@@ -1686,11 +1687,11 @@ $d$是一个$(\textbf{s},\textbf{t})$上基于短语的翻译推导,$\textrm{P
\vspace{-2.0em}
\begin{eqnarray}
& & \langle\ \textrm{X}, \textrm{X}\ \rangle \nonumber \\
\visible<2->{& \xrightarrow[]{r_1} & \langle\ \alert{\textrm{进口}\ \textrm{X}_1},\ \alert{\textrm{The imports}\ \textrm{X}_1}\ \rangle \nonumber \\}
\visible<3->{& \xrightarrow[]{r_2} & \langle\ \textrm{进口}\ \alert{\textrm{X}_1\ \textrm{下降}\ \textrm{X}_2},\ \textrm{The imports}\ \alert{\textrm{X}_2\ \textrm{X}_1\ \textrm{fallen}}\ \rangle \nonumber \\}
\visible<4->{& \xrightarrow[]{r_3} & \langle\ \textrm{进口}\ \alert{\textrm{大幅度}}\ \textrm{下降}\ \textrm{X}_1, \nonumber \\}
\visible<4->{& & \ \textrm{The imports}\ \textrm{X}_1\ \alert{\textrm{drastically}}\ \textrm{fallen}\ \rangle \nonumber \\}
& & \langle\ \textrm{X}_1, \textrm{X}_1\ \rangle \nonumber \\
\visible<2->{& \xrightarrow[]{r_1} & \langle\ \alert{\textrm{进口}\ \textrm{X}_2},\ \alert{\textrm{The imports}\ \textrm{X}_2}\ \rangle \nonumber \\}
\visible<3->{& \xrightarrow[]{r_2} & \langle\ \textrm{进口}\ \alert{\textrm{X}_3\ \textrm{下降}\ \textrm{X}_4},\ \textrm{The imports}\ \alert{\textrm{X}_4\ \textrm{X}_3\ \textrm{fallen}}\ \rangle \nonumber \\}
\visible<4->{& \xrightarrow[]{r_3} & \langle\ \textrm{进口}\ \alert{\textrm{大幅度}}\ \textrm{下降}\ \textrm{X}_4, \nonumber \\}
\visible<4->{& & \ \textrm{The imports}\ \textrm{X}_4\ \alert{\textrm{drastically}}\ \textrm{fallen}\ \rangle \nonumber \\}
\visible<5->{& \xrightarrow[]{r_3} & \langle\ \textrm{进口}\ \textrm{大幅度}\ \textrm{下降}\ \alert{\textrm{}}, \nonumber \\}
\visible<5->{& & \ \textrm{The imports}\ \alert{\textrm{have}}\ \textrm{drastically}\ \textrm{fallen}\ \rangle \nonumber}
\end{eqnarray}
......@@ -1708,14 +1709,60 @@ d = r_1 \circ r_2 \circ r_3 \circ r_4
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% glue rule
%%% glue rules
\begin{frame}{胶水规则}
\begin{itemize}
\item 在实际系统中往往会遇到需要把两个局部翻译线性的拼接到一起的情况,因此可以在文法中引入胶水规则(glue rule)来处理,形式如下
\begin{eqnarray}
\textrm{S} & \to & \langle\ \textrm{S}_1\ \textrm{X}_2,\ \textrm{S}_1\ \textrm{X}_2\ \rangle \nonumber \\
\textrm{S} & \to & \langle\ \textrm{X}_1,\ \textrm{X}_1\ \rangle \nonumber
\end{eqnarray}
\item<2-> 本质上,胶水规则会顺序的拼接若干片段,最后整个句子会被归纳为$\textrm{S}$
\begin{eqnarray}
\textrm{S} & \to & \langle\ \textrm{S}_1\ \textrm{X}_2,\ \textrm{S}_1\ \textrm{X}_2\ \rangle \nonumber \\
& \to & \langle\ \textrm{S}_3\ \textrm{X}_4\ \textrm{X}_2,\ \textrm{S}_3\ \textrm{X}_4\ \textrm{X}_2\ \rangle \nonumber \\
& \to & ... \nonumber \\
& \to & \langle\ \textrm{X}_n\ ...\ \textrm{X}_4\ \textrm{X}_2,\ \textrm{X}_n\ ...\ \textrm{X}_4\ \textrm{X}_2\ \rangle \nonumber
\end{eqnarray}
\item<2-> 胶水规则大大提高了系统的健壮性(即使没有复杂规则,翻译可以顺序拼接),也体现了语言翻译单调性的假设
\end{itemize}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 基于句法的翻译系统流程
\begin{frame}{基于同步文法/句法的机器翻译流程}
% Manual第42页
%%% 文法驱动的统计机器翻译流程
\begin{frame}{文法驱动的机器翻译流程}
\begin{itemize}
\item 同步翻译文法给我们带来了新的思路:可以通过不断使用文法规则完成翻译过程。这类方法的基本流程如下:
\end{itemize}
\begin{center}
\begin{tikzpicture}
\begin{scope}
\tikzstyle{datanode} = [minimum width=10em,minimum height=1.7em,fill=ublue,rounded corners=0.7em];
\tikzstyle{modelnode} = [minimum width=10em,minimum height=1.7em,fill=darkred,rounded corners=0.2em];
\tikzstyle{decodingnode} = [minimum width=10em,minimum height=1.7em,fill=ugreen,rounded corners=0.2em];
\node [datanode,anchor=north west] (bitext) at (0,0) {{\color{white} \scriptsize{训练用双语数据}}};
\node [modelnode, anchor=north west] (gi) at ([xshift=2em,yshift=-0.2em]bitext.south east) {{\color{white} \scriptsize{文法(规则)抽取}}};
\node [datanode,anchor=north east] (birules) at ([xshift=-2em,yshift=-0.2em]gi.south west) {{\color{white} \scriptsize{同步翻译文法}}};
\node [modelnode, anchor=north west] (training) at ([xshift=2em,yshift=-0.2em]birules.south east) {{\color{white} \scriptsize{特征值学习}}};
\node [datanode,anchor=north east] (model) at ([xshift=-2em,yshift=-0.2em]training.south west) {{\color{white} \scriptsize{翻译模型}}};
\node [decodingnode, anchor=north west] (tuning) at ([xshift=2em,yshift=-0.2em]model.south east) {{\color{white} \scriptsize{特征权重调优}}};
\node [datanode,anchor=north east] (tuningdata) at ([xshift=-2em,yshift=-0.2em]tuning.south west) {{\color{white} \scriptsize{调优用双语数据}}};
\node [decodingnode, anchor=north west] (decoding) at ([xshift=2em,yshift=-0.2em]tuningdata.south east) {{\color{white} \scriptsize{解码新句子}}};
\draw [->,very thick] ([yshift=-0.3em,xshift=0.1em]bitext.east) -- ([yshift=0.1em]gi.north west);
\draw [->,very thick] ([yshift=-0.1em]gi.south west) -- ([yshift=0.3em,xshift=0.1em]birules.east);
\draw [->,very thick] ([yshift=-0.3em,xshift=0.1em]birules.east) -- ([yshift=0.1em]training.north west);
\draw [->,very thick] ([yshift=-0.1em]training.south west) -- ([yshift=0.3em,xshift=0.1em]model.east);
\draw [->,very thick] ([yshift=-0.3em,xshift=0.1em]model.east) -- ([yshift=0.1em]tuning.north west);
\draw [->,very thick] ([yshift=-0.1em]tuning.south) -- ([yshift=0.1em]decoding.north);
\draw [->,very thick] ([yshift=0.3em,xshift=0.1em]tuningdata.east) -- ([yshift=-0.1em]tuning.south west);
\end{scope}
\end{tikzpicture}
\end{center}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
......@@ -1728,6 +1775,12 @@ d = r_1 \circ r_2 \circ r_3 \circ r_4
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 关于文法的约束
\begin{frame}{文法的约束}
% 把文法限制在合理的范围内,使得系统可以处理
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 特征
\begin{frame}{特征}
% 还是David Chiang的论文
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论