Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mtbookv2
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
NiuTrans
mtbookv2
Commits
00d629b3
Commit
00d629b3
authored
Nov 07, 2020
by
曹润柘
Browse files
Options
Browse Files
Download
Plain Diff
合并分支 'master' 到 'caorunzhe'
Master 查看合并请求
!352
parents
b5e4df5e
21d3ed48
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
9 行增加
和
10 行删除
+9
-10
Chapter12/chapter12.tex
+2
-3
Chapter9/Figures/figure-embedding-matrix.tex
+1
-1
Chapter9/chapter9.tex
+0
-0
ChapterPreface/Figures/figure-preface.tex
+1
-1
ChapterPreface/chapterpreface.tex
+2
-2
mt-book-xelatex.tex
+3
-3
没有找到文件。
Chapter12/chapter12.tex
查看文件 @
00d629b3
...
...
@@ -58,8 +58,7 @@
\parinterval
自注意力机制也可以被看做是一个序列表示模型。比如,对于每个目标位置
$
j
$
,都生成一个与之对应的源语句子表示,它的形式为:
\begin{eqnarray}
\mathbi
{
C
}}_
j =
\sum
_
i
\alpha
_{
i,j
}
\vectorn
{
\emph
{
h
}}_
i
\label
{
eq:12-4201
}
\mathbi
{
C
}_
j
&
=
&
\sum
_
i
\alpha
_{
i,j
}
\vectorn
{
\emph
{
h
}}_
i
\label
{
eq:12-4201
}
\end{eqnarray}
\noindent
其中,
$
\vectorn
{
\emph
{
h
}}_
i
$
为源语句子每个位置的表示结果,
$
\alpha
_{
i,j
}$
是目标位置
$
j
$
对
$
\vectorn
{
\emph
{
h
}}_
i
$
的注意力权重。而自注意力机制不仅可以处理两种语言句子之间的对应,它也可以对单语句子进行表示。以源语句子为例,自注意力机制将序列中每个位置的表示
$
\vectorn
{
\emph
{
h
}}_
i
$
看作
$
\mathrm
{
query
}$
(查询),并且将所有位置的表示看作
$
\mathrm
{
key
}$
(键)和
$
\mathrm
{
value
}$
(值)。自注意力模型通过计算当前位置与所有位置的匹配程度,也就是在注意力机制中提到的注意力权重,来对各个位置的
$
\mathrm
{
value
}$
进行加权求和。得到的结果可以被看作是在这个句子中当前位置的抽象表示。这个过程,可以叠加多次,形成多层注意力模型,对输入序列中各个位置进行更深层的表示。
...
...
@@ -561,7 +560,7 @@ Transformer Deep(48层) & 30.2 & 43.1 & 194$\times 10^
\section
{
推断
}
\parinterval
Transformer解码器生成译文词序列的过程和其它神经机器翻译系统类似,都是从左往右生成,且下一个单词的预测依赖已经生成的单词。其具体推断过程如图
\ref
{
fig:12-56
}
所示,其中
$
\mathbi
{
C
}
}_
i
$
是编码-解码注意力的结果,解码器首先根据“<eos>”和
$
\mathbi
{
C
}}_
1
$
生成第一个单词“how”,然后根据“how”和
$
\mathbi
{
C
}
}_
2
$
生成第二个单词“are”,以此类推,当解码器生成“<eos>”时结束推断。
\parinterval
Transformer解码器生成译文词序列的过程和其它神经机器翻译系统类似,都是从左往右生成,且下一个单词的预测依赖已经生成的单词。其具体推断过程如图
\ref
{
fig:12-56
}
所示,其中
$
\mathbi
{
C
}
_
i
$
是编码-解码注意力的结果,解码器首先根据“<eos>”和
$
\mathbi
{
C
}_
1
$
生成第一个单词“how”,然后根据“how”和
$
\mathbi
{
C
}_
2
$
生成第二个单词“are”,以此类推,当解码器生成“<eos>”时结束推断。
\parinterval
但是,Transformer在推断阶段无法对所有位置进行并行化操作,因为对于每一个目标语单词都需要对前面所有单词进行注意力操作,因此它推断速度非常慢。可以采用的加速手段有:低精度
\upcite
{
DBLP:journals/corr/CourbariauxB16
}
、Cache(缓存需要重复计算的变量)
\upcite
{
DBLP:journals/corr/abs-1805-00631
}
、共享注意力网络等
\upcite
{
Xiao2019SharingAW
}
。关于Transformer模型的推断加速方法将会在
{
\chapterfourteen
}
进一步深入讨论。
...
...
Chapter9/Figures/figure-embedding-matrix.tex
查看文件 @
00d629b3
...
...
@@ -8,7 +8,7 @@
\node
[rectangle,inner sep=0.4em,draw,fill=blue!20!white] [fit = (e) (c)] (box)
{}
;
\end{pgfonlayer}
\draw
[->,thick] ([yshift=-1em]box.south)--([yshift=-0.1em]box.south) node [pos=0,below] (bottom1)
{
\small
{
单词
$
w
$
的
o
ne-hot表示
}}
;
\draw
[->,thick] ([yshift=-1em]box.south)--([yshift=-0.1em]box.south) node [pos=0,below] (bottom1)
{
\small
{
单词
$
w
$
的
O
ne-hot表示
}}
;
\draw
[->,thick] ([yshift=0.1em]box.north)--([yshift=1em]box.north) node [pos=1,above] (top1)
{
\scriptsize
{$
\mathbi
{
e
}$
=(8,.2,-1,.9,...,1)
}}
;
\node
[anchor=north] (bottom2) at ([yshift=0.3em]bottom1.south)
{
\scriptsize
{$
\mathbi
{
o
}$
=(0,0,1,0,...,0)
}}
;
\node
[anchor=south] (top2) at ([yshift=-0.3em]top1.north)
{
\small
{
单词
$
w
$
的分布式表示
}}
;
...
...
Chapter9/chapter9.tex
查看文件 @
00d629b3
差异被折叠。
点击展开。
ChapterPreface/Figures/figure-preface.tex
查看文件 @
00d629b3
...
...
@@ -53,7 +53,7 @@
\node
[secnode,anchor=south west,fill=green!30,minimum width=9em,minimum height=4.5em,align=center] (sec15) at ([yshift=0.8em]sec13.north west)
{
第十五章
\\
神经机器翻译
\\
结构优化
}
;
\node
[secnode,anchor=south west,fill=green!30,minimum width=9em,minimum height=4.5em,align=center] (sec16) at ([xshift=0.8em]sec15.south east)
{
第十六章
\\
低资源
\\
机器翻译
}
;
\node
[secnode,anchor=south west,fill=green!30,minimum width=9em,minimum height=4.5em,align=center] (sec17) at ([xshift=0.8em]sec16.south east)
{
第十七章
\\
多模态、多层次
\\
机器翻译
}
;
\node
[secnode,anchor=south west,fill=amber!25,minimum width=28.7em,align=center] (sec18) at ([yshift=0.8em]sec15.north west)
{
第十八章
\hspace
{
1em
}
机器翻译
工业实践
}
;
\node
[secnode,anchor=south west,fill=amber!25,minimum width=28.7em,align=center] (sec18) at ([yshift=0.8em]sec15.north west)
{
第十八章
\hspace
{
1em
}
机器翻译
应用技术
}
;
\node
[rectangle,draw,dotted,thick,inner sep=0.1em,fill opacity=1] [fit = (sec13) (sec14)] (nmtbasebox)
{}
;
\draw
[->,very thick] ([yshift=-0.7em]sec15.south) -- ([yshift=-0.1em]sec15.south);
\draw
[->,very thick] ([yshift=-0.7em]sec16.south) -- ([yshift=-0.1em]sec16.south);
...
...
ChapterPreface/chapterpreface.tex
查看文件 @
00d629b3
...
...
@@ -93,7 +93,7 @@
\item
第十五章
\
神经机器翻译结构优化
\item
第十六章
\
低资源机器翻译
\item
第十七章
\
多模态、多层次机器翻译
\item
第十八章
\
机器翻译
工业实践
\item
第十八章
\
机器翻译
应用技术
\end{itemize}
\end{itemize}
...
...
@@ -105,7 +105,7 @@
本书的第三部分主要介绍神经机器翻译模型,该模型也是近些年机器翻译的热点。第九章介绍了神经网络和深度学习的基础知识以保证本书知识体系的完备性。同时,第九章也介绍了基于神经网络的语言模型,其建模思想在神经机器翻译中被大量使用。第十、十一、十二章分别对三种经典的神经机器翻译模型进行介绍,以模型提出的时间为序,从最初的基于循环网络的模型,到最新的Transformer模型均有涉及。其中也会对编码器-解码器框架、注意力机制等经典方法和技术进行介绍。
本书的第四部分会进一步对机器翻译的前沿技术进行讨论,以神经机器翻译为主。第十三、十四、十五章是神经机器翻译研发的三个主要方面,也是近几年机器翻译领域讨论最多的几个方向。第十六章也是机器翻译的热门方向之一,包括无监督翻译等主题都会在这里被讨论。第十六章会对语音、图像翻译等多模态方法以及篇章级翻译等方法进行介绍,它们可以被看作是机器翻译在更多任务上的扩展。第十七章会结合笔者在各种机器翻译比赛和机器翻译产品研发的经验,对机器翻译
系统搭建的具体流程和一些常见技术进行讨论,包括调优方法、前后处理等,都是机器翻译工业应用中的常见问题
。
本书的第四部分会进一步对机器翻译的前沿技术进行讨论,以神经机器翻译为主。第十三、十四、十五章是神经机器翻译研发的三个主要方面,也是近几年机器翻译领域讨论最多的几个方向。第十六章也是机器翻译的热门方向之一,包括无监督翻译等主题都会在这里被讨论。第十六章会对语音、图像翻译等多模态方法以及篇章级翻译等方法进行介绍,它们可以被看作是机器翻译在更多任务上的扩展。第十七章会结合笔者在各种机器翻译比赛和机器翻译产品研发的经验,对机器翻译
的应用技术进行讨论
。
%-------------------------------------------
\begin{figure}
[htp]
...
...
mt-book-xelatex.tex
查看文件 @
00d629b3
...
...
@@ -139,10 +139,10 @@
%\include{Chapter6/chapter6}
%\include{Chapter7/chapter7}
%\include{Chapter8/chapter8}
%
\include{Chapter9/chapter9}
\include
{
Chapter9/chapter9
}
\include
{
Chapter10/chapter10
}
%
\include{Chapter11/chapter11}
%
\include{Chapter12/chapter12}
\include
{
Chapter11/chapter11
}
\include
{
Chapter12/chapter12
}
%\include{Chapter13/chapter13}
%\include{Chapter14/chapter14}
%\include{Chapter15/chapter15}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论