Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
Toy-MT-Introduction
概览
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
Toy-MT-Introduction
Commits
d53fb7d4
Commit
d53fb7d4
authored
Dec 19, 2019
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
summary pages
parent
7e80636a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
60 行增加
和
109 行删除
+60
-109
Section06-Neural-Machine-Translation/section06-test.tex
+60
-109
Section06-Neural-Machine-Translation/section06.tex
+0
-0
没有找到文件。
Section06-Neural-Machine-Translation/section06-test.tex
查看文件 @
d53fb7d4
...
...
@@ -145,119 +145,70 @@
\subsection
{
注意力机制
}
%%%------------------------------------------------------------------------------------------------------------
\begin{frame}
{
模块1:词嵌入层
}
%%% 做个小结
\begin{frame}
{
我们赶上了好时代 ...
}
\begin{itemize}
\item
词嵌入
\item
神经机器翻译的火爆这几年有目共睹,好事情!!!
\begin{itemize}
\item
https://arxiv.org上搜索neural machine translation
\item
ACL、EMNLP等顶会神经机器翻译论文数量近些年几乎呈线性增长
\item
神经机器翻译系统在各大比赛中霸榜,开源机器翻译满天飞,大厂秀肌肉,小作坊刷存在感
\end{itemize}
\vspace
{
0.3em
}
\item
<2-> 这里只介绍了最基本的概念,NMT的内容远不止这些
\begin{itemize}
\item
各种专题:解码、压缩、先验知识、低资源翻译、无指导方法、篇章级翻译等等等等
\item
推荐一个survey,有些基础的可以参考一下,很全面
\\
``Neural Machine Translation: A Review'' by Felix Stahlberg
\\
\url
{
https://arxiv.org/abs/1912.02047
}
\item
如何搭建一个优秀的NMT系统?- 有许多技巧
\\
下一章介绍
\item
回忆一下第一章介绍的NMT开源系统,可以试试
\end{itemize}
\end{itemize}
%%% 图
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% last slide
\begin{frame}
{
结束~
}
\vspace
{
2em
}
\begin{center}
\hspace*
{
-0.6cm
}
\begin{tikzpicture}
\setlength
{
\base
}{
0.9cm
}
\tikzstyle
{
rnnnode
}
= [rounded corners=1pt,minimum height=0.5
\base
,minimum width=1
\base
,draw,inner sep=0pt,outer sep=0pt]
\tikzstyle
{
wordnode
}
= [font=
\tiny
]
% RNN translation model
\begin{scope}
[local bounding box=RNNMT]
% RNN Encoder
\coordinate
(eemb0) at (0,0);
\foreach
\x
[count=
\y
from 0] in
{
1,2,...,3
}
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=west]
(eemb
\x
) at ([xshift=0.4
\base
]eemb
\y
.east)
{
\tiny
{$
e
_
x
()
$}}
;
\foreach
\x
in
{
1,2,...,3
}
\node
[rnnnode,fill=blue!30!white,anchor=south]
(enc
\x
) at ([yshift=0.3
\base
]eemb
\x
.north)
{}
;
\node
[]
(enclabel1) at (enc1)
{
\tiny
{$
\textbf
{
h
}_{
m
-
2
}$}}
;
\node
[]
(enclabel2) at (enc2)
{
\tiny
{$
\textbf
{
h
}_{
m
-
1
}$}}
;
\node
[rnnnode,fill=purple!30!white]
(enclabel3) at (enc3)
{
\tiny
{$
\textbf
{
h
}_{
m
}$}}
;
\node
[wordnode,left=0.4\base of enc1]
(init1)
{$
\cdots
$}
;
\node
[wordnode,left=0.4\base of eemb1]
(init2)
{$
\cdots
$}
;
\node
[wordnode,below=0pt of eemb1]
()
{
走
}
;
\node
[wordnode,below=0pt of eemb2]
()
{
吗
}
;
\node
[wordnode,below=0pt of eemb3]
()
{$
\langle
$
eos
$
\rangle
$}
;
% RNN Decoder
\foreach
\x
in
{
1,2,...,3
}
\node
[rnnnode,minimum height=0.5\base,fill=green!30!white,anchor=south]
(demb
\x
) at ([yshift=
\base
]enc
\x
.north)
{
\tiny
{$
e
_
y
()
$}}
;
\foreach
\x
in
{
1,2,...,3
}
\node
[rnnnode,fill=blue!30!white,anchor=south]
(dec
\x
) at ([yshift=0.3
\base
]demb
\x
.north)
{{
\tiny
{$
\textbf
{
s
}_
\x
$}}}
;
\foreach
\x
in
{
1,2,...,3
}
\node
[rnnnode,minimum height=0.5\base,fill=red!30!white,anchor=south]
(softmax
\x
) at ([yshift=0.3
\base
]dec
\x
.north)
{
\tiny
{
Softmax
}}
;
\node
[wordnode,right=0.4\base of demb3]
(end1)
{$
\cdots
$}
;
\node
[wordnode,right=0.4\base of dec3]
(end2)
{$
\cdots
$}
;
\node
[wordnode,right=0.4\base of softmax3]
(end3)
{$
\cdots
$}
;
% Decoder input words
\node
[wordnode,below=0pt of demb1]
(decwordin)
{$
\langle
$
sos
$
\rangle
$}
;
\ExtractX
{$
(
demb
2
.south
)
$}
\ExtractY
{$
(
decwordin.base
)
$}
\node
[wordnode,anchor=base]
() at (
\XCoord
,
\YCoord
)
{
Do
}
;
\ExtractX
{$
(
demb
3
.south
)
$}
\ExtractY
{$
(
decwordin.base
)
$}
\node
[wordnode,anchor=base]
() at (
\XCoord
,
\YCoord
)
{
you
}
;
% Decoder output words
\node
[wordnode,above=0pt of softmax1]
(decwordout)
{
Do
}
;
\ExtractX
{$
(
softmax
2
.north
)
$}
\ExtractY
{$
(
decwordout.base
)
$}
\node
[wordnode,anchor=base]
() at (
\XCoord
,
\YCoord
)
{
you
}
;
\ExtractX
{$
(
softmax
3
.north
)
$}
\ExtractY
{$
(
decwordout.base
)
$}
\node
[wordnode,anchor=base]
() at (
\XCoord
,
\YCoord
)
{
know
}
;
% Connections
\draw
[-latex']
(init1.east) to (enc1.west);
\draw
[-latex']
(dec3.east) to (end2.west);
\foreach
\x
in
{
1,2,...,3
}
\draw
[-latex']
(eemb
\x
) to (enc
\x
);
\foreach
\x
in
{
1,2,...,3
}
\draw
[-latex']
(demb
\x
) to (dec
\x
);
\foreach
\x
in
{
1,2,...,3
}
\draw
[-latex']
(dec
\x
.north) to (softmax
\x
.south);
\foreach
\x
[count=
\y
from 2] in
{
1,2
}
{
\draw
[-latex']
(enc
\x
.east) to (enc
\y
.west);
\draw
[-latex']
(dec
\x
.east) to (dec
\y
.west);
}
\coordinate
(bridge) at ([yshift=0.4
\base
]enc2.north west);
\draw
[-latex']
(enc3.north) .. controls +(north:0.3
\base
) and +(east:
\base
) .. (bridge) .. controls +(west:2.7
\base
) and +(west:0.3
\base
) .. (dec1.west);
\end{scope}
\begin{scope}
\coordinate
(start) at (5.8
\base
,0.3
\base
);
\node
[anchor=south west] (one) at (start)
{
\scriptsize
{$
\begin
{
bmatrix
}
0
\\
0
\\
0
\\
\vdots
\\
0
\\
{
\color
{
ugreen
}
1
}
\\
0
\\
0
\end
{
bmatrix
}$}}
;
\node
[anchor=north] (w) at ([yshift=3pt]one.south)
{
\scriptsize
{
\color
{
ugreen
}
you
}}
;
\node
[anchor=north west] (words) at ([xshift=10pt]one.north east)
{
\scriptsize
{$
\begin
{
matrix
}
\langle\textrm
{
eos
}
\rangle
\\
\langle\textrm
{
sos
}
\rangle
\\
\textrm
{
Do
}
\\
\vdots
\\
\textrm
{
know
}
\\
\textrm
{
you
}
\\
\textrm
{
?
}
\\
\textrm
{
have
}
\end
{
matrix
}$}}
;
\node
[anchor=north west] (mat) at ([xshift=-6pt]words.north east)
{
\scriptsize
{$
\begin
{
bmatrix
}
.
1
&
-
4
&
\cdots
&
2
\\
5
&
2
&
\cdots
&
.
2
\\
2
&
.
1
&
\cdots
&
.
3
\\
\vdots
&
\vdots
&
\ddots
&
\vdots
\\
0
&
.
8
&
\cdots
&
4
\\
-
1
&
-
2
&
\cdots
&
-
3
\\
.
7
&
.
5
&
\cdots
&
3
\\
-
2
&
.
3
&
\cdots
&
.
1
\end
{
bmatrix
}$
}}
;
\begin{pgfonlayer}
{
background
}
\node
[draw=ugreen,fill=green!20!white,rounded corners=0.3em,minimum width=3.8cm,minimum height=0.9em,anchor=south west] (emb) at ([shift=
{
(1.25cm,0.8cm)
}
]start)
{}
;
\end{pgfonlayer}
\draw
[decorate,decoration=
{
brace,mirror
}
] ([shift=
{
(6pt,2pt)
}
]mat.south west) to node [auto,swap,font=
\scriptsize
]
{
词嵌入矩阵
}
([shift=
{
(-6pt,2pt)
}
]mat.south east);
\draw
[-latex'] ([xshift=-2pt,yshift=-0.65cm]one.east) to ([yshift=-0.65cm]words.west);
\draw
[-latex'] (emb.east) -| ([yshift=0.4cm]mat.north east);
\draw
[-latex'] ([yshift=-0.4cm]w.south) to ([yshift=2pt]w.south);
\node
[draw=ugreen,densely dashed,thick,rounded corners=3pt,fit=(one) (words) (mat) (w)] (input)
{}
;
\end{scope}
\draw
[->,thick,densely dashed,ugreen] ([yshift=-0.2em]demb3.east) to [out=0,in=180] ([yshift=-1cm]input.west);
\end{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\small
{
\node
[anchor=south west,minimum width=15em] (source) at (0,0)
{
\Large
{
\textbf
{
source
}
: 谢谢 大家 !
}}
;
\node
[anchor=south west,minimum width=15em] (target) at ([yshift=12em]source.north west)
{
\Large
{
\textbf
{
target
}
: Thank You !
}}
;
\node
[anchor=center,minimum width=9.6em,minimum height=1.8em,draw,rounded corners=0.3em] (hidden) at ([yshift=6em]source.north)
{}
;
\node
[anchor=west,minimum width=1.5em,minimum size=1.5em,fill=ugreen!20] (cell01) at ([xshift=0.2em]hidden.west)
{
\footnotesize
{
.2
}}
;
\node
[anchor=west,minimum width=1.5em,minimum size=1.5em,fill=ugreen!10] (cell02) at (cell01.east)
{
\footnotesize
{
-1
}}
;
\node
[anchor=west,minimum width=1.5em,minimum size=1.5em,fill=ugreen!70] (cell03) at (cell02.east)
{
\footnotesize
{
6
}}
;
\node
[anchor=west,minimum width=1.5em,minimum size=1.5em,fill=ugreen!50] (cell04) at (cell03.east)
{
\footnotesize
{
5
}}
;
\node
[anchor=west,minimum width=1.5em,minimum size=1.5em,fill=ugreen!30] (cell05) at (cell04.east)
{
\footnotesize
{
.7
}}
;
\node
[anchor=west,minimum width=1.5em,minimum size=1.5em,fill=ugreen!10] (cell06) at (cell05.east)
{
\footnotesize
{
-2
}}
;
\filldraw
[fill=red!20,draw=white] (source.north west) -- (source.north east) -- ([xshift=-0.2em,yshift=-0.1em]hidden.south east) -- ([xshift=0.2em,yshift=-0.1em]hidden.south west);
\filldraw
[fill=blue!20,draw=white] (target.south west) -- (target.south east) -- ([xshift=-0.2em,yshift=0.1em]hidden.north east) -- ([xshift=0.2em,yshift=0.1em]hidden.north west);
\draw
[->,thick] (source.north west) -- ([xshift=0.2em,yshift=-0.1em]hidden.south west);
\draw
[->,thick] (source.north east) -- ([xshift=-0.2em,yshift=-0.1em]hidden.south east);
\draw
[->,thick] ([xshift=0.2em,yshift=0.1em]hidden.north west) -- (target.south west);
\draw
[->,thick] ([xshift=-0.2em,yshift=0.1em]hidden.north east) -- (target.south east);
}
\node
[anchor=south] (enclabel) at ([yshift=2em]source.north)
{
\large
{
Encoder
}}
;
\node
[anchor=north] (declabel) at ([yshift=-2em]target.south)
{
\large
{
Decoder
}}
;
\end{scope}
\end{tikzpicture}
\vspace
{
2em
}
\end{center}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
...
...
Section06-Neural-Machine-Translation/section06.tex
查看文件 @
d53fb7d4
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论