Commit 56b1669c by 曹润柘

合并分支 'caorunzhe' 到 'master'

Caorunzhe

查看合并请求 !796
parents 5e44c9da cb40f83d
......@@ -7,12 +7,12 @@
\tikzstyle{more} = [inner sep=2pt,rounded corners=0pt,minimum width=2.5em,minimum height=1.5em,anchor=west]
\node[data,fill=blue!20] (one) at (0,0) {};
\node[data,fill=green!20] (two) at ([]one.east) {};
\node[data,fill=yellow!20] (three) at ([]two.east) {};
\node[data,fill=green!20] (two) at ([xshift=-0.2em]one.east) {};
\node[data,fill=yellow!20] (three) at ([xshift=-0.2em]two.east) {};
\node[data,fill=blue!20,minimum width=1em] (one_) at ([yshift=-6em]one.south west) {};
\node[data,fill=green!20,minimum width=4.5em] (two_) at ([yshift=0em]one_.east) {};
\node[data,fill=yellow!20,minimum width=2em] (three_) at ([yshift=0em]two_.east) {};
\node[data,fill=green!20,minimum width=4.5em] (two_) at ([xshift=-0.2em]one_.east) {};
\node[data,fill=yellow!20,minimum width=2em] (three_) at ([xshift=-0.2em]two_.east) {};
\node[model] (mo) at ([xshift=0.5em,yshift=-5em]two_.south){模型};
......@@ -43,11 +43,11 @@
\tikzstyle{more} = [inner sep=2pt,rounded corners=0pt,minimum width=2.5em,minimum height=1.5em,anchor=west]
\node[data,fill=blue!20] (one-2) at ([xshift=10.0em]one.east) {};
\node[data,fill=green!20] (two-2) at ([]one-2.east) {};
\node[data,fill=yellow!20] (three-2) at ([]two-2.east) {};
\node[data,fill=green!20] (two-2) at ([xshift=-0.2em]one-2.east) {};
\node[data,fill=yellow!20] (three-2) at ([xshift=-0.2em]two-2.east) {};
\node[data,fill=blue!20] (one_-2) at ([yshift=-6em]one-2.south west) {};
\node[data,fill=yellow!20] (three_-2) at ([yshift=0em]one_-2.east) {};
\node[data,fill=yellow!20] (three_-2) at ([xshift=-0.2em]one_-2.east) {};
\node[model] (mo-2) at ([xshift=1.7em,yshift=-5em]one_-2.south){模型};
......@@ -75,35 +75,48 @@
\tikzstyle{more} = [inner sep=2pt,rounded corners=0pt,minimum width=2.5em,minimum height=1.5em,anchor=west]
\node[data,fill=blue!20] (one-3) at ([xshift=10.0em]one-2.east) {};
\node[data,fill=green!20] (two-3) at ([]one-3.east) {};
\node[data,fill=yellow!20] (three-3) at ([]two-3.east) {};
\node[data,fill=green!20] (two-3) at ([xshift=-0.2em]one-3.east) {};
\node[data,fill=yellow!20] (three-3) at ([xshift=-0.2em]two-3.east) {};
\node[data,fill=blue!20] (one_-3) at ([yshift=-6em]one-3.south west) {};
\node[data,fill=green!20] (two_-3) at ([yshift=0em]one_-3.east) {};
\node[data,fill=yellow!20] (three_-3) at ([yshift=0em]two_-3.east) {};
\node[data,fill=black!10] (new_-3) at ([yshift=0em]three_-3.east) {};
\node[data,fill=green!20] (two_-3) at ([xshift=-0.2em]one_-3.east) {};
\node[data,fill=yellow!20] (three_-3) at ([xshift=-0.2em]two_-3.east) {};
\node[data,fill=black!10] (new_-3) at ([xshift=1.2em]three_-3.east) {};
\node[model] (mo-3) at ([xshift=1.7em,yshift=-5em]two_-3.south){模型};
\node[word] at ([xshift=-1.5em]one-3.west) {原始 \\ 数据};
\node[word] at ([xshift=-1.5em]one_-3.west) {伪数据};
\node[word,font=\tiny] at ([yshift=1em]one-3.north) {$(x_1,y_1)$};
\node[word,font=\tiny] at ([yshift=1em]two-3.north) {$(x_2,y_2)$};
\node[word,font=\tiny] at ([yshift=1em]three-3.north) {$(x_3,y_3)$};
\node[word,font=\scriptsize] (monolingual-3) at ([xshift=5em]three-3.south) {$x_4$};
\node[word,font=\scriptsize] (monolingual-3) at ([xshift=6em]three-3.south) {$\tilde{x}_4$};
\node[word,font=\tiny] at ([yshift=1em]one_-3.north) {$(x_1,y_1)$};
\node[word,font=\tiny] (w-3) at ([yshift=1em]one_-3.north) {$(x_1,y_1)$};
\node[word,font=\tiny] at ([yshift=1em]two_-3.north) {$(x_2,y_2)$};
\node[word,font=\tiny] at ([yshift=1em]three_-3.north) {$(x_3,y_3)$};
\node[word,font=\tiny] at ([yshift=1em]new_-3.north) {{\red $(x_4,y_4^*)$}};
\node[word,font=\tiny] (w4-3) at ([yshift=1em]new_-3.north) {{\red $(\tilde{x}_4,y_4^*)$}};
\draw [->,thick] ([yshift=-0.2em]one-3.south) .. controls +(south:2.5em) and +(north:2.5em) .. ([yshift=1.5em]one_-3.north);
\draw [->,thick] ([yshift=-0.2em]two-3.south) .. controls +(south:2.5em) and +(north:2.5em) .. ([yshift=1.5em]two_-3.north);
\draw [->,thick] ([yshift=-0.2em]three-3.south) .. controls +(south:2.5em) and +(north:2.5em) .. ([yshift=1.5em]three_-3.north);
\draw [->,thick] ([yshift=-0.2em]monolingual-3.south) .. controls +(south:2.5em) and +(north:2.5em) .. ([xshift=0.8em,yshift=1.6em]new_-3.north);
\draw [->,thick] ([yshift=-0.0em]monolingual-3.south) .. controls +(south:2.5em) and +(north:2.5em) .. ([xshift=0.8em,yshift=1.7em]new_-3.north) node[pos=0.5,left,align=center,font=\tiny]{解码};
\draw [->,thick] ([xshift=1.7em,yshift=-0.2em]two_-3.south) -- ([yshift=0.2em]mo-3.north) node[pos=0.5,left,align=center,font=\footnotesize]{训练};
\node[font=\small] at ([yshift=-4em]mo-3.south){(c)伪数据};
\begin{pgfonlayer}{background}
\node [rectangle,rounded corners=1pt,fill=orange!10] [fit = (w-3) (one_-3)(three_-3)] (box1) {};
\node [rectangle,rounded corners=1pt,fill=cyan!10] [fit = (w4-3) (new_-3)] (box2) {};
\end{pgfonlayer}
\node[word,draw=orange!50,dotted,very thick,inner sep=2.5pt] (realdata-3) at ([xshift=-4.5em,yshift=-2em]box1.south) {真实数据};
\node[word,draw=cyan!50,dotted,very thick,inner sep=2.5pt] (fake-3) at ([xshift=1em,yshift=-2em]box2.south) {伪数据};
\node[word,draw,dotted,very thick,inner sep=2.5pt] (monodata-3) at ([xshift=-0.5em,yshift=2em]monolingual-3.north) {单语数据};
\draw[->,dotted,very thick] ([yshift=0.0em]monolingual-3.north)-- ([yshift=-0.2em,xshift=0.45em]monodata-3.south);
\draw[->,dotted,very thick,cyan] (box2.south) -- ([xshift=-1em,yshift=0.2em]fake-3.north);
\draw[->,dotted,very thick,orange] ([xshift=-3.5em]box1.south) -- ([xshift=1em,yshift=0.2em]realdata-3.north);
\end{scope}
\end{tikzpicture}
......@@ -153,7 +153,7 @@ IBM模型由Peter F. Brown等人于上世纪九十年代初提出\upcite{DBLP:jo
% NEW SUBSUB-SECTION
%----------------------------------------------------------------------------------------
\subsubsection{3. 人工翻译 vs. 机器翻译}
\subsubsection{3. 人工翻译 vs 机器翻译}
\parinterval 人在翻译时的决策是非常确定并且快速的,但计算机处理这个问题时却充满了概率化的思想。当然它们也有类似的地方。首先,计算机使用统计模型的目的是把翻译知识变得可计算,并把这些“知识”储存在模型参数中,这个模型和人类大脑的作用是类似的\footnote{这里并不是要把统计模型等同于生物学或者认知科学上的人脑,这里是指它们处理翻译问题时发挥的作用类似。};其次,计算机对统计模型进行训练相当于人类对知识的学习,二者都可以被看作是理解、加工知识的过程;再有,计算机使用学习到的模型对新句子进行翻译的过程相当于人运用知识的过程。在统计机器翻译中,模型学习的过程被称为训练,目的是从双语平行数据中自动学习翻译“知识”;而使用模型处理新句子的过程是一个典型的预测过程,也被称为解码或推断。图\ref{fig:5-4}的右侧标注在翻译过程中训练和解码的作用。最终,统计机器翻译的核心由三部分构成\ \dash \ 建模、训练和解码。本章后续内容会围绕这三个问题展开讨论。
%----------------------------------------------------------------------------------------
......@@ -401,7 +401,7 @@ g(\seq{s},\seq{t}) &= &\prod_{(j,i)\in \widehat{A}}\funp{P}(s_j,t_i)
\label{eq:5-10}
\end{eqnarray}
\noindent 其中,$\seq{t}=t_1...t_l$表示由$l$个单词组成的句子,$\funp{P}_{\textrm{lm}}(\seq{t})$表示语言模型给句子$\seq{t}$的打分。具体而言,$\funp{P}_{\textrm{lm}}(\seq{t})$被定义为$\funp{P}(t_i|t_{i-1})(i=1,2,...,l)$的连乘\footnote{为了确保数学表达的准确性,本书中定义$\funp{P}(t_1|t_0) \equiv \funp{P}(t_1)$},其中$\funp{P}(t_i|t_{i-1})(i=1,2,...,l)$表示前面一个单词为$t_{i-1}$时,当前单词为$t_i$的概率。语言模型的训练方法可以参看{\chaptertwo}相关内容。
\noindent 其中,$\seq{t}=\{ t_1...t_l \}$表示由$l$个单词组成的句子,$\funp{P}_{\textrm{lm}}(\seq{t})$表示语言模型给句子$\seq{t}$的打分。具体而言,$\funp{P}_{\textrm{lm}}(\seq{t})$被定义为$\funp{P}(t_i|t_{i-1})(i=1,2,...,l)$的连乘\footnote{为了确保数学表达的准确性,本书中定义$\funp{P}(t_1|t_0) \equiv \funp{P}(t_1)$},其中$\funp{P}(t_i|t_{i-1})(i=1,2,...,l)$表示前面一个单词为$t_{i-1}$时,当前单词为$t_i$的概率。语言模型的训练方法可以参看{\chaptertwo}相关内容。
\parinterval 回到建模问题上来。既然语言模型可以帮助系统度量每个译文的流畅度,那么可以使用它对翻译进行打分。一种简单的方法是把语言模型$\funp{P}_{\textrm{lm}}{(\seq{t})}$ 和公式\eqref{eq:5-8}中的$g(\seq{s},\seq{t})$相乘,这样就得到了一个新的$g(\seq{s},\seq{t})$,它同时考虑了翻译准确性($\prod_{j,i \in \widehat{A}}{\funp{P}(s_j,t_i)}$)和流畅度($\funp{P}_{\textrm{lm}}(\seq{t})$):
\begin{eqnarray}
......@@ -605,7 +605,7 @@ g(\seq{s},\seq{t}) & \equiv & \prod_{j,i \in \widehat{A}}{\funp{P}(s_j,t_i)} \ti
\subsection{词对齐}
\parinterval IBM模型的一个基本的假设是词对齐假设。词对齐描述了源语言句子和目标语句子之间单词级别的对应。具体来说,给定源语句子$\seq{s}=s_1...s_m$和目标语译文$\seq{t}=t_1...t_l$,IBM模型假设词对齐具有如下两个性质。
\parinterval IBM模型的一个基本的假设是词对齐假设。词对齐描述了源语言句子和目标语句子之间单词级别的对应。具体来说,给定源语句子$\seq{s}=\{ s_1...s_m \}$和目标语译文$\seq{t}=\{ t_1...t_l \}$,IBM模型假设词对齐具有如下两个性质。
\begin{itemize}
\vspace{0.5em}
......@@ -634,7 +634,7 @@ g(\seq{s},\seq{t}) & \equiv & \prod_{j,i \in \widehat{A}}{\funp{P}(s_j,t_i)} \ti
%----------------------------------------------
\end{itemize}
\parinterval 通常,把词对齐记为$\seq{a}$,它由$a_1$$a_m$$m$个词对齐连接组成,即$\seq{a}=a_1...a_m$$a_j$表示第$j$个源语单词$s_j$对应的目标语单词的位置。在图\ref{fig:5-16}的例子中,词对齐关系可以记为$a_1=0, a_2=3, a_3=1$,即第1个源语单词“在”对应到目标语译文的第0个位置,第2个源语单词“桌子”对应到目标语译文的第3个位置,第3个源语单词“上”对应到目标语译文的第1个位置。
\parinterval 通常,把词对齐记为$\seq{a}$,它由$a_1$$a_m$$m$个词对齐连接组成,即$\seq{a}=\{ a_1...a_m \}$$a_j$表示第$j$个源语单词$s_j$对应的目标语单词的位置。在图\ref{fig:5-16}的例子中,词对齐关系可以记为$a_1=0, a_2=3, a_3=1$,即第1个源语单词“在”对应到目标语译文的第0个位置,第2个源语单词“桌子”对应到目标语译文的第3个位置,第3个源语单词“上”对应到目标语译文的第1个位置。
%----------------------------------------------------------------------------------------
% NEW SUB-SECTION
......@@ -668,7 +668,7 @@ g(\seq{s},\seq{t}) & \equiv & \prod_{j,i \in \widehat{A}}{\funp{P}(s_j,t_i)} \ti
\label{eq:5-19}
\end{eqnarray}
\noindent 其中$s_j$$a_j$分别表示第$j$个源语言单词及第$j$个源语言单词对齐到的目标位置,\seq{s}${{}_1^{j-1}}$表示前$j-1$个源语言单词(即\seq{s}${}_1^{j-1}=s_1...s_{j-1}$),\seq{a}${}_1^{j-1}$表示前$j-1$个源语言的词对齐(即\seq{a}${}_1^{j-1}=a_1...a_{j-1}$),$m$表示源语句子的长度。公式\eqref{eq:5-19}$\funp{P}(\seq{s},\seq{a}|\seq{t})$分解为四个部分,具体含义如下:
\noindent 其中$s_j$$a_j$分别表示第$j$个源语言单词及第$j$个源语言单词对齐到的目标位置,\seq{s}${{}_1^{j-1}}$表示前$j-1$个源语言单词(即\seq{s}${}_1^{j-1}=\{ s_1...s_{j-1} \}$),\seq{a}${}_1^{j-1}$表示前$j-1$个源语言的词对齐(即\seq{a}${}_1^{j-1}=\{ a_1...a_{j-1} \}$),$m$表示源语句子的长度。公式\eqref{eq:5-19}$\funp{P}(\seq{s},\seq{a}|\seq{t})$分解为四个部分,具体含义如下:
\begin{itemize}
\vspace{0.5em}
......
......@@ -219,7 +219,7 @@
\parinterval 不过$<\seq{s},\seq{a}>$中有多少组$<\tau,\pi>$呢?通过图\ref{fig:6-5}中的例子,可以推出$<\seq{s},\seq{a}>$应该包含$\prod_{i=0}^{l}{\varphi_i !}$个不同的二元组$<\tau,\pi>$。 这是因为在给定源语言句子和词对齐时,对于每一个$\tau_i$都有$\varphi_{i}!$种排列。
\parinterval 进一步,$\funp{P}(\tau,\pi|\seq{t})$可以被表示如图\ref{fig:6-7}的形式。其中$\tau_{i1}^{k-1}$表示$\tau_{i1}\tau_{i2}\cdots \tau_{i(k-1)}$$\pi_{i1}^{ k-1}$表示$\pi_{i1}\pi_{i2}\cdots \pi_{i(k-1)}$。可以把图\ref{fig:6-7}中的公式分为5个部分,并用不同的序号和颜色进行标注。每部分的具体含义是:
\parinterval 进一步,$\funp{P}(\tau,\pi|\seq{t})$可以被表示如图\ref{fig:6-7}的形式。其中$\tau_{i1}^{k-1}$表示$\tau_{i1}\cdots \tau_{i(k-1)}$$\pi_{i1}^{ k-1}$表示$\pi_{i1}\cdots \pi_{i(k-1)}$。可以把图\ref{fig:6-7}中的公式分为5个部分,并用不同的序号和颜色进行标注。每部分的具体含义是:
%----------------------------------------------
\begin{figure}[htp]
......@@ -281,13 +281,13 @@
\label{eq:6-15}
\end{eqnarray}
}
\parinterval 而上面提到的$t_0$所对应的这些空位置是如何生成的呢?即如何确定哪些位置是要放置空对齐的源语言单词。在IBM模型3中,假设在所有的非空对齐源语言单词都被生成出来后(共$\varphi_1+\varphi_2+\cdots {\varphi}_l$个非空对源语单词),这些单词后面都以$p_1$概率随机地产生一个“槽”用来放置空对齐单词。这样,${\varphi}_0$就服从了一个二项分布。于是得到
\parinterval 而上面提到的$t_0$所对应的这些空位置是如何生成的呢?即如何确定哪些位置是要放置空对齐的源语言单词。在IBM模型3中,假设在所有的非空对齐源语言单词都被生成出来后(共$\varphi_1+\cdots {\varphi}_l$个非空对源语单词),这些单词后面都以$p_1$概率随机地产生一个“槽”用来放置空对齐单词。这样,${\varphi}_0$就服从了一个二项分布。于是得到
{
\begin{eqnarray}
\funp{P}(\varphi_0|\seq{t}) & = & \big(\begin{array}{c}
\varphi_1+\varphi_2+\cdots \varphi_l\\
\varphi_1+\cdots \varphi_l\\
\varphi_0\\
\end{array}\big)p_0^{\varphi_1+\varphi_2+\cdots \varphi_l-\varphi_0}p_1^{\varphi_0}
\end{array}\big)p_0^{\varphi_1+\cdots \varphi_l-\varphi_0}p_1^{\varphi_0}
\label{eq:6-16}
\end{eqnarray}
}
......
......@@ -142,7 +142,7 @@
\begin{definition} 短语
{\small
对于一个句子$\seq{w} = w_1...w_n$,任意子串$w_i...w_j$($i\leq j$$0\leq i,j\leq n$)都是句子$\seq{w}$的一个{\small\bfnew{短语}}
对于一个句子$\seq{w} = \{ w_1...w_n \} $,任意子串$\{ w_i...w_j\}$($i\leq j$$0\leq i,j\leq n$)都是句子$\seq{w}$的一个{\small\bfnew{短语}}
}
\end{definition}
%-------------------------------------------
......@@ -154,7 +154,7 @@
\begin{definition} 句子的短语切分
{\small
如果一个句子$\seq{w} = w_1...w_n$可以被切分为$m$个子串,则称$\seq{w}$$m$个短语组成,记为$\seq{w} = p_1...p_m$,其中$p_i$$\seq{w}$的一个短语,$\{p_1,...,p_m\}$也被称作句子$\seq{w}$的一个{\small\bfnew{短语切分}}
如果一个句子$\seq{w} = \{ w_1...w_n\}$可以被切分为$m$个子串,则称$\seq{w}$$m$个短语组成,记为$\seq{w} =\{ p_1...p_m \} $,其中$p_i$$\seq{w}$的一个短语,$\{p_1,...,p_m\}$也被称作句子$\seq{w}$的一个{\small\bfnew{短语切分}}
}
\end{definition}
%-------------------------------------------
......
......@@ -340,11 +340,11 @@ d & = & {r_1} \circ {r_2} \circ {r_3} \circ {r_4}
\item 对于$(x,y)\in \varPhi$,存在$m$个双语短语$(x_i,y_j)\in \varPhi$,同时存在(1,$...$,$m$)上面的一个排序$\sim = \{\pi_1 , ... ,\pi_m\}$,且:
\vspace{-1.5em}
\begin{eqnarray}
x&=&\alpha_0 x_1 \alpha_1 x_2 ... \alpha_{m-1} x_m \alpha_m \label{eq:8-2}\\
y&=&\beta_0 y_{\pi_1} \beta_1 y_{\pi_2} ... \beta_{m-1} y_{\pi_m} \beta_m
x&=&\alpha_0 x_1 ... \alpha_{m-1} x_m \alpha_m \label{eq:8-2}\\
y&=&\beta_0 y_{\pi_1} ... \beta_{m-1} y_{\pi_m} \beta_m
\label{eq:8-3}
\end{eqnarray}
其中,${\alpha_0, ... ,\alpha_m}$${\beta_0, ... ,\beta_m}$表示源语言和目标语言的若干个词串(包含空串)。则$\funp{X} \to \langle x,y,\sim \rangle$是与词对齐相兼容的层次短语规则。这条规则包含$m$个变量,变量的对齐信息是$\sim$
其中,$\{\alpha_0, ... ,\alpha_m \}$$\{\beta_0, ... ,\beta_m \}$表示源语言和目标语言的若干个词串(包含空串)。则$\funp{X} \to \langle x,y,\sim \rangle$是与词对齐相兼容的层次短语规则。这条规则包含$m$个变量,变量的对齐信息是$\sim$
\end{enumerate}
}
\end{definition}
......
......@@ -36,7 +36,7 @@
\parinterval 自从计算机诞生开始,机器翻译即利用计算机软件技术实现不同语言自动翻译,就是人们首先想到的计算机主要应用之一。很多人说现在处于人工智能时代,是得语言者的天下,因此机器翻译也是认知智能的终极梦想之一。本书已经讨论了机器翻译的模型、方法和实现技术,这里将分享一些我们对机器翻译应用和未来的一些思考,有些想法不一定正确,也许需要十年之后才能验证。
\parinterval 简单来说,机器翻译技术应用至少可以满足三个用户需求。一是实现外文资料辅助阅读和帮助不同母语的人们进行无障碍交流;二是计算机辅助翻译,帮助人工翻译降本增效;三是大数据分析和处理应用领域实现对多语言文字资料(也可以是图像和语音资料)进行加工处理,海量数据翻译对于人工翻译来说是无法完成的,机器翻译是大数据翻译的唯一有效解决方案。从上述三个需求可以看出,机器翻译和人工翻译本质上不存在严格冲突,属于两个平行轨道,两者可以和谐共存、相互帮助。对于机器翻译来说,至少有两个应用场景是其无法胜任的。第一个是要求高质量翻译结果,比如诗歌小说翻译出版;第二个是比如重要领导人讲话,轻易不允许出现低级翻译错误,否则有可能导致严重后果甚至国际纠纷。严格上来说,对译文准确性要求很高的应用 场景不可能简单采用机器翻译,必须由高水平的人工翻译参与来完成。
\parinterval 简单来说,机器翻译技术应用至少可以满足三个用户需求。一是实现外文资料辅助阅读和帮助不同母语的人们进行无障碍交流;二是计算机辅助翻译,帮助人工翻译降本增效;三是通过大数据分析和处理,实现对多语言文字资料(也可以是图像资料或语音资料)的加工处理,海量数据翻译对于人工翻译来说是无法完成的,机器翻译是大数据翻译的唯一有效解决方案。从上述三个需求可以看出,机器翻译和人工翻译本质上不存在严格冲突,属于两个平行轨道,两者可以和谐共存、相互帮助。对于机器翻译来说,至少有两个应用场景是其无法胜任的。第一个是要求高质量翻译结果,比如诗歌小说翻译出版;第二个是比如重要领导人讲话,轻易不允许出现低级翻译错误,否则有可能导致严重后果甚至国际纠纷。严格上来说,对译文准确性要求很高的应用 场景不可能简单采用机器翻译,必须由高水平的人工翻译参与来完成。
\parinterval 如何构建一套好的机器翻译系统呢?假设我们需要给用户提供一套翻译品质不错的机器翻译系统,至少需要考虑三个方面:足够大规模的双语句对集合用于训练、强大的机器翻译技术和错误驱动的打磨过程。从技术应用和产业化角度来看,简单靠提出一个新的机器翻译技术,对于构建一套好的机器翻译系统来说,只能说必要条件,不是充要条件,上述三者缺一不可。
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论