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
单韦乔
Toy-MT-Introduction
Commits
1e144093
Commit
1e144093
authored
5 years ago
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new pages and new sections
parent
65c39211
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
141 行增加
和
699 行删除
+141
-699
.gitignore
+1
-0
Section04-Phrasal-and-Syntactic-Models/section04.test.tex
+0
-442
Section04-Phrasal-and-Syntactic-Models/section04.tex
+95
-93
Section06-Neural-Machine-Translation/section06-test.tex
+18
-161
Section06-Neural-Machine-Translation/section06.tex
+27
-3
没有找到文件。
.gitignore
查看文件 @
1e144093
...
@@ -7,3 +7,4 @@
...
@@ -7,3 +7,4 @@
*.gz
*.gz
*.toc
*.toc
*.blg
*.blg
*.sav
This diff is collapsed.
Click to expand it.
Section04-Phrasal-and-Syntactic-Models/section04.test.tex
deleted
100644 → 0
查看文件 @
65c39211
% !Mode:: "TeX:GBK"
\def\CTeXPreproc
{
Created by ctex v0.2.13, don't edit!
}
\documentclass
[cjk,t,compress,12pt]
{
beamer
}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage
{
pstricks
}
\usepackage
{
etex
}
\usepackage
{
eso-pic,graphicx
}
\usepackage
{
fancybox
}
\usepackage
{
amsmath,amssymb
}
\usepackage
{
setspace
}
\usepackage
{
xcolor
}
\usepackage
{
CJK
}
\usepackage
{
tikz
}
\usepackage
{
tikz-qtree
}
\usepackage
{
hyperref
}
\usepackage
{
ulem
}
\usetikzlibrary
{
arrows,decorations.pathreplacing
}
\usetikzlibrary
{
shadows
}
% LATEX and plain TEX when using Tik Z
\usepgflibrary
{
arrows
}
% LATEX and plain TEX and pure pgf
\usetikzlibrary
{
arrows
}
% LATEX and plain TEX when using Tik Z
\usetikzlibrary
{
decorations
}
\usetikzlibrary
{
arrows,shapes
}
\usetikzlibrary
{
decorations.text
}
\usetikzlibrary
{
positioning,fit,calc
}
\usetikzlibrary
{
mindmap,backgrounds
}
% mind map
\DeclareMathOperator*
{
\argmax
}{
arg
\,
max
}
\DeclareMathOperator*
{
\argmin
}{
arg
\,
min
}
\setbeamertemplate
{
items
}
[ball]
\usefonttheme
[onlymath]
{
serif
}
% fout of math
\definecolor
{
ugreen
}{
rgb
}{
0,0.5,0
}
\definecolor
{
lgreen
}{
rgb
}{
0.9,1,0.8
}
\definecolor
{
xtgreen1
}{
rgb
}{
0.824,0.898,0.8
}
\definecolor
{
xtgreen
}{
rgb
}{
0.914,0.945,0.902
}
\definecolor
{
lightgray
}{
gray
}{
0.85
}
\setbeamercolor
{
uppercol
}{
fg=white,bg=ugreen
}
\setbeamercolor
{
lowercol
}{
fg=black,bg=xtgreen
}
%\definecolor{ublue}{rgb}{0,0.298,0.525}
\definecolor
{
ublue
}{
rgb
}{
0.152,0.250,0.545
}
\setbeamercolor
{
uppercolblue
}{
fg=white,bg=ublue
}
\setbeamercolor
{
lowercolblue
}{
fg=black,bg=blue!10
}
%\usetheme{default}
%\usetheme{Darmstadt}
%\usetheme{Madrid}
%\usetheme{Frankfurt}
%\usetheme{Dresden}
%\usetheme{Boadilla}
%\usecolortheme{dolphin}
\usefonttheme
[onlylarge]
{
structurebold
}
\begin{CJK}
{
GBK
}{
song
}
\end{CJK}
\setbeamerfont*
{
frametitle
}{
size=
\large
,series=
\bfseries
}
\setbeamertemplate
{
navigation symbols
}{
\begin{CJK}
{
GBK
}{
hei
}
第四章 基于短语的翻译模型
\hspace*
{
2em
}
肖桐
\&
朱靖波
\end{CJK}
\hspace*
{
2em
}
\today
\hspace*
{
2em
}
\insertframenumber
{}
/
\inserttotalframenumber
}
\setbeamertemplate
{
itemize items
}
[circle]
% if you want a circle
\setbeamertemplate
{
itemize subitem
}
[triangle]
% if you want a triangle
\setbeamertemplate
{
itemize subsubitem
}
[ball]
% if you want a ball
\begin{document}
\begin{CJK}
{
GBK
}{
you
}
\title
{
\Large
{
基于短语的翻译模型
}}
\author
{
\large
{
\textbf
{
肖桐
\ \
朱靖波
}}}
\institute
{
\blue
{
\url
{
xiaotong@mail.neu.edu.cn
}}
\black
{}
\\
\blue
{
\url
{
zhujingbo@mail.neu.edu.cn
}}
\black
{}
\\
\vspace
{
1.0em
}
东北大学 自然语言处理实验室
\\
\blue
{
\underline
{
\url
{
http://www.nlplab.com
}}}
\black
{}
\\
\vspace
{
0.2cm
}
\hspace
{
0.1cm
}
\includegraphics
[scale=0.1]
{
../Figures/logo.pdf
}
}
\date
{}
\maketitle
\setlength
{
\leftmargini
}{
1em
}
\setlength
{
\leftmarginii
}{
1em
}
%%%------------------------------------------------------------------------------------------------------------
\section
{
翻译中为什么要使用短语
}
%%%------------------------------------------------------------------------------------------------------------
%%% 回顾基于词的翻译模型
\begin{frame}
{
回顾 - 基于词的机器翻译
}
\begin{itemize}
\item
对每个
\alert
{
单词
}
的翻译进行(任意)组合
\end{itemize}
\vspace
{
-2em
}
\begin{flushright}
\begin{tikzpicture}
\begin{scope}
\node
[anchor=west] (s1) at (0,0)
{
\textbf
{
我
}}
;
\node
[anchor=west] (s2) at ([xshift=2em]s1.east)
{
\textbf
{
对
}}
;
\node
[anchor=west] (s3) at ([xshift=2em]s2.east)
{
\textbf
{
你
}}
;
\node
[anchor=west] (s4) at ([xshift=2em]s3.east)
{
\textbf
{
表示
}}
;
\node
[anchor=west] (s5) at ([xshift=2em]s4.east)
{
\textbf
{
满意
}}
;
\node
[anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west)
{
\scriptsize
{
\textbf
{
\alert
{
待翻译句子(已经分词):
}}}}
;
\draw
[->,very thick,ublue] (s1.south) -- ([yshift=-0.7em]s1.south);
\draw
[->,very thick,ublue] (s2.south) -- ([yshift=-0.7em]s2.south);
\draw
[->,very thick,ublue] (s3.south) -- ([yshift=-0.7em]s3.south);
\draw
[->,very thick,ublue] (s4.south) -- ([yshift=-0.7em]s4.south);
\draw
[->,very thick,ublue] (s5.south) -- ([yshift=-0.7em]s5.south);
{
\small
\node
[anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t11) at ([yshift=-1em]s1.south)
{
I
}
;
\node
[anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t12) at ([yshift=-0.2em]t11.south)
{
me
}
;
\node
[anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t13) at ([yshift=-0.2em]t12.south)
{
I'm
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl11) at (t11.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl12) at (t12.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl13) at (t13.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1
}}}}
;
\invisible
{
\node
[anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=6.55em] (t14) at ([yshift=-0.2em]t13.south west)
{
I'm
}
;
\node
[anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=6.55em] (t15) at ([yshift=-0.2em]t14.south west)
{
I
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl14) at (t14.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1-2
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl15) at (t15.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1-2
}}}}
;
}
\node
[anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t21) at ([yshift=-1em]s2.south)
{
to
}
;
\node
[anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t22) at ([yshift=-0.2em]t21.south)
{
with
}
;
\node
[anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t23) at ([yshift=-0.2em]t22.south)
{
for
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl21) at (t21.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl22) at (t22.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl23) at (t23.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2
}}}}
;
\invisible
{
\node
[anchor=north west,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=6.55em] (t24) at ([yshift=-0.2em,xshift=-2.6em]t15.south east)
{
for you
}
;
\node
[anchor=north west,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=6.55em] (t25) at ([yshift=-0.2em]t24.south west)
{
with you
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl24) at (t24.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2-3
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl25) at (t25.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2-3
}}}}
;
}
\node
[anchor=north,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (t31) at ([yshift=-1em]s3.south)
{
you
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl31) at (t31.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
3
}}}}
;
\invisible
{
\node
[anchor=west,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=13.35em] (t32) at ([xshift=1.4em]t14.east)
{
you are satisfied
}
;
\node
[anchor=north west,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=7.45em] (t33) at ([yshift=-0.2em]t32.south west)
{$
\phi
$}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl32) at (t32.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
3-5
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl33) at (t33.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
3-4
}}}}
;
}
\node
[anchor=north,inner sep=2pt,fill=orange!20,minimum height=1.5em,minimum width=3em] (t41) at ([yshift=-1em]s4.south)
{$
\phi
$}
;
\node
[anchor=north,inner sep=2pt,fill=orange!20,minimum height=1.5em,minimum width=3em] (t42) at ([yshift=-0.2em]t41.south)
{
show
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl41) at (t41.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
4
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl42) at (t42.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
4
}}}}
;
\invisible
{
\node
[anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=9.00em] (t43) at ([xshift=1.75em]t24.east)
{
satisfied
}
;
\node
[anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=9.00em] (t44) at ([yshift=-0.2em]t43.south west)
{
satisfactory
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl43) at (t43.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
4-5
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl44) at (t44.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
4-5
}}}}
;
}
\node
[anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t51) at ([yshift=-1em]s5.south)
{
satisfy
}
;
\node
[anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t52) at ([yshift=-0.2em]t51.south)
{
satisfied
}
;
\node
[anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t53) at ([yshift=-0.2em]t52.south)
{
satisfies
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl51) at (t51.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
5
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl52) at (t52.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
5
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl53) at (t53.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
5
}}}}
;
}
{
\tiny
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt11) at (t11.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt12) at (t12.east)
{{
\color
{
white
}
\textbf
{
P=.2
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt13) at (t13.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\invisible
{
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt14) at (t14.east)
{{
\color
{
white
}
\textbf
{
P=.1
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt15) at (t15.east)
{{
\color
{
white
}
\textbf
{
P=.2
}}}
;
}
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt21) at (t21.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt22) at (t22.east)
{{
\color
{
white
}
\textbf
{
P=.3
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt23) at (t23.east)
{{
\color
{
white
}
\textbf
{
P=.3
}}}
;
\invisible
{
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt24) at (t24.east)
{{
\color
{
white
}
\textbf
{
P=.2
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt25) at (t25.east)
{{
\color
{
white
}
\textbf
{
P=.1
}}}
;
}
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt31) at (t31.east)
{{
\color
{
white
}
\textbf
{
P=1
}}}
;
\invisible
{
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt33) at (t32.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt33) at (t33.east)
{{
\color
{
white
}
\textbf
{
P=.3
}}}
;
}
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt41) at (t41.east)
{{
\color
{
white
}
\textbf
{
P=.5
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt42) at (t42.east)
{{
\color
{
white
}
\textbf
{
P=.5
}}}
;
\invisible
{
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt43) at (t43.east)
{{
\color
{
white
}
\textbf
{
P=.3
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt44) at (t44.east)
{{
\color
{
white
}
\textbf
{
P=.2
}}}
;
}
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt51) at (t51.east)
{{
\color
{
white
}
\textbf
{
P=.5
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt52) at (t52.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt53) at (t53.east)
{{
\color
{
white
}
\textbf
{
P=.1
}}}
;
}
\end{scope}
\begin{scope}
{
\small
}
\end{scope}
\begin{scope}
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=0em,xshift=-0.5em]t11.north west) -- ([xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label2)
{
\footnotesize
{
\textbf
{
单词翻译
}}}
;
\visible
<2->
{
\draw
[->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t22.west) -- ([xshift=0.8em]t22.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t52.west) -- ([xshift=1.2em]t52.east);
}
\invisible
{
\draw
[->,ultra thick,ublue,line width=2pt,opacity=0.7] ([xshift=-0.5em]t15.west) -- ([xshift=0.8em]t15.east) -- ([xshift=-0.2em]t32.west) -- ([xshift=1.2em]t32.east);
\draw
[->,ultra thick,ublue,line width=2pt,opacity=0.7] ([xshift=-0.5em,yshift=0.1em]t13.west) -- ([xshift=0.8em,yshift=0.1em]t13.east) -- ([xshift=-0.2em]t25.west) -- ([xshift=0.8em]t25.east) -- ([xshift=-0.2em,yshift=0.1em]t41.west) -- ([xshift=0.8em,yshift=0.1em]t41.east) -- ([xshift=-0.2em,yshift=0.1em]t52.west) -- ([xshift=1.2em,yshift=0.1em]t52.east);
}
\invisible
{
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=-0.2em,xshift=-0.5em]t13.south west) -- ([yshift=-6.3em,xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label3)
{
\footnotesize
{
\textbf
{
短语翻译
}}}
;
}
\visible
<2->
{
\node
[anchor=north west] (wtranslabel) at ([yshift=-4em]t15.south west)
{
\scriptsize
{
翻译路径(仅含有单词):
}}
;
\draw
[->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1em]wtranslabel.east);
}
\invisible
{
\node
[anchor=north west] (ptranslabel) at ([yshift=-5.5em]t15.south west)
{
\scriptsize
{
翻译路径(含有短语):
}}
;
\draw
[->,ultra thick,ublue,line width=1.5pt,opacity=0.7] ([xshift=0.65em]ptranslabel.east) -- ([xshift=1.65em]ptranslabel.east);
}
\end{scope}
\end{tikzpicture}
\end{flushright}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 基于短语的翻译模型
\begin{frame}
{
基于"短语"的机器翻译
}
\begin{itemize}
\item
对每个
\alert
{
单词
}
及
\alert
{
连续词串
}
的翻译进行(任意)组合
\end{itemize}
\vspace
{
-2em
}
\begin{flushright}
\begin{tikzpicture}
\begin{scope}
\node
[anchor=west] (s1) at (0,0)
{
\textbf
{
我
}}
;
\node
[anchor=west] (s2) at ([xshift=2em]s1.east)
{
\textbf
{
对
}}
;
\node
[anchor=west] (s3) at ([xshift=2em]s2.east)
{
\textbf
{
你
}}
;
\node
[anchor=west] (s4) at ([xshift=2em]s3.east)
{
\textbf
{
表示
}}
;
\node
[anchor=west] (s5) at ([xshift=2em]s4.east)
{
\textbf
{
满意
}}
;
\node
[anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west)
{
\scriptsize
{
\textbf
{
\alert
{
待翻译句子(已经分词):
}}}}
;
\draw
[->,very thick,ublue] (s1.south) -- ([yshift=-0.7em]s1.south);
\draw
[->,very thick,ublue] (s2.south) -- ([yshift=-0.7em]s2.south);
\draw
[->,very thick,ublue] (s3.south) -- ([yshift=-0.7em]s3.south);
\draw
[->,very thick,ublue] (s4.south) -- ([yshift=-0.7em]s4.south);
\draw
[->,very thick,ublue] (s5.south) -- ([yshift=-0.7em]s5.south);
{
\small
\node
[anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t11) at ([yshift=-1em]s1.south)
{
I
}
;
\node
[anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t12) at ([yshift=-0.2em]t11.south)
{
me
}
;
\node
[anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t13) at ([yshift=-0.2em]t12.south)
{
I'm
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl11) at (t11.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl12) at (t12.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl13) at (t13.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1
}}}}
;
\visible
<2->
{
\node
[anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=6.55em] (t14) at ([yshift=-0.2em]t13.south west)
{
I'm
}
;
\node
[anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=6.55em] (t15) at ([yshift=-0.2em]t14.south west)
{
I
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl14) at (t14.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1-2
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl15) at (t15.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
1-2
}}}}
;
}
\node
[anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t21) at ([yshift=-1em]s2.south)
{
to
}
;
\node
[anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t22) at ([yshift=-0.2em]t21.south)
{
with
}
;
\node
[anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t23) at ([yshift=-0.2em]t22.south)
{
for
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl21) at (t21.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl22) at (t22.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl23) at (t23.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2
}}}}
;
\visible
<2->
{
\node
[anchor=north west,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=6.55em] (t24) at ([yshift=-0.2em,xshift=-2.6em]t15.south east)
{
for you
}
;
\node
[anchor=north west,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=6.55em] (t25) at ([yshift=-0.2em]t24.south west)
{
with you
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl24) at (t24.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2-3
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl25) at (t25.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
2-3
}}}}
;
}
\node
[anchor=north,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (t31) at ([yshift=-1em]s3.south)
{
you
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl31) at (t31.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
3
}}}}
;
\visible
<2->
{
\node
[anchor=west,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=13.35em] (t32) at ([xshift=1.4em]t14.east)
{
you are satisfied
}
;
\node
[anchor=north west,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=7.45em] (t33) at ([yshift=-0.2em]t32.south west)
{$
\phi
$}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl32) at (t32.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
3-5
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl33) at (t33.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
3-4
}}}}
;
}
\node
[anchor=north,inner sep=2pt,fill=orange!20,minimum height=1.5em,minimum width=3em] (t41) at ([yshift=-1em]s4.south)
{$
\phi
$}
;
\node
[anchor=north,inner sep=2pt,fill=orange!20,minimum height=1.5em,minimum width=3em] (t42) at ([yshift=-0.2em]t41.south)
{
show
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl41) at (t41.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
4
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl42) at (t42.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
4
}}}}
;
\visible
<2->
{
\node
[anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=9.00em] (t43) at ([xshift=1.75em]t24.east)
{
satisfied
}
;
\node
[anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=9.00em] (t44) at ([yshift=-0.2em]t43.south west)
{
satisfactory
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl43) at (t43.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
4-5
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl44) at (t44.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
4-5
}}}}
;
}
\node
[anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t51) at ([yshift=-1em]s5.south)
{
satisfy
}
;
\node
[anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t52) at ([yshift=-0.2em]t51.south)
{
satisfied
}
;
\node
[anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t53) at ([yshift=-0.2em]t52.south)
{
satisfies
}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl51) at (t51.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
5
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl52) at (t52.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
5
}}}}
;
\node
[anchor=north west,inner sep=1pt,fill=black] (tl53) at (t53.north west)
{
\tiny
{{
\color
{
white
}
\textbf
{
5
}}}}
;
}
{
\tiny
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt11) at (t11.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt12) at (t12.east)
{{
\color
{
white
}
\textbf
{
P=.2
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt13) at (t13.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\visible
<2->
{
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt14) at (t14.east)
{{
\color
{
white
}
\textbf
{
P=.1
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt15) at (t15.east)
{{
\color
{
white
}
\textbf
{
P=.2
}}}
;
}
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt21) at (t21.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt22) at (t22.east)
{{
\color
{
white
}
\textbf
{
P=.3
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt23) at (t23.east)
{{
\color
{
white
}
\textbf
{
P=.3
}}}
;
\visible
<2->
{
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt24) at (t24.east)
{{
\color
{
white
}
\textbf
{
P=.2
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt25) at (t25.east)
{{
\color
{
white
}
\textbf
{
P=.1
}}}
;
}
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt31) at (t31.east)
{{
\color
{
white
}
\textbf
{
P=1
}}}
;
\visible
<2->
{
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt33) at (t32.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt33) at (t33.east)
{{
\color
{
white
}
\textbf
{
P=.3
}}}
;
}
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt41) at (t41.east)
{{
\color
{
white
}
\textbf
{
P=.5
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt42) at (t42.east)
{{
\color
{
white
}
\textbf
{
P=.5
}}}
;
\visible
<2->
{
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt43) at (t43.east)
{{
\color
{
white
}
\textbf
{
P=.3
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt44) at (t44.east)
{{
\color
{
white
}
\textbf
{
P=.2
}}}
;
}
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt51) at (t51.east)
{{
\color
{
white
}
\textbf
{
P=.5
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt52) at (t52.east)
{{
\color
{
white
}
\textbf
{
P=.4
}}}
;
\node
[anchor=north,rotate=90,inner sep=1pt,minimum width=2.55em,fill=black] (pt53) at (t53.east)
{{
\color
{
white
}
\textbf
{
P=.1
}}}
;
}
\end{scope}
\begin{scope}
{
\small
}
\end{scope}
\begin{scope}
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=0em,xshift=-0.5em]t11.north west) -- ([xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label2)
{
\footnotesize
{
\textbf
{
单词翻译
}}}
;
\draw
[->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t22.west) -- ([xshift=0.8em]t22.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t52.west) -- ([xshift=1.2em]t52.east);
\visible
<3->
{
\draw
[->,ultra thick,ublue,line width=2pt,opacity=0.7] ([xshift=-0.5em]t15.west) -- ([xshift=0.8em]t15.east) -- ([xshift=-0.2em]t32.west) -- ([xshift=1.2em]t32.east);
}
\visible
<4->
{
\draw
[->,ultra thick,ublue,line width=2pt,opacity=0.7] ([xshift=-0.5em,yshift=0.1em]t13.west) -- ([xshift=0.8em,yshift=0.1em]t13.east) -- ([xshift=-0.2em]t25.west) -- ([xshift=0.8em]t25.east) -- ([xshift=-0.2em,yshift=0.1em]t41.west) -- ([xshift=0.8em,yshift=0.1em]t41.east) -- ([xshift=-0.2em,yshift=0.1em]t52.west) -- ([xshift=1.2em,yshift=0.1em]t52.east);
}
\visible
<2->
{
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=-0.2em,xshift=-0.5em]t13.south west) -- ([yshift=-6.3em,xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label3)
{
\footnotesize
{
\textbf
{
短语翻译
}}}
;
}
\node
[anchor=north west] (wtranslabel) at ([yshift=-4em]t15.south west)
{
\scriptsize
{
翻译路径(仅含有单词):
}}
;
\draw
[->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1em]wtranslabel.east);
\visible
<3->
{
\node
[anchor=north west] (ptranslabel) at ([yshift=-5.5em]t15.south west)
{
\scriptsize
{
翻译路径(含有短语):
}}
;
\draw
[->,ultra thick,ublue,line width=1.5pt,opacity=0.7] ([xshift=0.65em]ptranslabel.east) -- ([xshift=1.65em]ptranslabel.east);
}
\end{scope}
\end{tikzpicture}
\end{flushright}
\end{frame}
\end{CJK}
\end{document}
This diff is collapsed.
Click to expand it.
Section04-Phrasal-and-Syntactic-Models/section04.tex
查看文件 @
1e144093
% !Mode:: "TeX:GBK"
% !Mode:: "TeX:UTF-8"
% !TEX encoding = UTF-8 Unicode
\def\CTeXPreproc
{
Created by ctex v0.2.13, don't edit!
}
\def\CTeXPreproc
{
Created by ctex v0.2.13, don't edit!
}
\documentclass
[cjk,t,compress,12pt]
{
beamer
}
\documentclass
[cjk,t,compress,12pt]
{
beamer
}
%\documentclass[cjk,t,compress,handout,12pt]{beamer}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage
{
pstricks
}
\usepackage
{
pstricks
}
\usepackage
{
etex
}
\usepackage
{
etex
}
\usepackage
{
eso-pic,graphicx
}
\usepackage
{
eso-pic,graphicx
}
...
@@ -62,11 +60,15 @@
...
@@ -62,11 +60,15 @@
\usefonttheme
[onlylarge]
{
structurebold
}
\usefonttheme
[onlylarge]
{
structurebold
}
\begin{CJK}
{
GBK
}{
song
}
\IfFileExists
{
C:/WINDOWS/win.ini
}
{
\newcommand
{
\mycfont
}{
you
}}
{
\newcommand
{
\mycfont
}{
gbsn
}}
\begin{CJK}
{
UTF8
}{
\mycfont
}
\end{CJK}
\end{CJK}
\setbeamerfont*
{
frametitle
}{
size=
\large
,series=
\bfseries
}
\setbeamerfont*
{
frametitle
}{
size=
\large
,series=
\bfseries
}
\setbeamertemplate
{
navigation symbols
}{
\begin{CJK}
{
GBK
}{
hei
}
第四章 基于短语和句法的翻译模型
\hspace*
{
2em
}
肖桐
\&
朱靖波
\end{CJK}
\hspace*
{
2em
}
\today
\hspace*
{
2em
}
\insertframenumber
{}
/
\inserttotalframenumber
}
\setbeamertemplate
{
navigation symbols
}{
\begin{CJK}
{
UTF8
}{
\mycfont
}
第四章 基于短语和句法的翻译模型
\hspace*
{
2em
}
肖桐
\&
朱靖波
\end{CJK
}
\hspace*
{
2em
}
\today
\hspace*
{
2em
}
\insertframenumber
{}
/
\inserttotalframenumber
}
\setbeamertemplate
{
itemize items
}
[circle]
% if you want a circle
\setbeamertemplate
{
itemize items
}
[circle]
% if you want a circle
\setbeamertemplate
{
itemize subitem
}
[triangle]
% if you wnat a triangle
\setbeamertemplate
{
itemize subitem
}
[triangle]
% if you wnat a triangle
...
@@ -74,15 +76,15 @@
...
@@ -74,15 +76,15 @@
\begin{document}
\begin{document}
\begin{CJK}
{
GBK
}{
you
}
\begin{CJK}
{
UTF8
}{
\mycfont
}
\title
{
\Large
{
基于短语和句法的翻译模型
}}
\title
{
\Large
{
基于短语和句法的翻译模型
}}
\author
{
\large
{
\textbf
{
肖桐
\ \
朱靖波
}
}}
\author
{
\large
{
\textbf
{
肖桐
\ \
朱靖波
}}}
\institute
{
\institute
{
\blue
{
\url
{
xiaotong@mail.neu.edu.cn
}}
\black
{}
\\
\blue
{
\url
{
xiaotong@mail.neu.edu.cn
}}
\black
{}
\\
\blue
{
\url
{
zhujingbo@mail.neu.edu.cn
}}
\black
{}
\\
\blue
{
\url
{
zhujingbo@mail.neu.edu.cn
}}
\black
{}
\\
\vspace
{
1.0em
}
\vspace
{
1.0em
}
东北大学 自然语言处理实验室
\\
东北大学 自然语言处理实验室
\\
\blue
{
\underline
{
\url
{
http://www.nlplab.com
}}}
\black
{}
\\
\blue
{
\underline
{
\url
{
http://www.nlplab.com
}}}
\black
{}
\\
\vspace
{
0.2cm
}
\vspace
{
0.2cm
}
\hspace
{
0.1cm
}
\includegraphics
[scale=0.1]
{
../Figures/logo.pdf
}
\hspace
{
0.1cm
}
\includegraphics
[scale=0.1]
{
../Figures/logo.pdf
}
...
@@ -95,17 +97,17 @@
...
@@ -95,17 +97,17 @@
\setlength
{
\leftmarginii
}{
1em
}
\setlength
{
\leftmarginii
}{
1em
}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\section
{
翻译中为什么要使用短语
}
\section
{
翻译中为什么要使用短语
}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
%%%
基于单词的模型的问题
%%%
基于单词的模型的问题
\begin{frame}
{
基于单词有哪些问题
}
\begin{frame}
{
基于单词有哪些问题
}
\begin{itemize}
\begin{itemize}
\item
基于单词的翻译模型有哪些
\alert
{
优点
}
?
\item
基于单词的翻译模型有哪些
\alert
{
优点
}
?
\begin{itemize}
\begin{itemize}
\item
比较符合人的思维、简单直接、易于实现
\item
比较符合人的思维、简单直接、易于实现
\end{itemize}
\end{itemize}
\vspace
{
0.3em
}
\vspace
{
0.3em
}
...
@@ -114,11 +116,11 @@
...
@@ -114,11 +116,11 @@
\begin{center}
\begin{center}
{
\scriptsize
{
\scriptsize
\begin{tabular}
{
l | l
}
\begin{tabular}
{
l | l
}
单词翻译表
&
P
\\
\hline
单词翻译表
&
P
\\
\hline
我
$
\to
$
I
&
0.6
\\
我
$
\to
$
I
&
0.6
\\
喜欢
$
\to
$
like
&
0.3
\\
喜欢
$
\to
$
like
&
0.3
\\
绿
$
\to
$
green
&
0.9
\\
绿
$
\to
$
green
&
0.9
\\
茶
$
\to
$
tea
&
0.8
\\
茶
$
\to
$
tea
&
0.8
\\
\end{tabular}
\end{tabular}
}
}
\end{center}
\end{center}
...
@@ -128,10 +130,10 @@
...
@@ -128,10 +130,10 @@
\begin{scope}
\begin{scope}
{
\footnotesize
{
\footnotesize
\node
[anchor=west] (s1) at (0,0)
{
我
}
;
\node
[anchor=west] (s1) at (0,0)
{
我
}
;
\node
[anchor=west] (s2) at ([xshift=1.0em]s1.east)
{
喜欢
}
;
\node
[anchor=west] (s2) at ([xshift=1.0em]s1.east)
{
喜欢
}
;
\node
[anchor=west] (s3) at ([xshift=1.0em]s2.east)
{{
\color
{
ugreen
}
绿
}
}
;
\node
[anchor=west] (s3) at ([xshift=1.0em]s2.east)
{{
\color
{
ugreen
}
绿
}
}
;
\node
[anchor=west] (s4) at ([xshift=1.0em]s3.east)
{
茶
}
;
\node
[anchor=west] (s4) at ([xshift=1.0em]s3.east)
{
茶
}
;
\node
[anchor=east] (s) at (s1.west)
{$
s
=
$}
;
\node
[anchor=east] (s) at (s1.west)
{$
s
=
$}
;
}
}
\end{scope}
\end{scope}
...
@@ -158,11 +160,11 @@
...
@@ -158,11 +160,11 @@
\vspace
{
0.5em
}
\vspace
{
0.5em
}
\item
<3->
基于单词的翻译模型有哪些
\alert
{
缺点
}
?
\item
<3->
基于单词的翻译模型有哪些
\alert
{
缺点
}
?
\begin{itemize}
\begin{itemize}
\item
很多 - 这符合中国人的思维,缺点总是很多
:)
\item
很多 - 这符合中国人的思维,缺点总是很多 :)
\item
独立性假设:单词之间相对独立,没有考虑搭配
\item
独立性假设:单词之间相对独立,没有考虑搭配
\item
调序:较弱的调序建模
\item
调序:较弱的调序建模
\item
...
\item
...
\end{itemize}
\end{itemize}
...
@@ -172,12 +174,12 @@
...
@@ -172,12 +174,12 @@
\begin{center}
\begin{center}
{
\scriptsize
{
\scriptsize
\begin{tabular}
{
l | l
}
\begin{tabular}
{
l | l
}
单词翻译表
&
P
\\
\hline
单词翻译表
&
P
\\
\hline
我
$
\to
$
I
&
0.6
\\
我
$
\to
$
I
&
0.6
\\
喜欢
$
\to
$
like
&
0.3
\\
喜欢
$
\to
$
like
&
0.3
\\
红
$
\to
$
red
&
0.8
\\
红
$
\to
$
red
&
0.8
\\
红
$
\to
$
black
&
0.1
\\
红
$
\to
$
black
&
0.1
\\
茶
$
\to
$
tea
&
0.8
\\
茶
$
\to
$
tea
&
0.8
\\
\end{tabular}
\end{tabular}
}
}
\end{center}
\end{center}
...
@@ -188,10 +190,10 @@
...
@@ -188,10 +190,10 @@
\begin{scope}
\begin{scope}
{
\footnotesize
{
\footnotesize
\node
[anchor=west] (s1) at (0,0)
{
我
}
;
\node
[anchor=west] (s1) at (0,0)
{
我
}
;
\node
[anchor=west] (s2) at ([xshift=1.0em]s1.east)
{
喜欢
}
;
\node
[anchor=west] (s2) at ([xshift=1.0em]s1.east)
{
喜欢
}
;
\node
[anchor=west] (s3) at ([xshift=1.0em]s2.east)
{
\alert
{
红
}
}
;
\node
[anchor=west] (s3) at ([xshift=1.0em]s2.east)
{
\alert
{
红
}
}
;
\node
[anchor=west] (s4) at ([xshift=1.0em]s3.east)
{
茶
}
;
\node
[anchor=west] (s4) at ([xshift=1.0em]s3.east)
{
茶
}
;
\node
[anchor=east] (s) at (s1.west)
{$
s
=
$}
;
\node
[anchor=east] (s) at (s1.west)
{$
s
=
$}
;
}
}
\end{scope}
\end{scope}
...
@@ -216,7 +218,7 @@
...
@@ -216,7 +218,7 @@
\begin{pgfonlayer}
{
background
}
\begin{pgfonlayer}
{
background
}
\visible
<5->
{
\visible
<5->
{
\node
[rectangle,draw=red,thick,inner sep=0.2em,fill=white,drop shadow] [fit = (t3) (t4)] (problemphrase)
{}
;
\node
[rectangle,draw=red,thick,inner sep=0.2em,fill=white,drop shadow] [fit = (t3) (t4)] (problemphrase)
{}
;
\node
[anchor=north,red,text width=8em,align=left] (problemlabel) at (problemphrase.south)
{
\begin{spacing}
{
0.8
}
\scriptsize
{
"
红 茶"为一种搭配,应该翻译为
"black tea"
}
\end{spacing}
}
;
\node
[anchor=north,red,text width=8em,align=left] (problemlabel) at (problemphrase.south)
{
\begin{spacing}
{
0.8
}
\scriptsize
{
"
红 茶"为一种搭配,应该翻译为"blac
k tea"
}
\end{spacing}
}
;
}
%\visible<5->
}
%\visible<5->
\end{pgfonlayer}
\end{pgfonlayer}
...
@@ -228,27 +230,27 @@
...
@@ -228,27 +230,27 @@
\end{frame}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
%%%
引入短语翻译
%%%
引入短语翻译
\begin{frame}
{
引入更大的翻译单元
}
\begin{frame}
{
引入更大的翻译单元
}
\begin{itemize}
\begin{itemize}
\item
简单的单词翻译似乎不行,咋办?
\visible
<2->
{
\alert
{
- 引入更大的翻译单元
}
}
\item
简单的单词翻译似乎不行,咋办?
\visible
<2->
{
\alert
{
- 引入更大的翻译单元
}}
\begin{minipage}
[t]
{
0.40
\linewidth
}
\begin{minipage}
[t]
{
0.40
\linewidth
}
\begin{center}
\begin{center}
{
\scriptsize
{
\scriptsize
\begin{tabular}
{
l | l
}
\begin{tabular}
{
l | l
}
\only
<1>
{
单词翻译表
}
\only
<2->
{
\alert
{
\sout
{
单词
}}
词串翻译表
}
&
P
\\
\hline
\only
<1>
{
单词翻译表
}
\only
<2->
{
\alert
{
\sout
{
单词
}}
词串翻译表
}
&
P
\\
\hline
我
$
\to
$
I
&
0.6
\\
我
$
\to
$
I
&
0.6
\\
喜欢
$
\to
$
like
&
0.3
\\
喜欢
$
\to
$
like
&
0.3
\\
红
$
\to
$
red
&
0.8
\\
红
$
\to
$
red
&
0.8
\\
红
$
\to
$
black
&
0.1
\\
红
$
\to
$
black
&
0.1
\\
茶
$
\to
$
tea
&
0.8
\\
茶
$
\to
$
tea
&
0.8
\\
\visible
<2->
{
我 喜欢
$
\to
$
I like
&
0.3
\\
\visible
<2->
{
我 喜欢
$
\to
$
I like
&
0.3
\\
我 喜欢
$
\to
$
I liked
&
0.2
\\
我 喜欢
$
\to
$
I liked
&
0.2
\\
绿 茶
$
\to
$
green tea
&
0.5
\\
绿 茶
$
\to
$
green tea
&
0.5
\\
绿 茶
$
\to
$
the green tea
&
0.1
\\
绿 茶
$
\to
$
the green tea
&
0.1
\\
红 茶
$
\to
$
black tea
&
0.6
\\
红 茶
$
\to
$
black tea
&
0.6
\\
...
&
}
...
&
}
\end{tabular}
\end{tabular}
}
}
...
@@ -262,10 +264,10 @@
...
@@ -262,10 +264,10 @@
\begin{scope}
\begin{scope}
\begin{scope}
\begin{scope}
{
\footnotesize
{
\footnotesize
\node
[anchor=west] (s1) at (0,0)
{
我
}
;
\node
[anchor=west] (s1) at (0,0)
{
我
}
;
\node
[anchor=west] (s2) at ([xshift=1.0em]s1.east)
{
喜欢
}
;
\node
[anchor=west] (s2) at ([xshift=1.0em]s1.east)
{
喜欢
}
;
\node
[anchor=west] (s3) at ([xshift=1.0em]s2.east)
{
\alert
{
红
}
}
;
\node
[anchor=west] (s3) at ([xshift=1.0em]s2.east)
{
\alert
{
红
}
}
;
\node
[anchor=west] (s4) at ([xshift=1.0em]s3.east)
{
茶
}
;
\node
[anchor=west] (s4) at ([xshift=1.0em]s3.east)
{
茶
}
;
\node
[anchor=east] (s) at (s1.west)
{$
s
=
$}
;
\node
[anchor=east] (s) at (s1.west)
{$
s
=
$}
;
}
}
\end{scope}
\end{scope}
...
@@ -294,10 +296,10 @@
...
@@ -294,10 +296,10 @@
\begin{scope}
[yshift=-6em]
\begin{scope}
[yshift=-6em]
\begin{scope}
\begin{scope}
{
\footnotesize
{
\footnotesize
\node
[anchor=west] (s1) at (0,0)
{
我
}
;
\node
[anchor=west] (s1) at (0,0)
{
我
}
;
\node
[anchor=west] (s2) at ([xshift=1.0em]s1.east)
{
喜欢
}
;
\node
[anchor=west] (s2) at ([xshift=1.0em]s1.east)
{
喜欢
}
;
\node
[anchor=west] (s3) at ([xshift=1.0em]s2.east)
{
\alert
{
红
}
}
;
\node
[anchor=west] (s3) at ([xshift=1.0em]s2.east)
{
\alert
{
红
}
}
;
\node
[anchor=west] (s4) at ([xshift=1.0em]s3.east)
{
茶
}
;
\node
[anchor=west] (s4) at ([xshift=1.0em]s3.east)
{
茶
}
;
\node
[anchor=east] (s) at (s1.west)
{$
s
=
$}
;
\node
[anchor=east] (s) at (s1.west)
{$
s
=
$}
;
}
}
\end{scope}
\end{scope}
...
@@ -332,12 +334,12 @@
...
@@ -332,12 +334,12 @@
\end{center}
\end{center}
\end{minipage}
\end{minipage}
\item
<4->
\alert
{
优点
}
很多
\item
<4->
\alert
{
优点
}
很多
\begin{itemize}
\begin{itemize}
\item
翻译时候可以考虑更大范围的上下文信息
\\
\item
翻译时候可以考虑更大范围的上下文信息
\\
比如:"红茶"中的"红"如果和"茶"搭配
...
比如:"红茶"中的"红"如果和"茶"搭配 ...
\item
更好的局部调序,比如:短语中有"的"字
$
\to
$
... of ... 结构
\item
更好的局部调序,比如:短语中有"的"字
$
\to
$
... of ... 结构
\item
更大范围的目标语连续词串的使用,有利于
$
n
$
-gram语言模型选择译文
\item
更大范围的目标语连续词串的使用,有利于
$
n
$
-gram语言模型选择译文
\end{itemize}
\end{itemize}
\end{itemize}
\end{itemize}
...
@@ -345,14 +347,14 @@
...
@@ -345,14 +347,14 @@
\end{frame}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
\section
{
翻译中为什么要使用短语
}
\section
{
翻译中为什么要使用短语
}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
%%%
回顾基于词的翻译模型
%%%
回顾基于词的翻译模型
\begin{frame}
{
回顾 - 基于词的机器翻译
}
\begin{frame}
{
回顾 - 基于词的机器翻译
}
\begin{itemize}
\begin{itemize}
\item
对每个
\alert
{
单词
}
的翻译进行(任意)组合
\item
对每个
\alert
{
单词
}
的翻译进行(任意)组合
\end{itemize}
\end{itemize}
\vspace
{
-2em
}
\vspace
{
-2em
}
...
@@ -362,13 +364,13 @@
...
@@ -362,13 +364,13 @@
\begin{scope}
\begin{scope}
\node
[anchor=west] (s1) at (0,0)
{
\textbf
{
我
}
}
;
\node
[anchor=west] (s1) at (0,0)
{
\textbf
{
我
}
}
;
\node
[anchor=west] (s2) at ([xshift=2em]s1.east)
{
\textbf
{
对
}
}
;
\node
[anchor=west] (s2) at ([xshift=2em]s1.east)
{
\textbf
{
对
}
}
;
\node
[anchor=west] (s3) at ([xshift=2em]s2.east)
{
\textbf
{
你
}
}
;
\node
[anchor=west] (s3) at ([xshift=2em]s2.east)
{
\textbf
{
你
}
}
;
\node
[anchor=west] (s4) at ([xshift=2em]s3.east)
{
\textbf
{
表示
}}
;
\node
[anchor=west] (s4) at ([xshift=2em]s3.east)
{
\textbf
{
表示
}
}
;
\node
[anchor=west] (s5) at ([xshift=2em]s4.east)
{
\textbf
{
满意
}}
;
\node
[anchor=west] (s5) at ([xshift=2em]s4.east)
{
\textbf
{
满意
}
}
;
\node
[anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west)
{
\scriptsize
{
\textbf
{
\alert
{
待翻译句子(已经分词
):
}}}}
;
\node
[anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west)
{
\scriptsize
{
\textbf
{
\alert
{
待翻译句子(已经分词):
}}
}}
;
\draw
[->,very thick,ublue] (s1.south) -- ([yshift=-0.7em]s1.south);
\draw
[->,very thick,ublue] (s1.south) -- ([yshift=-0.7em]s1.south);
\draw
[->,very thick,ublue] (s2.south) -- ([yshift=-0.7em]s2.south);
\draw
[->,very thick,ublue] (s2.south) -- ([yshift=-0.7em]s2.south);
...
@@ -484,7 +486,7 @@
...
@@ -484,7 +486,7 @@
\begin{scope}
\begin{scope}
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=0em,xshift=-0.5em]t11.north west) -- ([xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label2)
{
\footnotesize
{
\textbf
{
单词翻译
}}}
;
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=0em,xshift=-0.5em]t11.north west) -- ([xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label2)
{
\footnotesize
{
\textbf
{
单词翻译
}}
}
;
\visible
<2->
{
\visible
<2->
{
\draw
[->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t22.west) -- ([xshift=0.8em]t22.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t52.west) -- ([xshift=1.2em]t52.east);
\draw
[->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t22.west) -- ([xshift=0.8em]t22.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t52.west) -- ([xshift=1.2em]t52.east);
...
@@ -497,16 +499,16 @@
...
@@ -497,16 +499,16 @@
}
}
\invisible
{
\invisible
{
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=-0.2em,xshift=-0.5em]t13.south west) -- ([yshift=-6.3em,xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label3)
{
\footnotesize
{
\textbf
{
短语翻译
}}}
;
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=-0.2em,xshift=-0.5em]t13.south west) -- ([yshift=-6.3em,xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label3)
{
\footnotesize
{
\textbf
{
短语翻译
}}
}
;
}
}
\visible
<2->
{
\visible
<2->
{
\node
[anchor=north west] (wtranslabel) at ([yshift=-4em]t15.south west)
{
\scriptsize
{
翻译路径(仅含有单词)
:
}}
;
\node
[anchor=north west] (wtranslabel) at ([yshift=-4em]t15.south west)
{
\scriptsize
{
翻译路径(仅含有单词):
}}
;
\draw
[->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1em]wtranslabel.east);
\draw
[->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1em]wtranslabel.east);
}
}
\invisible
{
\invisible
{
\node
[anchor=north west] (ptranslabel) at ([yshift=-5.5em]t15.south west)
{
\scriptsize
{
翻译路径(含有短语)
:
}}
;
\node
[anchor=north west] (ptranslabel) at ([yshift=-5.5em]t15.south west)
{
\scriptsize
{
翻译路径(含有短语):
}}
;
\draw
[->,ultra thick,ublue,line width=1.5pt,opacity=0.7] ([xshift=0.65em]ptranslabel.east) -- ([xshift=1.65em]ptranslabel.east);
\draw
[->,ultra thick,ublue,line width=1.5pt,opacity=0.7] ([xshift=0.65em]ptranslabel.east) -- ([xshift=1.65em]ptranslabel.east);
}
}
...
@@ -518,11 +520,11 @@
...
@@ -518,11 +520,11 @@
\end{frame}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
%%%
基于短语的翻译模型
%%%
基于短语的翻译模型
\begin{frame}
{
基于"短语"的机器翻译
}
\begin{frame}
{
基于"短语"的机器翻译
}
\begin{itemize}
\begin{itemize}
\item
对每个
\alert
{
单词
}
及
\alert
{
连续词串
}
的翻译进行(任意)组合
\item
对每个
\alert
{
单词
}
及
\alert
{
连续词串
}
的翻译进行(任意)组合
\end{itemize}
\end{itemize}
\vspace
{
-2em
}
\vspace
{
-2em
}
...
@@ -532,13 +534,13 @@
...
@@ -532,13 +534,13 @@
\begin{scope}
\begin{scope}
\node
[anchor=west] (s1) at (0,0)
{
\textbf
{
我
}
}
;
\node
[anchor=west] (s1) at (0,0)
{
\textbf
{
我
}
}
;
\node
[anchor=west] (s2) at ([xshift=2em]s1.east)
{
\textbf
{
对
}
}
;
\node
[anchor=west] (s2) at ([xshift=2em]s1.east)
{
\textbf
{
对
}
}
;
\node
[anchor=west] (s3) at ([xshift=2em]s2.east)
{
\textbf
{
你
}
}
;
\node
[anchor=west] (s3) at ([xshift=2em]s2.east)
{
\textbf
{
你
}
}
;
\node
[anchor=west] (s4) at ([xshift=2em]s3.east)
{
\textbf
{
表示
}}
;
\node
[anchor=west] (s4) at ([xshift=2em]s3.east)
{
\textbf
{
表示
}
}
;
\node
[anchor=west] (s5) at ([xshift=2em]s4.east)
{
\textbf
{
满意
}}
;
\node
[anchor=west] (s5) at ([xshift=2em]s4.east)
{
\textbf
{
满意
}
}
;
\node
[anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west)
{
\scriptsize
{
\textbf
{
\alert
{
待翻译句子(已经分词
):
}}}}
;
\node
[anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west)
{
\scriptsize
{
\textbf
{
\alert
{
待翻译句子(已经分词):
}}
}}
;
\draw
[->,very thick,ublue] (s1.south) -- ([yshift=-0.7em]s1.south);
\draw
[->,very thick,ublue] (s1.south) -- ([yshift=-0.7em]s1.south);
\draw
[->,very thick,ublue] (s2.south) -- ([yshift=-0.7em]s2.south);
\draw
[->,very thick,ublue] (s2.south) -- ([yshift=-0.7em]s2.south);
...
@@ -654,7 +656,7 @@
...
@@ -654,7 +656,7 @@
\begin{scope}
\begin{scope}
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=0em,xshift=-0.5em]t11.north west) -- ([xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label2)
{
\footnotesize
{
\textbf
{
单词翻译
}}}
;
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=0em,xshift=-0.5em]t11.north west) -- ([xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label2)
{
\footnotesize
{
\textbf
{
单词翻译
}}
}
;
\draw
[->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t22.west) -- ([xshift=0.8em]t22.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t52.west) -- ([xshift=1.2em]t52.east);
\draw
[->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t22.west) -- ([xshift=0.8em]t22.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t52.west) -- ([xshift=1.2em]t52.east);
...
@@ -667,14 +669,14 @@
...
@@ -667,14 +669,14 @@
}
}
\visible
<2->
{
\visible
<2->
{
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=-0.2em,xshift=-0.5em]t13.south west) -- ([yshift=-6.3em,xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label3)
{
\footnotesize
{
\textbf
{
短语翻译
}}}
;
\draw
[decorate,thick,decoration={brace,amplitude=5pt,mirror}]
([yshift=-0.2em,xshift=-0.5em]t13.south west) -- ([yshift=-6.3em,xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=1.0em,yshift=0.0em,text width=5em,align=left] (label3)
{
\footnotesize
{
\textbf
{
短语翻译
}}
}
;
}
}
\node
[anchor=north west] (wtranslabel) at ([yshift=-4em]t15.south west)
{
\scriptsize
{
翻译路径(仅含有单词)
:
}}
;
\node
[anchor=north west] (wtranslabel) at ([yshift=-4em]t15.south west)
{
\scriptsize
{
翻译路径(仅含有单词):
}}
;
\draw
[->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1em]wtranslabel.east);
\draw
[->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1em]wtranslabel.east);
\visible
<3->
{
\visible
<3->
{
\node
[anchor=north west] (ptranslabel) at ([yshift=-5.5em]t15.south west)
{
\scriptsize
{
翻译路径(含有短语)
:
}}
;
\node
[anchor=north west] (ptranslabel) at ([yshift=-5.5em]t15.south west)
{
\scriptsize
{
翻译路径(含有短语):
}}
;
\draw
[->,ultra thick,ublue,line width=1.5pt,opacity=0.7] ([xshift=0.65em]ptranslabel.east) -- ([xshift=1.65em]ptranslabel.east);
\draw
[->,ultra thick,ublue,line width=1.5pt,opacity=0.7] ([xshift=0.65em]ptranslabel.east) -- ([xshift=1.65em]ptranslabel.east);
}
}
...
...
This diff is collapsed.
Click to expand it.
Section06-Neural-Machine-Translation/section06-test.tex
查看文件 @
1e144093
...
@@ -145,170 +145,27 @@
...
@@ -145,170 +145,27 @@
\subsection
{
注意力机制
}
\subsection
{
注意力机制
}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
%%% 解码 -
beam search
%%% 解码 -
长度惩罚和覆盖度
\begin{frame}
{
推断 -
Beam Search
}
\begin{frame}
{
推断 -
其它特征
}
\begin{itemize}
\begin{itemize}
\item
\textbf
{
Greedy Search
}
: 目标语每一个位置,输出层的Softmax可以得到所有单词的概率,然后选择一个概率最大单词输出,下一个位置的预测就基于这一步输出的单词
\item
直接用
$
\textrm
{
P
}
(
\textbf
{
y
}
|
\textbf
{
x
}
)
$
进行解码,面临两方面问题
\item
\textbf
{
Beach Search
}
: 为了避免贪婪方法造成的错误累加,可以每次对
$
b
$
个单词进行扩展,而不是只使用一个单词,其中
$
b
$
称做束的宽度 - 这样可以搜索更多可能的译文
\begin{itemize}
\item
对
$
\textrm
{
P
}
(
y
_
j|
\textbf
{
y
}_{
<j
}
,
\textbf
{
x
}
)
$
进行乘积会导致长句的概率很低
\item
模型本身并没有考虑每个源语言单词被使用的程度,比如一个单词可能会被翻译了很多``次''
\end{itemize}
\item
<2-> 因此,解码时会使用其它特征与
$
\textrm
{
P
}
(
\textbf
{
y
}
|
\textbf
{
x
}
)
$
一起组成模型得分
$
score
(
\textbf
{
y
}
,
\textbf
{
x
}
)
$
,
$
score
(
\textbf
{
y
}
,
\textbf
{
x
}
)
$
也作为beam search的排序依据
\begin{eqnarray}
score(
\textbf
{
y
}
,
\textbf
{
x
}
)
&
=
&
\textrm
{
P
}
(
\textbf
{
y
}
|
\textbf
{
x
}
)/
\textrm
{
lp
}
(
\textbf
{
y
}
) +
\textrm
{
cp
}
(
\textbf
{
y
}
,
\textbf
{
x
}
)
\nonumber
\\
\textrm
{
lp
}
(
\textbf
{
y
}
)
&
=
&
\frac
{
(5 + |
\textbf
{
y
}
|)
^
\alpha
}{
(5 + 1)
^
\alpha
}
\nonumber
\\
\textrm
{
cp
}
(
\textbf
{
y
}
,
\textbf
{
x
}
)
&
=
&
\beta
\cdot
\sum\nolimits
_{
i=1
}^{
|
\textbf
{
x
}
|
}
\log
(
\min
(
\sum\nolimits
_{
j
}^{
|
\textbf
{
y
}
|
}
a
_{
ij
}
, 1)))
\nonumber
\end{eqnarray}
\vspace
{
-0.5em
}
\begin{itemize}
\item
lp会惩罚译文过短的结果(长度惩罚);cp会惩罚把某些源语单词对应到很多目标语单词的情况(覆盖度),被覆盖的程度用
$
\sum\nolimits
_{
j
}^{
|
\textbf
{
y
}
|
}
a
_{
ij
}$
度量;
$
\alpha
$
和
$
\beta
$
是超参,需要经验性设置
\end{itemize}
\end{itemize}
\end{itemize}
\vspace
{
-0.3em
}
\visible
<2->
{
\begin{center}
\begin{tikzpicture}
\begin{scope}
\tikzstyle
{
rnnnode
}
= [minimum height=1.1em,minimum width=3.5em,inner sep=2pt,rounded corners=1pt,draw,fill=red!20];
\tikzstyle
{
wnode
}
= [minimum height=1.0em,minimum width=3.5em,inner sep=2pt,rounded corners=1pt,draw,fill=white];
\visible
<3->
{
\node
[rnnnode,anchor=west,fill=green!20] (t1) at (0,0)
{
\tiny
{$
e
_
y
()
$}}
;
}
\visible
<7->
{
\node
[rnnnode,anchor=west,fill=green!20] (t2) at ([xshift=2.2em]t1.east)
{
\tiny
{$
e
_
y
()
$
(
$
\times
3
$
)
}}
;
}
\visible
<8->
{
\node
[rnnnode,anchor=west,fill=green!20] (t3) at ([xshift=2.2em]t2.east)
{
\tiny
{$
e
_
y
()
$
(
$
\times
3
$
)
}}
;
\node
[anchor=west,inner sep=2pt] (t4) at ([xshift=0.3em]t3.east)
{
\tiny
{
...
}}
;
}
\visible
<3->
{
\node
[rnnnode,anchor=south] (s1) at ([yshift=1em]t1.north)
{
\tiny
{$
\textbf
{
s
}_
1
$}}
;
}
\visible
<7->
{
\node
[rnnnode,anchor=south] (s2) at ([yshift=1em]t2.north)
{
\tiny
{$
\textbf
{
s
}_
2
$
(
$
\times
3
$
)
}}
;
}
\visible
<8->
{
\node
[rnnnode,anchor=south] (s3) at ([yshift=1em]t3.north)
{
\tiny
{$
\textbf
{
s
}_
3
$
(
$
\times
3
$
)
}}
;
\node
[anchor=west,inner sep=2pt] (s4) at ([xshift=0.3em]s3.east)
{
\tiny
{
...
}}
;
}
\visible
<3->
{
\node
[rnnnode,anchor=south,fill=blue!20] (o1) at ([yshift=1em]s1.north)
{
\tiny
{
softmax
}}
;
}
\visible
<7->
{
\node
[rnnnode,anchor=south,fill=blue!20] (o2) at ([yshift=1em]s2.north)
{
\tiny
{
softmax (
$
\times
3
$
)
}}
;
}
\visible
<8->
{
\node
[rnnnode,anchor=south,fill=blue!20] (o3) at ([yshift=1em]s3.north)
{
\tiny
{
softmax (
$
\times
3
$
)
}}
;
\node
[anchor=west,inner sep=2pt] (o4) at ([xshift=0.3em]o3.east)
{
\tiny
{
...
}}
;
}
\node
[wnode,anchor=north] (wt1) at ([yshift=-0.8em]t1.south)
{
\tiny
{
EOS
}}
;
\visible
<6->
{
\node
[wnode,anchor=north] (wt2) at ([yshift=-0.8em]t2.south)
{
\tiny
{
Have
}}
;
\node
[wnode,anchor=north] (wt2copy1) at ([xshift=-0.2em,yshift=-0.2em]wt2.north)
{
\tiny
{
Have
}}
;
\node
[wnode,anchor=north] (wt2copy2) at ([xshift=-0.4em,yshift=-0.4em]wt2.north)
{
\tiny
{
Have
}}
;
}
\visible
<8->
{
\node
[wnode,anchor=north,inner sep=2pt] (wt3) at ([yshift=-0.8em]t3.south)
{
\tiny
{
you
}}
;
\node
[wnode,anchor=north] (wt3copy1) at ([xshift=-0.2em,yshift=-0.2em]wt3.north)
{
\tiny
{
you
}}
;
\node
[wnode,anchor=north] (wt3copy2) at ([xshift=-0.4em,yshift=-0.4em]wt3.north)
{
\tiny
{
you
}}
;
}
\visible
<5->
{
\node
[wnode,anchor=center,inner sep=2pt] (wo1) at ([xshift=0.4em,yshift=1.8em]o1.north)
{
\tiny
{
Have
}}
;
\node
[wnode,anchor=north] (wo1copy1) at ([xshift=-0.2em,yshift=-0.2em]wo1.north)
{
\tiny
{
Have
}}
;
\node
[wnode,anchor=north] (wo1copy2) at ([xshift=-0.4em,yshift=-0.4em]wo1.north)
{
\tiny
{
Have
}}
;
}
\visible
<8->
{
\node
[wnode,anchor=center,inner sep=2pt] (wo2) at ([xshift=0.4em,yshift=1.8em]o2.north)
{
\tiny
{
you
}}
;
\node
[wnode,anchor=north] (wo2copy1) at ([xshift=-0.2em,yshift=-0.2em]wo2.north)
{
\tiny
{
you
}}
;
\node
[wnode,anchor=north] (wo2copy2) at ([xshift=-0.4em,yshift=-0.4em]wo2.north)
{
\tiny
{
you
}}
;
}
\visible
<8->
{
\node
[wnode,anchor=center,inner sep=2pt] (wo3) at ([xshift=0.4em,yshift=1.8em]o3.north)
{
\tiny
{
learned
}}
;
\node
[wnode,anchor=north] (wo3copy1) at ([xshift=-0.2em,yshift=-0.2em]wo3.north)
{
\tiny
{
learned
}}
;
\node
[wnode,anchor=north] (wo3copy2) at ([xshift=-0.4em,yshift=-0.4em]wo3.north)
{
\tiny
{
learned
}}
;
}
\visible
<3->
{
\foreach
\x
in
{
1
}{
\draw
[->] ([yshift=-0.7em]t
\x
.south) -- ([yshift=-0.1em]t
\x
.south);
\draw
[->] ([yshift=0.1em]t
\x
.north) -- ([yshift=-0.1em]s
\x
.south);
\draw
[->] ([yshift=0.1em]s
\x
.north) -- ([yshift=-0.1em]o
\x
.south);
}
}
\visible
<5->
{
\draw
[->] ([yshift=0.1em]o1.north) -- ([yshift=0.8em]o1.north) node [pos=0.5,right]
{
\tiny
{
top-3
}}
;
}
\visible
<7->
{
\foreach
\x
in
{
2
}{
\draw
[->] ([yshift=-0.7em]t
\x
.south) -- ([yshift=-0.1em]t
\x
.south);
\draw
[->] ([yshift=0.1em]t
\x
.north) -- ([yshift=-0.1em]s
\x
.south);
\draw
[->] ([yshift=0.1em]s
\x
.north) -- ([yshift=-0.1em]o
\x
.south);
\draw
[->] ([yshift=0.1em]o
\x
.north) -- ([yshift=0.8em]o
\x
.north) node [pos=0.5,right]
{
\tiny
{
top-3
}}
;
}
}
\visible
<8->
{
\foreach
\x
in
{
3
}{
\draw
[->] ([yshift=-0.7em]t
\x
.south) -- ([yshift=-0.1em]t
\x
.south);
\draw
[->] ([yshift=0.1em]t
\x
.north) -- ([yshift=-0.1em]s
\x
.south);
\draw
[->] ([yshift=0.1em]s
\x
.north) -- ([yshift=-0.1em]o
\x
.south);
\draw
[->] ([yshift=0.1em]o
\x
.north) -- ([yshift=0.8em]o
\x
.north) node [pos=0.5,right]
{
\tiny
{
top-3
}}
;
}
}
\visible
<3->
{
\draw
[->] ([xshift=-0.5em]s1.west) -- ([xshift=-0.1em]s1.west) node [pos=0,left,inner sep=1pt]
{
\tiny
{
0
}}
;
}
\visible
<7->
{
\draw
[->] ([xshift=0.1em]s1.east) -- ([xshift=-0.1em]s2.west);
}
\visible
<8->
{
\draw
[->] ([xshift=0.1em]s2.east) -- ([xshift=-0.1em]s3.west);
}
\visible
<6->
{
\draw
[->,very thick,dotted] (wo1.east) .. controls +(east:0.6) and +(west:0.8) ..(wt2copy2.west);
}
\visible
<8->
{
\draw
[->,very thick,dotted] (wo2.east) .. controls +(east:0.6) and +(west:0.8) ..(wt3copy2.west);
}
\visible
<7->
{
\node
[circle,draw,anchor=north,inner sep=2pt,fill=orange!20] (c2) at ([yshift=-2.5em]t1.south)
{
\tiny
{$
\textbf
{
C
}_
2
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c2copy1) at ([yshift=-0.1em,xshift=-0.1em]c2)
{
\tiny
{$
\textbf
{
C
}_
2
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c2copy2) at ([yshift=-0.2em,xshift=-0.2em]c2)
{
\tiny
{$
\textbf
{
C
}_
2
$}}
;
\draw
[->] ([xshift=-0.9em]c2.west) -- ([xshift=-0.3em]c2.west);
\draw
[->] ([xshift=0.1em]c2.east) .. controls +(east:1.5) and +(west:0.8) ..([yshift=-0.3em,xshift=-0.1em]s2.west);
}
\visible
<8->
{
\node
[circle,draw,anchor=north,inner sep=2pt,fill=orange!20] (c3) at ([yshift=-2.5em]t2.south)
{
\tiny
{$
\textbf
{
C
}_
3
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c3copy1) at ([yshift=-0.1em,xshift=-0.1em]c3)
{
\tiny
{$
\textbf
{
C
}_
3
$}}
;
\node
[circle,draw,inner sep=2pt,fill=orange!20] (c3copy2) at ([yshift=-0.2em,xshift=-0.2em]c3)
{
\tiny
{$
\textbf
{
C
}_
3
$}}
;
\draw
[->] ([xshift=-0.9em]c3.west) -- ([xshift=-0.3em]c3.west);
\draw
[->] ([xshift=0.1em]c3.east) .. controls +(east:1.5) and +(west:0.8) ..([yshift=-0.3em,xshift=-0.1em]s3.west);
}
\visible
<3->
{
\node
[anchor=east] (vocab) at ([xshift=-5em]s1.west)
{
\tiny
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
&
0
.
50
\\
\textrm
{
I
}
&
0
.
02
\\
\textrm
{
it
}
&
0
.
03
\\
\textrm
{
has
}
&
0
.
30
\\
\textrm
{
you
}
&
0
.
01
\\
\textrm
{
the
}
&
0
.
01
\\
\textrm
{
a
}
&
0
.
01
\\
\textrm
{
an
}
&
0
.
02
\\
\textrm
{
he
}
&
0
.
03
\\
\textrm
{
she
}
&
0
.
01
\\
\textrm
{
are
}
&
0
.
00
\\
\textrm
{
am
}
&
0
.
01
\\
...
&
...
\end
{
bmatrix
}$}}
;
\node
[anchor=south] (vocablabel) at (vocab.north)
{
\tiny
{
单词的概率分布
}}
;
\draw
[->,red,very thick,dotted] (o1.west) .. controls +(west:1) and +(east:2) .. ([yshift=1em]vocab.south east);
}
\visible
<4->
{
\node
[anchor=east,inner sep=1pt] (vocabtopn) at ([xshift=-0.5em,yshift=-0.5em]wo1.west)
{
\tiny
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
\\
\textrm
{
has
}
\\
\textrm
{
it
}
\end
{
bmatrix
}$}}
;
\draw
[->] ([yshift=-1.6em,xshift=-0.4em]vocab.north east) .. controls +(east:1) and +(west:1) .. ([xshift=0.1em,yshift=0.4em]vocabtopn.west) node [pos=0.3,below] (topnlabel)
{
\tiny
{
top-3
}}
;
\visible
<4->
{
\node
[anchor=north] (cap) at (vocab.south east)
{
\scriptsize
{
\textbf
{
束搜索(
$
b
=
3
$
)
}}}
;
}
}
\end{scope}
\end{tikzpicture}
\end{center}
}
\end{frame}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Section06-Neural-Machine-Translation/section06.tex
查看文件 @
1e144093
...
@@ -505,7 +505,7 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\
...
@@ -505,7 +505,7 @@ NLP问题的隐含结构假设 & 无隐含结构假设,端到端学习 \\
\node
[wordnode,below=0pt of emb3]
(word3)
{
好
}
;
\node
[wordnode,below=0pt of emb3]
(word3)
{
好
}
;
\draw
[-latex']
(emb3.north) to (rnn3.south);
\draw
[-latex']
(emb3.north) to (rnn3.south);
\draw
[-latex']
(rnn2.east) to (rnn3.west);
\draw
[-latex']
(rnn2.east) to (rnn3.west);
\node
[rnnnode,fill=blue!30!white,right=\base of rnn3]
(rnn4)
{}
;
\node
[rnnnode,fill=blue!30!white,right=\base of rnn3]
(rnn4)
{}
;
\node
[rnnnode,fill=green!30!white,below=\base of rnn4]
(emb4)
{}
;
\node
[rnnnode,fill=green!30!white,below=\base of rnn4]
(emb4)
{}
;
\node
[wordnode,below=0pt of emb4]
(word4)
{
EOS
}
;
\node
[wordnode,below=0pt of emb4]
(word4)
{
EOS
}
;
...
@@ -2355,7 +2355,7 @@ $\textrm{``you''} = \argmax_{y} \textrm{P}(y|\textbf{s}_1, \alert{\textbf{C}})$
...
@@ -2355,7 +2355,7 @@ $\textrm{``you''} = \argmax_{y} \textrm{P}(y|\textbf{s}_1, \alert{\textbf{C}})$
\draw
[->] ([yshift=-0.7em]t
\x
.south) -- ([yshift=-0.1em]t
\x
.south);
\draw
[->] ([yshift=-0.7em]t
\x
.south) -- ([yshift=-0.1em]t
\x
.south);
\draw
[->] ([yshift=0.1em]t
\x
.north) -- ([yshift=-0.1em]s
\x
.south);
\draw
[->] ([yshift=0.1em]t
\x
.north) -- ([yshift=-0.1em]s
\x
.south);
\draw
[->] ([yshift=0.1em]s
\x
.north) -- ([yshift=-0.1em]o
\x
.south);
\draw
[->] ([yshift=0.1em]s
\x
.north) -- ([yshift=-0.1em]o
\x
.south);
}
}
}
}
...
@@ -2417,7 +2417,7 @@ $\textrm{``you''} = \argmax_{y} \textrm{P}(y|\textbf{s}_1, \alert{\textbf{C}})$
...
@@ -2417,7 +2417,7 @@ $\textrm{``you''} = \argmax_{y} \textrm{P}(y|\textbf{s}_1, \alert{\textbf{C}})$
\visible
<3->
{
\visible
<3->
{
\node
[anchor=east] (vocab) at ([xshift=-5em]s1.west)
{
\tiny
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
&
0
.
50
\\
\textrm
{
I
}
&
0
.
02
\\
\textrm
{
it
}
&
0
.
03
\\
\textrm
{
has
}
&
0
.
30
\\
\textrm
{
you
}
&
0
.
01
\\
\textrm
{
the
}
&
0
.
01
\\
\textrm
{
a
}
&
0
.
01
\\
\textrm
{
an
}
&
0
.
02
\\
\textrm
{
he
}
&
0
.
03
\\
\textrm
{
she
}
&
0
.
01
\\
\textrm
{
are
}
&
0
.
00
\\
\textrm
{
am
}
&
0
.
01
\\
...
&
...
\end
{
bmatrix
}$}}
;
\node
[anchor=east] (vocab) at ([xshift=-5em]s1.west)
{
\tiny
{$
\begin
{
bmatrix
}
\textrm
{
Have
}
&
0
.
50
\\
\textrm
{
I
}
&
0
.
02
\\
\textrm
{
it
}
&
0
.
03
\\
\textrm
{
has
}
&
0
.
30
\\
\textrm
{
you
}
&
0
.
01
\\
\textrm
{
the
}
&
0
.
01
\\
\textrm
{
a
}
&
0
.
01
\\
\textrm
{
an
}
&
0
.
02
\\
\textrm
{
he
}
&
0
.
03
\\
\textrm
{
she
}
&
0
.
01
\\
\textrm
{
are
}
&
0
.
00
\\
\textrm
{
am
}
&
0
.
01
\\
...
&
...
\end
{
bmatrix
}$}}
;
\node
[anchor=south] (vocablabel) at (vocab.north)
{
\tiny
{
单词的概率分布
}}
;
\node
[anchor=south] (vocablabel) at (vocab.north)
{
\tiny
{
单词的概率分布
}}
;
\draw
[->,red,very thick,dotted] (o1.west) .. controls +(west:1) and +(east:2) .. ([yshift=1em]vocab.south east);
\draw
[->,red,very thick,dotted] (o1.west) .. controls +(west:1) and +(east:2) .. ([yshift=1em]vocab.south east);
}
}
\visible
<4->
{
\visible
<4->
{
...
@@ -2438,6 +2438,30 @@ $\textrm{``you''} = \argmax_{y} \textrm{P}(y|\textbf{s}_1, \alert{\textbf{C}})$
...
@@ -2438,6 +2438,30 @@ $\textrm{``you''} = \argmax_{y} \textrm{P}(y|\textbf{s}_1, \alert{\textbf{C}})$
\end{frame}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%%------------------------------------------------------------------------------------------------------------
%%% 解码 - 长度惩罚和覆盖度
\begin{frame}
{
推断 - 其它特征
}
\begin{itemize}
\item
直接用
$
\textrm
{
P
}
(
\textbf
{
y
}
|
\textbf
{
x
}
)
$
进行解码,面临两方面问题
\begin{itemize}
\item
对
$
\textrm
{
P
}
(
y
_
j|
\textbf
{
y
}_{
<j
}
,
\textbf
{
x
}
)
$
进行乘积会导致长句的概率很低
\item
模型本身并没有考虑每个源语言单词被使用的程度,比如一个单词可能会被翻译了很多``次''
\end{itemize}
\item
<2-> 因此,解码时会使用其它特征与
$
\textrm
{
P
}
(
\textbf
{
y
}
|
\textbf
{
x
}
)
$
一起组成模型得分
$
score
(
\textbf
{
y
}
,
\textbf
{
x
}
)
$
,
$
score
(
\textbf
{
y
}
,
\textbf
{
x
}
)
$
也作为beam search的排序依据
\begin{eqnarray}
score(
\textbf
{
y
}
,
\textbf
{
x
}
)
&
=
&
\textrm
{
P
}
(
\textbf
{
y
}
|
\textbf
{
x
}
)/
\textrm
{
lp
}
(
\textbf
{
y
}
) +
\textrm
{
cp
}
(
\textbf
{
y
}
,
\textbf
{
x
}
)
\nonumber
\\
\textrm
{
lp
}
(
\textbf
{
y
}
)
&
=
&
\frac
{
(5 + |
\textbf
{
y
}
|)
^
\alpha
}{
(5 + 1)
^
\alpha
}
\nonumber
\\
\textrm
{
cp
}
(
\textbf
{
y
}
,
\textbf
{
x
}
)
&
=
&
\beta
\cdot
\sum\nolimits
_{
i=1
}^{
|
\textbf
{
x
}
|
}
\log
(
\min
(
\sum\nolimits
_{
j
}^{
|
\textbf
{
y
}
|
}
a
_{
ij
}
, 1)))
\nonumber
\end{eqnarray}
\vspace
{
-0.5em
}
\begin{itemize}
\item
lp会惩罚译文过短的结果(长度惩罚);cp会惩罚把某些源语单词对应到很多目标语单词的情况(覆盖度),被覆盖的程度用
$
\sum\nolimits
_{
j
}^{
|
\textbf
{
y
}
|
}
a
_{
ij
}$
度量;
$
\alpha
$
和
$
\beta
$
是超参,需要经验性设置
\end{itemize}
\end{itemize}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 实验结果
%%% 实验结果
\begin{frame}
{
效果
}
\begin{frame}
{
效果
}
%% 实用注意力机制带来的提升
%% 实用注意力机制带来的提升
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论