section04.tex 347 KB
Newer Older
xiaotong committed
1 2
% !Mode:: "TeX:UTF-8"
% !TEX encoding = UTF-8 Unicode
xiaotong committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{beamer}
\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}

19 20 21
\usepackage{tcolorbox}
\tcbuselibrary{skins}

xiaotong committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
\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{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}

xiaotong committed
49 50
\definecolor{darkred}{rgb}{0.55, 0.0, 0.0}
\definecolor{alizarin}{rgb}{0.82, 0.1, 0.26}
xiaotong committed
51 52 53 54
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\setbeamercolor{uppercolblue}{fg=white,bg=ublue}
\setbeamercolor{lowercolblue}{fg=black,bg=blue!10}

55 56 57 58 59 60
\newlength{\mystep}
\newlength{\base}
\newlength{\wseg}
\newlength{\hseg}
\newlength{\wnode}
\newlength{\hnode}
xiaotong committed
61 62 63

\usefonttheme[onlylarge]{structurebold}

xiaotong committed
64 65 66 67 68
\IfFileExists{C:/WINDOWS/win.ini}
{\newcommand{\mycfont}{you}}
{\newcommand{\mycfont}{gbsn}}

\begin{CJK}{UTF8}{\mycfont}
xiaotong committed
69 70 71
\end{CJK}

\setbeamerfont*{frametitle}{size=\large,series=\bfseries}
xiaotong committed
72
\setbeamertemplate{navigation symbols}{\begin{CJK}{UTF8}{\mycfont} 第四章 基于短语和句法的统计翻译模型 \hspace*{2em} 肖桐\&朱靖波 \end{CJK} \hspace*{2em} \today \hspace*{2em} \insertframenumber{}/\inserttotalframenumber}
xiaotong committed
73 74 75 76 77 78 79

\setbeamertemplate{itemize items}[circle] % if you want a circle
\setbeamertemplate{itemize subitem}[triangle] % if you wnat a triangle
\setbeamertemplate{itemize subsubitem}[ball] % if you want a ball

\begin{document}

xiaotong committed
80
\begin{CJK}{UTF8}{\mycfont}
xiaotong committed
81

82
\title{\Large{基于短语和句法的统计翻译模型}}
xiaotong committed
83
\author{\large{\textbf{肖桐\ \ 朱靖波}}}
xiaotong committed
84 85 86 87
\institute{
\blue{\url{xiaotong@mail.neu.edu.cn}} \black{} \\
\blue{\url{zhujingbo@mail.neu.edu.cn}} \black{} \\
\vspace{1.0em}
xiaotong committed
88
东北大学 自然语言处理实验室 \\
xiaotong committed
89 90 91 92 93 94 95 96 97 98 99 100
\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}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
101
\section{使用更大的翻译单元}
xiaotong committed
102 103

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
104 105
%%% 基于单词的模型的问题
\begin{frame}{基于单词有哪些问题}
xiaotong committed
106 107 108

\begin{itemize}

xiaotong committed
109
\item 基于单词的翻译模型有哪些\alert{优点}
xiaotong committed
110
    \begin{itemize}
xiaotong committed
111
    \item 比较符合人的思维、简单直接、易于实现
xiaotong committed
112 113 114 115 116 117 118 119
    \end{itemize}

    \vspace{0.3em}

    \begin{minipage}[t]{0.40\linewidth}
    \begin{center}
    {\scriptsize
    \begin{tabular}{l | l}
xiaotong committed
120 121 122 123 124
    单词翻译表 & P \\ \hline
$\to$ I & 0.6 \\
    喜欢 $\to$ like & 0.3 \\
    绿 $\to$ green & 0.9 \\
$\to$ tea & 0.8 \\
xiaotong committed
125 126 127 128 129 130 131 132 133
    \end{tabular}
    }
    \end{center}
    \end{minipage}
    \begin{minipage}[c]{0.58\linewidth}
    \begin{tikzpicture}

    \begin{scope}
    {\footnotesize
xiaotong committed
134 135 136 137
    \node [anchor=west] (s1) at (0,0) {};
    \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] (s4) at ([xshift=1.0em]s3.east) {};
xiaotong committed
138
    \node [anchor=east] (s) at (s1.west) {$\textbf{s}=$};
xiaotong committed
139 140 141 142 143 144 145 146 147 148
    }
    \end{scope}

    \visible<2->{
    \begin{scope}[yshift=-2.0em]
    {\footnotesize
    \node [anchor=west] (t1) at (0.35em,0) {I};
    \node [anchor=west] (t2) at ([xshift=0.8em,yshift=-0.0em]t1.east) {like};
    \node [anchor=west] (t3) at ([xshift=1.0em,yshift=-0.2em]t2.east) {green};
    \node [anchor=west] (t4) at ([xshift=0.8em,yshift=0.1em]t3.east) {tea};
xiaotong committed
149
    \node [anchor=east] (t) at ([xshift=-0.3em]t1.west) {$\textbf{t}=$};
xiaotong committed
150 151 152 153 154 155 156 157 158 159 160 161 162 163
    }
    \end{scope}

    \draw [-] (s1.south) -- (t1.north);
    \draw [-] (s2.south) ..controls +(south:0.5em) and +(north:0.5em).. (t2.north);
    \draw [-] (s3.south) ..controls +(south:0.5em) and +(north:0.5em).. (t3.north);
    \draw [-] (s4.south) -- (t4.north);
    }%visible<2->

    \end{tikzpicture}
    \end{minipage}

\vspace{0.5em}

xiaotong committed
164
\item<3-> 基于单词的翻译模型有哪些\alert{不足}
xiaotong committed
165
    \begin{itemize}
xiaotong committed
166
    \item 需要定义词是什么
xiaotong committed
167 168
    \item 独立性假设:单词之间相对独立,没有考虑搭配
    \item 调序:较弱的调序建模
xiaotong committed
169 170 171 172 173 174 175 176 177
    \item ...
    \end{itemize}

    \vspace{-0.5em}

    \begin{minipage}[t]{0.40\linewidth}
    \begin{center}
    {\scriptsize
    \begin{tabular}{l | l}
xiaotong committed
178 179 180 181 182 183
    单词翻译表 & P \\ \hline
$\to$ I & 0.6 \\
    喜欢 $\to$ like & 0.3 \\
$\to$ red & 0.8 \\
$\to$ black & 0.1 \\
$\to$ tea & 0.8\\
xiaotong committed
184 185 186 187 188 189 190 191 192 193
    \end{tabular}
    }
    \end{center}
    \end{minipage}
    \begin{minipage}[c]{0.58\linewidth}
    \vspace{1em}
    \begin{tikzpicture}

    \begin{scope}
    {\footnotesize
xiaotong committed
194 195 196 197
    \node [anchor=west] (s1) at (0,0) {};
    \node [anchor=west] (s2) at ([xshift=1.0em]s1.east) {喜欢};
    \node [anchor=west] (s3) at ([xshift=1.0em]s2.east) {\alert{}};
    \node [anchor=west] (s4) at ([xshift=1.0em]s3.east) {};
xiaotong committed
198
    \node [anchor=east] (s) at (s1.west) {$\textbf{s}=$};
xiaotong committed
199 200 201 202 203 204 205 206 207 208
    }
    \end{scope}

    \visible<4->{
    \begin{scope}[yshift=-2.0em]
    {\footnotesize
    \node [anchor=west] (t1) at (0.35em,0) {I};
    \node [anchor=west] (t2) at ([xshift=0.8em,yshift=-0.0em]t1.east) {like};
    \node [anchor=west] (t3) at ([xshift=1.0em,yshift=-0.0em]t2.east) {red};
    \node [anchor=west] (t4) at ([xshift=1.0em,yshift=-0.1em]t3.east) {tea};
xiaotong committed
209
    \node [anchor=east] (t) at ([xshift=-0.3em]t1.west) {$\textbf{t}=$};
xiaotong committed
210 211 212 213 214 215 216 217 218 219 220 221
    }
    \end{scope}

    \draw [-] (s1.south) -- (t1.north);
    \draw [-] (s2.south) ..controls +(south:0.5em) and +(north:0.5em).. (t2.north);
    \draw [-] (s3.south) ..controls +(south:0.5em) and +(north:0.5em).. (t3.north);
    \draw [-] (s4.south) ..controls +(south:0.5em) and +(north:0.5em).. (t4.north);
    }%visible<4->

    \begin{pgfonlayer}{background}
    \visible<5->{
    \node [rectangle,draw=red,thick,inner sep=0.2em,fill=white,drop shadow] [fit = (t3) (t4)] (problemphrase) {};
xiaotong committed
222
    \node [anchor=north,red,text width=8em,align=left] (problemlabel) at (problemphrase.south) {\begin{spacing}{0.8}\scriptsize{"红 茶"为一种搭配,应该翻译为"black tea"}\end{spacing}};
xiaotong committed
223 224 225 226 227 228 229 230 231 232 233
    }%\visible<5->
    \end{pgfonlayer}

    \end{tikzpicture}
    \end{minipage}

\end{itemize}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
234 235
%%% 引入短语翻译
\begin{frame}{引入更大的翻译单元}
xiaotong committed
236 237

\begin{itemize}
xiaotong committed
238
\item 简单的单词翻译似乎不行?\visible<2->{\alert{- 引入更大的翻译单元}}
xiaotong committed
239 240 241 242 243

    \begin{minipage}[t]{0.40\linewidth}
    \begin{center}
    {\scriptsize
    \begin{tabular}{l | l}
xiaotong committed
244 245 246 247 248 249 250 251 252 253 254
    \only<1>{单词翻译表}\only<2->{\alert{\sout{单词}}词串翻译表} & P \\ \hline
$\to$ I & 0.6 \\
    喜欢 $\to$ like & 0.3 \\
$\to$ red & 0.8 \\
$\to$ black & 0.1 \\
$\to$ tea & 0.8\\
    \visible<2->{我 喜欢 $\to$ I like & 0.3\\
    我 喜欢 $\to$ I liked & 0.2\\
    绿 茶 $\to$ green tea & 0.5\\
    绿 茶 $\to$ the green tea & 0.1\\
    红 茶 $\to$ black tea & 0.6\\
xiaotong committed
255 256 257 258 259 260 261 262 263 264 265 266 267
    ... & }
    \end{tabular}
    }
    \end{center}
    \end{minipage}
    \begin{minipage}[c]{0.55\linewidth}
    \vspace{1em}
    \begin{center}
    \begin{tikzpicture}

    \begin{scope}
    \begin{scope}
    {\footnotesize
xiaotong committed
268 269 270 271
    \node [anchor=west] (s1) at (0,0) {};
    \node [anchor=west] (s2) at ([xshift=1.0em]s1.east) {喜欢};
    \node [anchor=west] (s3) at ([xshift=1.0em]s2.east) {\alert{}};
    \node [anchor=west] (s4) at ([xshift=1.0em]s3.east) {};
xiaotong committed
272
    \node [anchor=east] (s) at (s1.west) {$\textbf{s}=$};
xiaotong committed
273 274 275 276 277 278 279 280 281
    }
    \end{scope}

    \begin{scope}[yshift=-3.0em]
    {\small
    \node [anchor=west] (t1) at (0.30em,0) {I};
    \node [anchor=west] (t2) at ([xshift=0.8em,yshift=-0.0em]t1.east) {like};
    \node [anchor=west] (t3) at ([xshift=0.6em,yshift=-0.0em]t2.east) {red};
    \node [anchor=west] (t4) at ([xshift=1.0em,yshift=-0.1em]t3.east) {tea};
xiaotong committed
282
    \node [anchor=east] (t) at ([xshift=-0.3em]t1.west) {$\textbf{t}=$};
xiaotong committed
283 284 285 286 287 288 289 290 291 292 293 294 295 296
    }
    \end{scope}


    \draw [-] (s1.south) -- (t1.north);
    \draw [-] (s2.south) ..controls +(south:1.0em) and +(north:1.0em).. (t2.north);
    \draw [-] (s3.south) ..controls +(south:1.0em) and +(north:1.0em).. (t3.north);
    \draw [-] (s4.south) -- (t4.north);

    \node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=2pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (head1) at ([xshift=2.5em,yshift=-0.5em]s4.south east) {{\color{red} \small{\textbf{No}}}};

    \end{scope}

    \visible<3->{
xiaotong committed
297
    \begin{scope}[yshift=-5.0em]
xiaotong committed
298 299
    \begin{scope}
    {\footnotesize
xiaotong committed
300 301 302 303
    \node [anchor=west] (s1) at (0,0) {};
    \node [anchor=west] (s2) at ([xshift=1.0em]s1.east) {喜欢};
    \node [anchor=west] (s3) at ([xshift=1.0em]s2.east) {\alert{}};
    \node [anchor=west] (s4) at ([xshift=1.0em]s3.east) {};
xiaotong committed
304
    \node [anchor=east] (s) at (s1.west) {$\textbf{s}=$};
xiaotong committed
305 306 307 308 309 310 311 312 313
    }
    \end{scope}

    \begin{scope}[yshift=-3.0em]
    {\small
    \node [anchor=west] (t1) at (0.30em,0) {I};
    \node [anchor=west] (t2) at ([xshift=0.8em,yshift=-0.0em]t1.east) {like};
    \node [anchor=west] (t3) at ([xshift=0.6em,yshift=-0.0em]t2.east) {black};
    \node [anchor=west] (t4) at ([xshift=1.0em,yshift=-0.1em]t3.east) {tea};
xiaotong committed
314
    \node [anchor=east] (t) at ([xshift=-0.3em]t1.west) {$\textbf{t}=$};
xiaotong committed
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
    }
    \end{scope}

    \begin{pgfonlayer}{background}
    \visible<3->{
    \node [rectangle,draw=red,thick,inner sep=0.0em,fill=white] [fit = (s3) (s4)] (sphrase1) {};
    \node [rectangle,draw=black,thick,inner sep=0.0em,fill=white] [fit = (t3) (t4)] (tphrase1) {};
    }
    \end{pgfonlayer}

    \draw [-] (s1.south) -- (t1.north);
    \draw [-] (s2.south) ..controls +(south:1.0em) and +(north:1.0em).. (t2.north);
    \draw [-] (sphrase1.south) ..controls +(south:1.0em) and +(north:1.0em).. ([xshift=-1em]tphrase1.north);

    \node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (head1) at ([xshift=2.5em,yshift=-0.5em]s4.south east) {{\color{ugreen} \small{\textbf{Yes}}}};

    \end{scope}
    }

    \end{tikzpicture}
    \end{center}
    \end{minipage}

xiaotong committed
338
\item<4-> \alert{优点}
xiaotong committed
339
    \begin{itemize}
xiaotong committed
340 341 342 343
    \item 翻译时候可以考虑更大范围的上下文信息\\
          比如:"红茶"中的"红"如果和"茶"搭配 ...
    \item 更好的局部调序,比如:短语中有"的"字 $\to$ ... of ... 结构
    \item 更大范围的目标语连续词串的使用,有利于$n$-gram语言模型选择译文
xiaotong committed
344 345 346 347 348 349 350
    \end{itemize}

\end{itemize}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
351
\section{翻译中为什么要使用短语}
xiaotong committed
352 353

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
354 355
%%% 回顾基于词的翻译模型
\begin{frame}{回顾 - 基于词的机器翻译}
xiaotong committed
356 357

\begin{itemize}
xiaotong committed
358
\item 对每个\alert{单词}的翻译进行(任意)组合
xiaotong committed
359 360 361 362 363 364 365 366 367
\end{itemize}

\vspace{-2em}

\begin{flushright}
\begin{tikzpicture}

\begin{scope}

xiaotong committed
368 369 370 371 372
\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{满意}};
xiaotong committed
373

xiaotong committed
374
\node [anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west) {\scriptsize{\textbf{\alert{待翻译句子(已经分词):}}}};
xiaotong committed
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489

\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}


xiaotong committed
490
\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{单词翻译}}};
xiaotong committed
491 492 493 494 495 496 497 498 499 500 501 502

\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{
xiaotong committed
503
\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{短语翻译}}};
xiaotong committed
504 505 506
}

\visible<2->{
xiaotong committed
507
\node [anchor=north west] (wtranslabel) at ([yshift=-4em]t15.south west) {\scriptsize{翻译路径(仅含有单词):}};
xiaotong committed
508 509 510 511
\draw [->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1em]wtranslabel.east);
}

\invisible{
xiaotong committed
512
\node [anchor=north west] (ptranslabel) at ([yshift=-5.5em]t15.south west) {\scriptsize{翻译路径(含有短语):}};
xiaotong committed
513 514 515 516 517 518 519 520 521 522 523
\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}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
524
%%% 基于短语的翻译模型
xiaotong committed
525
\begin{frame}{基于``短语''的机器翻译}
xiaotong committed
526 527

\begin{itemize}
xiaotong committed
528
\item 对每个\alert{单词}\alert{连续词串}的翻译进行(任意)组合
xiaotong committed
529 530 531 532 533 534 535 536 537
\end{itemize}

\vspace{-2em}

\begin{flushright}
\begin{tikzpicture}

\begin{scope}

xiaotong committed
538 539 540 541 542
\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{满意}};
xiaotong committed
543

xiaotong committed
544
\node [anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west) {\scriptsize{\textbf{\alert{待翻译句子(已经分词):}}}};
xiaotong committed
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659

\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}


xiaotong committed
660
\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{单词翻译}}};
xiaotong committed
661 662 663 664 665 666 667 668 669 670 671 672

\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->{
xiaotong committed
673
\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{短语翻译}}};
xiaotong committed
674 675
}

xiaotong committed
676
\node [anchor=north west] (wtranslabel) at ([yshift=-4em]t15.south west) {\scriptsize{翻译路径(仅含有单词):}};
xiaotong committed
677 678 679
\draw [->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1em]wtranslabel.east);

\visible<3->{
xiaotong committed
680
\node [anchor=north west] (ptranslabel) at ([yshift=-5.5em]t15.south west) {\scriptsize{翻译路径(含有短语):}};
xiaotong committed
681 682 683 684 685 686 687 688 689 690
\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}

xiaotong committed
691
%%%------------------------------------------------------------------------------------------------------------
692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842
%%% 短语 -> 句法
\begin{frame}{使用短语就够了?}

\begin{itemize}
\item 短语是具有完整意思的连续词串,因此可以捕捉更多的上下文信息
	\begin{itemize}
	\item 不过过大的短语会造成数据稀疏、长距离依赖等问题
	\item 而且单纯的词串也缺乏句法功能表示能力
	\end{itemize}
    \begin{tikzpicture}

    \node[anchor=west, fill=blue!50, inner sep=0.05cm] (sp1) at (0, 0) {进口\ \ };
    \node[anchor=west] (sp2) at (2.5em, 0) {在 过去的 五 到 十 年 间};
    \node[anchor=west, fill=red!50, inner sep=0.05cm] (sp3) at (14em, 0) {有了 大幅度 下降};
    \draw[->] (sp1) edge [out=15, in=170] (sp3);

    \node[anchor=west, fill=blue!50, inner sep=0.05cm] (tp1) at (0, -0.8) {the imports};
    \node[anchor=west, fill=red!50, inner sep=0.05cm] (tp2) at (5.3em, -0.8) {drastically fell};
    \node[anchor=west] (tp3) at (11.3em, -0.8) {in the past five to ten years};
    \path[->] (tp1) edge [out=30, in=150] (tp2);

    \end{tikzpicture}
\item<2-> 另一种方式是考虑句子的句法结构,这样更容易描述句子的层次结构和长距离依赖关系
\end{itemize}

\visible<2->{
\begin{center}
\begin{tikzpicture}

\begin{scope}[scale=0.8, sibling distance=1pt, level distance=20pt, yshift=-1.4in]
\Tree[. S
        [.NP
            [.NP
                [.DT the ]
                [.\node[fill=ugreen!50]{NN}; \node[](n1){import}; ]
            ]
            [.\node[fill=ugreen!50]{IN}; in ]
            [.NP \edge[roof]; {North Korea} ]
        ]
        [.VP
            [.\node[fill=ugreen!50]{VBZ}; \node[](n2){have}; ]
            [.ADVP
                [.RB drastically ]
                [.VBN fallen ]
            ]
        ]
     ]

\draw[-latex] (n1.south) .. controls +(south east:1) and +(south:1) .. (n2.south);
\end{scope}

\end{tikzpicture}
\end{center}
}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 基于句法的模型
\begin{frame}{引入句法信息}
\begin{itemize}
\item 句法树是句子的更高层次的抽象,相比短语句法树具有更加丰富的句法功能标记,对语言结构的转换很有帮助
	\begin{itemize}
	\item 更容易捕捉翻译中的远距离调序
	\item 使用句法更容易对大范围的上下文建模
	\end{itemize}
\item<2-> 看一个真实的例子
    \begin{itemize}
    \item 长介词短语的翻译,需要完整的看到这个结构才能准确翻译介词
    \end{itemize}
\end{itemize}

\visible<2->{
\vspace{-1.2em}
\begin{center}
\begin{tikzpicture}

%% example
\begin{scope}[xshift=-0.1in,yshift=-1.5in]

{\tiny

\node[anchor=west] (ref) at (0,0) {\textbf{人工翻译:} \alert{After} North Korea demanded concessions from U.S. again before the start of a new round of six-nation talks ...};

\node[anchor=north west] (hifst) at ([yshift=-0.3em]ref.south west) {\textbf{机器翻译:} \blue{In}\black{} the new round of six-nation talks on North Korea again demanded that U.S. in the former promise ...};

\visible<4->{
\node[anchor=north west] (synhifst) at ([yshift=-0.3em]hifst.south west) {\textbf{better?:}};

\node[anchor=west, fill=red!20!white, inner sep=0.3em] (synhifstpart1) at ([xshift=-0.5em]synhifst.east) {After};

\node[anchor=west, fill=blue!20!white, inner sep=0.25em] (synhifstpart2) at ([xshift=0.1em,yshift=-0.05em]synhifstpart1.east) {North Korea again demanded that U.S. promised concessions before the new round of six-nation talks};

\node[anchor=west] (synhifstpart3) at ([xshift=-0.2em]synhifstpart2.east) {...};
}

\node [anchor=west] (inputlabel) at ([yshift=-0.4in]synhifst.west) {\textbf{Input:}};

\node [anchor=west,minimum height=12pt] (inputseg1) at (inputlabel.east) {$_1$ };
\node [anchor=west,minimum height=12pt] (inputseg2) at ([xshift=0.2em]inputseg1.east) {北韩$_2$ 再度$_3$ 要求$_4$ 美国$_5$$_6$$_7$ 回合$_8$$_9$$_{10}$ 会谈$_{11}$$_{12}$ 承诺$_{13}$ 让步$_{14}$};
\node [anchor=west,minimum height=12pt] (inputseg3) at ([xshift=0.2em]inputseg2.east) {$_{15}$};
\node [anchor=west,minimum height=12pt] (inputseg4) at ([xshift=0.2em]inputseg3.east) {,$_{16}$};
\node [anchor=west,minimum height=12pt] (inputseg5) at ([xshift=0.2em]inputseg4.east) {...};

\visible<3->{
\node [anchor=north,inner sep=2pt] (synlabel1) at ([yshift=-0.34in]inputseg2.south) {\scriptsize{PP}};
\node [anchor=north,inner sep=2pt] (synlabel2) at ([yshift=-0.34in]inputseg4.south) {\scriptsize{PU}};
\node [anchor=north,inner sep=2pt] (synlabel3) at ([yshift=-0.34in]inputseg5.south) {\scriptsize{VP}};
\node [anchor=north,inner sep=2pt] (synlabel4) at ([xshift=1.6in,yshift=-0.35in]synlabel1.south) {\scriptsize{VP}};

\draw [-] (inputseg1.south west) -- (inputseg3.south east) -- (synlabel1.north) -- cycle;
\draw [-] (inputseg4.south) -- (synlabel2.north);
\draw [-] (inputseg5.south) -- (synlabel3.north);
\draw [-] (synlabel1.south) -- (synlabel4.north);
\draw [-] (synlabel2.south) -- (synlabel4.north);
\draw [-] (synlabel3.south) -- (synlabel4.north);
}

\visible<3->{
\node [anchor=north east,align=left] (nolimitlabel) at (synlabel1.south west) {\scriptsize{短语结构树很容易捕捉}\\\scriptsize{这种介词短语结构}};
}

\visible<4->{
\node [anchor=west,minimum height=12pt,fill=red!20] (inputseg1) at (inputlabel.east) {$_1$ };
\node [anchor=west,minimum height=12pt,fill=blue!20] (inputseg2) at ([xshift=0.2em]inputseg1.east) {北韩$_2$ 再度$_3$ 要求$_4$ 美国$_5$$_6$$_7$ 回合$_8$$_9$$_{10}$ 会谈$_{11}$$_{12}$ 承诺$_{13}$ 让步$_{14}$};
\node [anchor=west,minimum height=12pt,fill=red!20] (inputseg3) at ([xshift=0.2em]inputseg2.east) {$_{15}$};

\path [draw,->,dashed] (inputseg1.north) .. controls +(north:0.2) and +(south:0.3) ..  ([xshift=1em]synhifstpart1.south);
\path [draw,->,dashed] (inputseg3.north) .. controls +(north:0.2) and +(south:0.6) ..  ([xshift=1em]synhifstpart1.south);
\path [draw,->,dashed] ([xshift=-0.5in]inputseg2.north) --  ([xshift=-0.6in]synhifstpart2.south);
}

}

\end{scope}
%% end of example

\end{tikzpicture}
\end{center}
}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 本章的核心问题
\begin{frame}{核心问题}

\vspace{6em}

 \begin{tcolorbox}[enhanced,size=normal,left=2mm,right=1mm,colback=blue!5!white,colframe=blue!75!black,drop fuzzy shadow]
{\LARGE
843 844 845
\textbf{如何使用短语、句法等}\\
\\
\textbf{结构信息进行机器翻译建模?}
846 847 848 849 850 851 852 853 854 855 856 857 858
}
\end{tcolorbox}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 本章的内容
\begin{frame}{Outline}

 \begin{tcolorbox}[enhanced,size=normal,left=2mm,right=1mm,colback=red!5!white,colframe=red!75!black,drop fuzzy shadow]
{\normalsize
\textbf{基于短语的模型} \vspace{-0.2em}\\
\small{1. 建模} \vspace{-0.2em}\\
xiaotong committed
859 860
\small{2. 短语获取和调序} \vspace{-0.2em}\\
\small{3. 翻译特征和最小错误率训练} \vspace{-0.2em}\\
861 862 863 864 865 866 867 868 869 870
\small{4. 栈解码}
}
\end{tcolorbox}

\vspace{0em}

 \begin{tcolorbox}[enhanced,size=normal,left=2mm,right=1mm,colback=red!5!white,colframe=red!75!black,drop fuzzy shadow]
{\normalsize
\textbf{基于层次短语的模型} \vspace{-0.2em}\\
\small{1. 同步上下文无关文法} \vspace{-0.2em}\\
xiaotong committed
871 872
\small{2. 层次短语规则及翻译特征} \vspace{-0.2em}\\
\small{3. 基于chart的解码和剪枝}
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889
}
\end{tcolorbox}

\vspace{0em}

\begin{tcolorbox}[enhanced,size=normal,left=2mm,right=1mm,colback=red!5!white,colframe=red!75!black,drop fuzzy shadow]
{\normalsize
\textbf{基于语言学句法的模型} \vspace{-0.2em}\\
\small{1. 基于树结构的文法} \vspace{-0.2em}\\
\small{2. 翻译规则抽取} \vspace{-0.2em}\\
\small{3. 规则匹配}
}
\end{tcolorbox}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
890 891 892
\section{基于短语的模型}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938
\subsection{建模}

%%%------------------------------------------------------------------------------------------------------------
%%% 什么是短语
\begin{frame}{何为短语?}

\begin{itemize}
\item 句对可以用短语对的组合进行表示,比如下图的例子包含三个短语翻译:
	\begin{itemize}
	\item 进口 $\leftrightarrow$ the imports have
	\item 大幅度 $\leftrightarrow$ drastically
	\item 下降 了 $\leftrightarrow$ fallen
	\end{itemize}

\begin{center}
\begin{tikzpicture}

\begin{scope}[minimum height = 18pt]

\node[anchor=east] (s0) at (-0.5em, 0) {源语:};
\node[anchor=west] (s1) at (0, 0) {进口};
\node[anchor=west] (s2) at (3.5em, 0) {大幅度};
\node[anchor=west] (s3) at (7.9em, 0) {下降 了};

\node[anchor=west,fill=ugreen!50] (s1) at (0, 0) {进口};
\node [anchor=west,fill=red!50] (s2) at (3.5em, 0) {大幅度};
\node[anchor=west,fill=blue!50] (s3) at (7.9em, 0) {下降 了};

\node[anchor=east] (t0) at (-0.5em, -1) {目标语:};
\node[anchor=west] (t1) at (0, -1) {the imports have};
\node[anchor=west] (t2) at (8.4em, -1) {drastically};
\node[anchor=west] (t3) at (14.0em, -1) {fallen};

\node[anchor=west,fill=ugreen!50] (t1) at (0, -1) {the imports have};
\node[anchor=west,fill=red!50] (t2) at (8.4em, -1) {drastically};
\node[anchor=west,fill=blue!50] (t3) at (14.0em, -1) {fallen};

\path[<->, thick] (s1.south) edge (t1.north);
\path[<->, thick] (s2.south) edge (t2.north);
\path[<->, thick] (s3.south) edge (t3.north);

\end{scope}

\end{tikzpicture}
\end{center}

姜雨帆 committed
939
\item<2-> 显然上图中的短语并\alert{不是}语言学上的短语。这里有:\\
xiaotong committed
940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964

\vspace{0.3em}
\begin{beamerboxesrounded}[upper=uppercolblue,lower=lowercolblue,shadow=true]{定义 - 短语}
对于一个句子$\textbf{w} = w_1...w_n$,任意子串$w_i...w_j$($i \le j$, $0 \le i$, $j \le n$)都是句子$\textbf{w}$的一个\alert{短语}
\end{beamerboxesrounded}

	\begin{itemize}
	\item $n$个词构成的句子可以有$\frac{n(n+1)}{2}$个短语
	\end{itemize}

\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 什么是短语翻译推导
\begin{frame}{双语短语}
\begin{itemize}
\item 进一步,可以定义 \\
\begin{beamerboxesrounded}[upper=uppercolblue,lower=lowercolblue,shadow=true]{定义 - 句子的短语切分}
对于一个句子$\textbf{w} = w_1...w_n$,可以被切分为$m$个子串,则称$\textbf{w}$$m$个短语组成,记为$\textbf{w} = p_1...p_m$,其中$p_i$$\textbf{w}$的一个短语, $p_1...p_m$也被称作句子$\textbf{w}$的一个\alert{短语切分}
\end{beamerboxesrounded}

\vspace{0.5em}
\item<2-> 对于双语的情况 \\
\begin{beamerboxesrounded}[upper=uppercolblue,lower=lowercolblue,shadow=true]{定义 - 双语短语(或短语对)}
xiaotong committed
965
对于源语和目标语句对($\textbf{s}, \textbf{t}$),$\textbf{s}$中短语$\bar{s}_i$$\textbf{t}$中的短语$\bar{t}_j$可以构成一个双语短语对$(\bar{s}_i,\bar{t}_j)$,简称\alert{短语对}$(\bar{s}_i,\bar{t}_j)$
xiaotong committed
966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983
\end{beamerboxesrounded}

	\begin{itemize}
	\item 比如,句对``进口 大幅度 下降 了 $\leftrightarrow$ the imports have drastically fallen'',有很多短语对,比如
		\begin{itemize}
		\item 大幅度 $\leftrightarrow$ drastically
		\item 大幅度 下降 $\leftrightarrow$ have drastically fallen
		\end{itemize}
	\end{itemize}

\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 融合用双语短语描述翻译
\begin{frame}{基于短语的翻译推导}
\begin{beamerboxesrounded}[upper=uppercolblue,lower=lowercolblue,shadow=true]{定义 - 基于短语的翻译推导}
{\small
xiaotong committed
984
对于源语和目标语句对($\textbf{s}, \textbf{t}$),有$l$个短语对$\{(\bar{s}_i,\bar{t}_j)\}$,且所有源语言短语$\{\bar{s}_i\}$和所有目标语短语$\{\bar{t}_j\}$分别构成$\textbf{s}$$\textbf{t}$ 的切分,则称这些短语对$\{(\bar{s}_i,\bar{t}_j)\}$构成了$\textbf{s}$$\textbf{t}$\alert{基于短语的翻译推导}(简称推导),记为$d(\{(\bar{s}_i,\bar{t}_j)\},\textbf{s},\textbf{t})$(简记为$d(\{(\bar{s}_i,\bar{t}_j)\})$$d$)。
xiaotong committed
985 986 987 988 989 990
}
\end{beamerboxesrounded}

\vspace{-0.5em}
\begin{center}
\begin{tikzpicture}
991

xiaotong committed
992
\begin{scope}[minimum height = 18pt]
993

xiaotong committed
994 995 996 997
\node[anchor=east] (s0) at (-0.5em, 0) {$\textbf{s}$:};
\node[anchor=west] (s1) at (0, 0) {进口};
\node[anchor=west] (s2) at (3.5em, 0) {大幅度};
\node[anchor=west] (s3) at (7.9em, 0) {下降 了};
998

xiaotong committed
999 1000 1001
\node[anchor=west,fill=ugreen!50] (s1) at (0, 0) {进口};
\node[anchor=west,fill=red!50] (s2) at (3.5em, 0) {大幅度};
\node[anchor=west,fill=blue!50] (s3) at (7.9em, 0) {下降 了};
1002

xiaotong committed
1003 1004 1005 1006
\node[anchor=east] (t0) at (-0.5em, -1) {$\textbf{t}$:};
\node[anchor=west] (t1) at (0, -1) {the imports have};
\node[anchor=west] (t2) at (8.4em, -1) {drastically};
\node[anchor=west] (t3) at (14.0em, -1) {fallen};
1007

xiaotong committed
1008 1009 1010
\node[anchor=west,fill=ugreen!50] (t1) at (0, -1) {the imports have};
\node[anchor=west,fill=red!50] (t2) at (8.4em, -1) {drastically};
\node[anchor=west,fill=blue!50] (t3) at (14.0em, -1) {fallen};
1011

xiaotong committed
1012 1013 1014 1015
\path[<->, thick] (s1.south) edge (t1.north);
\path[<->, thick] (s2.south) edge (t2.north);
\path[<->, thick] (s3.south) edge (t3.north);

xiaotong committed
1016 1017 1018 1019 1020 1021
\node[anchor=south,inner sep=0pt,yshift=-0.3em] (sp1) at (s1.north) {\scriptsize{$\bar{s}_1$}};
\node[anchor=south,inner sep=0pt,yshift=-0.3em] (sp2) at (s2.north) {\scriptsize{$\bar{s}_2$}};
\node[anchor=south,inner sep=0pt,yshift=-0.3em] (sp3) at (s3.north) {\scriptsize{$\bar{s}_3$}};
\node[anchor=north,inner sep=0pt,yshift=0.3em] (tp1) at (t1.south) {\scriptsize{$\bar{t}_1$}};
\node[anchor=north,inner sep=0pt,yshift=0.3em] (tp2) at (t2.south) {\scriptsize{$\bar{t}_2$}};
\node[anchor=north,inner sep=0pt,yshift=0.3em] (tp3) at (t3.south) {\scriptsize{$\bar{t}_3$}};
1022

xiaotong committed
1023 1024 1025 1026
\end{scope}
\end{tikzpicture}
\end{center}

1027
\vspace{-1.0em}
xiaotong committed
1028 1029

\begin{itemize}
xiaotong committed
1030 1031 1032 1033 1034 1035
\item $\{(\bar{s}_k,\bar{t}_k)\}$构成了$(\textbf{s},\textbf{t})$的一个基于短语的翻译推导
\item 需要在建模中描述的两个问题:
    \begin{itemize}
    \item $\bar{s}_k$是如何被翻译成$\bar{t}_k$的?
    \item $\bar{t}_k$在目标语中位置是如何决定的?
    \end{itemize}
xiaotong committed
1036 1037 1038 1039 1040
\end{itemize}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070
%%% 数学模型
\begin{frame}{数学模型}
\begin{itemize}
\item \textbf{机器翻译}:对于输入的源语言句子$\textbf{s}$,找到最佳译文$\hat{\textbf{t}}$

\begin{displaymath}
\hat{\textbf{t}} = \argmax_{\textbf{t}} \textrm{P}(\textbf{t}|\textbf{s})
\end{displaymath}

其中$\textrm{P}(\textbf{t}|\textbf{s})$表示$\textbf{s}$$\textbf{t}$的翻译概率

\item 三个基本问题(回忆一下第三章)
    \begin{enumerate}
    \item 如何定义$\textrm{P}(\textbf{t}|\textbf{s})$ - 建模问题
    \item 如何学习$\textrm{P}(\textbf{t}|\textbf{s})$的统计模型 - 训练问题
    \item 如何找到最优译文 - 解码问题
    \end{enumerate}
\vspace{0.3em}
\item<2-> 先看建模问题。可以把$\textrm{P}(\textbf{t}|\textbf{s})$表示成所有翻译推导的概率

\begin{displaymath}
\textrm{P}(\textbf{t}|\textbf{s}) = \sum_{d} \textrm{P}(d,\textbf{t}|\textbf{s})
\end{displaymath}

$d$是一个$(\textbf{s},\textbf{t})$上基于短语的翻译推导,$\textrm{P}(d,\textbf{t}|\textbf{s})$表示翻译推导$d$的概率

\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
姜雨帆 committed
1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096
%%% 数学模型
\begin{frame}{数学模型(续)}
\begin{itemize}
\item 但是,上式提到的翻译推导的样本空间是巨大的,很难枚举所有推导并进行求和。通常使用采样的方法选取搜索空间的一部分样本代表整个搜索空间
\vspace{0.3em}
\begin{center}
\begin{tikzpicture}
\node [anchor=west] (s1) at (0,0) {$\textrm{P}(\textbf{t}|\textbf{s}) = $};
\node [anchor=west,inner sep=3pt,fill=red!20] (s2) at ([xshift=0.1em]s1.east) {$\sum_{d} \textrm{P}(d,\textbf{t}|\textbf{s})$};
\node [anchor=west,inner sep=3pt,fill=green!20,minimum width=7.5em] (s3) at ([xshift=2.5em,yshift=1.5em]s2.east) {$\textrm{Max}\  \textrm{P}(d,\textbf{t}|\textbf{s})$};
\node [anchor=west,inner sep=3pt,fill=green!20,minimum width=7.5em] (s4) at ([xshift=2.5em,yshift=-1.5em]s2.east) {$\sum_{d_{nbest}} \textrm{P}(d,\textbf{t}|\textbf{s})$};
\draw[->,thick] ([xshift=-0.1em]s3.west) -- ([xshift=0.1em,yshift=0.3em]s2.east);
\draw[->,thick] ([xshift=-0.1em]s4.west) -- ([xshift=0.1em,yshift=-0.3em]s2.east);
\end{tikzpicture}
\end{center}
\vspace{0.3em}
如1-best(Viterbi)或者n-best的和来近似所有的和
\item<2-> 若采用Viterbi的方法,机器翻译也可看作对于输入的源语言句子$\textbf{s}$,找到最佳翻译推导$\hat{d}$
\begin{displaymath}
\hat{d} = \argmax_{d} \textrm{P}(d,\textbf{t}|\textbf{s})
\end{displaymath}
在后面的内容中出现的 $\hat{d}$$\hat{t}$ 都可以看作是等价的
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
1097 1098
%%% 翻译推导的建模
\begin{frame}{对翻译推导进行建模}
xiaotong committed
1099
\vspace{-0.4em}
1100
\begin{itemize}
xiaotong committed
1101 1102
\item $\textrm{P}(\textbf{t}|\textbf{s}) = \sum_{d} \textrm{P}(d,\textbf{t}|\textbf{s})$带来新的问题:如何描述$\textrm{P}(d,\textbf{t}|\textbf{s})$ \\

xiaotong committed
1103
\vspace{0.0em}
xiaotong committed
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134
\begin{center}
\begin{tikzpicture}

\begin{scope}[minimum height = 18pt]

\node[anchor=east] (s0) at (-0.5em, 0) {$\textbf{s}$:};
\node[anchor=west,fill=ugreen!50] (s1) at (0, 0) {};
\node[anchor=west,fill=red!50] (s2) at ([xshift=1em]s1.east) {桌子 上 的};
\node[anchor=west,fill=blue!50] (s3) at ([xshift=1em]s2.east) {苹果};

\node[anchor=east] (t0) at (-0.5em, -1.5) {$\textbf{t}$:};
\node[anchor=west,fill=blue!50] (t1) at (0, -1.5) {the apple};
\node[anchor=west,fill=ugreen!50] (t2) at ([xshift=1em]t1.east) {on};
\node[anchor=west,fill=red!50] (t3) at ([xshift=1em]t2.east) {the table};

\path[<->, thick] (s1.south) edge (t3.north);
\path[<->, thick] (s2.south) edge (t2.north);
\path[<->, thick] (s3.south) edge (t1.north);

\end{scope}
\end{tikzpicture}
\end{center}

上图体现了三方面问题

    \begin{enumerate}
    \item 短语获取:确定哪些是``可用''的短语
    \item 翻译模型:描述短语翻译的好坏
    \item 调序模型:描述翻译中的调序现象
    \end{enumerate}

xiaotong committed
1135
\item<2-> 希望有这样一种模型可以对任意的因素进行方便的建模。经典的判别式模型成为了不二的选择\\
xiaotong committed
1136

xiaotong committed
1137
\vspace{0.5em}
xiaotong committed
1138 1139 1140 1141 1142
\visible<2->{
\textbf{Discriminative Training and Maximum Entropy Models for Statistical Machine Translation}\\
\textbf{Franz Och and Hermann Ney, 2002, In Proc of ACL}
}

xiaotong committed
1143 1144
\end{itemize}

xiaotong committed
1145 1146 1147 1148 1149 1150 1151 1152 1153 1154
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 判别式模型
\begin{frame}{判别式模型}
\begin{itemize}
\item 判别式模型的形式:
\begin{displaymath}
\textrm{P}(d,\textbf{t}|\textbf{s}) = \frac{\exp(\sum_{i=1}^{M} \lambda_i \cdot h_i(d,\textbf{s},\textbf{t}))}{\sum_{d',t'}\exp(\sum_{i=1}^{M} \lambda_i \cdot h_i(d',\textbf{s},\textbf{t}'))}
\end{displaymath}
1155
    \begin{itemize}
xiaotong committed
1156 1157
    \item $\{h_i(\cdot)\}$$M$\alert{特征},每个$h_i(d,\textbf{s},\textbf{t})$$d$映射为一个实数值
    \item $\{\lambda_i\}$是这些特征对应权重,权重越大表示特征越重要
1158
    \item $\sum_{i=1}^{M} \lambda_i \cdot h_i(d,\textbf{s},\textbf{t})$描述了$d$的整体质量,值约大$d$越``好''
1159
    \end{itemize}
xiaotong committed
1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
\item<2-> 判别式模型的优点在于,它可以很方便的引入各种特征。我们只需要设计不同的特征函数$h_i(\cdot)$即可。
    \begin{itemize}
    \item 比如,可以定义短语翻译概率作为特征,也可以定义调序的程度作为一个特征
    \end{itemize}
\item<2-> \textbf{两个问题}
    \begin{itemize}
    \item \textbf{特征定义}:定义短语翻译特征和调序特征(马上)
    \item \textbf{权重调优}:得到最好的特征权重(后面)
    \end{itemize}

\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224
%%%  短语系统的架构
\begin{frame}{短语系统的架构}
\begin{itemize}
\item \textbf{训练阶段},需要得到三个子模型
	\begin{enumerate}
	\item 短语表:短语翻译及每个短语对应的特征值
	\item 调序模型:短语调序的模型
	\item 语言模型:评价译文流畅度的$n$-gram语言模型
	\end{enumerate}
\item \textbf{解码阶段}利用以上模型对新的句子进行翻译
\end{itemize}

\begin{center}
\begin{tikzpicture}
\begin{scope}

\tikzstyle{datanode} = [minimum width=7em,minimum height=1.7em,fill=ublue,rounded corners=0.7em];
\tikzstyle{modelnode} = [minimum width=7em,minimum height=1.7em,fill=darkred,rounded corners=0.2em];
\tikzstyle{decodingnode} = [minimum width=7em,minimum height=1.7em,fill=ugreen,rounded corners=0.2em];

\node [datanode,anchor=north west] (bitext) at (0,0) {{\color{white} \scriptsize{训练用双语数据}}};
\node [modelnode,anchor=north] (phrase) at ([yshift=-1.5em]bitext.south) {{\color{white} \scriptsize{短语抽取及打分}}};
\node [modelnode,anchor=west] (reorder) at ([xshift=1.5em]phrase.east) {{\color{white} \scriptsize{调序建模}}};
\node [modelnode,anchor=west] (lm) at ([xshift=1.5em]reorder.east) {{\color{white} \scriptsize{语言建模}}};
\node [datanode,anchor=south] (monotext) at ([yshift=1.5em]lm.north) {{\color{white} \scriptsize{目标语单语数据}}};

\node [datanode,anchor=north] (phrasetable) at ([yshift=-1.5em]phrase.south) {{\color{white} \scriptsize{短语表}}};
\node [datanode,anchor=north] (reordertable) at ([yshift=-1.5em]reorder.south) {{\color{white} \scriptsize{调序模型}}};
\node [datanode,anchor=north] (lmtable) at ([yshift=-1.5em]lm.south) {{\color{white} \scriptsize{语言模型}}};

\node [decodingnode,anchor=north] (decoding) at ([yshift=-2em]reordertable.south) {{\color{white} \scriptsize{解码器}}};

\draw [->,very thick] ([yshift=-0.1em]bitext.south) -- ([yshift=0.1em]phrase.north);
\draw [->,very thick] (bitext.south east) -- ([yshift=0.1em]reorder.north west);
\draw [->,very thick] ([yshift=-0.1em]monotext.south) -- ([yshift=0.1em]lm.north);
\draw [->,very thick] ([yshift=-0.1em]phrase.south) -- ([yshift=0.1em]phrasetable.north);
\draw [->,very thick] ([yshift=-0.1em]reorder.south) -- ([yshift=0.1em]reordertable.north);
\draw [->,very thick] ([yshift=-0.1em]lm.south) -- ([yshift=0.1em]lmtable.north);

\draw [->,very thick] ([yshift=-0.1em]phrasetable.south east) -- ([yshift=0.1em,xshift=-3em]decoding.north);
\draw [->,very thick] ([yshift=-0.1em]reordertable.south) -- ([yshift=0.1em,xshift=0em]decoding.north);
\draw [->,very thick] ([yshift=-0.1em]lmtable.south west) -- ([yshift=0.1em,xshift=3em]decoding.north);

\end{scope}
\end{tikzpicture}
\end{center}

\end{frame}


%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
1225 1226 1227 1228 1229 1230 1231
\subsection{短语抽取}

%%%------------------------------------------------------------------------------------------------------------
%%% 短语获取
\begin{frame}{短语获取}
\begin{itemize}
\item 回到最开始的问题: 给定$\textbf{s}$$\textbf{t}$\alert{如何获得双语短语}
1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284
    \begin{itemize}
    \item 如果没有限制,$\textbf{s}$$\textbf{t}$之间任何子串映射都可以看做双语短语
    \end{itemize}
\end{itemize}

\vspace{-0.7em}

\begin{center}
\begin{tikzpicture}

\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.0cm}

\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [rotate=45,font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]

% alignment matrix
\begin{scope}[scale=0.85,yshift=0.12in]
\foreach \i / \j / \c in
    {0/7/0.15, 1/7/0.15, 2/7/0.15, 3/7/0.15, 4/7/0.15, 5/7/0.15,
    0/6/0.15, 1/6/0.15, 2/6/0.15, 3/6/0.15, 4/6/0.15, 5/6/0.15,
    0/5/0.15, 1/5/0.15, 2/5/0.15, 3/5/0.15, 4/5/0.15, 5/5/0.15,
    0/4/0.15, 1/4/0.15, 2/4/0.15, 3/4/0.15, 4/4/0.15, 5/4/0.15,
    0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15, 4/3/0.15, 5/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15, 4/2/0.15, 5/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15, 4/1/0.15, 5/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15, 4/0/0.15, 5/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};

% source
\node[srcnode] (src1) at (-5.4*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{Have}};
\node[srcnode] (src2) at ([xshift=0.5\hnode]src1.south west) {\scriptsize{you}};
\node[srcnode] (src3) at ([xshift=0.5\hnode]src2.south west) {\scriptsize{learned}};
\node[srcnode] (src4) at ([xshift=0.5\hnode]src3.south west) {\scriptsize{nothing}};
\node[srcnode] (src5) at ([xshift=0.5\hnode]src4.south west) {\scriptsize{?}};
\node[srcnode] (src6) at ([xshift=0.5\hnode]src5.south west) {\scriptsize{EOS}};

% target
\node[tgtnode] (tgt1) at (-6.0*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{}};
\node[tgtnode] (tgt2) at ([yshift=-0.5\hnode]tgt1.north east) {\scriptsize{什么}};
\node[tgtnode] (tgt3) at ([yshift=-0.5\hnode]tgt2.north east) {\scriptsize{}};
\node[tgtnode] (tgt4) at ([yshift=-0.5\hnode]tgt3.north east) {\scriptsize{}};
\node[tgtnode] (tgt5) at ([yshift=-0.5\hnode]tgt4.north east) {\scriptsize{}};
\node[tgtnode] (tgt6) at ([yshift=-0.5\hnode]tgt5.north east) {\scriptsize{}};
\node[tgtnode] (tgt7) at ([yshift=-0.5\hnode]tgt6.north east) {\scriptsize{?}};
\node[tgtnode] (tgt8) at ([yshift=-0.5\hnode]tgt7.north east) {\scriptsize{EOS}};

xiaotong committed
1285 1286
\node [anchor=west] (p1line1) at ([xshift=4em,yshift=1em]a57.east) {\footnotesize{$\bar{s}_i$: 什么\ \ \ \ \ \ }};
\node [anchor=north west] (p1line2) at ([xshift=0]p1line1.south west) {\footnotesize{$\bar{t}_i$: learned\ \ \ nothing\ \ \ ? \ \ \ \ \ \ \ \ \ \ \ \ }};
1287

xiaotong committed
1288 1289
\node [anchor=west] (p2line1) at ([xshift=4em]a53.east) {\footnotesize{$\bar{s}_j$: 到\ \ \ ?}};
\node [anchor=north west] (p2line2) at ([xshift=0]p2line1.south west) {\footnotesize{$\bar{t}_j$: Have\ \ \ you\ \ \ learned\ \ \ nothing}};
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304

\begin{pgfonlayer}{background}
\node [rectangle,draw=red,thick,inner sep=0.2em,fill=white,drop shadow] [fit = (a26) (a44)] (phrase1) {};
\node [rectangle,draw=ugreen,thick,inner sep=0.2em,fill=white,drop shadow] [fit = (a01) (a32)] (phrase2) {};
\node [rectangle,inner sep=0.2em,fill=red!10] [fit = (p1line1) (p1line2)] (box1) {};
\node [rectangle,inner sep=0.2em,fill=green!10] [fit = (p2line1) (p2line2)] (box2) {};
\end{pgfonlayer}

\draw [->,thick,dotted] ([yshift=-0.8em]phrase1.east) .. controls +(east:1.5) and +(west:1) ..  (box1.west);
\draw [->,thick,dotted] ([yshift=-0.0em]phrase2.east) .. controls +(east:2.0) and +(west:1) ..  ([yshift=1em]box2.west);

\end{scope}

\end{tikzpicture}
\end{center}
xiaotong committed
1305 1306 1307 1308 1309 1310 1311 1312

\begin{itemize}
\item<2-> \textbf{显然},不加限制的定义短语会带来很多问题
    \begin{itemize}
    \item 短语数量随句子长度增加急剧膨胀
    \item 大量噪声,如``到 ? $\leftrightarrow$ Have you learned nothing''
    \end{itemize}
\end{itemize}
1313 1314 1315

\end{frame}

姜雨帆 committed
1316 1317
%%------------------------------------------------------------------------------------------------------------
%% 与词对齐的兼容性
xiaotong committed
1318
\begin{frame}{与词对齐的兼容性}
姜雨帆 committed
1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409
\begin{itemize}
\item 基于短语的翻译系统性能很大程度取决于短语表的好坏
    \begin{itemize}
    \item 在前面一章,我们提到过\alert{词对齐}的概念,在源语和目标语之间存在着单词级别的对应关系
    \item 借助词对齐信息可以提高抽取双语短语的效率和质量
    \end{itemize}
\end{itemize}

\vspace{-0.2em}

\begin{center}
\begin{tikzpicture}

\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.1cm}

\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [rotate=45,font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]

 alignment matrix
\begin{scope}[scale=0.85,yshift=0.12in]
\foreach \i / \j / \c in
    {0/5/0.15, 1/5/0.15, 2/5/0.15, 3/5/0.15, 4/5/0.15, 5/5/0.15, 6/5/0.15, 7/5/0.15,
    0/4/0.15, 1/4/0.15, 2/4/0.15, 3/4/0.15, 4/4/0.15, 5/4/0.15, 6/4/0.15, 7/4/0.15,
    0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15, 4/3/0.15, 5/3/0.15, 6/3/0.15, 7/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15, 4/2/0.15, 5/2/0.15, 6/2/0.15, 7/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15, 4/1/0.15, 5/1/0.15, 6/1/0.15, 7/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15, 4/0/0.15, 5/0/0.15, 6/0/0.15, 7/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-0.05*\hnode) {};

 source
\node[srcnode] (src1) at (-5.4*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{The}};
\node[srcnode] (src2) at ([xshift=0.5\hnode]src1.south west) {\scriptsize{weather}};
\node[srcnode] (src3) at ([xshift=0.5\hnode]src2.south west) {\scriptsize{is}};
\node[srcnode] (src4) at ([xshift=0.5\hnode]src3.south west) {\scriptsize{very}};
\node[srcnode] (src5) at ([xshift=0.5\hnode]src4.south west) {\scriptsize{good}};
\node[srcnode] (src6) at ([xshift=0.5\hnode]src5.south west) {\scriptsize{today}};
\node[srcnode] (src7) at ([xshift=0.5\hnode]src6.south west) {\scriptsize{.}};
\node[srcnode] (src8) at ([xshift=0.5\hnode]src7.south west) {\scriptsize{EOS}};

 target
\node[tgtnode] (tgt1) at (-6.0*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{今天}};
\node[tgtnode] (tgt2) at ([yshift=-0.5\hnode]tgt1.north east) {\scriptsize{天气}};
\node[tgtnode] (tgt3) at ([yshift=-0.5\hnode]tgt2.north east) {\scriptsize{}};
\node[tgtnode] (tgt4) at ([yshift=-0.5\hnode]tgt3.north east) {\scriptsize{}};
\node[tgtnode] (tgt5) at ([yshift=-0.5\hnode]tgt4.north east) {\scriptsize{}};
\node[tgtnode] (tgt6) at ([yshift=-0.5\hnode]tgt5.north east) {\scriptsize{EOS}};

 word alignment
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l04) at (a04) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l14) at (a14) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l55) at (a55) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l33) at (a33) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l42) at (a42) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l61) at (a61) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l70) at (a70) {};


\visible<2->{
\node [anchor=west] (p1line1) at ([xshift=4em,yshift=1em]a75.east) {\footnotesize{$\bar{s}_i$: 天气\ \ \ \ \ \ }};
\node [anchor=north west] (p1line2) at ([xshift=0]p1line1.south west) {\footnotesize{$\bar{t}_i$: The\ \ \ weather\ \ \ \ \ }};

\node [anchor=west] (p2line1) at ([xshift=4em]a72.east) {\footnotesize{$\bar{s}_j$: 真\ \ \ \ \ }};
\node [anchor=north west] (p2line2) at ([xshift=0]p2line1.south west) {\footnotesize{$\bar{t}_j$: very\ \ \ good\ \ \ \ \ \ \ \ }};

\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,draw=red,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (a04) (a14)] (phrase1) {};
\node [rectangle,draw=ugreen,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (a33) (a42)] (phrase2) {};
\node [rectangle,inner sep=0.2em,fill=red!10] [fit = (p1line1) (p1line2)] (box1) {};
\node [rectangle,inner sep=0.2em,fill=green!10] [fit = (p2line1) (p2line2)] (box2) {};
}
\end{pgfonlayer}

\draw [->,thick,dotted] ([yshift=0.3em]phrase1.east) .. controls +(east:3.5) and +(west:1) ..  (box1.west);
\draw [->,thick,dotted] ([yshift=-0.0em]phrase2.east) .. controls +(east:2.0) and +(west:1) ..  ([yshift=1em]box2.west);
}
\end{scope}

\end{tikzpicture}
\end{center}

\begin{itemize}
\item<2-> \textbf{如何}使用词对齐信息来抽取短语对?
\end{itemize}
xiaotong committed
1410 1411
\end{frame}

姜雨帆 committed
1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535
%%------------------------------------------------------------------------------------------------------------
%% 短语抽取方法
\begin{frame}{基于词对齐的短语抽取}
%描述算法,给出词对齐及短语抽取结果
\begin{itemize}
\item 抽取短语要与词对齐保持一致
    \begin{itemize}
    \item 如果短语$\bar{s}$中所有词$s_1,\cdots,s_n$在词对齐$A$中与短语$\bar{t}$中的词$t_1,\cdots,t_n$都有对齐的点,反之亦然,那么称短语对$(\bar{t},\bar{s})$与词对齐$A$一致。即
    \end{itemize}
\end{itemize}
\begin{center}
\begin{tikzpicture}

\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.1cm}

\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]

 alignment matrix1
\begin{scope}[scale=1,yshift=0.12in]
\foreach \i / \j / \c in
    {0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};



 source
\node[srcnode] (src01) at (-5.9*0.5*\hnode,-1.05*\hnode+3.4*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (src02) at ([xshift=0.5\hnode]src01.south west) {\scriptsize{$t_2$}};
\node[srcnode] (src03) at ([xshift=0.5\hnode]src02.south west) {\scriptsize{$t_3$}};
\node[srcnode] (src04) at ([xshift=0.5\hnode]src03.south west) {\scriptsize{$t_4$}};

 target
\node[tgtnode] (tgt01) at (-6.0*0.5*\hnode,-1.05*\hnode+3.3*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (tgt02) at ([yshift=-0.5\hnode]tgt01.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (tgt03) at ([yshift=-0.5\hnode]tgt02.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (tgt04) at ([yshift=-0.5\hnode]tgt03.north east) {\scriptsize{$s_4$}};

 alignment matrix2
\foreach \i / \j / \c in
    {0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (b\i\j) at (0.5*\hnode*\i+0.6*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};

 source
\node[srcnode] (src11) at (0.1*0.5*\hnode,-1.05*\hnode+3.4*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (src12) at ([xshift=0.5\hnode]src11.south west) {\scriptsize{$t_2$}};
\node[srcnode] (src13) at ([xshift=0.5\hnode]src12.south west) {\scriptsize{$t_3$}};
\node[srcnode] (src14) at ([xshift=0.5\hnode]src13.south west) {\scriptsize{$t_4$}};

 target
\node[tgtnode] (tgt11) at (0.2*0.5*\hnode,-1.05*\hnode+3.3*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (tgt12) at ([yshift=-0.5\hnode]tgt11.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (tgt13) at ([yshift=-0.5\hnode]tgt12.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (tgt14) at ([yshift=-0.5\hnode]tgt13.north east) {\scriptsize{$s_4$}};

 alignment matrix3
\foreach \i / \j / \c in
    {0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (c\i\j) at (0.5*\hnode*\i+6.6*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};

 source
\node[srcnode] (src21) at (6.1*0.5*\hnode,-1.05*\hnode+3.4*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (src22) at ([xshift=0.5\hnode]src21.south west) {\scriptsize{$t_2$}};
\node[srcnode] (src23) at ([xshift=0.5\hnode]src22.south west) {\scriptsize{$t_3$}};
\node[srcnode] (src24) at ([xshift=0.5\hnode]src23.south west) {\scriptsize{$t_4$}};

 target
\node[tgtnode] (tgt21) at (6.2*0.5*\hnode,-1.05*\hnode+3.3*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (tgt22) at ([yshift=-0.5\hnode]tgt21.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (tgt23) at ([yshift=-0.5\hnode]tgt22.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (tgt24) at ([yshift=-0.5\hnode]tgt23.north east) {\scriptsize{$s_4$}};

 word alignment
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la1) at (a03) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la2) at (a12) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la3) at (a11) {};

\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lb1) at (b03) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lb2) at (b12) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=red!50] (lb3) at (b11) {};

\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lc1) at (c03) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lc2) at (c12) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lc3) at (c11) {};

\begin{pgfonlayer}{background}
\node [rectangle,draw=ugreen,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (a03) (a11)] (phrase1) {};
\node [rectangle,draw=red,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (b03) (b12)] (phrase2) {};
\node [rectangle,draw=ugreen,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (c03) (c21)] (phrase3) {};
\end{pgfonlayer}

\node[anchor=north] (l1) at ([xshift=0.5em,yshift=-0.5em]a10.south) {一致};
\node[anchor=north] (l2) at ([xshift=0.5em,yshift=-0.5em]b10.south) {不一致};
\node[anchor=north] (l3) at ([xshift=0.5em,yshift=-0.5em]c10.south) {一致};

\node[anchor=north] (formula1) at ([xshift=-0.5em,yshift=8.0em]a33.north) {$(\bar{t},\bar{s})$$A$一致$\Leftrightarrow$};
\node[anchor=west] (formula2) at ([xshift=0.3em,yshift=-1.5em]formula1.east) {$\forall t_i \in \bar{t}:(\bar{t},\bar{s}) \in A \Rightarrow s_i \in \bar{s}$};
\node[anchor=west] (formula3) at ([xshift=-2.4em,yshift=-1.5em]formula2.west) {AND $\forall s_i \in \bar{s}:(\bar{t},\bar{s}) \in A \Rightarrow t_i \in \bar{t}$};
\node[anchor=west] (formula4) at ([yshift=-1.5em]formula3.west) {AND $\exists t_i \in \bar{t},\exists s_i \in \bar{s}:(\bar{t},\bar{s}) \in A $};

\end{scope}

\end{tikzpicture}
\end{center}

\end{frame}


xiaotong committed
1536 1537
%%%------------------------------------------------------------------------------------------------------------
%%% 短语抽取方法
姜雨帆 committed
1538
\begin{frame}{基于词对齐的短语抽取(续)}
xiaotong committed
1539
% 描述算法,给出词对齐及短语抽取结果
姜雨帆 committed
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715
\begin{itemize}
\item 短语抽取算法
    \begin{itemize}
    \item 遍历所有可能的目标语短语,搜索与它们中每一个相匹配的(最小)源语短语
    \item<6-> 需要对抽取短语的长度进行限制,否则抽取出来的短语对数量十分庞大,导致短语表质量下降
    \end{itemize}
\end{itemize}

\vspace{-2.0em}

\begin{center}
\begin{tikzpicture}

\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.1cm}

\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [rotate=45,font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]

% alignment matrix
\begin{scope}[scale=0.85,yshift=0.12in]
\foreach \i / \j / \c in
    {0/5/0.15, 1/5/0.15, 2/5/0.15, 3/5/0.15, 4/5/0.15, 5/5/0.15, 6/5/0.15, 7/5/0.15,
    0/4/0.15, 1/4/0.15, 2/4/0.15, 3/4/0.15, 4/4/0.15, 5/4/0.15, 6/4/0.15, 7/4/0.15,
    0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15, 4/3/0.15, 5/3/0.15, 6/3/0.15, 7/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15, 4/2/0.15, 5/2/0.15, 6/2/0.15, 7/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15, 4/1/0.15, 5/1/0.15, 6/1/0.15, 7/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15, 4/0/0.15, 5/0/0.15, 6/0/0.15, 7/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-0.05*\hnode) {};

% source
\node[srcnode] (src1) at (-5.4*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{The}};
\node[srcnode] (src2) at ([xshift=0.5\hnode]src1.south west) {\scriptsize{weather}};
\node[srcnode] (src3) at ([xshift=0.5\hnode]src2.south west) {\scriptsize{is}};
\node[srcnode] (src4) at ([xshift=0.5\hnode]src3.south west) {\scriptsize{very}};
\node[srcnode] (src5) at ([xshift=0.5\hnode]src4.south west) {\scriptsize{good}};
\node[srcnode] (src6) at ([xshift=0.5\hnode]src5.south west) {\scriptsize{today}};
\node[srcnode] (src7) at ([xshift=0.5\hnode]src6.south west) {\scriptsize{.}};
\node[srcnode] (src8) at ([xshift=0.5\hnode]src7.south west) {\scriptsize{EOS}};

% target
\node[tgtnode] (tgt1) at (-6.0*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{今天}};
\node[tgtnode] (tgt2) at ([yshift=-0.5\hnode]tgt1.north east) {\scriptsize{天气}};
\node[tgtnode] (tgt3) at ([yshift=-0.5\hnode]tgt2.north east) {\scriptsize{}};
\node[tgtnode] (tgt4) at ([yshift=-0.5\hnode]tgt3.north east) {\scriptsize{}};
\node[tgtnode] (tgt5) at ([yshift=-0.5\hnode]tgt4.north east) {\scriptsize{}};
\node[tgtnode] (tgt6) at ([yshift=-0.5\hnode]tgt5.north east) {\scriptsize{EOS}};

% word alignment
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l14) at (a14) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l55) at (a55) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l33) at (a33) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l42) at (a42) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l61) at (a61) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l70) at (a70) {};

\node [anchor=north west,fill=blue!30,minimum width=1.3in,minimum height=1.5em] (alig) at ([xshift=3em,yshift=-1.5em]tgt6.south west) {\footnotesize{与词对齐保持一致?}};

\visible<2>{
\begin{pgfonlayer}{background}
\visible<2>{
\node [rectangle,draw=red,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (a04) (a14)] (phrase1) {};
}
\end{pgfonlayer}
\draw [->,thick,dotted] ([yshift=-0.1em]phrase1.south) .. controls +(south:3.5) and +(north:1.5) ..  ([yshift=0.1em]alig.north);
}

\visible<3>{
\begin{pgfonlayer}{background}
\visible<3>{
\node [rectangle,draw=red,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (a04) (a14) (a24)] (phrase2) {};
}
\end{pgfonlayer}
\draw [->,thick,dotted] ([xshift=0.5em,yshift=-0.1em]phrase2.south) .. controls +(south:3.5) and +(north:1.5) ..  ([yshift=0.1em]alig.north);
}

\visible<4>{
\begin{pgfonlayer}{background}
\visible<4>{
\node [rectangle,draw=red,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (a04) (a14) (a24) (a33)] (phrase3) {};
}
\end{pgfonlayer}
\draw [->,thick,dotted] ([yshift=-0.1em]phrase3.south) .. controls +(south:2.8) and +(north:1.4) ..  ([yshift=0.1em]alig.north);
}

\visible<5>{
\begin{pgfonlayer}{background}
\visible<5>{
\node [rectangle,draw=red,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (a04) (a14) (a24) (a33) (a42)] (phrase4) {};
}
\end{pgfonlayer}
\draw [->,thick,dotted] ([xshift=0.5em,yshift=-0.1em]phrase4.south) .. controls +(south:2.0) and +(north:1.2) ..  ([yshift=0.1em]alig.north);
}

\end{scope}

\begin{scope}[xshift = 1.5in, yshift = 1.3in]
{\scriptsize
\node (rules) {\textbf{抽取得到的短语:}};
\draw[-] (rules.south west)--([xshift=2.0in]rules.south west);

\visible<2->{
\node[anchor=north west] (r1) at ([yshift=-0.3em]rules.south west) {天气 -- The weather};
}

\visible<3->{
\node[anchor=north west] (r2) at ([yshift=-0.4em]r1.south west) {天气 -- The weather is};
}

\visible<4->{
\node[anchor=north west] (r3) at ([yshift=-0.4em]r2.south west) {天气真 -- The weather is very};
}

\visible<5->{
\node[anchor=north west] (r4) at ([yshift=-0.4em]r3.south west) {天气真好 -- The weather is very good};
}

\visible<6->{
\node[anchor=north west] (r5) at ([yshift=-0.4em]r4.south west) {今天天气真好 -- The weather is very};
\node[anchor=north west] (r51) at ([xshift=7em,yshift=-0.4em]r5.south west) {good today};
\node[anchor=north west] (r6) at ([xshift=-7em,yshift=-0.8em]r51.south west) {今天 -- The today/真好 -- very good......};
}

\visible<2>{
\begin{pgfonlayer}{background}
\visible<2>{
\node [rectangle,thick,inner sep=0.1em,fill=ugreen!20] [fit = (r1)] (p1) {};
}
\end{pgfonlayer}
\draw [->,thick,dotted] ([xshift=0.1em]alig.east) .. controls +(east:2) and +(west:1.5) ..  ([xshift=-0.1em]p1.west);
}

\visible<3>{
\begin{pgfonlayer}{background}
\visible<3>{
\node [rectangle,thick,inner sep=0.1em,fill=ugreen!20] [fit = (r2)] (p2) {};
}
\end{pgfonlayer}
\draw [->,thick,dotted] ([xshift=0.1em]alig.east) .. controls +(east:2) and +(west:1.5) ..  ([xshift=-0.1em]p2.west);
}

\visible<4>{
\begin{pgfonlayer}{background}
\visible<4>{
\node [rectangle,thick,inner sep=0.1em,fill=ugreen!20] [fit = (r3)] (p3) {};
}
\end{pgfonlayer}
\draw [->,thick,dotted] ([xshift=0.1em]alig.east) .. controls +(east:2) and +(west:1.5) ..  ([xshift=-0.1em]p3.west);
}

\visible<5>{
\begin{pgfonlayer}{background}
\visible<5>{
\node [rectangle,thick,inner sep=0.1em,fill=ugreen!20] [fit = (r4)] (p4) {};
}
\end{pgfonlayer}
\draw [->,thick,dotted] ([xshift=0.1em]alig.east) .. controls +(east:2) and +(west:1.5) ..  ([xshift=-0.1em]p4.west);
}

\begin{pgfonlayer}{background}
\visible<6>{
\node [rectangle,draw=ugreen,thick,inner sep=0.1em,fill=white,drop shadow] [fit = (r1) (r6)] (p5) {};
}
\end{pgfonlayer}

}
\end{scope}

\end{tikzpicture}
\end{center}
xiaotong committed
1716 1717 1718 1719 1720 1721 1722 1723
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 词对齐系统
\begin{frame}{如何获得词对齐}
% GIZA++ + 对称化
% FastAlign
% ...
姜雨帆 committed
1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737
\begin{itemize}
\item 基于词的翻译模型(IBM模型)为每个句对建立了词对齐关系,但是IBM模型有一个根本问题,每个目标语单词只对齐到一个源语词(GIZA++??)
    \begin{itemize}
    \item 词对齐对称化:从两个方向运行IBM模型,合并词对齐结果(交集包含相对可靠的对齐点,并集包含大多数对齐点)
    \end{itemize}
\end{itemize}
\vspace{-0.3em}
\begin{center}
\begin{tikzpicture}

\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.1cm}
xiaotong committed
1738

姜雨帆 committed
1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842
\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]

% alignment matrix1
\begin{scope}[scale=0.9,yshift=0.12in]
\foreach \i / \j / \c in
    {0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};

% source
\node[srcnode] (src01) at (-5.9*0.5*\hnode,-1.05*\hnode+3.4*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (src02) at ([xshift=0.5\hnode]src01.south west) {\scriptsize{$t_2$}};
\node[srcnode] (src03) at ([xshift=0.5\hnode]src02.south west) {\scriptsize{$t_3$}};
\node[srcnode] (src04) at ([xshift=0.5\hnode]src03.south west) {\scriptsize{$t_4$}};

% target
\node[tgtnode] (tgt01) at (-6.0*0.5*\hnode,-1.05*\hnode+3.3*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (tgt02) at ([yshift=-0.5\hnode]tgt01.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (tgt03) at ([yshift=-0.5\hnode]tgt02.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (tgt04) at ([yshift=-0.5\hnode]tgt03.north east) {\scriptsize{$s_4$}};

% alignment matrix2
\foreach \i / \j / \c in
    {0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (b\i\j) at (0.5*\hnode*\i+0.6*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};

% source
\node[srcnode] (src11) at (0.1*0.5*\hnode,-1.05*\hnode+3.4*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (src12) at ([xshift=0.5\hnode]src11.south west) {\scriptsize{$t_2$}};
\node[srcnode] (src13) at ([xshift=0.5\hnode]src12.south west) {\scriptsize{$t_3$}};
\node[srcnode] (src14) at ([xshift=0.5\hnode]src13.south west) {\scriptsize{$t_4$}};

% target
\node[tgtnode] (tgt11) at (0.2*0.5*\hnode,-1.05*\hnode+3.3*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (tgt12) at ([yshift=-0.5\hnode]tgt11.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (tgt13) at ([yshift=-0.5\hnode]tgt12.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (tgt14) at ([yshift=-0.5\hnode]tgt13.north east) {\scriptsize{$s_4$}};

% alignment matrix3
\foreach \i / \j / \c in
    {0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (c\i\j) at (0.5*\hnode*\i+6.6*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};

% source
\node[srcnode] (src21) at (6.1*0.5*\hnode,-1.05*\hnode+3.4*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (src22) at ([xshift=0.5\hnode]src21.south west) {\scriptsize{$t_2$}};
\node[srcnode] (src23) at ([xshift=0.5\hnode]src22.south west) {\scriptsize{$t_3$}};
\node[srcnode] (src24) at ([xshift=0.5\hnode]src23.south west) {\scriptsize{$t_4$}};

% target
\node[tgtnode] (tgt21) at (6.2*0.5*\hnode,-1.05*\hnode+3.3*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (tgt22) at ([yshift=-0.5\hnode]tgt21.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (tgt23) at ([yshift=-0.5\hnode]tgt22.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (tgt24) at ([yshift=-0.5\hnode]tgt23.north east) {\scriptsize{$s_4$}};

% word alignment
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la1) at (a03) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la2) at (a12) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la3) at (a22) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la4) at (a30) {};

\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lb1) at (b03) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lb2) at (b12) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lb3) at (b11) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lb4) at (b30) {};

\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lc1) at (c03) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lc2) at (c12) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=red!50] (lc3) at (c11) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=red!50] (lc4) at (c22) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lc5) at (c30) {};

\node[anchor=north] (l1) at ([xshift=0.5em,yshift=-0.5em]a10.south) {\scriptsize{S - T}};
\node[anchor=north] (l2) at ([xshift=0.5em,yshift=-0.5em]b10.south) {\scriptsize{T - S}};
\node[anchor=north] (l3) at ([xshift=0.5em,yshift=-0.5em]c10.south) {\scriptsize{交集/并集}};

\end{scope}

\end{tikzpicture}
\end{center}

\vspace{-1.2em}

\begin{itemize}
\item<2-> 其他词对齐方法:FastAlign、Berkeley Word Aligner
\item<3-> 如何评价词对齐?
    \begin{enumerate}
    \item<3-> 自动指标:词对齐错误率(AER)
    \item<3-> 下游系统:短语抽取、机器翻译...
    \end{enumerate}
\end{itemize}
xiaotong committed
1843 1844 1845
% 如何评价词对齐 - 1) 自动指标 2) 下游系统(短语抽取、机器翻译)
\end{frame}

姜雨帆 committed
1846 1847
%%------------------------------------------------------------------------------------------------------------
%% 改进方法
姜雨帆 committed
1848
%\begin{frame}{更好更多的短语}
xiaotong committed
1849 1850
% 提高词对齐性能 -> 增加短语质量? -> 提高翻译质量?
% 提高Recall,对于不同任务,词对齐的密度更重要?
姜雨帆 committed
1851
%\end{frame}
xiaotong committed
1852 1853 1854 1855 1856

%%%------------------------------------------------------------------------------------------------------------
%%% 如何度量短语的好坏
\begin{frame}{短语打分 - 翻译概率}
% 正向、反向翻译概率
姜雨帆 committed
1857 1858 1859 1860
\begin{itemize}
\item 抽取到短语之后,如何将这些短语对转化成概率化的短语表?这里使用极大似然估计的方法(MLE)对翻译概率进行估计:
\vspace{-0.5em}
\begin{displaymath}
xiaotong committed
1861
\textrm{P}(\bar{t}|\bar{s}) = \frac{count(\bar{s},\bar{t})}{count(\bar{s})}
姜雨帆 committed
1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917
\end{displaymath}
\vspace{-1.0em}
    \begin{itemize}
    \item count($\bar{s},\bar{t}$)表示短语对($\bar{s},\bar{t}$)出现的次数
    \item count($\bar{s}$)表示短语$\bar{s}$出现的次数
    \end{itemize}
\vspace{0.8em}
\begin{tikzpicture}

{\scriptsize
\node [anchor=north west,inner sep=1pt] (entry1) at (0,0) {\tiny{\textbf{1:} 这 是 数据 $\leftrightarrow$ This is data}};
\node [anchor=north west,inner sep=1pt] (entry2) at ([yshift=-0.1em]entry1.south west) {\tiny{\textbf{2:} 小心 !$\leftrightarrow$ Look out !}};
\node [anchor=north west,inner sep=1pt] (entry3) at ([yshift=-0.1em]entry2.south west) {\tiny{\textbf{3:} 你 是 谁 $\leftrightarrow$ Who are you}};
\node [anchor=north west,inner sep=2pt] (entry4) at ([yshift=-0.1em]entry3.south west) {...};
\node [anchor=south west] (corpuslabel) at (entry1.north west) {{\color{ublue} \textbf{双语平行数据}}};

\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow,minimum height=1.6cm] [fit = (entry1) (entry2) (entry3) (entry4) (corpuslabel)] (corpus) {};
\end{pgfonlayer}
}

\visible<2->{
{\scriptsize
\node [anchor=west] (P1) at ([xshift=15em]entry1.west){\tiny{\textbf{1:} 数据 -- data}};
\node [anchor=west] (P2) at ([xshift=15em]entry2.west){\tiny{\textbf{2:} 小心 -- Look out}};
\node [anchor=west] (P3) at ([xshift=15em]entry3.west){\tiny{\textbf{3:} 谁 -- you}};
\node [anchor=west] (P4) at ([xshift=15em]entry4.west){...};
\node [anchor=west] (plabel) at ([xshift=15em]corpuslabel.west) {{\color{ublue} \textbf{短语对}}};
}

\begin{pgfonlayer}{background}
\visible<2->{
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow,minimum height=1.6cm] [fit = (P1) (P4) (P2) (P3) (plabel)] (model) {};
}
\end{pgfonlayer}

\draw [->,very thick,ublue] ([xshift=0.2em]corpus.east) -- ([xshift=3.2em]corpus.east)  node [pos=0.5, above] {\alert{\scriptsize{短语抽取}}};
}
\visible<3->{
\draw [->,very thick,ublue] ([xshift=0.4em]model.east) -- ([xshift=3.4em]model.east)  node [inner sep=0pt,pos=0.5, above,yshift=0.3em] (decodingarrow) {\alert{\scriptsize{统计}}};

{\scriptsize
\node [anchor=north west,inner sep=2pt] (sentlabel) at ([xshift=5.5em,yshift=-0.3em]model.north east) {{\color{ublue} \textbf{统计出现次数}}};
\node [anchor=north west] (sent) at ([yshift=-0.5em]sentlabel.south west) {\textbf{count($\bar{s},\bar{t}$)}};
\node [anchor=north west] (sentpart2) at ([yshift=-0.1em]sent.south west) {\textbf{count($\bar{s}$)}};
}
}

\begin{pgfonlayer}{background}
\visible<3->{
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow,minimum height=1.6cm] [fit = (sentlabel) (sent) (sentpart2)] (segsystem) {};
}
\end{pgfonlayer}

\end{tikzpicture}
\vspace{-0.2em}
xiaotong committed
1918
\item<4-> 在实际使用中,还可以加入反向翻译概率即$\textrm{P}(\bar{s}|\bar{t})$来提升机器翻译模型性能
姜雨帆 committed
1919
\end{itemize}
xiaotong committed
1920 1921 1922 1923 1924 1925
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 如何度量短语的好坏
\begin{frame}{短语打分 - 词汇翻译概率}
% 正向、反向翻译概率
姜雨帆 committed
1926 1927 1928 1929
\begin{itemize}
\item 对于不常出现的短语可能会产生一些问题,可以将短语分解成词,计算他们的匹配程度。计算公式如下:
\vspace{-0.5em}
\begin{displaymath}
xiaotong committed
1930
\textrm{$\textrm{P}_{lex}$}(\bar{t}|\bar{s}) = \prod_{j=1}^{J} \frac{1}{|\{j|a(j,i) = 1\}|} \sum_{\forall(j,i):a(j,i) = 1} w(t_i|s_j)
姜雨帆 committed
1931 1932 1933
\end{displaymath}
\vspace{-1em}
\begin{itemize}
xiaotong committed
1934
\item  源语短语$\bar{s}=s_1...s_J$, 目标语短语$\bar{t}=t_1...t_I$,词对齐矩阵 $\mathbf{a}$
姜雨帆 committed
1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980
\end{itemize}
\visible<2->{
\begin{center}
\begin{tikzpicture}

\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.1cm}

\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]

% alignment matrix1
\begin{scope}[scale=0.9,yshift=0.12in]
\foreach \i / \j / \c in
    {0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15, 4/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15, 4/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15, 4/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15, 4/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};

% source
\node[srcnode] (tgt01) at (-5.9*0.5*\hnode,-1.05*\hnode+3.4*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (tgt02) at ([xshift=0.5\hnode]tgt01.south west) {\scriptsize{$t_2$}};
\node[srcnode] (tgt03) at ([xshift=0.5\hnode]tgt02.south west) {\scriptsize{$t_3$}};
\node[srcnode] (tgt04) at ([xshift=0.5\hnode]tgt03.south west) {\scriptsize{$t_4$}};
\node[srcnode] (tgt05) at ([xshift=0.5\hnode]tgt04.south west) {\scriptsize{$N$}};

% target
\node[tgtnode] (src01) at (-6.0*0.5*\hnode,-1.05*\hnode+3.3*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (src02) at ([yshift=-0.5\hnode]src01.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (src03) at ([yshift=-0.5\hnode]src02.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (src04) at ([yshift=-0.5\hnode]src03.north east) {\scriptsize{$s_4$}};

% word alignment
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la1) at (a03) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la2) at (a12) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la3) at (a22) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la4) at (a41) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la5) at (a30) {};

xiaotong committed
1981 1982
\node[anchor=west] (f1) at ([xshift=3em,yshift=0.8em]a43.east) {\scriptsize{$\textrm{P}_{lex}(\bar{t}|\bar{s})=w(t_1|s_1)\times$}};
\node[anchor=north] (f2) at ([xshift=6em]f1.south) {\scriptsize{$\frac{1}{2}(w(t_2|s_2)+w(t_4|s_2))\times$}};
姜雨帆 committed
1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997
\node[anchor=north west] (f3) at (f2.south west) {\scriptsize{$w(N|s_3)\times$}};
\node[anchor=north west] (f4) at (f3.south west) {\scriptsize{$w(t_4|s_4)\times$}};

\end{scope}

\end{tikzpicture}
\end{center}

    \begin{itemize}
    \item 词对齐概率$w(t_i|s_i)$可以从平行语料中获取
    \item 如果对空则使用概率$w(t_i|N)$
    \end{itemize}
}
\item<3-> 同翻译概率一样,在模型中可以使用双向词汇翻译概率
\end{itemize}
xiaotong committed
1998 1999 2000 2001 2002
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 展示短语表的内容
\begin{frame}{短语表实例}
姜雨帆 committed
2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028
\begin{itemize}
\item 下面来看一个真实的短语表例子
\vspace{-0.5em}
\begin{center}
\begin{tikzpicture}
\node [anchor=west] (s1) at (0,0) {\scriptsize{报告 认为 $\vert\vert\vert$ report holds that $\vert\vert\vert$ -2.62 -5.81 -0.91 -2.85 1 0 $\vert\vert\vert$ 4 $\vert\vert\vert$ 0-0 1-1 1-2}};
\node [anchor=west] (s2) at ([yshift=-1.2em]s1.west) {\scriptsize{,悲伤 $\vert\vert\vert$ , sadness $\vert\vert\vert$ -1.946 -3.659 0 -3.709 1 0 $\vert\vert\vert$ 1 $\vert\vert\vert$ 0-0 1-1}};
\node [anchor=west] (s3) at ([yshift=-1.2em]s2.west) {\scriptsize{,北京 等 $\vert\vert\vert$ , beijing , and other $\vert\vert\vert$ 0 -7.98 0 -3.84 1 0 $\vert\vert\vert$ 2 $\vert\vert\vert$ 0-0 1-1 2-2 2-3 2-4}};
\node [anchor=west] (s4) at ([yshift=-1.2em]s3.west) {\scriptsize{,北京 及 $\vert\vert\vert$ , beijing , and $\vert\vert\vert$ -0.69 -1.45 -0.92 -4.80 1 0  $\vert\vert\vert$ 2 $\vert\vert\vert$ 0-0 1-1 2-2}};
\node [anchor=west] (s5) at ([yshift=-1.2em]s4.west) {\scriptsize{一个 中国 $\vert\vert\vert$ one china $\vert\vert\vert$ 0 -1.725 0 -1.636 1 0 $\vert\vert\vert$ 2 $\vert\vert\vert$ 1-1 2-2}};
\node [anchor=west] (s7) at ([yshift=-1.1em]s5.west) {\scriptsize{...}};
\node [anchor=west] (s6) at ([yshift=1.0em]s1.west) {\scriptsize{...}};
\begin{pgfonlayer}{background}
\node [rectangle,inner sep=0.3em,fill=red!20] [fit = (s1) (s3) (s4) (s6) (s7)] (box1) {};
\end{pgfonlayer}
\end{tikzpicture}
\end{center}
\item 在短语表的例子中,每行使用 $\vert\vert\vert$ 划分为五个部分
    \begin{itemize}
    \item 第一部分为源语端的短语
	\item 第二部分为目标语端的短语
	\item 第三部分为多个特征的值,包含了短语翻译概率、词汇翻译概率等特征
	\item 第四部分为短语对在短语抽取集合中出现的频率
	\item 第五部分为词对齐信息
    \end{itemize}
\end{itemize}
xiaotong committed
2029
\end{frame}
xiaotong committed
2030 2031

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
2032
\subsection{调序}
xiaotong committed
2033 2034

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
2035 2036 2037 2038 2039
%%% 调序是翻译中的常见现象
\begin{frame}{翻译中的调序}
% 用一个调序比较多的实例说明调序是翻译中的普遍现象
% 需要设计调序特征来对问题进行建模
% 参考NiuTrans Manual
姜雨帆 committed
2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066
\begin{itemize}
\item 通过短语表可以找到每个短语正确的翻译结果,我们仍需要对这些短语进行调序来获取流利的翻译结果
\vspace{0.3em}
\begin{center}
\begin{tikzpicture}

\begin{scope}[minimum height = 18pt]

\node[anchor=east] (s0) at (-0.5em, 0) {$\textbf{s}$:};
\node[anchor=west,fill=ugreen!50] (s1) at (0, 0) {};
\node[anchor=west,fill=red!50] (s2) at ([xshift=1em]s1.east) {桌子 上 的};
\node[anchor=west,fill=blue!50] (s3) at ([xshift=1em]s2.east) {苹果};

\node[anchor=east] (t0) at (-0.5em, -1.5) {$\textbf{t}$:};
\node[anchor=west,fill=blue!50] (t1) at (0, -1.5) {the apple};
\node[anchor=west,fill=ugreen!50] (t2) at ([xshift=1em]t1.east) {on};
\node[anchor=west,fill=red!50] (t3) at ([xshift=1em]t2.east) {the table};

\path[<->, thick] (s1.south) edge (t3.north);
\path[<->, thick] (s2.south) edge (t2.north);
\path[<->, thick] (s3.south) edge (t1.north);

\end{scope}
\end{tikzpicture}
\end{center}
	\begin{itemize}
	\item 将调序的程度作为特征加入判别式模型
xiaotong committed
2067
	\item<2-> 也可以引入约束化简调序问题,如BTG
姜雨帆 committed
2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080
	\end{itemize}
\vspace{0.5em}
\visible<2->{
\begin{flushright}
\begin{tabular}{l l l l r}
$X$ & $\to$ & $X_1$ $X_2,$ & $X_1$ $X_2$ & \hspace{4em} (R1)\\
$X$ & $\to$ & $X_1$ $X_2,$ & $X_2$ $X_1$ & (R2)\\
$X$ & $\to$ & $\bar{s},$ & $\bar{t}$ & (R3)\\
\end{tabular}
\end{flushright}
}
\item<3-> 常见的调序模型有基于距离的调序模型、词汇化调序模型(MSD)、最大熵调序模型(ME)
\end{itemize}
xiaotong committed
2081 2082 2083 2084 2085 2086
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 调序模型1:基于距离的调序
\begin{frame}{调序模型1:基于距离的调序}
% 参考Moses
姜雨帆 committed
2087 2088 2089 2090
\begin{itemize}
\item 参考前一个短语,来判断当前短语是否需要进行,调序距离设为$\textrm{start}_i-\textrm{end}_{i-1}-1$

\begin{itemize}
姜雨帆 committed
2091
\item $\textrm{start}_i$是指翻译成第$i$个目标语短语的源语短语中的第一个词,而$\textrm{end}_i$为源于短语最后一个词($\textrm{end}_0$为0)
姜雨帆 committed
2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115
\end{itemize}
\vspace{0.0em}
\visible<2->{
\begin{center}
\begin{tikzpicture}

\begin{scope}[minimum height = 20pt]

\node[anchor=east] (s0) at (-0.5em, 0) {$\textbf{s}$:};
\node[anchor=west,fill=ugreen!50] (s1) at (0, 0) {在 桌子 上 的};
\node[anchor=south] (n1) at ([xshift=-2.5em,yshift=-0.5em]s1.north) {\scriptsize{1}};
\node[anchor=south] (n2) at ([xshift=-0.8em,yshift=-0.5em]s1.north) {\scriptsize{2}};
\node[anchor=south] (n3) at ([xshift=1.1em,yshift=-0.5em]s1.north) {\scriptsize{3}};
\node[anchor=south] (n4) at ([xshift=2.5em,yshift=-0.5em]s1.north) {\scriptsize{4}};
\node[anchor=west,fill=blue!50] (s2) at ([xshift=1em]s1.east) {苹果};
\node[anchor=south] (n5) at ([yshift=-0.5em]s2.north) {\scriptsize{5}};

\node[anchor=east] (t0) at (-0.5em, -1.5) {$\textbf{t}$:};
\node[anchor=west,fill=blue!50] (t1) at (0, -1.5) {the apple};
\node[anchor=west,fill=ugreen!50] (t2) at ([xshift=1em]t1.east) {on the table};

\path[<->, thick] (s1.south) edge (t2.north);
\path[<->, thick] (s2.south) edge (t1.north);

姜雨帆 committed
2116
\node[anchor=west] (target) at ([xshift=3em,yshift=2.3em]n5.east) {\scriptsize{目标短语}};
姜雨帆 committed
2117 2118 2119 2120
\node[anchor=west] (source) at ([xshift=0.7em]target.east) {\scriptsize{源短语}};
\node[anchor=west] (distance) at ([xshift=0.7em]source.east) {\scriptsize{距离}};

\node[anchor=north] (t1) at ([yshift=-0.1em]target.south) {1};
姜雨帆 committed
2121
\node[anchor=north] (t2) at ([yshift=-1.8em]t1.south) {2};
姜雨帆 committed
2122 2123

\node[anchor=north] (so1) at ([yshift=-0.1em]source.south) {5};
姜雨帆 committed
2124
\node[anchor=north] (so2) at ([yshift=-1.8em]so1.south) {1-4};
姜雨帆 committed
2125 2126

\node[anchor=north] (d1) at ([yshift=-0.1em]distance.south) {+4};
姜雨帆 committed
2127 2128 2129 2130
\node[anchor=north] (d2) at ([yshift=-1.8em]d1.south) {-5};

\node[anchor=north west,fill=red!20] (m1) at ([xshift=-1em,yshift=-0.0em]t1.south west) {\scriptsize{$\textrm{start}_1-\textrm{end}_{0}-1$ = 5  - 0 - 1}};
\node[anchor=north west,fill=red!20] (m2) at ([xshift=-1em,yshift=-0.0em]t2.south west) {\scriptsize{$\textrm{start}_2-\textrm{end}_{1}-1$ = 1  - 5 - 1}};
姜雨帆 committed
2131 2132 2133 2134 2135 2136 2137 2138 2139

\draw[-] (target.south west)--([xshift=1.6in]target.south west);

\draw[-,thick] (s1.north west)--([yshift=0.3in]s1.north west);
\draw[->,densely dotted,thick] ([yshift=0.3in]s1.north west)--([xshift=0.3in,yshift=0.3in]s1.north west);

\draw[-,thick] (s2.north west)--([yshift=0.3in]s2.north west);
\draw[->,densely dotted,thick] ([yshift=0.3in]s2.north west)--([xshift=-0.3in,yshift=0.3in]s2.north west);

姜雨帆 committed
2140 2141
\node[anchor=south] (ld1) at ([xshift=-0.1em,yshift=0.4em]n1.north) {\scriptsize{x=-5}};
\node[anchor=south] (ld2) at ([xshift=6em,yshift=0.4em]n1.north) {\scriptsize{x=+4}};
姜雨帆 committed
2142 2143 2144 2145 2146 2147

\end{scope}
\end{tikzpicture}
\end{center}
}
\vspace{0.3em}
姜雨帆 committed
2148
\item<3-> 代价函数选择指数衰减函数$c(x)=\alpha^{|x|}$,其中$\alpha$通过近似估计得到,$\alpha \in$[0,1]
姜雨帆 committed
2149 2150 2151 2152
\begin{itemize}
\item<3-> 调序距离越大,调序代价越大
\end{itemize}
\end{itemize}
xiaotong committed
2153 2154
\end{frame}

姜雨帆 committed
2155

xiaotong committed
2156 2157 2158 2159
%%%------------------------------------------------------------------------------------------------------------
%%% 调序模型2:MSD模型
\begin{frame}{调序模型2:MSD模型}
% 参考NiuTrans Manual
姜雨帆 committed
2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270
\begin{itemize}
\item 基于距离的调序模型仅仅以词语移动的距离为条件,词汇化调序模型以实际短语为条件
    \begin{itemize}
    \item 在词汇化调序模型中仅考虑三种调序类型:M、S、D
    \item 三种调序类型仅针对每个短语的前面一个短语
    \end{itemize}
\end{itemize}

\vspace{-0.2em}

\begin{center}
\begin{tikzpicture}

\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.1cm}

\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [left,font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]

 alignment matrix
\begin{scope}[scale=0.92,yshift=0.12in]
\foreach \i / \j / \c in
    {0/5/0.15, 1/5/0.15, 2/5/0.15, 3/5/0.15, 4/5/0.15, 5/5/0.15, 6/5/0.15, 7/5/0.15,
    0/4/0.15, 1/4/0.15, 2/4/0.15, 3/4/0.15, 4/4/0.15, 5/4/0.15, 6/4/0.15, 7/4/0.15,
    0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15, 4/3/0.15, 5/3/0.15, 6/3/0.15, 7/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15, 4/2/0.15, 5/2/0.15, 6/2/0.15, 7/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15, 4/1/0.15, 5/1/0.15, 6/1/0.15, 7/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15, 4/0/0.15, 5/0/0.15, 6/0/0.15, 7/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-0.05*\hnode) {};

 source
\node[srcnode] (src1) at (-5.9*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (src2) at ([xshift=0.5\hnode]src1.south west) {\scriptsize{$t_2$}};
\node[srcnode] (src3) at ([xshift=0.5\hnode]src2.south west) {\scriptsize{$t_3$}};
\node[srcnode] (src4) at ([xshift=0.5\hnode]src3.south west) {\scriptsize{$t_4$}};
\node[srcnode] (src5) at ([xshift=0.5\hnode]src4.south west) {\scriptsize{$t_5$}};
\node[srcnode] (src6) at ([xshift=0.5\hnode]src5.south west) {\scriptsize{$t_6$}};
\node[srcnode] (src7) at ([xshift=0.5\hnode]src6.south west) {\scriptsize{$t_7$}};
\node[srcnode] (src8) at ([xshift=0.5\hnode]src7.south west) {\scriptsize{$t_8$}};

 target
\node[tgtnode] (tgt1) at (-6.0*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (tgt2) at ([yshift=-0.5\hnode]tgt1.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (tgt3) at ([yshift=-0.5\hnode]tgt2.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (tgt4) at ([yshift=-0.5\hnode]tgt3.north east) {\scriptsize{$s_4$}};
\node[tgtnode] (tgt5) at ([yshift=-0.5\hnode]tgt4.north east) {\scriptsize{$s_5$}};
\node[tgtnode] (tgt6) at ([yshift=-0.5\hnode]tgt5.north east) {\scriptsize{$s_6$}};

 word alignment
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l05) at (a05) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l14) at (a14) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l24) at (a24) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l31) at (a31) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l32) at (a32) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l43) at (a43) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l53) at (a53) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l63) at (a63) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l70) at (a70) {};


\visible<2->{
\node [anchor=west] (p1line1) at ([xshift=3.5em,yshift=0.5em]a75.east) {\footnotesize{M(monotone):单调调序}};
\node [anchor=north west] (p1line2) at ([xshift=0,yshift=-1em]p1line1.south west) {\footnotesize{S(swap): 与前面一个短语}};
\node [anchor=north west] (p1line3) at ([xshift=3.8em]p1line2.south west) {\footnotesize{位置进行交换}};
\node [anchor=north west] (p1line4) at ([xshift=-3.8em,yshift=-1em]p1line3.south west) {\footnotesize{D(discontinuous):非连续调序}};

%\node [anchor=west] (p2line1) at ([xshift=4em]a73.east) {\footnotesize{$\bar{s}_j$: 真\ \ \ 好 \ \ }};
%\node [anchor=north west] (p2line2) at ([xshift=0]p2line1.south west) {\footnotesize{$\bar{t}_j$: very\ \ \ good\ \ \ \ \ \ \ \ }};

\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,thick,inner sep=0.3em,fill=blue!40,drop shadow,fill opacity=0.85] [fit = (a05)] (phrase1) {};
\node [rectangle,thick,inner sep=0.3em,fill=blue!40,drop shadow,fill opacity=0.85] [fit = (a14) (a24)] (phrase2) {};
\node [rectangle,thick,inner sep=0.3em,fill=blue!40,drop shadow,fill opacity=0.85] [fit = (a31) (a32)] (phrase3) {};
\node [rectangle,thick,inner sep=0.3em,fill=blue!40,drop shadow,fill opacity=0.85] [fit = (a43) (a63)] (phrase4) {};
\node [rectangle,thick,inner sep=0.3em,fill=blue!40,drop shadow,fill opacity=0.85] [fit = (a70)] (phrase5) {};
\node [rectangle,inner sep=0.2em,fill=red!10] [fit = (p1line1)] (box1) {};
\node [rectangle,inner sep=0.2em,fill=ugreen!10] [fit = (p1line2) (p1line3)] (box2) {};
\node [rectangle,inner sep=0.2em,fill=orange!10] [fit = (p1line4)] (box3) {};
}
\end{pgfonlayer}

\node [circle,draw,anchor=south,inner sep=1pt,fill=red!20] (c1) at ([xshift=-0.5em]a05.north) {\scriptsize{m}};
\node [circle,draw,anchor=south,inner sep=1pt,fill=red!20] (c2) at ([xshift=-0.5em]a14.north) {\scriptsize{m}};
\node [circle,draw,anchor=north,inner sep=1pt,fill=orange!20] (c3) at ([xshift=0.1em]a24.south) {\scriptsize{d}};
\node [circle,draw,anchor=south,inner sep=2pt,fill=ugreen!20] (c4) at ([xshift=0.5em]a32.north) {\scriptsize{s}};
\node [circle,draw,anchor=north,inner sep=1pt,fill=orange!20] (c5) at ([xshift=0.5em]a63.south) {\scriptsize{d}};


\draw [->,thick] (a05.south east) -- (c1.315);
\draw [->,thick] ([xshift=-0.5em]a24.west) -- (c2.315);
\draw [->,thick] ([yshift=-0.7em]a32.south) .. controls +(west:1.3) and +(east:1.3) .. (c3.340);
\draw [->,thick] (a53.center) -- (c4.15);
\draw [->,thick] (a70.center) .. controls +(west:1.3) and +(east:1.3) .. (c5.340);
}
\end{scope}

\end{tikzpicture}
\end{center}
\vspace{-0.6em}
\begin{itemize}
\item<3-> 引入调序模型来预测调序的方向类型,计算公式如下
\end{itemize}
\visible<3->{
\begin{displaymath}
xiaotong committed
2271
\textrm{P}(\textbf{o}|\textbf{s},\textbf{t},\textbf{a}) = \prod_{i=1}^{K} \textrm{P}(o_i| \bar{s}_{a_i}, \bar{t}_i, a_{i-1}, a_i)
姜雨帆 committed
2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284
\end{displaymath}
}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 调序模型2:MSD模型
\begin{frame}{调序模型2:MSD模型(续)}
% 参考NiuTrans Manual
\begin{itemize}
\item 来详细的分析一下
\vspace{-1em}
\begin{displaymath}
姜雨帆 committed
2285
\Pr(\textbf{o}|\textbf{s},\textbf{t},\textbf{a}) = \prod_{i=1}^{K} \Pr(o_i| \bar{s}_{a_i}, \bar{t}_i, a_{i-1}, a_i)
姜雨帆 committed
2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306
\end{displaymath}
\vspace{-1em}
    \begin{itemize}
    \item 其中$a_i$$\bar{t}_i$$\bar{s}_{a_i}$的词对齐,$\bar{t}_1...\bar{t}_K$为目标语短语序列
    \item $o_i$为相应的调序类型,$O=\{M,S,D\}$,与$a_i$$a_{i-1}$有关
    \end{itemize}

\vspace{-0.5em}
\begin{displaymath}
o_i = \left\{ \begin{array}{ll}
      M & \textrm{if $a_i - a_{i-1} = 1$}\\
      S & \textrm{if $a_i - a_{i-1} = -1$}\\
      D & \textrm{otherwise}\\
      \end{array} \right. \nonumber
\end{displaymath}
\vspace{-0.5em}
	\begin{itemize}
	\item 针对不同的调序类型,调序模型如下
	\end{itemize}
\vspace{0.1em}
\begin{displaymath}
姜雨帆 committed
2307
f_{\textrm{M-pre}}(d) = \prod_{i=1}^{K} \Pr(o_i = M| \bar{s}_{a_i}, \bar{t}_i, a_{i-1}, a_i)
姜雨帆 committed
2308 2309 2310
\end{displaymath}
\vspace{-0.8em}
	\begin{itemize}
姜雨帆 committed
2311
	\item 我们还可以得到$f_{\textrm{S-pre}}(d)$$f_{\textrm{D-pre}}(d)$,此外将$a_{i-1}$换成$a_{i+1}$,还可以得到每个短语与后面短语的调序类型
姜雨帆 committed
2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465
	\end{itemize}

\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 调序模型2:MSD模型
\begin{frame}{调序模型2:MSD模型(续)}
% 参考NiuTrans Manual
\begin{itemize}
\item 统计每种调序方向中每个抽取短语对的频率,使用极大似然估计对其概率分布进行估计
	\begin{itemize}
	\item 基于词的调序模型和基于短语的调序模型
	\item<2-> 假设$\bar{t}_i$$(t_u,...,t_v)$组成,$\bar{s}_{a_i}$$(s_x,...,s_y)$组成
	\end{itemize}
\end{itemize}
\vspace{-0.2em}
\visible<2->{
\begin{center}
\begin{tikzpicture}

\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.1cm}

\tikzstyle{elementnode} = [rectangle,anchor=center]
\tikzstyle{srcnode} = [font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]

% alignment matrix1
\begin{scope}[scale=0.9,yshift=0.12in]
\foreach \i / \j / \c in
    {0/5/0.15, 1/5/0.15, 2/5/0.15, 3/5/0.15, 4/5/0.15, 5/5/0.15,
    0/4/0.15, 1/4/0.15, 2/4/0.15, 3/4/0.15, 4/4/0.15, 5/4/0.15,
    0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15, 4/3/0.15, 5/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15, 4/2/0.15, 5/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15, 4/1/0.15, 5/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15, 4/0/0.15, 5/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};

% source
\node[srcnode] (src01) at (-5.9*0.5*\hnode,-1.05*\hnode+5.4*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (src02) at ([xshift=0.5\hnode]src01.south west) {\scriptsize{$t_2$}};
\node[srcnode] (src03) at ([xshift=0.5\hnode]src02.south west) {\scriptsize{$t_3$}};
\node[srcnode] (src04) at ([xshift=0.5\hnode]src03.south west) {\scriptsize{$t_4$}};
\node[srcnode] (src05) at ([xshift=0.5\hnode]src04.south west) {\scriptsize{$t_5$}};
\node[srcnode] (src06) at ([xshift=0.5\hnode]src05.south west) {\scriptsize{$t_6$}};

% target
\node[tgtnode] (tgt01) at (-6.0*0.5*\hnode,-1.05*\hnode+5.4*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (tgt02) at ([yshift=-0.5\hnode]tgt01.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (tgt03) at ([yshift=-0.5\hnode]tgt02.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (tgt04) at ([yshift=-0.5\hnode]tgt03.north east) {\scriptsize{$s_4$}};
\node[tgtnode] (tgt05) at ([yshift=-0.5\hnode]tgt04.north east) {\scriptsize{$s_5$}};
\node[tgtnode] (tgt06) at ([yshift=-0.5\hnode]tgt05.north east) {\scriptsize{$s_6$}};

%% alignment matrix2
\foreach \i / \j / \c in
    {0/5/0.15, 1/5/0.15, 2/5/0.15, 3/5/0.15, 4/5/0.15, 5/5/0.15,
    0/4/0.15, 1/4/0.15, 2/4/0.15, 3/4/0.15, 4/4/0.15, 5/4/0.15,
    0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15, 4/3/0.15, 5/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15, 4/2/0.15, 5/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15, 4/1/0.15, 5/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15, 4/0/0.15, 5/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (b\i\j) at (0.5*\hnode*\i+4*0.5*\hnode,0.5*\hnode*\j-1.05*\hnode) {};

% source
\node[srcnode] (src11) at (3.5*0.5*\hnode,-1.05*\hnode+5.4*0.5*\hnode) {\scriptsize{$t_1$}};
\node[srcnode] (src12) at ([xshift=0.5\hnode]src11.south west) {\scriptsize{$t_2$}};
\node[srcnode] (src13) at ([xshift=0.5\hnode]src12.south west) {\scriptsize{$t_3$}};
\node[srcnode] (src14) at ([xshift=0.5\hnode]src13.south west) {\scriptsize{$t_4$}};
\node[srcnode] (src15) at ([xshift=0.5\hnode]src14.south west) {\scriptsize{$t_5$}};
\node[srcnode] (src16) at ([xshift=0.5\hnode]src15.south west) {\scriptsize{$t_6$}};

% target
\node[tgtnode] (tgt11) at (3.4*0.5*\hnode,-1.05*\hnode+5.4*0.5*\hnode) {\scriptsize{$s_1$}};
\node[tgtnode] (tgt12) at ([yshift=-0.5\hnode]tgt11.north east) {\scriptsize{$s_2$}};
\node[tgtnode] (tgt13) at ([yshift=-0.5\hnode]tgt12.north east) {\scriptsize{$s_3$}};
\node[tgtnode] (tgt14) at ([yshift=-0.5\hnode]tgt13.north east) {\scriptsize{$s_4$}};
\node[tgtnode] (tgt15) at ([yshift=-0.5\hnode]tgt14.north east) {\scriptsize{$s_5$}};
\node[tgtnode] (tgt16) at ([yshift=-0.5\hnode]tgt15.north east) {\scriptsize{$s_6$}};


% word alignment
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la1) at (a23) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la2) at (a22) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (la3) at (a31) {};
\visible<3->{
\node[align=center,elementnode,minimum size=0.5cm,inner sep=0.1pt,fill=red!50] (la4) at (a14) {M};
}

\visible<4->{
\node[align=center,elementnode,minimum size=0.5cm,inner sep=0.1pt,fill=ugreen!50] (la5) at (a44) {S};
}

\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lb1) at (b23) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lb2) at (b22) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (lb3) at (b31) {};
\visible<3->{
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=red!50] (lb4) at (b05) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=red!50] (lb5) at (b14) {};
}
\visible<4->{
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=ugreen!50] (lb6) at (b45) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=ugreen!50] (lb7) at (b54) {};
}

\begin{pgfonlayer}{background}
\node [rectangle,thick,inner sep=0.4em,fill=blue!40,drop shadow,fill opacity=0.85] [fit = (a23) (a31)] (phrase1) {};
\node [rectangle,thick,inner sep=0.4em,fill=blue!40,drop shadow,fill opacity=0.85] [fit = (b23) (b31)] (phrase2) {};
\visible<3->{
\node [rectangle,thick,inner sep=0.4em,fill=red!40,drop shadow,fill opacity=0.85] [fit = (b05) (b14)] (phrase3) {};
}
\visible<4->{
\node [rectangle,thick,inner sep=0.4em,fill=ugreen!40,drop shadow,fill opacity=0.85] [fit = (b45) (b54)] (phrase4) {};
}
\end{pgfonlayer}

\visible<4->{
\node[anchor=north] (s1) at ([xshift=0.6em,yshift=0.1em]b45.east) {S};
}
\visible<3->{
\node[anchor=north] (m1) at ([xshift=0.6em,yshift=0.1em]b05.east) {M};
}

\node[anchor=north] (l1) at ([xshift=1.8em,yshift=-0.5em]a10.south) {\scriptsize{基于词}};
\node[anchor=north] (l2) at ([xshift=2.2em,yshift=-0.5em]b10.south) {\scriptsize{基于短语}};

\visible<3->{
\node [anchor=south west] (p1line1) at ([xshift=-4em,yshift=2em]a05.north west) {\footnotesize{如果在(x-1,u-1)存在对齐点,或者存在可抽取的短语,则$o_i$=M}};
}
\visible<4->{
\node [anchor=north west] (p1line2) at ([yshift=-11.2em]p1line1.south west) {\footnotesize{如果在(x-1,v+1)存在对齐点,或者存在可抽取的短语,则$o_i$=S}};
}
\begin{pgfonlayer}{background}
\visible<3->{
\node [rectangle,inner sep=0.2em,fill=red!10] [fit = (p1line1)] (box1) {};
}
\visible<4->{
\node [rectangle,inner sep=0.2em,fill=ugreen!10] [fit = (p1line2)] (box2) {};
}
\end{pgfonlayer}

%\draw [->,dotted,very thick,red] ([yshift=0.1em]la4.north) .. controls +(north:1) and +(south:1) .. ([xshift=3em,yshift=-0.1em]box1.south west) ;

\end{scope}

\end{tikzpicture}
\end{center}
}
xiaotong committed
2466 2467 2468 2469 2470 2471
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 调序模型3:分类模型
\begin{frame}{调序模型3:分类模型}
% 参考NiuTrans Manual 的最大熵分类
姜雨帆 committed
2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502
\begin{itemize}
\item 还有一种基于最大熵的调序模型,将调序问题看成是一个二分类问题
	\begin{itemize}
	\item 对于相邻的两个短语块,将其合成一个大的更大的块
     \item 根据合成后的顺序$o$,可以分为正序和反序,因此可以看作是一个二分类问题
	\end{itemize}

\vspace{0.1em}

\begin{center}
\begin{tikzpicture}

\begin{scope}[minimum height = 15pt]
\node[anchor=west,fill=ugreen!50,minimum width=3em] (x1) at (0, 0) {\footnotesize{$X_1$}};
\node[anchor=west,fill=blue!50] (x2) at ([xshift=1em]x1.east) {\footnotesize{$X_2$}};

\node[anchor=west,fill=ugreen!50,minimum width=3em] (x3) at ([xshift=3em,yshift=1.2em]x2.east) {\footnotesize{$X_1$}};
\node[anchor=west,fill=blue!50] (x4) at ([xshift=1em]x3.east) {\footnotesize{$X_2$}};

\node[anchor=west,fill=blue!50] (x5) at ([xshift=3em,yshift=-1.2em]x2.east) {\footnotesize{$X_2$}};
\node[anchor=west,fill=ugreen!50,minimum width=3em] (x6) at ([xshift=1em]x5.east) {\footnotesize{$X_1$}};

\draw [->,thick] ([xshift=0.1em]x2.east) -- ([xshift=-0.1em]x3.west);
\draw [->,thick] ([xshift=0.1em]x2.east) -- ([xshift=-0.1em]x5.west);

\node[anchor=west] (l1) at ([xshift=1em]x4.east) {正序};
\node[anchor=west] (l2) at ([xshift=1em]x6.east) {反序};
\end{scope}
\end{tikzpicture}
\end{center}
	\begin{itemize}
xiaotong committed
2503
	\item 但是,对于非连续的调序该模型无法处理
姜雨帆 committed
2504 2505 2506
	\end{itemize}
\item 对于每一种翻译推导$d$,基于最大熵的调序模型的得分计算公式如下
\begin{displaymath}
姜雨帆 committed
2507
f_{\textrm{ME}}(d) = \prod_{<o,X_1,X_2> \in d} \Pr(o|X_1, X_2)
姜雨帆 committed
2508 2509
\end{displaymath}
\end{itemize}
xiaotong committed
2510 2511 2512
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
2513
\subsection{特征及最小错误率训练}
xiaotong committed
2514 2515

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
2516 2517 2518 2519
%%% 模型得分
\begin{frame}{模型得分}
% 定义模型得分 - 不需要算归一化的分母
% 判别式模型使用了三类特征:1)翻译模型特征;2)调序模型特征;3)语言模型
姜雨帆 committed
2520 2521 2522 2523 2524 2525 2526 2527 2528 2529
\begin{itemize}
\item 基于短语的统计机器翻译模型包括三个子模型
	\begin{enumerate}
	\item 短语表:短语翻译及每个短语对应的特征值
	\item 调序模型:短语调序的模型
	\item 语言模型:评价译文流畅度的$n$-gram语言模型
	\end{enumerate}
\item 把每个子模型当作一个特征,为每个模型添加一个权重,然后使用对数线性模型对这些子模型进行建模,对数线性模型的形式如下:
\vspace{-0.8em}
\begin{displaymath}
姜雨帆 committed
2530
\textrm{P}(d,\textbf{t}|\textbf{s}) \propto \exp(\sum_{i=1}^{M} \lambda_i \cdot h_i(d,\textbf{s},\textbf{t}))
姜雨帆 committed
2531 2532 2533 2534 2535 2536 2537
\end{displaymath}
\vspace{-1.2em}
	\begin{itemize}
	\item 将三个子模型作为具体的特征代入有
	\end{itemize}
\vspace{0.8em}
\begin{displaymath}
姜雨帆 committed
2538
\textrm{P}(d,\textbf{t}|\textbf{s}) = \prod_{(\bar{s},\bar{t}) \in d} \Pr(\bar{t}|\bar{s})^{\lambda_{1}} \times f(d)^{\lambda_{2}} \times \Pr\nolimits_{\textrm{lm}}(\mathbf{t})^{\lambda_{lm}}
姜雨帆 committed
2539 2540 2541
\end{displaymath}
\item 可以引入更多的特征来提高翻译质量(下面介绍)
\end{itemize}
xiaotong committed
2542 2543 2544 2545 2546 2547
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 特征的具体形式
\begin{frame}{特征}
% 给出特征列表
姜雨帆 committed
2548
\begin{itemize}
姜雨帆 committed
2549 2550
\item \textbf{特征1-2: 短语翻译概率},即正向翻译概率$\Pr(\bar{s}|\bar{t})$和反向翻译概率$\Pr(\bar{t}|\bar{s})$。是基于短语的统计机器翻译模型中最主要的特征。
\item \textbf{特征3-4: 词汇翻译概率},即正向词汇翻译概率$\Pr_{\textrm{lex}}(\bar{t}|\bar{s})$和反向词汇翻译概率$\Pr_{\textrm{lex}}(\bar{s}|\bar{t})$。用来描述短语对中源语端单词和目标语端单词的对应关系
姜雨帆 committed
2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563
\item<2-> \textbf{特征5: $n$-gram语言模型},即$\textrm{P}_{\textrm{lm}}(\textbf{t})$。度量译文的流畅度,可以使用大规模目标语单语数据得到。
\item<2-> \textbf{特征6:译文长度},即$|\textbf{t}|$。避免模型倾向于短译文,同时让系统自动学习对译文长度的偏好。
\item<2-> \textbf{特征7:翻译规则数量}。这个特征是为了避免模型仅仅使用少量特征构成翻译推导(因为翻译概率相乘,因子少结果一般会大一些),同时让系统自动学习对使用规则数量的偏好。
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 特征的具体形式
\begin{frame}{特征(续)}
% 给出特征列表
\begin{itemize}
\item \textbf{特征8:源语言被翻译为空的单词数量}。注意,空翻译规则(或特征)有时也被称作evil feature,这类特征在一些数据集上对BLEU有很好的提升作用,但是会造成人工评价的下降,因此需要谨慎使用。
\item \textbf{特征9:基于最大熵的调序模型}$f_{ME}(d)$
姜雨帆 committed
2564
\item \textbf{特征10:基于MSD的调序模型},包括与前一个短语的调序$f_{\textrm{M-pre}}(d)$$f_{\textrm{S-pre}}(d)$$f_{\textrm{D-pre}}(d)$, 和后一个短语的调序$f_{\textrm{M-fol}}(d)$$f_{\textrm{S-fol}}(d)$$f_{\textrm{D-fol}}(d)$
姜雨帆 committed
2565 2566 2567 2568 2569
\item \textbf{最终模型得分}
\vspace{0.3em}
\begin{center}
\begin{tikzpicture}
\begin{scope}[minimum height = 15pt]
姜雨帆 committed
2570 2571 2572
\node[anchor=west,minimum width=3em] (x1) at (0, 0) {\footnotesize{$\textrm{P}(d,\textbf{t}|\textbf{s}) = \prod_{(\bar{s},\bar{t}) \in d} score(\bar{s},\bar{t}) \times f_{\textrm{ME}}(d)^{\lambda_{ME}} \times f_{\textrm{MSD}}(d)^{\lambda_{MSD}} \times$}};
\node[anchor=north west] (x2) at ([xshift=4em,yshift=0.1em]x1.south west) {\footnotesize{$\Pr\nolimits_{\textrm{lm}}(\mathbf{t})^{\lambda_{lm}} \times \exp(\lambda_{TWB} \cdot length(\mathbf{t})) / Z(\mathbf{s})$}};
\node[anchor=north west] (x3) at ([yshift=-1.8em]x1.south west) {\footnotesize{$score(\bar{s},\bar{t}) = \Pr(\bar{t}|\bar{s})^{\lambda_{1}} \times \Pr(\bar{s}|\bar{t})^{\lambda_{2}} \times \Pr\nolimits_{\textrm{lex}}(\bar{t}|\bar{s})^{\lambda_{3}} \times \Pr\nolimits_{\textrm{lex}}(\bar{s}|\bar{t})^{\lambda_{4}} \times$}};
姜雨帆 committed
2573 2574 2575 2576 2577
\node[anchor=north west] (x4) at ([xshift=5em,yshift=0.1em]x3.south west) {\footnotesize{$\exp(\lambda_{PB}) \times \exp(\lambda_{WDB} \cdot \delta(\bar{s} \to null))$}};
\end{scope}
\end{tikzpicture}
\end{center}
\end{itemize}
xiaotong committed
2578 2579 2580 2581 2582 2583
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 特征权重调优
\begin{frame}{特征权重调优}
% 看我MERT的slides
姜雨帆 committed
2584 2585 2586 2587
\begin{itemize}
\item 对于训练样本$S=\{(f_1,r_1),...,(f_s,r_s)\}$,有
	\begin{itemize}
	\item $f_s$为样本中的第$s$个源语句子,$r_s$为相应的译文,通常使用$R=\{r_1,...r_s\}$来表示训练样本的参考译文
姜雨帆 committed
2588
	\item 针对每个源语句子,解码器可以生成一个n-best结果$\{d_{ij}\}$
姜雨帆 committed
2589
	\end{itemize}
姜雨帆 committed
2590
\item 对于模型参数$\lambda$,最佳的翻译推导为$D^*=\{d_{1}^{*},..,d_{i}^{*}\}$
姜雨帆 committed
2591 2592
\vspace{-0.5em}
\begin{displaymath}
姜雨帆 committed
2593
d_{i}^{*} = \argmax_{d_{ij}} \sum_{k=1}^{M} \lambda_k \cdot h_k(d_{ij})
姜雨帆 committed
2594 2595 2596 2597 2598
\end{displaymath}
\vspace{-0.9em}
\item<2-> 最小错误率训练(MERT)
\vspace{0.1em}
	\begin{itemize}
姜雨帆 committed
2599
	\item<2-> 定义一个错误函数Err$(D^*, R)$来衡量推导$D^*$得到的译文与参考答案$R$之间的差距,通过调整权重$\lambda$来最小化错误率
姜雨帆 committed
2600 2601 2602 2603 2604
	\item<2-> 常见的错误函数有词错误率(WER)、位置错误率(PER)、BLEU值以及NIST值
	\end{itemize}
\vspace{0.3em}
\visible<2->{
\begin{displaymath}
姜雨帆 committed
2605
\mathbf{\lambda}^*  =  \argmin_{\mathbf{\lambda}} \mathbf{Err}(D^*, R)
姜雨帆 committed
2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618
\end{displaymath}
}
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 特征权重调优
\begin{frame}{特征权重调优(续)}
% 看我MERT的slides
\begin{itemize}
\item 如何得到最优的$\lambda^*$
	\begin{itemize}
	\item 最简单的方法是枚举所有可能的$\lambda$值,但是这样做效率很低。可以只考虑最优译文发生变化的点:)
姜雨帆 committed
2619
	\item 对于每个训练样本,假设有2-best个推导$\mathbf{d}=\{d_1,d_2\}$,每个推导$d$的得分modelscore($d$)可以表示成关于权重$\lambda_i$的函数
姜雨帆 committed
2620 2621 2622
	\end{itemize}
\vspace{0.2em}
\begin{displaymath}
姜雨帆 committed
2623
\textrm{modelscore}(d) = \lambda_i \cdot h_i(d) + \sum_{k{\ne}i}^{M} \lambda_k \cdot h_k(d) = a \cdot \lambda_i + b
姜雨帆 committed
2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636
\end{displaymath}
\vspace{-0.7em}
\begin{center}
\begin{tikzpicture}
\begin{scope}
\node[anchor=west] (x0) at (0, 0) {};

\draw[->,thick] (x0.center) -- ([xshift=8.2em]x0.east);
\draw[->,thick] (x0.center) -- ([yshift=5.6em]x0.center);

\visible<1-2>{
\draw[thick] ([yshift=1em]x0.center) -- ([xshift=8em,yshift=5em]x0.center);
\draw[thick] ([yshift=2em]x0.center) -- ([xshift=8em,yshift=4em]x0.center);
姜雨帆 committed
2637 2638
\node[anchor=north] (e1) at ([xshift=6em,yshift=6em]x0.south) {\footnotesize{$d_1$}};
\node[anchor=north] (e2) at ([xshift=7em,yshift=4em]x0.south) {\footnotesize{$d_2$}};
姜雨帆 committed
2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655
\node[anchor=north,rotate=90] (e2) at ([xshift=-1.3em,yshift=3.6em]x0.south) {\footnotesize{model score}};
}

\visible<2>{
\node [anchor=center,draw=red,circle,inner sep=2pt,thick] (x1) at ([xshift=4em,yshift=3em]x0.center) {};
\draw[thick,dotted] ([xshift=4em]x0.center) -- ([xshift=4em,yshift=3em]x0.center);
}
\node[anchor=north] (zero) at ([yshift=0.1em]x0.south) {\footnotesize{0}};
\node[anchor=north] (wx) at ([xshift=4em,yshift=0.1em]x0.south) {\footnotesize{$w_x$}};
\node[anchor=north] (wi) at ([xshift=8em,yshift=0.1em]x0.south) {\footnotesize{$w_i$}};

\visible<3->{
\draw[thick] ([yshift=2em]x0.center) -- ([xshift=4em,yshift=2em]x0.center);
\draw[thick] ([xshift=4em,yshift=4em]x0.center) -- ([xshift=8em,yshift=4em]x0.center);

\draw[thick,dotted] ([xshift=4em]x0.center) -- ([xshift=4em,yshift=5.5em]x0.center);

姜雨帆 committed
2656 2657
\node[anchor=north] (e1) at ([xshift=2em,yshift=3em]x0.north) {\footnotesize{$d^*=d_1$}};
\node[anchor=north] (e2) at ([xshift=6.2em,yshift=5em]x0.north) {\footnotesize{$d^*=d_2$}};
姜雨帆 committed
2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688

\node[anchor=north,rotate=90] (e2) at ([xshift=-1.3em,yshift=3.6em]x0.south) {\footnotesize{BLEU}};
\draw[decorate,decoration={brace,amplitude=0.4em},red,thick] ([xshift=3.8em,yshift=0.5em]x0.south) -- ([xshift=8.2em,yshift=0.5em]x0.south);
\node[anchor=north] (wi) at ([xshift=6.1em,yshift=2em]x0.south) {\tiny{\alert{挑选$w_i$}}};
}

\visible<2->{
\node [anchor=east] (line1) at ([xshift=-2.2em,yshift=4.5em]x0.west) {\footnotesize{1.找到最优译文$E^*$发生变化的位置}};
}
\visible<3->{
\node [anchor=north west] (line2) at ([yshift=-0.8em]line1.south west) {\footnotesize{2.对译文按照BLEU值进行排序,\ \ \  }};
\node [anchor=north west] (line3) at ([xshift=0.6em,yshift=-0.1em]line2.south west) {\footnotesize{在分数高的范围中挑选新的$\lambda_i$}};
}

\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,inner sep=0.2em,fill=red!10] [fit = (line1)] (box1) {};
}
\visible<3->{
\node [rectangle,inner sep=0.2em,fill=green!10] [fit = (line2) (line3)] (box2) {};
}
\end{pgfonlayer}

\end{scope}
\end{tikzpicture}
\end{center}
\vspace{-0.3em}
	\begin{itemize}
	\item<4-> 还有一些技巧可以防止训练出现过拟合和陷入局部最优
	\end{itemize}
\end{itemize}
xiaotong committed
2689 2690
\end{frame}

姜雨帆 committed
2691

xiaotong committed
2692
%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
2693 2694 2695
\subsection{栈解码}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
2696 2697 2698
%%% 什么是解码
\begin{frame}{解码问题}
% 定义解码是啥
姜雨帆 committed
2699
\begin{itemize}
姜雨帆 committed
2700
\item 解码是根据模型以及输入原文,找到得分最高的推导 ${d}^*$
姜雨帆 committed
2701
\begin{displaymath}
姜雨帆 committed
2702
d^*  =  \argmax_{d \in D} \textrm{score}(d)
姜雨帆 committed
2703 2704 2705 2706
\end{displaymath}
\vspace{-0.8em}
	\begin{itemize}
	\item 其中 $D$表示所有可能的推导构成的搜索空间。
姜雨帆 committed
2707
	\item $\Pr(d, \mathbf{t}|\mathbf{s})$表示前面提到的所有特征的得分
姜雨帆 committed
2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742
	\end{itemize}
\item 实际解码过程中,通常按从左到右的顺序生成译文,递增的计算翻译概率,同时对已翻译的原文进行标记
\vspace{1em}
\begin{center}
\begin{tikzpicture}

\begin{scope}[minimum height = 18pt]

\node[anchor=east] (s0) at (-0.5em, 0) {$\textbf{s}$:};
\node[anchor=west,fill=ugreen!50] (s1) at (0, 0) {桌子 上};
\node[anchor=west,fill=red!50] (s2) at ([xshift=1em]s1.east) {};
\node[anchor=west,fill=blue!50] (s3) at ([xshift=1em]s2.east) {一个 苹果};

\node[anchor=east] (t0) at (-0.5em, -1.5) {$\textbf{t}$:};
\visible<2->{
\node[anchor=west,fill=red!50] (t1) at (0, -1.5) {There is};
\path[<->, thick] (s2.south) edge (t1.north);
}
\visible<3->{
\node[anchor=west,fill=blue!50] (t2) at ([xshift=1em]t1.east) {an apple};
\path[<->, thick] (s3.south) edge (t2.north);
}
\visible<4->{
\node[anchor=west,fill=ugreen!50] (t3) at ([xshift=1em]t2.east) {on the table};
\path[<->, thick] (s1.south) edge (t3.north);
}

\end{scope}
\end{tikzpicture}
\end{center}
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 什么是解码
xiaotong committed
2743
\begin{frame}{解码问题 - 翻译选项}
姜雨帆 committed
2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796
% 定义解码是啥
\begin{itemize}
\item 对于每个输入的源语句子$\textbf{s}$,可以从短语表中查询到所有可能的翻译选项,用来翻译
\vspace{0.1em}
\begin{center}
\begin{tikzpicture}
\begin{scope}[minimum height = 16pt]

\node[anchor=east] (s0) at (-0.8em, 0) {$\textbf{s}$:};
\node[anchor=west] (s1) at (0, 0) {桌子};
\node[anchor=west] (s2) at ([xshift=2em]s1.east) {};
\node[anchor=west] (s3) at ([xshift=2.3em]s2.east) {};
\node[anchor=west] (s4) at ([xshift=2em]s3.east) {一个};
\node[anchor=west] (s5) at ([xshift=1.6em]s4.east) {苹果};

\node [anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=3em] (t11) at ([yshift=-0.5em]s1.south) {table};
\node [anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=3em] (t12) at ([yshift=-0.2em]t11.south) {desk};

\node [anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=3em] (t21) at ([yshift=-0.5em]s2.south) {on};
\node [anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=3em] (t22) at ([yshift=-0.2em]t21.south) {up};

\node [anchor=north,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=3.4em] (t31) at ([yshift=-0.5em]s3.south) {have};
\node [anchor=north,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=3.4em] (t32) at ([yshift=-0.2em]t31.south) {there is};

\node [anchor=north,inner sep=2pt,fill=orange!20,minimum height=1.5em,minimum width=3em] (t41) at ([yshift=-0.5em]s4.south) {one};
\node [anchor=north,inner sep=2pt,fill=orange!20,minimum height=1.5em,minimum width=3em] (t42) at ([yshift=-0.2em]t41.south) {an};

\node [anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=3em] (t51) at ([yshift=-0.5em]s5.south) {apple};
\node [anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=3em] (t52) at ([yshift=-0.2em]t51.south) {apples};

\node [anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=7.2em] (t13) at ([yshift=-3.7em]t12.south west) {on tabel};
\node [anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=7.2em] (t14) at ([yshift=-0.2em]t13.south west) {on the tabel};

\node [anchor=north west,inner sep=2pt,fill=orange!20,minimum height=1.5em,minimum width=7.35em] (t43) at ([yshift=-0.2em]t42.south west) {one apple};
\node [anchor=north west,inner sep=2pt,fill=orange!20,minimum height=1.5em,minimum width=7.35em] (t44) at ([yshift=-0.2em]t43.south west) {an apple};

\node [anchor=north west,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=7.25em] (t23) at ([yshift=-0.2em]t22.south west) {upon there};

\node [anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=11.5em] (t15) at ([yshift=-1.95em]t12.south west) {upon the tabel};

\node [anchor=north west,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=11.8em] (t33) at ([yshift=-3.7em]t32.south west) {there is an apple};
\node [anchor=north west,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=11.8em] (t34) at ([yshift=-0.2em]t33.south west) {have an apple...};

\end{scope}
\end{tikzpicture}
\end{center}
\vspace{0.3em}
\item 正确的翻译都在翻译选项中,但是里面也包含了很多其他翻译选项,接下来介绍如何找到最优的译文?
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 什么是解码
xiaotong committed
2797
\begin{frame}{解码问题 - 假设扩展}
姜雨帆 committed
2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818
% 定义解码是啥
\begin{itemize}
\item 从翻译选项中挑选合适的选项,顺序地构建输出,构建的局部翻译称为翻译假设
	\begin{enumerate}
	\item<1-> 翻译的起点是空假设,局部概率得分是1
	\item<2-> 挑选一个翻译选项扩展为新的翻译假设,同时记录已翻译的原文并计算翻译代价(可以同时生成多种翻译假设)
	\item<3-> 对未覆盖的源语应用上述方法
	\item<4-> 当翻译假设覆盖了所有的原文时,就得到了一个完整的翻译假设,从所有的翻译假设中找到一个概率最高的翻译
	\end{enumerate}
\vspace{0.5em}
\begin{center}
\begin{tikzpicture}
\begin{scope}
\visible<1->{
\node [anchor=north,inner sep=2pt,fill=red!20,minimum height=1.7em,minimum width=3.2em] (h0) at (0,0) {\scriptsize{null}};
\node [anchor=north west,inner sep=1.5pt,fill=black] (hl0) at (h0.north west) {\tiny{{\color{white} \textbf{0}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.7em,fill=black] (pt0) at (h0.east) {\tiny{{\color{white} \textbf{P=1}}}};
}

\visible<2->{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.7em,minimum width=3.2em] (h1) at ([xshift=2.5em]h0.east) {\scriptsize{on}};
姜雨帆 committed
2819
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.7em,minimum width=3.2em] (h2) at ([xshift=2.5em,yshift=2.5em]h0.east) {\scriptsize{table}};
姜雨帆 committed
2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.7em,minimum width=3.2em] (h3) at ([xshift=2.5em,yshift=-2.5em]h0.east) {\scriptsize{there is}};
\node [anchor=north west,inner sep=1.5pt,fill=black] (hl1) at (h1.north west) {\tiny{{\color{white} \textbf{2}}}};
\node [anchor=north west,inner sep=1.5pt,fill=black] (hl2) at (h2.north west) {\tiny{{\color{white} \textbf{1}}}};
\node [anchor=north west,inner sep=1.5pt,fill=black] (hl3) at (h3.north west) {\tiny{{\color{white} \textbf{3}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.7em,fill=black] (pt1) at (h1.east) {\tiny{{\color{white} \textbf{P=.2}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.7em,fill=black] (pt2) at (h2.east) {\tiny{{\color{white} \textbf{P=.3}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.7em,fill=black] (pt3) at (h3.east) {\tiny{{\color{white} \textbf{P=.5}}}};

\draw [->,very thick,ublue] ([xshift=0.1em]pt0.south) -- ([xshift=-0.1em]h1.west);
\draw [->,very thick,ublue] ([xshift=0.1em]pt0.south) -- ([xshift=-0.1em]h2.west);
\draw [->,very thick,ublue] ([xshift=0.1em]pt0.south) -- ([xshift=-0.1em]h3.west);
}

\visible<3->{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.7em,minimum width=3.2em] (h4) at ([xshift=2.5em,yshift=-1.8em]h3.east) {\scriptsize{one}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.7em,minimum width=3.2em] (h5) at ([xshift=2.5em,yshift=0.7em]h3.east) {\scriptsize{an apple}};
姜雨帆 committed
2836 2837
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.7em,minimum width=3.2em] (h6) at ([xshift=2.5em,yshift=0.7em]h1.east) {\scriptsize{table}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.7em,minimum width=3.5em] (h7) at ([xshift=2.5em,yshift=0.7em]h5.east) {\scriptsize{on the table}};
姜雨帆 committed
2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.7em,minimum width=3.2em] (h8) at ([xshift=2.5em,yshift=-2em]h5.east) {\scriptsize{apple}};

\node [anchor=north west,inner sep=1.5pt,fill=black] (hl4) at (h4.north west) {\tiny{{\color{white} \textbf{4}}}};
\node [anchor=north west,inner sep=1.5pt,fill=black] (hl5) at (h5.north west) {\tiny{{\color{white} \textbf{4-5}}}};
\node [anchor=north west,inner sep=1.5pt,fill=black] (hl6) at (h6.north west) {\tiny{{\color{white} \textbf{1}}}};
\node [anchor=north west,inner sep=1.5pt,fill=black] (hl7) at (h7.north west) {\tiny{{\color{white} \textbf{1-2}}}};
\node [anchor=north west,inner sep=1.5pt,fill=black] (hl8) at (h8.north west) {\tiny{{\color{white} \textbf{5}}}};

\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.7em,fill=black] (pt4) at (h4.east) {\tiny{{\color{white} \textbf{P=.1}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.7em,fill=black] (pt5) at (h5.east) {\tiny{{\color{white} \textbf{P=.4}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.7em,fill=black] (pt6) at (h6.east) {\tiny{{\color{white} \textbf{P=.3}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.7em,fill=black] (pt7) at (h7.east) {\tiny{{\color{white} \textbf{P=.4}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.7em,fill=black] (pt8) at (h8.east) {\tiny{{\color{white} \textbf{P=.2}}}};

\draw [->,very thick,ublue] ([xshift=0.1em]pt1.south) -- ([xshift=1em,yshift=0.7em]pt1.south);

\draw [->,very thick,ublue] ([xshift=0.1em]pt2.south) -- ([xshift=1em,yshift=-0.7em]pt2.south);
\draw [->,very thick,ublue] ([xshift=0.1em]pt2.south) -- ([xshift=1em,yshift=0.7em]pt2.south);

\draw [->,very thick,ublue] ([xshift=0.1em]pt6.south) -- ([xshift=1em,yshift=-0.7em]pt6.south);
\draw [->,very thick,ublue] ([xshift=0.1em]pt6.south) -- ([xshift=1em,yshift=0.7em]pt6.south);

\draw [->,very thick,ublue] ([xshift=0.1em]pt3.south) -- ([xshift=-0.1em]h4.west);
\draw [->,very thick,ublue] ([xshift=0.1em]pt3.south) -- ([xshift=-0.1em]h5.west);
\draw [->,very thick,ublue] ([xshift=0.1em]pt3.south) -- ([xshift=-0.1em]h6.west);

\draw [->,very thick,ublue] ([xshift=0.1em]pt5.south) -- ([xshift=-0.1em]h7.west);
\draw [->,very thick,ublue] ([xshift=0.1em]pt5.south) -- ([xshift=1em,yshift=-0.7em]pt5.south);

\draw [->,very thick,ublue] ([xshift=0.1em]pt4.south) -- ([xshift=-0.1em]h8.west);
\draw [->,very thick,ublue] ([xshift=0.1em]pt4.south) -- ([xshift=1em,yshift=-0.7em]pt4.south);
}

\visible<4->{
\draw [->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.2em]h0.west) -- ([xshift=0.7em]h0.east) -- ([xshift=-0.2em]h3.west) -- ([xshift=0.8em]h3.east) -- ([xshift=-0.2em]h5.west) -- ([xshift=0.8em]h5.east) -- ([xshift=-0.2em]h7.west) -- ([xshift=0.8em]h7.east);
\node [anchor=north west] (wtranslabel) at ([yshift=-3em]h0.south west) {\scriptsize{翻译路径:}};
\draw [->,ultra thick,red,line width=1.5pt,opacity=0.7] (wtranslabel.east) -- ([xshift=1.5em]wtranslabel.east);
}
\end{scope}
\end{tikzpicture}
\end{center}
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 假设重组
\begin{frame}{假设重组}
% 描述过程,可能需要几页,注意提到coverage,beam search,hypothesis recombination
\begin{itemize}
\item 随着源语长度的增加,搜索空间将变得十分巨大,其中相同的翻译假设可以通过不同的搜索路径得到
	\begin{itemize}
	\item 可以通过\alert{假设重组},来减少翻译假设的数量
	\end{itemize}
\vspace{0.8em}
\begin{center}
\begin{tikzpicture}
\begin{scope}
\visible<2->{
\node [anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.0em] (h0) at (0,0) {\tiny{null}};
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl0) at (h0.north west) {\tiny{{\color{white} \textbf{0}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt0) at (h0.east) {\tiny{{\color{white} \textbf{P=1}}}};

\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.0em] (h2) at ([xshift=1.8em,yshift=2.5em]h0.east) {\tiny{an}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.0em] (h3) at ([xshift=1.8em]h2.east) {\tiny{apple}};

\node [anchor=north west,inner sep=1.0pt,fill=black] (hl2) at (h2.north west) {\tiny{{\color{white} \textbf{1}}}};
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl3) at (h3.north west) {\tiny{{\color{white} \textbf{2}}}};

\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt2) at (h2.east) {\tiny{{\color{white} \textbf{P=.3}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt3) at (h3.east) {\tiny{{\color{white} \textbf{P=.5}}}};

\draw [->,very thick,ublue] ([xshift=0.1em]pt0.south) -- ([xshift=-0.1em]h2.west);
\draw [->,very thick,ublue] ([xshift=0.1em]pt2.south) -- ([xshift=-0.1em]h3.west);

\visible<2>{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.0em] (h1) at ([xshift=5.3em]h0.east) {\tiny{an apple}};
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl1) at (h1.north west) {\tiny{{\color{white} \textbf{1-2}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt1) at (h1.east) {\tiny{{\color{white} \textbf{P=.5}}}};
\draw [->,very thick,ublue] ([xshift=0.1em]pt0.south) -- ([xshift=-0.1em]h1.west);
}
\visible<3->{
\draw [->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=0.1em]pt0.south) -- ([xshift=5em]pt0.south) -- ([yshift=-0.1em]h3.south);
}
}
\visible<4->{
\node [anchor=north west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.0em] (h4) at ([yshift=-4em]h0.south west) {\tiny{null}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.0em] (h5) at ([xshift=1.8em]h4.east) {\tiny{he}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.0em] (h6) at ([xshift=1.8em,yshift=2.5em]h4.east) {\tiny{it}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.0em] (h8) at ([xshift=1.8em]h6.east) {\tiny{is not}};

\node [anchor=north west,inner sep=1.0pt,fill=black] (hl4) at (h4.north west) {\tiny{{\color{white} \textbf{0}}}};
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl5) at (h5.north west) {\tiny{{\color{white} \textbf{1}}}};
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl5) at (h6.north west) {\tiny{{\color{white} \textbf{1}}}};

\node [anchor=north west,inner sep=1.0pt,fill=black] (hl5) at (h8.north west) {\tiny{{\color{white} \textbf{2}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt4) at (h4.east) {\tiny{{\color{white} \textbf{P=1}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt5) at (h5.east) {\tiny{{\color{white} \textbf{P=.3}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt6) at (h6.east) {\tiny{{\color{white} \textbf{P=.4}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt8) at (h8.east) {\tiny{{\color{white} \textbf{P=.2}}}};

\draw [->,very thick,ublue] ([xshift=0.1em]pt4.south) -- ([xshift=-0.1em]h5.west);
\draw [->,very thick,ublue] ([xshift=0.1em]pt4.south) -- ([xshift=-0.1em]h6.west);
\draw [->,very thick,ublue] ([xshift=0.1em]pt6.south) -- ([xshift=-0.1em]h8.west);

\visible<4>{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.0em] (h7) at ([xshift=1.8em]h5.east) {\tiny{is not}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt7) at (h7.east) {\tiny{{\color{white} \textbf{P=.2}}}};
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl5) at (h7.north west) {\tiny{{\color{white} \textbf{2}}}};
\draw [->,very thick,ublue] ([xshift=0.1em]pt5.south) -- ([xshift=-0.1em]h7.west);
}

\visible<5->{
\draw [->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=0.1em]pt5.south) -- ([xshift=1.5em]pt5.south) -- ([yshift=-0.1em]h8.south);
}
}

\visible<2->{
\node [anchor=west] (line1) at ([xshift=2em,yshift=-0.5em]h3.east) {\footnotesize{1.翻译过相同数量的源语,输出}};
\node [anchor=north west] (line2) at ([xshift=0.6em,yshift=-0.1em]line1.south west) {\footnotesize{相同的翻译。舍弃概率低的假设}};
}
\visible<4->{
\node [anchor=west] (line3) at ([xshift=2em,yshift=-0.5em]h8.east) {\footnotesize{2.输出结果略有不同也可以重新}};
\node [anchor=north west] (line4) at ([xshift=0.6em,yshift=-0.1em]line3.south west) {\footnotesize{组合,只要有相同后续代价即可}};
}

\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,inner sep=0.2em,fill=red!10] [fit = (line1) (line2)] (box1) {};
}
\visible<4->{
\node [rectangle,inner sep=0.2em,fill=green!10] [fit = (line3) (line4)] (box2) {};
}
\end{pgfonlayer}

\end{scope}
\end{tikzpicture}
\end{center}
\vspace{0.3em}
\item<5-> 重组假设可以减少内部表示不同,如不同短语切分的情况,能够更严格和高效地搜索
\end{itemize}
xiaotong committed
2978 2979 2980 2981 2982 2983
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 栈解码
\begin{frame}{栈解码}
% 描述过程,可能需要几页,注意提到coverage,beam search,hypothesis recombination
姜雨帆 committed
2984 2985 2986 2987 2988 2989 2990
\begin{itemize}
\item 还有一种减小搜索空间的方法,如果早期发现较差的翻译假设,则将它舍弃,并忽略由它扩展出来的翻译假设
	\begin{itemize}
	\item 整理翻译假设,放进\alert{假设堆栈}
	\item 堆栈按照已翻译的词数进行分类
	\item 如果栈过大,则删掉栈里面最差的那些假设
	\end{itemize}
姜雨帆 committed
2991
\vspace{0.2em}
姜雨帆 committed
2992 2993 2994
\begin{center}
\begin{tikzpicture}
\begin{scope}
姜雨帆 committed
2995
\visible<2->{
姜雨帆 committed
2996 2997 2998
\node [anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.2em] (h0) at (0,0) {\tiny{null}};
\node [anchor=north west,inner sep=1.5pt,fill=black] (hl0) at (h0.north west) {\tiny{{\color{white} \textbf{0}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt0) at (h0.east) {\tiny{{\color{white} \textbf{P=1}}}};
姜雨帆 committed
2999 3000 3001 3002 3003 3004
}
\visible<3->{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.2em] (h13) at ([xshift=2.1em,yshift=5em]h0.east) {\tiny{there is}};
%\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.2em] (h12) at ([xshift=2.1em,yshift=2.5em]h0.east) {\tiny{on}};
\node [anchor=west,inner sep=2pt,minimum height=1.5em,minimum width=2.2em] (h12) at ([xshift=2.1em,yshift=3em]h0.east) {\footnotesize{\textbf{...}}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.2em] (h1) at ([xshift=2.1em]h0.east) {\tiny{tabel}};
姜雨帆 committed
3005

姜雨帆 committed
3006 3007 3008
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl1) at (h1.north west) {\tiny{{\color{white} \textbf{1}}}};
%\node [anchor=north west,inner sep=1.0pt,fill=black] (hl2) at (h12.north west) {\tiny{{\color{white} \textbf{2}}}};
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl3) at (h13.north west) {\tiny{{\color{white} \textbf{3}}}};
姜雨帆 committed
3009 3010 3011


\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt1) at (h1.east) {\tiny{{\color{white} \textbf{P=.2}}}};
姜雨帆 committed
3012
%\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt2) at (h12.east) {\tiny{{\color{white} \textbf{P=.3}}}};
姜雨帆 committed
3013 3014
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt3) at (h13.east) {\tiny{{\color{white} \textbf{P=.5}}}};

姜雨帆 committed
3015 3016 3017 3018 3019 3020
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.2em] (h2) at ([xshift=2.1em]h1.east) {\tiny{have}};
\node [anchor=west,inner sep=2pt,minimum height=1.5em,minimum width=2.2em] (h22) at ([xshift=2.1em]h12.east) {\footnotesize{\textbf{...}}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.2em] (h23) at ([xshift=2.1em]h13.east) {\tiny{an}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.2em] (h3) at ([xshift=2.1em]h2.east) {\tiny{there is}};
\node [anchor=west,inner sep=2pt,minimum height=1.5em,minimum width=2.2em] (h32) at ([xshift=2.1em]h22.east) {\footnotesize{\textbf{...}}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.2em] (h33) at ([xshift=2.1em]h23.east) {\tiny{an apple}};
姜雨帆 committed
3021 3022 3023 3024

\node [anchor=north west,inner sep=1.0pt,fill=black] (hl2) at (h2.north west) {\tiny{{\color{white} \textbf{3}}}};
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl23) at (h23.north west) {\tiny{{\color{white} \textbf{4}}}};
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl3) at (h3.north west) {\tiny{{\color{white} \textbf{2}}}};
姜雨帆 committed
3025
\node [anchor=north west,inner sep=1.0pt,fill=black] (hl33) at (h33.north west) {\tiny{{\color{white} \textbf{4-5}}}};
姜雨帆 committed
3026 3027 3028 3029 3030

\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt2) at (h2.east) {\tiny{{\color{white} \textbf{P=.5}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt23) at (h23.east) {\tiny{{\color{white} \textbf{P=.5}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt3) at (h3.east) {\tiny{{\color{white} \textbf{P=.5}}}};
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=1.5em,fill=black] (pt33) at (h33.east) {\tiny{{\color{white} \textbf{P=.5}}}};
姜雨帆 committed
3031
}
姜雨帆 committed
3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043
\node [anchor=north] (l0) at ([xshift=0.2em,yshift=-0.7em]h0.south) {\scriptsize{\textbf{未译词}}};
\node [anchor=north] (l1) at ([xshift=0.3em,yshift=-0.7em]h1.south) {\scriptsize{\textbf{已译1词}}};
\node [anchor=north] (l2) at ([xshift=0.3em,yshift=-0.7em]h2.south) {\scriptsize{\textbf{已译2词}}};
\node [anchor=north] (l3) at ([xshift=0.3em,yshift=-0.7em]h3.south) {\scriptsize{\textbf{已译3词}}};

\begin{pgfonlayer}{background}
\node [rectangle,inner sep=0.3em,fill=blue!10] [fit = (h0) (pt0)] (box0) {};
\node [rectangle,inner sep=0.3em,fill=blue!10] [fit = (h1) (pt1) (h13)] (box1) {};
\node [rectangle,inner sep=0.3em,fill=blue!10] [fit = (h2) (pt2) (h23)] (box2) {};
\node [rectangle,inner sep=0.3em,fill=blue!10] [fit = (h3) (pt3) (h33)] (box3) {};
\end{pgfonlayer}

姜雨帆 committed
3044 3045 3046 3047
\visible<3->{
\draw [->,thick,red] (h13.north).. controls +(60:0.5) and +(120:0.5) .. (h23.north);
\draw [->,thick,red] (h13.north).. controls +(58:0.8) and +(122:0.8) .. (h33.north);
\draw [->,thick,red] (h1.north).. controls +(60:0.5) and +(120:0.5) .. (h2.north);
姜雨帆 committed
3048
\draw [->,thick,red] (h2.north).. controls +(60:0.5) and +(120:0.5) .. (h3.north);
姜雨帆 committed
3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066
}
\node [anchor=south east] (wtranslabel) at ([xshift=-2em,yshift=-2em]h0.south west) {\scriptsize{\textbf{:假设堆栈}}};
\node [anchor=east,inner sep=2pt,fill=blue!10,minimum height=1em,minimum width=2em] (stacklabel) at ([xshift=-0.1em]wtranslabel.west) {};
\visible<2->{
\node [anchor=east] (line1) at ([xshift=-1.0em,yshift=0em]h0.west) {\footnotesize{0号栈包含空假设}};
}
\visible<3->{
\node [anchor=east] (line2) at ([xshift=-1.5em,yshift=0em]h13.west) {\footnotesize{通过假设扩展产生新的假设}};
\node [anchor=north west] (line3) at ([yshift=0.1em]line2.south west) {\footnotesize{并不断的被存入假设堆栈中}};
}
\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,inner sep=0.1em,fill=ugreen!10] [fit = (line1)] (box1) {};
}
\visible<3->{
\node [rectangle,inner sep=0.1em,fill=red!10] [fit = (line2) (line3)] (box2) {};
}
\end{pgfonlayer}
姜雨帆 committed
3067 3068 3069 3070

\end{scope}
\end{tikzpicture}
\end{center}
姜雨帆 committed
3071
\item<3-> 使用栈解码可以很大程度上提高解码效率
姜雨帆 committed
3072
\end{itemize}
xiaotong committed
3073 3074 3075
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3076 3077 3078
\section{基于层次短语的模型}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094
%%% 第二节的内容
\begin{frame}{Outline}

\vspace{5em}

 \begin{tcolorbox}[enhanced,size=normal,left=2mm,right=1mm,colback=red!5!white,colframe=red!75!black,drop fuzzy shadow]
{\Large
\begin{center}
\textbf{基于层次短语的翻译模型}
\end{center}
}
\end{tcolorbox}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3095
%%%  短语系统的问题 - 数据稀疏和无法处理长距离依赖
xiaotong committed
3096
\begin{frame}{基于短语的方法的不足}
xiaotong committed
3097 3098 3099 3100 3101 3102
\begin{itemize}
\item 短语可以很好的捕捉词语之间的局部搭配和调序,但是长距离依赖需要更长的短语
    \begin{itemize}
    \item 实践中发现使用超过长度3的短语作用不大
    \item 短语非常稀疏,包含多个词的短语大多非常低频
    \end{itemize}
xiaotong committed
3103 3104 3105

    \vspace{0.5em}
    \begin{center}
xiaotong committed
3106
    \begin{tabular}{l | r}
xiaotong committed
3107
    短语(中文) & 训练数据中出现频次 \\ \hline
xiaotong committed
3108 3109
    包含 & 3341 \\
    包含 多个 & 213 \\
xiaotong committed
3110 3111 3112 3113
    包含 多个 词 & 12 \\
    包含 多个 词 的 & 8 \\
    包含 多个 词 的 短语 & 0 \\
    包含 多个 词 的 短语 大多 & 0
xiaotong committed
3114
    \end{tabular}
xiaotong committed
3115
    \end{center}
xiaotong committed
3116

xiaotong committed
3117 3118 3119 3120 3121 3122
\vspace{0.5em}
\item<2-> 简单使用短语和$n$-gram语言模型无法处理长距离的调序
    \begin{itemize}
    \item 引入独立的调序模型,比如简单的基于距离的调序
    \item 当然,也可以设计更加复杂的调序模型
    \end{itemize}
xiaotong committed
3123
\end{itemize}
xiaotong committed
3124 3125 3126
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153
%%%  短语系统的问题 - 一个实例
\begin{frame}{基于短语的方法的不足 - 一个实例}
\begin{itemize}
\item 一个短语翻译不成功的例子(Chiang, 2015)
\end{itemize}

\vspace{-1.5em}
\begin{center}
\begin{tikzpicture}
\begin{scope}
\node [anchor=east] (shead) at (0,0) {源语:};
\node [anchor=west] (swords) at (shead.east) {澳洲\ \ \ \ \ \ 北韩\ \ \ \ 邦交\ \ \ \ 少数\ \ 国家\ \ 之一};
\node [anchor=north east] (thead) at ([yshift=-0.8em]shead.south east) {短语系统:};
\node [anchor=west] (twords) at (thead.east) {Australia is diplomatic relations with North Korea};
\node [anchor=north west] (twords2) at ([yshift=-0.2em]twords.south west) {is one of the few countries};
\node [anchor=north east] (rhead) at ([yshift=-2.2em]thead.south east) {参考译文:};
\node [anchor=west] (rwords) at (rhead.east) {Australia is one of the few countries that have};
\node [anchor=north west] (rwords2) at ([yshift=-0.2em]rwords.south west) {diplomatic relations with North Korea};

\begin{pgfonlayer}{background}
\visible<2->{
\draw[fill=red!20,draw=white] ([xshift=-5.6em]twords.north) rectangle ([xshift=11em]twords.south);
\draw[fill=blue!20,draw=white] ([xshift=-4.8em]twords2.north) rectangle ([xshift=6.3em]twords2.south);
\node [anchor=south east,inner sep=1pt,fill=black] (l1) at ([xshift=11em]twords.south) {\tiny{{\color{white} 1}}};
\node [anchor=south east,inner sep=1pt,fill=black] (l2) at ([xshift=6.3em]twords2.south) {\tiny{{\color{white} 2}}};
}
\end{pgfonlayer}
xiaotong committed
3154

xiaotong committed
3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167
\end{scope}
\end{tikzpicture}
\end{center}

\begin{itemize}
\item<2-> 从短语系统翻译结果可以看出
	\begin{itemize}
	\item diplomatic relations with North Korea能够进行正确调序
	\item one of the few countries能够进行正确调序
	\item \textbf{但是},两个短语(\tikz{\node[fill=black,inner sep=2pt] {\tiny{{\color{white} 1}}};}\tikz{\node[fill=black,inner sep=2pt] {\tiny{{\color{white} 2}}};})没有正确调序 - 怎么办?
	\end{itemize}
\end{itemize}

xiaotong committed
3168 3169 3170
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3171 3172 3173 3174 3175
%%%  引入层次短语规则
\begin{frame}{引入新的翻译单元}
\begin{itemize}
\item 显然,通过由连续单词构成的短语拼装出理想的译文需要比较复杂的机制。但是,语言是有``结构''的,我们可以用一种新的方式描述翻译:
\begin{displaymath}
xiaotong committed
3176
\langle\ \textrm{}\ \textrm{X}_1\ \textrm{}\ \textrm{X}_2,\ \ \textrm{have}\ \textrm{X}_2\ \textrm{with}\ \textrm{X}_1\ \rangle
xiaotong committed
3177 3178
\end{displaymath}

xiaotong committed
3179
这里,$\textrm{X}_1$$\textrm{X}_2$表示变量,源语和目标语相同的变量表示对应关系,变量可以被其它连续词串替换。这样,这种源语言和目标语言的对应构成了一种翻译规则或模版,相当于把``$\textrm{}\ \textrm{X}_1\ \textrm{}\ \textrm{X}_2$''翻译为``$\textrm{have}\ \textrm{X}_2\ \textrm{with}\ \textrm{X}_1$'',调序信息就隐含在变量的编号里
xiaotong committed
3180 3181 3182 3183 3184 3185

\vspace{0.5em}
\item<2-> 类似的,可以写出很多这样的翻译规则

\vspace{-1.5em}
\begin{eqnarray}
xiaotong committed
3186 3187 3188
\langle\ \textrm{X}_1\ \textrm{}\ \textrm{X}_2, & & \textrm{X}_1\ \textrm{is}\ \textrm{X}_2\ \rangle \nonumber \\
\langle\ \textrm{X}_1\ \textrm{之一},& & \textrm{one\ \ of\ \ }\textrm{X}_1\ \rangle \nonumber \\
\langle\ \textrm{X}_1\ \textrm{}\ \textrm{X}_2,& & \textrm{X}_2\ \textrm{that\ \ have\ \ }\textrm{X}_1\ \rangle \nonumber
xiaotong committed
3189 3190 3191
\end{eqnarray}

\end{itemize}
xiaotong committed
3192 3193 3194
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210
%%%  使用翻译规则
\begin{frame}{使用翻译规则描述双语句子生成过程}
\begin{itemize}
\item 翻译过程可以用上述规则描述
    \begin{itemize}
    \item 每个变量在源语和目标语端可以被同步替换
    \end{itemize}
\end{itemize}

\begin{center}
\begin{tikzpicture}
\begin{scope}

\visible<3->{
% rule 1 (source)
\node [anchor=west] (rule1s1) at (0,0) {};
3211
\node [anchor=west,inner sep=2pt,fill=black] (rule1s2) at ([xshift=0.5em]rule1s1.east) {\scriptsize{{\color{white} $\textrm{X}_1$}}};
xiaotong committed
3212
\node [anchor=west] (rule1s3) at ([xshift=0.5em]rule1s2.east) {};
3213
\node [anchor=west,inner sep=2pt,fill=black] (rule1s4) at ([xshift=0.5em]rule1s3.east) {\scriptsize{{\color{white} $\textrm{X}_2$}}};
xiaotong committed
3214 3215 3216

% rule 1 (target)
\node [anchor=west] (rule1t1) at ([xshift=0.8in]rule1s4.east) {have};
3217
\node [anchor=west,inner sep=2pt,fill=black] (rule1t2) at ([xshift=0.5em]rule1t1.east) {\scriptsize{{\color{white} $\textrm{X}_2$}}};
xiaotong committed
3218
\node [anchor=west] (rule1t3) at ([xshift=0.5em]rule1t2.east) {with};
3219
\node [anchor=west,inner sep=2pt,fill=black] (rule1t4) at ([xshift=0.5em]rule1t3.east) {\scriptsize{{\color{white} $\textrm{X}_1$}}};
xiaotong committed
3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237
}

\visible<1->{
% phrase 1 (source and target)
\node [anchor=north] (phrase1s1) at ([yshift=-1em]rule1s2.south) {北韩};
\node [anchor=north] (phrase1t1) at ([yshift=-1em]rule1t4.south) {North Korea};
}

\visible<2->{
% phrase 2 (source and target)
\node [anchor=north] (phrase2s1) at ([yshift=-3em]rule1s4.south) {邦交};
\node [anchor=north] (phrase2t1) at ([yshift=-3em]rule1t2.south) {diplomatic relations};
}

\begin{pgfonlayer}{background}
\visible<3->{
\node [rectangle,draw=red,inner sep=1pt,thick,fill=white,drop shadow] [fit = (rule1s1) (rule1s4)] (rule1s) {};
\node [rectangle,draw=red,inner sep=2pt,thick,fill=white,drop shadow] [fit = (rule1t1) (rule1t4)] (rule1t) {};
xiaotong committed
3238
\draw [<->,dotted,thick,red] ([xshift=0.1em]rule1s.east) -- ([xshift=-0.1em]rule1t.west);
xiaotong committed
3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251
}
\end{pgfonlayer}

\visible<3->{
% edges (phrases 1-2 to rule1)
\draw [->] (phrase1s1.north) -- ([yshift=-0.1em]rule1s2.south);
\draw [->] (phrase1t1.north) -- ([yshift=-0.1em]rule1t4.south);
\draw [->] (phrase2s1.north) -- ([yshift=-0.1em]rule1s4.south);
\draw [->] (phrase2t1.north) -- ([yshift=-0.1em]rule1t2.south);
}

\visible<4->{
% rule 2 (source)
3252
\node [anchor=west,inner sep=2pt,fill=black] (rule2s1) at ([yshift=3.5em,xshift=-0.5em]rule1s1.north west) {\scriptsize{{\color{white} $\textrm{X}_1$}}};
xiaotong committed
3253
\node [anchor=west] (rule2s2) at ([xshift=0.5em]rule2s1.east) {};
3254
\node [anchor=west,inner sep=2pt,fill=black] (rule2s3) at ([xshift=0.5em]rule2s2.east) {\scriptsize{{\color{white} $\textrm{X}_2$}}};
xiaotong committed
3255 3256

% rule 2 (target)
3257
\node [anchor=west,inner sep=2pt,fill=black] (rule2t1) at ([xshift=1.8in]rule2s3.east) {\scriptsize{{\color{white} $\textrm{X}_2$}}};
xiaotong committed
3258
\node [anchor=west] (rule2t2) at ([xshift=0.5em]rule2t1.east) {that};
3259
\node [anchor=west,inner sep=2pt,fill=black] (rule2t3) at ([xshift=0.5em]rule2t2.east) {\scriptsize{{\color{white} $\textrm{X}_1$}}};
xiaotong committed
3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275

% phrase 3 (source and target)
\node [anchor=north] (phrase3s1) at ([yshift=-0.8em]rule2s3.south) {\footnotesize{少数 国家}};
\node [anchor=north] (phrase3t1) at ([yshift=-0.8em]rule2t1.south) {\footnotesize{the few countries}};

% edges (phrase 3 to rule 2 and rule1 to rule2)
\draw [->] (phrase3s1.north) -- ([yshift=-0.1em]rule2s3.south);
\draw [->] (phrase3t1.north) -- ([yshift=-0.1em]rule2t1.south);
\draw [->] ([xshift=2em]rule1s.north west) ..controls +(north:1.5em) and +(south:1.5em).. ([yshift=-0.1em]rule2s1.south);
\draw [->] ([xshift=-2em]rule1t.north east) ..controls +(north:1.5em) and +(south:1.5em).. ([yshift=-0.1em]rule2t3.south);
}

\begin{pgfonlayer}{background}
\visible<4->{
\node [rectangle,draw=blue,inner sep=4pt,thick,fill=white,drop shadow] [fit = (rule2s1) (rule2s3)] (rule2s) {};
\node [rectangle,draw=blue,inner sep=4pt,thick,fill=white,drop shadow] [fit = (rule2t1) (rule2t3)] (rule2t) {};
xiaotong committed
3276
\draw [<->,dotted,thick,blue] ([xshift=0.1em]rule2s.east) -- ([xshift=-0.1em]rule2t.west);
xiaotong committed
3277 3278 3279 3280 3281
}
\end{pgfonlayer}

\visible<5->{
% rule 3 (source)
3282
\node [anchor=west,inner sep=2pt,fill=black] (rule3s1) at ([yshift=2.5em,xshift=4em]rule2s1.north west) {\scriptsize{{\color{white} $\textrm{X}_1$}}};
xiaotong committed
3283 3284 3285
\node [anchor=west] (rule3s2) at ([xshift=0.5em]rule3s1.east) {之一};

% rule 3 (target)
xiaotong committed
3286
\node [anchor=west] (rule3t1) at ([xshift=1.0in]rule3s2.east) {one of};
3287
\node [anchor=west,inner sep=2pt,fill=black] (rule3t2) at ([xshift=0.5em]rule3t1.east) {\scriptsize{{\color{white} $\textrm{X}_1$}}};
xiaotong committed
3288 3289 3290 3291 3292 3293 3294 3295 3296 3297

% edges: rule 2 to rule 3
\draw [->] ([xshift=-1em]rule2s.north) ..controls +(north:1.2em) and +(south:1.2em).. ([yshift=-0.1em]rule3s1.south);
\draw [->] ([xshift=1em]rule2t.north) ..controls +(north:1.2em) and +(south:1.2em).. ([yshift=-0.1em]rule3t2.south);
}

\begin{pgfonlayer}{background}
\visible<5->{
\node [rectangle,draw=ugreen,inner sep=1pt,thick,fill=white,drop shadow] [fit = (rule3s1) (rule3s2)] (rule3s) {};
\node [rectangle,draw=ugreen,inner sep=2pt,thick,fill=white,drop shadow] [fit = (rule3t1) (rule3t2)] (rule3t) {};
xiaotong committed
3298
\draw [<->,dotted,thick,ugreen] ([xshift=0.1em]rule3s.east) -- ([xshift=-0.1em]rule3t.west);
xiaotong committed
3299 3300 3301 3302 3303
}
\end{pgfonlayer}

\visible<6->{
% rule 4 (source)
3304
\node [anchor=west,inner sep=2pt,fill=black] (rule4s1) at ([yshift=3.5em,xshift=-3.5em]rule3s1.north west) {\scriptsize{{\color{white} $\textrm{X}_1$}}};
xiaotong committed
3305
\node [anchor=west] (rule4s2) at ([xshift=0.5em]rule4s1.east) {};
3306
\node [anchor=west,inner sep=2pt,fill=black] (rule4s3) at ([xshift=0.5em]rule4s2.east) {\scriptsize{{\color{white} $\textrm{X}_2$}}};
xiaotong committed
3307 3308

% rule 2 (target)
3309
\node [anchor=west,inner sep=2pt,fill=black] (rule4t1) at ([xshift=2.0in]rule4s2.east) {\scriptsize{{\color{white} $\textrm{X}_1$}}};
xiaotong committed
3310
\node [anchor=west] (rule4t2) at ([xshift=0.5em]rule4t1.east) {is};
3311
\node [anchor=west,inner sep=2pt,fill=black] (rule4t3) at ([xshift=0.5em]rule4t2.east) {\scriptsize{{\color{white} $\textrm{X}_2$}}};
xiaotong committed
3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327

% phrase 4 (source and target)
\node [anchor=north] (phrase4s1) at ([yshift=-0.8em]rule4s1.south) {\footnotesize{澳洲}};
\node [anchor=north] (phrase4t1) at ([yshift=-0.8em]rule4t1.south) {\footnotesize{Australia}};

% edges (phrase 4 to rule 4 and rule3 to rule4)
\draw [->] (phrase4s1.north) -- ([yshift=-0.1em]rule4s1.south);
\draw [->] (phrase4t1.north) -- ([yshift=-0.1em]rule4t1.south);
\draw [->] ([xshift=1em]rule3s.north) ..controls +(north:1.5em) and +(south:1.5em).. ([yshift=-0.1em]rule4s3.south);
\draw [->] ([xshift=-1em]rule3t.north east) ..controls +(north:1.5em) and +(south:1.5em).. ([yshift=-0.1em]rule4t3.south);
}

\begin{pgfonlayer}{background}
\visible<6->{
\node [rectangle,draw=orange,inner sep=4pt,thick,fill=white,drop shadow] [fit = (rule4s1) (rule4s3)] (rule4s) {};
\node [rectangle,draw=orange,inner sep=4pt,thick,fill=white,drop shadow] [fit = (rule4t1) (rule4t3)] (rule4t) {};
xiaotong committed
3328
\draw [<->,dotted,thick,orange] ([xshift=0.1em]rule4s.east) -- ([xshift=-0.1em]rule4t.west);
xiaotong committed
3329 3330 3331 3332 3333 3334 3335 3336 3337
}
\end{pgfonlayer}

\end{scope}
\end{tikzpicture}
\end{center}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3338 3339
\subsection{同步上下文无关文法}

xiaotong committed
3340

xiaotong committed
3341
%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3342
%%%  上下文无关文法
xiaotong committed
3343
\begin{frame}{同步上下文无关文法}
xiaotong committed
3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383
\begin{itemize}
\item 以上这种对翻译的描述方式,可以用同步上下文无关文法来定义,记Synchronous Context-Free Grammar(SCFG)
\end{itemize}

\begin{beamerboxesrounded}[upper=uppercolblue,lower=lowercolblue,shadow=true]{定义 - 同步上下文无关文法}
{\small
一个同步上下文无关文法由五部分构成$(N, T_s, T_t, I, R)$,其中 \\
1. $N$是非终结符集合 \\
2. $T_s$$T_t$分别是源语言和目标语终结符集合\\
3. $I \subseteq N$起始非终结符集合\\
4. $R$是规则集合,每条规则$r \in R$有如下形式

\begin{displaymath}
\textrm{LHS} \to <\alpha, \beta, \sim>
\end{displaymath}
其中,$\textrm{LHS} \in N$表示规则的左部,它是一个非终结符;规则右部由三部分组成,$\alpha \in (N \bigcup T_s)^{*}$表示由源语言终结符和非终结符组成的串;$\beta \in (N \bigcup T_t)^{*}$ 表示由目标语言终结符和非终结符组成的串;$\sim$表示$\alpha$$\beta$中终结符的1-1对应关系
}
\end{beamerboxesrounded}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  上下文无关文法 - 一些实例
\begin{frame}{同步上下文无关文法 - 实例}
\begin{itemize}
\item SCFG可以被看做是对CFG的扩展,相当于把单语的CFG扩展到双语,如下是一些SCFG规则,其中每个规则非终结符的对应用非终结符的标号表示
\begin{eqnarray}
\textrm{S} & \to & <\textrm{NP}_1\ \textrm{希望}\ \textrm{VP}_2,\ \textrm{NP}_1\ \textrm{wish to}\ \textrm{VP}_2> \nonumber \\
\textrm{VP}& \to & <\textrm{}\ \textrm{NP}_1\ \textrm{感到}\ \textrm{VP}_2,\ \textrm{be}\ \textrm{VP}_2\ \textrm{with}\ \textrm{NP}_1> \nonumber \\
\textrm{NN} & \to & <\textrm{强大},\ \textrm{strong}> \nonumber
\end{eqnarray}

\item<2-> 这里NP、VP等是有语言学意义的非终结符。当然,在机器翻译中这些并不是必要的,可以使用更简单的文法,只包含一种非终结符
\begin{eqnarray}
\textrm{X} & \to & <\textrm{X}_1\ \textrm{希望}\ \textrm{X}_2,\ \textrm{X}_1\ \textrm{wish to}\ \textrm{X}_2> \nonumber \\
\textrm{X}& \to & <\textrm{}\ \textrm{X}_1\ \textrm{感到}\ \textrm{X}_2,\ \textrm{be}\ \textrm{X}_2\ \textrm{with}\ \textrm{X}_1> \nonumber \\
\textrm{X} & \to & <\textrm{强大},\ \textrm{strong}> \nonumber
\end{eqnarray}

\end{itemize}
xiaotong committed
3384 3385 3386
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416
%%%  一个完整文法的例子
\begin{frame}{一个完整的文法}
\begin{itemize}
\item 对于一个中文-英文句对,假设可以得到如下同步上下文无关文法\\
    \vspace{0.3em}
    \textbf{源语}\ \ \ 进口 大幅度 下降 了 \\
    \vspace{0.3em}
    \textbf{目标语}:The imports have drastically fallen \\
    \vspace{1.0em}
    \textbf{SCFG}\\
    \vspace{-1.5em}
    \begin{eqnarray}
    r_1:\ \ \ \textrm{X} & \to & \langle\ \textrm{进口}\ \textrm{X}_1,\ \textrm{The imports}\ \textrm{X}_1\ \rangle \nonumber \\
    r_2:\ \ \ \textrm{X}& \to & \langle\ \textrm{X}_1\ \textrm{下降}\ \textrm{X}_2,\ \textrm{X}_2\ \textrm{X}_1\ \textrm{fallen}\ \rangle \nonumber \\
    r_3:\ \ \ \textrm{X} & \to & \langle\ \textrm{大幅度},\ \textrm{drastically}\ \rangle \nonumber \\
    r_4:\ \ \ \textrm{X} & \to & \langle\ \textrm{},\ \textrm{have}\ \rangle \nonumber
    \end{eqnarray}

    其中,规则$r_1$$r_2$是右部含有变量的规则,这些变量可以被其它规则的右部替换;规则$r_2$是调序规则;规则$r_3$$r_4$是纯词汇化规则,表示单词或者短语的翻译
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  推导
\begin{frame}{翻译规则的推导}
\begin{itemize}
\item 使用SCFG规则的过程构成了一个\alert{推导},每次规则的使用都会同步替换源语言和目标语言串中的一个非终结符\\
\vspace{-2.0em}

\begin{eqnarray}
xiaotong committed
3417 3418 3419 3420 3421
& & \langle\ \textrm{X}_1, \textrm{X}_1\ \rangle \nonumber \\
\visible<2->{& \xrightarrow[]{r_1} & \langle\ \alert{\textrm{进口}\ \textrm{X}_2},\ \alert{\textrm{The imports}\ \textrm{X}_2}\ \rangle \nonumber \\}
\visible<3->{& \xrightarrow[]{r_2} & \langle\ \textrm{进口}\ \alert{\textrm{X}_3\ \textrm{下降}\ \textrm{X}_4},\ \textrm{The imports}\ \alert{\textrm{X}_4\ \textrm{X}_3\ \textrm{fallen}}\ \rangle \nonumber \\}
\visible<4->{& \xrightarrow[]{r_3} & \langle\ \textrm{进口}\ \alert{\textrm{大幅度}}\ \textrm{下降}\ \textrm{X}_4, \nonumber \\}
\visible<4->{&                     & \ \textrm{The imports}\ \textrm{X}_4\ \alert{\textrm{drastically}}\ \textrm{fallen}\ \rangle \nonumber \\}
姜雨帆 committed
3422
\visible<5->{& \xrightarrow[]{r_4} & \langle\ \textrm{进口}\ \textrm{大幅度}\ \textrm{下降}\ \alert{\textrm{}}, \nonumber \\}
xiaotong committed
3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435
\visible<5->{&                     & \ \textrm{The imports}\ \alert{\textrm{have}}\ \textrm{drastically}\ \textrm{fallen}\ \rangle \nonumber}
\end{eqnarray}

\visible<6->{
这里把$d$定义为由规则$r_1, r_2, r_3, r_4$构成的SCFG推导,记作
\begin{displaymath}
d = r_1 \circ r_2 \circ r_3 \circ r_4
\end{displaymath}

显然$d$定义了从源于句子生成目标语译文的一个过程
}

\end{itemize}
xiaotong committed
3436 3437 3438
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3439
%%%  glue rules
xiaotong committed
3440
\begin{frame}{胶水规则}
xiaotong committed
3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455
\begin{itemize}
\item 在实际系统中往往会遇到需要把两个局部翻译线性的拼接到一起的情况,因此可以在文法中引入胶水规则(glue rule)来处理,形式如下
\begin{eqnarray}
\textrm{S} & \to & \langle\ \textrm{S}_1\ \textrm{X}_2,\ \textrm{S}_1\ \textrm{X}_2\ \rangle \nonumber \\
\textrm{S} & \to & \langle\ \textrm{X}_1,\ \textrm{X}_1\ \rangle \nonumber
\end{eqnarray}
\item<2-> 本质上,胶水规则会顺序的拼接若干片段,最后整个句子会被归纳为$\textrm{S}$
\begin{eqnarray}
\textrm{S} & \to & \langle\ \textrm{S}_1\ \textrm{X}_2,\ \textrm{S}_1\ \textrm{X}_2\ \rangle \nonumber \\
                & \to & \langle\ \textrm{S}_3\ \textrm{X}_4\ \textrm{X}_2,\ \textrm{S}_3\ \textrm{X}_4\ \textrm{X}_2\ \rangle \nonumber \\
                & \to & ... \nonumber \\
                & \to & \langle\ \textrm{X}_n\ ...\ \textrm{X}_4\ \textrm{X}_2,\ \textrm{X}_n\ ...\ \textrm{X}_4\ \textrm{X}_2\ \rangle \nonumber
\end{eqnarray}
\item<2-> 胶水规则大大提高了系统的健壮性(即使没有复杂规则,翻译可以顺序拼接),也体现了语言翻译单调性的假设
\end{itemize}
xiaotong committed
3456 3457 3458
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3459 3460 3461
%%%  文法驱动的统计机器翻译流程
\begin{frame}{文法驱动的机器翻译流程}
\begin{itemize}
3462
\item 同步翻译文法给我们带来了新的思路:可以通过不断使用文法规则完成翻译过程。这类模型的基本流程如下:
xiaotong committed
3463 3464 3465 3466 3467 3468
\end{itemize}

\begin{center}
\begin{tikzpicture}
\begin{scope}

3469 3470 3471
\tikzstyle{datanode} = [minimum width=7em,minimum height=1.7em,fill=ublue,rounded corners=0.7em];
\tikzstyle{modelnode} = [minimum width=7em,minimum height=1.7em,fill=darkred,rounded corners=0.2em];
\tikzstyle{decodingnode} = [minimum width=7em,minimum height=1.7em,fill=ugreen,rounded corners=0.2em];
xiaotong committed
3472 3473 3474 3475 3476 3477 3478 3479 3480 3481

\node [datanode,anchor=north west] (bitext) at (0,0) {{\color{white} \scriptsize{训练用双语数据}}};
\node [modelnode, anchor=north west] (gi) at ([xshift=2em,yshift=-0.2em]bitext.south east) {{\color{white} \scriptsize{文法(规则)抽取}}};
\node [datanode,anchor=north east] (birules) at ([xshift=-2em,yshift=-0.2em]gi.south west) {{\color{white} \scriptsize{同步翻译文法}}};
\node [modelnode, anchor=north west] (training) at ([xshift=2em,yshift=-0.2em]birules.south east) {{\color{white} \scriptsize{特征值学习}}};
\node [datanode,anchor=north east] (model) at ([xshift=-2em,yshift=-0.2em]training.south west) {{\color{white} \scriptsize{翻译模型}}};
\node [decodingnode, anchor=north west] (tuning) at ([xshift=2em,yshift=-0.2em]model.south east) {{\color{white} \scriptsize{特征权重调优}}};
\node [datanode,anchor=north east] (tuningdata) at ([xshift=-2em,yshift=-0.2em]tuning.south west) {{\color{white} \scriptsize{调优用双语数据}}};
\node [decodingnode, anchor=north west] (decoding) at ([xshift=2em,yshift=-0.2em]tuningdata.south east) {{\color{white} \scriptsize{解码新句子}}};

3482 3483 3484 3485
\node [datanode,anchor=south west] (monotext) at ([xshift=2em,yshift=0.2em]training.north east) {{\color{white} \scriptsize{目标语数据}}};
\node [modelnode,anchor=south west] (lm) at ([xshift=2em,yshift=0.2em]tuning.north east) {{\color{white} \scriptsize{$n$-gram语言建模}}};
\node [datanode,anchor=south west] (lmmodel) at ([xshift=2em,yshift=0.2em]decoding.north east) {{\color{white} \scriptsize{语言模型}}};

xiaotong committed
3486 3487 3488 3489 3490 3491 3492
\draw [->,very thick] ([yshift=-0.3em,xshift=0.1em]bitext.east) -- ([yshift=0.1em]gi.north west);
\draw [->,very thick] ([yshift=-0.1em]gi.south west) -- ([yshift=0.3em,xshift=0.1em]birules.east);
\draw [->,very thick] ([yshift=-0.3em,xshift=0.1em]birules.east) -- ([yshift=0.1em]training.north west);
\draw [->,very thick] ([yshift=-0.1em]training.south west) -- ([yshift=0.3em,xshift=0.1em]model.east);
\draw [->,very thick] ([yshift=-0.3em,xshift=0.1em]model.east) -- ([yshift=0.1em]tuning.north west);
\draw [->,very thick] ([yshift=-0.1em]tuning.south) -- ([yshift=0.1em]decoding.north);
\draw [->,very thick] ([yshift=0.3em,xshift=0.1em]tuningdata.east) -- ([yshift=-0.1em]tuning.south west);
3493 3494 3495 3496

\draw [->,very thick] ([yshift=-0.1em]monotext.south) -- ([yshift=0.1em]lm.north);
\draw [->,very thick] ([yshift=-0.1em]lm.south) -- ([yshift=0.1em]lmmodel.north);
\draw [->,very thick] ([yshift=0.3em,xshift=-0.1em]lmmodel.west) -- ([yshift=-0.1em]tuning.south east);
3497
\draw [->,very thick] ([yshift=-0.3em,xshift=-0.1em]lmmodel.west) -- ([yshift=0.1em]decoding.north east);
xiaotong committed
3498 3499 3500 3501
\end{scope}
\end{tikzpicture}
\end{center}

xiaotong committed
3502 3503 3504
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3505 3506 3507
\subsection{层次短语规则及翻译特征}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3508 3509 3510
%%%  翻译规则抽取
\begin{frame}{层次短语规则抽取}
% 还是David Chiang的论文
姜雨帆 committed
3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630
\begin{itemize}
\item 如何抽取规则
    \begin{itemize}
    \item 首先进行短语抽取,从词对齐矩阵中抽取得到所有与词对齐保持一致的短语对
    \item<3-> 在抽取得到的短语中,找到其中包含的子短语,使用非终结符进行替换,就得到了一条规则
    \end{itemize}
\end{itemize}
\vspace{-1.5em}
\begin{center}
\begin{tikzpicture}

\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.1cm}

\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [rotate=45,font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]

% alignment matrix
\begin{scope}[scale=1.0,yshift=0.12in]
\foreach \i / \j / \c in
    {0/5/0.15, 1/5/0.15, 2/5/0.15, 3/5/0.15, 4/5/0.15, 5/5/0.15, 6/5/0.15, 7/5/0.15,
    0/4/0.15, 1/4/0.15, 2/4/0.15, 3/4/0.15, 4/4/0.15, 5/4/0.15, 6/4/0.15, 7/4/0.15,
    0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15, 4/3/0.15, 5/3/0.15, 6/3/0.15, 7/3/0.15,
    0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15, 4/2/0.15, 5/2/0.15, 6/2/0.15, 7/2/0.15,
    0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15, 4/1/0.15, 5/1/0.15, 6/1/0.15, 7/1/0.15,
    0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15, 4/0/0.15, 5/0/0.15, 6/0/0.15, 7/0/0.15}
    \node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-0.05*\hnode) {};

% source
\node[srcnode] (src1) at (-5.4*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{The}};
\node[srcnode] (src2) at ([xshift=0.5\hnode]src1.south west) {\scriptsize{weather}};
\node[srcnode] (src3) at ([xshift=0.5\hnode]src2.south west) {\scriptsize{is}};
\node[srcnode] (src4) at ([xshift=0.5\hnode]src3.south west) {\scriptsize{very}};
\node[srcnode] (src5) at ([xshift=0.5\hnode]src4.south west) {\scriptsize{good}};
\node[srcnode] (src6) at ([xshift=0.5\hnode]src5.south west) {\scriptsize{today}};
\node[srcnode] (src7) at ([xshift=0.5\hnode]src6.south west) {\scriptsize{.}};
\node[srcnode] (src8) at ([xshift=0.5\hnode]src7.south west) {\scriptsize{EOS}};

% target
\node[tgtnode] (tgt1) at (-6.0*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{今天}};
\node[tgtnode] (tgt2) at ([yshift=-0.5\hnode]tgt1.north east) {\scriptsize{天气}};
\node[tgtnode] (tgt3) at ([yshift=-0.5\hnode]tgt2.north east) {\scriptsize{}};
\node[tgtnode] (tgt4) at ([yshift=-0.5\hnode]tgt3.north east) {\scriptsize{}};
\node[tgtnode] (tgt5) at ([yshift=-0.5\hnode]tgt4.north east) {\scriptsize{}};
\node[tgtnode] (tgt6) at ([yshift=-0.5\hnode]tgt5.north east) {\scriptsize{EOS}};

% word alignment
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l04) at (a04) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l14) at (a14) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l55) at (a55) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l33) at (a33) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l42) at (a42) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l61) at (a61) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l70) at (a70) {};

\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,draw=red,thick,inner sep=0.6em,fill=white,drop shadow] [fit = (a04) (a14) (a24) (a33) (a42)] (phrase1) {};
}
\visible<3->{
\node [rectangle,draw=ugreen,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (a04) (a14)] (phrase2) {};
}
\end{pgfonlayer}

\end{scope}

\begin{scope}[xshift = 1.3in, yshift = 1.8in]
{\scriptsize
\node (phrase) {\textbf{抽取得到的短语:}};
\draw[-] (phrase.south west)--([xshift=1.9in]phrase.south west);
\node[anchor=north west] (rules) at ([yshift=-7.5em]phrase.south west) {\textbf{抽取得到的规则:}};
\draw[-] (rules.south west)--([xshift=1.9in]rules.south west);

\visible<2->{
\node[anchor=north west] (p1) at ([yshift=-0.3em]phrase.south west) {天气真好 -- The weather is very good};
}

\visible<3->{
\node[anchor=north west] (r1) at ([yshift=-0.3em]rules.south west) {$\mathrm{X_1}$真好 -- $\mathrm{X_1}$ is very good};
}

\visible<4->{
\node[anchor=north west] (p2) at ([yshift=-0.4em]p1.south west) {天气 -- The weather is};
\node[anchor=north west] (p3) at ([yshift=-0.4em]p2.south west) {天气真 -- The weather is very};
\node[anchor=north west] (p4) at ([yshift=-0.4em]p3.south west) {...};
\node[anchor=north west] (r2) at ([yshift=-0.4em]r1.south west) {天气真$\mathrm{X_1}$ -- The weather is very $\mathrm{X_1}$};
\node[anchor=north west] (r3) at ([yshift=-0.4em]r2.south west) {$\mathrm{X_1}$$\mathrm{X_2}$ -- $\mathrm{X_1}$ is very $\mathrm{X_2}$};
\node[anchor=north west] (r4) at ([yshift=-0.4em]r3.south west) {...};
}

\begin{pgfonlayer}{background}
\visible<2-3>{
\node [rectangle,thick,inner sep=0.1em,fill=red!20] [fit = (p1)] (pb1) {};
}

\visible<2>{
\draw [->,thick,dotted] ([xshift=0.1em]phrase1.east) .. controls +(east:2) and +(west:1.5) ..  ([xshift=-0.1em]p1.west);
}

\visible<3>{
\node [rectangle,thick,inner sep=0.1em,fill=ugreen!20] [fit = (r1)] (rb1) {};
\draw [->,thick,dotted] ([xshift=0.1em]phrase1.east) .. controls +(east:2) and +(west:1.5) ..  ([xshift=-0.1em]r1.west);
}

\visible<4->{
\node [rectangle,thick,inner sep=0.1em,fill=red!20] [fit = (p1) (p4)] (pb2) {};
\node [rectangle,thick,inner sep=0.1em,fill=ugreen!20] [fit = (r1) (r2) (r4)] (rb2) {};
}
\end{pgfonlayer}

}
\end{scope}
\end{tikzpicture}
\end{center}
xiaotong committed
3631 3632 3633
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3634 3635 3636
%%%  关于文法的约束
\begin{frame}{文法的约束}
% 把文法限制在合理的范围内,使得系统可以处理
3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674
\begin{itemize}
\item 按照上面的方法可以抽取到大量的规则,规则太多会降低训练和解码的效率,甚至影响翻译性能,因此需要加入一些\alert{约束}来限制文法规则的数目
\vspace{0.3em}
\begin{center}
\begin{tikzpicture}

\begin{scope}[minimum height = 18pt]
%\node[anchor=east] (s0) at (0, 0) {$\textrm{X} \ \to \  <\textrm{X}_1\ \textrm{希望}\ \textrm{X}_2,\ \textrm{X}_1\ \textrm{wish to}\ \textrm{X}_2>$};
\node[anchor=north west] (s1) at (0, 0) {$\textrm{X} \ \to \  <\textrm{X}_1\  \textrm{X}_2 \  \textrm{之一},\ \textrm{one of}\ \textrm{X}_1\ \textrm{X}_2>$};
\node[anchor=north west] (s2) at ([yshift=0.1em]s1.south west) {$\textrm{X} \ \to \  <\textrm{X}_1\ \textrm{X}_2\ \textrm{}\ \textrm{X}_3,\ \textrm{X}_1\ \textrm{X}_2\ \textrm{is}\ \textrm{X}_3>$};
\node[anchor=north west] (s3) at ([yshift=0.1em]s2.south west) {$\textrm{X} \ \to \  <\textrm{X}_1\ \textrm{希望...}\ \textrm{X}_2,\ \textrm{X}_1\ \textrm{wish to...}\ \textrm{X}_2>$};
\draw[decorate,decoration={brace,amplitude=0.4em,mirror},red,thick] ([xshift=1.3em,yshift=0.3em]s3.south) -- ([xshift=8.0em,yshift=0.3em]s3.south);
\node[anchor=north] (wi) at ([xshift=4.7em,yshift=-0.0em]s3.south) {\scriptsize{\alert{超过10个词}}};
\visible<2->{
\draw[-,red] (s1.west)--(s1.east);
\draw[-,red] (s2.west)--(s2.east);
\draw[-,red] (s3.west)--(s3.east);
}
\end{scope}
\end{tikzpicture}
\end{center}
\vspace{-0.5em}
\visible<2->{
具体包含如下约束
}
    \begin{enumerate}
    \item<2-> 规则中的非终结符不可以连续的出现
    \item<2-> 每条规则最多包含两个非终结符
    \item<2-> 抽取规则最多可以跨越10个单词
    \end{enumerate}

\item<3-> 除此之外,不同的语言会有不同的文法约束,可参考
\visible<3->{
\textbf{Hierarchical Phrase-Based Translation}\\
\textbf{Chiang, Computational Linguistics, 2007}
}
\end{itemize}

xiaotong committed
3675 3676 3677
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3678 3679 3680
%%%  特征
\begin{frame}{特征}
% 还是David Chiang的论文
3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692
\begin{itemize}
\item 与短语模型一样,层次短语模型也使用判别式模型进行建模 - $\textrm{P}(d,\textbf{t}|\textbf{s}) = \frac{\exp(\sum_{i=1}^{M} \lambda_i \cdot h_i(d,\textbf{s},\textbf{t}))}{\sum_{d',t'}\exp(\sum_{i=1}^{M} \lambda_i \cdot h_i(d',\textbf{s},\textbf{t}'))}$。其中特征权重$\{\lambda_i\}$可以使用最小错误率训练进行调优,特征函数$\{h_i\}$需要用户定义。
\item<2-> 这里,所有层次短语规则满足$\langle\ \alpha, \beta, \sim\ \rangle$的形式
    \begin{itemize}
    \item $\alpha$$\beta$表示源语和目标语的规则串,$\sim$表示他们的对应关系
    \item 此外,定义$\tau(\alpha)$$\tau(\beta)$为源语端和目标语端的规则序列。例如
        \vspace{-0.8em}
        \begin{eqnarray}
        \tau(\alpha) & = & \textrm{}\ \textrm{X}_1\ \textrm{感到}\ \textrm{X}_2 \nonumber \\
        \tau(\beta) & = & \textrm{be}\ \textrm{X}_2\ \textrm{with}\ \textrm{X}_1 \nonumber
        \end{eqnarray}
    \end{itemize}
xiaotong committed
3693
\item<3-> \textbf{特征1-2: 短语翻译概率},即正向翻译概率$\textrm{P}(\tau(\alpha)|\tau(\beta))$和反向翻译概率$\textrm{P}(\tau(\alpha)|\tau(\beta))$。这里,$\tau(\alpha)$$\tau(\beta)$ 都被看做短语,因此可以直接复用短语系统的方法,使用极大似然估计进行计算。
3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  特征
\begin{frame}{特征(续)}
% 给出特征列表
\begin{itemize}
\item \textbf{特征3-4: 词汇翻译概率},即正向词汇翻译概率$\Pr_{lex}(\bar{t}|\bar{s})$和反向词汇翻译概率$\Pr_{lex}(\bar{s}|\bar{t})$。用来描述短语对中源语端单词和目标语端单词的对应关系
\item \textbf{特征5: $n$-gram语言模型},即$\textrm{P}_{\textrm{lm}}(\textbf{t})$。度量译文的流畅度,可以使用大规模目标语单语数据得到。
\item<2-> \textbf{特征6:译文长度},即$|\textbf{t}|$。避免模型倾向于短译文,同时让系统自动学习对译文长度的偏好。
\item<2-> \textbf{特征7:翻译规则数量}。这个特征是为了避免模型仅仅使用少量特征构成翻译推导(因为翻译概率相乘,因子少结果一般会大一些),同时让系统自动学习对使用规则数量的偏好。
\item<2-> \textbf{特征8:源语言被翻译为空的单词数量}。注意,空翻译规则(或特征)有时也被称作evil feature,这类特征在一些数据集上对BLEU有很好的提升作用,但是会造成人工评价的下降,因此需要谨慎使用。
\end{itemize}
xiaotong committed
3708 3709 3710
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3711 3712 3713
\subsection{基于chart的解码}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
3714 3715 3716
%%%  CYK解码
\begin{frame}{CYK解码}
% 看NiuTrans Manual
3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753
\begin{itemize}
\item 基于层次短语的翻译解码与基于短语的模型类似,都是要找到使$\textrm{score}(d)$达到最大的翻译推导$d$
\vspace{-0.5em}
\begin{displaymath}
\hat{d} = \argmax_{d \in D} \textrm{score}(d)
\end{displaymath}
\vspace{-0.8em}
    \begin{itemize}
    \item 由于翻译推导由SCFG构成,使用CYK算法进行解码
	\item CYK算法解码是一个用来判定任意给定的字符串 是否属于一个上下文无关文法的算法,具体流程如下
    \end{itemize}
\vspace{0.5em}
\begin{center}
\begin{tikzpicture}
\node [anchor=south west,rectangle,draw=ublue,thick,inner sep=0.4em,fill=white,drop shadow] (sourceG) at (0,0) {{\color{ublue} \footnotesize{\textbf{S端文法}}}};
\node [anchor=west,rectangle,draw=ublue,thick,inner sep=0.4em,fill=white,drop shadow] (chom) at ([xshift=3.5em]sourceG.east) {{\color{ublue} \footnotesize{\textbf{乔姆斯基范式}}}};
\node [anchor=west,rectangle,draw=ublue,thick,inner sep=0.4em,fill=white,drop shadow] (targetG) at ([xshift=3.5em]chom.east) {{\color{ublue} \footnotesize{\textbf{T端文法}}}};

\draw[->,very thick] ([xshift=0.1em]sourceG.east) -- ([xshift=-0.1em]chom.west);
\draw[->,very thick] ([xshift=-0.1em]targetG.west) -- ([xshift=0.1em]chom.east);

\node [anchor=north west,rectangle,draw=ublue,thick,inner sep=0.4em,fill=white,drop shadow,minimum height=1.2cm] (sourceS) at ([yshift=-1em]sourceG.south west) {{\color{ublue} \footnotesize{\textbf{S端句子}}}};
\node [anchor=north west,rectangle,draw=ublue,thick,inner sep=0.4em,fill=white,drop shadow,minimum height=1.2cm] (targetS) at ([yshift=-1em]targetG.south west) {{\color{ublue} \footnotesize{\textbf{T端句子}}}};
\node [anchor=north,rectangle,draw=ublue,thick,inner sep=0.4em,fill=white,drop shadow,minimum height=1.2cm] (parse) at ([yshift=-1em]chom.south) {{\color{ublue} \footnotesize{\textbf{解析得到最好的翻译}}}};

\draw[->,very thick] ([xshift=0.1em]sourceS.east) -- ([xshift=-0.1em]parse.west);
\draw[->,very thick] ([xshift=0.1em]parse.east) -- ([xshift=-0.1em]targetS.west);
\draw[->,very thick] ([yshift=-0.1em]chom.south) -- ([yshift=0.1em]parse.north);
\end{tikzpicture}
\end{center}
\vspace{0.3em}
\item 由于对文法中的非终结符进行了限制,可以直接使用CYK算法进行解码,无需转换成乔姆斯基范式
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  CYK解码
姜雨帆 committed
3754 3755 3756
\begin{frame}{CYK算法}
% 看NiuTrans Manual
\begin{itemize}
姜雨帆 committed
3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820
\item CYK算法通过遍历不同\alert{span}来判断字符串是否符合文法
	\begin{itemize}
	\item 输入:源语串\textbf{s =} $s_1 ... s_J$,以及上下文无关文法$G$
	\item 输出:判断字符串是否符合上下文无关文法
	\end{itemize}
%\vspace{-0.5em}
\begin{center}
\begin{tikzpicture}
\tikzstyle{alignmentnode} = [rectangle,fill=blue!30,minimum size=0.45em,text=white,inner sep=0.1pt]
\tikzstyle{selectnode} = [rectangle,fill=green!20,minimum height=1.5em,minimum width=1.5em,inner sep=1.2pt]
\tikzstyle{srcnode} = [anchor=south west]
\begin{scope}[scale=0.85]
\node[srcnode] (c1) at (0,0) {\small{\textbf{Function} CKY-Algorithm($s,G$)}};
\node[srcnode,anchor=north west] (c21) at ([xshift=2em,yshift=0.4em]c1.south west) {\small{\textbf{foreach} ($j_1, j_2$): 1$ \leq j_1 \leq J$ and 1$ \leq j_2 \leq J$}};
\node[srcnode,anchor=north west] (c22) at ([xshift=2em,yshift=0.4em]c21.south west) {\small{Initialize $cell[j_1,j_2 ]$}};
\node[srcnode,anchor=north west] (c3) at ([xshift=-2em,yshift=0.4em]c22.south west) {\small{\textbf{for} $j_1$ = 1 to $J$}};
\node[srcnode,anchor=west] (c31) at ([xshift=5em]c3.east) {\small{// beginning of span}};
\node[srcnode,anchor=north west] (c4) at ([xshift=2em,yshift=0.4em]c3.south west) {\small{\textbf{for} $j_2$ = $j_1$ to $J$}};
\node[srcnode,anchor=north west] (c41) at ([yshift=0.4em]c31.south west) {\small{// ending of span}};
\node[srcnode,anchor=north west] (c5) at ([xshift=2em,yshift=0.4em]c4.south west) {\small{\textbf{for} $k$ = $j_1$ to $j_2$}};
\node[srcnode,anchor=north west] (c51) at ([yshift=0.4em]c41.south west) {\small{// partition of span}};
\node[srcnode,anchor=north west] (c6) at ([xshift=2em,yshift=0.4em]c5.south west) {\small{$hypos$ = Compose($cell[j_1, k], cell[k, j_2]$)}};
\node[srcnode,anchor=north west] (c7) at ([yshift=0.4em]c6.south west) {\small{$cell[j_1, j_2]$.update($hypos$)}};
\node[srcnode,anchor=north west] (c8) at ([xshift=-6em,yshift=0.4em]c7.south west) {\small{\textbf{return} $cell[1, J]$}};


\node[srcnode] (s1) at ([yshift=-2.5em]c8.south west) {\textbf{s:}};
\node[srcnode] (s2) at ([xshift=1em]s1.south east) {$s_1$};
\node[srcnode] (s3) at ([xshift=1em]s2.south east) {$s_2$};
\node[srcnode] (s4) at ([xshift=1em]s3.south east) {$s_3$};
\node[srcnode] (s5) at ([xshift=1em]s4.south east) {$s_4$};
\node[srcnode] (s6) at ([xshift=1em]s5.south east) {$s_5$};
\node[srcnode] (s7) at ([xshift=1em]s6.south east) {$s_6$};
\node[srcnode] (s8) at ([xshift=1em]s7.south east) {$s_7$};

\node[srcnode,anchor=center] (j1) at ([yshift=-1.4em]s3.south) {$j_1$};
\node[srcnode,anchor=center] (j2) at ([yshift=-1.4em]s7.south) {$j_2$};

\node[srcnode,anchor=center] (k) at ([xshift=1.5em,yshift=-1.5em]s4.south) {$k$};

\draw[->,thick] ([yshift=-0.1em]j1.north)--([yshift=0.1em]s3.south);
\draw[->,thick] ([yshift=-0.1em]j2.north)--([yshift=0.1em]s7.south);
\draw[->,thick] ([yshift=-0.1em]k.north)--([xshift=1.5em,yshift=0.1em]s4.south);

\node [rectangle,inner sep=0.3em,rounded corners=1pt,very thick,dotted,draw=ugreen] [fit = (s3) (s7)] (box1) {};

\begin{pgfonlayer}{background}
\node [rectangle,inner sep=0.2em,rounded corners=1pt,fill=blue!10!white] [fit = (c1) (c21) (c3) (c6) (c7) (c8)] (gl1) {};
\node [rectangle,inner sep=0.3em,rounded corners=1pt,fill=green!10!white] [fit = (s3) (s4)] (box2) {};
\node [rectangle,inner sep=0.3em,rounded corners=1pt,fill=red!10!white] [fit = (s5) (s7)] (box3) {};
\end{pgfonlayer}

\end{scope}

\end{tikzpicture}
\end{center}
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  CYK解码
\begin{frame}{CYK算法}
% 看NiuTrans Manual
\begin{itemize}
姜雨帆 committed
3821
\item 我们来看一个CYK算法的具体例子,给定一个上下无关文法以及一个单词\alert{aabbc},来判断该单词是否属于此文法,解析流程如下
姜雨帆 committed
3822
\vspace{-0.3em}
姜雨帆 committed
3823 3824
\begin{center}
\begin{tikzpicture}
姜雨帆 committed
3825
\tikzstyle{alignmentnode} = [rectangle,fill=blue!30,minimum size=0.5em,text=white,inner sep=0.1pt]
姜雨帆 committed
3826 3827
\tikzstyle{selectnode} = [rectangle,fill=green!20,minimum height=1.5em,minimum width=1.5em,inner sep=1.2pt]
\tikzstyle{srcnode} = [anchor=south west]
姜雨帆 committed
3828
\tikzstyle{chartnode}=[rectangle,minimum size=1.3em,draw]
姜雨帆 committed
3829 3830
\begin{scope}[scale=0.85]

姜雨帆 committed
3831 3832
\node[anchor=south east] (g1) at (0,0) {\small{$\textrm{S} \to \textrm{AB}\ \ \ \textrm{A} \to \textrm{CD}\  \vert \  \textrm{CF}\ \ \ \textrm{B} \to \textrm{c}\  \vert \  \textrm{BE}$}};
\node[anchor=north west] (g2) at ([yshift=0.3em]g1.south west) {\small{$\textrm{C} \to \textrm{a}\ \ \ \  \textrm{D} \to \textrm{b}\ \ \ \ \textrm{E} \to \textrm{c}\ \ \ \ \textrm{F} \to \textrm{AD}$}};
姜雨帆 committed
3833 3834

\begin{pgfonlayer}{background}
姜雨帆 committed
3835
\node [rectangle,inner sep=0.1em,rounded corners=1pt,fill=green!10,drop shadow,draw=ugreen] [fit = (g1) (g2)] (gl1) {};
姜雨帆 committed
3836
\end{pgfonlayer}
姜雨帆 committed
3837
\vspace{0.5em}
姜雨帆 committed
3838

姜雨帆 committed
3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878
\node [anchor=east] (s1) at ([xshift=-3em,yshift=-3em]g2.west) {a};
\node [anchor=north west] (s2) at ([yshift=-1em]s1.south west) {a};
\node [anchor=north west] (s3) at ([yshift=-1em]s2.south west) {b};
\node [anchor=north west] (s4) at ([yshift=-1em]s3.south west) {b};
\node [anchor=north west] (s5) at ([yshift=-1em]s4.south west) {c};

\node [alignmentnode,anchor=west] (cell11) at ([xshift=1em]s1.east) {};
\node [alignmentnode,anchor=west] (cell21) at ([xshift=1em]s2.east) {};
\node [alignmentnode,anchor=west] (cell22) at ([xshift=2em]cell21.east) {};
\node [alignmentnode,anchor=west] (cell31) at ([xshift=1em]s3.east) {};
\node [alignmentnode,anchor=west] (cell32) at ([xshift=2em]cell31.east) {};
\node [alignmentnode,anchor=west] (cell33) at ([xshift=2em]cell32.east) {};
\node [alignmentnode,anchor=west] (cell41) at ([xshift=1em]s4.east) {};
\node [alignmentnode,anchor=west] (cell42) at ([xshift=2em]cell41.east) {};
\node [alignmentnode,anchor=west] (cell43) at ([xshift=2em]cell42.east) {};
\node [alignmentnode,anchor=west] (cell44) at ([xshift=2em]cell43.east) {};
\node [alignmentnode,anchor=west] (cell51) at ([xshift=1em]s5.east) {};
\node [alignmentnode,anchor=west] (cell52) at ([xshift=2em]cell51.east) {};
\node [alignmentnode,anchor=west] (cell53) at ([xshift=2em]cell52.east) {};
\node [alignmentnode,anchor=west] (cell54) at ([xshift=2em]cell53.east) {};
\node [alignmentnode,anchor=west] (cell55) at ([xshift=2em]cell54.east) {};

\node [anchor=north] (l1) at ([yshift=-0.5em]cell51.south) {\scriptsize{$l$=1}};
\node [anchor=north] (l2) at ([yshift=-0.5em]cell52.south) {\scriptsize{$l$=2}};
\node [anchor=north] (l3) at ([yshift=-0.5em]cell53.south) {\scriptsize{$l$=3}};
\node [anchor=north] (l4) at ([yshift=-0.5em]cell54.south) {\scriptsize{$l$=4}};
\node [anchor=north] (l5) at ([yshift=-0.5em]cell55.south) {\scriptsize{$l$=5}};

\node [anchor=center] (y1) at ([xshift=-1.2em,yshift=1.3em]cell11.center) {\scriptsize{\blue 0}};
\node [anchor=center] (y2) at ([xshift=-1.2em,yshift=1.3em]cell21.center) {\scriptsize{\blue 1}};
\node [anchor=center] (y3) at ([xshift=-1.2em,yshift=1.3em]cell31.center) {\scriptsize{\blue 2}};
\node [anchor=center] (y4) at ([xshift=-1.2em,yshift=1.3em]cell41.center) {\scriptsize{\blue 3}};
\node [anchor=center] (y5) at ([xshift=-1.2em,yshift=1.3em]cell51.center) {\scriptsize{\blue 4}};
\node [anchor=center] (y6) at ([xshift=-1.2em,yshift=-1em]cell51.center) {\scriptsize{\blue 5}};

\node [anchor=west] (num) at ([xshift=15em,yshift=0.5em]s1.east) {\footnotesize{序号}};
\node [anchor=west] (kua) at ([xshift=1em]num.east) {\footnotesize{跨度}};
\node [anchor=west] (tui) at ([xshift=1em]kua.east) {\footnotesize{推导}};

\draw[-] ([yshift=-0.1em]num.south west)--([xshift=13em,yshift=-0.1em]num.south west);
姜雨帆 committed
3879 3880

\visible<2->{
姜雨帆 committed
3881 3882 3883 3884
\node [anchor=west] (n1) at ([yshift=-1em]num.south west) {\footnotesize{1}};
\node [anchor=west] (k1) at ([yshift=-1em]kua.south west) {\footnotesize{[{\blue 0},{\blue 1}]}};
\node [anchor=west] (t1) at ([yshift=-1em]tui.south west) {\footnotesize{C $\to$ a}};
\node [anchor=center,selectnode,fill=black!10] (alig11) at (cell11.center) {\footnotesize{C}};
姜雨帆 committed
3885 3886 3887
}

\visible<3->{
姜雨帆 committed
3888 3889 3890 3891
\node [anchor=center] (n2) at ([yshift=-1.3em]n1.center) {\footnotesize{2}};
\node [anchor=center] (k2) at ([yshift=-1.3em]k1.center) {\footnotesize{[{\blue 1},{\blue 2}]}};
\node [anchor=west] (t2) at ([yshift=-1.3em]t1.west) {\footnotesize{C $\to$ a}};
\node [anchor=center,selectnode,fill=black!10] (alig21) at (cell21.center) {\footnotesize{C}};
姜雨帆 committed
3892 3893 3894
}

\visible<4->{
姜雨帆 committed
3895 3896 3897 3898
\node [anchor=center] (n3) at ([yshift=-1.3em]n2.center) {\footnotesize{3}};
\node [anchor=center] (k3) at ([yshift=-1.3em]k2.center) {\footnotesize{[{\blue 2},{\blue 3}]}};
\node [anchor=west] (t3) at ([yshift=-1.3em]t2.west) {\footnotesize{D $\to$ b}};
\node [anchor=center,selectnode,fill=black!10] (alig31) at (cell31.center) {\footnotesize{D}};
姜雨帆 committed
3899 3900
}

姜雨帆 committed
3901 3902 3903 3904 3905
\visible<5->{
\node [anchor=center] (n4) at ([yshift=-1.3em]n3.center) {\footnotesize{4}};
\node [anchor=center] (k4) at ([yshift=-1.3em]k3.center) {\footnotesize{[{\blue 3},{\blue 4}]}};
\node [anchor=west] (t4) at ([yshift=-1.3em]t3.west) {\footnotesize{D $\to$ b}};
\node [anchor=center,selectnode,fill=black!10] (alig41) at (cell41.center) {\footnotesize{D}};
姜雨帆 committed
3906 3907 3908
}

\visible<6->{
姜雨帆 committed
3909 3910 3911 3912
\node [anchor=center] (n5) at ([yshift=-1.3em]n4.center) {\footnotesize{5}};
\node [anchor=center] (k5) at ([yshift=-1.3em]k4.center) {\footnotesize{[{\blue 4},{\blue 5}]}};
\node [anchor=west] (t5) at ([yshift=-1.3em]t4.west) {\footnotesize{B $\to$ c , E $\to$ c}};
\node [anchor=center,selectnode,fill=black!10] (alig51) at (cell51.center) {\footnotesize{B,E}};
姜雨帆 committed
3913 3914 3915
}

\visible<7->{
姜雨帆 committed
3916 3917 3918 3919
\node [anchor=center] (n6) at ([yshift=-1.3em]n5.center) {\footnotesize{6}};
\node [anchor=center] (k6) at ([yshift=-1.3em]k5.center) {\footnotesize{[{\blue 0},{\blue 2}]}};
\node [anchor=west] (t6) at ([yshift=-1.3em]t5.west) {\footnotesize{none}};
\node [anchor=center,selectnode,fill=black!10] (alig22) at (cell22.center) {\footnotesize{}};
姜雨帆 committed
3920 3921
}

姜雨帆 committed
3922 3923 3924 3925 3926
\visible<8->{
\node [anchor=center] (n7) at ([yshift=-1.3em]n6.center) {\footnotesize{7}};
\node [anchor=center] (k7) at ([yshift=-1.3em]k6.center) {\footnotesize{[{\blue 1},{\blue 3}]}};
\node [anchor=west] (t7) at ([yshift=-1.3em]t6.west) {\footnotesize{A $\to$ CD}};
\node [anchor=center,selectnode,fill=black!10] (alig32) at (cell32.center) {\footnotesize{A}};
姜雨帆 committed
3927 3928 3929
}


姜雨帆 committed
3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943
\visible<9->{
\node [anchor=center] (sep1) at ([yshift=-0.8em]n7.center) {\footnotesize{...}};
\node [anchor=center] (n8) at ([yshift=-1.8em]n7.center) {\footnotesize{15}};
\node [anchor=center] (k8) at ([yshift=-1.8em]k7.center) {\footnotesize{[{\blue 0},{\blue 5}]}};
\node [anchor=west] (t8) at ([yshift=-1.8em]t7.west) {\footnotesize{S $\to$ AB}};

\node [anchor=center,selectnode,fill=black!10] (alig33) at (cell33.center) {\footnotesize{}};
\node [anchor=center,selectnode,fill=black!10] (alig42) at (cell42.center) {\footnotesize{}};
\node [anchor=center,selectnode,fill=black!10] (alig43) at (cell43.center) {\footnotesize{F}};
\node [anchor=center,selectnode,fill=black!10] (alig44) at (cell44.center) {\footnotesize{A}};
\node [anchor=center,selectnode,fill=black!10] (alig52) at (cell52.center) {\footnotesize{}};
\node [anchor=center,selectnode,fill=black!10] (alig53) at (cell53.center) {\footnotesize{}};
\node [anchor=center,selectnode,fill=black!10] (alig54) at (cell54.center) {\footnotesize{}};
\node [anchor=center,selectnode,fill=black!10] (alig55) at (cell55.center) {\footnotesize{S}};
姜雨帆 committed
3944 3945 3946 3947 3948
}
\end{scope}
\end{tikzpicture}
\end{center}
\end{itemize}
姜雨帆 committed
3949

姜雨帆 committed
3950 3951 3952 3953
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  CYK解码
3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039
\begin{frame}{CYK解码(续)}
% 看NiuTrans Manual
\begin{itemize}
\item CYK解码提出了一种cell的数据结构,用来记录所有可能出现的翻译假设。
    \begin{itemize}
    \item<2-> 对于每个源语句子,使用短语规则表初始化它的cell
    \item<3-> 自底向上对cell中的每个子cell进行重新组合(正向、反向)
    \item<4-> 计算每个推导的得分并记录下来,最终选择最优推导所对应的译文作为输出
    \end{itemize}
\end{itemize}
\vspace{-0.8em}
\begin{center}
\begin{tikzpicture}
\visible<2->{
\node [anchor=west] (s1) at (0,0) {\small{\textbf{进口}}};
\node [anchor=west] (s2) at ([xshift=4em]s1.east) {\small{\textbf{大幅度}}};
\node [anchor=west] (s3) at ([xshift=2.8em]s2.east) {\small{\textbf{下降}}};
\node [anchor=west] (s4) at ([xshift=2.8em]s3.east) {\small{\textbf{}}};

\node [anchor=north] (t11) at ([yshift=-0.4em]s1.south) {\scriptsize{Imports}};
\node [anchor=west] (t12) at ([yshift=-1em]t11.west) {\scriptsize{The imports}};
\node [anchor=west] (t13) at ([yshift=-0.7em]t12.west) {\scriptsize{...}};

\node [anchor=north] (t21) at ([yshift=-0.4em]s2.south) {\scriptsize{drastically}};
\node [anchor=west] (t22) at ([yshift=-1em]t21.west) {\scriptsize{substantially}};
\node [anchor=west] (t23) at ([yshift=-0.7em]t22.west) {\scriptsize{...}};

\node [anchor=north] (t31) at ([yshift=-0.4em]s3.south) {\scriptsize{fall}};
\node [anchor=west] (t32) at ([yshift=-1em]t31.west) {\scriptsize{fallen}};
\node [anchor=west] (t33) at ([yshift=-0.7em]t32.west) {\scriptsize{...}};

\node [anchor=north] (t41) at ([yshift=-0.4em]s4.south) {\scriptsize{have}};
\node [anchor=west] (t42) at ([yshift=-1em]t41.west) {\scriptsize{had}};
\node [anchor=west] (t43) at ([yshift=-0.7em]t42.west) {\scriptsize{...}};
}
\visible<3->{
\node [anchor=west] (t51) at ([xshift=2em,yshift=-1.8em]t23.west) {\scriptsize{drastically \ fallen}};
\node [anchor=west] (t53) at ([yshift=-0.7em]t51.west) {\scriptsize{...}};
}
\visible<4->{

\node [anchor=west] (t61) at ([xshift=3em,yshift=-1.8em]t53.west) {\scriptsize{have \ drastically \ fallen}};
\node [anchor=west] (t62) at ([yshift=-0.7em]t61.west) {\scriptsize{...}};

\node [anchor=west] (t71) at ([xshift=-6em,yshift=-1.8em]t62.west) {\scriptsize{The \ imports}};
\node [anchor=west] (t72) at ([xshift=0.2em]t71.east) {\scriptsize{have \ drastically \ fallen}};
\node [anchor=west] (t73) at ([yshift=-0.7em]t71.west) {\scriptsize{...}};
}
\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,inner sep=0.05em,fill=red!20] [fit = (t11) (t12) (t13)] (box1) {};
\node [rectangle,inner sep=0.05em,fill=green!20] [fit = (t21) (t22) (t23)] (box2) {};
\node [rectangle,inner sep=0.05em,fill=blue!20,minimum width=3em] [fit = (t31) (t32) (t33)] (box3) {};
\node [rectangle,inner sep=0.05em,fill=orange!20,minimum width=3em] [fit = (t41) (t42) (t43)] (box4) {};
}
\visible<3->{
\node [rectangle,inner sep=0.05em,fill=purple!20] [fit = (t51) (t53)] (box5) {};
}
\visible<4->{
\node [rectangle,inner sep=0.05em,fill=yellow!20] [fit = (t61) (t62)] (box6) {};
\node [rectangle,inner sep=0.05em,fill=black!10] [fit = (t71) (t72) (t73)] (box7) {};
}
\end{pgfonlayer}

\visible<2->{
\node [anchor=south east,inner sep=1pt,fill=black] (tl1) at (box1.south east) {\tiny{{\color{white} \textbf{1}}}};
\node [anchor=south east,inner sep=1pt,fill=black] (tl2) at (box2.south east) {\tiny{{\color{white} \textbf{2}}}};
\node [anchor=south east,inner sep=1pt,fill=black] (tl3) at (box3.south east) {\tiny{{\color{white} \textbf{3}}}};
\node [anchor=south east,inner sep=1pt,fill=black] (tl4) at (box4.south east) {\tiny{{\color{white} \textbf{4}}}};
}

\visible<3->{
\draw [->,thick] (t22.south) .. controls +(south:0.5) and +(north:0.5) .. (t51.north);
\draw [->,thick] (t32.south) .. controls +(south:0.5) and +(north:0.5) .. (t51.north);
\node [anchor=south east,inner sep=1pt,fill=black] (tl5) at (box5.south east) {\tiny{{\color{white} \textbf{2-3}}}};
}
\visible<4->{
\draw [->,thick] (t51.south) .. controls +(south:0.5) and +(north:0.5) .. (t61.north);
\draw [->,thick] (t42.south) .. controls +(south:2) and +(north:0.5) .. (t61.north);
\draw [->,thick] (t61.south) .. controls +(south:0.5) and +(north:0.5) .. (t72.north);
\draw [->,thick] (t12.south) .. controls +(south:2.5) and +(north:0.8) .. (t71.north);
\node [anchor=south east,inner sep=1pt,fill=black] (tl6) at (box6.south east) {\tiny{{\color{white} \textbf{2-4}}}};
\node [anchor=south east,inner sep=1pt,fill=black] (tl7) at (box7.south east) {\tiny{{\color{white} \textbf{1-4}}}};
}
\end{tikzpicture}
\end{center}
xiaotong committed
4040 4041 4042
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4043 4044 4045
\subsection{剪枝}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4046 4047 4048 4049
%%%  立方剪枝
\begin{frame}{立方剪枝(Cube Pruning)}
% 问题
% 解决方法
4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153
\begin{itemize}
\item 前面介绍的解码方法由于搜索空间非常大,速度很慢,通常使用剪枝的方法来加速这个过程
    \begin{itemize}
    \item 解码时对来自不同的cell进行合并时,第一个cell包含$n$个条目,第二个cell包含$m$个条目,就会产生$n \times m$个新条目
\vspace{0.8em}
\begin{center}
\begin{tikzpicture}
\node [anchor=west] (s1) at (0,0) {\footnotesize{$\textrm{X} \to <\textrm{}\ \textrm{X}_1,\ \textrm{from}\ \textrm{X}_1>$}};
\node [anchor=east] (s2) at ([yshift=-2em]s1.east) {\footnotesize{$\textrm{X} \to <\textrm{}\ \textrm{X}_1,\ \textrm{since}\ \textrm{X}_1>$}};
\node [anchor=east] (s3) at ([yshift=-2em]s2.east) {\footnotesize{$\textrm{X} \to <\textrm{}\ \textrm{X}_1,\ \textrm{from the}\ \textrm{X}_1>$}};
\node [anchor=east] (s4) at ([yshift=-2em]s3.east) {\footnotesize{$\textrm{X} \to <\textrm{}\ \textrm{X}_1,\ \textrm{through}\ \textrm{X}_1>$}};

\node [anchor=west] (t1) at ([xshift=2.5em]s1.east) {\footnotesize{$\textrm{X} \to <\textrm{计划},\ \textrm{plan}>$}};
\node [anchor=west] (t2) at ([xshift=2.5em]s2.east) {\footnotesize{$\textrm{X} \to <\textrm{方案},\ \textrm{scheme}>$}};
\node [anchor=west] (t3) at ([xshift=2.5em]s3.east) {\footnotesize{$\textrm{X} \to <\textrm{项目},\ \textrm{project}>$}};
\node [anchor=west] (t4) at ([xshift=2.5em]s4.east) {\footnotesize{$\textrm{X} \to <\textrm{时期},\ \textrm{times}>$}};

\foreach \x in {1,2,...,4}
	\foreach \y in {1,2,...,4}
    \draw[->] ([xshift=0.1em]s\x.east) -- ([xshift=-0.1em]t\y.west);

\begin{pgfonlayer}{background}
\node [rectangle,inner sep=0.3em,fill=red!20] [fit = (s1) (s3) (s4)] (box1) {};
\node [rectangle,inner sep=0.3em,fill=green!20] [fit = (t1) (t2) (t3) (t4)] (box2) {};
\end{pgfonlayer}

\end{tikzpicture}
\end{center}
\vspace{0.3em}
    \item$n$$m$都很大时,会产生很多新的条目,可以通过限制栈的大小来舍弃大部分条目
	\item 另一个思路就是如何只生成有机会被选中的条目,这就是\alert{立方剪枝(cube pruning)}的思想
    \end{itemize}
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  立方剪枝
\begin{frame}{立方剪枝(Cube Pruning)(续)}
% 问题
% 解决方法
\begin{itemize}
\item 不是考虑所有可能的组合,而是从\alert{最优}候选开始选择
    \begin{itemize}
    \item 根据代价估计对每个cell中的条目进行排序,最好的候选在最顶层,次优候选排在后面
    \item<2-> 计算所有邻居的代价,选择最优的条目,再计算其邻居的代价,不断进行迭代
    \item<3-> 直到产生的条目达到一定的数量(如栈容量)或者新加入的条目被其他剪枝策略丢弃,则终止算法
    \end{itemize}
\end{itemize}
\begin{center}
\begin{tikzpicture}
\tikzstyle{alignmentnode} = [rectangle,fill=blue!30,minimum size=0.4em,text=white,inner sep=0.1pt]
\tikzstyle{selectnode} = [rectangle,fill=green!20,minimum height=1.5em,minimum width=1.5em,inner sep=1.2pt]
\tikzstyle{srcnode} = [rotate=45,anchor=south west]
\begin{scope}[scale=0.85]
\node [anchor=west] (s1) at (0,0) {\footnotesize{$\textrm{X} \to <\textrm{}\ \textrm{X}_1,\ \textrm{from}\ \textrm{X}_1>$}};
\node [anchor=east] (s2) at ([yshift=-2em]s1.east) {\footnotesize{$\textrm{X} \to <\textrm{}\ \textrm{X}_1,\ \textrm{since}\ \textrm{X}_1>$}};
\node [anchor=east] (s3) at ([yshift=-2em]s2.east) {\footnotesize{$\textrm{X} \to <\textrm{}\ \textrm{X}_1,\ \textrm{from the}\ \textrm{X}_1>$}};
\node [anchor=east] (s4) at ([yshift=-2em]s3.east) {\footnotesize{$\textrm{X} \to <\textrm{}\ \textrm{X}_1,\ \textrm{through}\ \textrm{X}_1>$}};

\node [anchor=center,alignmentnode] (alig1) at ([xshift=2.5em]s1.east) {};
\node [anchor=center,alignmentnode] (alig11) at ([xshift=2.2em]alig1.center) {};
\node [anchor=center,alignmentnode] (alig12) at ([xshift=2.2em]alig11.center) {};
\node [anchor=center,alignmentnode] (alig13) at ([xshift=2.2em]alig12.center) {};

\node [anchor=center,alignmentnode] (alig2) at ([xshift=2.5em]s2.east) {};
\node [anchor=center,alignmentnode] (alig21) at ([xshift=2.2em]alig2.center) {};
\node [anchor=center,alignmentnode] (alig22) at ([xshift=2.2em]alig21.center) {};
\node [anchor=center,alignmentnode] (alig23) at ([xshift=2.2em]alig22.center) {};

\node [anchor=center,alignmentnode] (alig3) at ([xshift=2.5em]s3.east) {};
\node [anchor=center,alignmentnode] (alig31) at ([xshift=2.2em]alig3.center) {};
\node [anchor=center,alignmentnode] (alig32) at ([xshift=2.2em]alig31.center) {};
\node [anchor=center,alignmentnode] (alig33) at ([xshift=2.2em]alig32.center) {};

\node [anchor=center,alignmentnode] (alig4) at ([xshift=2.5em]s4.east) {};
\node [anchor=center,alignmentnode] (alig41) at ([xshift=2.2em]alig4.center) {};
\node [anchor=center,alignmentnode] (alig42) at ([xshift=2.2em]alig41.center) {};
\node [anchor=center,alignmentnode] (alig43) at ([xshift=2.2em]alig42.center) {};

\node[srcnode] (c1) at ([yshift=1em]alig1.north) {\footnotesize{plan}};
\node[srcnode] (c2) at ([yshift=1em]alig11.north) {\footnotesize{scheme}};
\node[srcnode] (c3) at ([yshift=1em]alig12.north) {\footnotesize{project}};
\node[srcnode] (c4) at ([yshift=1em]alig13.north) {\footnotesize{times}};

\visible<2->{
\node [anchor=center,selectnode] (c1) at (alig1.center) {\footnotesize{2.1}};
}

\visible<3->{
\node [anchor=center,selectnode,fill=red!20] (c2) at (alig11.center) {\footnotesize{5.1}};
\node [anchor=center,selectnode,fill=red!20] (c3) at (alig2.center) {\footnotesize{5.5}};
}

\visible<4->{
\node [anchor=center,selectnode] (c2) at (alig11.center) {\footnotesize{5.1}};
\node [anchor=center,selectnode] (c3) at (alig2.center) {\footnotesize{5.5}};
\node [anchor=center,selectnode,fill=red!20] (c4) at (alig12.center) {\footnotesize{8.2}};
\node [anchor=center,selectnode,fill=red!20] (c5) at (alig21.center) {\footnotesize{8.5}};
\node [anchor=center,selectnode,fill=red!20] (c6) at (alig3.center) {\footnotesize{7.7}};
}
\end{scope}

\end{tikzpicture}
\end{center}
xiaotong committed
4154 4155
\end{frame}

4156

xiaotong committed
4157 4158 4159 4160
%%%------------------------------------------------------------------------------------------------------------
%%%  BLEU等评价
\begin{frame}{效果}
% 实验结果
4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176
\begin{itemize}
\item 从实验结果中可以看出,基于层次短语的翻译模型性能要优于基于短语的翻译模型
\item 选择使用层次短语信息实际上增加了模型的复杂度,但是可以通过借鉴基于短语的翻译模型模型以及CYK解码和立方剪枝等技术来解决
\item 可以考虑加入更多句法信息来进一步提升模型性能
\end{itemize}
%\vspace{-1em}
\begin{center}
\begin{tabular}{l | l | l | l}
\multicolumn{2}{c|}{模型} & 开发集 & 测试集  \\
\multicolumn{2}{c|}{} & (BLEU[\%]) & (BLEU[\%])  \\ \hline
\multicolumn{2}{l|}{短语(Moses)} & 36.51  & 34.93 \\
\multicolumn{2}{l|}{短语(NiuTrans)} & 36.99 & 35.29 \\ \hline
\multicolumn{2}{l|}{层次短语(Moses)} & 36.65 & 34.79 \\
\multicolumn{2}{l|}{层次短语(NiuTrans)} & 37.41 & 35.35 \\ \hline
\end{tabular}
\end{center}
xiaotong committed
4177

4178 4179 4180 4181
\vspace{-0.5em}
\scriptsize{* 以上结果来自 NiuTrans: An Open Source Toolkit for Phrase-based Machine Translation}\\
\scriptsize{* 开发集:NIST MT03,测试集:NIST MT05}\\
\end{frame}
xiaotong committed
4182
%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4183
\section{基于语言学句法的模型}
xiaotong committed
4184

xiaotong committed
4185
%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200
%%% 第三节的内容
\begin{frame}{Outline}

\vspace{5em}

 \begin{tcolorbox}[enhanced,size=normal,left=2mm,right=1mm,colback=red!5!white,colframe=red!75!black,drop fuzzy shadow]
{\Large
\begin{center}
\textbf{基于语言学句法的翻译模型}
\end{center}
}
\end{tcolorbox}

\end{frame}

xiaotong committed
4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294

%%%------------------------------------------------------------------------------------------------------------
%%%  句法树(层次短语)
\begin{frame}{层次短语规则推导的句法树表示}
\begin{itemize}
\item 层次短语规则的使用本质上是对(源语)句子建立树状结构,这反应了文法对于字符串分析得到的推导\\
\vspace{-0.4em}
\begin{displaymath}
\visible<2->{d = r_3}\visible<3->{\circ r_1}\visible<4->{ \circ r_4}\visible<5->{ \circ r_2}\visible<6->{ \circ r_5}\visible<7->{ \circ r_2}\visible<8->{ \circ r_7}\visible<9->{ \circ r_6}\visible<10->{ \circ r_2}
\end{displaymath}
\end{itemize}

\vspace{-1em}
\begin{center}
\begin{tikzpicture}
{\scriptsize
\begin{scope}[sibling distance=0pt, level distance = 27pt]
{\scriptsize
\Tree[.\node(n1){\textbf{S}};
        [.\node(n2){\textbf{S}};
	        [.\node(n3){\textbf{S}};
		        [.\node(n4){\textbf{S}};
		            [.\node(n5){\textbf{X}}; \node(cw1){}; ]
		        ]
		        [.\node(n6){\textbf{X}}; \node(cw2){美国}; ]
		    ]
	        [.\node(n7){\textbf{X}};
	            [. \node(cw3){并没有}; ]
	            [. \node(cw4){执行}; ]
	        ]
        ]
        [.\node(n8){\textbf{X}};
            [. \node(cw5){世贸}; ]
            [.\node(n9){\textbf{X}};
                [. \node(cw6){组织}; ]
                [. \node(cw7){}; ]
            ]
            [. \node(cw8){裁决}; ]
        ]
     ]

\node<10->[circle, inner sep = 0.5pt, fill=blue!90!white, anchor = west] (l1) at ([xshift=-0.3em]n1.north east) {{\color{white} \tiny{$r_2$}}};
\node<7->[circle, inner sep = 0.5pt, fill=blue!90!white, anchor = east] (l2) at ([xshift=0.3em]n2.north west) {{\color{white} \tiny{$r_2$}}};
\node<5->[circle, inner sep = 0.5pt, fill=blue!90!white, anchor = east] (l2) at ([xshift=0.3em]n3.north west) {{\color{white} \tiny{$r_2$}}};
\node<3->[circle, inner sep = 0.5pt, fill=blue!90!white, anchor = east] (l2) at ([xshift=0.3em]n4.north west) {{\color{white} \tiny{$r_1$}}};
\visible<2->{\node[circle, inner sep = 0.5pt, fill=blue!90!white, anchor = east] (l2) at ([xshift=0.3em]n5.north west) {{\color{white} \tiny{$r_3$}}};}
\node<4->[circle, inner sep = 0.5pt, fill=blue!90!white, anchor = west] (l1) at ([xshift=-0.3em]n6.south east) {{\color{white} \tiny{$r_4$}}};
\node<6->[circle, inner sep = 0.5pt, fill=blue!90!white, anchor = west] (l1) at ([xshift=-0.3em]n7.north east) {{\color{white} \tiny{$r_5$}}};
\node<9->[circle, inner sep = 0.5pt, fill=blue!90!white, anchor = west] (l1) at ([xshift=-0.3em]n8.north east) {{\color{white} \tiny{$r_6$}}};
\node<8->[circle, inner sep = 0.5pt, fill=blue!90!white, anchor = west] (l1) at ([xshift=-0.3em]n9.north east) {{\color{white} \tiny{$r_7$}}};

}
\end{scope}

\begin{scope}[xshift = 1.8in, yshift = 0.1in]
\node (rules) {\textbf{层次短语翻译规则:}};
\draw[-] (rules.south west)--([xshift=1.8in]rules.south west);

\node[anchor=north west] (r1) at ([yshift=-0.2em]rules.south west) {$r_1$};
\node[anchor=west] (rc1) at ([xshift=0.0em]r1.east) {$\textrm{S} \; \to \; \langle\ \textrm{X}_1, \; \; \textrm{X}_1\ \rangle$};

\node[anchor=north west] (r2) at ([yshift=-0.4em]r1.south west) {$r_2$};
\node[anchor=west] (rc2) at ([xshift=0em]r2.east) {$\textrm{S} \; \to \; \langle\  \textrm{S}_1 \; \textrm{X}_2, \; \; \textrm{S}_1 \; \textrm{X}_2\ \rangle$};

\node[anchor=north west] (r3) at ([yshift=-0.4em]r2.south west) {$r_3$};
\node[anchor=west] (rc3) at ([xshift=0em]r3.east) {$\textrm{X} \; \to \; \langle\  \text{}, \; \; \text{but}\ \rangle$};

\node[anchor=north west] (r4) at ([yshift=-0.4em]r3.south west) {$r_4$};
\node[anchor=west] (rc4) at ([xshift=0em]r4.east) {$\textrm{X} \; \to \; \langle\  \text{美国}, \; \; \text{the U.S.}\ \rangle$};

\node[anchor=north west] (r5) at ([yshift=-0.4em]r4.south west) {$r_5$};
\node[anchor=west] (rc5) at ([xshift=0em]r5.east) {$\textrm{X} \; \to \; \langle\  \text{并没有} \; \text{执行}, \; \; \text{}$};

\node[anchor=north west] (r52) at ([yshift=-0.4em]r5.south west) {{\color{white} $r_5$}};
\node[anchor=west] (rc52) at ([xshift=2.9em]r52.east) {$\text{has not implemented}\ \rangle$};

\node[anchor=north west] (r6) at ([yshift=-0.4em]r52.south west) {$r_6$};
\node[anchor=west] (rc6) at ([xshift=0em]r6.east) {$\textrm{X} \; \to \; \langle\ \text{世贸} \; \textrm{X}_1 \; \text{裁决}, $};

\node[anchor=north west] (r61) at ([yshift=-0.4em]r6.south west) {{\color{white} $r_6$}};
\node[anchor=west] (rc61) at ([xshift=2.9em]r61.east) {$\text{the decision} \; \textrm{X}_1 \; \text{the WTO}\ \rangle$};

\node[anchor=north west] (r7) at ([yshift=-0.4em]r61.south west) {$r_7$};
\node[anchor=west] (rc7) at ([xshift=0em]r7.east) {$\textrm{X} \; \to \; \langle\ \text{组织 的}, \; \; \text{of}\ \rangle$};


\end{scope}

}
\end{tikzpicture}
\end{center}

\end{frame}

xiaotong committed
4295
%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308
%%%  句法树(语言学)
\begin{frame}{语言学句法树}
\begin{itemize}
\item 但是,层次短语的分析过程还是一种形式文法的推导,另一种自然的想法是把句子表示成语言学上的句法树,这种表示更符合人类对语言的认知
    \begin{itemize}
    \item 比如,``执行''后面接名词短语NP
    \item 还有,``并没有''作用于后面的动词短语``执行...''
    \end{itemize}
\end{itemize}

\begin{center}
\begin{tikzpicture}

xiaotong committed
4309 4310
\begin{scope}[xshift = -0.3in, sibling distance=5pt, level distance = 24pt]
{\footnotesize
xiaotong committed
4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338
\Tree[.IP
        [.ADVP
            [.AD \node(cw1){}; ]
        ]
        [.NP
            [.NR \node(cw2){美国}; ]
        ]
        [.VP
            [.ADVP
                [.AD \node(cw3){并没有}; ]
            ]
            [.VP
                [.VP
                    [.VV \node(cw4){执行}; ]
                ]
                [.NP
                    [.NP
                        [.NN \node(cw5){世贸}; ]
                        [.NN \node(cw6){组织}; ]
                    ]
                    [.DEC \node(cw7){}; ]
                    [.NP
                        [.NN \node(cw8){裁决}; ]
                    ]
                ]
            ]
        ]
     ]
xiaotong committed
4339
}
xiaotong committed
4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527
\end{scope}

\end{tikzpicture}
\end{center}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 在MT中使用句法带来的好处
\begin{frame}{使用句法的好处}
\begin{itemize}
\item 短语结构树可以仍容易进行远距离调序的建模,同时丰富的句法功能标记有助于翻译中的消歧和生成
\end{itemize}

\vspace{-1.0em}

\begin{center}
\begin{tikzpicture}

\begin{scope}[yshift=-0in]

{\tiny

\node[anchor=west] (ref) at (0,0) {\textbf{参考答案:} The Chinese star performance troupe presented a wonderful Peking opera as well as singing and dancing };

\node[anchor=north west] (ref2) at (ref.south west) {{\color{white} \textbf{Reference:}} performance to Hong Kong audience .};

\node[anchor=north west] (hifst) at (ref2.south west) {\textbf{层次短语系统:} Star troupe of China, highlights of Peking opera and dance show to the audience of Hong Kong .};

\node[anchor=north west] (synhifst) at (hifst.south west) {\textbf{句法系统:} Chinese star troupe};

\node[anchor=west, fill=green!20!white, inner sep=0.25em] (synhifstpart2) at (synhifst.east) {presented};

\node[anchor=west, fill=blue!20!white, inner sep=0.25em] (synhifstpart3) at ([xshift=0.2em]synhifstpart2.east) {a wonderful Peking opera singing and dancing};

\node[anchor=west, fill=red!20!white, inner sep=0.40em] (synhifstpart4) at ([xshift=0.2em]synhifstpart3.east) {to};

\node[anchor=west, fill=purple!20!white, inner sep=0.25em] (synhifstpart5) at ([xshift=0.2em]synhifstpart4.east) {Hong Kong audience};

\node[anchor=west] (synhifstpart6) at (synhifstpart5.east) {.};

\node[anchor=north west] (input) at ([yshift=-10em]synhifst.south west) {\textbf{源语句法树:}};

\node<2->[anchor=north west] (rule) at ([yshift=-2em]synhifst.south west) {句法翻译规则:};

\node<2->[anchor=north west] (rule2) at ([yshift=0.2em]rule.south west) {(VP BA(将) $x_1$:NP $x_2$:VP PP(P(给) $x_3$:NP))};

\node<2->[anchor=north west] (rule3) at ([yshift=0.2em]rule2.south west) {$\to$ $x_2$ $x_1$ to $x_3$ };


\begin{scope}[scale = 0.9, grow'=up, sibling distance=15pt, level distance=23pt, xshift=2.8in, yshift=-2.8in]

\Tree[.\node(tn1){IP};
        [.\node(tn2){NP}; \edge[roof]; \node[](seg1){中国$_1$ 明星$_2$ 艺术团$_3$}; ]
        [.\node(tn3){VP};
            [.\node(tn4){BA}; \node[fill=red!20!white](seg2){$_4$}; ]
            [.\node(tn5){NP}; \edge[roof]; \node[fill=blue!20!white](seg3){$_5$$_6$ 精彩$_7$$_8$ 京剧$_9$ 歌舞$_{10}$}; ]
            [.\node(tn6){VP};
                [.\node(tn7){VV}; \node[fill=green!20!white](seg4){呈现$_{11}$}; ]
            ]
            [.\node(tn8){PP};
                [.\node(tn9){P}; \node[fill=red!20!white](seg5){$_{12}$}; ]
                [.\node(tn10){NP}; \edge[roof]; \node[fill=purple!20!white](seg6){香港$_{13}$ 观众$_{14}$}; ]
            ]
        ]
        [.\node(tn11){.}; ]
     ]

\end{scope}

\path<2-> [draw,dotted,thick,blue] (tn3.south west) -- (tn4.south west) -- (seg2.north west) -- (seg2.north east) -- ([xshift=0.1em]tn4.north east) -- ([xshift=2.8em]tn6.north east) -- (seg5.north west) -- (seg5.north east) -- ([yshift=-1.7em]seg5.south east) -- (tn10.north east) -- (tn10.south east) -- (tn8.south east) -- (tn3.south east) -- (tn3.south west);

\path [draw,thick,->,dashed] (seg2.north) .. controls +(north:1.0) and +(south:1.5) ..  (synhifstpart4.south);
\path [draw,thick,->,dashed] (seg3.north) --  (synhifstpart3.south);
\path [draw,thick,->,dashed] (seg4.north) --  (synhifstpart2.south);
\path [draw,thick,->,dashed] (seg5.north) .. controls +(north:0.5) ..  (synhifstpart4.south);
\path [draw,thick,->,dashed] (seg6.north) --  (synhifstpart5.south);

\path<2-> [draw,<->,dotted,blue,thick] ([yshift=-0.5em]seg2.south west) .. controls +(west:1.0) and +(south:0.5) ..  ([xshift=-1.5em]rule2.south);

}

\end{scope}

\end{tikzpicture}
\end{center}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 使用句法信息的一些思考
\begin{frame}{有很多句法知识可以使用}
\begin{itemize}
\item \textbf{句法树形式选择} - 句法的表示形式有很多,侧重点也不同,机器翻译需要何种句法信息?

\begin{center}
\begin{tikzpicture}
{\footnotesize
\begin{scope}[xshift = -0.3in, sibling distance=3pt, level distance = 18pt]
\Tree[.S
        [.NP
            [.NNP \node(w1){Messi}; ]
        ]
        [.VP
            [.VBD \node(w2){hit}; ]
            [.NP
                [.DT \node(w3){the}; ]
                [.NN \node(w4){ball}; ]
            ]
        ]
     ]
\node [anchor=north west] (cap1) at ([yshift=-2.0em,xshift=2.0em]w1.south west) {\footnotesize{(a) 短语结构树}};

\node [anchor=west] (t1) at ([xshift=3em,]w4.east) {Messi};
\node [anchor=west] (t2) at ([xshift=0.5em,]t1.east) {hit};
\node [anchor=west] (t3) at ([xshift=0.5em,]t2.east) {the};
\node [anchor=west] (t4) at ([xshift=0.5em,]t3.east) {ball};

\draw [->] ([xshift=0em]t3.north) .. controls +(north:1em) and +(north:1em) .. ([xshift=-0.2em]t4.north);
\draw [->] ([xshift=0.2em]t4.north) .. controls +(north:2.5em) and +(north:2.5em) .. ([xshift=0.2em]t2.north);
\draw [->] ([xshift=0.0em]t1.north) .. controls +(north:2.5em) and +(north:2.5em) .. ([xshift=-0.2em]t2.north);

\node [anchor=north west] (cap2) at ([yshift=-0.2em,xshift=-0.5em]t2.south west) {\footnotesize{(b) 依存树}};
\end{scope}
}
\end{tikzpicture}
\end{center}

\item<2-> \textbf{如何获取句法知识} - 句法信息由谁提供?
    \begin{itemize}
    \item 自动句法分析器可以提供句法信息,分析器可以从树库中自动学习(回忆第二章),因此得到的句法分析结果和树库标注是一致的
    \item 不使用句法分析器,而是让机器翻译自动学习适合翻译任务的句法结构
    \end{itemize}
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 句法树中的一些基本概念
\begin{frame}{术语}
\begin{itemize}
\item 这里我们\alert{假设}
    \begin{itemize}
    \item 使用短语结构树表示句法信息
    \item 句法树由句法分析器自动生成
    \end{itemize}
\item 涉及的术语
\end{itemize}

\vspace{-0.8em}
{\small
\begin{center}
\begin{tabular}{l | l}
术语 & 说明 \\ \hline
翻译规则 & 翻译的最小单元(或步骤) \\ \hline
推导 & 由一系列规则组成的分析或翻译过程,推导可以 \\
     & 被看做是规则的序列 \\ \hline
规则表 & 翻译规则的存储表示形式,可以高效进行查询\\ \hline
层次短语模型 & 基于同步上下文无关文法的翻译模型,非终结符\\
             & 只有S和X两种,规则和文法并不需要符合语言学\\
             & 句法约束\\ \hline
树到串模型 & 一类翻译模型,它使用源语语言学句法树,因此\\
           & 翻译可以被看做从一棵句法树到词串的转换\\ \hline
串到树模型 & 一类翻译模型,它使用目标语语言学句法树,因\\
           & 此翻译可以被看做从词串到句法树的转换\\
\end{tabular}
\end{center}
}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 句法树中的一些基本概念(续)
\begin{frame}{术语(续)}

\vspace{-0.5em}
{\small
\begin{center}
\begin{tabular}{l | l}
术语 & 说明 \\ \hline
树到树模型 & 一类翻译模型,它同时使用源语和目标语语言学\\
           & 句法树,因此此翻译可以被看做从句法树到句法\\
           & 树的转换 \\ \hline
基于句法 & 使用语言学句法 \\ \hline
基于树 & (源语言)使用树结构(大多指句法树)\\ \hline
基于串 & (源语言)使用词串,比如串到树的翻译系统的\\
       & 解码器一般都是基于串的解码方法 \\ \hline
基于森林 & (源语言)使用句法森林,这里森林只是对多个\\
       & 句法树的一种压缩表示 \\ \hline
xiaotong committed
4528 4529
词汇化规则 & 含有终结符的规则 \\ \hline
非词汇规则 & 不含有终结符的规则 \\ \hline
xiaotong committed
4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558
句法约软束 & 不强制规则推导匹配语言学句法树,通常把 \\
           & 句法信息作为特征使用 \\ \hline
句法硬约束 & 强制推导必须符合语言学句法树,不符合的 \\
           & 推导会被过滤掉
\end{tabular}
\end{center}
}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 句法模型的分类
\begin{frame}{句法模型的分类}

\begin{center}
\begin{tikzpicture}

\begin{scope}
\tikzstyle{cnode} = [minimum width=7.0em,minimum height=2.5em,rounded corners=0.2em];
\tikzstyle{xnode} = [minimum width=4.5em,minimum height=2.5em,rounded corners=0.2em];

\node[xnode,anchor=west,fill=red!30,align=left] (itg) at (0,0) {\footnotesize{反向转录}\\\footnotesize{文法}};
\node[xnode,anchor=west,fill=red!30,align=left] (hiero) at ([xshift=0.5em]itg.east) {\footnotesize{层次短语}\\\footnotesize{模型}};
\node[xnode,anchor=west,fill=blue!30,align=left] (s2t) at ([xshift=0.5em]hiero.east) {\footnotesize{串到树}\\\footnotesize{模型}};
\node[xnode,anchor=west,fill=blue!30,align=left] (t2s) at ([xshift=0.5em]s2t.east) {\footnotesize{树到串}\\\footnotesize{模型}};
\node[xnode,anchor=west,fill=blue!30,align=left] (t2t) at ([xshift=0.5em]t2s.east) {\footnotesize{树到树}\\\footnotesize{模型}};

\node[cnode,anchor=south,fill=red!30,align=left] (cat1) at ([xshift=-0.2em,yshift=2em]hiero.north west) {\footnotesize{基于形式文法}\\\footnotesize{的模型}};
\node[cnode,anchor=south,fill=blue!30,align=left] (cat2) at ([xshift=-0.0em,yshift=2em]t2s.north) {\footnotesize{基于语言学}\\\footnotesize{句法的模型}};
xiaotong committed
4559
\node[cnode,anchor=south,minimum width=10.0em,fill=green!30,align=center] (cat0) at ([xshift=-3em,yshift=2em]cat2.north west) {\footnotesize{(广义上)}\\\footnotesize{基于句法的模型}};
xiaotong committed
4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579

\draw [-,thick] ([yshift=0.1em,xshift=1em]cat1.north) -- ([xshift=-1.5em,yshift=-0.1em]cat0.south);
\draw [-,thick] ([yshift=0.1em,xshift=-1em]cat2.north) -- ([xshift=1.5em,yshift=-0.1em]cat0.south);
\draw [-,thick] ([yshift=0.1em]itg.north) -- ([xshift=-0.5em,yshift=-0.1em]cat1.south);
\draw [-,thick] ([yshift=0.1em]hiero.north) -- ([xshift=0.5em,yshift=-0.1em]cat1.south);
\draw [-,thick] ([yshift=0.1em]s2t.north) -- ([xshift=-0.8em,yshift=-0.1em]cat2.south);
\draw [-,thick] ([yshift=0.1em]t2s.north) -- ([xshift=-0.0em,yshift=-0.1em]cat2.south);
\draw [-,thick] ([yshift=0.1em]t2t.north) -- ([xshift=0.8em,yshift=-0.1em]cat2.south);

\node [anchor=north] (itglabel) at (itg.south) {\scriptsize{(Wu, 1995)}};
\node [anchor=north] (hierolabel) at (hiero.south) {\scriptsize{(Chiang, 2005)}};
\node [anchor=north,align=left] (s2tlabel) at (s2t.south) {\scriptsize{(Galley et al.,}\\\scriptsize{\ 2004; 2006)}};
\node [anchor=north,align=left] (t2slabel) at (t2s.south) {\scriptsize{(Liu et al.,}\\\scriptsize{\ 2006)}};
\node [anchor=north,align=left] (t2tlabel) at (t2t.south) {\scriptsize{(Eisner, 2003)}};

\end{scope}

\end{tikzpicture}
\end{center}

xiaotong committed
4580
\vspace{-0.8em}
xiaotong committed
4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615
\begin{itemize}
\item 实际上,上面仅仅只是一种分类方法,还有很多其它分类标准,比如:句法软约束 vs 句法硬约束,基于树 vs. 基于串,等等
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%% 对比
\begin{frame}{句法模型对比}

\begin{tabular}{l | l | l | l | l}
& 形式句法 & \multicolumn{3}{c}{语言学句法} \\ \cline{3-5}
& & 树到串 & 串到树 & 树到树 \\ \hline
源语句法 & No & Yes & No & Yes \\
目标语句法 & No & No & Yes & Yes \\
基于串的解码 & Yes & No & Yes & Yes \\
基于树的解码 & No & Yes & No & Yes \\
健壮性 & High & Mid & Mid & Low
\end{tabular}

\vspace{0.3em}

\begin{itemize}
\item<2-> 下面,以树到串/串到树为例进行介绍,一些代表性论文\\
	\begin{itemize}
	\item \textbf{What's in a translation rule?}\\
        \textbf{Galley et al., 2004, In Proc. of HLT-NAACL}
        \item \textbf{Scalable Inference and Training of Context-Rich Syntactic Translation Models}\\
        \textbf{Galley et al., 2006, In Proc. of ACL}
        \item \textbf{Tree-to-String Alignment Template for Statistical Machine Translation}\\
        \textbf{Liu et al., 2006, In Proc. of ACL}
	\end{itemize}
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4616 4617 4618
\subsection{基于树结构的文法}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643
%%%  树结构的表示
\begin{frame}{树结构的表示}
\begin{itemize}
\item 基于句法的翻译模型核心是对\alert{树结构}进行建模。对于树到串和串到树模型,本质上是要到树和串的对应关系;而对于树到树模型,本质上是找到树到树的对应
	\begin{tikzpicture}
	{\footnotesize
	\begin{scope}[sibling distance=3pt, level distance = 22pt]
	\Tree[.S [.NN ] [.VP [.AD ] [.VP [.VV ] [.AS ] ] ] ]
	\end{scope}
	
	\begin{scope}[xshift=1in,yshift=0.25in]
	\node [anchor=north west,align=left] (string1) at (0,0) {[S \\\hspace{1em}NN\\\hspace{1em}VP[\\\hspace{2.5em}AD \\\hspace{2.5em}VP[\\\hspace{4em}VV \\\hspace{4em}AS]]]};
	\end{scope}
	
	\begin{scope}[xshift=2.5in,yshift=-0.80in]
	\node [anchor=west,align=left] (string2) at (0,0) {(S NN VP(AD \\ VP(VV AS)))};
	\end{scope}
	
	\node [anchor=north west] (cap1) at (-1.5em,-1in) {\scriptsize{(a) 树状表示}};
	\node [anchor=west] (cap2) at ([xshift=0.5in]cap1.east) {\scriptsize{(b) 序列表示(缩进)}};
	\node [anchor=west] (cap3) at ([xshift=0.5in]cap2.east) {\scriptsize{(c) 序列表示}};
	}
	\end{tikzpicture}
\item<2-> 通常,可以用基于树结构的翻译规则来描述上述过程,有两种情况:
	\begin{enumerate}
xiaotong committed
4644 4645
	\item 树到串翻译规则 - 对应树到串、串到树模型
	\item 树到树翻译规则 - 对应树到树模型
xiaotong committed
4646 4647 4648
	\end{enumerate}
	这里用一种统一的形式描述上述规则
\end{itemize}
xiaotong committed
4649 4650 4651
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671
%%%  基于树结构的文法
\begin{frame}{基于树结构的文法}
\begin{itemize}
\item 为了描述任意树和串之间的转换,可以定义如下文法
\end{itemize}

\begin{beamerboxesrounded}[upper=uppercolblue,lower=lowercolblue,shadow=true]{定义 - 基于树结构的文法}
{\small
一个基于树结构的文法由七部分构成$(N_s, N_t, T_s, T_t, I_s, I_t, R)$,其中 \\
1. $N_s$$N_t$是源语和目标语非终结符集合 \\
2. $T_s$$T_t$是源语言和目标语终结符集合\\
3. $I_s \subseteq N_s$$I_t \subseteq N_t$是源语言和目标语起始非终结符集合\\
4. $R$是规则集合,每条规则$r \in R$有如下形式

\begin{displaymath}
\langle\  \alpha_h, \beta_h\ \rangle \to \langle\ \alpha_r, \beta_r, \sim\ \rangle
\end{displaymath}
其中,规则左部由非终结符$\alpha_h \in N_s$$\beta_h \in N_t$构成;规则右部由三部分组成,$\alpha_r$表示由源语言终结符和非终结符组成的树结构;$\beta_r$ 表示由目标语言终结符和非终结符组成的树结构;$\sim$表示$\alpha_r$$\beta_r$中叶子非终结符的1-1对应关系
}
\end{beamerboxesrounded}
xiaotong committed
4672 4673 4674 4675

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720
%%%  规则实例(树到树)
\begin{frame}{基于树的翻译规则}
\begin{itemize}
\item 上述文法定义了一种树结构到树结构的映射,例子:
\end{itemize}

\begin{center}
\begin{tikzpicture}

{\scriptsize
\begin{scope}[sibling distance=5pt, level distance = 22pt]
\Tree[.\node(s1){VP}; [.\node(s2){PP}; ] [.\node(s3){VP}; [.\node(s4){VV}; \node[fill=white](w1){表示}; ] [.\node(s5){NN}; ] ] ]
\end{scope}

\begin{scope}[xshift=2in,sibling distance=5pt, level distance = 22pt]
\Tree[.\node(t1){VP}; [.\node(t2){VBZ}; \node(w2){was}; ] [.\node(t3){VP}; [.\node(t4){VBN}; ] [.\node(t5){PP}; ] ] ]
\end{scope}

\begin{pgfonlayer}{background}
\node [anchor=west] (arrow) at ([xshift=3em]s5.east) {\Large{\textbf{$\to$}}};
\visible<2->{
\node [inner sep=0,fill=orange!20] [fit = (s2)] (snode1) {};
\node [inner sep=0,fill=green!20] [fit = (s5)] (snode2) {};
\node [inner sep=0,fill=green!20] [fit = (t4)] (tnode1) {};
\node [inner sep=0,fill=orange!20] [fit = (t5)] (tnode2) {};
\draw [<->,dotted,thick] (snode2.south) ..controls +(south:2.5em) and +(south:2.5em).. (tnode1.south);
\draw [<->,dotted,thick] (snode1.south) ..controls +(south:8em) and +(south:4.5em).. (tnode2.south);
}
\end{pgfonlayer}
}

\end{tikzpicture}
\end{center}

\vspace{-2.0em}

\begin{itemize}
\item 由规则定义$\langle\  \alpha_h, \beta_h\ \rangle \to \langle\ \alpha_r, \beta_r, \sim\ \rangle$知道


\vspace{-1.3em}
{\small
\begin{eqnarray}
\langle\ \alpha_h,\beta_h\ \rangle & = & \langle\ \textrm{VP}, \textrm{VP}\ \rangle \nonumber \\
\alpha_r & = & \textrm{VP(PP:}x\ \textrm{VP(VV(表示) NN:}x)) \nonumber \\
姜雨帆 committed
4721
\beta_r & = & \textrm{VP(VBZ(was) VP(VBN:}x\ \textrm{PP:}x)) \nonumber \\
xiaotong committed
4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857
\sim & = & \{1-2,2-1\} \nonumber
\end{eqnarray}
}

\vspace{-1.7em}
\visible<2->{
$x$表示叶子非终结符(可替换的变量),显然这是调序规则
}

\end{itemize}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  规则实例(树到树)
\begin{frame}{基于树的翻译规则(续)}
\begin{itemize}
\item 可以省略``$\sim$'',把规则重新写为易于计算机处理的格式 \\

\vspace{-1em}
\begin{eqnarray}
\langle\ \textrm{VP}, \textrm{VP}\ \rangle & \to & \langle\ \textrm{VP(PP}_{\alert{1}}\ \textrm{VP(VV(表示) NN}_{\alert{2}})), \nonumber \\
& & \ \ \textrm{VP(VBZ(was) VP(VBZ}_{\alert{2}}\ \textrm{PP}_{\alert{1}}))\ \rangle \nonumber
\end{eqnarray}

其中变量的对应关系用下标数字表示,比如:$\textrm{PP}_1 \leftrightarrow \textrm{PP}_1$$\textrm{NN}_2 \leftrightarrow \textrm{VBZ}_2$

\item<2-> 在这个规则的树结构中,每个叶子非终结符本质上定义了一个变量,这个节点也被称作边缘节点(frontier node)。边缘节点可以被其它树结构替换,组合为更大的树结构,这个操作被称作组合(composition) 或树替换

\end{itemize}

\visible<2->{
\begin{center}
\begin{tikzpicture}

{\scriptsize
\begin{scope}[sibling distance=5pt, level distance = 22pt]
\Tree[.\node(s1){VP}; [.\node(s2){PP}; ] [.\node(s3){VP}; [.\node(s4){VV}; \node[fill=white](w1){表示}; ] [.\node(s5){NN}; ] ] ]
\end{scope}

\begin{scope}[xshift=1.2in, yshift=-0.2in, sibling distance=5pt, level distance = 22pt]
\Tree[.\node(ws1){NN}; \node(ws2){满意}; ]
\end{scope}

\node (anchor=west] (arrow) at ([xshift=0.4in]ws2.east) {\large{$\Rightarrow$}};

\begin{pgfonlayer}{background}
\node [inner sep=0,fill=green!20] [fit = (ws1)] (snode1) {};
\node [inner sep=0,fill=green!20] [fit = (s5)] (snode2) {};
\draw [<-,thick,dotted] ([xshift=0.1em]s5.east) ..controls +(east:3em) and +(west:3em).. ([xshift=-0.1em]ws1.west);
\end{pgfonlayer}

\begin{scope}[xshift=2.5in, sibling distance=5pt, level distance = 22pt]
\Tree[.\node(s1){VP}; [.\node(s2){PP}; ] [.\node(s3){VP}; [.\node(s4){VV}; \node[fill=white](w1){表示}; ] [.\node(s5){NN}; \node(w2){满意}; ] ] ]
\end{scope}
}

\end{tikzpicture}
\end{center}
}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  规则的组装对应翻译过程
\begin{frame}{使用规则定义翻译过程}

\begin{itemize}
\item 规则的推导描述双语句子同步生成(和分析)的过程
    \begin{itemize}
    \item \raisebox{0.3em}{\tikz{\draw[*-*] (0,0)--(0.5,0);}}表示对边缘阶段(变量)的替换操作
    \end{itemize}
\end{itemize}

\begin{tikzpicture}

% target side
\begin{scope}[xshift=-1em, level distance=25pt]

\node[scale=0.8] at (1.5, 2.2) {目标语言};

\node[scale=0.6, inner sep=0.1cm, draw,xshift=1em] (tfrag1) at
   (0,0.05) {\Tree[.NP [.DT the ] [.NNS imports ]]};

\visible<4->{
\node[scale=0.6, inner sep=0.1cm, draw, sibling distance=100pt] (tfrag2) at
   (1.4,1.4) {\Tree[.S [.NP ] [.VP ]]};
}

\visible<3->{
\node[scale=0.6, inner sep=0.1cm, draw, sibling distance=30pt] (tfrag3) at
   (3,-0.2) {\Tree[.VP [.VBZ have ] [.ADVP [.RB ] [.VBN fallen ]]]};
}

\visible<2->{
\node[scale=0.6, inner sep=0.1cm, draw,xshift=-1.5em] (tfrag4) at
   (2.8,-1.8) {\Tree[.RB drastically ]};
}

\visible<4->{\draw[*-*] (0.15,0.7) -- (0.15,1.05);}
\visible<4->{\draw[*-*] (2.7,0.7) -- (2.7,1.05);}
\visible<3->{\draw[*-*] (2.4,-1.4) .. controls +(north:0.6) and +(south:0.6) .. (3.0,-0.6);}
\end{scope}

% source side
\begin{scope}[scale=0.8, level distance=25pt, xshift=-20em, yshift=1em]

\node[scale=0.8] at (2.1, 2.45) {源语言};

\visible<1->{
\node[scale=0.6, inner sep=0.1cm, draw] (sfrag1) at
   (0,0) {\Tree[.NN 进口 ]};
}

\visible<4->{
\node[scale=0.6, inner sep=0.1cm, draw, sibling distance=135pt] (sfrag2) at
   (2.0,1.4) {\Tree[.IP [.NN ] [.VP ]]};
}

\visible<3->{
\node[scale=0.6, inner sep=0.1cm, xshift=1em, draw] (sfrag3) at
   (4,-0.7) {\Tree[.VP [.AD ] [.ADVP [.VV 下降 ] [.AS 了 ]]]};
}

\visible<2->{
\node[scale=0.6, inner sep=0.1cm, draw] (sfrag4) at
   (1.3,-1.3) {\Tree[.AD 大幅度 ]};
}

\visible<4->{\draw[*-*] (0.05,0.5) -- (0.05,0.95);}
\visible<4->{\draw[*-*] (4.15,0.5) -- (4.15,0.95);}
\visible<3->{\draw[*-*] (1.55,-0.95) .. controls +(east:1.0) and +(south:0.4) .. (3.5,-0.6);}

\end{scope}

% rule 1
xiaotong committed
4858
\begin{scope}[scale=0.6, xshift=-22em, yshift=-11em, level distance=20pt]
xiaotong committed
4859 4860 4861 4862 4863 4864 4865 4866

\begin{scope}[anchor=north east, xshift=-6em] \Tree[.NN 进口 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west] \Tree[.NP [.DT the ] [.NNS imports ]] \end{scope}

\end{scope}

% rule 2
xiaotong committed
4867
\begin{scope}[scale=0.6, xshift=-11em, yshift=-11em, level distance=20pt]
xiaotong committed
4868 4869 4870 4871 4872 4873 4874 4875

\begin{scope}[anchor=north east, xshift=-6em] \Tree[.AD 大幅度 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west] \Tree[.RB drastically ] \end{scope}

\end{scope}

% rule 3
xiaotong committed
4876
\begin{scope}[scale=0.6, xshift=2em, yshift=-11em, level distance=20pt]
xiaotong committed
4877 4878 4879 4880 4881 4882 4883 4884

\begin{scope}[anchor=north east, xshift=-7em] \Tree[.VP [.AD ] [.ADVP [.VV 下降 ] [.AS 了 ]]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west, xshift=1em] \Tree[.VP [.VBZ have ] [.ADVP [.RB ] [.VBN fallen ]]] \end{scope}

\end{scope}

% rule 4
xiaotong committed
4885
\begin{scope}[scale=0.6, xshift=16em, yshift=-11em, level distance=20pt]
xiaotong committed
4886 4887 4888 4889 4890 4891 4892 4893

\begin{scope}[anchor=north east, xshift=-6em] \Tree[.IP [.NN ] [.VP ]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west,xshift=-1em] \Tree[.S [.NP ] [.VP ]] \end{scope}

\end{scope}

% red rule 1
xiaotong committed
4894
\begin{scope}[red, scale=0.6, xshift=-22em, yshift=-11em, level distance=20pt]
xiaotong committed
4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905

\visible<1>{
\begin{scope}[anchor=north east, xshift=-6em] \Tree[.NN 进口 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west] \Tree[.NP [.DT the ] [.NNS imports ]] \end{scope}
}

\end{scope}

\visible<2>{
% red rule 2
xiaotong committed
4906
\begin{scope}[red, scale=0.6, xshift=-11em, yshift=-11em, level distance=20pt]
xiaotong committed
4907 4908 4909 4910 4911 4912 4913 4914 4915 4916

\begin{scope}[anchor=north east, xshift=-6em] \Tree[.AD 大幅度 ] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west] \Tree[.RB drastically ] \end{scope}

\end{scope}
}

\visible<3>{
% red rule 3
xiaotong committed
4917
\begin{scope}[red, scale=0.6, xshift=2em, yshift=-11em, level distance=20pt]
xiaotong committed
4918 4919 4920 4921 4922 4923 4924 4925 4926 4927

\begin{scope}[anchor=north east, xshift=-7em] \Tree[.VP [.AD ] [.ADVP [.VV 下降 ] [.AS 了 ]]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west, xshift=1em] \Tree[.VP [.VBZ have ] [.ADVP [.RB ] [.VBN fallen ]]] \end{scope}

\end{scope}
}

\visible<4>{
% rule 4
xiaotong committed
4928
\begin{scope}[red, scale=0.6, xshift=16em, yshift=-11em, level distance=20pt]
xiaotong committed
4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941

\begin{scope}[anchor=north east, xshift=-6em] \Tree[.IP [.NN ] [.VP ]] \end{scope}
\draw[->] (-1.7,0.1) -- (-0.9,0.1);
\begin{scope}[anchor=north west,xshift=-1em] \Tree[.S [.NP ] [.VP ]] \end{scope}

\end{scope}
}

\end{tikzpicture}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020
%%%  树到串规则
\begin{frame}{树到串翻译规则}
\begin{itemize}
\item 对于只有一端使用句法树的情况,仍然可以用上述规则定义进行描述
    \begin{itemize}
    \item 树到串翻译可以看做是句法树到词串的转换,串到树类似,只是反过来看
    \end{itemize}
\end{itemize}

\begin{center}
\begin{tikzpicture}

\begin{scope}[scale=0.9]
\Tree[.\node(sn1){VP};
        [.\node(sn2){VV}; \node(scw1){提高}; ]
        [.\node(sn3){NN}; ]
     ]

\path [draw, ->, thick] ([xshift=1em]sn3.east) -- ([xshift=2.5em]sn3.east);

\node [anchor=west] (tw1) at ([xshift=3.5em]sn3.east) {increases};
\node [anchor=west] (tw2) at ([xshift=0.3em]tw1.east) {NN};

\draw[dotted,thick] ([yshift=-0.1em]sn3.south)..controls +(south:1.2) and +(south: 1.2)..([yshift=-0.1em]tw2.south);

\end{scope}

\end{tikzpicture}
\end{center}

\vspace{-0.3em}
\begin{itemize}
\item<2-> 由规则定义$\langle\  \alpha_h, \beta_h\ \rangle \to \langle\ \alpha_r, \beta_r, \sim\ \rangle$,可得

\vspace{-1.3em}
{\small
\begin{eqnarray}
\alpha_h & = & \textrm{VP} \nonumber \\
\beta_h & = & \textrm{VP}\ (=\alpha_h) \nonumber \\
\alpha_r & = & \textrm{VP(VV(提高) NN:}x) \nonumber \\
\beta_r & = & \textrm{increases\ NN:}x \nonumber \\
\sim & = & \{1-1\} \nonumber
\end{eqnarray}
}

\end{itemize}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  树到串规则
\begin{frame}{树到串翻译规则}
\begin{itemize}
\item 这里,目标端是一个词串,因此
    \begin{itemize}
    \item $\beta_h$实际上并不是树的根节点标记,直接复制$\alpha_h$即可,也就是说目标语端和源语端共享同一个非终结符集合
    \item $\beta_s$是一个词串,可以被看作是树的叶子节点序列,或者一个单层的树结构
    \end{itemize}
\item<2-> 可以把这条规则简记为

\begin{center}
\vspace{0.5em}
$\textrm{VP} \to \langle\ \textrm{VP(VV(提高) NN}_1),\ \textrm{increases\ NN}_1\ \rangle$ \\
\vspace{0.5em}
\end{center}
\\
\begin{center}
\vspace{0.5em}
$\textrm{VP(VV(提高) NN}_1) \to \textrm{increases\ NN}_1$ \\
\end{center}
\vspace{0.5em}
上述规则也被称作\alert{树到串翻译规则}

\item<3-> 类似的,层次短语规则也可以被看作是一种特殊的基于树结构的规则,它的源语和目标语都是由单层树结构构成,且源语和目标语共享同一个非终结符集合

\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
5021
\subsection{树到串翻译规则抽取}
xiaotong committed
5022 5023

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
5024
%%%  基于树结构的翻译文法 - 树到串/串到树
xiaotong committed
5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121
\begin{frame}{树到串规则抽取 - GHKM方法}
\begin{itemize}
\item 基于句法的翻译系统的核心有两个部分
    \begin{enumerate}
    \item \textbf{文法归纳}:从带有句法分析结果的双语数据中自动学习翻译规则
    \item \textbf{解码}:使用学习到的翻译规则对新的句子进行翻译
    \end{enumerate}
\item<2-> 首先要解决的是如何获取翻译规则,即\alert{规则抽取} - 这里先从GHKM方法开始,它是经典的树到串翻译规则的抽取方法(Galley et al., 2004; 2006)
    \begin{itemize}
    \item 方法的名字是由四位作者的名字首字母构成 :)
    \end{itemize}
\item<3-> GHKM方法的输入包括
    \begin{itemize}
    \item 源语言句子和和它的短语分析树
    \item 目标语句子
    \item 源语和目标语句子之间的词对齐
    \end{itemize}
\item<3-> 注意:
    \begin{itemize}
    \item 句法树可以由句法分析器自动生成
    \item 词对齐可以由词对齐系统(如IBM模型)自动生成
    \end{itemize}
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  翻译规则抽取本质上是要完成对树结构的切割
\begin{frame}{树片段}
\begin{itemize}
\item 树到串翻译规则实际上是一个树片段到一个词串的映射。一个合理的树到串翻译规则,不应该违反任何的词对齐信息
    \begin{itemize}
    \item 显然这种树片段可以有很多
    \item 一棵句法树也可以被切割成多个树片段
    \end{itemize}
\end{itemize}

\begin{center}
\begin{tikzpicture}

{\footnotesize
\begin{scope}[sibling distance=25pt, level distance=20pt]

\Tree[.\node(n1){IP};
     	[.\node(n2){NP}; [.\node(n3){PN}; \node(cw1){}; ]]
     	[.\node(n4){VP};
     		[.\node(n5){PP};
     			[.\node(n6){P}; \node(cw2){}; ]
     			[.\node(n7){NP};
                    [.\node(n8){NN}; \node(cw3){回答}; ]
                ]
     		]
     		[.\node(n9){VP};
     			[.\node(n10){VV}; \node(cw4){表示}; ]
     			[.\node(n11){NN}; \node(cw5){满意}; ]
     		]
     	]
     ]

\node[anchor=north,minimum size=18pt] (tw1) at ([yshift=-6.0em]cw1.south){he};
\node[anchor=west,minimum size=18pt] (tw2) at ([yshift=-0.1em,xshift=1.1em]tw1.east){was};
\node[anchor=west,minimum size=18pt] (tw3) at ([yshift=0.1em,xshift=1.1em]tw2.east){satisfied};
\node[anchor=west,minimum size=18pt] (tw4) at ([xshift=1.1em]tw3.east){with};
\node[anchor=west,minimum size=18pt] (tw5) at ([xshift=1.1em]tw4.east){the};
\node[anchor=west,minimum size=18pt] (tw6) at ([yshift=-0.1em,xshift=1.1em]tw5.east){answer};

\draw[dashed] (cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw[dashed] (cw2.south) .. controls +(south:1.6) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw[dashed] (cw4.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw[dashed] (cw5.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);


\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,inner sep=0em,fill=red!20] [fit = (cw2) (cw3) (n5)] (rule1s) {};
\node [rectangle,inner sep=0em,fill=red!20] [fit = (tw4) (tw5) (tw6)] (rule1t) {};
}
\visible<3->{
\node [rectangle,inner sep=0em,fill=blue!20] [fit = (cw5) (n11)] (rule2s) {};
\node [rectangle,inner sep=0em,fill=blue!20] [fit = (tw3)] (rule2t) {};
}
\end{pgfonlayer}

\visible<2->{
\node [anchor=south] (rule1label) at ([xshift=1em]rule1s.north west) {\scriptsize{\textbf{\alert{正确的规则}}}};
}
\visible<3->{
\node [anchor=north west,align=left] (rule2label) at (rule2s.north east) {\scriptsize{\textbf{\color{blue} 错误的规则}}\\\scriptsize{因为``satisfied''会}\\\scriptsize{对齐到规则外,}\\\scriptsize{也就是这条规则}\\\scriptsize{与词对齐不相容}};
}

\end{scope}
}

\end{tikzpicture}
\end{center}

xiaotong committed
5122 5123 5124
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411
%%%  Span的定义
\begin{frame}{Span}
\begin{itemize}
\item 为了描述每个树节点对齐到目标语的情况,定义概念
\end{itemize}

\begin{beamerboxesrounded}[upper=uppercolblue,lower=lowercolblue,shadow=true]{定义 - Span}
{\small
源语树节点$n$的Span是它所对应到到目标语的第一个单词和最后一个单词所构成的索引范围
}
\end{beamerboxesrounded}

\begin{center}
\begin{tikzpicture}

{\footnotesize
\begin{scope}[sibling distance=25pt, level distance=20pt]

\Tree[.\node(n1){IP};
     	[.\node(n2){NP}; [.\node(n3){PN}; \node(cw1){}; ]]
     	[.\node(n4){VP};
     		[.\node(n5){PP};
     			[.\node(n6){P}; \node(cw2){}; ]
     			[.\node(n7){NP};
                    [.\node(n8){NN}; \node(cw3){回答}; ]
                ]
     		]
     		[.\node(n9){VP};
     			[.\node(n10){VV}; \node(cw4){表示}; ]
     			[.\node(n11){NN}; \node(cw5){满意}; ]
     		]
     	]
     ]

\node[anchor=north,minimum size=18pt,align=center] (tw1) at ([yshift=-6.0em]cw1.south){he\\\scriptsize{1}};
\node[anchor=west,minimum size=18pt,align=center] (tw2) at ([yshift=-0.1em,xshift=1.1em]tw1.east){was\\\scriptsize{2}};
\node[anchor=west,minimum size=18pt,align=center] (tw3) at ([yshift=0.1em,xshift=1.1em]tw2.east){satisfied\\\scriptsize{3}};
\node[anchor=west,minimum size=18pt,align=center] (tw4) at ([xshift=1.1em]tw3.east){with\\\scriptsize{4}};
\node[anchor=west,minimum size=18pt,align=center] (tw5) at ([xshift=1.1em]tw4.east){the\\\scriptsize{5}};
\node[anchor=west,minimum size=18pt,align=center] (tw6) at ([yshift=-0.1em,xshift=1.1em]tw5.east){answer\\\scriptsize{6}};

\draw[dashed] (cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw[dashed] (cw2.south) .. controls +(south:1.6) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw[dashed] (cw4.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw[dashed] (cw5.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);

\visible<2->{
\node [anchor=south west,align=left,fill=orange!20,drop shadow] (label1) at ([xshift=0.5em]n11.north east) {\scriptsize{span=\{3\}}\\\scriptsize{{\color{orange!20} c-span=\{1,3-6\}}}};
}
\visible<3->{
\node [anchor=south west,align=left,fill=green!20,drop shadow] (label1) at ([xshift=0.5em,yshift=-0.5em]n4.north east) {\scriptsize{span=\{3-6\}}\\\scriptsize{{\color{green!20} c-span=\{1\}}}};
}

\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,fill=orange!20,inner sep=0] [fit = (n11)] (n11box) {};
}
\visible<3->{
\node [rectangle,fill=green!20,inner sep=0] [fit = (n4)] (n4box) {};
}
\end{pgfonlayer}

\end{scope}
}

\end{tikzpicture}
\end{center}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  Complement Span的定义
\begin{frame}{Complement Span}
\begin{itemize}
\item 进一步,引入Complement Span的概念
\end{itemize}

\vspace{-0.2em}

\begin{beamerboxesrounded}[upper=uppercolblue,lower=lowercolblue,shadow=true]{定义 - Complement Span}
{\small
源语树节点$n$的Complement Span是除了它的祖先和子孙阶段外的其它节点Span的并集
}
\end{beamerboxesrounded}

\begin{center}
\begin{tikzpicture}

{\footnotesize
\begin{scope}[sibling distance=25pt, level distance=20pt]

\Tree[.\node(n1){IP};
     	[.\node(n2){NP}; [.\node(n3){PN}; \node(cw1){}; ]]
     	[.\node(n4){VP};
     		[.\node(n5){PP};
     			[.\node(n6){P}; \node(cw2){}; ]
     			[.\node(n7){NP};
                    [.\node(n8){NN}; \node(cw3){回答}; ]
                ]
     		]
     		[.\node(n9){VP};
     			[.\node(n10){VV}; \node(cw4){表示}; ]
     			[.\node(n11){NN}; \node(cw5){满意}; ]
     		]
     	]
     ]

\node[anchor=north,minimum size=18pt,align=center] (tw1) at ([yshift=-6.0em]cw1.south){he\\\scriptsize{1}};
\node[anchor=west,minimum size=18pt,align=center] (tw2) at ([yshift=-0.1em,xshift=1.1em]tw1.east){was\\\scriptsize{2}};
\node[anchor=west,minimum size=18pt,align=center] (tw3) at ([yshift=0.1em,xshift=1.1em]tw2.east){satisfied\\\scriptsize{3}};
\node[anchor=west,minimum size=18pt,align=center] (tw4) at ([xshift=1.1em]tw3.east){with\\\scriptsize{4}};
\node[anchor=west,minimum size=18pt,align=center] (tw5) at ([xshift=1.1em]tw4.east){the\\\scriptsize{5}};
\node[anchor=west,minimum size=18pt,align=center] (tw6) at ([yshift=-0.1em,xshift=1.1em]tw5.east){answer\\\scriptsize{6}};

\draw[dashed] (cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw[dashed] (cw2.south) .. controls +(south:1.6) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw[dashed] (cw4.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw[dashed] (cw5.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);

\node [anchor=south west,align=left,fill=orange!20,drop shadow] (label1) at ([xshift=0.5em]n11.north east) {\scriptsize{span=\{3\}}\\\scriptsize{c-span=\{1,3-6\}}};
\node [anchor=south west,align=left,fill=green!20,drop shadow] (label1) at ([xshift=0.5em,yshift=-0.5em]n4.north east) {\scriptsize{span=\{3-6\}}\\\scriptsize{c-span=\{1\}}};

\begin{pgfonlayer}{background}
\node [rectangle,fill=orange!20,inner sep=0] [fit = (n11)] (n11box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n4)] (n4box) {};
\end{pgfonlayer}

\end{scope}
}

\end{tikzpicture}
\end{center}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  Admissible Node的定义
\begin{frame}{可信节点}
\begin{itemize}
\item 基于Span和Complment Span,可以定义可信节点)
\end{itemize}

\vspace{-0.3em}

\begin{beamerboxesrounded}[upper=uppercolblue,lower=lowercolblue,shadow=true]{定义 - 可信节点(Admissible Node)}
{\small
对于源语树节点$n$,如果他的Span和Complement Span不相交,节点$n$就是一个可信节点,否则是一个不可信节点
}
\end{beamerboxesrounded}

\begin{center}
\begin{tikzpicture}

{\footnotesize
\begin{scope}[sibling distance=25pt, level distance=20pt]

\Tree[.\node(n1){IP};
     	[.\node(n2){NP}; [.\node(n3){PN}; \node(cw1){}; ]]
     	[.\node(n4){VP};
     		[.\node(n5){PP};
     			[.\node(n6){P}; \node(cw2){}; ]
     			[.\node(n7){NP};
                    [.\node(n8){NN}; \node(cw3){回答}; ]
                ]
     		]
     		[.\node(n9){VP};
     			[.\node(n10){VV}; \node(cw4){表示}; ]
     			[.\node(n11){NN}; \node(cw5){满意}; ]
     		]
     	]
     ]

\node[anchor=north,minimum size=18pt,align=center] (tw1) at ([yshift=-6.0em]cw1.south){he\\\scriptsize{1}};
\node[anchor=west,minimum size=18pt,align=center] (tw2) at ([yshift=-0.1em,xshift=1.1em]tw1.east){was\\\scriptsize{2}};
\node[anchor=west,minimum size=18pt,align=center] (tw3) at ([yshift=0.1em,xshift=1.1em]tw2.east){satisfied\\\scriptsize{3}};
\node[anchor=west,minimum size=18pt,align=center] (tw4) at ([xshift=1.1em]tw3.east){with\\\scriptsize{4}};
\node[anchor=west,minimum size=18pt,align=center] (tw5) at ([xshift=1.1em]tw4.east){the\\\scriptsize{5}};
\node[anchor=west,minimum size=18pt,align=center] (tw6) at ([yshift=-0.1em,xshift=1.1em]tw5.east){answer\\\scriptsize{6}};

\draw[dashed] (cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw[dashed] (cw2.south) .. controls +(south:1.6) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw[dashed] (cw4.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw[dashed] (cw5.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);

\node [anchor=south west,align=left,fill=orange!20,drop shadow] (label1) at ([xshift=0.5em]n11.north east) {\scriptsize{span=\{3\}}\\\scriptsize{c-span=\{1,3-6\}}};
\node [anchor=south west,align=left,fill=green!20,drop shadow] (label2) at ([xshift=0.5em,yshift=-0.5em]n4.north east) {\scriptsize{span=\{3-6\}}\\\scriptsize{c-span=\{1\}}};

\begin{pgfonlayer}{background}
\node [rectangle,fill=orange!20,inner sep=0] [fit = (n11)] (n11box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n4)] (n4box) {};

\visible<3->{
\node [rectangle,fill=green!20,inner sep=0] [fit = (n1)] (n1box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n2)] (n2box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n3)] (n3box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n5)] (n5box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n6)] (n6box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n7)] (n7box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n8)] (n8box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n9)] (n9box) {};
\node [rectangle,fill=orange!20,inner sep=0] [fit = (n10)] (n10box) {};
}
\end{pgfonlayer}

\visible<2->{
\node [anchor=north] (n11boxlabel) at (label1.south) {\tiny{\textbf{\alert{不可信}}}};
\node [anchor=north] (n4boxlabel) at (label2.south) {\tiny{\textbf{\alert{可信}}}};
}

\visible<3->{
\node [anchor=north west, minimum size=1.2em, fill=green!20] (land1) at ([xshift=1.5em,yshift=-1em]cw5.south east) {};
\node [anchor=west] (land1label) at (land1.east) {\scriptsize{可信}};
\node [anchor=north west, minimum size=1.2em, fill=orange!20] (land2) at ([yshift=-0.3em]land1.south west) {};
\node [anchor=west] (land2label) at (land2.east) {\scriptsize{不可信}};
}

\end{scope}
}

\end{tikzpicture}
\end{center}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  规则抽取
\begin{frame}{规则抽取}
\begin{itemize}
\item 可信节点本质上定义了规则的边界,规则需要满足
    \begin{itemize}
    \item 左部树片段的根节点是可信节点
    \item 左部树片段的叶子节点是终结符或者可信节点
    \end{itemize}
\end{itemize}

\begin{center}
{\footnotesize
\visible<2->{
例如:$\textrm{VP(PP(P() NP(NN(回答))) VP}_1) \to \textrm{VP}_1\ \textrm{with the answer}$
}
}
\end{center}

\begin{center}
\begin{tikzpicture}

{\footnotesize
\begin{scope}[sibling distance=25pt, level distance=20pt]

\Tree[.\node(n1){IP};
     	[.\node(n2){NP}; [.\node(n3){PN}; \node(cw1){}; ]]
     	[.\node(n4){VP};
     		[.\node(n5){PP};
     			[.\node(n6){P}; \node(cw2){}; ]
     			[.\node(n7){NP};
                    [.\node(n8){NN}; \node(cw3){回答}; ]
                ]
     		]
     		[.\node(n9){VP};
     			[.\node(n10){VV}; \node(cw4){表示}; ]
     			[.\node(n11){NN}; \node(cw5){满意}; ]
     		]
     	]
     ]

\node[anchor=north,minimum size=18pt,align=center] (tw1) at ([yshift=-6.0em]cw1.south){he\\\scriptsize{1}};
\node[anchor=west,minimum size=18pt,align=center] (tw2) at ([yshift=-0.1em,xshift=1.1em]tw1.east){was\\\scriptsize{2}};
\node[anchor=west,minimum size=18pt,align=center] (tw3) at ([yshift=0.1em,xshift=1.1em]tw2.east){satisfied\\\scriptsize{3}};
\node[anchor=west,minimum size=18pt,align=center] (tw4) at ([xshift=1.1em]tw3.east){with\\\scriptsize{4}};
\node[anchor=west,minimum size=18pt,align=center] (tw5) at ([xshift=1.1em]tw4.east){the\\\scriptsize{5}};
\node[anchor=west,minimum size=18pt,align=center] (tw6) at ([yshift=-0.1em,xshift=1.1em]tw5.east){answer\\\scriptsize{6}};

\draw[dashed] (cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw[dashed] (cw2.south) .. controls +(south:1.6) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw[dashed] (cw4.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw[dashed] (cw5.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);

\begin{pgfonlayer}{background}
\visible<2->{
xiaotong committed
5412 5413 5414 5415
\node [fill=blue!30] [fit = (cw2) (cw3) (n7) (n8)] (rule1box1) {};
\node [fill=blue!30] [fit = (n4) (n9)] (rule1box2) {};
\node [fill=blue!30] [fit = (tw3) (tw4) (tw5) (tw6)] (rule1box3) {};
\path [fill=blue!30] ([xshift=0.05em]rule1box2.north west) -- ([xshift=-0.3em,yshift=0.3em]n5.north west) -- ([yshift=-0.05em]rule1box1.north west) -- ([xshift=0.05em,yshift=-0.05em]rule1box2.south west) -- ([xshift=0.05em]rule1box2.north west);
5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452
}

\node [rectangle,fill=orange!20,inner sep=0] [fit = (n11)] (n11box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n4)] (n4box) {};

\node [rectangle,fill=green!20,inner sep=0] [fit = (n1)] (n1box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n2)] (n2box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n3)] (n3box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n5)] (n5box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n6)] (n6box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n7)] (n7box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n8)] (n8box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n9)] (n9box) {};
\node [rectangle,fill=orange!20,inner sep=0] [fit = (n10)] (n10box) {};
\end{pgfonlayer}

\node [anchor=north west, minimum size=1.2em, fill=green!20] (land1) at ([xshift=1.5em,yshift=-1em]cw5.south east) {};
\node [anchor=west] (land1label) at (land1.east) {\scriptsize{可信}};
\node [anchor=north west, minimum size=1.2em, fill=orange!20] (land2) at ([yshift=-0.3em]land1.south west) {};
\node [anchor=west] (land2label) at (land2.east) {\scriptsize{不可信}};

\visible<3->{
\node [draw,thick,red,fill=red!20] [fit = (n9)] (var1) {{\color{black} VP}};
\node [draw,thick,red,fill=red!20] [fit = (tw3)] (var1v2) {{\color{black} \large{VP}}};
\node [anchor=west] (var1label) at ([yshift=0.5em]var1.east) {\tiny{\alert{变量}}};
\node [anchor=south] (var1v2label) at ([xshift=-2em]var1v2.north) {\tiny{\alert{变量}}};
}

\end{scope}
}

\end{tikzpicture}
\end{center}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465
%%%  规则抽取
\begin{frame}{规则抽取 - 树的切割}
\begin{itemize}
\item 所有可信节点构成了句法树的边缘集合(frontier set),进而得到树的一种\alert{切割}以及切割得到的树片段(或规则)
\end{itemize}


\begin{center}
\begin{tikzpicture}

{\scriptsize
\begin{scope}[scale = 0.9, sibling distance=20pt, level distance=30pt]

xiaotong committed
5466
{\footnotesize
xiaotong committed
5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481
\Tree[.\node(n1){IP};
     	[.\node(n2){NP}; [.\node(n3){PN}; \node(cw1){}; ]]
     	[.\node(n4){VP};
     		[.\node(n5){PP};
     			[.\node(n6){P}; \node(cw2){}; ]
     			[.\node(n7){NP};
                    [.\node(n8){NN}; \node(cw3){回答}; ]
                ]
     		]
     		[.\node(n9){VP};
     			[.\node(n10){VV}; \node(cw4){表示}; ]
     			[.\node(n11){NN}; \node(cw5){满意}; ]
     		]
     	]
     ]
xiaotong committed
5482
}
xiaotong committed
5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704

\begin{pgfonlayer}{background}

\visible<2->{
\node [rectangle,fill=orange!20,inner sep=0] [fit = (n11)] (n11box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n4)] (n4box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n1)] (n1box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n2)] (n2box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n3)] (n3box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n5)] (n5box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n6)] (n6box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n7)] (n7box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n8)] (n8box) {};
\node [rectangle,fill=green!20,inner sep=0] [fit = (n9)] (n9box) {};
\node [rectangle,fill=orange!20,inner sep=0] [fit = (n10)] (n10box) {};

\node [anchor=north west, minimum size=1.2em, fill=green!20] (land1) at ([xshift=7.0em,yshift=0em]n1.north east) {};
\node [anchor=west] (land1label) at (land1.east) {\scriptsize{可信}};
\node [anchor=north west, minimum size=1.2em, fill=orange!20] (land2) at ([yshift=-0.3em]land1.south west) {};
\node [anchor=west] (land2label) at (land2.east) {\scriptsize{不可信}};
}

\end{pgfonlayer}

\node[anchor=north,minimum size=18pt] (tw1) at ([yshift=-10.0em]cw1.south){he};
\node[anchor=west,minimum size=18pt] (tw2) at ([yshift=-0.1em,xshift=0.3em]tw1.east){was};
\node[anchor=west,minimum size=18pt] (tw3) at ([yshift=0.1em,xshift=0.3em]tw2.east){satisfied};
\node[anchor=west,minimum size=18pt] (tw4) at ([xshift=0.3em]tw3.east){with};
\node[anchor=west,minimum size=18pt] (tw5) at ([xshift=0.3em]tw4.east){the};
\node[anchor=west,minimum size=18pt] (tw6) at ([yshift=-0.1em,xshift=0.3em]tw5.east){answer};

\draw[dashed] (cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw[dashed] (cw2.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw[dashed] (cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw[dashed] (cw4.south) .. controls +(south:2.5) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw[dashed] (cw5.south) .. controls +(south:2.5) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);

\end{scope}

\begin{scope} [yshift = -1.87in, xshift = 1.9in]
\visible<3->{
\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,draw] (cfrag1) at
   (0,0.25) {\Tree[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag2) at
   ([xshift=1.2em]cfrag1.south east) {\Tree[.\node(sn3){P}; 对 ]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag3) at
   ([xshift=1.2em]cfrag2.south east) {\Tree[.\node(sn4){NP}; [.NN 回答 ]]};
   \end{scope}

\begin{scope}[sibling distance=15pt,level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag4) at
   ([xshift=1.4em]cfrag3.south east) {\Tree[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ] [.\node(sn7){NN}; 满意 ]]};
\end{scope}

\begin{scope}[sibling distance=20pt,,level distance=25pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag5) at
   ([xshift=0.3em,yshift=2.2em]cfrag2.north west) {\Tree[.\node(sn8){PP}; [.\node(sn9){P}; ] [.\node(sn10){NP}; ]]};
\end{scope}

\begin{scope}[sibling distance=60pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag6) at
   ([xshift=1.6em,yshift=0.5em]cfrag5.north west) {\Tree[.\node(sn11){VP}; [.\node(sn12){PP}; ] [.\node(sn13){VP}; ]]};
\end{scope}

\begin{scope}[sibling distance=80pt,level distance=18pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw] (cfrag7) at
   ([xshift=-3.6em,yshift=0.5em]cfrag6.north east) {\Tree[.\node(sn14){IP}; [.\node(sn15){NP}; ] [.\node(sn16){VP}; ]]};
\end{scope}

\node[scale=0.9,anchor=north,minimum size=18pt] (tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south){he};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east){was};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east){satisfied};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw14) at ([xshift=0.5em]tw13.east){with};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw15) at ([xshift=0.5em]tw14.east){the};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east){answer};

\draw[dashed] ([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw[dashed] (cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw[dashed] (cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);

\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
}
\end{scope}
}

\end{tikzpicture}
\end{center}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  最小规则
\begin{frame}{规则抽取 - 最小规则}
\begin{itemize}
\item 边缘集合所对应的树切割,产生了若干树片段,这些树片段内部包含其它的切割点,每个树片段都对应了一条最小翻译规则(即无法继续分解的规则)。见如下示例
\end{itemize}

\begin{minipage}[b]{0.47\textwidth}
{\footnotesize
\renewcommand*{\arraystretch}{1.3}
\begin{tabular}{l l}
\visible<2->{$r_1$} & \visible<2->{NP(PN(他)) $\to$  he} \\
\visible<3->{$r_2$} & \visible<3->{P(对) $\to$  with} \\
\visible<4->{$r_3$} & \visible<4->{NP(NN(回答)) $\to$  the answer} \\
\visible<5->{$r_4$} & \visible<5->{VP(VV(表示) NN(满意) $\to$} \\
      & \visible<5->{satisfied} \\
\visible<6->{$r_5$} & \visible<6->{PP(P$_1$ NP$_2$) $\to$} \\
      & \visible<6->{P$_1$ NP$_2$} \\
\visible<6->{$r_6$} & \visible<6->{VP(PP$_1$ VP$_2$) $\to$} \\
      & \visible<6->{VP$_2$ PP$_1$} \\
\visible<6->{$r_7$} & \visible<6->{IP(NP$_1$ VP$_2$) $\to$} \\
      & \visible<6->{NP$_1$ VP$_2$} \\
      & \\
\end{tabular}
\renewcommand*{\arraystretch}{1.0}
}
\end{minipage}
\hfill
\begin{minipage}[t]{0.47\textwidth}
\begin{tikzpicture}

{\scriptsize
\begin{scope}

\visible<1->{
\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,draw] (cfrag1) at
   (0,0.25) {\Tree[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag2) at
   ([xshift=1.2em]cfrag1.south east) {\Tree[.\node(sn3){P}; 对 ]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag3) at
   ([xshift=1.2em]cfrag2.south east) {\Tree[.\node(sn4){NP}; [.NN 回答 ]]};
   \end{scope}

\begin{scope}[sibling distance=15pt,level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag4) at
   ([xshift=1.4em]cfrag3.south east) {\Tree[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ] [.\node(sn7){NN}; 满意 ]]};
\end{scope}

\begin{scope}[sibling distance=20pt,,level distance=25pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag5) at
   ([xshift=0.3em,yshift=2.2em]cfrag2.north west) {\Tree[.\node(sn8){PP}; [.\node(sn9){P}; ] [.\node(sn10){NP}; ]]};
\end{scope}

\begin{scope}[sibling distance=60pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag6) at
   ([xshift=1.6em,yshift=0.5em]cfrag5.north west) {\Tree[.\node(sn11){VP}; [.\node(sn12){PP}; ] [.\node(sn13){VP}; ]]};
\end{scope}

\begin{scope}[sibling distance=80pt,level distance=18pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw] (cfrag7) at
   ([xshift=-3.6em,yshift=0.5em]cfrag6.north east) {\Tree[.\node(sn14){IP}; [.\node(sn15){NP}; ] [.\node(sn16){VP}; ]]};
\end{scope}

\node[scale=0.9,anchor=north,minimum size=18pt] (tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south){he};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east){was};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east){satisfied};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw14) at ([xshift=0.5em]tw13.east){with};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw15) at ([xshift=0.5em]tw14.east){the};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east){answer};

\draw[dashed] ([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw[dashed] (cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw[dashed] (cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);

\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);

\visible<2->{
\node [fill=blue,circle,inner sep=2pt] (rlabel1) at (cfrag1.south east) {{\color{white} \tiny{1}}};
}
\visible<3->{
\node [fill=blue,circle,inner sep=2pt] (rlabel2) at (cfrag2.south east) {{\color{white} \tiny{2}}};
}
\visible<4->{
\node [fill=blue,circle,inner sep=2pt] (rlabel3) at (cfrag3.south east) {{\color{white} \tiny{3}}};
}
\visible<5->{
\node [fill=blue,circle,inner sep=2pt] (rlabel4) at (cfrag4.south east) {{\color{white} \tiny{4}}};
}
\visible<6->{
\node [fill=blue,circle,inner sep=2pt] (rlabel5) at (cfrag5.north west) {{\color{white} \tiny{5}}};
\node [fill=blue,circle,inner sep=2pt] (rlabel6) at (cfrag6.north east) {{\color{white} \tiny{6}}};
\node [fill=blue,circle,inner sep=2pt] (rlabel7) at (cfrag7.south west) {{\color{white} \tiny{7}}};
}

}
\end{scope}
}
\end{tikzpicture}
\end{minipage}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733
%%%  unary rule
\begin{frame}{一元规则}
\begin{itemize}
\item 上述例子中,词性生成单词的过程对应一种\alert{一元规则},即树的孩子节点只有一个,例如 \\

\vspace{0.5em}
\begin{center}
NP(PN(他)) $\to$ he
\end{center}
\vspace{0.5em}

显然,NP只有一个孩子PN,PN只有一个孩子he。实际上,这条规则对应两条规则的组合

\vspace{0.5em}
\begin{center}
PN(他) $\to$ he\\
\vspace{0.3em}
NP(PN$_1$) $\to$ PN$_1$
\end{center}
\vspace{0.5em}

这里,把两条一元规则合并成``NP(PN(他)) $\to$ he''主要是出于系统实现的考虑,因为允许任意词性到句法标记的一元规则会大大增加翻译假设数量,但是本质上这些一元规则并没有带来太多新的信息\\

\vspace{0.2em}
这也是为什么上图中PN虽然是可信节点,但是没有作为树切割的边界

\end{itemize}
\end{frame}

5734 5735
\subsection{更多样的规则}

xiaotong committed
5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977
%%%------------------------------------------------------------------------------------------------------------
%%%  处理空对其单词
\begin{frame}{更多的规则 - 处理空对齐}
\begin{itemize}
\item 句法翻译系统成功的前提是规则可以覆盖尽可能多的语言现象。为了得到覆盖度更高的规则集,需要处理空对齐的情况 - 把空对齐单词附着在所有可能的规则上
\end{itemize}

\begin{minipage}[b]{0.47\textwidth}
{\footnotesize
\renewcommand*{\arraystretch}{1.3}
\begin{tabular}{l l}
\visible<2->{$r_1$} & \visible<2->{NP(PN(他)) $\to$  he} \\
\visible<2->{$r_4$} & \visible<2->{VP(VV(表示) NN(满意) $\to$} \\
                    & \visible<2->{satisfied} \\
\visible<2->{$r_6$} & \visible<2->{VP(PP$_1$ VP$_2$) $\to$ VP$_2$ PP$_1$} \\
\visible<2->{$r_7$} & \visible<2->{IP(NP$_1$ VP$_2$) $\to$ NP$_1$ VP$_2$} \\
\visible<4->{$r_8$} & \visible<4->{NP(PN(他)) $\to$  he \alert{was}} \\
\visible<5->{$r_9$} & \visible<5->{VP(VV(表示) NN(满意)) $\to$} \\
                    & \visible<5->{\alert{was} satisfied} \\
\visible<6->{$r_{10}$} & \visible<6->{VP(PP$_1$ VP$_2$) $\to$} \\
                     & \visible<6->{\alert{was} VP$_2$ PP$_1$} \\
\visible<7->{$r_{11}$} & \visible<7->{IP(NP$_1$ VP$_2$) $\to$} \\
                     & \visible<7->{NP$_1$ \alert{was} VP$_2$} \\
\end{tabular}
\renewcommand*{\arraystretch}{1.0}
}
\end{minipage}
\hfill
\begin{minipage}[t]{0.47\textwidth}
\begin{tikzpicture}

{\scriptsize
\begin{scope}

\visible<2->{
\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,draw] (cfrag1) at
   (0,0.25) {\Tree[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag2) at
   ([xshift=1.2em]cfrag1.south east) {\Tree[.\node(sn3){P}; 对 ]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag3) at
   ([xshift=1.2em]cfrag2.south east) {\Tree[.\node(sn4){NP}; [.NN 回答 ]]};
   \end{scope}

\begin{scope}[sibling distance=15pt,level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag4) at
   ([xshift=1.4em]cfrag3.south east) {\Tree[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ] [.\node(sn7){NN}; 满意 ]]};
\end{scope}

\begin{scope}[sibling distance=20pt,,level distance=25pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag5) at
   ([xshift=0.3em,yshift=2.2em]cfrag2.north west) {\Tree[.\node(sn8){PP}; [.\node(sn9){P}; ] [.\node(sn10){NP}; ]]};
\end{scope}

\begin{scope}[sibling distance=60pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag6) at
   ([xshift=1.6em,yshift=0.5em]cfrag5.north west) {\Tree[.\node(sn11){VP}; [.\node(sn12){PP}; ] [.\node(sn13){VP}; ]]};
\end{scope}

\begin{scope}[sibling distance=80pt,level distance=18pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw] (cfrag7) at
   ([xshift=-3.6em,yshift=0.5em]cfrag6.north east) {\Tree[.\node(sn14){IP}; [.\node(sn15){NP}; ] [.\node(sn16){VP}; ]]};
\end{scope}

\node[scale=0.9,anchor=north,minimum size=18pt] (tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south){he};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east){was};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east){satisfied};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw14) at ([xshift=0.5em]tw13.east){with};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw15) at ([xshift=0.5em]tw14.east){the};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east){answer};

\draw[dashed] ([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw[dashed] (cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw[dashed] (cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);

\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);

\visible<4->{
\node [fill=blue,circle,inner sep=2pt] (rlabel1) at (cfrag1.south east) {{\color{white} \tiny{1}}};
}
%\node [fill=blue,circle,inner sep=2pt] (rlabel2) at (cfrag2.south east) {{\color{white} \tiny{2}}};
%\node [fill=blue,circle,inner sep=2pt] (rlabel3) at (cfrag3.south east) {{\color{white} \tiny{3}}};
\visible<5->{
\node [fill=blue,circle,inner sep=2pt] (rlabel4) at (cfrag4.south east) {{\color{white} \tiny{4}}};
}
%\node [fill=blue,circle,inner sep=2pt] (rlabel5) at (cfrag5.north west) {{\color{white} \tiny{5}}};
\visible<6->{
\node [fill=blue,circle,inner sep=2pt] (rlabel6) at (cfrag6.north east) {{\color{white} \tiny{6}}};
}
\visible<7->{
\node [fill=blue,circle,inner sep=2pt] (rlabel7) at (cfrag7.south west) {{\color{white} \tiny{7}}};
}
\visible<3->{
\node [fill=white,draw=red,thick] (tw12label) at (tw12) {\alert{was}};
}

\visible<4->{
\draw [->,red] ([xshift=0.2em]tw12label.north west) .. controls +(north:0.4) and +(south:0.4) .. ([xshift=0em]cfrag1.south);
}
\visible<7->{
\draw [->,red] ([xshift=0.8em]tw12label.north west) -- ([xshift=0.8em,yshift=16.8em]tw12label.north west);
}
\visible<6->{
\draw [->,red] ([xshift=0.2em]tw12label.north) .. controls +(north:7em) and +(south:11em) .. ([xshift=0em]cfrag6.south);
}
\visible<5->{
\draw [->,red] ([xshift=0.6em]tw12label.north) -- ([xshift=-2em]cfrag4.south);
}

\begin{pgfonlayer}{background}
\visible<4->{
\node [fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag1)] {};
}
\visible<5->{
\node [fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag4)] {};
}
\visible<6->{
\node [fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag6)] {};
}
\visible<7->{
\node [fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag7)] {};
}
\end{pgfonlayer}

}
\end{scope}
}
\end{tikzpicture}
\end{minipage}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  组合规则
\begin{frame}{更多的规则 - 组合规则}
\begin{itemize}
\item 最小规则之间可以进行组合,得到更大粒度的组合规则,可以使用更多上下文信息,并进行更复杂的调序。比如,三条最小规则组合成一条composed-3规则
\end{itemize}

\begin{minipage}[b]{0.47\textwidth}
{\footnotesize
\renewcommand*{\arraystretch}{1.3}
\begin{tabular}{l l}
\visible<2->{$r_1$} & \visible<2->{NP(PN(他)) $\to$  he} \\
\visible<2->{$r_5$} & \visible<2->{PP(P$_1$ NP$_2$) $\to$ P$_1$ NP$_2$} \\
\visible<2->{$r_6$} & \visible<2->{VP(PP$_1$ VP$_2$) $\to$ VP$_2$ PP$_1$} \\
\visible<2->{$r_7$} & \visible<2->{IP(NP$_1$ VP$_2$) $\to$ NP$_1$ VP$_2$} \\
\visible<3->{\alert{$r_{1,7}$}} & \visible<3->{IP(NP(PN(他)) VP$_1$) $\to$} \\
                          & \visible<3->{he VP$_1$}\\
\visible<4->{\alert{$r_{1,6}$}} & \visible<4->{IP(NP(PN(他)) VP(PP$_1$ VP$_2$))} \\
\visible<4->{\alert{\ $^{,7}$}}  & \visible<4->{$\to$ he VP$_2$ PP$_1$}\\
\visible<5->{\alert{$r_{1,5}$}} & \visible<5->{IP(NP(PN(他)) } \\
\visible<5->{\alert{\ $^{,6,7}$}}  & \visible<5->{VP(P$_1$ NP$_2$ VP$_3$))}\\
                           & \visible<5->{$\to$ he VP$_3$ P$_1$ NP$_2$}\\
                           & \\
\end{tabular}
\renewcommand*{\arraystretch}{1.0}
}
\end{minipage}
\hfill
\begin{minipage}[t]{0.47\textwidth}
\begin{tikzpicture}

{\scriptsize
\begin{scope}

\visible<2->{
\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,draw] (cfrag1) at
   (0,0.25) {\Tree[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag2) at
   ([xshift=1.2em]cfrag1.south east) {\Tree[.\node(sn3){P}; 对 ]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag3) at
   ([xshift=1.2em]cfrag2.south east) {\Tree[.\node(sn4){NP}; [.NN 回答 ]]};
   \end{scope}

\begin{scope}[sibling distance=15pt,level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag4) at
   ([xshift=1.4em]cfrag3.south east) {\Tree[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ] [.\node(sn7){NN}; 满意 ]]};
\end{scope}

\begin{scope}[sibling distance=20pt,,level distance=25pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag5) at
   ([xshift=0.3em,yshift=2.2em]cfrag2.north west) {\Tree[.\node(sn8){PP}; [.\node(sn9){P}; ] [.\node(sn10){NP}; ]]};
\end{scope}

\begin{scope}[sibling distance=60pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag6) at
   ([xshift=1.6em,yshift=0.5em]cfrag5.north west) {\Tree[.\node(sn11){VP}; [.\node(sn12){PP}; ] [.\node(sn13){VP}; ]]};
\end{scope}

\begin{scope}[sibling distance=80pt,level distance=18pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw] (cfrag7) at
   ([xshift=-3.6em,yshift=0.5em]cfrag6.north east) {\Tree[.\node(sn14){IP}; [.\node(sn15){NP}; ] [.\node(sn16){VP}; ]]};
\end{scope}

\node[scale=0.9,anchor=north,minimum size=18pt] (tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south){he};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east){was};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east){satisfied};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw14) at ([xshift=0.5em]tw13.east){with};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw15) at ([xshift=0.5em]tw14.east){the};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east){answer};

\draw[dashed] ([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw[dashed] (cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw[dashed] (cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);

\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);

\visible<3->{
\node [fill=blue,circle,inner sep=2pt] (rlabel1) at (cfrag1.south east) {{\color{white} \tiny{1}}};
\draw[*-*,red,thick] ([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);

}
\visible<5->{
\node [fill=blue,circle,inner sep=2pt] (rlabel5) at (cfrag5.north west) {{\color{white} \tiny{5}}};
xiaotong committed
5978
\draw[*-*,red] ([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
xiaotong committed
5979 5980 5981
}
\visible<4->{
\node [fill=blue,circle,inner sep=2pt] (rlabel6) at (cfrag6.north east) {{\color{white} \tiny{6}}};
xiaotong committed
5982
\draw[*-*,red] ([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
xiaotong committed
5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009
}
\visible<3->{
\node [fill=blue,circle,inner sep=2pt] (rlabel7) at (cfrag7.south west) {{\color{white} \tiny{7}}};
}

\begin{pgfonlayer}{background}
\visible<3->{
\node [fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag1)] {};
\node [fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag7)] {};
}
\visible<4->{
\node [fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag6)] {};
}
\visible<5->{
\node [fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag5)] {};
}
\end{pgfonlayer}

}
\end{scope}
}
\end{tikzpicture}
\end{minipage}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
6010 6011 6012 6013 6014 6015 6016 6017 6018 6019
%%%  SPMT规则
\begin{frame}{更多的规则 - SPMT规则}
\begin{itemize}
\item 任意大小的规则都可以通过组合的方式获取,但是组合过多数量的规则会大大增加规则集大小。SPMT一种高效地获得大颗粒度规则的方法 (Marcu et al., 2006)
	\begin{itemize}
	\item 先抽取短语,之后找到覆盖这个短语的可信节点
	\item 以这个可信节点做根,生成包含该短语的规则
	\end{itemize}
\end{itemize}

6020
\vspace{-0.1em}
xiaotong committed
6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036
\begin{minipage}[b]{0.47\textwidth}
{\footnotesize
\visible<3->{
对于任意一个与词对齐兼容的短语,可以找到包含它的``最小''翻译规则,即SPMT规则,比如\\

\vspace{-0.4em}
对 形式 $\to$ about the situation \\

\vspace{-0.4em}
可以很容易得到它的SPMT规则 \\

\vspace{-0.4em}
VP(P(对) NP(NN(局势)) VP$_1$) $\to$ VP$_1$ about the situation \\
}

\visible<4->{
xiaotong committed
6037
\vspace{-0.3em}
xiaotong committed
6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132
但是,如果用组合的方式,需要三条最小规则才能得到这条规则\\
}
\vfill
}
\end{minipage}
\hfill
\begin{minipage}[t]{0.47\textwidth}
\begin{tikzpicture}

{\scriptsize
\begin{scope}

\visible<2->{
\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,draw] (cfrag1) at
   (0,0.25) {\Tree[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag2) at
   ([xshift=1.2em]cfrag1.south east) {\Tree[.\node(sn3){P}; 对 ]};
\end{scope}

\begin{scope}[level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag3) at
   ([xshift=1.2em]cfrag2.south east) {\Tree[.\node(sn4){NP}; [.NN 形式 ]]};
   \end{scope}

\begin{scope}[sibling distance=15pt,level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag4) at
   ([xshift=1.4em]cfrag3.south east) {\Tree[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ] [.\node(sn7){NN}; 担心 ]]};
\end{scope}

\begin{scope}[sibling distance=32pt,level distance=20pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw] (cfrag6) at
   ([xshift=0.3em,yshift=4em]cfrag2.north west) {\Tree[.\node(sn11){VP}; [.\node(sn9){P}; ] [.\node(sn10){NP}; ] [.\node(sn13){VP}; ]]};
\end{scope}

\begin{scope}[sibling distance=65pt,level distance=18pt]
\node[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw] (cfrag7) at
   ([xshift=-4.5em,yshift=0.5em]cfrag6.north east) {\Tree[.\node(sn14){IP}; [.\node(sn15){NP}; ] [.\node(sn16){VP}; ]]};
\end{scope}

\node[scale=0.9,anchor=north,minimum size=18pt] (tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south){he};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east){was};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east){worried};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw14) at ([xshift=0.5em]tw13.east){about};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw15) at ([xshift=0.5em]tw14.east){the};
\node[scale=0.9,anchor=west,minimum size=18pt] (tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east){situation};

\draw[dashed] ([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw[dashed] (cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw[dashed] (cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw[dashed] (cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);

\visible<3->{
\draw[dashed,red] (cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw[dashed,red] (cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw[dashed,red] (cfrag3.south) -- ([yshift=-0.4em]tw16.north);
}

\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=6.5em]cfrag1.north);
\draw[*-*] ([xshift=-0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=-0.1em,yshift=4.4em]cfrag2.north);
\draw[*-*] ([xshift=0.1em,yshift=-0.4em]cfrag3.north) .. controls +(north:2.4em) and +(south:2.4em) .. ([xshift=1.1em,yshift=2.5em]cfrag3.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=2.5em]cfrag4.north);
\draw[*-*] ([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);

\visible<4->{
\node [fill=blue,circle,inner sep=2pt] (rlabel2) at (cfrag2.north east) {{\color{white} \tiny{2}}};
\node [fill=blue,circle,inner sep=2pt] (rlabel3) at (cfrag3.north east) {{\color{white} \tiny{3}}};
\node [fill=blue,circle,inner sep=2pt] (rlabel6) at (cfrag6.north east) {{\color{white} \tiny{5}}};
}

\begin{pgfonlayer}{background}
\visible<4->{
\node [fill=green!20,inner sep=0pt] (cfrag2back) [fit = (cfrag2)] {};
\node [fill=green!20,inner sep=0pt] (cfrag3back) [fit = (cfrag3)] {};
\node [fill=green!20,inner sep=0pt] (cfrag6back) [fit = (cfrag6)] {};
}

\visible<3->{
\node [anchor=south west,draw=red,thick,fill=red!20,inner sep=0pt,minimum height = 2em, minimum width=6em] (ps) at ([xshift=-0.2em,yshift=-0.2em]cfrag2.south west) {};
\node [anchor=south west,draw=red,thick,fill=red!20,inner sep=0pt] (pt) [fit = (tw14) (tw15) (tw16)] {};
}
\end{pgfonlayer}

}
\end{scope}
}
\end{tikzpicture}
\end{minipage}

\end{frame}

xiaotong committed
6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221
%%%------------------------------------------------------------------------------------------------------------
%%%  tree binarization
\begin{frame}{更多的规则 - 句法树二叉化}
\begin{itemize}
\item 句法分析器生成的句法树可能会非常平坦,这会导致抽取的规则很``大''而且规则无法继续被分解
	\begin{itemize}
	\item 比如,在CTB中经常会看到很宽的子树结构
	\end{itemize}
\end{itemize}

\begin{center}
\begin{tikzpicture}

{\scriptsize
\begin{scope}[scale = 0.9, sibling distance=20pt, level distance=30pt]

{\footnotesize
\Tree[.IP
     	[.NP ]
     	[.VP ]
        [., ]
        [.VP ]
        [., ]
        [.VP ]
        [., ]
        [.VP ]
        [.{.{\color{white} V}} ]
     ]
}
\end{scope}
}

\end{tikzpicture}
\end{center}

\begin{itemize}
\item<2-> 一个例子
\end{itemize}

\vspace{-1.0em}
\begin{center}
\begin{tikzpicture}

\visible<2->{
{\scriptsize
\begin{scope}[sibling distance=4pt, level distance=25pt]

{\footnotesize
\Tree[.\node(n1){NP};
     	[.NNP \node(sw1){美国}; ]
     	[.NN \node(sw2){总统}; ]
        [.NN \node(sw3){唐纳德}; ]
        [.NN \node(sw4){特朗普}; ]
     ]
}

\node [anchor=north] (tw1) at ([yshift=-2em]sw1.south) {U.S.};
\node [anchor=north] (tw2) at ([yshift=-2em]sw2.south) {President};
\node [anchor=north] (tw3) at ([yshift=-2em]sw3.south) {Trump};

\draw [-,dashed] (sw1.south) -- (tw1.north);
\draw [-,dashed] (sw2.south) -- (tw2.north);
\draw [-,dashed] (sw3.south) -- (tw3.north);
\draw [-,dashed] (sw4.south) -- (tw3.north);

\node [anchor=west] (rulelabel1) at ([xshift=1in,yshift=0.3em]n1.east) {\footnotesize{\textbf{抽取到的规则:}}};
\node [anchor=north west] (rule1) at (rulelabel1.south west) {NP(NNP$_1$ NN$_2$ NN(唐纳德) NN(特朗普))};
\node [anchor=north west] (rule1t) at ([yshift=0.2em]rule1.south west) {$\to$ NNP$_1$ NN$_2$ Trump};
\node [anchor=north west] (rule2) at (rule1t.south west) {NP(NNP$_1$ NN(总统) NN(唐纳德) NN(特朗普))};
\node [anchor=north west] (rule2t) at ([yshift=0.2em]rule2.south west) {$\to$ NNP$_1$ President Trump};
\node [anchor=north west] (rulelabel2) at ([yshift=-0.3em]rule2t.south west) {\footnotesize{\textbf{\alert{不能}抽取到的规则:}}};
\node [anchor=north west] (rule3) at (rulelabel2.south west) {NP(NN(唐纳德) NN(特朗普)) $\to$ Trump};

\end{scope}
}
}

\end{tikzpicture}
\end{center}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  tree binarization (cont.)
\begin{frame}{更多的规则 - 句法树二叉化(续)}
\begin{itemize}
\item 一种解决问题的思路是用二叉化方法把树结构变得更深


6222
\vspace{-0.5em}
xiaotong committed
6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301
\begin{center}
\begin{tikzpicture}

{\scriptsize
\begin{scope}[sibling distance=4pt, level distance=25pt]

\Tree[.\node(n1){NP};
     	[.NNP \node(sw1){美国}; ]
     	[.NN \node(sw2){总统}; ]
        [.NN \node(sw3){唐纳德}; ]
        [.NN \node(sw4){特朗普}; ]
     ]

\node [anchor=north] (tw1) at ([yshift=-2em]sw1.south) {U.S.};
\node [anchor=north] (tw2) at ([yshift=-2em]sw2.south) {President};
\node [anchor=north] (tw3) at ([yshift=-2em]sw3.south) {Trump};

\draw [-,dashed] (sw1.south) -- (tw1.north);
\draw [-,dashed] (sw2.south) -- (tw2.north);
\draw [-,dashed] (sw3.south) -- (tw3.north);
\draw [-,dashed] (sw4.south) -- (tw3.north);

\draw [->,very thick] ([xshift=1em]sw4.east) -- ([xshift=5em]sw4.east) node [pos=0.5,above] {\tiny{二叉化}};

\end{scope}

\begin{scope}[xshift=2.2in,sibling distance=10pt, level distance=15pt]

\Tree[.\node(n1){NP};
     	[.NNP \node(sw1){美国}; ]
	[.NP-BAR
     	    [.NN \node(sw2){总统}; ]
	    [.NP-BAR
                [.NN \node(sw3){唐纳德}; ]
                [.NN \node(sw4){特朗普}; ]
             ]
         ]
     ]

\node [anchor=north] (tw1) at ([yshift=-4.5em]sw1.south) {U.S.};
\node [anchor=north] (tw2) at ([yshift=-2.75em]sw2.south) {President};
\node [anchor=north] (tw3) at ([yshift=-1em]sw3.south) {Trump};

\draw [-,dashed] (sw1.south) -- (tw1.north);
\draw [-,dashed] (sw2.south) -- (tw2.north);
\draw [-,dashed] (sw3.south) -- (tw3.north);
\draw [-,dashed] (sw4.south) -- (tw3.north);

\end{scope}

}

\end{tikzpicture}
\end{center}

\visible<2->{
\small{二叉化增加了更多的可信节点,这也带来了新的规则}

\begin{center}
{\footnotesize
\vspace{0.3em}
NP-BAR(NN(唐纳德) NN(特朗普)) $\to$ Trump \\
\vspace{0.3em}
NP-BAR(NN$_1$ NP-BAR$_2$) $\to$ NN$_1$ NP-BAR$_2$
\vspace{0.3em}
}
\end{center}
}

\item<3-> 树二叉化已经成为基于句法机器翻译模型的常用方法
	\begin{itemize}
	\item 有很多策略:左优先、右优先、head优先等等
	\item 二叉化可以得到更多(细粒度)规则,保证规则的覆盖度
	\end{itemize}

\end{itemize}

\end{frame}

6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392
\subsection{引入双语句法信息}

%%%------------------------------------------------------------------------------------------------------------
%%%  树到树规则抽取
\begin{frame}{引入双语句法信息}
\begin{itemize}
\item 对于树到树模型,源语和目标语端都有句法树,需要使用树片段到树片段的映射来描述翻译过程,这种映射关系被描述为树到树翻译规则。这里,把\\
\vspace{-1.3em}
\begin{eqnarray}
\langle\ \textrm{VP}, \textrm{VP}\ \rangle & \to & \langle\ \textrm{VP(PP}_{1}\ \textrm{VP(VV(表示) NN}_{2})), \nonumber \\
& & \ \ \textrm{VP(VBZ(was) VP(VBZ}_{2}\ \textrm{PP}_{1}))\ \rangle \nonumber
\end{eqnarray}
表示为\alert{树片段到树片段}的映射形式\\
\vspace{-1.3em}
\begin{eqnarray}
& & \textrm{VP(PP}_{1}\ \textrm{VP(VV(表示) NN}_{2})) \nonumber \\
& \to & \textrm{VP(VBZ(was) VP(VBZ}_{2}\ \textrm{PP}_{1})) \nonumber
\end{eqnarray}

\item<2-> 可以通过扩展GHKM方法进行树到树规则抽取
    \begin{itemize}
    \item 双语端进行可信节点的识别,之后找到节点之间的对应
    \item 基于对应的节点获得树片段的对应,即抽取树到树规则
    \item 规则组合、SPMT等方法同样适用
    \end{itemize}

\end{itemize}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  方法1:利用词对齐归纳句法映射
\begin{frame}{方法1:利用词对齐归纳树到树规则}
\begin{itemize}
\item 简单直接的方法是把GHKM方法扩展到双语的情况,利用词对齐归纳树到树映射
    \begin{itemize}
    \item<3-> 但是词对齐的错误往往会导致很多规则无法抽取
    \end{itemize}
\end{itemize}

\begin{minipage}[c][5cm][t]{0.47\textwidth}
\begin{center}
\begin{tikzpicture}
\begin{scope}
\begin{scope}[scale=0.65, level distance=27pt]
\Tree[.S
        [.NP
            [.DT \node(ew1){the}; ]
            [.NNS \node(ew2){imports}; ]
        ]
        [.VP
            [.VBZ \node(ew3){have}; ]
            [.ADVP
                [.RB \node(ew4){drastically}; ]
                [.VBN \node(ew5){fallen}; ]
            ]
        ]
     ]
\end{scope}

\begin{scope}[scale=0.65, level distance=27pt, grow'=up, xshift=-13pt, yshift=-3.5in, sibling distance=22pt]
\Tree[.IP
        [.NN \node(cw1){进口}; ]
        [.VP
            [.AD \node(cw2){大幅度}; ]
            [.VP
                [.VV \node(cw3){下降}; ]
                [.AS \node(cw4){}; ]
            ]
        ]
     ]
\end{scope}

\visible<2->{
\draw[-, dashed] (cw1) -- (ew2);
\draw[-, dashed] (cw2) -- (ew4);
\draw[-, dashed] (cw3) -- (ew5);
\draw[-, dashed] (cw4) .. controls +(north:1.0) and +(south:1.6) .. (ew1);
}

\visible<3->{
\draw[-, red, dashed,thick] (cw4) .. controls +(north:1.0) and +(south:1.6) .. (ew1);
}


\end{scope}
\end{tikzpicture}
\end{center}
\end{minipage}
\begin{minipage}[c][5cm][t]{0.50\textwidth}
\visible<2->{
xiaotong committed
6393
\renewcommand*{\arraystretch}{0.95}
6394 6395 6396 6397 6398 6399 6400 6401 6402 6403
\begin{tabular}{l l}
\multicolumn{2}{l}{\textbf{\scriptsize{抽取得到的规则}}} \\
\hline
\scriptsize{$r_1$} & \scriptsize{AS(了) $\rightarrow$ DT(the)} \\
\scriptsize{$r_2$} & \scriptsize{NN(进口) $\rightarrow$ NNS(imports)} \\
\scriptsize{$r_3$} & \scriptsize{AD(大幅度) $\rightarrow$ RB(drastically)} \\
\scriptsize{$r_4$} & \scriptsize{VV(下降) $\rightarrow$ VBN(fallen)} \\
\scriptsize{$r_5$} & \scriptsize{IP(NN$_1$ VP(AD$_2$ VP(VV$_3$ AS$_4$)) $\rightarrow$} \\
\multicolumn{2}{l}{\tiny{S(NP(DT$_4$ NNS$_1$) VP(VBZ(have) ADVP(RB$_2$ VBN$_3$))}} \\
\end{tabular}
xiaotong committed
6404
\renewcommand*{\arraystretch}{1.0}
6405 6406 6407 6408 6409
}

\visible<3->{
\vspace{0.5em}

xiaotong committed
6410
\renewcommand*{\arraystretch}{0.95}
6411 6412 6413 6414 6415 6416 6417 6418
\begin{tabular}{l l}
\multicolumn{2}{l}{\textbf{\scriptsize{无法得到的规则}}} \\
\hline
\scriptsize{$r_{?}$} & \scriptsize{AS(了) $\rightarrow$ VBZ(have)} \\
\scriptsize{$r_{?}$} & \scriptsize{NN(进口) $\rightarrow$} \\
                     & \scriptsize{NP(DT(the) NNS(imports))} \\
\scriptsize{$r_{?}$} & \scriptsize{IP(NN$_1$ VP$_2$) $\rightarrow$ S(NP$_1$ VP$_2$)} \\
\end{tabular}
xiaotong committed
6419
\renewcommand*{\arraystretch}{1.0}
6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526
}
\end{minipage}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  方法2:直接进行节点对齐然后归纳句法映射
\begin{frame}{方法2:利用节点对齐抽取树到树规则}
\begin{itemize}
\item 另一种思路是直接获取源语言树节点到目标语树节点的对应关系,然后直接抽取规则,这样可避免词对齐错误
    \begin{itemize}
    \item 节点对其可以更准确的捕捉双语结构的对应
    \end{itemize}
\end{itemize}

\begin{minipage}[c][5cm][t]{0.47\textwidth}
\begin{center}
\begin{tikzpicture}

\only<1>{
\begin{scope}
\begin{scope}[scale=0.65, level distance=27pt]
\Tree[.S
        [.NP
            [.DT \node(ew1){the}; ]
            [.NNS \node(ew2){imports}; ]
        ]
        [.VP
            [.VBZ \node(ew3){have}; ]
            [.ADVP
                [.RB \node(ew4){drastically}; ]
                [.VBN \node(ew5){fallen}; ]
            ]
        ]
     ]
\end{scope}

\begin{scope}[scale=0.65, level distance=27pt, grow'=up, xshift=-13pt, yshift=-3.5in, sibling distance=22pt]
\Tree[.IP
        [.NN \node(cw1){进口}; ]
        [.VP
            [.AD \node(cw2){大幅度}; ]
            [.VP
                [.VV \node(cw3){下降}; ]
                [.AS \node(cw4){}; ]
            ]
        ]
     ]
\end{scope}

\draw[-, dashed] (cw1) -- (ew2);
\draw[-, dashed] (cw2) -- (ew4);
\draw[-, dashed] (cw3) -- (ew5);
\draw[-, dashed] (cw4) .. controls +(north:1.0) and +(south:1.6) .. (ew1);

\end{scope}
}

\begin{scope}

\visible<2->{
\begin{scope}[scale=0.65, level distance=27pt]
\Tree[.\node[draw](en1){S};
        [.\node[draw](en2){NP};
            [.DT the ]
            [.NNS imports ]
        ]
        [.\node[draw](en3){VP};
            [.\node[draw](en4){VBZ}; have ]
            [.ADVP
                [.\node[draw](en5){RB}; drastically ]
                [.\node[draw](en6){VBN}; fallen ]
            ]
        ]
     ]
\end{scope}

\begin{scope}[scale=0.65, level distance=27pt, grow'=up, xshift=-13pt, yshift=-3.5in, sibling distance=22pt]
\Tree[.\node[draw](cn1){\ \ IP\ \ };
        [.\node[draw](cn2){NN}; 进口 ]
        [.\node[draw](cn3){VP};
            [.\node[draw](cn4){AD}; 大幅度 ]
            [.VP
                [.\node[draw](cn5){VV}; 下降 ]
                [.\node[draw](cn6){AS}; 了 ]
            ]
        ]
     ]
\end{scope}
}

\visible<3->{
\draw[latex-latex, dotted, thick, red] (cn4.east) .. controls +(east:0.5) and +(west:0.5) .. (en5.west);
\draw[latex-latex, dotted, thick, red] (cn5.east) .. controls +(east:0.5) and +(south:0.5) .. (en6.south west);
\draw[latex-latex, dotted, thick, red] (cn6.north west) .. controls +(north:1.5) and +(south:2.5) .. (en4.south west);
\draw[latex-latex, dotted, thick, red] (cn3.north west) -- (en3.south west);
\draw[latex-latex, dotted, thick, red] (cn2.west) .. controls +(west:0.6) and +(west:0.6) .. (en2.west);
\draw[latex-latex, dotted, thick, red] (cn1.north west) .. controls +(north:4) and +(south:5.5) .. (en1.south west);
}

\end{scope}

\end{tikzpicture}
\end{center}
\end{minipage}
\begin{minipage}[c][5cm][t]{0.50\textwidth}
\only<1>{
xiaotong committed
6527
\renewcommand*{\arraystretch}{0.9}
6528 6529 6530 6531 6532 6533 6534 6535 6536 6537
\begin{tabular}{l l}
\multicolumn{2}{l}{\textbf{\scriptsize{抽取得到的规则(词对齐)}}} \\
\hline
\scriptsize{$r_1$} & \scriptsize{AS(了) $\rightarrow$ DT(the)} \\
\scriptsize{$r_2$} & \scriptsize{NN(进口) $\rightarrow$ NNS(imports)} \\
\scriptsize{$r_3$} & \scriptsize{AD(大幅度) $\rightarrow$ RB(drastically)} \\
\scriptsize{$r_4$} & \scriptsize{VV(下降) $\rightarrow$ VBN(fallen)} \\
\scriptsize{$r_5$} & \scriptsize{IP(NN$_1$ VP(AD$_2$ VP(VV$_3$ AS$_4$)) $\rightarrow$} \\
\multicolumn{2}{l}{\tiny{S(NP(DT$_4$ NNS$_1$) VP(VBZ(have) ADVP(RB$_2$ VBN$_3$))}} \\
\end{tabular}
xiaotong committed
6538
\renewcommand*{\arraystretch}{1.0}
6539 6540 6541
}

\visible<4->{
xiaotong committed
6542
\renewcommand*{\arraystretch}{0.9}
6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558
\begin{tabular}{l l}
\multicolumn{2}{l}{\textbf{\scriptsize{抽取得到的规则(子树对齐)}}} \\
\hline
{\color{gray!70} \scriptsize{$r_1$}} & {\color{gray!70} \scriptsize{AS(了) $\rightarrow$ DT(the)}} \\
{\color{gray!70} \scriptsize{$r_2$}} & {\color{gray!70}\scriptsize{NN(进口) $\rightarrow$ NNS(imports)}} \\
\scriptsize{$r_3$} & \scriptsize{AD(大幅度) $\rightarrow$ RB(drastically)} \\
\scriptsize{$r_4$} & \scriptsize{VV(下降) $\rightarrow$ VBN(fallen)} \\
{\color{gray!70} \scriptsize{$r_5$}} & {\color{gray!70} \scriptsize{IP(NN$_1$ VP(AD$_2$ VP(VV$_3$ AS$_4$)) $\rightarrow$}} \\
\multicolumn{2}{l}{{\color{gray!70} \tiny{S(NP(DT$_4$ NNS$_1$) VP(VBZ(have) ADVP(RB$_2$ VBN$_3$))}}} \\
\alert{\scriptsize{$r_6$}} & \alert{\scriptsize{AS(了) $\rightarrow$ VBZ(have)}} \\
\alert{\scriptsize{$r_7$}} & \alert{\scriptsize{NN(进口) $\rightarrow$ }} \\
                           & \alert{\scriptsize{NP(DT(the) NNS(imports))}}\\
\alert{\scriptsize{$r_8$}} & \alert{\scriptsize{VP(AD$_1$ VP(VV$_2$ AS$_3$)) $\rightarrow$}} \\
                           & \alert{\scriptsize{VP(VBZ$_3$ ADVP(RB$_1$ VBN$_2$)}} \\
\alert{\scriptsize{$r_9$}} & \alert{\scriptsize{IP(NN$_1$ VP$_2$) $\rightarrow$ S(NP$_1$ VP$_2$)}} \\
\end{tabular}
xiaotong committed
6559
\renewcommand*{\arraystretch}{1.0}
6560 6561 6562 6563
}
\end{minipage}

\end{frame}
xiaotong committed
6564 6565

%%%------------------------------------------------------------------------------------------------------------
6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602
%%%  抽取更多的规则:节点对齐矩阵
\begin{frame}{节点对齐矩阵}
\begin{itemize}
\item 节点对齐的自动获取:1)基于分类模型的方法;2)无指导节点对齐的方法
\item 使用节点对齐的另一个好处是,我们可以直接用节点对齐矩阵进行规则抽取,而不是用单一的对齐结果
    \begin{itemize}
    \item 对齐矩阵可以帮助抽取更多样的规则
    \end{itemize}
\end{itemize}

\vspace{-0.2em}
\centering
\begin{tikzpicture}

\begin{scope}[scale=0.7]

\begin{scope}[sibling distance=17pt, level distance=25pt]
\Tree[.\node(en1){VP$^{[1]}$};
        [.\node(en2){VBZ$^{[2]}$}; have ]
        [.\node(en3){ADVP$^{[3]}$};
            [.\node(en4){RB$^{[4]}$}; drastically ]
            [.\node(en5){VBN$^{[5]}$}; fallen ]
        ]
     ]
\end{scope}

\begin{scope}[grow'=up, yshift=-2.7in, sibling distance=32pt, level distance=25pt]
\Tree[.\node(cn1){VP$^{[1]}$};
        [.\node(cn2){AD$^{[2]}$}; 大幅度 ]
        [.\node(cn3){VP$^{[3]}$};
            [.\node(cn4){VV$^{[4]}$}; 下降 ]
            [.\node(cn5){AS$^{[5]}$}; 了 ]
        ]
     ]
\end{scope}

\begin{scope}[xshift=1.7in, yshift=-0.4in]
xiaotong committed
6603 6604

{\footnotesize
6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615
\node[anchor=west, rotate=60] at (0.8,-0.6) {VP$^{[1]}$};
\node[anchor=west, rotate=60] at (1.8,-0.6) {VBZ$^{[2]}$};
\node[anchor=west, rotate=60] at (2.8,-0.6) {ADVP$^{[3]}$};
\node[anchor=west, rotate=60] at (3.8,-0.6) {RB$^{[4]}$};
\node[anchor=west, rotate=60] at (4.8,-0.6) {VBN$^{[5]}$};

\node[] at (6.2,-1) {VP$^{[1]}$};
\node[] at (6.2,-2) {AD$^{[2]}$};
\node[] at (6.2,-3) {VP$^{[3]}$};
\node[] at (6.2,-4) {VV$^{[4]}$};
\node[] at (6.2,-5) {AS$^{[5]}$};
xiaotong committed
6616
}
6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682

\foreach \i in {1,...,5}{
    \foreach \j in {-5,...,-1}{
        \node[fill=blue,scale=0.2] at (\i,\j) {};
    }
}

\visible<2-3>{
\node[fill=blue, scale=1.2] at (1,-1) {};
\node[fill=blue, scale=1.2] at (4,-2) {};
\node[fill=blue, scale=1.2] at (2,-5) {};
}

\visible<2>{
\node[fill=blue, scale=1.2] at (5,-4) {};
}

\visible<3>{
\node[fill=red, scale=1.2] at (5,-4) {};
}

\visible<4-5>{
\node[fill=blue, scale=1.1] at (1,-1) {};
\node[fill=blue, scale=0.5] at (1,-3) {};
\node[fill=blue, scale=0.6] at (2,-2) {};
\node[fill=blue, scale=0.7] at (2,-3) {};
\node[fill=blue, scale=0.7] at (2,-5) {};
\node[fill=blue, scale=0.4] at (3,-1) {};
\node[fill=blue, scale=0.6] at (3,-2) {};
\node[fill=blue, scale=0.5] at (3,-3) {};
\node[fill=blue, scale=0.9] at (4,-2) {};
\node[fill=blue, scale=0.7] at (5,-3) {};
\node[fill=blue, scale=0.4] at (5,-5) {};
}

\visible<4>{
\node[fill=blue, scale=0.6] at (3,-4) {};
\node[fill=blue, scale=0.8] at (5,-4) {};
}

\visible<5>{
\node[fill=red, scale=0.6] at (3,-4) {};
\node[fill=red, scale=0.8] at (5,-4) {};
}

\visible<2-3>{
\node[] at (4,-5.8) {\footnotesize{{\color{blue} $\blacksquare$} = extractable node-pair}};
}

\visible<4-5>{
\node[] at (4,-5.8) {\footnotesize{{\color{blue} $\blacksquare$} = possible alignment}};
}

\end{scope}

\visible<3>{\draw[<->, red, thick] (cn4.east) .. controls +(east:0.9) and +(west:0.9) .. (en5.west);}

\visible<5>{\draw[<->, red, dotted, very thick] (cn4.east) .. controls +(east:0.9) and +(west:0.9) .. (en5.west);}
\visible<5>{\draw[<->, red, dotted, very thick] (cn4.west) .. controls +(west:1.0) and +(west:2) .. (en3.west);}



\end{scope}

\end{tikzpicture}

xiaotong committed
6683 6684
\end{frame}

6685 6686
\subsection{翻译特征}

xiaotong committed
6687 6688
%%%------------------------------------------------------------------------------------------------------------
%%%  翻译特征
xiaotong committed
6689 6690 6691 6692 6693 6694 6695 6696
\begin{frame}{特征}
\begin{itemize}
\item 与短语和层次短语模型一样,句法模型也使用判别式模型进行建模 - $\textrm{P}(d,\textbf{t}|\textbf{s}) = \frac{\exp(\sum_{i=1}^{M} \lambda_i \cdot h_i(d,\textbf{s},\textbf{t}))}{\sum_{d',t'}\exp(\sum_{i=1}^{M} \lambda_i \cdot h_i(d',\textbf{s},\textbf{t}'))}$。其中特征权重$\{\lambda_i\}$可以使用最小错误率训练进行调优,特征函数$\{h_i\}$需要用户定义。
\item<2-> 这里,所有规则满足$\langle\  \alpha_h, \beta_h\ \rangle \to \langle\ \alpha_r, \beta_r, \sim\ \rangle$的形式
    \begin{itemize}
    \item $\alpha_h$$\beta_h$是规则左部的源语和目标语部分,对应树结构的根节点
    \item $\alpha_r$$\beta_r$是规则右部的源语和目标语部分,对应树结构
    \item $\sim$表示$\alpha_r$$\beta_r$中叶子非终结符的对应
xiaotong committed
6697
    \item 此外,定义$\tau(\alpha_r)$$\tau(\beta_r)$为源语和目标语树结构的叶子节点序列。例如,对于规则$\langle\ \textrm{VP}, \textrm{VP}\ \rangle \to \langle\ \textrm{VP(PP}_{1}\ \textrm{VP(VV(表示) NN}_{2})), \textrm{VP(VBZ(was) VP(VBZ}_{2}\ \textrm{PP}_{1}))$,有 \\
xiaotong committed
6698 6699 6700

        \vspace{-1.5em}
        \begin{eqnarray}
xiaotong committed
6701 6702
        \tau(\alpha_r) & = & \textrm{PP}_1\ \textrm{表示 NN}_2 \nonumber \\
        \tau(\beta_r) & = & \textrm{was}\ \textrm{VBZ}_2\ \textrm{PP}_1\nonumber
xiaotong committed
6703 6704 6705
        \end{eqnarray}
    \end{itemize}
\end{itemize}
xiaotong committed
6706 6707 6708
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733
%%%  翻译特征(续)
\begin{frame}{特征()}
\begin{itemize}
\item \textbf{特征1-2: 短语翻译概率},即正向翻译概率$\textrm{P}(\tau(\beta_r)|\tau(\alpha_r))$和反向翻译概率$\textrm{P}(\tau(\alpha_r)|\tau(\beta_r))$。这里,$\tau(\alpha_r)$$\tau(\beta_r)$ 都被看做短语,因此可以直接复用短语系统的方法进行计算。
\item \textbf{特征3-4: 词汇翻译概率},即$\textrm{P}_{\textrm{lex}}(\tau(\beta_r)|\tau(\alpha_r))$$\textrm{P}_{\textrm{lex}}(\tau(\alpha_r)|\tau(\beta_r))$。可以用短语系统中的词汇翻译概率描述源语和目标语单词对应的情况。
\item<2-> \textbf{特征5$n$-gram语言模型},即$\textrm{P}_{\textrm{lm}}(\textbf{t})$。度量译文的流畅度,可以使用大规模目标语单语数据得到。
\item<2-> \textbf{特征6:译文长度},即$|\textbf{t}|$。避免模型倾向于短译文,同时让系统自动学习对译文长度的偏好。
\item<2-> \textbf{特征7:翻译规则数量}。这个特征是为了避免模型仅仅使用少量特征构成翻译推导(因为翻译概率相乘,因子少结果一般会大一些),同时让系统自动学习对使用规则数量的偏好。
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  翻译特征(续)
\begin{frame}{特征(2)}
\begin{itemize}
\item \textbf{特征8:源语言被翻译为空的单词数量}。注意,空翻译规则(或特征)有时也被称作evil feature,这类特征在一些数据集上对BLEU有很好的提升作用,但是会造成人工评价的下降,因此需要谨慎使用。
\item<2-> \textbf{特征9: 翻译规则生成概率},即$\textrm{P}_{\textrm{rule}}(\alpha_r,\beta_r,\sim|\alpha_h,\beta_h)$。这个特征可以被看做是生成翻译推导的概率。
\item<2-> \textbf{特征10:组合规则的数量}。学习使用组合规则(或最小规则)的偏好。
\item<2-> \textbf{特征11:词汇化规则的数量}。学习使用含有终结符规则的偏好。
\item<2-> \textbf{特征12:低频规则的数量}。学习使用训练数据中出现频次低于3的规则的偏好。低频规则大多并不可靠,这个特征本质上也是为了区分不同质量规则。
\item<3-> \alert{注意!}特征9-12也被看做是句法特征。当然,还有很多很多特征,感兴趣可以自己设计或查阅相关论文。
\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
6734
\subsection{基于树和基于串的解码方法}
xiaotong committed
6735

xiaotong committed
6736
%%%------------------------------------------------------------------------------------------------------------
xiaotong committed
6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781
%%%  解码模型
\begin{frame}{解码}
\begin{itemize}
\item 翻译时可以用如下式子计算每个推导的模型得分\\
\vspace{-1em}
\begin{eqnarray}
\textrm{score}(d,\textbf{t},\textbf{s}) & = & \sum_{r\in d} \log(\textrm{score}(r)) + \lambda_{\textrm{lm}}\log(\textrm{P}_{\textrm{lm}}(\textbf{t})) + \lambda_{l} |\textbf{t}| \nonumber
\end{eqnarray}
其中,$\textrm{score}(r)$表示每条规则的得分,由特征1-4和特征7-12共同计算得到,因此也可以把特征1-4和特征7-12看做是规则特征

\item<2-> \alert{解码}是要找到使$\textrm{score}(d)$达到最大的翻译推导$d$\\
\begin{displaymath}
\hat{d} = \argmax_{d \in D} \textrm{score}(d)
\end{displaymath}
其中 $D$表示所有可能的推导构成的搜索空间。广义上来说,由于句法系统引入了非终结符和复杂的规则,它的推导空间会远大于短语系统,因此句法模型的解码器的好坏对性能影响很大

\end{itemize}
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  基于树的解码 vs 基于串的解码
\begin{frame}{基于树的解码 vs 基于串的解码}
\begin{itemize}
\item 前面的公式本质上描述了一种基于串的解码,即对输入的源语言句子通过句法模型进行翻译,得到译文串。不过,搜索所有的推导导致巨大的解码空间。对于树到串和树到树翻译来说,源语言句法树是可见的,因此可以使用另一种解码方法 - 基于树的解码,即把输出入的源语句法树翻译为目标语串\\
\end{itemize}

\centering
\begin{tabular} {l | l l}
\textbf{对比} & \textbf{基于树的解码} & \textbf{基于串的解码} \\ \hline
解码方法 &
\parbox{0.35\textwidth}{
\begin{equation}
\hat{d} = \argmax_{d \in D_{\textrm{tree}}} \textrm{score}(d) \nonumber
\end{equation}
}
&
\parbox{0.35\textwidth}{
\begin{equation}
\hat{d} = \argmax_{d \in D} \textrm{score}(d) \nonumber
\end{equation}
}
\\ \hline
搜索空间 & 与输入的源语句法树 & 所有推导$D$ \\
         & 兼容的推导$D_{\textrm{tree}}$ & \\ \hline
适用模型 & 树到串、树到树 & 所有句法模型 \\ \hline
xiaotong committed
6782
解码算法 & chart解码 &  CYK + 规则二叉化 \\ \hline
xiaotong committed
6783 6784 6785 6786 6787 6788
速度 && 一般较慢

\end{tabular}

\end{frame}

xiaotong committed
6789 6790 6791 6792
%%%------------------------------------------------------------------------------------------------------------
%%%  基于树的解码方法 - 超图
\begin{frame}{基于树的解码 - 超图}
\begin{itemize}
6793
\item 如果源语言输入的是句法树,\alert{基于树的解码}会找到一个推导覆盖整个句法树,之后输出所对应的目标语词串作为译文
xiaotong committed
6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846
\item 比如,可以从树的叶子结点开始,找到所有能匹配到这个节点的规则,当所有节点匹配完之后,本质上获得了一个超图
	\begin{itemize}
	\item<2-> 图的节点对应一个句法树句法节点
	\item<2-> 图的边(或者叫超边)对应规则,边的头指向规则左部(源语言端)所对应图节点,边可以有多个尾,每个尾对应规则右部(源语言端)中的一个变量
	\end{itemize}
\end{itemize}

\visible<2->{
\begin{center}
\begin{tikzpicture}
{\scriptsize
\begin{scope}[sibling distance=5pt, level distance=20pt]
\Tree[.\node(cn1){VP$^{[1]}$};
        [.\node(cn2){AD$^{[2]}$}; 大幅度 ]
        [.\node(cn3){VP$^{[3]}$};
            [.\node(cn4){VV$^{[4]}$}; 下降 ]
            [.\node(cn5){AS$^{[5]}$}; 了 ]
        ]
     ]
\node [anchor=south] (treelabel) at (cn1.north) {\scriptsize{源语句法树}};
\end{scope}

\begin{scope}[xshift=1.3in,sibling distance=5pt, level distance=20pt]
\Tree[.\node(sn1){VP};  [.\node(sn2){AD}; \node(sw1){大幅度}; ] [.\node(sn3){VP};] ]
\node [anchor=south] (rulelabel) at ([yshift=0.2em,xshift=4em]sn1.north) {\scriptsize{匹配的翻译规则}};
\end{scope}

\draw [->,thick] (sn3.east) -- ([xshift=1em]sn3.east);
\node [anchor=west] (rr) at ([xshift=1em]sn3.east) {drastically VP};

\node [anchor=west,circle,draw,inner sep=2pt] (tail) at ([yshift=-3em,xshift=3em]rr.south east) {\tiny{[3]}};
\node [anchor=west,circle,draw,inner sep=2pt] (head) at ([yshift=2.5em,xshift=5em]rr.south east) {\tiny{[1]}};
\draw [-latex,thick] ([yshift=0.1em]tail.60) -- ([yshift=-0.1em]head.260);
\node [anchor=north] (headlabel) at ([xshift=0.5em]head.south) {\tiny{}};
\node [anchor=west] (taillabel) at ([yshift=1.2em,xshift=-0.3em]tail.east) {\tiny{}};
\node [anchor=south] (graphlabel) at ([yshift=0.6em]head.north) {\scriptsize{超图}};

\begin{pgfonlayer}{background}
\node [fill=green!20,inner sep=2pt,drop shadow] (rulebox) [fit = (sn1) (sn2) (sn3) (sw1) (rr)] {};
\draw [->,dotted,thick] ([yshift=2em]rulebox.east) ..controls +(east:3.5em) and +(west:1.5em).. ([yshift=1em,xshift=0.3em]tail.north);

\node [fill=red!20,inner sep=0pt] (nodebox1) [fit = (cn1)] {};
\node [fill=red!20,inner sep=0pt] (nodebox2) [fit = (sn1)] {};
\draw [<->,red] (nodebox1) edge [out=15, in=160] (nodebox2);
\end{pgfonlayer}
}

\end{tikzpicture}
\end{center}
}

\end{frame}

xiaotong committed
6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891
%%%------------------------------------------------------------------------------------------------------------
%%%  基于树的解码方法 - chart
\begin{frame}{基于树的解码 - chart}
\begin{itemize}
\item 规则匹配后形成的超图,每个节点可以由两部分信息决定:节点的句法标记 + 跨度
    \begin{itemize}
    \item 这本质上和单语句法分析中的表示方法是一致的
    \item 存储形式有很多中,这里采用常用的chart结构,即,用一个二维表存储,其中每一个单元对应一个跨度(span)。同一个跨度的节点都可以放到同一个表单元中,同一表单元的节点用句法标记区分
    \end{itemize}
\end{itemize}

\begin{center}
\begin{tikzpicture}

\visible<2->{
\begin{scope}
\node [anchor=west,circle,inner sep=2pt,draw,fill=red!20] (node1) at (0,0) {\tiny{[1,1]}};
\node [anchor=west,circle,inner sep=2pt,draw,fill=blue!20] (node2) at ([xshift=3.3em]node1.east) {\tiny{[3,3]}};
\node [anchor=north,circle,inner sep=2pt,draw,fill=green!20] (node3) at ([xshift=2.5em,yshift=5em]node1.north) {\tiny{[1,3]}};
\node [anchor=north] (rulelabel) at ([yshift=-0.5em,xshift=2em]node1.south east) {\tiny{规则$r$所对应的超图}};

\draw [-latex] (node1.90) ..controls +(north:3em) and +(south:3em).. (node3.-90);
\draw [-latex] (node2.90) ..controls +(north:3em) and +(south:3em).. (node3.-90);

\node [anchor=west] (rule1) at ([xshift=6em]node3.east) {\footnotesize{VP(AD$_1$ VP(VV(下降)) AS$_2$)}};
\node [anchor=north west] (rule2) at (rule1.south west) {\footnotesize{$\to$ AS$_2$ AD$_1$ fallen}};
\node [anchor=south] (rulelabel) at ([yshift=-0.4em]rule1.north) {\tiny{规则$r$}};

\begin{pgfonlayer}{background}
\visible<2->{
\node [anchor=north west,fill=green!20,inner sep=2pt,minimum height=1.5em,minimum width=1.3em] (nodebox1) at ([xshift=0.2em]rule1.north west) {};
\node [anchor=north west,fill=red!20,inner sep=2pt,minimum height=1.5em,minimum width=1.8em] (nodebox2) at ([xshift=0.2em]nodebox1.north east) {};
\node [anchor=north east,fill=blue!20,inner sep=2pt,minimum height=1.5em,minimum width=1.6em] (nodebox1) at ([xshift=-0.6em]rule1.north east) {};
}
\end{pgfonlayer}

\tikzstyle{chartnode}=[rectangle,minimum size=1.3em,draw]
\node [chartnode,anchor=north west] (cell11) at ([yshift=-2em]rule2.south west) {};
\node [chartnode,anchor=north west] (cell21) at ([yshift=-0em]cell11.south west) {};
\node [chartnode,anchor=west] (cell22) at (cell21.east) {};
\node [chartnode,anchor=north west] (cell31) at ([yshift=-0em]cell21.south west) {};
\node [chartnode,anchor=west] (cell32) at (cell31.east) {};
\node [chartnode,anchor=west] (cell33) at (cell32.east) {};
\node [anchor=north] (chartlabel) at (cell32.south) {\scriptsize{chart}};

xiaotong committed
6892 6893
\draw [<-,dotted,thick] ([xshift=0.1em]node3.60) ..controls +(60:0.5) and +(120:0.5).. (rule1.north west);

xiaotong committed
6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916
\visible<3->{
\node [chartnode,anchor=north west,fill=red!20] (cell11) at ([yshift=-2em]rule2.south west) {};
\node [chartnode,anchor=north west,fill=blue!20] (cell31) at ([yshift=-0em]cell21.south west) {};
\node [chartnode,anchor=west,fill=green!20] (cell33) at (cell32.east) {};

\draw [->,dotted] ([xshift=0.1em]node3.-60)..controls +(-60:3em) and +(north:7em).. (cell33.center);
\draw [->,dotted] ([xshift=0.1em]node2.0)..controls +(east:2em) and +(west:3em).. (cell31.center);
\draw [->,dotted] ([xshift=0.1em]node1.60)..controls +(60:1.5em) and +(120:2em)..  (cell11.center);
}

\visible<4->{
\node [anchor=north west,fill=green!20,drop shadow,align=left] (cellbox) at ([yshift=4em,xshift=1em]cell33.north east) {\scriptsize{表单元表示覆盖单词1-3的跨度}\\\scriptsize{保存跨度[1,3]上的所有节点}\\\scriptsize{VP [1,3]}\\\scriptsize{NP [1,3]}\\\scriptsize{...}};
\draw [->] ([xshift=-0.2em,yshift=-0.2em]cell33.north east)..controls +(north:2.5em) and +(west:1em)..  ([yshift=2em]cellbox.west);
}

\end{scope}
}

\end{tikzpicture}
\end{center}

\end{frame}

xiaotong committed
6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115
%%%------------------------------------------------------------------------------------------------------------
%%%  基于树的解码方法 - chart-based decoding
\begin{frame}{基于树的解码 - 基于chart的方法}
\begin{itemize}
\item 基于chart这种结构,可以很容易的构建解码所用的超图。常用的方法是自底向上解码:
    \begin{itemize}
    \item 从源语言句法树的叶子节点开始,自下而上访问树的节点
    \item 对于每个跨度,如果对应一个树节点,则匹配相应的规则
    \item 从树的根节点可以得到翻译推导,最终选择最优推导所对应的译文输出
    \end{itemize}
\end{itemize}

\visible<2->{
\begin{minipage}[b]{0.42\linewidth}
\begin{center}
\begin{tikzpicture}

\begin{scope}
\tikzstyle{chartnode}=[rectangle,minimum size=1.3em,draw]
\node [chartnode,anchor=north west] (cell11) at (0,0) {};
\node [chartnode,anchor=north west] (cell21) at ([yshift=-0em]cell11.south west) {};
\node [chartnode,anchor=west] (cell22) at (cell21.east) {};
\node [chartnode,anchor=north west] (cell31) at ([yshift=-0em]cell21.south west) {};
\node [chartnode,anchor=west] (cell32) at (cell31.east) {};
\node [chartnode,anchor=west] (cell33) at (cell32.east) {};
\node [chartnode,anchor=north west] (cell41) at ([yshift=-0em]cell31.south west) {};
\node [chartnode,anchor=west] (cell42) at (cell41.east) {};
\node [chartnode,anchor=west] (cell43) at (cell42.east) {};
\node [chartnode,anchor=west] (cell44) at (cell43.east) {};

\tikzstyle{chartnode2}=[rectangle,minimum size=1.3em,fill=orange!20]
\node<3-> [chartnode2,anchor=north west] (cell11) at (0,0) {};
\node<4-> [chartnode2,anchor=north west] (cell21) at ([yshift=-0em]cell11.south west) {};
\node<7-> [chartnode2,anchor=west] (cell22) at (cell21.east) {};
\node<5-> [chartnode2,anchor=north west] (cell31) at ([yshift=-0em]cell21.south west) {};
\node<8-> [chartnode2,anchor=west] (cell32) at (cell31.east) {};
\node<10-> [chartnode2,anchor=west] (cell33) at (cell32.east) {};
\node<6-> [chartnode2,anchor=north west] (cell41) at ([yshift=-0em]cell31.south west) {};
\node<9-> [chartnode2,anchor=west] (cell42) at (cell41.east) {};
\node<11-> [chartnode2,anchor=west] (cell43) at (cell42.east) {};
\node<12-> [chartnode2,anchor=west] (cell44) at (cell43.east) {};

\node [anchor=east] (s1) at (cell11.west) {\scriptsize{}};
\node [anchor=east] (s2) at (cell21.west) {\scriptsize{喜欢}};
\node [anchor=east] (s3) at (cell31.west) {\scriptsize{}};
\node [anchor=east] (s4) at (cell41.west) {\scriptsize{}};
\node [anchor=north] (t5) at (cell41.south) {\tiny{$l$=1}};
\node [anchor=north] (t5) at (cell42.south) {\tiny{$l$=2}};
\node [anchor=north] (t5) at (cell43.south) {\tiny{$l$=3}};
\node [anchor=north] (t5) at (cell44.south) {\tiny{$l$=4}};

\node [anchor=north] (chartlabel) at ([yshift=-1em]cell42.south east) {\footnotesize{\textbf{chart}}};

\node [anchor=north west] (w1) at ([yshift=-2.5em,xshift=-2.0em]cell41.south west) {};
\node [anchor=west] (w2) at ([xshift=0.3em]w1.east) {喜欢};
\node [anchor=west] (w3) at ([xshift=0.3em]w2.east) {};
\node [anchor=west] (w4) at ([xshift=0.3em]w3.east) {};
\node [anchor=north east] (p0) at ([xshift=0.3em]w1.south west) {\blue{0}};
\node [anchor=north east] (p1) at ([xshift=0.3em]w2.south west) {\blue{1}};
\node [anchor=north east] (p2) at ([xshift=0.3em]w3.south west) {\blue{2}};
\node [anchor=north east] (p3) at ([xshift=0.3em]w4.south west) {\blue{3}};
\node [anchor=north west] (p4) at ([xshift=-0.4em]w4.south east) {\blue{4}};
\node [anchor=north] (slabel) at (p2.south) {\scriptsize{\textbf{源语言句子}}};

\end{scope}

\end{tikzpicture}
\end{center}

\end{minipage}
\begin{minipage}[b]{0.55\linewidth}

{\footnotesize
\visible<3->{
\begin{tabular}{l l l l}
\visible<3->{序号} & \visible<3->{跨度} & \visible<3->{标记} & \visible<3->{源语句子片段} \\ \hline
\visible<3->{1} & \visible<3->{[{\blue 0},{\blue 1}]} & \visible<3->{NN \& NP} & \visible<3->{} \\
\visible<4->{2} & \visible<4->{[{\blue 1},{\blue 2}]} & \visible<4->{VV} & \visible<4->{喜欢} \\
\visible<5->{3} & \visible<5->{[{\blue 2},{\blue 5}]} & \visible<5->{VV} & \visible<5->{} \\
\visible<6->{4} & \visible<6->{[{\blue 3},{\blue 6}]} & \visible<6->{NN \& NP} & \visible<6->{} \\
\visible<7->{5} & \visible<7->{[{\blue 0},{\blue 2}]} & \visible<7->{N/A} & \visible<7->{猫 喜欢} \\
\visible<8->{6} & \visible<8->{[{\blue 1},{\blue 3}]} & \visible<8->{N/A} & \visible<8->{喜欢 吃} \\
\visible<9->{7} & \visible<9->{[{\blue 2},{\blue 4}]} & \visible<9->{VP} & \visible<9->{吃 鱼} \\
\visible<10->{8} & \visible<10->{[{\blue 0},{\blue 3}]} & \visible<10->{N/A} & \visible<10->{猫 喜欢 吃} \\
\visible<11->{9} & \visible<11->{[{\blue 1},{\blue 4}]} & \visible<11->{VP} & \visible<11->{喜欢 吃 鱼} \\
\visible<12->{10} & \visible<12->{[{\blue 0},{\blue 4}]} & \visible<12->{IP (\alert{root})} & \visible<12->{猫 喜欢 吃 鱼} \\
\\
\end{tabular}
}
}

\end{minipage}
}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% 规则使用 - 基于树的匹配
\begin{frame}{使用树结构匹配树到串规则}

\begin{itemize}
\item 对于规则的源语言部分,可以使用树片段的匹配找到可以使用这条规则位置
    \begin{itemize}
    \item 匹配的规则会被存入相应的表格单元中
    \end{itemize}
\end{itemize}

\vspace{-2em}

\begin{center}
\begin{tikzpicture}

\begin{scope}

{\scriptsize

\begin{scope}[sibling distance=2pt,level distance=20pt,grow'=up]
\Tree[.\node(treeroot){IP};
     [.NP [.NR 阿都拉$_1$ ]]
        [.\node(tn1){VP};
            [.\node(tn2){PP};
                [.\node(tn3){P}; \node(cw1){$_2$}; ]
                [.\node(tn4){NP}; \edge[roof]; {自己$_3$$_4$\ $_5$\ $_6$\ $_7$\ 以来$_8$\ $_9$\ 施政$_{10}$\ 表现$_{11}$} ]
            ]
            [.\node(tn5){VP};
                [.VV 感到$_{12}$ ]
                [.NN 满意$_{13}$ ]
            ]
        ]
     ]
\end{scope}

\visible<2->{
\node [anchor=west,fill=green!20!white] (rulepart1) at ([yshift=2.0in,xshift=-1.3in]treeroot.east) {VP(PP(P() NP$_1$) VP$_2$)};
\node [anchor=north west] (rulepart2) at (rulepart1.south west) {$\to$ VP$_2$ with NP$_1$};
}

\begin{pgfonlayer}{background}
\visible<2->{
\node[rectangle,draw,inner sep=2pt] [fit = (rulepart1) (rulepart2)] (rulemark) {};
}
\end{pgfonlayer}

\visible<2->{
\node [anchor=south west] at (rulemark.north west) {\tiny{\textbf{树到串翻译规则}}};
}

}

\begin{scope}[xshift=1.5in,yshift=1.6in]
\visible<3->{
\node[anchor=center, minimum size=10pt,draw] (cell1and1) at (0,0) {};
\node[anchor=center, minimum size=10pt,draw] (cell2and1) at ([xshift=10pt]cell1and1.center) {};
\node[anchor=center, minimum size=10pt,draw] (cell3and1) at ([xshift=10pt]cell2and1.center) {};
\node[anchor=center, minimum size=10pt] (cell4and1) at ([xshift=15pt]cell3and1.center) {\tiny{$\dots$}};
\node[anchor=center, minimum size=10pt,draw] (cellnand1) at ([xshift=13pt]cell4and1.center) {};

\node[anchor=center, minimum size=10pt,draw] (cell1and2) at ([yshift=10pt]cell1and1.center) {};
\node[anchor=center, minimum size=10pt,draw] (cell2and2) at ([xshift=10pt]cell1and2.center) {};

\node[anchor=center, minimum size=10pt,draw] (cell1and3) at ([yshift=10pt]cell1and2.center) {};
\node[anchor=center, minimum size=10pt] (cell1and4) at ([yshift=20pt]cell1and3.center) {\tiny{$\vdots$}};

\node[anchor=center, minimum size=10pt] (cell2and3) at ([yshift=20pt]cell2and2.center) {\tiny{$\vdots$}};
\node[anchor=center, minimum size=10pt] (cell3and2) at ([yshift=20pt]cell3and1.center) {\tiny{$\vdots$}};
\node[anchor=center, minimum size=10pt,draw] (cell4andn) at ([yshift=20pt,xshift=10pt]cell3and1.center) {};

%\node[anchor=center, minimum size=10pt] (cell4and2) at ([yshift=20pt]cell4and1.center) {\tiny{$\ddots$}};

\node[anchor=center, minimum size=10pt,draw] (cell1andn) at ([yshift=10pt]cell1and4.center) {};
\node[anchor=center, minimum size=10pt,draw] (cell2andn) at ([xshift=10pt,yshift=-10pt]cell1andn.center) {};
%\node[anchor=center, minimum size=10pt,draw] (cell3andn) at ([xshift=10pt,yshift=-10pt]cell2andn.center) {};

\node[anchor=west] (chartlabel) at ([xshift=-0em,yshift=-0.8em]cell1and1.south east) {\scriptsize{Chart}};
}
\end{scope}

\visible<3->{
\path [draw,thick,blue,->,dashed] (rulemark.north east) .. controls +(60:2.0) and +(north east:1.5)  ..  ([yshift=0.05em,xshift=0.05em]cell4andn.north east) node[pos=0.25, below,yshift=-0.2em] (spanlabel) {};
}


\begin{pgfonlayer}{background}
\visible<2->{
\path [fill=green!20] (tn1.south west) -- ([yshift=0.2em]tn2.south west) -- ([yshift=0.2em,xshift=-0.30em]tn3.south west) -- (cw1.north west) -- (cw1.north east) -- ([xshift=0.30em]tn3.north east) -- (tn4.north east) -- (tn4.south east) -- ([xshift=0.5em]tn2.north east) -- (tn5.north east)-- ([yshift=0.2em]tn5.south east) -- (tn1.south east) -- (tn1.south west);
}
\end{pgfonlayer}

\visible<2->{
\path [draw,thick,blue,<->] ([xshift=-2em]rulepart1.south east) .. controls +(south:1.7) and +(north:1.3) ..  ([xshift=0em,yshift=0.10em]cw1.north) node[pos=0.5, below,xshift=0.3in] {\scriptsize{树片段的匹配}};
}

\end{scope}

\end{tikzpicture}
\end{center}

\end{frame}

7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230
%%%------------------------------------------------------------------------------------------------------------
%%%  基于串的解码方法
\begin{frame}{基于串的解码}

\begin{itemize}
\item 不同于基于树的解码,\alert{基于串的解码}方法并不要求输入句法树,它直接对输入词串进行翻译,最终得到译文。
    \begin{itemize}
    \item 这种方法适用于树到串、串到树、树到树等多种模型
    \item 本质上,由于并不受固定输入的句法树约束,基于串的解码可以探索更多潜在的树结构,这也增大了搜索空间(相比基于串的解码),因此该方法更有可能找到高质量翻译结果
    \end{itemize}
\item<2-> 在基于串的方法中,句法结构被看做是翻译的隐含变量,而非线性的输入和输出。比如,层次短语翻译解码就是一种典型的基于串的解码方法,所有的翻译推导在翻译过程里动态生成,但是并不要输入或者输出这些推导所对应的层次结构
\end{itemize}

\visible<2->{
\begin{center}
\begin{tikzpicture}

\begin{scope}[scale=0.9,level distance=15pt,sibling distance=0pt]

{\scriptsize
\Tree[.\node(bsn0){IP};
          [.\node(bsn1){NP};
               [.\node(bsn2){NN}; \node(bsw1){}; ]
          ]
          [.\node(bsn3){VP};
               [.\node(bsn4){VV}; \node(bsw2){喜欢}; ]
               [.\node(bsn5){VP}; \edge[roof]; \node(bsw3){\ }; ]
          ]
     ]

\node [anchor=west] (target) at ([xshift=1em]bsw3.east) {Cats like eating fish};
\node [anchor=north,inner sep=3pt] (cap1) at (target.south west) {(a) 基于树的解码};
\draw [->,thick] (bsw3.east) -- (target.west);
\node [anchor=west] (sourcelabel) at ([xshift=2em]bsn0.east) {显式输入的结构};

\node [anchor=west] (source2) at ([xshift=2em]target.east) {猫 喜欢 吃 鱼};
\node [anchor=west] (target2) at ([xshift=1em]source2.east) {Cats like eating fish};
\node [anchor=north,inner sep=3pt] (cap2) at (target2.south west) {(b) 基于串的解码};
\draw [->,thick] (source2.east) -- (target2.west);

\begin{scope}[xshift=2.45in,sibling distance=3pt]
\Tree[.\node(bsn0){IP};
          [.\node(bsn1){NP};
               [.\node(bsn2){NN}; ]
          ]
          [.\node(bsn3){VP};
               [.\node(bsn4){VV}; ]
               [.\node(bsn5){VP}; ]
          ]
     ]

\begin{pgfonlayer}{background}
\node [draw,dashed,inner sep=2pt] (box) [fit = (bsn0) (bsn1) (bsn2) (bsn3) (bsn4) (bsn5)] {};
\node [anchor=north west] (boxlabel) at (box.north east) {隐含结构};
\end{pgfonlayer}

\end{scope}

}

\end{scope}

\end{tikzpicture}
\end{center}
}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  基于串的解码方法本质上和句法分析一样
\begin{frame}{基于串的解码 $\approx$ 句法分析}

\begin{itemize}
\item 基于串的翻译和传统\alert{句法分析}的任务很像:对于一个输入的词串,找到生成这个词串的最佳推导。唯一不同的地方,在于机器翻译需要考虑译文的生成(语言模型的引入会使问题稍微复杂一些),但是源语言部分的处理和句法分析一模一样
\item<2-> 这个过程仍然可以用基于chart的方法实现,即对于每一个源语言片段,都匹配可能的翻译规则,之后填入相应的表格单元,这也构成了一个超图,最佳推导可以从这个超图得到
\end{itemize}

\visible<2->{
\begin{center}
\begin{tikzpicture}

\begin{scope}
{\scriptsize

\node [anchor=west] (sw1) at (0,0) {阿都拉$_1$};
\node [anchor=west] (sw2) at ([xshift=0.1em]sw1.east) {$_2$};
\node [anchor=west] (sw3) at ([xshift=0.1em]sw2.east) {自己$_3$$_4$\ $_5$\ $_6$\ $_7$\ 以来$_8$\ $_9$\ 施政$_{10}$\ 表现$_{11}$};
\node [anchor=west] (sw4) at ([xshift=0.2em]sw3.east) {感到$_{12}$ 满意$_{13}$};

\begin{pgfonlayer}{background}
\visible<3->{
\node [fill=red!20,inner sep=0pt] (box1) [fit = (sw1)] {};
\node [fill=green!20,inner sep=0pt] (box2) [fit = (sw3)] {};
\node [fill=orange!20,inner sep=0pt] (box3) [fit = (sw4)] {};
\node [anchor=south,align=center] (box1label) at (box1.north) {[{\blue 0},{\blue 1}]\\VP};
\node [anchor=south,align=center] (box2label) at (box2.north) {[{\blue 2},{\blue 11}]\\NP};
\node [anchor=south,align=center] (box3label) at (box3.north) {[{\blue 11},{\blue 13}]\\VP};
}
\end{pgfonlayer}

\draw[decorate,decoration={brace,mirror,,amplitude=3mm}] (sw1.south west) -- (sw4.south east);

\node [anchor=north] (label) at ([yshift=-1em]sw3.south) {在跨度[{\blue 0},{\blue 13}]上进行规则匹配};
\node [anchor=north] (rule) at ([yshift=-0.3em]label.south) {{\footnotesize 比如:IP({\color{red} NP$_1$} VP(PP(P() {\color{ugreen} NP$_2$}) {\color{orange} VP$_3$}))}};
\node [anchor=north west] (rule2) at ([yshift=0.2em]rule.south west) {{\footnotesize \hspace{2.8em} $\to$ NP$_1$ VP$_3$ with NP$_2$}};

}

\end{scope}

\end{tikzpicture}
\end{center}
}

\end{frame}
xiaotong committed
7231 7232

%%%------------------------------------------------------------------------------------------------------------
7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283
%%%  基于串的解码 - 规则匹配
\begin{frame}{基于串的解码 - 规则匹配}

\begin{itemize}
\item 相比基于树的解码,基于串的解码的实现要复杂许多,因为对于每一个片段,需要判断每条规则是否能匹配
	\begin{itemize}
	\item 就是匹配树片段的叶子节点序列,即单词和变量构成的串
	\item<2-> 匹配单词可以直接完成
	\item<3-> 匹配变量需要检查相应跨度节点上是否有相应标记的推导
	\end{itemize}
\end{itemize}

\vspace{-1em}
\begin{center}
\begin{tikzpicture}

\begin{scope}
{\scriptsize

\node [anchor=west] (sw1) at (0,0) {阿都拉$_1$};
\node [anchor=west] (sw2) at ([xshift=0.1em]sw1.east) {$_2$};
\node [anchor=west] (sw3) at ([xshift=0.1em]sw2.east) {自己$_3$$_4$\ $_5$\ $_6$\ $_7$\ 以来$_8$\ $_9$\ 施政$_{10}$\ 表现$_{11}$};
\node [anchor=west] (sw4) at ([xshift=0.2em]sw3.east) {感到$_{12}$ 满意$_{13}$};

\begin{pgfonlayer}{background}
\visible<3->{
\node [fill=red!20,inner sep=0pt] (box1) [fit = (sw1)] {};
\node [fill=green!20,inner sep=0pt] (box2) [fit = (sw3)] {};
\node [fill=orange!20,inner sep=0pt] (box3) [fit = (sw4)] {};
\node [anchor=south,align=center] (box1label) at (box1.north) {[{\blue 0},{\blue 1}]\\VP};
\node [anchor=south,align=center] (box2label) at (box2.north) {[{\blue 2},{\blue 11}]\\NP};
\node [anchor=south,align=center] (box3label) at (box3.north) {[{\blue 11},{\blue 13}]\\VP};
}
\visible<2->{
\node [draw,thick,purple,inner sep=0pt] (box4) [fit = (sw2)] {};
}
\end{pgfonlayer}

\draw[decorate,decoration={brace,mirror,,amplitude=3mm}] (sw1.south west) -- (sw4.south east);

\node [anchor=north] (label) at ([yshift=-1em]sw3.south) {在跨度[{\blue 0},{\blue 13}]上匹配``NP 对 NP VP''};
}

\end{scope}

\end{tikzpicture}
\end{center}

\vspace{-1em}

\begin{itemize}
7284
\item<4-> 如果待匹配的单词和变量序列中,没有连续的变量,这样的规则符合lexicalized norm form (LNF)。因为LNF中单词(终结符)可以作为锚点,因此规则匹配较容易实现
7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345
	\begin{itemize}
	\item 比如层次短语系统的规则就符合LNF,因此规则匹配非常容易实现
	\item 显然上面例子中的规则不符合LNF
	\end{itemize}
\end{itemize}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  基于串的解码 - 连续变量的匹配,复杂度增加
\begin{frame}{基于串的解码 - 连续变量的匹配}
\begin{itemize}
\item 但是,如果待匹配串中有连续变量,问题会变得复杂:因为确定两个变量之间的边界需要 增加一重循环
\end{itemize}

\vspace{-0.5em}

\begin{center}
\begin{tikzpicture}

\begin{scope}
{\scriptsize

\node [anchor=west] (sw11) at (0,0) {阿都拉$_1$};
\node [anchor=west] (sw12) at ([xshift=0.1em]sw11.east) {$_2$};
\node [anchor=west,fill=green!20] (sw13) at ([xshift=0.1em]sw12.east) {自己$_3$$_4$\ $_5$\ $_6$\ $_7$\ 以来$_8$\ $_9$\ 施政$_{10}$\ 表现$_{11}$ 感到$_{12}$ };
\node [anchor=west,fill=orange!20] (sw14) at ([xshift=0.2em]sw13.east) {满意$_{13}$};

\node [anchor=north west] (sw21) at ([yshift=-0.3em]sw11.south west) {阿都拉$_1$};
\node [anchor=west] (sw22) at ([xshift=0.1em]sw21.east) {$_2$};
\node [anchor=west,fill=green!20] (sw23) at ([xshift=0.1em]sw22.east) {自己$_3$$_4$\ $_5$\ $_6$\ $_7$\ 以来$_8$\ $_9$\ 施政$_{10}$\ 表现$_{11}$};
\node [anchor=west,fill=orange!20] (sw24) at ([xshift=0.2em]sw23.east) {感到$_{12}$ 满意$_{13}$};

\node [anchor=north west] (sw31) at ([yshift=-0.3em]sw21.south west) {阿都拉$_1$};
\node [anchor=west] (sw32) at ([xshift=0.1em]sw31.east) {$_2$};
\node [anchor=west,fill=green!20] (sw33) at ([xshift=0.1em]sw32.east) {自己$_3$$_4$\ $_5$\ $_6$\ $_7$\ 以来$_8$\ $_9$\ 施政$_{10}$};
\node [anchor=west,fill=orange!20] (sw34) at ([xshift=0.2em]sw33.east) {表现$_{11}$ 感到$_{12}$ 满意$_{13}$};

\node [anchor=north] (dots) at ([yshift=-0.5em]sw33.south) {...};

\node [anchor=north west] (sw41) at ([yshift=-1.8em]sw31.south west) {阿都拉$_1$};
\node [anchor=west] (sw42) at ([xshift=0.1em]sw41.east) {$_2$};
\node [anchor=west,fill=green!20] (sw43) at ([xshift=0.1em]sw42.east) {自己$_3$ };
\node [anchor=west,fill=orange!20] (sw44) at ([xshift=0.2em]sw43.east) {$_4$\ $_5$\ $_6$\ $_7$\ 以来$_8$\ $_9$ 施政$_{10}$ 表现$_{11}$ 感到$_{12}$ 满意$_{13}$};

\node [anchor=south] (label) at ([yshift=0.3em]sw13.north) {\footnotesize{在跨度[{\blue 0},{\blue 13}]上匹配``NP 对 NP VP''}};

\node [anchor=north west,minimum size=1.2em,fill=green!20] (np) at ([yshift=-1.0em,xshift=0.3em]sw41.south west) {};
\node [anchor=west] (nplabel) at (np.east) {NP(第二个)};
\node [anchor=west,minimum size=1.2em,fill=orange!20] (vp) at ([xshift=1.0em]nplabel.east) {};
\node [anchor=west] (vplabel) at (vp.east) {VP};

}
\end{scope}

\end{tikzpicture}
\end{center}

\vspace{-0.5em}

\begin{itemize}
7346
\item<2-> 理论上,对于长度为$n$的词串,匹配$m$个连续变量的时间复杂度是O($n^{m-1}$)
7347 7348 7349 7350 7351 7352 7353 7354
	\begin{itemize}
	\item 这也会导致含有多个变量的非词汇化规则的匹配大大增加系统的运行时间,但这种规则在句法系统中也很常见
	\end{itemize}
\end{itemize}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
7355 7356 7357 7358 7359 7360 7361 7362
%%%  基于串的解码 - CYK + 规则二叉化
\begin{frame}{基于串的解码 - CKY + 规则二叉化}

\begin{itemize}
\item 对于这个问题,常用的解决办法是进行规则二叉化,这样右端最多只有两个连续变量,规则匹配的复杂度降为O($n$)。例如,对于如下串到树规则\\

    \vspace{0.4em}
    \begin{center}
xiaotong committed
7363
    喜欢 VP$_1$ NP$_2$ $\to$ VP(VBZ(likes) VP$_1$ NP$_2$) \\
7364 7365 7366 7367 7368 7369
    \end{center}
    \vspace{0.4em}

	二叉化之后变为
    \vspace{0.4em}
    \begin{center}
xiaotong committed
7370
    \hspace{1em} 喜欢 V103 $\to$ VP(VBZ(likes) V103) \\
7371 7372 7373 7374 7375 7376 7377 7378 7379 7380
    \vspace{0.4em}
    VP$_1$ NP$_2$ $\to$ V103(VP$_1$ NP$_2$) \\
    \end{center}
    \vspace{0.4em}

    其中,二叉化后的规则源语言端最多有两个非终结符。V103是一个虚拟符号,用于表示临时生成的规则
\item<2-> 对于二叉化后的规则,可以使用CKY方法完成解码,它也是一种基于chart的分析方法,对于每个源语言片段,匹配规则两个枝杈的左分支和右分支,整个过程和其它chart方法没有区别

\end{itemize}

xiaotong committed
7381 7382 7383
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
7384 7385 7386 7387 7388 7389 7390 7391 7392 7393
%%%  基于串的解码 - chart parsing examples
\begin{frame}{基于串的解码 - 规则使用的实例}

\begin{itemize}
\item 使用规则可以构建句子的分析图
\end{itemize}

\centering
\includegraphics[scale=0.63]{./Figures/figure-chart-parsing-example.pdf}

xiaotong committed
7394 7395
\end{frame}

xiaotong committed
7396
%%%------------------------------------------------------------------------------------------------------------
7397 7398 7399
\subsection{改进方法}

%%%------------------------------------------------------------------------------------------------------------
7400 7401 7402 7403 7404 7405 7406 7407 7408
%%%  对于句法系统的改进
\begin{frame}{改进方法}
\begin{itemize}
\item \textbf{基于森林的翻译模型}。句法分析会出现错误,因此只使用一棵句法树进行规则抽取和解码会放大句法分析错误的影响。一种解决方法是使用多棵句法树增加覆盖度,句法森林是一种有效的数据结构表示指数级树结构,因此也被用于基于句法的机器翻译。
\vspace{0.3em}
\item \textbf{句法软约束和规则模糊匹配}。前面提到的模型都要求模型严格遵循句法结构,很多时候由于句法结构可能不完全适合翻译任务甚至有错误,这种模型过``硬''。因此可以使用句法软约束或者放松规则匹配时的约束。
\vspace{0.3em}
\item \textbf{控制句法使用的程度}。句法模型比较适合捕捉句法上层的表示,而短语模型更适合处理局部依赖。因此可以使用二者的混合来达到更好的效果,比如,可以让句法模型处理上层骨架的翻译,之后让短语模型处理简单短语片段的翻译。
\end{itemize}
xiaotong committed
7409 7410 7411
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
7412 7413 7414
%%%  实验结果
\begin{frame}{翻译效果}

xiaotong committed
7415
\vspace{-1em}
7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435
\begin{center}
\begin{tabular}{l | l | l | l}
\multicolumn{2}{c|}{模型} & 开发集 & 测试集  \\
\multicolumn{2}{c|}{} & (BLEU[\%]) & (BLEU[\%])  \\ \hline
\multicolumn{2}{l|}{短语(Moses)} & 36.51  & 34.93 \\
\multicolumn{2}{l|}{短语(NiuTrans)} & 36.99 & 35.29 \\ \hline
\multicolumn{2}{l|}{层次短语(Moses)} & 36.65 & 34.79 \\
\multicolumn{2}{l|}{层次短语(NiuTrans)} & 37.41 & 35.35 \\ \hline
       & 基于串的解码 & 36.48 & 34.71 \\
树到串 & 基于树的解码 & 35.54 & 33.99 \\
(NiuTrans) & 基于森林的解码 & 36.14 & 34.25 \\ \hline
       & 基于串的解码 & 35.99 & 34.01 \\
树到树 & 基于树的解码 & 35.04 & 33.21 \\
(NiuTrans) & 基于森林的解码 & 35.56 & 33.45 \\ \hline
串到树 & 基于串的解码 & 37.63 & 35.65 \\
(NiuTrans) & & &
\end{tabular}
\end{center}

\vspace{-0.5em}
xiaotong committed
7436 7437
\scriptsize{* 以上结果来自 NiuTrans: An Open Source Toolkit for Phrase-based and Syntax-based Machine Translation}\\
\scriptsize{* 开发集:NIST MT03,测试集:NIST MT05}\\
7438

xiaotong committed
7439 7440 7441
\end{frame}

%%%------------------------------------------------------------------------------------------------------------
7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509
%%%  总结
\begin{frame}{小结一下}

\begin{itemize}
\item 基于短语和基于句法的模型是机器翻译2000年之后的重要进展之一
    \begin{itemize}
    \item 研究热度持续十余年,至今仍有使用(无指导机器翻译中使用SMT做初始模型)
    \item 一些方法代表了NLP中的原始创新,比如最小错误率训练
    \end{itemize}
\item 相关技术和方法对现在研究仍然有很好的借鉴意义
    \begin{itemize}
    \item 对翻译的统计建模方法,比如,基于翻译文法和推导的机器翻译建模思想
    \item 翻译调序等机器翻译特有问题的描述方法
    \item 先验知识的使用,句法结构、篇章等等
    \end{itemize}
\item<2-> 在深度学习时代下重新审视统计机器翻译
    \begin{itemize}
    \item 注意,统计机器翻译并不是简单几套系统,更重要的是思想,这种建模方法更接近人类对翻译的认知
    \item 深度学习方法从另一个视角看待机器翻译,二者必然存在结合的可能,只是结合的方法需要探索
    \end{itemize}
\end{itemize}

\end{frame}

%%%------------------------------------------------------------------------------------------------------------
%%%  last slide
\begin{frame}{Last Slide}

\vspace{1em}
\begin{center}

\begin{tikzpicture}

\begin{scope}[level distance=25pt]

\node[] (x) at (-4,0) {};

\begin{scope}[sibling distance=15pt]
\Tree[.\node(en1){VP};
        [.\node(en2){VP};
            [.VB \textbf{Thank} ]
            [.PRP \textbf{you} ]
        ]
        [.\node(en3){ADJP};
            [.RB \textbf{very} ]
            [.JJ \textbf{much} ]
        ]
     ]
\end{scope}

\begin{scope}[grow'=up, xshift=-0.2in, yshift=-2.6in, sibling distance=34pt]
\Tree[.\node(cn1){VP};
        [.\node(cn2){ADVP}; [.AD \textbf{非常} ] ]
        [.\node(cn3){VP};
            [.VV \textbf{感谢} ]
            [.PR \textbf{大家} ]
        ]
     ]
\end{scope}

\draw[<->, very thick, dotted, red] (cn1.east) .. controls +(east:4.5) and +(east:4.5) .. (en1.east);
\draw[<->, very thick, dotted, ugreen] (cn2.east) .. controls +(east:2) and +(west:2) .. (en3.west);
\draw[<->, very thick, dotted, blue] (cn3.west) .. controls +(west:2) and +(south:2) .. (en2.south);

\end{scope}
\end{tikzpicture}
\end{center}

xiaotong committed
7510 7511
\end{frame}

xiaotong committed
7512 7513
\end{CJK}
\end{document}