Commit dc9540cc by 曹润柘

合并分支 'caorunzhe' 到 'master'

Caorunzhe

查看合并请求 !923
parents 131278fa 46beaa17
%%%------------------------------------------------------------------------------------------------------------
%%% 调序模型1:基于距离的调序
\begin{center}
\begin{tikzpicture}
\tikzstyle{tnode}=[rectangle,inner sep=0mm,minimum height=1.8em,minimum width=4em,rounded corners=5pt,thick,draw,fill=teal!20]
\tikzstyle{stnode}=[rectangle,inner sep=0mm,minimum height=1.8em,minimum width=4em,rounded corners=5pt,thick,fill=red!20,draw]
\tikzstyle{rnnnode}=[rectangle,inner sep=0mm,minimum height=2em,minimum width=6.5em,rounded corners=5pt,thick,fill=green!20,draw]
\tikzstyle{wnode}=[inner sep=0mm,minimum height=2em,minimum width=5em]
\begin{scope}[]
\node [anchor=west,rnnnode] (r1) at (0, 0) {循环单元$\mathbi{h}_1$};
\node [anchor=south,rnnnode] (r2) at ([xshift=0em,yshift=1em]r1.north){循环单元$\mathbi{h}_2$};
\node [anchor=south] (r3) at ([xshift=0em,yshift=1em]r2.north){$\cdots$};
\node [anchor=south,rnnnode] (r4) at ([xshift=0em,yshift=1em]r3.north){循环单元$\mathbi{h}_n$};
\node [anchor=east,wnode,font=\footnotesize] (wr1) at ([xshift=-1em,yshift=0em]r1.west) {1时刻输入};
\node [anchor=east,wnode,font=\footnotesize] (wr2) at ([xshift=-1em,yshift=0em]r2.west) {2时刻输入};
\node [anchor=east,wnode,font=\footnotesize] (wr3) at ([xshift=-1em,yshift=0em]r4.west) {$n$时刻输入};
\node [anchor=north,wnode] (input) at ([xshift=0em,yshift=-1em]r1.south) {$\mathbi{h}_0$};
\node [anchor=south,wnode] (output) at ([xshift=0em,yshift=1em]r4.north) {输出};
\draw[->,very thick] ([xshift=-0.3em,yshift=-1em]wr1.west)--([xshift=-0.3em,yshift=1em]wr3.west);
\draw[->,thick] ([xshift=0em,yshift=0em]input.north)--([xshift=0em,yshift=0em]r1.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r1.north)--([xshift=0em,yshift=0em]r2.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r2.north)--([xshift=0em,yshift=0em]r3.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r3.north)--([xshift=0em,yshift=0em]r4.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r4.north)--([xshift=0em,yshift=0em]output.south);
\draw[->,thick] ([xshift=0em,yshift=0em]wr1.east)--([xshift=0em,yshift=0em]r1.west);
\draw[->,thick] ([xshift=0em,yshift=0em]wr2.east)--([xshift=0em,yshift=0em]r2.west);
\draw[->,thick] ([xshift=0em,yshift=0em]wr3.east)--([xshift=0em,yshift=0em]r4.west);
\node [anchor=north,font=\small] (label) at ([xshift=-4em,yshift=-0.5em]input.south) {(a)RNN};
\end{scope}
\begin{scope}[xshift=1.9in]
\node [anchor=west,stnode] (r1) at (0, 0) {第1层};
\node [anchor=south,tnode] (r2) at ([xshift=0em,yshift=1em]r1.north){第2层};
\node [anchor=south] (r3) at ([xshift=0em,yshift=1em]r2.north){$\cdots$};
\node [anchor=south,tnode] (r4) at ([xshift=0em,yshift=1em]r3.north){$n$};
\node [anchor=east,wnode,font=\footnotesize,minimum width=3em] (wr1) at ([xshift=-0.3em,yshift=0em]r1.west) {1时刻};
\node [anchor=east,wnode,font=\footnotesize,minimum width=3em] (wr2) at ([xshift=-0.3em,yshift=0em]r2.west) {2时刻};
\node [anchor=east,wnode,font=\footnotesize,minimum width=3em] (wr3) at ([xshift=-0.3em,yshift=0em]r4.west) {$n$时刻};
\node [anchor=north,wnode] (input) at ([xshift=0em,yshift=-1em]r1.south) {$\mathbi{h}_0$};
\node [anchor=south,wnode] (output) at ([xshift=0em,yshift=1em]r4.north) {输出};
\draw[->,very thick] ([xshift=-0.3em,yshift=-1em]wr1.west)--([xshift=-0.3em,yshift=1em]wr3.west);
\draw[->,thick] ([xshift=0em,yshift=0em]input.north)--([xshift=0em,yshift=0em]r1.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r1.north)--([xshift=0em,yshift=0em]r2.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r2.north)--([xshift=0em,yshift=0em]r3.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r3.north)--([xshift=0em,yshift=0em]r4.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r4.north)--([xshift=0em,yshift=0em]output.south);
\node [anchor=north,font=\small] (label) at ([xshift=-2em,yshift=-0.5em]input.south) {(b)原始Transformer模型};
\end{scope}
\begin{scope}[xshift=3.7in]
\node [anchor=west,stnode] (r1) at (0, 0) {第1层};
\node [anchor=south,stnode] (r2) at ([xshift=0em,yshift=1em]r1.north){第2层};
\node [anchor=south] (r3) at ([xshift=0em,yshift=1em]r2.north){$\cdots$};
\node [anchor=south,stnode] (r4) at ([xshift=0em,yshift=1em]r3.north){$n$};
\node [anchor=east,wnode,font=\footnotesize,align=left,minimum width=4em] (wr1) at ([xshift=-1em,yshift=0em]r1.west) {1时刻编\\ 码向量};
\node [anchor=east,wnode,font=\footnotesize,align=left,minimum width=4em] (wr2) at ([xshift=-1em,yshift=0em]r2.west) {2时刻编\\ 码向量};
\node [anchor=east,wnode,font=\footnotesize,align=left,minimum width=4em] (wr3) at ([xshift=-1em,yshift=0em]r4.west) {$n$时刻编\\ 码向量};
\node [anchor=north,wnode] (input) at ([xshift=0em,yshift=-1em]r1.south) {$\mathbi{h}_0$};
\node [anchor=south,wnode] (output) at ([xshift=0em,yshift=1em]r4.north) {输出};
\draw[->,very thick] ([xshift=-0.3em,yshift=-1em]wr1.west)--([xshift=-0.3em,yshift=1em]wr3.west);
\draw[->,thick] ([xshift=0em,yshift=0em]input.north)--([xshift=0em,yshift=0em]r1.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r1.north)--([xshift=0em,yshift=0em]r2.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r2.north)--([xshift=0em,yshift=0em]r3.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r3.north)--([xshift=0em,yshift=0em]r4.south);
\draw[->,thick] ([xshift=0em,yshift=0em]r4.north)--([xshift=0em,yshift=0em]output.south);
\draw[->,thick] ([xshift=0em,yshift=0em]wr1.east)--([xshift=0em,yshift=0em]r1.west);
\draw[->,thick] ([xshift=0em,yshift=0em]wr2.east)--([xshift=0em,yshift=0em]r2.west);
\draw[->,thick] ([xshift=0em,yshift=0em]wr3.east)--([xshift=0em,yshift=0em]r4.west);
\node [anchor=north,font=\small,align=left] (label) at ([xshift=-2em,yshift=0.2em]input.south) {(c)共享权重的\\ Transformer模型};
\end{scope}
\end{tikzpicture}
\end{center}
\ No newline at end of file
\begin{tikzpicture}
\tikzstyle{Sanode} = [minimum height=1.1em,minimum width=7em,inner sep=3pt,rounded corners=1.5pt,draw];
\tikzstyle{Resnode} = [minimum height=1.1em,minimum width=7em,inner sep=3pt,rounded corners=1.5pt,draw];
\tikzstyle{ffnnode} = [minimum height=1.1em,minimum width=7em,inner sep=3pt,rounded corners=1.5pt,draw];
\tikzstyle{outputnode} = [minimum height=1.4em,minimum width=7em,inner sep=3pt,rounded corners=1.5pt,draw];
\tikzstyle{inputnode} = [minimum height=1.4em,minimum width=3.5em,inner sep=3pt,rounded corners=1.5pt,draw,fill=red!20];
\tikzstyle{posnode} = [minimum height=1.4em,minimum width=3.5em,inner sep=3pt,rounded corners=1.5pt,draw,fill=black!10!white];
\tikzstyle{standard} = [rounded corners=3pt];
\begin{scope}
\node [Sanode,anchor=west] (sa1) at (0,0) {\tiny{$\textbf{Self-Attention}$}};
\node [Resnode,anchor=south] (res1) at ([yshift=0.3em]sa1.north) {\tiny{$\textbf{Add \& LayerNorm}$}};
\node [ffnnode,anchor=south] (ffn1) at ([yshift=0.5em]res1.north) {\tiny{$\textbf{Feed Forward Network}$}};
\node [Resnode,anchor=south] (res2) at ([yshift=0.3em]ffn1.north) {\tiny{$\textbf{Add \& LayerNorm}$}};
\node [anchor=south,minimum height=1.4em,minimum width=7em] (dot1) at ([yshift=1.5em]res2.north) {\tiny{$\cdots$}};
\node [Sanode,anchor=south] (sa2) at ([yshift=1.5em]dot1.north) {\tiny{$\textbf{Self-Attention}$}};
\node [Resnode,anchor=south] (res3) at ([yshift=0.3em]sa2.north) {\tiny{$\textbf{Add \& LayerNorm}$}};
\node [ffnnode,anchor=south] (ffn2) at ([yshift=0.5em]res3.north) {\tiny{$\textbf{Feed Forward Network}$}};
\node [Resnode,anchor=south] (res4) at ([yshift=0.3em]ffn2.north) {\tiny{$\textbf{Add \& LayerNorm}$}};
\node [anchor=north west,font=\scriptsize,align=center] (l1) at ([xshift=0.1em]ffn1.north east) {\\\\};
\node [anchor=north west,font=\scriptsize,align=center] (l2) at ([xshift=0.1em]ffn2.north east) {\\ $n$ \\};
\node [anchor=south east,font=\scriptsize] (l3) at ([yshift=3em]l1.north east) {};
\node [anchor=north east,font=\scriptsize,align=center,opacity=0.0] (l4) at ([xshift=0.1em]ffn1.north west) {\\\\};
\node [anchor=north east,font=\scriptsize,align=center,opacity=0.0] (l5) at ([xshift=0.1em]ffn2.north west) {\\ $n$ \\};
\node [anchor=south west,font=\scriptsize] (l6) at ([yshift=3em]l4.north west) {};
\node [anchor=south west] (e1) at ([xshift=-1.4em,yshift=0.3em]res4.north west) {{编码器}};
\begin{pgfonlayer}{background}
\node [rectangle,inner sep=0.6em,rounded corners=5pt,very thick,dotted,minimum height=1.4em,minimum width=3.5em,draw=red!40] [fit = (e1) (sa1) (l1) (l4)] (b4) {};
\node [rectangle,inner sep=0.3em,rounded corners=5pt,very thick,dotted,draw=green!40,minimum height=1.4em,minimum width=7em] [fit = (l1) (sa1) (res2) (l4)] (b1) {};
\node [rectangle,inner sep=0.3em,rounded corners=5pt,very thick,dotted,draw=green!40,minimum height=1.4em,minimum width=7em] [fit = (dot1) (l3) (l6)] (b2) {};
\node [rectangle,inner sep=0.3em,rounded corners=5pt,very thick,dotted,draw=green!40,minimum height=1.4em,minimum width=7em] [fit = (l2) (sa2) (res4) (l5)] (b3) {};
\end{pgfonlayer}
\node [inputnode,anchor=north west] (input1) at ([yshift=-1.1em,xshift=-0.5em]sa1.south west) {\tiny{$\textbf{Embedding}$}};
\node [] (add) at ([yshift=-1.7em,xshift=3.5em]sa1.south west) {$+$};
\node [posnode,anchor=north east] (pos1) at ([yshift=-1.1em,xshift=1.6em]sa1.south east) {\tiny{$\textbf{Absolute Position}$}};
\node [anchor=north] (wi) at ([yshift=-0.5em]pos1.south) {\scriptsize{词序信息}};
\draw [->] (wi.north) -- (pos1.south);
\draw [->] (add.north) -- (sa1.south);
\draw [->] (sa1.north) -- (res1.south);
\draw [->] (res1.north) -- (ffn1.south);
\draw [->] (ffn1.north) -- (res2.south);
\draw [->] (res2.north) -- ([yshift=-0.4em]dot1.south);
\draw [->] ([yshift=0.3em]dot1.north) -- (sa2.south);
\draw [->] (sa2.north) -- (res3.south);
\draw [->] (res3.north) -- (ffn2.south);
\draw [->] (ffn2.north) -- (res4.south);
\draw [->] (res4.north) -- ([yshift=1em]res4.north);
\draw[->,standard] ([yshift=-0.3em]sa1.south) -- ([xshift=-4em,yshift=-0.3em]sa1.south) -- ([xshift=-4em,yshift=2em]sa1.south) -- ([xshift=-3.5em,yshift=2em]sa1.south);
\draw[->,standard] ([yshift=0.2em]res1.north) -- ([xshift=-4em,yshift=0.2em]res1.north) -- ([xshift=-4em,yshift=2.5em]res1.north) -- ([xshift=-3.5em,yshift=2.5em]res1.north);
\draw[->,standard] ([yshift=-0.3em]sa2.south) -- ([xshift=-4em,yshift=-0.3em]sa2.south) -- ([xshift=-4em,yshift=2em]sa2.south) -- ([xshift=-3.5em,yshift=2em]sa2.south);
\draw[->,standard] ([yshift=0.2em]res3.north) -- ([xshift=-4em,yshift=0.2em]res3.north) -- ([xshift=-4em,yshift=2.5em]res3.north) -- ([xshift=-3.5em,yshift=2.5em]res3.north);
\begin{pgfonlayer}{background}
\node [rectangle,inner sep=0.2em,rounded corners=1pt,very thick,dotted,fill=red!40] [fit = (input1) (pos1)] (box1) {};
\end{pgfonlayer}
\node [anchor=north,font=\small] (label) at ([yshift=-3em]add.south) {{(a)绝对位置编码}};
\end{scope}
\begin{scope}[xshift=2in]
\node [Sanode,anchor=west] (sa1) at (0,0) {\tiny{$\textbf{Self-Attention}$}};
\node [Resnode,anchor=south] (res1) at ([yshift=0.3em]sa1.north) {\tiny{$\textbf{Add \& LayerNorm}$}};
\node [ffnnode,anchor=south] (ffn1) at ([yshift=0.5em]res1.north) {\tiny{$\textbf{Feed Forward Network}$}};
\node [Resnode,anchor=south] (res2) at ([yshift=0.3em]ffn1.north) {\tiny{$\textbf{Add \& LayerNorm}$}};
\node [anchor=south,minimum height=1.4em,minimum width=7em] (dot1) at ([yshift=1.5em]res2.north) {\tiny{$\cdots$}};
\node [Sanode,anchor=south] (sa2) at ([yshift=1.5em]dot1.north) {\tiny{$\textbf{Self-Attention}$}};
\node [Resnode,anchor=south] (res3) at ([yshift=0.3em]sa2.north) {\tiny{$\textbf{Add \& LayerNorm}$}};
\node [ffnnode,anchor=south] (ffn2) at ([yshift=0.5em]res3.north) {\tiny{$\textbf{Feed Forward Network}$}};
\node [Resnode,anchor=south] (res4) at ([yshift=0.3em]ffn2.north) {\tiny{$\textbf{Add \& LayerNorm}$}};
\node [anchor=north west,font=\scriptsize,align=center] (l1) at ([xshift=0.1em]ffn1.north east) {\\\\};
\node [anchor=north west,font=\scriptsize,align=center] (l2) at ([xshift=0.1em]ffn2.north east) {\\ $n$ \\};
\node [anchor=south east,font=\scriptsize] (l3) at ([yshift=3em]l1.north east) {};
\node [anchor=north east,font=\scriptsize,align=center,opacity=0.0] (l4) at ([xshift=0.1em]ffn1.north west) {\\\\};
\node [anchor=north east,font=\scriptsize,align=center,opacity=0.0] (l5) at ([xshift=0.1em]ffn2.north west) {\\ $n$ \\};
\node [anchor=south west,font=\scriptsize] (l6) at ([yshift=3em]l4.north west) {};
\node [anchor=south west] (e1) at ([xshift=-1.4em,yshift=0.3em]res4.north west) {{编码器}};
\begin{pgfonlayer}{background}
\node [rectangle,inner sep=0.6em,rounded corners=5pt,very thick,dotted,minimum height=1.4em,minimum width=3.5em,draw=red!40] [fit = (e1) (sa1) (l1) (l4)] (b4) {};
\node [rectangle,inner sep=0.3em,rounded corners=5pt,very thick,dotted,draw=green!40,minimum height=1.4em,minimum width=7em] [fit = (l1) (sa1) (res2) (l4)] (b1) {};
\node [rectangle,inner sep=0.3em,rounded corners=5pt,very thick,dotted,draw=green!40,minimum height=1.4em,minimum width=7em] [fit = (dot1) (l3) (l6)] (b2) {};
\node [rectangle,inner sep=0.3em,rounded corners=5pt,very thick,dotted,draw=green!40,minimum height=1.4em,minimum width=7em] [fit = (l2) (sa2) (res4) (l5)] (b3) {};
\end{pgfonlayer}
\node [inputnode,anchor=north west] (input1) at ([yshift=-1.1em,xshift=-0.5em]sa1.south west) {\tiny{Embedding}};
\node [] (add) at ([yshift=-1.7em,xshift=3.5em]sa1.south west) {$+$};
\node [posnode,anchor=north east] (pos1) at ([yshift=-1.1em,xshift=1.5em]sa1.south east) {\tiny{Absolute Position}};
\node [anchor=north] (wi) at ([yshift=-0.5em]pos1.south) {\scriptsize{词序信息}};
\node [posnode,anchor=west,font=\tiny,align=center] (pos2) at ([yshift=0em,xshift=1em]pos1.east) {Relative \\ Position 1};
\node [posnode,anchor=west,font=\tiny,align=center,minimum width=1em] (pos3) at ([yshift=0em,xshift=1em]pos2.east) {$\cdots$};
\node [posnode,anchor=west,font=\tiny,align=center] (pos4) at ([yshift=0em,xshift=1em]pos3.east) {Relative \\ Position $n$};
\draw [->] (wi.north) -- (pos1.south);
\draw [->] (add.north) -- (sa1.south);
\draw [->] (sa1.north) -- (res1.south);
\draw [->] (res1.north) -- (ffn1.south);
\draw [->] (ffn1.north) -- (res2.south);
\draw [->] (res2.north) -- ([yshift=-0.4em]dot1.south);
\draw [->] ([yshift=0.3em]dot1.north) -- (sa2.south);
\draw [->] (sa2.north) -- (res3.south);
\draw [->] (res3.north) -- (ffn2.south);
\draw [->] (ffn2.north) -- (res4.south);
\draw [->] (res4.north) -- ([yshift=1em]res4.north);
\draw[->,standard] ([yshift=-0.3em]sa1.south) -- ([xshift=-4em,yshift=-0.3em]sa1.south) -- ([xshift=-4em,yshift=2em]sa1.south) -- ([xshift=-3.5em,yshift=2em]sa1.south);
\draw[->,standard] ([yshift=0.2em]res1.north) -- ([xshift=-4em,yshift=0.2em]res1.north) -- ([xshift=-4em,yshift=2.5em]res1.north) -- ([xshift=-3.5em,yshift=2.5em]res1.north);
\draw[->,standard] ([yshift=-0.3em]sa2.south) -- ([xshift=-4em,yshift=-0.3em]sa2.south) -- ([xshift=-4em,yshift=2em]sa2.south) -- ([xshift=-3.5em,yshift=2em]sa2.south);
\draw[->,standard] ([yshift=0.2em]res3.north) -- ([xshift=-4em,yshift=0.2em]res3.north) -- ([xshift=-4em,yshift=2.5em]res3.north) -- ([xshift=-3.5em,yshift=2.5em]res3.north);
\draw[->,standard] ([xshift=0em]wi.east) -- ([xshift=3.2em,yshift=0em]wi.east) -- ([xshift=-0em,yshift=0em]pos2.south);
\draw[->,standard] ([xshift=0em]wi.east) -- ([xshift=6.7em,yshift=0em]wi.east) -- ([xshift=-0em,yshift=0em]pos3.south);
\draw[->,standard] ([xshift=0em]wi.east) -- ([xshift=10.2em,yshift=0em]wi.east) -- ([xshift=-0em,yshift=0em]pos4.south);
\draw[->,standard] ([xshift=0em]pos2.north) -- ([xshift=0em,yshift=1.6em]pos2.north) -- ([xshift=-0em,yshift=0em]sa1.east);
\draw[->,standard] ([xshift=0em]pos3.north) -- ([xshift=0em,yshift=9em]pos3.north) -- ([xshift=-0em,yshift=0em]dot1.east);
\draw[->,standard] ([xshift=0em]pos4.north) -- ([xshift=0em,yshift=11.7em]pos4.north) -- ([xshift=-0em,yshift=0em]sa2.east);
\begin{pgfonlayer}{background}
\node [rectangle,inner sep=0.2em,rounded corners=1pt,very thick,dotted,fill=red!40] [fit = (pos2) (pos3) (pos4)] (box1) {};
\end{pgfonlayer}
\node [anchor=north,font=\small] (label) at ([xshift=4em,yshift=-3em]add.south) {{(b)相对位置编码}};
\end{scope}
\end{tikzpicture}
\ No newline at end of file
......@@ -51,7 +51,7 @@
%----------------------------------------------
\begin{figure}[htp]
\centering
\includegraphics[scale=0.5]{./Chapter15/Figures/figure-relative-position-coding-and-absolute-position-coding.jpg}
\input{./Chapter15/Figures/figure-relative-position-coding-and-absolute-position-coding}
\caption{绝对位置编码(左)和相对位置编码(右)}
\label{fig:15-1}
\end{figure}
......@@ -322,7 +322,7 @@ C(\mathbi{x}_j \mathbi{W}_K,\omega) &=& (\mathbi{x}_{j-\omega},\ldots,\mathbi{x}
%----------------------------------------------
\begin{figure}[htp]
\centering
\includegraphics[scale=0.5]{./Chapter15/Figures/figure-introducing-rnn-mechanism-into-transformer.jpg}
\input{./Chapter15/Figures/figure-introducing-rnn-mechanism-into-transformer}
\caption{在Transformer中引入循环机制}
\label{fig:15-8}
\end{figure}
......@@ -867,17 +867,17 @@ lr &=& d_{\textrm{model}}^{-0.5}\cdot step\_num^{-0.5}
\sectionnewpage
\section{基于句法的神经机器翻译模型}
\parinterval 在统计机器翻译时代,使用句法信息是一种非常有效的机器翻译建模手段(见{\chaptereight})。由于句法是人类运用语言的高级抽象结果,使用句法信息(如句法树)可以帮助机器翻译系统对句子结构进行建模例如,利用句法树提升译文语法结构的正确性。在神经机器翻译中,大多数框架均基于词串进行建模,因此在模型中引入句法树等结构也很有潜力\upcite{DBLP:conf/acl/LiXTZZZ17}。 具体来说,由于传统神经机器翻译模型缺少对句子结构的理解,会导致一些翻译问题:
\parinterval 在统计机器翻译时代,使用句法信息是一种非常有效的机器翻译建模手段(见{\chaptereight})。由于句法是人类运用语言的高级抽象结果,使用句法信息(如句法树)可以帮助机器翻译系统对句子结构进行建模例如,利用句法树提升译文语法结构的正确性。在神经机器翻译中,大多数框架均基于词串进行建模,因此在模型中引入句法树等结构也很有潜力\upcite{DBLP:conf/acl/LiXTZZZ17}。 具体来说,由于传统神经机器翻译模型缺少对句子结构的理解,会导致一些翻译问题:
\begin{itemize}
\vspace{0.5em}
\item 过度翻译问题,如:
\item {\small\bfnew{过度翻译问题}},如:
\begin{equation}
\textrm{“ 两/个/女孩 ”}\ \to \ \textrm{“ two girls and two girls ”} \nonumber
\end{equation}
\vspace{0.5em}
\item 翻译不连贯问题,如:
\item {\small\bfnew{翻译不连贯问题}},如:
\begin{equation}
\textrm{“ 新生/银行/申请/上市 ”}\ \to \ \textrm{“ new listing bank ”} \nonumber
\end{equation}
......@@ -885,15 +885,15 @@ lr &=& d_{\textrm{model}}^{-0.5}\cdot step\_num^{-0.5}
\vspace{0.5em}
\end{itemize}
\parinterval 显然,神经机器翻译系统并没有按照合理的句法结构生成译文。也就是说,模型并没有理解句子的结构\upcite{DBLP:conf/acl/LiXTZZZ17}。甚至对于一些语言差异很大的语言对,会出现将介词短语翻译成一个词的情况。虽然可以通过很多手段对上述问题进行求解,但是使用句法树是最直接的解决问题的方法\upcite{DBLP:conf/acl/EriguchiHT16}
\parinterval 显然,神经机器翻译系统并没有按照合理的句法结构生成译文。也就是说,模型并没有理解句子的结构\upcite{DBLP:conf/acl/LiXTZZZ17}。甚至对于一些语言差异很大的语言对,会出现将介词短语翻译成一个词的情况。虽然可以通过很多手段对上述问题进行求解,但是使用句法树是解决该问题的一种最直接的方法\upcite{DBLP:conf/acl/EriguchiHT16}
\parinterval 那么在神经机器翻译中,如何将这种离散化的树结构融入到基于分布式表示的翻译模型中呢?有以下两种策略:
\begin{itemize}
\vspace{0.5em}
\item 将句法信息加入到编码器,使得编码器更加充分地表示源语言句子。
\item {\small\bfnew{将句法信息加入到编码器}},使得编码器更加充分地表示源语言句子。
\vspace{0.5em}
\item 将句法信息加入到解码器,使得翻译模型能生成更符合句法的译文。
\item {\small\bfnew{将句法信息加入到解码器}},使得翻译模型能生成更符合句法的译文。
\vspace{0.5em}
\end{itemize}
......@@ -903,7 +903,7 @@ lr &=& d_{\textrm{model}}^{-0.5}\cdot step\_num^{-0.5}
\subsection{编码器使用句法信息}
\parinterval 编码器中使用句法信息有两种思路,一种思路是在编码器中显性使用树结构进行建模,另一种思路是把句法信息作为特征输入到传统的序列编码器中。这两种思路与统计机器翻译中基于句法树结构的模型和基于句法特征的模型十分相似(见{\chaptereight})。
\parinterval 编码器中使用句法信息有两种思路,一种思路是在编码器中显性使用树结构进行建模,另一种思路是把句法信息作为特征输入到传统的序列编码器中。这两种思路与统计机器翻译中基于句法树结构的模型和基于句法特征的模型十分相似(见{\chaptereight})。
%----------------------------------------------------------------------------------------
% NEW SUBSUB-SECTION
......@@ -911,7 +911,7 @@ lr &=& d_{\textrm{model}}^{-0.5}\cdot step\_num^{-0.5}
\subsubsection{1. 基于句法树结构的编码}
\parinterval 一种简单的方法是将源语言句子编码成一个二叉树结构\footnote[6]{所有句法树都可以通过二叉化方法转化为二叉树(见{\chaptereight})。},树节点的信息是由左子树和右子树变换而来,如下所示:
\parinterval 使用句法信息的一种简单的方法是将源语言句子编码成一个二叉树结构\footnote[6]{所有句法树都可以通过二叉化方法转化为二叉树(见{\chaptereight})。},树节点的信息是由左子树和右子树变换而来,如下所示:
\begin{eqnarray}
\mathbi{h}_p &=& f_\textrm{tree}(\mathbi{h}_l,\mathbi{h}_r)
\label{eq:15-50}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论