Commit 569f7f6f by 曹润柘

update chapter1 and chapter2

parent aacc5f12
......@@ -73,7 +73,7 @@
{\footnotesize
\node [anchor=north west,inner sep=1mm] (t15final) at ([yshift=-1.5em]t15.south west) {I am satisfied with you};
\node [draw,circle,thick,dotted,ublue,minimum width=1.5em] (be1) at ([xshift=1.5em]t15.west) {};
\node [draw,circle,thick,dotted,ublue,minimum width=1.5em] (be1) at ([xshift=1.4em]t15.west) {};
\draw[->,thick,ublue] (be1.south)..controls +(south:0.5) and +(north:0.6)..([xshift=1.8em,yshift=-0.0em]t15final.north west);
}
{
......
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}[sibling distance=0pt,level distance=17pt]
{\footnotesize
\Tree[.\node[inner sep=2pt](t1n1){IP};
[.\node[inner sep=2pt](t1n2){NP};
[.\node[inner sep=2pt](t1n3){NN}; 狗 ]
]
[.\node[inner sep=2pt](t1n4){VP};
[.\node[inner sep=2pt](t1n5){VV}; 喜欢 ]
[.\node[inner sep=2pt](t1n6){VP};
[.\node[inner sep=2pt](t1n7){VV}; 吃 ]
[.\node[inner sep=2pt](t1n8){NN}; 骨头 ]
]
]
]
}
\end{scope}
\begin{scope}[sibling distance=0pt,level distance=17pt,yshift=-7em]
{\footnotesize
\Tree[.\node[inner sep=2pt](t2n1){IP};
[.\node[inner sep=2pt](t2n2){VP};
[.\node[inner sep=2pt](t2n3){VV}; \node[](t2w1){}; ]
]
[.\node[inner sep=2pt](t2n4){IP};
[.\node[inner sep=2pt](t2n5){VP};
[.\node[inner sep=2pt](t2n6){VV}; 看 ]
]
[.\node[inner sep=2pt](t2n7){NP};
[.\node[inner sep=2pt](t2n8){QP};
[.\node[inner sep=2pt](t2n9){CD}; 一 ]
[.\node[inner sep=2pt](t2n10){M}; 个 ]
]
[.\node[inner sep=2pt](t2n11){ADJP};
[.\node[inner sep=2pt](t2n12){JJ}; 新 ]
]
[.\node[inner sep=2pt](t2n13){NP};
[.\node[inner sep=2pt](t2n14){NN}; \node[](t2wn){句子}; ]
]
]
]
]
}
\end{scope}
\node [anchor=south] (treebanklabel) at (t1n1.north) {{\color{ublue} 数据:树库}};
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue, inner sep=0.2em] [fit = (treebanklabel) (t1n1) (t2w1) (t2wn)] (treebank) {};
\end{pgfonlayer}
\node [anchor=north west] (math1) at ([xshift=2em]treebank.north east) {P('VP $\to$ VV NN')};
\node [anchor=north west] (math1part2) at ([xshift=-1em,yshift=0.2em]math1.south west) {$=\frac{\textrm{'VP'和'VV NN'同时出现的次数=1}}{\textrm{'VP'出现的次数}=4}$};
\node [anchor=north west] (math1part3) at ([yshift=0.2em]math1part2.south west){$=\frac{1}{4}$};
\node [anchor=north west] (math2) at ([yshift=-6em]math1.north west) {P('NP $\to$ NN')};
\node [anchor=north west] (math2part2) at ([xshift=-1em,yshift=0.2em]math2.south west) {$=\frac{\textrm{'NP'和'NN'同时出现的次数=2}}{\textrm{'NP'出现的次数}=3}$};
\node [anchor=north west] (math2part3) at ([yshift=0.2em]math2part2.south west){$=\frac{2}{3}$};
\node [anchor=north west] (math3) at ([yshift=-6em]math2.north west) {P('IP $\to$ NP NP')};
\node [anchor=north west] (math3part2) at ([xshift=-1em,yshift=0.2em]math3.south west) {$=\frac{\textrm{'IP'和'NP NP'同时出现的次数=0}}{\textrm{'IP'出现的次数}=3}$};
\begin{pgfonlayer}{background}
\path [] (t1n4.north east) -- (t1n4.north west) -- (t1n4.south west) -- (t1n4.south east);
\path [] (t1n6.north east) -- (t1n6.north west) -- (t1n6.south west) -- (t1n6.south east);
\path [] (t2n2.north east) -- (t2n2.north west) -- (t2n2.south west) -- (t2n2.south east);
\path [] (t2n5.north east) -- (t2n5.north west) -- (t2n5.south west) -- (t2n5.south east);
\path [] (t1n6.north west) -- (t1n7.north west) -- (t1n7.south west) -- (t1n8.south east) -- (t1n8.north east) -- (t1n6.north east);
\path [] (t1n2.north east) -- (t1n2.north west) -- (t1n2.south west) -- (t1n2.south east);
\path [] (t2n7.north east) -- (t2n7.north west) -- (t2n7.south west) -- (t2n7.south east);
\path [] (t2n13.north east) -- (t2n13.north west) -- (t2n13.south west) -- (t2n13.south east);
\path [] (t1n2.north west) -- (t1n3.south west) -- (t1n3.south east) -- (t1n2.north east) -- (t1n2.north west);
\path [] (t2n13.north west) -- (t2n14.south west) -- (t2n14.south east) -- (t2n13.north east) -- (t2n13.north west);
\path [] (t1n1.north east) -- (t1n1.north west) -- (t1n1.south west) -- (t1n1.south east);
\path [] (t2n4.north east) -- (t2n4.north west) -- (t2n4.south west) -- (t2n4.south east);
\path [] (t2n1.north east) -- (t2n1.north west) -- (t2n1.south west) -- (t2n1.south east);
\end{pgfonlayer}
\end{tikzpicture}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{minipage}[t]{0.38\linewidth}
{\small
\begin{eqnarray}
& &\textrm{IP} \nonumber \\
& \overset{r_8}{\Rightarrow} & \textrm{NP VP} \nonumber \\
& \overset{r_5}{\Rightarrow} & \textrm{NN VP} \nonumber \\
& \overset{r_1}{\Rightarrow} & \textrm{猫 VP} \nonumber \\
& \overset{r_7}{\Rightarrow} & \textrm{猫 VV VP} \nonumber \\
& \overset{r_2}{\Rightarrow} & \textrm{猫 喜欢 VP} \nonumber \\
& \overset{r_6}{\Rightarrow} & \textrm{猫 喜欢 VV NN} \nonumber \\
& \overset{r_3}{\Rightarrow} & \textrm{猫 喜欢 吃 NN} \nonumber \\
& \overset{r_4}{\Rightarrow} & \textrm{猫 喜欢 吃 鱼} \nonumber
\end{eqnarray}
}
\end{minipage}
\hfill
\begin{minipage}[t]{0.55\linewidth}
\vspace{1.0em}
\begin{center}
\begin{tikzpicture}
\begin{scope}
{\scriptsize
\node [anchor=west,inner sep=2pt] (r1) at (0,0) {$r_1$: NN $\to$};
\node [anchor=west,inner sep=2pt] (r2) at ([xshift=3em]r1.east) {$r_2$: VV $\to$ 喜欢};
\node [anchor=north west,inner sep=2pt] (r3) at ([yshift=-0.2em]r1.south west) {$r_3$: VV $\to$};
\node [anchor=north west,inner sep=2pt] (r4) at ([yshift=-0.2em]r2.south west) {$r_4$: NN $\to$};
\node [anchor=north west,inner sep=2pt] (r5) at ([yshift=-0.2em]r3.south west) {$r_5$: NP $\to$ NN};
\node [anchor=north west,inner sep=2pt] (r6) at ([yshift=-0.2em]r4.south west) {$r_6$: VP $\to$ VV NN};
\node [anchor=north west,inner sep=2pt] (r7) at ([yshift=-0.2em]r5.south west) {$r_7$: VP $\to$ VV VP};
\node [anchor=north west,inner sep=2pt] (r8) at ([yshift=-0.2em]r6.south west) {$r_8$: IP $\to$ NP VP};
\node [anchor=west,inner sep=2pt] (r1) at (0,0) {$r_1$: NN $\to$};
\node [anchor=west,inner sep=2pt] (r2) at ([xshift=3em]r1.east) {$r_2$: VV $\to$ 喜欢};
\node [anchor=north west,inner sep=2pt] (r3) at ([yshift=-0.2em]r1.south west) {$r_3$: VV $\to$};
\node [anchor=north west,inner sep=2pt] (r4) at ([yshift=-0.2em]r2.south west) {$r_4$: NN $\to$};
\node [anchor=north west,inner sep=2pt] (r5) at ([yshift=-0.2em]r3.south west) {$r_5$: NP $\to$ NN};
\node [anchor=north west,inner sep=2pt] (r6) at ([yshift=-0.2em]r4.south west) {$r_6$: VP $\to$ VV NN};
\node [anchor=north west,inner sep=2pt] (r7) at ([yshift=-0.2em]r5.south west) {$r_7$: VP $\to$ VV VP};
\node [anchor=north west,inner sep=2pt] (r8) at ([yshift=-0.2em]r6.south west) {$r_8$: IP $\to$ NP VP};
}
\end{scope}
\begin{scope}[xshift=4.5em,yshift=-5.5em,level distance=20pt,sibling distance=13pt]
\Tree[.IP \edge[white];
[.{\color{white} NP} \edge[white];
[.{\color{white} NN} \edge[white]; \node[white](sw1){}; ]
] \edge[white];
[.{\color{white} VP} \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw2){喜欢}; ] \edge[white];
[.{\color{white} VP} \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw1){}; ] \edge[white];
[.{\color{white} NN} \edge[white]; \node[white](sw1){}; ]
]
]
]
\Tree[.IP
[.NP \edge[white];
[.{\color{white} NN} \edge[white]; \node[white](sw1){}; ]
]
[.VP \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw2){喜欢}; ] \edge[white];
[.{\color{white} VP} \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw1){}; ] \edge[white];
[.{\color{white} NN} \edge[white]; \node[white](sw1){}; ]
]
]
]
\Tree[.IP
[.NP
[.NN \edge[white]; \node[white](sw1){}; ]
]
[.VP \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw2){喜欢}; ] \edge[white];
[.{\color{white} VP} \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw1){}; ] \edge[white];
[.{\color{white} NN} \edge[white]; \node[white](sw1){}; ]
]
]
]
\Tree[.IP
[.NP
[.NN \node(sw1){}; ]
]
[.VP \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw2){喜欢}; ] \edge[white];
[.{\color{white} VP} \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw1){}; ] \edge[white];
[.{\color{white} NN} \edge[white]; \node[white](sw1){}; ]
]
]
]
\Tree[.IP
[.NP
[.NN \node(sw1){}; ]
]
[.VP
[.VV \edge[white]; \node[white](sw2){喜欢}; ]
[.VP \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw1){}; ] \edge[white];
[.{\color{white} NN} \edge[white]; \node[white](sw1){}; ]
]
]
]
\Tree[.IP
[.NP
[.NN \node(sw1){}; ]
]
[.VP
[.VV \node(sw2){喜欢}; ]
[.VP \edge[white];
[.{\color{white} VV} \edge[white]; \node[white](sw1){}; ] \edge[white];
[.{\color{white} NN} \edge[white]; \node[white](sw1){}; ]
]
]
]
\Tree[.IP
[.NP
[.NN \node(sw1){}; ]
]
[.VP
[.VV \node(sw2){喜欢}; ]
[.VP
[.VV \edge[white]; \node[white](sw1){}; ]
[.NN \edge[white]; \node[white](sw1){}; ]
]
]
]
\Tree[.IP
[.NP
[.NN \node(sw1){}; ]
]
[.VP
[.VV \node(sw2){喜欢}; ]
[.VP
[.VV \node(sw1){}; ]
[.NN \node(sw1){}; ]
]
]
]
\end{scope}
\end{tikzpicture}
\end{center}
\end{minipage}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}[grow'=up,level distance=23pt]
\Tree[.\node(t1){IP};
[.\node(t2){NP}; \edge[roof]; \node(t3){$\textrm{中国}_{1}\textrm{明星}_{2}\textrm{艺术团}_{3}$}; ]
[.\node(t4){VP};
[.\node(t5){BA};\node(t9){$\textrm{}_{4}$};]
[.\node(t6){NP};\edge[roof]; \node(t10){$\textrm{}_{5}\textrm{}_{6}\textrm{精彩}_{7}\textrm{}_{8}\textrm{京剧}_{9}\textrm{歌舞}_{10}$};]
[.\node(t7){VP};
[.\node(t11){VV}; \node(t12){$\textrm{呈现}_{11}$};]
]
[.\node(t8){PP};
[.\node(t13){P}; \node(t15){$\textrm{}_{12}$};]
[.\node(t14){NP};\edge[roof]; \node(t16){$\textrm{香港}_{13}\textrm{观众}_{14}$};]
]
]
[..
]
]
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{tabular}{l c c c}
&
\begin{tikzpicture}
\begin{scope}[sibling distance=-5pt, level distance=20pt]
{\footnotesize
\Tree[.IP
[.VP
[.VP
[.NN 猫 ]
[.VV 喜欢 ]
]
[.VV 吃 ]
]
[.NP
[.NN 鱼 ]
]
]
}
\end{scope}
\end{tikzpicture}
&
\begin{tikzpicture}
\begin{scope}[sibling distance=-5pt, level distance=20pt]
{\footnotesize
\Tree[.IP
[.NP
[.NN 猫 ]
]
[.VP
[.VV 喜欢 ]
[.VP
[.VV 吃 ]
[.NN 鱼 ]
]
]
]
}
\end{scope}
\end{tikzpicture}
&
\begin{tikzpicture}
\begin{scope}[sibling distance=-5pt, level distance=20pt]
{\footnotesize
\Tree[.IP
[.NP
[.NN 猫 ]
]
[.VP
[.VP
[.VV 喜欢 ]
[.VV 吃 ]
]
[.NP
[.NN 鱼 ]
]
]
]
}
\end{scope}
\end{tikzpicture}
\\
语言学家: & 不对 && 不对 \\
我们: & 似乎对了 & 比较肯定 & 不太可能 \\
分析器: & P=0.2 & P=0.6 & P=0.1
\end{tabular}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}[sibling distance=7pt,level distance=22pt]
\Tree[.\node[inner sep=1pt](sn0){IP\scriptsize{:句子}};
[.\node[inner sep=1pt](sn1){NP\scriptsize{:名}};
[.\node[inner sep=1pt](sn2){NN\tiny{:名词}}; \node(sw1){}; ]
]
[.\node[inner sep=1pt](sn3){VP\scriptsize{:动}};
[.\node[inner sep=1pt](sn4){VV\tiny{:动词}}; \node(sw2){喜欢}; ]
[.\node[inner sep=1pt](sn5){VP\scriptsize{:动}};
[.\node[inner sep=1pt](sn6){VV\tiny{:动词}}; \node(sw1){}; ]
[.\node[inner sep=1pt](sn7){NN\tiny{:名词}}; \node(sw1){}; ]
]
]
]
\Tree[.\node[inner sep=1pt](sn0){IP\scriptsize{:句子}};
[.\node[inner sep=1pt](sn1){NP\scriptsize{:名}};
[.\node[inner sep=1pt,fill=blue!20](sn2){NN\tiny{:名词}}; \node(sw1){}; ]
]
[.\node[inner sep=1pt](sn3){VP\scriptsize{:动}};
[.\node[inner sep=1pt,fill=blue!20](sn4){VV\tiny{:动词}}; \node(sw2){喜欢}; ]
[.\node[inner sep=1pt](sn5){VP\scriptsize{:动}};
[.\node[inner sep=1pt,fill=blue!20](sn6){VV\tiny{:动词}}; \node(sw1){}; ]
[.\node[inner sep=1pt,fill=blue!20](sn7){NN\tiny{:名词}}; \node(sw1){}; ]
]
]
]
\Tree[.\node[inner sep=1pt,fill=red!20](sn0){IP\scriptsize{:句子}};
[.\node[inner sep=1pt,fill=red!20](sn1){NP\scriptsize{:名}};
[.\node[inner sep=1pt,fill=blue!20](sn2){NN\tiny{:名词}}; \node(sw1){}; ]
]
[.\node[inner sep=1pt,fill=red!20](sn3){VP\scriptsize{:动}};
[.\node[inner sep=1pt,fill=blue!20](sn4){VV\tiny{:动词}}; \node(sw2){喜欢}; ]
[.\node[inner sep=1pt](sn5){VP\scriptsize{:动}};
[.\node[inner sep=1pt,fill=blue!20](sn6){VV\tiny{:动词}}; \node(sw1){}; ]
[.\node[inner sep=1pt,fill=blue!20](sn7){NN\tiny{:名词}}; \node(sw1){}; ]
]
]
]
\Tree[.\node[inner sep=1pt,fill=red!20](sn0){IP\scriptsize{:句子}};
[.\node[inner sep=1pt,fill=red!20](sn1){NP\scriptsize{:名}};
[.\node[inner sep=1pt,fill=blue!20](sn2){NN\tiny{:名词}}; \node(sw1){}; ]
]
[.\node[inner sep=1pt,fill=red!20](sn3){VP\scriptsize{:动}};
[.\node[inner sep=1pt,fill=blue!20](sn4){VV\tiny{:动词}}; \node(sw2){喜欢}; ]
[.\node[inner sep=1pt,fill=green!20](sn5){VP\scriptsize{:动}};
[.\node[inner sep=1pt,fill=green!20](sn6){VV\tiny{:动词}}; \node(sw1){}; ]
[.\node[inner sep=1pt,fill=green!20](sn7){NN\tiny{:名词}}; \node(sw1){}; ]
]
]
]
\end{scope}
\begin{scope}[xshift=1.7in,yshift=-0.4in]
\node [,inner sep=2pt] (w1) at (0,0) {};
\node [anchor=west,inner sep=2pt] (w2) at ([xshift=0.8em,yshift=3em]w1.east) {喜欢};
\node [anchor=west,inner sep=2pt] (w3) at ([xshift=4.5em]w1.east) {};
\node [anchor=west,inner sep=2pt] (w4) at ([xshift=2em,yshift=-3em]w3.east) {};
\draw [<-,ultra thick,ublue] (w1.north east) -- (w2.south) node [pos=0.3, above, xshift=-0.5em] {\color{red}{\tiny{主谓}}};
\draw [<-,ultra thick,red] (w3.north west) -- (w2.south) node [pos=0.3, above, xshift=0.5em] {\color{red}{\tiny{连动}}};
\draw [->,ultra thick,ugreen] (w3.south east) -- (w4.north west) node [pos=0.5, above, xshift=0.5em] {\color{red}{\tiny{谓宾}}};
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
\node [] (sent) at (0,0) {\textbf{猫 喜欢 吃 鱼}};
\end{scope}
\begin{scope}[xshift=-8em,yshift=-9em,sibling distance=-5pt,level distance=17pt,grow'=up]
{\footnotesize
\Tree[.IP
[.VP
[.VP
[.NN 猫 ]
[.VV 喜欢 ]
]
[.VV 吃 ]
]
[.NP
[.NN 鱼 ]
]
]
}
\end{scope}
\begin{scope}[xshift=-1em,yshift=-9em,sibling distance=-5pt,level distance=17pt,grow'=up]
{\footnotesize
\Tree[.IP
[.NP
[.NN 猫 ]
]
[.VP
[.VV 喜欢 ]
[.VP
[.VV 吃 ]
[.NN 鱼 ]
]
]
]
}
\end{scope}
\begin{scope}[xshift=8em,yshift=-9em,sibling distance=-5pt, level distance=17pt,grow'=up]
{\footnotesize
\Tree[.IP
[.NP
[.NN 猫 ]
]
[.VP
[.VP
[.VV 喜欢 ]
[.VV 吃 ]
]
[.NP
[.NN 鱼 ]
]
]
]
}
\end{scope}
\draw [->,thick,ublue] ([xshift=-2em]sent.south) ..controls + (south:2em) and +(north:2em).. ([xshift=-8em,yshift=-2em]sent.south);
\draw [->,thick,ublue] ([xshift=-1em]sent.south) ..controls + (south:2em) and +(north:2em).. ([xshift=-2em,yshift=-3em]sent.south);
\draw [->,thick,ublue] ([xshift=0em]sent.south) ..controls + (south:2em) and +(north:2em).. ([xshift=6.5em,yshift=-2em]sent.south);
\draw [->,thick,ublue,dotted] ([xshift=1em]sent.south) ..controls + (south:1.5em) and +(north:2.5em).. ([xshift=12.5em,yshift=-2em]sent.south);
\node [anchor=north west] (others) at (11.8em,-3em) {...};
\node [] (d1) at (-9em,-10em) {$d_1$};
\node [] (d2) at (0em,-10em) {$d_2$};
\node [] (d3) at (8.5em,-10em) {$d_2$};
\node [anchor=east] (d1p) at ([xshift=0.4em]d1.west) {P(};
\node [anchor=west] (d1p2) at ([xshift=-0.4em]d1.east) {)=0.0123};
\node [anchor=east] (d2p) at ([xshift=0.4em]d2.west) {P(};
\node [anchor=west] (d2p2) at ([xshift=-0.4em]d2.east) {)=0.4031};
\node [anchor=east] (d3p) at ([xshift=0.4em]d3.west) {P(};
\node [anchor=west] (d3p2) at ([xshift=-0.4em]d3.east) {)=0.0056};
\end{tikzpicture}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{\scriptsize
\begin{scope}[level distance=10pt,xshift=1.5em,yshift=-0.5em]
{\tiny
\Tree[.\node[inner sep=1pt](t1n1){IP};
[.\node[inner sep=1pt](t1n2){VP};
[.\node[inner sep=1pt](t1n3){VV}; \node[](t1w1){}; ]
]
[.\node[inner sep=1pt](t1n4){NP};
[.\node[inner sep=1pt](t1n5){M}; 个 ]
[.\node[inner sep=1pt](t1n6){NN}; 例子 ]
]
]
}
\end{scope}
\begin{scope}[level distance=10pt,xshift=6.5em,yshift=-0.5em]
{\tiny
\Tree[.\node[inner sep=1pt](t2n1){IP};
[.\node[inner sep=1pt](t2n2){NP};
[.\node[inner sep=1pt](t2n3){PN}; 你 ]
]
[.\node[inner sep=1pt](t2n4){VP};
[.\node[inner sep=1pt](t2n5){VV}; 看到 ]
[.\node[inner sep=1pt](t2n6){AS}; \node[](t2wn){}; ]
]
]
}
\end{scope}
\node [anchor=west] (othertrees) at ([xshift=1em]t2n1.east) {...};
\node [anchor=south west] (corpuslabel) at ([xshift=-1em]t1n1.north west) {{\color{ublue} \textbf{学习用数据}}};
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow] [fit = (t1n1) (t1w1) (t2wn) (othertrees) (corpuslabel)] (corpus) {};
\end{pgfonlayer}
}
\node [anchor=west,ugreen] (P) at ([xshift=4.5em,yshift=-0.8em]corpus.east){\large{P($\cdot$)}};
\node [anchor=south] (modellabel) at (P.north) {{\color{ublue} {\scriptsize \textbf{统计分析模型}}}};
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow] [fit = (P) (modellabel)] (model) {};
\end{pgfonlayer}
\draw [->,very thick,ublue] ([xshift=0.2em]corpus.east) -- ([xshift=3.0em]corpus.east) node [pos=0.5, above] {\color{red}{\scriptsize{统计学习}}};
\draw [->,very thick,ublue] ([xshift=0.2em]model.east) -- ([xshift=3.2em]model.east) node [pos=0.5, above] {\color{red}{\scriptsize{穷举\&计算}}};
{\scriptsize
\node [anchor=north west] (sentlabel) at ([xshift=5.0em,yshift=-1em]model.north east) {{\color{ublue} {\scriptsize \textbf{统计分析模型}}}};
\node [anchor=north west] (sent) at (sentlabel.south west) {\textbf{对任意句子进行分析}};
}
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow] [fit = (sentlabel) (sent)] (parser) {};
\end{pgfonlayer}
\end{tikzpicture}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\small
\node [anchor=west,inner sep=2pt] (r1) at (0,0) {$r_1$: NN $\to$};
\node [anchor=west,inner sep=2pt] (r2) at ([xshift=6em]r1.east) {$r_2$: VV $\to$ 喜欢};
\node [anchor=north west,inner sep=2pt] (r3) at ([yshift=-0.2em]r1.south west) {$r_3$: VV $\to$};
\node [anchor=north west,inner sep=2pt] (r4) at ([yshift=-0.2em]r2.south west) {$r_4$: NN $\to$};
\node [anchor=north west,inner sep=2pt] (r5) at ([yshift=-0.2em]r3.south west) {$r_5$: NP $\to$ NN};
\node [anchor=north west,inner sep=2pt] (r6) at ([yshift=-0.2em]r4.south west) {$r_6$: VP $\to$ VV NN};
\node [anchor=north west,inner sep=2pt] (r7) at ([yshift=-0.2em]r5.south west) {$r_7$: VP $\to$ VV VP};
\node [anchor=north west,inner sep=2pt] (r8) at ([yshift=-0.2em]r6.south west) {$r_8$: IP $\to$ NP VP};
\node [anchor=west,inner sep=2pt,fill=blue!20] (r1) at (0,0) {$r_1$: NN $\to$};
\node [anchor=west,inner sep=2pt,fill=blue!20] (r2) at ([xshift=6em]r1.east) {$r_2$: VV $\to$ 喜欢};
\node [anchor=north west,inner sep=2pt,fill=blue!20] (r3) at ([yshift=-0.2em]r1.south west) {$r_3$: VV $\to$};
\node [anchor=north west,inner sep=2pt,fill=blue!20] (r4) at ([yshift=-0.2em]r2.south west) {$r_4$: NN $\to$};
\node [anchor=north west,inner sep=2pt,fill=red!20] (r5) at ([yshift=-0.2em]r3.south west) {$r_5$: NP $\to$ NN};
\node [anchor=north west,inner sep=2pt,fill=green!20] (r6) at ([yshift=-0.2em]r4.south west) {$r_6$: VP $\to$ VV NN};
\node [anchor=north west,inner sep=2pt,fill=green!20] (r7) at ([yshift=-0.2em]r5.south west) {$r_7$: VP $\to$ VV VP};
\node [anchor=north west,inner sep=2pt,fill=green!20] (r8) at ([yshift=-0.2em]r6.south west) {$r_8$: IP $\to$ NP VP};
\node [anchor=north west,fill=blue!20] (sent1) at ([yshift=-0.4em]r7.south west) {$r_1,r_2,r_3,r_4$};
\node [anchor=west] (sent1part2) at (sent1.east) {为生成单词词性的规则};
\node [anchor=north west,fill=red!20] (sent2) at ([yshift=-0.2em]sent1.south west) {$r_5$};
\node [anchor=west] (sent2part2) at (sent2.east) {为单变量规则,它将词性NN进一步抽象为名词短语NP};
\node [anchor=north west,fill=green!20] (sent3) at ([yshift=-0.2em]sent2.south west){$r_6,r_7,r_8$};
\node [anchor=west] (sent3part2) at (sent3.east) {为句法结构规则,比如$r_8$表示了主(NP)+谓(VP)结构};
\end{tikzpicture}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{minipage}[t]{0.32\linewidth}
\vspace{1.5em}
\begin{tikzpicture}
\begin{scope}[sibling distance=3pt, level distance=25pt]
{\small
\Tree[.IP
[.NP
[.NN \node(sw1){}; ]
]
[.VP
[.VV \node(sw2){喜欢}; ]
[.VP
[.VV \node(sw1){}; ]
[.NN \node(sw1){}; ]
]
]
]
}
\end{scope}
\end{tikzpicture}
\end{minipage}
\hfill
\begin{minipage}[t]{0.32\linewidth}
{\small
\begin{eqnarray}
& & \textrm{\textbf{推导1}} \nonumber \\
& & \textrm{IP} \nonumber \\
& \overset{r_8}{\Rightarrow} & \textrm{NP VP} \nonumber \\
& \overset{r_5}{\Rightarrow} & \textrm{NN VP} \nonumber \\
& \overset{r_1}{\Rightarrow} & \textrm{猫 VP} \nonumber \\
& \overset{r_7}{\Rightarrow} & \textrm{猫 VV VP} \nonumber \\
& \overset{r_2}{\Rightarrow} & \textrm{猫 喜欢 VP} \nonumber \\
& \overset{r_6}{\Rightarrow} & \textrm{猫 喜欢 VV NN} \nonumber \\
& \overset{r_3}{\Rightarrow} & \textrm{猫 喜欢 吃 NN} \nonumber \\
& \overset{r_4}{\Rightarrow} & \textrm{猫 喜欢 吃 鱼} \nonumber
\end{eqnarray}
}
\end{minipage}
\hfill
\begin{minipage}[t]{0.32\linewidth}
{\small
\begin{eqnarray}
& & \textrm{\textbf{推导2}} \nonumber \\
& & \textrm{IP} \nonumber \\
& \overset{r_8}{\Rightarrow} & \textrm{NP VP} \nonumber \\
& \overset{r_7}{\Rightarrow} & \textrm{NP VV VP} \nonumber \\
& \overset{r_2}{\Rightarrow} & \textrm{NP 喜欢 VP} \nonumber \\
& \overset{r_6}{\Rightarrow} & \textrm{NP 喜欢 VV NN} \nonumber \\
& \overset{r_4}{\Rightarrow} & \textrm{NP 喜欢 VV 鱼} \nonumber \\
& \overset{r_5}{\Rightarrow} & \textrm{NN 喜欢 VV 鱼} \nonumber \\
& \overset{r_3}{\Rightarrow} & \textrm{NN 喜欢 吃 鱼} \nonumber \\
& \overset{r_1}{\Rightarrow} & \textrm{猫 喜欢 吃 鱼} \nonumber
\end{eqnarray}
}
\end{minipage}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
\node [anchor=west] (arule) at (0,0) {\large{$u \overset{r}{\Rightarrow} v$}};
\node [anchor=west,inner sep=2pt] (u) at ([xshift=-4em,yshift=-4em]arule.west) {VV};
\node [anchor=west,inner sep=2pt,fill=orange!40] (u) at ([xshift=-4em,yshift=-4em]arule.west) {VV};
\node [anchor=west] (upart2) at (u.east) {NN};
\node [anchor=east] (unumber) at (u.west) {$u:$};
\node [anchor=west,inner sep=2pt] (r) at ([xshift=-3em,yshift=2.5em]u.west) {VV};
\node [anchor=west,inner sep=2pt,fill=orange!40] (r) at ([xshift=-3em,yshift=2.5em]u.west) {VV};
\node [anchor=west] (rpart2) at (r.east) {$\to$};
\node [anchor=west,inner sep=2pt] (rpart3) at (rpart2.east) {};
\node [anchor=east] (rnumber) at (r.west) {$r:$};
\node [anchor=west,inner sep=2pt,fill=red!20] (rpart3) at (rpart2.east) {};
\node [anchor=west] (v) at ([xshift=5.5em]u.east) {$v$:};
\node [anchor=west,inner sep=2pt,fill=red!20] (vpart2) at (v.east) {};
\node [anchor=west] (vpart3) at (vpart2.east) {NN};
\node [anchor=west] (arrow) at ([xshift=3em]u.east) {$\Rightarrow$};
\draw [<-,dotted,thick] ([xshift=0.6em]arule.south west) ..controls +(south:0.7) and +(north:0.7).. ([xshift=-1.0em]upart2.north east);
\draw [<-,dotted,thick] ([xshift=-0.6em]arule.south east) ..controls +(south:0.7) and +(north:0.7).. ([xshift=1.0em]v.north west);
\draw [<-,dotted,thick] ([xshift=-0.4em,yshift=-0.5em]arule.north) ..controls +(180:0.7) and +(50:0.7) .. ([xshift=1em]rpart2.north west);
\draw [->,dotted,thick,ublue] (r.south) ..controls +(south:0.5) and +(north:0.5).. ([yshift=0]u.north);
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
......@@ -70,9 +70,9 @@
%--随机变量和概率---------------------
\subsection{随机变量和概率}\index{Chapter2.2.1}
\parinterval 在自然界中,有这样一类具有偶然性的事件,它在一定条件下是否会发生是不确定的。例如,明天会下雨、掷一枚硬币是正面朝上、扔一个骰子的点数是5……这类可能会发生也可能不会发生,通过大量的重复试验,能发现其发生具有某种规律性的事件叫做随机事件
\parinterval 在自然界中,有这样一类具有偶然性的事件,它在一定条件下是否会发生是不确定的。例如,明天会下雨、掷一枚硬币是正面朝上、扔一个骰子的点数是5……这类可能会发生也可能不会发生,通过大量的重复试验,能发现其发生具有某种规律性的事件叫做\textbf{随机事件}
\parinterval 随机变量是对随机事件发生可能状态的描述,是随机事件的数量表征。设$\Omega= \{ \omega \}$为一个随机试验的样本空间,X=X$(\omega)$就是定义在样本空间$\omega$上的、取值为实数的单值函数,即X=X$(\omega)$为随机变量,记为X。随机变量是一种能随机选取数值的变量,常用大写的英文字母或希腊字母表示,其取值通常用小写字母来表示。例如,用$A$表示一个随机变量,用$a$表示变量$A$的一个取值。根据随机变量可以选取的值,可以将其划分为离散变量和连续变量。
\parinterval \textbf{随机变量}是对随机事件发生可能状态的描述,是随机事件的数量表征。设$\Omega= \{ \omega \}$为一个随机试验的样本空间,X=X$(\omega)$就是定义在样本空间$\omega$上的、取值为实数的单值函数,即X=X$(\omega)$为随机变量,记为X。随机变量是一种能随机选取数值的变量,常用大写的英文字母或希腊字母表示,其取值通常用小写字母来表示。例如,用$A$表示一个随机变量,用$a$表示变量$A$的一个取值。根据随机变量可以选取的值,可以将其划分为离散变量和连续变量。
\parinterval 离散变量是指在其取值区间内可以被一一列举,总数有限并且可计算的数值变量。例如,用随机变量$X$代表某次投骰子出现的点数,点数只可能取1$\sim$6这6个整数,$X$是一个离散变量。
......@@ -80,7 +80,7 @@
\parinterval 概率是度量随机事件呈现其每个可能状态的可能性的数值,本质上它是一个测度函数\cite{茆诗松2011概率论与数理统计教程}\cite{kolmogorov2018foundations}。概率的大小表征了随机事件在一次试验中发生的可能性大小。用$\textrm{P}(\cdot )$表示一个随机事件的可能性,即事件发生的概率。比如$\textrm{P}(\textrm{太阳从东方升起})$表示“太阳从东方升起的可能性”,同理,$\textrm{P}(A=B)$表示的就是“$A=B$”这件事的可能性。
\parinterval概率学中,一个很简单的获取概率的方式是利用相对频度作为概率的估计值。如果$\{x_1,x_2,\dots,x_n \}$是一个试验的样本空间,在相同情况下重复试验N次,观察到样本$x_i (1\leq{i}\leq{n})$的次数为$n_N (x_i )$,那么$x_i$在这N次试验中的相对频率是$\frac{n_N (x_i )}{N}$。当N越来越大时,相对概率也就越来越接近真实概率$\textrm{P}(x_i)$,即$\lim_{N \to \infty}\frac{n_N (x_i )}{N}=\textrm{P}(x_i)$
\parinterval实际问题中,我们往往需要得到某些概率值。但是,真实的概率值往往是无法准确知道的,这时就需要对概率进行\textbf{估计},得到的结果是概率的\textbf{估计值(estimate)}。在概率论中,一个很简单的获取概率的方式是利用相对频度作为概率的估计值。如果$\{x_1,x_2,\dots,x_n \}$是一个试验的样本空间,在相同情况下重复试验N次,观察到样本$x_i (1\leq{i}\leq{n})$的次数为$n_N (x_i )$,那么$x_i$在这N次试验中的相对频率是$\frac{n_N (x_i )}{N}$。当N越来越大时,相对概率也就越来越接近真实概率$\textrm{P}(x_i)$,即$\lim_{N \to \infty}\frac{n_N (x_i )}{N}=\textrm{P}(x_i)$。实际上,很多概率模型都等同于相对频度估计,比如,对于一个多项式分布变量的概率的极大似然估计就可以用相对频度估计实现
\parinterval 概率函数是用函数形式给出离散变量每个取值发生的概率,其实就是将变量的概率分布转化为数学表达形式。如果我们把$A$看做一个离散变量,$a$看做变量$A$的一个取值,那么$\textrm{P}(A)$被称作变量$A$的概率函数,$\textrm{P}(A=a)$被称作$A = a$的概率值,简记为$\textrm{P}(a)$。例如,在相同条件下掷一个骰子50次,用$A$表示投骰子出现的点数这个离散变量,$a_i$表示点数的取值,$\textrm{P}_i$表示$A=a_i$的概率值。下表为$A$的概率分布,给出了$A$的所有取值及其概率。
%表1--------------------------------------------------------------------
......@@ -262,7 +262,7 @@
%$\textrm{P}(L)=\textrm{P}( L| S_a )\textrm{P}(S_a )+\textrm{P}( L| S_b )\textrm{P}(S_b )+\textrm{P}( L| S_c )\textrm{P}(S_c )=\textrm{P}({S_{a}^{'}})\textrm{P}(S_a)+\textrm{P}({S_{b}^{'}})\textrm{P}(S_b)+\textrm{P}({S_{c}^{'}})\textrm{P}(S_c)=0.36$
\parinterval 贝叶斯法则(Bayes’ rule)是概率论中的一个定理,通常用于知$\textrm{P}(A \mid B)$$\textrm{P}(B \mid A)$。其内容如下:
\parinterval \textbf{贝叶斯法则(Bayes’ rule)}是概率论中的一个定理,通常用于知$\textrm{P}(A \mid B)$$\textrm{P}(B \mid A)$。其内容如下:
\parinterval$B_1,…,B_n$是S的一个划分,A为事件,则对于$i=1,…,n$,有如下公式
\begin{equation}
......@@ -309,7 +309,7 @@
\subsection{KL距离和熵}\index{Chapter2.2.5}
\subsubsection{信息熵}\index{Chapter2.2.5.1}
\subsubsection{(一)信息熵}\index{Chapter2.2.5.1}
\parinterval 熵是热力学中的一个概念,同时也是对系统无序性的一种度量标准,在机器翻译领域,最常用到的是信息熵这一概念。一条信息的信息量大小与它的不确定性有着直接的关系,如果我们需要确认一件非常不确定甚至于一无所知的事情,那么需要理解大量的相关信息才能确认清楚;同样的,如果我们对某件事已经非常确定,那么就不需要太多的信息就可以把它搞清楚。
......@@ -350,7 +350,7 @@
\parinterval 一个分布的信息熵也就是从该分布中得到的一个事件的期望信息量。比如,$a$$b$$c$$d$三支球队,三支队伍夺冠的概率分别是$P1$$P2$$P3$$P4$,某个人对比赛不感兴趣但是又想知道哪只球队夺冠,通过使用二分法2次就确定哪支球队夺冠了。但其实,我们知道这四只球队中c的实力比较强劲,那么猜1次就可以确定。所以对于前者,哪只球队夺冠的信息量较高,信息熵也相对较高,对于后者信息量和信息熵也就相对较低。因此我们可以得知:较为尖锐的分布具有较低的熵;分布越接近均匀熵越大。
\subsubsection{KL距离}\index{Chapter2.2.5.2}
\subsubsection{(二)KL距离}\index{Chapter2.2.5.2}
\parinterval 如果在相同的随机变量$X$上有两个独立的概率分布P$(x)$和Q$(x)$,那么我们可以使用KL距离("Kullback-Leibler" 散度)来衡量这两个分布的不同,也就是大家所说的相对熵,其公式如下:
\begin{equation}
......@@ -368,7 +368,7 @@
\end{itemize}
\vspace{0.5em}
\subsubsection{交叉熵}\index{Chapter2.2.5.3}
\subsubsection{(三)交叉熵}\index{Chapter2.2.5.3}
\parinterval 交叉熵是一个与KL距离密切相关的概念,它的公式是:
\begin{equation}
......@@ -944,5 +944,321 @@ c_{KN}(\cdot) & \begin{cases} count(\cdot)\quad for\ the\ highest\ order \\ con
\parinterval 我们前面提到Kneser-Ney Smoothing 是当前一个标准的、广泛采用的、先进的平滑算法。还有很多基于此为基础衍生出来的算法,有兴趣的读者可以查找更多资料了解。\cite{parsing2009speech}\cite{ney1994structuring}\cite{chen1999empirical}
\parinterval
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{句法分析(短语结构)}\index{Chapter2.5}
\parinterval 通过前面两节的内容,我们已经了解什么叫做“词”、如何对分词问题进行统计建模。同时也了解了如何对词序列的概率用统计语言模型进行描述。无论是分词还是语言模型都是句子浅层词串信息的一种表示。对于一个自然语言句子来说,它更深层次的结构信息可以通过句法信息来描述,而句法信息也是机器翻译和自然语言处理其它任务中常用的知识源之一。本节将会对相关概念进行介绍。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{句子的句法树表示}\index{Chapter2.5.1}
\parinterval \textbf{句法(syntax)}是研究句子的每个组成部分和它们之间的组合方式。一般来说,句法和语言是相关的,比如,英文是主谓宾结构,而日语是主宾谓结构。因此不同的语言也会有不同的句法描述方式。这里我们将介绍自然语言处理领域最常用的两种句法分析形式 – \textbf{短语结构分析(phrase structure parsing)}\textbf{依存分析(dependency parsing)}。它们在汉语、英语等多种语言的处理中都有广泛应用。
\parinterval\ref{fig:phrase-structure-tree-and-dependency-tree}展示了这两种的句法表示形式的实例。其中,左侧是短语结构树。它描述的是短语的结构功能,比如“吃”是动词(记为VV),“鱼”是名词(记为NN),“吃鱼”组成动词短语,这个短语再与“喜欢”这一动词组成新的动词短语。每个子树都是一个句法功能单元,比如,VP(VV(吃) NN(鱼))这个子树就表示了“吃鱼”这个动词短语的结构,其中子树根节点VP是句法功能标记。短语结构树利用嵌套和递归的方式描述了语言学的功能。短语结构树中,每个词都有词性(或词类),不同的词或者短语可以组成名动结构、动宾结构等语言学短语结构。短语结构分析一般也被称为成分分析(constituency parsing),也被称作完全分析(full parsing)。
%----------------------------------------------
% 图2.5.1.1
\begin{figure}[htp]
\centering
\includegraphics{./Chapter2/Figures/phrase-structure-tree-and-dependency-tree.pdf}
\caption{短语结构树(左)和依存树(右)}
\label{fig:phrase-structure-tree-and-dependency-tree}
\end{figure}
%---------------------------
\parinterval\ref{fig:phrase-structure-tree-and-dependency-tree}右侧展示的是另一种句法结构,被称作依存句法树。依存句法树表示了句子中单词和单词之间的依存关系。比如,从这个例子可以了解,“猫”依赖“喜欢”,“吃”依赖“喜欢”,“鱼”依赖“吃”。
\parinterval 短语结构树和依存句法树的结构和功能都有所不同。短语结构树的叶子节点是单词,中间节点是词性或者短语句法标记。在短语结构分析中,通常把单词称作终结符(terminal),把词性称为预终结符(pre-terminal),而把其它句法标记称为非终结符(non-terminal)。依存句法树没有预终结符和非终结符,所有的节点都是句子里的单词,通过不同节点间的连线表示句子中各个单词之间的依存关系。每个依存关系实际上都是有方向的,头和尾分别指向“接受”和“发出”依存关系的词。每个依存关系也可以进行分类,如图\ref{fig:phrase-structure-tree-and-dependency-tree}所示,每个依存关系都的类型都进行了标记,这也被称作有标记的依存分析。如果不生成这些标记,这样的句法分析被称作无标记的依存分析。
\parinterval 虽然短语结构树和依存树是两种不同的句法表现形式,但是它们在某种条件下能相互转化。比如,可以使用启发性规则将短语结构树自动转化为依存树。从应用的角度,依存分析由于形式更加简单,而且直接建模词语之间的依赖,因此在最近自然语言处理领域中关注较多。在机器翻译中,不过无论是哪种句法树结构,都已经被证明会对机器翻译系统产生正面效果。特别是短语结构树,在机器翻译中的应用历史更长,研究更加深入,因此本节将会里短语结构分析为例介绍相关概念。
\parinterval 而句法分析到底是什么呢?简单的理解,句法分析就是我们在小学语文课程中学习的句子中的主谓宾等句子成分的分析,以及对句子中各个成分内部、外部关系的判断。更规范一些的定义,可以参照维基百科和百度百科的句法分析的解释。
%-------------------------------------------
\begin{definition}
《百度百科》
句法分析(Parsing)就是指对句子中的词语语法功能进行分析。
\end{definition}
%-------------------------------------------
%-------------------------------------------
\begin{definition}
《维基百科(译文)》
在自然语言或者计算机语言中,句法分析是利用形式化的文法规则对一个符号串进行分析的过程。
\end{definition}
%-------------------------------------------
\parinterval 上面的定义中,句法分析包含三个重要的概念:
\vspace{0.5em}
\begin{itemize}
\item 形式化的文法:描述语言结构的定义,由文法规则组成
\item 符号串:在本节中,符号串就是指词串,由前面提到的分词系统生成
\item 分析:使用形式文法对符号串进行分析的具体方法,在这里指实现分析的计算机算法
\end{itemize}
\vspace{0.5em}
\parinterval 以上要素在实现一个句法分析器中都需要考虑。因此,本节的后半部分会对相关的概念和技术方法进行介绍
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{上下文无关文法}\index{Chapter2.5.2}
\parinterval 句法树是对句子的一种抽象。这种树形结构对应着句子的归纳和生成过程,比如,从树的叶子开始,把每一个树节点看作一次抽象,最终形成整个句子的根节点。那么生成这种句法树结构的过程是如何用计算机实现出来呢?这就需要使用形式文法。
\parinterval 形式文法是句法分析中的核心内容,它不仅可以帮助我们分析计算机编程语言,也可以帮我们分析自然语言。根据乔姆斯基的定义\cite{chomsky2002syntactic},形式文法分为四种类型:无限制文法、上下文相关文法、上下文无关文法和正规文法。不同类型的文法有不同的应用,比如,正规文法可以用来描述自动机,因此也会被使用在语言模型等系统中\footnote[2]{\red $n$-gram语言模型也可以被看作是一种有限状态自动机,不同于传统的自动机,语言模型使用的是概率化自动机,也就是自动机中的每条边都会有一个概率与之对应。具体内容可以参考(参考文献??)。} 。对于句法分析问题,这里使用上下文无关文法(context-free grammar),因为它是很多句法分析模型的基础。上下文无关文法的具体形式如下:
%-------------------------------------------
\begin{definition}
一个上下文无关文法可以被视为一个系统$G=<N,\Sigma,R,S>$,其中
\begin{itemize}
\item
\item $N$为一个非终结符集合
\item $\Sigma$为一个终结符集合
\item $R$为一个规则(产生式)集合,每条规则 $r \in R$的形式为$X \to Y_1Y_2...Y_n$,其中$X \in N$, $Y_i \in N \cup \Sigma$
\item $S$为一个起始符号集合且$S \subseteq N$
\end{itemize}
\end{definition}
%-------------------------------------------
\parinterval 举例说明,假设有上下文无关文法$G=<N,\Sigma,R,S>$,其中把非终结符集合定义为不同的句法标记
\begin{equation}
\textrm{N}=\{\textrm{NN},\textrm{VV},\textrm{NP},\textrm{VP},\textrm{IP}\}
\end{equation}
这里,\textrm{NN}代表名词,\textrm{VV}代表动词,\textrm{NP}代表名词短语,\textrm{VP}代表动词短语,\textrm{IP}代表单句。进一步,把终结符集合定义为
\begin{equation}
\Sigma = \{\text{猫,喜欢,吃,鱼}\}
\end{equation}
再定义起始符集合为
\begin{equation}
\textrm{S}=\{\textrm{IP}\}
\end{equation}
最后,文法的规则集定义如下(其中$r_i$为规则的编号)
%----------------------------------------------
% 图2.5.2.1
\begin{figure}[htp]
\centering
\includegraphics{./Chapter2/Figures/rules-of-grammar.pdf}
\caption{还没有写}
\label{fig:2.5.2.1}
\end{figure}
%---------------------------
\parinterval 上面这个文法蕴含了不同“层次”的句法信息。比如,规则$r_1$$r_2$$r_3$$r_4$表达了词性对单词的抽象;规则$r_6$$r_7$$r_8$是表达了短语结构的抽象,其中,规则$r_8$表达了$\textrm{NP}+\textrm{VP}$描述了汉语中名词短语(主语)+动词短语(谓语)的结构。在实际应用中,像$r_8$这样的规则可以覆盖很大的片段(试想一下一个包含50个词的主谓结构的句子,都可以使用进行$r_8$描述)。
\parinterval 下文无关文法的规则是一种\textbf{产生式规则(production rule)},形如$\alpha \to \beta $,它表示把规则左端的非终结符$\alpha$替换为规则右端的符号序列$\beta$。通常,$\alpha$被称作规则的左部(left-hand side),$\beta$被称作规则的右部(right-hand side)。使用右边$\beta$替换左部$\alpha$的过程也被称作规则的使用,而这个过程的逆过程称为规约。规则的使用可以如下定义:
%-------------------------------------------
\begin{definition}
一个符号序列$u$可以通过使用规则$r$替换其中的某个非终结符,并得到符号序列$v$,我们说$v$是在$u$上使用$r$的结果,如图\ref{fig:2.5.2.2}所示:
\end{definition}
%-------------------------------------------
\begin{figure}[htp]
\centering
\includegraphics{./Chapter2/Figures/usage-of-regulation.pdf}
\caption{规则的使用示意图}
\label{fig:2.5.2.2}
\end{figure}
\parinterval 给定义起始非终结符,我们可以不断地使用规则,最终生成一个终结符串,这个过程也被称为推导(derivation)。
%-------------------------------------------
\begin{definition}
给定一个文法$G=<N,\Sigma,R,S>$,对于一个字符串序 \\
$s_0,s_1,...,s_n$和规则序列$r_1,r_2,...,r_n$,满足
\vspace{-0.5em}
\begin{displaymath}
s_0 \overset{r_1}{\Rightarrow} s_1 \overset{r_2}{\Rightarrow} s_2 \overset{r_3}{\Rightarrow} ... \overset{r_{n}}{\Rightarrow} s_n
\end{displaymath}
\begin{itemize}
\item
\item $\forall i \in [0,n], s_i \in (N\cup\Sigma)^*$ \hspace{3.5em} $\lhd$ $s_i$为合法的字符串
\item $\forall j \in [1,n], r_j \in R$ \hspace{6.3em} $\lhd$ $r_j$为G的规则
\item $s_0 \in S$ \hspace{10.9em} $\lhd$ $s_0$为起始非终结符
\item $s_n \in \Sigma^{*}$ \hspace{10.4em} $\lhd$ $s_n$为终结符序列
\end{itemize}
$s_0 \overset{r_1}{\Rightarrow} s_1 \overset{r_2}{\Rightarrow} s_2 \overset{r_3}{\Rightarrow} ... \overset{r_{n}}{\Rightarrow} s_n$为一个推导(derivation)
\end{definition}
%-------------------------------------------
\parinterval 比如,使用前面的示例文法,可以对“猫 喜欢 吃 鱼”进行分析,并形成句法分析树(图\ref{fig:2.5.2.3})。我们从起始非终结符IP开始,利用唯一拥有IP在左部的规则$r_8$推导出NP和VP,之后依次使用规则$r_5$$r_1$$r_7$$r_2$$r_6$$r_3$$r_4$,得到了完整的句法树。
%-------------------------------------------
% 图2.5.2.3
\begin{figure}[htp]
\centering
\includegraphics{./Chapter2/Figures/example-of-derivation.pdf}
\caption{上下文无关文法推导实例}
\label{fig:2.5.2.3}
\end{figure}
%-------------------------------------------
\parinterval 通常,可以把推导简记为$\textrm{d}=r_1,r_2,…,r_n$,其中$$表示规则的组合。显然,$\textrm{d}$也对应了树形结构,也就是句法分析结果。从这个角度看,推导就是描述句法分析树的一种方式。此外,规则的推导也把规则的使用和生成的字符串对应起来。一个推导所生成的字符串,也被称作文法的一个句子。而一个文法所能生成的所有句子是这个文法所对应的语言。
\parinterval 但是,句子和规则的推导并不是一一对应的。同一个句子,往往有很多推导与之对应,我们称为歧义。甚至同一棵句法树,也可以对应不同的推导。图\ref{fig:2.5.2.4}给出一个同一棵句法树所对应的两种不同的规则推导。
%-------------------------------------------
%图2.5.2.4
\begin{figure}[htp]
\centering
\includegraphics{./Chapter2/Figures/two-different-derivation-of-regulation.pdf}
\caption{同一棵句法树对应的不同规则推导}
\label{fig:2.5.2.4}
\end{figure}
%-------------------------------------------
\parinterval 显然,这样使用不同的规则顺序进行树的生成会导致句法树的推导这一确定的过程变得不确定。因此,需要进行消歧。这里,我们可以使用启发式方法:要求规则使用都服从最左优先原则,这样得到的推导被称为最左优先推导。图中推导1就是符合最左优先原则的推导。
\parinterval 这样,对于一个上下文无关文法,每一棵句法树都有唯一的最左推导与之对应。这样,句法分析可以被描述为:对于一个句子找到能够生成它的最佳推导,这个推导所对应的句法树就是这个句子的句法分析结果。
\parinterval 不过问题又回来了,怎样才能知道什么样的推导或者句法树是“最佳”的呢?对于句法分析的语言学专来说,可以很确定的分辨出哪些树是正确的哪些树是错误的结果。甚至对于普通人,也通过经验可以得到一些模糊的结果。而计算机如何进行判别呢?沿着前面介绍的统计建模的思想,计算机可以得出不同句法树出现的概率,进而选择概率最高的句法树作为输出,而这正是统计句法分析所做的事情。%-------------------------------------------
%图2.5.2.5
\begin{figure}[htp]
\centering
\includegraphics{./Chapter2/Figures/perspectives-of-expert-ordinary-and-syntactic-parser.pdf}
\caption{如何选择最佳的句法分析结果 - 专家、普通人和句法分析器的视角}
\label{fig:2.5.2.5}
\end{figure}
%-------------------------------------------
\parinterval 在统计句法分析中,我们需要对每个推导进行统计建模,于是我们得到一个模型$\textrm{P}( \cdot )$,对于任意的推导$d$,都可以用$\textrm{P}(d)$计算推导$d$的概率。这样,给定一个输入句子,我们可以对所有可能的推导用$\textrm{P}(d)$计算其概率值,并选择概率最大的结果作为句法分析的结果输出(图\ref{fig:2.5.2.6})。
%-------------------------------------------
%图2.5.2.6
\begin{figure}[htp]
\centering
\includegraphics{./Chapter2/Figures/probability-values-corresponding-to-different-derivations.pdf}
\caption{不同推导(句法树)对应的概率值}
\label{fig:2.5.2.6}
\end{figure}
%-------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{规则和推导的概率}\index{Chapter2.5.3}
\parinterval 对句法树进行概率化,首先要对使用的规则和推导进行概率化。为了达到这个目的,可以使用概率上下文无关文法(probabilistic context-free grammar),它是上下文无关文法的扩展。
%-------------------------------------------
\begin{definition} 概率上下文无关文法
一个上下文无关文法可以被视为一个系统$G=<N,\Sigma,R,S>$,其中
\begin{itemize}
\item
\item $N$为一个非终结符集合
\item $\Sigma$为一个终结符集合
\item $R$为一个规则(产生式)集合,每条规则 $r \in R$的形式为$X \to Y_1Y_2...Y_n$,其中$X \in N$, $Y_i \in N \cup \Sigma$
\item $S$为一个起始符号集合且$S \subseteq N$
\end{itemize}
\end{definition}
%-------------------------------------------
\parinterval 概率上下文无关文法与传统上下文无关文法的区别在于,每条规则都会有一个概率,描述规则生成的可能性。具体来说,规则$\textrm{P}(\alpha \to \beta)$的概率可以被定义为:
\begin{equation}
\textrm{P}(\alpha \to \beta)=\textrm{P}(\beta | \alpha)
\label{eq:2.5.3.1}
\end{equation}
即,在给定规则左部的情况下生成规则右部的可能性。进一步,在上下文无关文法中,因为上下文无关的属性,每条规则之间的使用都是相互独立的 \footnote[3]{如果是上下文有关文法,规则会形如 $\textrm{a}\alpha \textrm{b}\to \textrm{a}\beta \textrm{b}$,这时$\alpha \to \beta $的过程会依赖前后上下文\textrm{a}\textrm{b}}。因此可以把\textrm{P(d)}分解为规则概率的乘积进行计算:
\begin{equation}
\begin{aligned}
\textrm{P}(d) & = \textrm{P}(r_1∘r_2∘…∘r_n) \\
& = \textrm{P}(r_1) \cdot \textrm{P}(r_2) \cdots \textrm{P}(r_n)
\label{eq:2.5.3.1}
\end{aligned}
\end{equation}
\parinterval 这样我们就可以得到每个推导d的概率值。这个模型,可以很好的解释词串的生成过程。比如,对于规则集
\begin{equation} \nonumber
\begin{aligned}
r_3: & VV \to \text{} \\
r_4: & NN \to \text{} \\
r_6: & VP \to VV NN
\end{aligned}
\end{equation}
\parinterval 可以得到 $d_1=r_3 \cdot r_4 \cdot r_6$的概率为
\begin{equation}
\begin{aligned}
\textrm{P}(d_1) & = \textrm{P}(r_3) \cdot \textrm{P}(r_4) \cdot \textrm{P}(r_6) \\
& = \textrm{P}(VV \to \text{}) \cdot \textrm{P}(NN \to \text{}) \cdots \textrm{P}(VP \to VV NN)
\label{eq:2.5.3.2}
\end{aligned}
\end{equation}
\parinterval 这也对应了词串“吃 鱼”的生成过程。首先,从起始VP使用规则$r_6$生成两个非终结符VV和NN;进一步,分别使用规则$r_3$$r_4$从VV和NN进一步生成单词“吃”和“鱼”。整个过程的概率等于三条规则概率的乘积。
\parinterval 新的问题又来了,如何得到规则的概率呢?这里仍然可以使用数据驱动的想法,从数据中学习文法规则的概率。假设我们有人工标注的数据,其中包括很多句子的人工标注的句法树,称之为树库。然后,对于规则$\textrm{r}:\alpha \to \beta$可以使用极大似然估计:
\begin{equation}
\textrm{P}(r) = \frac{\text{规则$r$在树库中出现的次数}}{\alpha \text{在树库中出现的次数}}
\label{eq:2.5.3.3}
\end{equation}
\parinterval 这里通过一个例子来解释规则概率的计算过程(图\ref{fig:2.5.3.1})。
%-------------------------------------------
% 图2.5.3.1
\begin{figure}[htp]
\centering
\includegraphics{./Chapter2/Figures/evaluation-of-probability-for-grammar.pdf}
\caption{上下文无关文法规则概率估计}
\label{fig:2.5.3.1}
\end{figure}
%-------------------------------------------
\parinterval 与词法分析类似,我们统计树库中规则左部和右部同时出现的次数,除以规则左部出现的全部次数,所得的结果就是所求规则的概率。这种方法也是典型的相对频度估计。但是如果规则左部和右部同时出现的次数为0时是否代表这个规则概率是0呢?遇到这种情况,可以使用平滑方法对概率进行平滑处理,具体思路和2.4.2节基本上是一样的。
\parinterval\ref{fig:2.5.3.2}展示了基于统计句法分析的流程。首先,通过对人工标注数据的统计,获得各个规则的概率,这样我们得到了一个上下文无关句法分析模型$\textrm{P}( \cdot )$,对于任意句法分析结果$\textrm{d}=r_1 \cdot r_2 \cdot\cdot r_n$,都能通过$\textrm{P}(\textrm{d})= \prod_{i=1}^{n}\textrm{p}(r_i)$计算其概率值。
%-------------------------------------------
% 图2.5.3.2
\begin{figure}[htp]
\centering
\includegraphics{./Chapter2/Figures/process-of-statistical-syntax-analysis.pdf}
\caption{统计句法分析的流程}
\label{fig:2.5.3.2}
\end{figure}
%-------------------------------------------
\parinterval 在获取统计分析模型后,就可以使用模型对任意句子进行分析,计算每个句法分析树的概率,并输出概率最高的树作为句法分析的结果。图\ref{fig:2.5.3.3}给出了几个真实句法分析器的输入输出实例。
%-------------------------------------------
% 图2.5.3.3
%\begin{figure}[htp]
% \centering
%\includegraphics{./Chapter2/Figures/.pdf}
% \caption{中文句法分析实例}
% \label{fig:2.5.3.3}
%\end{figure}
%-------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{小结及深入阅读}\index{Chapter2.6}
\parinterval 在本章中,我们重点介绍了如何对自然语言处理问题进行统计建模,并从数据中自动学习统计模型的参数,最终使用学习到的模型对新输入的问题进行处理。之后,我们将这种思想应用到三个自然语言处理任务,包括:中文分词、语言建模、句法分析,这三个任务也和机器翻译有着紧密的联系。从中可以看出,经过适当的假设和化简,统计模型可以很好的描述复杂的自然语言处理问题。相关概念和方法都会在后续章节的机器翻译内容中被频繁使用。
\parinterval 由于本章重点关注介绍如何用统计的思想对自然语言处理任务进行建模,因此并没有对具体的问题展开深入讨论。有几方面内容,读者可以继续关注:
\begin{adjustwidth}{1em}{}
\begin{itemize}
\item 在建模方面,本章介绍的三个任务均采用的是基于人工先验知识进行模型设计的思路。也就是,问题所表达的现象被“一步一步”生成出来。这是一种典型的生成式建模思想,它把要解决的问题看作一些观测结果的隐含变量(比如,句子是观测结果,分词是隐含变量),之后通过对观测变量生成观测结果的过程建模,以达到对问题进行数学描述的目的。这类模型一般需要进行一些独立性假设,假设的好坏对最终的性能有较大影响。相对\textbf{生成模型}(generative models),另一类方法\textbf{判别模型}(discriminative models),它直接对问题进行求解,可以更加灵活的定义不同的特征,而且不依赖过多的独立性假设。判别式模型在自然语言处理中也有广泛应用\cite{shannon1948mathematical}\cite{ng2002discriminative}。在本书的第四章也会使用到判别式模型。
\item 从现在自然语言处理的前沿看,基于端到端学习的深度学习方法在很多任务中都取得了领先的性能。但是,深度学习及相关方法并没有在本章被涉及,这是由于笔者认为对问题的建模是处理自然语言处理问题的基础,对问题的描述并不会因为方法的改变而改变。因此,本章的内容没有太多的陷入到更加复杂的模型和算法设计中,相反,我们希望关注对基本问题的理解和描述。不过,对于本章中涉及的自然语言问题,一些前沿方法可以参考,包括:基于条件随机场和双向长短时记忆模型的序列标注模型(\cite{lafferty2001conditional}\cite{huang2015bidirectional}\cite{ma2016end}、神经语言模型\cite{bengio2003neural}\cite{mikolov2010recurrent}、神经句法分析模型\cite{chen2014fast}\cite{zhu2015long}
\item 此外,本章并没有对模型的推断方法进行深入介绍。比如,对于一个句子如何有效的找到概率最大的分词结果?显然简单枚举是不可行的。对于这类问题比较简单的解决方法是使用动态规划\cite{huang2008advanced}。如果使用动态规划的条件不满足,可以考虑使用更加复杂的搜索策略,并配合一定剪枝方法。实际上,无论是n-gram语言模型还是简单的上下文无关文法都有高效的推断方法。比如,n-gram语言模型可以被视为概率有限状态自动机,因此可以直接使用成熟的自动机工具。即使更复杂的句法分析模型也有移进-规约方法可以有效的解决推断问题\cite{aho1972theory}
\end{itemize}
\end{adjustwidth}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=3em] (eq1) at (0,0) {$f(s_u|t_v)$};
\node [anchor=west,inner sep=2pt] (eq2) at ([xshift=-2pt]eq1.east) {$=$};
\node [anchor=west,inner sep=2pt] (eq3) at ([xshift=-2pt]eq2.east) {$\lambda_{t_v}^{-1}$};
\node [anchor=west,inner sep=2pt] (eq4) at ([xshift=-2pt]eq3.east) {$\frac{\epsilon}{(l+1)^{m}}$};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=3em] (eq5) at ([xshift=-2pt]eq4.east) {\footnotesize{$\prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$}};
\node [anchor=west,inner sep=2pt] (eq6) at ([xshift=-2pt]eq5.east) {\footnotesize{$\sum\limits_{j=1}^{m} \delta(s_j,s_u) \sum\limits_{i=0}^{l} \delta(t_i,t_v)$}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=3em] (eq7) at ([xshift=-2pt,yshift=-0pt]eq6.east) {$\frac{f(s_u|t_v)}{\sum_{i=0}^{l}f(s_u|t_i)}$};
\node [anchor=south west,inner sep=2pt] (label1) at ([yshift=1em]eq1.north west) {\footnotesize{\textbf{新的参数值}}};
\node [anchor=south east,inner sep=2pt] (label2) at ([yshift=1em,xshift=-5em]eq7.north east) {\footnotesize{\textbf{旧的参数值}}};
\draw [<-,thick] (label1.south) .. controls +(south:1em) and +(north:1em) .. ([xshift=-1em]eq1.north);
\draw [<-,thick] (label2.south) .. controls +(300:1em) and +(north:1em) .. ([xshift=1em]eq7.north);
\draw [<-,thick] ([xshift=-0.5em]label2.south) .. controls +(240:1em) and +(north:1em) .. ([xshift=1em]eq5.north);
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=west,inner sep=2pt,minimum height=2em] (eq1) at (0,0) {$f(s_u|t_v)$};
\node [anchor=west,inner sep=2pt] (eq2) at ([xshift=-2pt]eq1.east) {$=$};
\node [anchor=west,inner sep=2pt,minimum height=2em] (eq3) at ([xshift=-2pt]eq2.east) {$\lambda_{t_v}^{-1}$};
\node [anchor=west,inner sep=2pt,minimum height=3.0em] (eq4) at ([xshift=-3pt]eq3.east) {\footnotesize{$\frac{\epsilon}{(l+1)^{m}} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$}};
\node [anchor=west,inner sep=2pt,minimum height=3.0em] (eq5) at ([xshift=1pt]eq4.east) {\footnotesize{$\sum\limits_{j=1}^{m} \delta(s_j,s_u) \sum\limits_{i=0}^{l} \delta(t_i,t_v)$}};
\node [anchor=west,inner sep=2pt,minimum height=3.0em] (eq6) at ([xshift=1pt]eq5.east) {$\frac{f(s_u|t_v)}{\sum_{i=0}^{l}f(s_u|t_i)}$};
{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=3.0em] (eq4) at ([xshift=-3pt]eq3.east) {\footnotesize{$\frac{\epsilon}{(l+1)^{m}} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$}};
}
{
\node [anchor=west,inner sep=2pt,fill=blue!20,minimum height=3.0em] (eq5) at ([xshift=1pt]eq4.east) {\footnotesize{$\sum\limits_{j=1}^{m} \delta(s_j,s_u) \sum\limits_{i=0}^{l} \delta(t_i,t_v)$}};
}
{
\node [anchor=west,inner sep=2pt,fill=green!20,minimum height=3.0em] (eq6) at ([xshift=1pt]eq5.east) {$\frac{f(s_u|t_v)}{\sum_{i=0}^{l}f(s_u|t_i)}$};
}
{
\node [anchor=south west,inner sep=2pt] (label1) at (eq4.north west) {\textbf{\scriptsize{翻译概率$\textrm{P}(s|t)$}}};
}
{
\node [anchor=south west,inner sep=2pt] (label2) at (eq5.north west) {\textbf{\scriptsize{配对的总次数}}};
\node [anchor=south west,inner sep=2pt] (label2part2) at ([yshift=-3pt]label2.north west) {\textbf{\scriptsize{$(s_u,t_v)$在句对$(s,t)$}}};
}
{
\node [anchor=south west,inner sep=2pt] (label3) at (eq6.north west) {\textbf{\scriptsize{有的$t_i$的相对值}}};
\node [anchor=south west,inner sep=2pt] (label4) at ([yshift=-3pt]label3.north west) {\textbf{\scriptsize{$f(s_u|t_v)$对于所}}};
}
{
\node [anchor=east,rotate=90] (neweq1) at ([yshift=-0em]eq4.south) {=};
\node [anchor=north,inner sep=1pt] (neweq1full) at (neweq1.west) {\large{$\textrm{P}(s|t)$}};
}
{
\draw[decorate,thick,decoration={brace,amplitude=5pt,mirror}] ([yshift=-0.2em]eq5.south west) -- ([yshift=-0.2em]eq6.south east) node [pos=0.4,below,xshift=-0.0em,yshift=-0.3em] (expcount1) {\footnotesize{\textbf{'$t_v$翻译为$s_u$'这个事件}}};
\node [anchor=north west] (expcount2) at ([yshift=0.5em]expcount1.south west) {\footnotesize{\textbf{出现次数的期望的估计}}};
\node [anchor=north west] (expcount3) at ([yshift=0.5em]expcount2.south west) {\footnotesize{\textbf{称之为期望频次expected count}}};
}
\end{tikzpicture}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=west,inner sep=2pt] (eq1) at (0,0) {$f(s_u|t_v)$};
\node [anchor=west] (eq2) at (eq1.east) {$=$\ };
\draw [-] ([xshift=0.3em]eq2.east) -- ([xshift=11.6em]eq2.east);
\node [anchor=south west] (eq3) at ([xshift=1em]eq2.east) {$\sum_{i=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})$};
\node [anchor=north west] (eq4) at (eq2.east) {$\sum_{s_u} \sum_{i=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})$};
{
\node [anchor=south] (label1) at ([yshift=-6em,xshift=3em]eq1.north west) {利用这个公式计算};
\node [anchor=north west] (label1part2) at ([yshift=0.3em]label1.south west) {新的$f(s_u|t_v)$};
}
{
\node [anchor=west] (label2) at ([xshift=5em]label1.east) {用当前的$f(s_u|t_v)$};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {计算期望频次$c_{\mathbb{E}}(\cdot)$};
}
{
\node [anchor=west,fill=red!20,inner sep=2pt] (eq1) at (0,0) {$f(s_u|t_v)$};
}
\begin{pgfonlayer}{background}
{
\node[rectangle,fill=blue!20,inner sep=0] [fit = (eq3) (eq4)] (c) {};
}
{
\node[rectangle,draw,red,inner sep=0] [fit = (label1) (label1part2)] (flabel) {};
}
{
\node[rectangle,draw,ublue,inner sep=0] [fit = (label2) (label2part2)] (clabel) {};
}
\end{pgfonlayer}
{
\draw [->,thick] (eq1.south) ..controls +(south:1.5em) and +(north:1.5em).. (flabel.north);
}
{
\draw [->,thick] (c.south) ..controls +(south:1.0em) and +(north:1.0em).. (clabel.north);
}
{
\draw [->,thick] ([yshift=1em]flabel.east) -- ([yshift=1em]clabel.west);
\draw [<-,thick] ([yshift=-1em]flabel.east) -- ([yshift=-1em]clabel.west) node [pos=0.5,above,yshift=0.3em] {\footnotesize{\textbf{反复执行}}};
}
\end{tikzpicture}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=north west] (line1) at (0,0) {\textbf{IBM模型1的训练(EM算法)}};
\node [anchor=north west] (line2) at ([yshift=-0.3em]line1.south west) {输入: 平行语料${(s^{[1]},t^{[1]}),...,(s^{[N]},t^{[N]})}$};
\node [anchor=north west] (line3) at ([yshift=-0.1em]line2.south west) {输出: 参数$f(\cdot|\cdot)$的最优值};
\node [anchor=north west] (line4) at ([yshift=-0.1em]line3.south west) {1: \textbf{Function} \textsc{TrainItWithEM}($\{(s^{[1]},t^{[1]}),...,(s^{[N]},t^{[N]})\}$) };
\node [anchor=north west] (line5) at ([yshift=-0.1em]line4.south west) {2: \ \ Initialize $f(\cdot|\cdot)$ \hspace{5em} $\rhd$ 比如给$f(\cdot|\cdot)$一个均匀分布};
\node [anchor=north west] (line6) at ([yshift=-0.1em]line5.south west) {3: \ \ Loop until $f(\cdot|\cdot)$ converges};
\node [anchor=north west] (line7) at ([yshift=-0.1em]line6.south west) {4: \ \ \ \ \textbf{foreach} $k = 1$ to $N$ \textbf{do}};
\node [anchor=north west] (line8) at ([yshift=-0.1em]line7.south west) {5: \ \ \ \ \ \ \ \footnotesize{$c_{\mathbb{E}}(s_u|t_v;s^{[k]},t^{[k]}) = \sum\limits_{j=1}^{|s^{[k]}|} \delta(s_j,s_u) \sum\limits_{i=0}^{|t^{[k]}|} \delta(t_i,t_v) \cdot \frac{f(s_u|t_v)}{\sum_{i=0}^{l}f(s_u|t_i)}$}\normalsize{}};
\node [anchor=north west] (line9) at ([yshift=-0.1em]line8.south west) {6: \ \ \ \ \textbf{foreach} $t_v$ appears at least one of $\{t^{[1]},...,t^{[N]}\}$ \textbf{do}};
\node [anchor=north west] (line10) at ([yshift=-0.1em]line9.south west) {7: \ \ \ \ \ \ \ $\lambda_{t_v}^{'} = \sum_{s_u} \sum_{k=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[k]},t^{[k]})$};
\node [anchor=north west] (line11) at ([yshift=-0.1em]line10.south west) {8: \ \ \ \ \ \ \ \textbf{foreach} $s_u$ appears at least one of $\{s^{[1]},...,s^{[N]}\}$ \textbf{do}};
\node [anchor=north west] (line12) at ([yshift=-0.1em]line11.south west) {9: \ \ \ \ \ \ \ \ \ $f(s_u|t_v) = \sum_{k=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[k]},t^{[k]}) \cdot (\lambda_{t_v}^{'})^{-1}$};
\node [anchor=north west] (line13) at ([yshift=-0.1em]line12.south west) {10: \ \textbf{return} $f(\cdot|\cdot)$};
\begin{pgfonlayer}{background}
{
\node[rectangle,draw=ublue, inner sep=0mm] [fit =(line1)(line2)(line3)(line4)(line5)(line6)(line7)(line11)(line8)(line9)(line13)] {};
}
\end{pgfonlayer}
\end{tikzpicture}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\definecolor{ugreen}{rgb}{0,0.5,0}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\node [anchor=west,draw,thick,minimum width=18.8em,minimum height=1.2em] (sent) at (0,0) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,red] (s1) at ([xshift=0.0em,yshift=-2em]sent.south west) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ugreen] (s2) at ([xshift=2.7em]s1.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,orange] (s3) at ([xshift=2.7em]s2.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ublue] (s4) at ([xshift=2.7em]s3.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,purple] (s5) at ([xshift=2.7em]s4.east) {};
{
\node [anchor=west,draw,thick,circle,minimum size=1.6em,red,fill=red] (t1) at ([yshift=-3.5em]s1.west) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ugreen,fill=ugreen] (t2) at ([xshift=2.7em]t1.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,orange,fill=orange] (t3) at ([xshift=2.7em]t2.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ublue,fill=ublue] (t4) at ([xshift=2.7em]t3.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,purple,fill=purple] (t5) at ([xshift=2.7em]t4.east) {};
}
{
\node [anchor=west,draw,thick,circle,minimum size=1.6em,red,fill=red] (ft1) at ([yshift=-3.5em]t1.west) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ublue,fill=ublue] (ft2) at ([xshift=2.7em]ft1.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,purple,fill=purple] (ft3) at ([xshift=2.7em]ft2.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ugreen,fill=ugreen] (ft4) at ([xshift=2.7em]ft3.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,orange,fill=orange] (ft5) at ([xshift=2.7em]ft4.east) {};
}
\draw [->,thick,double] ([yshift=-0.1em]sent.south) -- ([yshift=-.8em]sent.south);
{
\draw [->,thick] ([yshift=-0.1em]s1.south) -- ([yshift=0.1em]t1.north);
\draw [->,thick] ([yshift=-0.1em]s2.south) -- ([yshift=0.1em]t2.north);
\draw [->,thick] ([yshift=-0.1em]s3.south) -- ([yshift=0.1em]t3.north);
\draw [->,thick] ([yshift=-0.1em]s4.south) -- ([yshift=0.1em]t4.north);
\draw [->,thick] ([yshift=-0.1em]s5.south) -- ([yshift=0.1em]t5.north);
}
{
\draw [->,thick] ([yshift=-0.1em]t1.south) -- ([yshift=0.1em]ft1.north);
\draw [->,thick] ([yshift=-0.1em]t2.south) -- ([yshift=0.1em]ft4.north);
\draw [->,thick] ([yshift=-0.1em]t3.south) -- ([yshift=0.1em]ft5.north);
\draw [->,thick] ([yshift=-0.1em]t4.south) -- ([yshift=0.1em]ft2.north);
\draw [->,thick] ([yshift=-0.1em]t5.south) -- ([yshift=0.1em]ft3.north);
}
{
\node [anchor=north west] (label1) at ([xshift=1.5em,yshift=0.5em]s5.east) {\textbf{分析}};
\node [anchor=north west] (label2) at ([xshift=1.5em,yshift=0.5em]t5.east) {\textbf{转换}};
\node [anchor=north west] (label3) at ([xshift=1.5em,yshift=0.5em]ft5.east) {\textbf{生成}};
}
\end{tikzpicture}
%---------------------------------------------------------------------
\begin{center}
%%% outline
%-------------------------------------------------------------------------
{\footnotesize
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\begin{tikzpicture}
\begin{scope}
\node [anchor=west, font=\normalsize] (s1) at (0,0) {};
\node [anchor=west, font=\normalsize] (s2) at ([xshift=3em]s1.east) {};
\node [anchor=west, font=\normalsize] (s3) at ([xshift=5.6em]s2.east) {};
\node [anchor=west, font=\normalsize] (s4) at ([xshift=5.1em]s3.east) {感到};
\node [anchor=west, font=\normalsize] (s5) at ([xshift=3.1em]s4.east) {满意};
\end{scope}
\begin{scope}[yshift=-7em]
\node [anchor=west, font=\normalsize] (t1) at (0.4em,0) {I};
\node [anchor=west, font=\normalsize] (t2) at ([xshift=3.5em,yshift=-0.1em]t1.east) {am};
\node [anchor=west, font=\normalsize] (t3) at ([xshift=3.5em,yshift=0.1em]t2.east) {satisfied};
\node [anchor=west, font=\normalsize] (t4) at ([xshift=3.5em]t3.east) {with};
\node [anchor=west, font=\normalsize] (t5) at ([xshift=3.5em,yshift=-0.2em]t4.east) {you};
\end{scope}
{
\draw [-,very thick,ublue,dashed] (s1.south) -- (t1.north);
\draw [-,very thick,ublue,dashed] (s4.south) -- ([yshift=0.3em]t2.north);
\draw [-,very thick,ublue,dashed] (s2.south) ..controls +(south:1em) and +(north:1em).. (t4.north);
\draw [-,very thick,ublue,dashed] (s3.south) ..controls +(south:0.5em) and +(north:1.5em).. (t5.north);
\draw [-,very thick,ublue,dashed] (s5.south) -- (t3.north);
}
\end{tikzpicture}
}
%---------------------------------------------------------------------
\end{center}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
{
\node [pos=0.5,left,xshift=-0.5em,yshift=2.0em] (label2) {\footnotesize{{$t^1$ =$<$s$>$ {\color{red}machine}\; {\color{red}translation}\; is\; just\; translation\; by\; computer\; $<$/s$>$ }}};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {\footnotesize{{$t^2$ =$<$s$>$ how\; does\;this\; {\color{red}machine}\;work\; $?$ $<$/s$>$ }}};
\node [anchor=north west] (label2part3) at ([yshift=0.3em]label2part2.south west) {\footnotesize{{$t^3$ =$<$s$>$ we\; are\;replaced\;the\; old\; adding\; {\color{red}machine}\;with\;a\; computer\; $<$/s$>$ }}};
\node [anchor=north west] (label2part4) at ([yshift=0.3em]label2part3.south west) {\footnotesize{{$t^4$ =$<$s$>$ several\; approaches\; to\;{\color{red}machine}\;learning\; are\; used\; to\; solve\; problems\; $?$\; $<$/s$>$ }}};
}
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\definecolor{ugreen}{rgb}{0,0.5,0}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\node [anchor=west,inner sep=2pt,fill=red!20,thick,minimum width=3.6em,minimum height=0.8em] (s1) at (0,0) {$\phi$};
{%第一列
\node [anchor=north west] (label1) at ([xshift=2.5em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第1步}}};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s21) at ([xshift=2.0em,yshift=3.5em]s1.east) {$w_1^1$};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s22) at ([xshift=2.0em,yshift=0.0em]s1.east) {$w_2^1$};
\node [anchor=west] (s23) at ([xshift=3.3em,yshift=-3.2em]s1.east) {$\vdots$};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s24) at ([xshift=2.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{m \bullet n}^1$}};
}
{
\draw [->,thick] ([yshift=0.0em]s1.east) -- ([yshift=0.0em]s21.west);
\draw [->,thick] ([yshift=0.0em]s1.east) -- ([yshift=0.0em]s22.west);
\draw [->,thick] ([yshift=0.0em]s1.east) -- ([xshift=-1.3em,yshift=-0.2em]s23.west);
\draw [->,thick] ([yshift=0.0em]s1.east) -- ([yshift=0.0em]s24.west);
}
{%第二列
\node [anchor=north west] (label2) at ([xshift=9.3em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第2步}}};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s31) at ([xshift=8.8em,yshift=3.5em]s1.east) {$w_1^2$};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s32) at ([xshift=8.8em,yshift=0.0em]s1.east) {$w_2^2$};
\node [anchor=west] (s33) at ([xshift=10.1em,yshift=-3.2em]s1.east) {$\vdots$};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s34) at ([xshift=8.8em,yshift=-7.0em]s1.east) {\tiny{$w_{(m-1) \bullet n}^2$}};
}
{
\draw [->,thick] ([yshift=0.0em]s21.east) -- ([yshift=0.0em]s31.west);
\draw [->,thick] ([yshift=0.0em]s21.east) -- ([yshift=0.0em]s32.west);
\draw [->,thick] ([yshift=0.0em]s21.east) -- ([xshift=-1.3em,yshift=-0.2em]s33.west);
\draw [->,thick] ([yshift=0.0em]s21.east) -- ([yshift=0.0em]s34.west);
\draw [->,thick] ([yshift=0.0em]s22.east) -- ([yshift=0.0em]s31.west);
\draw [->,thick] ([yshift=0.0em]s22.east) -- ([yshift=0.0em]s32.west);
\draw [->,thick] ([yshift=0.0em]s22.east) -- ([xshift=-1.3em,yshift=-0.2em]s33.west);
\draw [->,thick] ([yshift=0.0em]s22.east) -- ([yshift=0.0em]s34.west);
\draw [->,thick] ([xshift=1.3em,yshift=-0.3em]s23.east) -- ([yshift=0.0em]s31.west);
\draw [->,thick] ([xshift=1.3em,yshift=-0.3em]s23.east) -- ([yshift=0.0em]s32.west);
\draw [->,thick] ([xshift=1.3em,yshift=-0.3em]s23.east) -- ([xshift=-1.3em,yshift=-0.3em]s33.west);
\draw [->,thick] ([xshift=1.3em,yshift=-0.3em]s23.east) -- ([yshift=0.0em]s34.west);
\draw [->,thick] ([yshift=0.0em]s24.east) -- ([yshift=0.0em]s31.west);
\draw [->,thick] ([yshift=0.0em]s24.east) -- ([yshift=0.0em]s32.west);
\draw [->,thick] ([yshift=0.0em]s24.east) -- ([xshift=-1.3em,yshift=-0.2em]s33.west);
\draw [->,thick] ([yshift=0.0em]s24.east) -- ([yshift=0.0em]s34.west);
}
{%第三列
\node [anchor=west] (s41) at ([xshift=15.6em,yshift=3.5em]s1.east) {$\cdots$};
\node [anchor=west] (s42) at ([xshift=15.6em,yshift=0.0em]s1.east) {$\cdots$};
\node [anchor=west] (s43) at ([xshift=15.6em,yshift=-3.5em]s1.east) {$\cdots$};
\node [anchor=west] (s44) at ([xshift=15.6em,yshift=-7.0em]s1.east) {$\cdots$};
\draw [->,thick] ([yshift=0.0em]s31.east) -- ([yshift=0.0em]s41.west);
\draw [->,thick] ([yshift=0.0em]s31.east) -- ([yshift=0.0em]s42.west);
\draw [->,thick] ([yshift=0.0em]s31.east) -- ([yshift=0.0em]s43.west);
\draw [->,thick] ([yshift=0.0em]s31.east) -- ([yshift=0.0em]s44.west);
\draw [->,thick] ([yshift=0.0em]s32.east) -- ([yshift=0.0em]s41.west);
\draw [->,thick] ([yshift=0.0em]s32.east) -- ([yshift=0.0em]s42.west);
\draw [->,thick] ([yshift=0.0em]s32.east) -- ([yshift=0.0em]s43.west);
\draw [->,thick] ([yshift=0.0em]s32.east) -- ([yshift=0.0em]s44.west);
\draw [->,thick] ([xshift=1.3em,yshift=-0.3em]s33.east) -- ([yshift=0.0em]s41.west);
\draw [->,thick] ([xshift=1.3em,yshift=-0.3em]s33.east) -- ([yshift=0.0em]s42.west);
\draw [->,thick] ([xshift=1.3em,yshift=-0.3em]s33.east) -- ([yshift=0.0em]s43.west);
\draw [->,thick] ([xshift=1.3em,yshift=-0.3em]s33.east) -- ([yshift=0.0em]s44.west);
\draw [->,thick] ([yshift=0.0em]s34.east) -- ([yshift=0.0em]s41.west);
\draw [->,thick] ([yshift=0.0em]s34.east) -- ([yshift=0.0em]s42.west);
\draw [->,thick] ([yshift=0.0em]s34.east) -- ([yshift=0.0em]s43.west);
\draw [->,thick] ([yshift=0.0em]s34.east) -- ([yshift=0.0em]s44.west);
}
{%第四列
\node [anchor=north west] (label3) at ([xshift=19.4em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第m步}}};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s51) at ([xshift=19.0em,yshift=3.5em]s1.east) {$w_1^m$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s52) at ([xshift=19.0em,yshift=0.0em]s1.east) {$w_2^m$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s53) at ([xshift=19.0em,yshift=-3.5em]s1.east) {$w_{?}^{m}$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s54) at ([xshift=19.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{1 \bullet n}^m$}};
\draw [->,thick] ([yshift=0.0em]s41.east) -- ([yshift=0.0em]s51.west);
\draw [->,thick] ([yshift=0.0em]s42.east) -- ([yshift=0.0em]s52.west);
\draw [->,thick] ([yshift=0.0em]s43.east) -- ([yshift=0.0em]s53.west);
\draw [->,thick] ([yshift=0.0em]s44.east) -- ([yshift=0.0em]s54.west);
}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\definecolor{ugreen}{rgb}{0,0.5,0}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\node [anchor=west,inner sep=2pt,fill=red!20,thick,minimum width=3.6em,minimum height=0.8em] (s1) at (0,0) {$\phi$};
{%第一列
\node [anchor=north west] (label1) at ([xshift=2.5em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第1步}}};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s21) at ([xshift=2.0em,yshift=3.5em]s1.east) {$w_1^1$};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s22) at ([xshift=2.0em,yshift=0.0em]s1.east) {$w_2^1$};
\node [anchor=west] (s23) at ([xshift=3.3em,yshift=-3.2em]s1.east) {$\vdots$};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s24) at ([xshift=2.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{m \bullet n}^1$}};
}
{
\draw [->,thick,red] ([yshift=0.0em]s1.east) -- ([yshift=0.0em]s21.west);
\draw [->,thick,densely dashed] ([yshift=0.0em]s1.east) -- ([yshift=0.0em]s22.west);
\draw [->,thick,densely dashed] ([yshift=0.0em]s1.east) -- ([xshift=-1.3em,yshift=-0.2em]s23.west);
\draw [->,thick,densely dashed] ([yshift=0.0em]s1.east) -- ([yshift=0.0em]s24.west);
}
{%第二列
\node [anchor=north west] (label2) at ([xshift=9.3em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第2步}}};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s31) at ([xshift=8.8em,yshift=3.5em]s1.east) {$w_1^2$};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s32) at ([xshift=8.8em,yshift=0.0em]s1.east) {$w_2^2$};
\node [anchor=west] (s33) at ([xshift=10.1em,yshift=-3.2em]s1.east) {$\vdots$};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s34) at ([xshift=8.8em,yshift=-7.0em]s1.east) {\tiny{$w_{(m-1) \bullet n}^2$}};
}
{
\draw [->,thick,densely dashed] ([yshift=0.0em]s21.east) -- ([yshift=0.0em]s31.west);
\draw [->,thick,densely dashed] ([yshift=0.0em]s21.east) -- ([yshift=0.0em]s32.west);
\draw [->,thick,red] ([yshift=0.0em]s21.east) -- ([xshift=-1.3em,yshift=-0.2em]s33.west);
\draw [->,thick,densely dashed] ([yshift=0.0em]s21.east) -- ([yshift=0.0em]s34.west);
}
{%第三列
\node [anchor=west] (s41) at ([xshift=15.6em,yshift=3.5em]s1.east) {$\cdots$};
\node [anchor=west] (s42) at ([xshift=15.6em,yshift=0.0em]s1.east) {$\cdots$};
\node [anchor=west] (s43) at ([xshift=15.6em,yshift=-3.5em]s1.east) {$\cdots$};
\node [anchor=west] (s44) at ([xshift=15.6em,yshift=-7.0em]s1.east) {$\cdots$};
\draw [->,thick,densely dashed] ([xshift=1.3em,yshift=-0.3em]s33.east) -- ([yshift=0.0em]s41.west);
\draw [->,thick,red] ([xshift=1.3em,yshift=-0.3em]s33.east) -- ([yshift=0.0em]s42.west);
\draw [->,thick,densely dashed] ([xshift=1.3em,yshift=-0.3em]s33.east) -- ([yshift=0.0em]s43.west);
\draw [->,thick,densely dashed] ([xshift=1.3em,yshift=-0.3em]s33.east) -- ([yshift=0.0em]s44.west);
}
{%第四列
\node [anchor=north west] (label3) at ([xshift=19.4em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第m步}}};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s51) at ([xshift=19.0em,yshift=3.5em]s1.east) {$w_1^m$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s52) at ([xshift=19.0em,yshift=0.0em]s1.east) {$w_2^m$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s53) at ([xshift=19.0em,yshift=-3.5em]s1.east) {$w_{?}^{m}$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s54) at ([xshift=19.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{1 \bullet n}^m$}};
\draw [->,thick,densely dashed] ([yshift=0.0em]s41.east) -- ([yshift=0.0em]s51.west);
\draw [->,thick,densely dashed] ([yshift=0.0em]s42.east) -- ([yshift=0.0em]s52.west);
\draw [->,thick,red] ([yshift=0.0em]s43.east) -- ([yshift=0.0em]s53.west);
\draw [->,thick,densely dashed] ([yshift=0.0em]s44.east) -- ([yshift=0.0em]s54.west);
}
\end{tikzpicture}
%---------------------------------------------------------------------
\begin{tikzpicture}
{
\node [anchor=north west,inner sep=2pt,align=left] (line1) at (0,0) {\textrm{\textbf{Function} \textsc{WordDecoding}($s$)}};
\node [anchor=north west,inner sep=2pt,align=left] (line2) at ([yshift=-1pt]line1.south west) {\textrm{1: $\pi = $\textsc{GetTransOptions}($s$)}};
\node [anchor=north west,inner sep=2pt,align=left] (line3) at ([yshift=-1pt]line2.south west) {\textrm{2: $best = \phi$}};
\node [anchor=north west,inner sep=2pt,align=left] (line4) at ([yshift=-1pt]line3.south west) {\textrm{3: \textbf{for} $i$ in $[1,m]$ \textbf{do}}};
\node [anchor=north west,inner sep=2pt,align=left] (line5) at ([yshift=-1pt]line4.south west) {\textrm{4: \hspace{1em} $h = \phi$}};
\node [anchor=north west,inner sep=2pt,align=left] (line6) at ([yshift=-1pt]line5.south west) {\textrm{5: \hspace{1em} \textbf{foreach} $j$ in $[1,m]$ \textbf{do}}};
\node [anchor=north west,inner sep=2pt,align=left] (line7) at ([yshift=-1pt]line6.south west) {\textrm{6: \hspace{2em} \textbf{if} $used[j]=$ \textbf{true} \textbf{then}}};
\node [anchor=north west,inner sep=2pt,align=left] (line8) at ([yshift=-1pt]line7.south west) {\textrm{7: \hspace{3em} $h = h \cup \textrm{\textsc{Join}}(best,\pi[j])$}};
\node [anchor=north west,inner sep=2pt,align=left] (line9) at ([yshift=-1pt]line8.south west) {\textrm{8: \hspace{1em} $best = \textrm{\textsc{PruneForTop1}}(h)$}};
\node [anchor=north west,inner sep=2pt,align=left] (line10) at ([yshift=-1pt]line9.south west) {\textrm{9: \hspace{1em} $used[best.j] = \textrm{\textsc{\textbf{true}}}$}};
\node [anchor=north west,inner sep=2pt,align=left] (line11) at ([yshift=-1pt]line10.south west) {\textrm{10: \textbf{return} $best.translatoin$}};
\node [anchor=south west,inner sep=2pt,align=left] (head1) at ([yshift=1pt]line1.north west) {输出: 找的最佳译文};
\node [anchor=south west,inner sep=2pt,align=left] (head2) at ([yshift=1pt]head1.north west) {输入: 源语句子$s=s_1...s_m$};
}
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow,minimum height=1.6cm] [fit = (head2) (line8) (line11)] (algorithm) {};
%% highlights
%\begin{pgfonlayer}{background}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line2highlight) at (line2.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line3highlight) at (line3.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line5highlight) at (line5.west) {};
}
%\end{pgfonlayer}
\end{pgfonlayer}
{
%% remark 1
\begin{scope}
{
\node [anchor=north west,align=left] (remark1) at ([xshift=0.4in]algorithm.north east) {获取每个单词\\的翻译候选};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,red] (s1) at ([yshift=-0.7em,xshift=0.5em]remark1.north east){1};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,ugreen] (s2) at ([xshift=0.4em]s1.east) {2};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,orange] (s3) at ([xshift=0.4em]s2.east) {3};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=3.0pt,ublue] (s4) at ([xshift=0.4em]s3.east) {...};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=1.5pt,purple] (s5) at ([xshift=0.4em]s4.east) {$m$};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,red,fill=red] (t1) at ([yshift=-1.7em]s1.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ugreen,fill=ugreen] (t2) at ([yshift=-1.7em]s2.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,orange,fill=orange] (t3) at ([yshift=-1.7em]s3.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ublue,fill=ublue] (t4) at ([yshift=-1.7em]s4.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,purple,fill=purple] (t5) at ([yshift=-1.7em]s5.center) {{\color{white} $n$}};
\draw [->,thick] ([yshift=-0.1em]s1.south) -- ([yshift=0.1em]t1.north);
\draw [->,thick] ([yshift=-0.1em]s2.south) -- ([yshift=0.1em]t2.north);
\draw [->,thick] ([yshift=-0.1em]s3.south) -- ([yshift=0.1em]t3.north);
\draw [->,thick] ([yshift=-0.1em]s4.south) -- ([yshift=0.1em]t4.north);
\draw [->,thick] ([yshift=-0.1em]s5.south) -- ([yshift=0.1em]t5.north);
\begin{pgfonlayer}{background}
{
\node[rectangle,draw,inner sep=0.2em,fill=blue!10] [fit = (remark1) (t5)] (remark1label) {};
}
\end{pgfonlayer}
}
\end{scope}
%% end of remark 1
%% remark 2
\begin{scope}
{
\node [anchor=north west,draw,inner sep=2pt,fill=blue!10] (remark2) at ([xshift=-0.2em,yshift=-1em]remark1.south west) {$best$用于保存当前最好的翻译结果};
}
\end{scope}
%% end of remark 2
\node [anchor=north west] (remark4) at ([xshift=21.8em,yshift=-0.6em]line7.east) {};
%% remark 3
\begin{scope}
{
\node [anchor=north west,draw,inner sep=2pt,fill=blue!10] (remark3) at ([yshift=-0.5em]remark2.south west) {$h$用于保存每步生成的所有译文候选};
}
\end{scope}
%% end of remark 3
{
\draw [->,thick] (line2highlight.east) ..controls +(east:1em) and +(west:1em).. (remark1label.west);
}
{
\draw [->,thick] (line3highlight.east) ..controls +(east:1em) and +(west:1em).. ([yshift=0.3em]remark2.south west);
\draw [->,thick] (line5highlight.east) ..controls +(east:1em) and +(west:1em).. ([yshift=0.3em]remark3.south west);
}
}
\end{tikzpicture}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=west] (e1) at (0,0) {$g(s,t)$};
\node [anchor=west] (e2) at (e1.east) {$=$};
\node [anchor=west,inner sep=2pt,fill=red!20] (e3) at (e2.east) {$\prod\nolimits_{(j,i) \in \hat{A}} \textrm{P}(s_j,t_i)$};
\node [anchor=west,inner sep=1pt] (e4) at (e3.east) {$\times$};
\node [anchor=west,inner sep=3pt,fill=blue!20] (e5) at (e4.east) {$\textrm{P}_{lm}(t)$};
\node [anchor=north west,inner sep=1pt] (n1) at ([xshift=2.5em,yshift=-1em]e1.south west) {$\textrm{P}(s|t)$};
\node [anchor=north] (n1part2) at ([yshift=0.3em]n1.south) {\scriptsize{\textbf{翻译模型}}};
\node [anchor=west,inner sep=1pt] (n2) at ([xshift=2em]n1.east) {$\textrm{P}(t)$};
\node [anchor=north] (n2part2) at ([yshift=0.3em]n2.south) {\scriptsize{\textbf{语言模型}}};
\draw [->,thick] (e3.south) .. controls +(south:1em) and +(north:1em) .. (n1.north);
\draw [->,thick] (e5.south) .. controls +(south:1em) and +(70:1em) .. (n2.north);
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=west] (eq1) at (0,0) {$\textrm{P}(s,a|t)=$};
\node [anchor=west,inner sep=1pt,minimum height=2.64em] (eq2) at (eq1.east) {$\textrm{P}(m|t)$};
\node [anchor=west,inner sep=1pt,minimum height=2.64em] (eq3) at ([xshift=1pt]eq2.east) {$\prod\limits_{j=1}^{m}$};
\node [anchor=west,inner sep=1pt,minimum height=2.64em] (eq4) at ([xshift=1pt]eq3.east) {$\textrm{P}(a_j|a_{1}^{j-1},s_{1}^{j-1},m,t)$};
\node [anchor=west,inner sep=1pt,minimum height=2.64em] (eq5) at ([xshift=1pt]eq4.east) {$\textrm{P}(s_j|a_{1}^{j},s_{1}^{j-1},m,t)$};
{
\node [anchor=west,inner sep=1pt,minimum height=2.64em,fill=red!20] (eq2) at (eq1.east) {$\textrm{P}(m|t)$};
}
{
\node [anchor=west,inner sep=1pt,minimum height=2.64em,fill=blue!20] (eq3) at ([xshift=1pt]eq2.east) {$\prod\limits_{j=1}^{m}$};
}
{
\node [anchor=west,inner sep=1pt,minimum height=2.64em,fill=green!20] (eq4) at ([xshift=1pt]eq3.east) {$\textrm{P}(a_j|a_{1}^{j-1},s_{1}^{j-1},m,t)$};
}
{
\node [anchor=west,inner sep=1pt,minimum height=2.64em,fill=purple!20] (eq5) at ([xshift=1pt]eq4.east) {$\textrm{P}(s_j|a_{1}^{j},s_{1}^{j-1},m,t)$};
}
{
\node [anchor=north,draw,circle,inner sep=1pt,ublue] (c1) at ([yshift=-1pt]eq2.south) {\tiny{\textbf{1}}};
}
{
\node [anchor=north,draw,circle,inner sep=1pt,ublue] (c2) at ([yshift=-1pt]eq3.south) {\tiny{\textbf{2}}};
}
{
\node [anchor=north,draw,circle,inner sep=1pt,ublue] (c3) at ([yshift=-1pt]eq4.south) {\tiny{\textbf{3}}};
}
{
\node [anchor=north,draw,circle,inner sep=1pt,ublue] (c4) at ([yshift=-1pt]eq5.south) {\tiny{\textbf{4}}};
}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{\small
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {$s_1$:在};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=1em]s1.east) {$s_2$:桌子};
\node [anchor=west,inner sep=2pt] (s3) at ([xshift=1em]s2.east) {$s_3$:上};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {$t_1$:on};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {$t_2$:the};
\node [anchor=north,inner sep=2pt] (t3) at ([yshift=-1.6em]s3.center) {$t_3$:table};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-1.5em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t0.north);
\draw [-] (s2.south) -- (t3.north);
\draw [-] (s3.south) -- (t1.north);
}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {$s_1$:在};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=2em]s1.east) {$s_2$:桌子};
\node [anchor=west,inner sep=2pt] (s3) at ([xshift=2em]s2.east) {$s_3$:上};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-2.4em]s1.center) {$t_1$:on};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-2.4em]s2.center) {$t_2$:the};
\node [anchor=north,inner sep=2pt] (t3) at ([yshift=-2.4em]s3.center) {$t_3$:table};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-2.2em]t1.west) {$t_0$};
}
{
\draw [-,dashed,thick] (s3.south) -- (t0);
\draw [-,dashed,thick] (s3.south) -- (t1);
\draw [-,dashed,thick] (s3.south) -- (t2);
\draw [-,dashed,thick] (s3.south) -- (t3);
}
\end{tikzpicture}
%---------------------------------------------------------------------
\begin{center}
\begin{tikzpicture}
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {$s_1$:在};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=2em]s1.east) {$s_2$:桌子};
\node [anchor=west,inner sep=2pt] (s3) at ([xshift=2em]s2.east) {$s_3$:上};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-2.4em]s1.center) {$t_1$:on};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-2.4em]s2.center) {$t_2$:the};
\node [anchor=north,inner sep=2pt] (t3) at ([yshift=-2.4em]s3.center) {$t_3$:table};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-2.2em]t1.west) {$t_0$};
\draw [-,dashed,thick] (s1.south) -- (t0.north);
\draw [-,dashed,thick] (s2.south) -- (t3.north);
\draw [-,dashed,thick] (s3.south) -- (t1.north);
}
\draw [-,dashed,thick,red] (s2.south) -- (t3.north);
\end{tikzpicture}
\end{center}
\ No newline at end of file
\begin{tikzpicture}
\node [anchor=west] (eq1) at (0,0) {$\sum\limits_{a_1=0}^{l} ... \sum\limits_{a_m=0}^{l} \prod\limits_{j=1}^{m} f(s_j|t_{a_j})$};
\node [anchor=west] (eq1part2) at (eq1.east) {$=$};
\node [anchor=west,inner sep=2pt] (eq1part3) at (eq1part2.east) {$\prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$};
{
\node [anchor=west,inner sep=2pt,fill=red!20] (eq1part3) at (eq1part2.east) {$\prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$};
}
{
\node [anchor=west] (eq2) at ([xshift=5em,yshift=-4.5em]eq1.west) {$\textrm{P}(s|t) = \frac{\epsilon}{(l+1)^{m}} $};
\node [anchor=west,inner sep=2pt] (eq2part2) at ([xshift=-0.3em]eq2.east) {$\prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$};
\node [anchor=east] (eq2label) at ([xshift=-0em,yshift=0.2em]eq2.west) {\small{IBM模型1:}};
\node [anchor=west,inner sep=2pt,fill=red!20] (eq2part2) at ([xshift=-0.3em]eq2.east) {$\prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$};
}
{
\node [anchor=west] (eq3) at ([xshift=5em,yshift=-7.5em]eq1.west) {$\textrm{P}(s|t) = \epsilon$};
\node [anchor=west,inner sep=2pt] (eq3part2) at ([xshift=-0.3em]eq3.east) {$\prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} a(i|j,m,l) f(s_j|t_i)$};
\node [anchor=east] (eq3label) at ([xshift=-0em,yshift=0.2em]eq3.west) {\small{类似的,IBM模型2:}};
}
\begin{pgfonlayer}{background}
{
\node[rectangle,draw=red,inner sep=2pt] [fit = (eq2) (eq2part2) (eq2label) (eq3) (eq3part2) (eq3label)] {};
}
\end{pgfonlayer}
{
\draw [->,thick] ([xshift=-1em]eq1part3.south) .. controls +(south:1.3em) and +(north:1.3em) .. ([xshift=1em]eq2part2.north);
}
\end{tikzpicture}
\begin{tikzpicture}
\begin{scope}[scale=0.8]
\draw [-,very thick] (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0) sin (7,-1);
\draw [-latex,thick] (-0.5,-1.2) -- (8,-1.2);
\draw [-latex,thick] (-0.5,-1.2) -- (-0.5,1.3);
\draw [-,dashed] (1,1) -- (1,-1.2);
\node [anchor=north] at (1,-1.2) {\scriptsize{参数$x$的最优解}};
\node [anchor=center] at (1,-1.2) {$\bullet$};
\node [anchor=center] at (1,1) {$\bullet$};
\node [anchor=west] at (1.3,1) {\scriptsize{目标函数$f(x)$的最大值}};
\draw [<-] (6.5,-0.8) -- (7.0,-0.3);
\node [anchor=south west,inner sep=1pt] at (7.0,-0.3) {\scriptsize{$f(x)$}};
\end{scope}
\end{tikzpicture}
\begin{tikzpicture}
\node [anchor=west] (eq1) at (0,0) {$\hat{\theta}$};
\node [anchor=west] (eq2) at ([yshift=-0.2em]eq1.east) {=};
\node [anchor=west,inner sep=2pt] (eq3) at ([yshift=-0.0em]eq2.east) {$\argmax$};
\node [anchor=north,inner sep=1pt] (eq3part2) at ([yshift=-0.2em]eq3.south) {\scriptsize{$\theta$}};
\node [anchor=west,inner sep=2pt] (eq4) at ([xshift=0.1em]eq3.east) {$\textrm{P}_{\theta}(s|t)$};
{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.35em] (eq3) at ([yshift=-0.0em]eq2.east) {$\argmax$};
\node [anchor=west,inner sep=2pt,fill=green!20] (eq4) at ([xshift=0.1em]eq3.east) {$\textrm{P}_{\theta}(s|t)$};
\node [anchor=north,draw,inner sep=3pt,fill=red!20] (eq3label) at ([yshift=-1.5em]eq3.south west) {\footnotesize{\textbf{求最优参数}}};
\node [anchor=north,draw,inner sep=3pt,fill=green!20] (eq4label) at ([yshift=-1.5em]eq4.south east) {\footnotesize{\textbf{目标函数}}};
\draw [->,thick] ([xshift=-1em]eq3.south) .. controls +(south:1em) and +(north:1em) .. (eq3label.north);
\draw [->,thick] (eq4.south) .. controls +(south:1em) and +(north:1em) .. (eq4label.north);
}
\end{tikzpicture}
\begin{tikzpicture}
\node [anchor=west,inner sep=2pt,fill=green!20] (eq1) at (0,0) {$L(f,\lambda)$};
\node [anchor=west,inner sep=2pt] (eq2) at (eq1.east) {$=$};
\node [anchor=west,inner sep=2pt] (eq3) at (eq2.east) {$\frac{\epsilon}{(l+1)^{m}} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l}$};
\node [anchor=west,inner sep=2pt] (eq4) at (eq3.east) {\black{$f(s_j|t_{i})$}};
\node [anchor=west,inner sep=2pt] (eq5) at (eq4.east) {$-$};
\node [anchor=north west,inner sep=2pt] (eq6) at ([yshift=-6pt]eq3.south west) {$\sum_{t_y}$};
\node [anchor=west,inner sep=1pt,minimum height=1.85em] (eq7) at (eq6.east) {$\lambda_{t_y}$};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq8) at ([xshift=3pt]eq7.east) {$(\sum_{s_x}$};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq9) at (eq8.east) {\black{$f(s_x|t_y)$}};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq10) at (eq9.east) {$-1)$};
{
\node [anchor=west,inner sep=2pt,fill=green!20] (eq1) at (0,0) {$L(f,\lambda)$};
\node [anchor=west,inner sep=2pt] (eq2) at (eq1.east) {$=$};
\node [anchor=west,inner sep=2pt] (eq3) at (eq2.east) {$\frac{\epsilon}{(l+1)^{m}} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l}$};
\node [anchor=west,inner sep=2pt,draw,ublue,fill=blue!20] (eq4) at (eq3.east) {\black{$f(s_j|t_{i})$}};
\node [anchor=west,inner sep=2pt] (eq5) at (eq4.east) {$-$};
\node [anchor=north west,inner sep=2pt] (eq6) at ([yshift=-6pt]eq3.south west) {$\sum_{t_y}$};
\node [anchor=west,inner sep=1pt,fill=purple!20,minimum height=1.85em] (eq7) at (eq6.east) {$\lambda_{t_y}$};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq8) at ([xshift=3pt]eq7.east) {$(\sum_{s_x}$};
\node [anchor=west,inner sep=1pt,draw,ublue,fill=blue!20,minimum height=1.5em] (eq9) at (eq8.east) {\black{$f(s_x|t_y)$}};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq10) at (eq9.east) {$-1)$};
}
\begin{pgfonlayer}{background}
\node[rectangle,red,inner sep=2pt,fill=red!20] [fit = (eq3) (eq4)] (oldobj) {};
{
\node[rectangle,red,inner sep=2pt,fill=orange!20] [fit = (eq8) (eq9) (eq10)] (constraint) {};
}
\end{pgfonlayer}
\node [anchor=west,draw,fill=green!20] (label1) at ([xshift=-2em,yshift=3em]eq1.north west) {新目标函数};
\node [anchor=west,draw,fill=red!20] (label2) at ([xshift=2em]label1.east) {旧目标函数};
{
\node [anchor=west,draw,fill=blue!20] (label3) at ([xshift=2em]label2.east) {参数:词翻译概率};
\node [anchor=west,draw,fill=purple!20] (label4) at ([xshift=-4em,yshift=-2.5em]eq6.south west) {参数:拉格朗日乘数};
\node [anchor=west,draw,fill=orange!20] (label5) at ([xshift=3em]label4.east) {参数约束条件};
}
\draw [<-,thick] ([xshift=-1em]label1.south) .. controls +(south:2em) and +(north:2em) .. (eq1.north);
\draw [<-,thick] ([xshift=-1em]label2.south) .. controls +(south:1.0em) and +(north:1.0em) .. (oldobj.north);
{
\draw [<-,thick] ([xshift=0em]label3.south) .. controls +(south:6.5em) and +(north:1.5em) .. (eq9.north);
\draw [<-,thick] ([xshift=0em]label3.south) .. controls +(south:1.5em) and +(north:1.5em) .. (eq4.north);
\draw [<-,thick] ([xshift=-2em]label4.north) .. controls +(north:1.5em) and +(south:1.5em) .. (eq7.south);
\draw [<-,thick] ([xshift=0em]label5.north) .. controls +(north:1.5em) and +(south:1.5em) .. (constraint.south);
}
\end{tikzpicture}
\begin{tikzpicture}
\node[anchor=west,inner sep=2pt] (eq11) at (0,0) {\large{$\frac{\partial \big[ \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i) \big]}{\partial f(s_u|t_v)}$}};
\node[anchor=west,inner sep=2pt] (eq12) at ([yshift=-9pt]eq11.east) {=};
\node[anchor=west,inner sep=2pt,fill=red!20] (eq13) at ([yshift=2pt]eq12.east) {\large{$\frac{\partial \big[ \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i) \big]}{\partial \big[ \sum\limits_{i=0}^{l}f(s_u|t_i) \big]}$}};
\node[anchor=west,inner sep=2pt] (eq14) at ([yshift=-1pt]eq13.east) {$\cdot$};
\node[anchor=west,inner sep=2pt,fill=blue!20,minimum height=4em] (eq15) at ([yshift=8pt]eq14.east) {\large{$\frac{\partial \big[ \sum\limits_{i=0}^{l}f(s_u|t_i) \big]}{\partial f(s_u|t_v)}$}};
\node[anchor=south,inner sep=1pt] (label1) at ([yshift=1pt]eq13.north) {\footnotesize{$\partial g(z)/\partial z$}};
\node[anchor=south,inner sep=1pt] (label2) at ([yshift=1pt]eq15.north) {\footnotesize{$\partial z/\partial f$}};
\node[anchor=north west,inner sep=2pt] (eq21) at (eq13.south west) {$\frac{\sum\limits_{j=1}^{m} \delta(s_j,s_u)}{\sum\limits_{i=0}^{l}f(s_u|t_i)} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i) \cdot \sum\limits_{i=0}^{l} \delta(t_i,t_v)$};
\node[anchor=east,inner sep=2pt] (eq20) at (eq21.west) {=};
\end{tikzpicture}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{\large
\node [anchor=west,minimum height=3em,inner sep=2pt] (eq11) at (0,0) {max};
\node [anchor=west,inner sep=2pt] (eq12) at ([xshift=2pt]eq11.east) {$\Big( \frac{\epsilon}{(l+1)^{m}} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l}$};
\node [anchor=west,inner sep=2pt] (eq13) at (eq12.east) {$f(s_j|t_i)$};
\node [anchor=west,inner sep=2pt] (eq14) at ([yshift=0.2em]eq13.east) {$\Big)$};
\node [anchor=north west,minimum height=1.8em,inner sep=2pt] (eq21) at ([yshift=-0.5em]eq11.south west) {s.t.};
\node [anchor=west] (eq22) at ([xshift=0.5em,yshift=-0.1em]eq21.east) {\normalsize{for each word $t_y$}:};
\node [anchor=west] (eq23) at ([xshift=0.1em,yshift=-0.0em]eq22.east) {$\sum_{s_x} f(s_x|t_y) = 1$};
{
\node [anchor=west,minimum height=3em,inner sep=2pt,fill=green!20] (eq11) at (0,0) {max};
\node [anchor=west,draw,thin,ublue,inner sep=2pt,fill=blue!20] (eq13) at (eq12.east) {\black{$f(s_j|t_i)$}};
\node [anchor=north west,minimum height=1.8em,inner sep=2pt,fill=purple!20] (eq21) at ([yshift=-0.5em]eq11.south west) {s.t.};
\node [anchor=west,fill=orange!20] (eq23) at ([xshift=0.1em,yshift=-0.0em]eq22.east) {$\sum_{s_x} f(s_x|t_y) = 1$};
}
\begin{pgfonlayer}{background}
{
\node[rectangle,red,inner sep=0pt,fill=red!20] [fit = (eq12) (eq13) (eq14)] (eq1full) (eq1obj) {};
}
\end{pgfonlayer}
}
{
\node [anchor=west,draw,fill=green!20] (label1) at ([xshift=-2em,yshift=3em]eq11.north west) {最大化函数};
\node [anchor=west,draw,fill=red!20] (label2) at ([xshift=4em]label1.east) {目标函数};
\node [anchor=west,draw,fill=blue!20] (label3) at ([xshift=4em]label2.east) {参数};
\node [anchor=west,draw,fill=purple!20] (label4) at ([xshift=-2em,yshift=-2.5em]eq21.south west) {subject to=满足...约束};
\node [anchor=west,draw,fill=orange!20] (label5) at ([xshift=3em]label4.east) {翻译概率归一化约束条件};
\draw [<-,thick] ([xshift=-2em]label1.south) .. controls +(south:2em) and +(north:2em) .. (eq11.north);
\draw [<-,thick] ([xshift=-0em]label2.south) .. controls +(south:1.7em) and +(north:1.7em) .. (eq1obj.north);
\draw [<-,thick] ([xshift=-0em]label3.south) .. controls +(south:2.5em) and +(north:2.5em) .. (eq13.north);
\draw [<-,thick] ([xshift=2em]label4.north) .. controls +(north:1.5em) and +(south:1.5em) .. (eq21.south);
\draw [<-,thick] ([xshift=0em]label5.north) .. controls +(north:1.0em) and +(south:1.0em) .. (eq23.south);
}
\end{tikzpicture}
\begin{tikzpicture}
\node [anchor=west,inner sep=2pt,fill=green!20] (eq1) at (0,0) {$L(f,\lambda)$};
\node [anchor=west,inner sep=2pt] (eq2) at (eq1.east) {$=$};
\node [anchor=west,inner sep=2pt] (eq3) at (eq2.east) {$\frac{\epsilon}{(l+1)^{m}} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l}$};
\node [anchor=west,inner sep=2pt] (eq4) at (eq3.east) {\black{$f(s_j|t_{i})$}};
\node [anchor=west,inner sep=2pt] (eq5) at (eq4.east) {$-$};
\node [anchor=north west,inner sep=2pt] (eq6) at ([yshift=-6pt]eq3.south west) {$\sum_{t_y}$};
\node [anchor=west,inner sep=1pt,minimum height=1.85em] (eq7) at (eq6.east) {$\lambda_{t_y}$};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq8) at ([xshift=3pt]eq7.east) {$(\sum_{s_x}$};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq9) at (eq8.east) {\black{$f(s_x|t_y)$}};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq10) at (eq9.east) {$-1)$};
{
\node [anchor=west,inner sep=2pt,fill=green!20] (eq1) at (0,0) {$L(f,\lambda)$};
\node [anchor=west,inner sep=2pt] (eq2) at (eq1.east) {$=$};
\node [anchor=west,inner sep=2pt] (eq3) at (eq2.east) {$\frac{\epsilon}{(l+1)^{m}} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l}$};
\node [anchor=west,inner sep=2pt,draw,ublue,fill=blue!20] (eq4) at (eq3.east) {\black{$f(s_j|t_{i})$}};
\node [anchor=west,inner sep=2pt] (eq5) at (eq4.east) {$-$};
\node [anchor=north west,inner sep=2pt] (eq6) at ([yshift=-6pt]eq3.south west) {$\sum_{t_y}$};
\node [anchor=west,inner sep=1pt,fill=purple!20,minimum height=1.85em] (eq7) at (eq6.east) {$\lambda_{t_y}$};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq8) at ([xshift=3pt]eq7.east) {$(\sum_{s_x}$};
\node [anchor=west,inner sep=1pt,draw,ublue,fill=blue!20,minimum height=1.5em] (eq9) at (eq8.east) {\black{$f(s_x|t_y)$}};
\node [anchor=west,inner sep=1pt,minimum height=1.5em] (eq10) at (eq9.east) {$-1)$};
}
\begin{pgfonlayer}{background}
\node[rectangle,red,inner sep=2pt,fill=red!20] [fit = (eq3) (eq4)] (oldobj) {};
{
\node[rectangle,red,inner sep=2pt,fill=orange!20] [fit = (eq8) (eq9) (eq10)] (constraint) {};
}
\end{pgfonlayer}
\node [anchor=west,draw,fill=green!20] (label1) at ([xshift=-2em,yshift=3em]eq1.north west) {新目标函数};
\node [anchor=west,draw,fill=red!20] (label2) at ([xshift=2em]label1.east) {旧目标函数};
{
\node [anchor=west,draw,fill=blue!20] (label3) at ([xshift=2em]label2.east) {参数:词翻译概率};
\node [anchor=west,draw,fill=purple!20] (label4) at ([xshift=-4em,yshift=-2.5em]eq6.south west) {参数:拉格朗日乘数};
\node [anchor=west,draw,fill=orange!20] (label5) at ([xshift=3em]label4.east) {参数约束条件};
}
\draw [<-,thick] ([xshift=-1em]label1.south) .. controls +(south:2em) and +(north:2em) .. (eq1.north);
\draw [<-,thick] ([xshift=-1em]label2.south) .. controls +(south:1.0em) and +(north:1.0em) .. (oldobj.north);
{
\draw [<-,thick] ([xshift=0em]label3.south) .. controls +(south:6.5em) and +(north:1.5em) .. (eq9.north);
\draw [<-,thick] ([xshift=0em]label3.south) .. controls +(south:1.5em) and +(north:1.5em) .. (eq4.north);
\draw [<-,thick] ([xshift=-2em]label4.north) .. controls +(north:1.5em) and +(south:1.5em) .. (eq7.south);
\draw [<-,thick] ([xshift=0em]label5.north) .. controls +(north:1.5em) and +(south:1.5em) .. (constraint.south);
}
\end{tikzpicture}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=3em] (eq1) at (0,0) {$f(s_u|t_v)$};
\node [anchor=west,inner sep=2pt] (eq2) at ([xshift=-2pt]eq1.east) {$=$};
\node [anchor=west,inner sep=2pt] (eq3) at ([xshift=-2pt]eq2.east) {$\lambda_{t_v}^{-1}$};
\node [anchor=west,inner sep=2pt] (eq4) at ([xshift=-2pt]eq3.east) {$\frac{\epsilon}{(l+1)^{m}}$};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=3em] (eq5) at ([xshift=-2pt]eq4.east) {\footnotesize{$\prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$}};
\node [anchor=west,inner sep=2pt] (eq6) at ([xshift=-2pt]eq5.east) {\footnotesize{$\sum\limits_{j=1}^{m} \delta(s_j,s_u) \sum\limits_{i=0}^{l} \delta(t_i,t_v)$}};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=3em] (eq7) at ([xshift=-2pt,yshift=-0pt]eq6.east) {$\frac{f(s_u|t_v)}{\sum_{i=0}^{l}f(s_u|t_i)}$};
\node [anchor=south west,inner sep=2pt] (label1) at ([yshift=1em]eq1.north west) {\footnotesize{\textbf{新的参数值}}};
\node [anchor=south east,inner sep=2pt] (label2) at ([yshift=1em,xshift=-5em]eq7.north east) {\footnotesize{\textbf{旧的参数值}}};
\draw [<-,thick] (label1.south) .. controls +(south:1em) and +(north:1em) .. ([xshift=-1em]eq1.north);
\draw [<-,thick] (label2.south) .. controls +(300:1em) and +(north:1em) .. ([xshift=1em]eq7.north);
\draw [<-,thick] ([xshift=-0.5em]label2.south) .. controls +(240:1em) and +(north:1em) .. ([xshift=1em]eq5.north);
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=west,inner sep=2pt,minimum height=2em] (eq1) at (0,0) {$f(s_u|t_v)$};
\node [anchor=west,inner sep=2pt] (eq2) at ([xshift=-2pt]eq1.east) {$=$};
\node [anchor=west,inner sep=2pt,minimum height=2em] (eq3) at ([xshift=-2pt]eq2.east) {$\lambda_{t_v}^{-1}$};
\node [anchor=west,inner sep=2pt,minimum height=3.0em] (eq4) at ([xshift=-3pt]eq3.east) {\footnotesize{$\frac{\epsilon}{(l+1)^{m}} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$}};
\node [anchor=west,inner sep=2pt,minimum height=3.0em] (eq5) at ([xshift=1pt]eq4.east) {\footnotesize{$\sum\limits_{j=1}^{m} \delta(s_j,s_u) \sum\limits_{i=0}^{l} \delta(t_i,t_v)$}};
\node [anchor=west,inner sep=2pt,minimum height=3.0em] (eq6) at ([xshift=1pt]eq5.east) {$\frac{f(s_u|t_v)}{\sum_{i=0}^{l}f(s_u|t_i)}$};
{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=3.0em] (eq4) at ([xshift=-3pt]eq3.east) {\footnotesize{$\frac{\epsilon}{(l+1)^{m}} \prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l} f(s_j|t_i)$}};
}
{
\node [anchor=west,inner sep=2pt,fill=blue!20,minimum height=3.0em] (eq5) at ([xshift=1pt]eq4.east) {\footnotesize{$\sum\limits_{j=1}^{m} \delta(s_j,s_u) \sum\limits_{i=0}^{l} \delta(t_i,t_v)$}};
}
{
\node [anchor=west,inner sep=2pt,fill=green!20,minimum height=3.0em] (eq6) at ([xshift=1pt]eq5.east) {$\frac{f(s_u|t_v)}{\sum_{i=0}^{l}f(s_u|t_i)}$};
}
{
\node [anchor=south west,inner sep=2pt] (label1) at (eq4.north west) {\textbf{\scriptsize{翻译概率$\textrm{P}(s|t)$}}};
}
{
\node [anchor=south west,inner sep=2pt] (label2) at (eq5.north west) {\textbf{\scriptsize{配对的总次数}}};
\node [anchor=south west,inner sep=2pt] (label2part2) at ([yshift=-3pt]label2.north west) {\textbf{\scriptsize{$(s_u,t_v)$在句对$(s,t)$}}};
}
{
\node [anchor=south west,inner sep=2pt] (label3) at (eq6.north west) {\textbf{\scriptsize{有的$t_i$的相对值}}};
\node [anchor=south west,inner sep=2pt] (label4) at ([yshift=-3pt]label3.north west) {\textbf{\scriptsize{$f(s_u|t_v)$对于所}}};
}
{
\node [anchor=east,rotate=90] (neweq1) at ([yshift=-0em]eq4.south) {=};
\node [anchor=north,inner sep=1pt] (neweq1full) at (neweq1.west) {\large{$\textrm{P}(s|t)$}};
}
{
\draw[decorate,thick,decoration={brace,amplitude=5pt,mirror}] ([yshift=-0.2em]eq5.south west) -- ([yshift=-0.2em]eq6.south east) node [pos=0.4,below,xshift=-0.0em,yshift=-0.3em] (expcount1) {\footnotesize{\textbf{'$t_v$翻译为$s_u$'这个事件}}};
\node [anchor=north west] (expcount2) at ([yshift=0.5em]expcount1.south west) {\footnotesize{\textbf{出现次数的期望的估计}}};
\node [anchor=north west] (expcount3) at ([yshift=0.5em]expcount2.south west) {\footnotesize{\textbf{称之为期望频次expected count}}};
}
\end{tikzpicture}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=west,inner sep=2pt] (eq1) at (0,0) {$f(s_u|t_v)$};
\node [anchor=west] (eq2) at (eq1.east) {$=$\ };
\draw [-] ([xshift=0.3em]eq2.east) -- ([xshift=11.6em]eq2.east);
\node [anchor=south west] (eq3) at ([xshift=1em]eq2.east) {$\sum_{i=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})$};
\node [anchor=north west] (eq4) at (eq2.east) {$\sum_{s_u} \sum_{i=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[i]},t^{[i]})$};
{
\node [anchor=south] (label1) at ([yshift=-6em,xshift=3em]eq1.north west) {利用这个公式计算};
\node [anchor=north west] (label1part2) at ([yshift=0.3em]label1.south west) {新的$f(s_u|t_v)$};
}
{
\node [anchor=west] (label2) at ([xshift=5em]label1.east) {用当前的$f(s_u|t_v)$};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {计算期望频次$c_{\mathbb{E}}(\cdot)$};
}
{
\node [anchor=west,fill=red!20,inner sep=2pt] (eq1) at (0,0) {$f(s_u|t_v)$};
}
\begin{pgfonlayer}{background}
{
\node[rectangle,fill=blue!20,inner sep=0] [fit = (eq3) (eq4)] (c) {};
}
{
\node[rectangle,draw,red,inner sep=0] [fit = (label1) (label1part2)] (flabel) {};
}
{
\node[rectangle,draw,ublue,inner sep=0] [fit = (label2) (label2part2)] (clabel) {};
}
\end{pgfonlayer}
{
\draw [->,thick] (eq1.south) ..controls +(south:1.5em) and +(north:1.5em).. (flabel.north);
}
{
\draw [->,thick] (c.south) ..controls +(south:1.0em) and +(north:1.0em).. (clabel.north);
}
{
\draw [->,thick] ([yshift=1em]flabel.east) -- ([yshift=1em]clabel.west);
\draw [<-,thick] ([yshift=-1em]flabel.east) -- ([yshift=-1em]clabel.west) node [pos=0.5,above,yshift=0.3em] {\footnotesize{\textbf{反复执行}}};
}
\end{tikzpicture}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [anchor=north west] (line1) at (0,0) {\textbf{IBM模型1的训练(EM算法)}};
\node [anchor=north west] (line2) at ([yshift=-0.3em]line1.south west) {输入: 平行语料${(s^{[1]},t^{[1]}),...,(s^{[N]},t^{[N]})}$};
\node [anchor=north west] (line3) at ([yshift=-0.1em]line2.south west) {输出: 参数$f(\cdot|\cdot)$的最优值};
\node [anchor=north west] (line4) at ([yshift=-0.1em]line3.south west) {1: \textbf{Function} \textsc{TrainItWithEM}($\{(s^{[1]},t^{[1]}),...,(s^{[N]},t^{[N]})\}$) };
\node [anchor=north west] (line5) at ([yshift=-0.1em]line4.south west) {2: \ \ Initialize $f(\cdot|\cdot)$ \hspace{5em} $\rhd$ 比如给$f(\cdot|\cdot)$一个均匀分布};
\node [anchor=north west] (line6) at ([yshift=-0.1em]line5.south west) {3: \ \ Loop until $f(\cdot|\cdot)$ converges};
\node [anchor=north west] (line7) at ([yshift=-0.1em]line6.south west) {4: \ \ \ \ \textbf{foreach} $k = 1$ to $N$ \textbf{do}};
\node [anchor=north west] (line8) at ([yshift=-0.1em]line7.south west) {5: \ \ \ \ \ \ \ \footnotesize{$c_{\mathbb{E}}(s_u|t_v;s^{[k]},t^{[k]}) = \sum\limits_{j=1}^{|s^{[k]}|} \delta(s_j,s_u) \sum\limits_{i=0}^{|t^{[k]}|} \delta(t_i,t_v) \cdot \frac{f(s_u|t_v)}{\sum_{i=0}^{l}f(s_u|t_i)}$}\normalsize{}};
\node [anchor=north west] (line9) at ([yshift=-0.1em]line8.south west) {6: \ \ \ \ \textbf{foreach} $t_v$ appears at least one of $\{t^{[1]},...,t^{[N]}\}$ \textbf{do}};
\node [anchor=north west] (line10) at ([yshift=-0.1em]line9.south west) {7: \ \ \ \ \ \ \ $\lambda_{t_v}^{'} = \sum_{s_u} \sum_{k=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[k]},t^{[k]})$};
\node [anchor=north west] (line11) at ([yshift=-0.1em]line10.south west) {8: \ \ \ \ \ \ \ \textbf{foreach} $s_u$ appears at least one of $\{s^{[1]},...,s^{[N]}\}$ \textbf{do}};
\node [anchor=north west] (line12) at ([yshift=-0.1em]line11.south west) {9: \ \ \ \ \ \ \ \ \ $f(s_u|t_v) = \sum_{k=1}^{N} c_{\mathbb{E}}(s_u|t_v;s^{[k]},t^{[k]}) \cdot (\lambda_{t_v}^{'})^{-1}$};
\node [anchor=north west] (line13) at ([yshift=-0.1em]line12.south west) {10: \ \textbf{return} $f(\cdot|\cdot)$};
\begin{pgfonlayer}{background}
{
\node[rectangle,draw=ublue, inner sep=0mm] [fit =(line1)(line2)(line3)(line4)(line5)(line6)(line7)(line11)(line8)(line9)(line13)] {};
}
\end{pgfonlayer}
\end{tikzpicture}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t0.north);
\draw [-] (s2.south) -- (t0.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=1.5in]
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t0.north);
\draw [-] (s2.south) -- (t1.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=3in]
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t0.north);
\draw [-] (s2.south) -- (t2.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[yshift=-0.6in]
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- (t0.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=1.5in,yshift=-0.6in]
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- ([yshift=-0.2em]t1.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=3in,yshift=-0.6in]
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- (t2.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[yshift=-1.2in]
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t2.north);
\draw [-] (s2.south) -- (t0.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=1.5in,yshift=-1.2in]
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t2.north);
\draw [-] (s2.south) -- (t1.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=3in,yshift=-1.2in]
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t2.north);
\draw [-] (s2.south) -- (t2.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\normalsize{= \ P($s|t$)}};
}
}
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{\small
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=1em]s1.east) {桌子};
\node [anchor=west,inner sep=2pt] (s3) at ([xshift=1em]s2.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {on};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.5em]s2.center) {the};
\node [anchor=north,inner sep=2pt] (t3) at ([yshift=-1.5em]s3.center) {table};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-1.5em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t0.north);
\draw [-] (s2.south) -- (t3.north);
\draw [-] (s3.south) .. controls +(south:1em) and +(north:1em) .. (t1.north);
}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
{\small
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=2em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-2.2em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-2.45em]s2.center) {you};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- (t2.north);
\node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (mark) at ([xshift=0.8em,yshift=-0.7em]s2.south east) {{\color{ugreen} \tiny{\textbf{Yes}}}};
}
\end{scope}
\begin{scope}[xshift=1.8in]
{\small
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=2em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-2.2em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-2.45em]s2.center) {you};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s1.south) -- (t2.north);
\node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1.5pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (mark) at ([xshift=0.8em,yshift=-0.7em]s2.south east) {{\color{red} \tiny{\textbf{No}}}};
}
\end{scope}
\begin{scope}[xshift=3.6in]
{\small
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=2em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-2.2em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-2.45em]s2.center) {you};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- ([yshift=-0.2em]t1.north);
\node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (mark) at ([xshift=0.8em,yshift=-0.7em]s2.south east) {{\color{ugreen} \tiny{\textbf{Yes}}}};
}
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [draw,red,fill=red!10,thick,anchor=center,circle,inner sep=3.5pt] (s1) at (0,0) {\black{$s$}};
\node [draw,ublue,fill=blue!10,thick,anchor=center,circle,inner sep=2pt] (t) at ([xshift=1in]s1.east) {\black{$\hat{t}$}};
\draw [->,thick,] (s1.north east) .. controls +(north east:1em) and +(north west:1em).. (t.north west) node[pos=0.5,below] {\tiny{正确翻译}};
\node [draw,red,fill=red!10,thick,anchor=center,circle,inner sep=3.5pt] (s) at ([xshift=13em,yshift=0em]s1.east) {\black{$s$}};
\node [draw,ublue,fill=blue!10,thick,anchor=center,circle,inner sep=2pt] (t1) at ([xshift=1in]s.east) {\black{$t_1$}};
\node [draw,ublue,fill=blue!10,thick,anchor=center,circle,inner sep=2pt] (t2) at ([xshift=3em,yshift=2em]t1.north east) {\black{$t_2$}};
\node [draw,ublue,fill=blue!10,thick,anchor=center,circle,inner sep=2pt] (t3) at ([xshift=1em,yshift=4em]t1.north east) {\black{$t_3$}};
\node [draw,ublue,fill=blue!10,thick,anchor=center,circle,inner sep=2pt] (t4) at ([xshift=3em,yshift=-1.5em]t1.north east) {\black{$t_4$}};
\node [draw,dashed,ublue,fill=blue!10,thick,anchor=center,circle,minimum size=18pt] (t5) at ([xshift=3em]t3.east) {};
\node [draw,dashed,ublue,fill=blue!10,thick,anchor=center,circle,minimum size=18pt] (t6) at ([xshift=3em]t2.east) {};
\node [draw,dashed,ublue,fill=blue!10,thick,anchor=center,circle,minimum size=18pt] (t7) at ([xshift=3em]t4.east) {};
\draw [->,thick,] (s.north east) .. controls +(north east:1em) and +(north west:1em).. (t1.north west) node[pos=0.5,below] {\tiny{P ($t_1|s$)=0.1}};
\draw [->,thick,] (s.60) .. controls +(50:4em) and +(west:1em).. (t2.west) node[pos=0.5,below] {\tiny{P($t_2|s$)=0.2}};
\draw [->,thick,] (s.north) .. controls +(70:4em) and +(west:1em).. (t3.west) node[pos=0.5,above,xshift=-1em] {\tiny{P($t_3|s$)=0.3}};
\draw [->,thick,] (s.south east) .. controls +(300:3em) and +(south west:1em).. (t4.south west) node[pos=0.5,below] {\tiny{P($t_4|s$)=0.1}};
\node [anchor=center] (foot1) at ([xshift=3.8em,yshift=-3em]s1.south) {\footnotesize{人的翻译候选空间}};
\node [anchor=center] (foot2) at ([xshift=7em,yshift=-3em]s.south) {\footnotesize{机器的翻译候选空间}};
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$s$ = 在\ \ 桌子\ \ };
\node [anchor=west] (t1) at ([yshift=-2em]s1.west) {$t$ = on\ \ the\ \ table};
\draw [->,double,thick,ublue] ([yshift=0.2em]s1.south) -- ([yshift=-0.8em]s1.south);
\end{scope}
\begin{scope}[xshift=1.5in]
\node [anchor=west] (s2) at (0,0) {$s$ = 在\ \ 桌子\ \ };
\node [anchor=west] (t2) at ([yshift=-2em]s2.west) {$t'$ = table \ on\ \ the};
\draw [->,double,thick,ublue] ([yshift=0.2em]s2.south) -- ([yshift=-0.8em]s2.south);
\end{scope}
\node [anchor=north] (score11) at ([yshift=-2.0em]s1.south) {$\textrm{P}(s|t)$};
\node [anchor=north] (score12) at ([yshift=-2.0em]s2.south) {$\textrm{P}(s|t')$};
\node [anchor=west] (comp1) at ([xshift=2.3em]score11.east) {\large{$\mathbf{=}$}};
\node [anchor=east] (label1) at ([xshift=-1em,yshift=0.1em]score11.west) {\textbf{IBM模型1:}};
{
\node [anchor=north] (score21) at ([yshift=0.2em]score11.south) {$\textrm{P}(s|t)$};
\node [anchor=north] (score22) at ([yshift=0.2em]score12.south) {$\textrm{P}(s|t')$};
\node [anchor=west] (comp2) at ([xshift=2.3em]score21.east) {\large{$\mathbf{>}$}};
\node [anchor=east] (label2) at ([xshift=-1em,yshift=0.1em]score21.west) {\textbf{理想:}};
}
\end{tikzpicture}
%---------------------------------------------------------------------
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{\footnotesize
\node [anchor=west] (mid) at (0,0) {$\alpha(1,0)\alpha(2,0) + \alpha(1,0)\alpha(2,1) + \alpha(1,0)\alpha(2,2) +$};
\node [anchor=west] (mid2) at ([yshift=-2em]mid.west) {$\alpha(1,1)\alpha(2,0) + \alpha(1,1)\alpha(2,1) + \alpha(1,1)\alpha(2,2)+$};
\node [anchor=west] (mid3) at ([yshift=-2em]mid2.west) {$\alpha(1,2)\alpha(2,0) + \alpha(1,2)\alpha(2,1) + \alpha(1,2)\alpha(2,2)$};
}
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,red,inner sep=0.1em,fill=white] [fit = (mid) (mid2) (mid3)] (exampleeq) {};
\end{pgfonlayer}
{\footnotesize
{
\node [anchor=north] (eq1) at ([xshift=2em,yshift=-2em]exampleeq.south west) {$\sum\limits_{y_1=0}^{2} \sum\limits_{y_2=0}^{2} \alpha(1,y_1)\alpha(2,y_2)$};
\node [anchor=west] (eq1part2) at ([xshift=-1em,yshift=-3em]eq1.west) {$=$};
\node [anchor=west] (eq1part3) at ([xshift=-0.5em]eq1part2.east) {$\sum\limits_{y_1=0}^{2} \sum\limits_{y_2=0}^{2} \prod\limits_{x=1}^{2} $};
\node [anchor=west,inner sep=2pt] (eq1part4) at ([xshift=-0.3em]eq1part3.east) {$\alpha(x,y_x)$};
}
{
\node [anchor=north] (eq2) at ([xshift=-2em,yshift=-2em]exampleeq.south east) {$(\alpha(1,0)+\alpha(1,1)+\alpha(1,2))\cdot$};
\node [anchor=west] (eq2part2) at ([yshift=-1.5em]eq2.west) {$(\alpha(2,0)+\alpha(2,1)+\alpha(2,2))$};
\node [anchor=west] (eq2part3) at ([xshift=2.1in]eq1part2.east){$=$};
\node [anchor=west] (eq2part4) at ([xshift=-0.5em]eq2part3.east){$\prod\limits_{x=1}^{2} \sum\limits_{y=0}^{2}$};
\node [anchor=west,inner sep=2pt] (eq2part5) at ([xshift=-0.3em]eq2part4.east){$\alpha(x,y)$};
}
}
\begin{pgfonlayer}{background}
{
\node[rectangle,draw=ublue,red,inner sep=0.1em,fill=white] [fit = (eq1) (eq1part2) (eq1part3)] (eq1full) {};
}
{
\node[rectangle,draw=ublue,red,inner sep=0.1em,fill=white] [fit = (eq2) (eq2part2) (eq2part3) (eq2part4)] (eq2full) {};
}
\end{pgfonlayer}
{
\draw [->,thick] ([xshift=-3em]exampleeq.south) .. controls +(south:1.5em) and +(north:1.5em) .. (eq1full.north);
}
{
\draw [->,thick] ([xshift=3em]exampleeq.south) .. controls +(south:1.5em) and +(north:1.5em) .. (eq2full.north);
}
{
\node [anchor=west] at ([xshift=0.7em]eq1full.east) {\LARGE{\textbf{=}}};
}
{
{\large
\node [anchor=west] (feq) at ([xshift=3em,yshift=-3em]eq1full.south west) {$\sum\limits_{a_1=0}^{l} ... \sum\limits_{a_m=0}^{l} \prod\limits_{j=1}^{m}$};
\node [anchor=west,inner sep=2pt,fill=blue!20] (feqpart2) at ([xshift=-0.3em]feq.east) {$f(s_j|t_{a_j})$};
\node [anchor=west,inner sep=1pt] (feqpart3) at (feqpart2.east) {=};
\node [anchor=west] (feqpart4) at (feqpart3.east) {$\prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l}$};
\node [anchor=west,inner sep=2pt,fill=blue!20] (feqpart5) at ([xshift=-0.3em]feqpart4.east) {$f(s_j|t_i)$};
}
\draw [->,thick] (eq1part4.south) .. controls +(south:2.5em) and +(north:2.5em) .. (feqpart2.north);
\draw [->,thick] (eq2part5.south) .. controls +(south:1.5em) and +(north:1.5em) .. (feqpart5.north);
\node [anchor=west,inner sep=2pt,fill=blue!20] (eq1part4) at ([xshift=-0.3em]eq1part3.east) {\footnotesize{$\alpha(x,y_x)$}};
\node [anchor=west,inner sep=2pt,fill=blue!20] (eq2part5) at ([xshift=-0.3em]eq2part4.east){\footnotesize{$\alpha(x,y)$}};
}
\end{tikzpicture}
%%% outline
%-------------------------------------------------------------------------
\begin{tabular}{| l | l |}
\hline
& {\footnotesize{$\prod\limits_{(j,i) \in \hat{A}} \textrm{P}(s_j,t_i)$} } \\ \hline
\begin{tikzpicture}
\begin{scope}
{\footnotesize
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=2.2em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=3.2em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=3.6em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=1.9em]s4.east) {满意$_5$};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-3.6em]
\node [anchor=west] (t1) at (0.35em,0) {I$_1$};
\node [anchor=west] (t2) at ([xshift=2.3em,yshift=-0.1em]t1.east) {am$_2$};
\node [anchor=west] (t3) at ([xshift=2.3em,yshift=0.1em]t2.east) {satisfied$_3$};
\node [anchor=west] (t4) at ([xshift=2.3em]t3.east) {with$_4$};
\node [anchor=west] (t5) at ([xshift=2.3em,yshift=-0.2em]t4.east) {you$_5$};
\node [anchor=east] (t) at (t1.west) {$t'=$};
\end{scope}
\draw [-,thick,ublue,dashed] (s1.south) -- (t1.north);
\draw [-,thick,ublue,dashed] (s4.south) -- ([yshift=0.3em]t2.north);
\draw [-,thick,ublue,dashed] (s2.south) ..controls +(south:1em) and +(north:1em).. (t4.north);
\draw [-,thick,ublue,dashed] (s3.south) ..controls +(south:0.5em) and +(north:1.5em).. (t5.north);
\draw [-,thick,ublue,dashed] (s5.south) -- (t3.north);
}
\end{scope}
\end{tikzpicture}
& {\tikz{\node[minimum height=3.2em]{\small{0.0023}};}} \\
\begin{tikzpicture}
\begin{scope}
{\footnotesize
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=2.5em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=2.5em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=2.5em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=2.5em]s4.east) {满意$_5$};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-3.6em]
\node [anchor=center] (t1) at ([yshift=-1.6em]s1.south) {I$_1$};
\node [anchor=center] (t2) at ([yshift=-1.6em]s2.south) {with$_2$};
\node [anchor=center] (t3) at ([yshift=-1.7em]s3.south) {you$_3$};
\node [anchor=center] (t4) at ([yshift=-1.7em]s4.south) {am$_4$};
\node [anchor=center] (t5) at ([yshift=-1.6em]s5.south) {satisfied$_5$};
\node [anchor=center] (t) at ([xshift=-1.3em]t1.west) {$t''=$};
\end{scope}
\draw [-,thick,ublue,dashed] (s1.south) -- (t1.north);
\draw [-,thick,ublue,dashed] (s2.south) -- (t2.north);
\draw [-,thick,ublue,dashed] (s3.south) -- (t3.north);
\draw [-,thick,ublue,dashed] (s4.south) -- (t4.north);
\draw [-,thick,ublue,dashed] (s5.south) -- (t5.north);
}
\end{scope}
\end{tikzpicture}
&{\tikz{\node[minimum height=3.2em]{\small{0.0023}};}}\\
\hline
\end{tabular}
%---------------------------------------------------------------------
\begin{tikzpicture}
{
\node [anchor=north west,inner sep=2pt,align=left] (line1) at (0,0) {\textrm{\textbf{Function} \textsc{WordDecoding}($s$)}};
\node [anchor=north west,inner sep=2pt,align=left] (line2) at ([yshift=-1pt]line1.south west) {\textrm{1: $\pi = $\textsc{GetTransOptions}($s$)}};
\node [anchor=north west,inner sep=2pt,align=left] (line3) at ([yshift=-1pt]line2.south west) {\textrm{2: $best = \phi$}};
\node [anchor=north west,inner sep=2pt,align=left] (line4) at ([yshift=-1pt]line3.south west) {\textrm{3: \textbf{for} $i$ in $[1,m]$ \textbf{do}}};
\node [anchor=north west,inner sep=2pt,align=left] (line5) at ([yshift=-1pt]line4.south west) {\textrm{4: \hspace{1em} $h = \phi$}};
\node [anchor=north west,inner sep=2pt,align=left] (line6) at ([yshift=-1pt]line5.south west) {\textrm{5: \hspace{1em} \textbf{foreach} $j$ in $[1,m]$ \textbf{do}}};
\node [anchor=north west,inner sep=2pt,align=left] (line7) at ([yshift=-1pt]line6.south west) {\textrm{6: \hspace{2em} \textbf{if} $used[j]=$ \textbf{true} \textbf{then}}};
\node [anchor=north west,inner sep=2pt,align=left] (line8) at ([yshift=-1pt]line7.south west) {\textrm{7: \hspace{3em} $h = h \cup \textrm{\textsc{Join}}(best,\pi[j])$}};
\node [anchor=north west,inner sep=2pt,align=left] (line9) at ([yshift=-1pt]line8.south west) {\textrm{8: \hspace{1em} $best = \textrm{\textsc{PruneForTop1}}(h)$}};
\node [anchor=north west,inner sep=2pt,align=left] (line10) at ([yshift=-1pt]line9.south west) {\textrm{9: \hspace{1em} $used[best.j] = \textrm{\textsc{\textbf{true}}}$}};
\node [anchor=north west,inner sep=2pt,align=left] (line11) at ([yshift=-1pt]line10.south west) {\textrm{10: \textbf{return} $best.translatoin$}};
\node [anchor=south west,inner sep=2pt,align=left] (head1) at ([yshift=1pt]line1.north west) {输出: 找的最佳译文};
\node [anchor=south west,inner sep=2pt,align=left] (head2) at ([yshift=1pt]head1.north west) {输入: 源语句子$s=s_1...s_m$};
}
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow,minimum height=1.6cm] [fit = (head2) (line8) (line11)] (algorithm) {};
%% highlights
%\begin{pgfonlayer}{background}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line2highlight) at (line2.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line3highlight) at (line3.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line5highlight) at (line5.west) {};
}
%\end{pgfonlayer}
\end{pgfonlayer}
{
%% remark 1
\begin{scope}
{
\node [anchor=north west,align=left] (remark1) at ([xshift=0.4in]algorithm.north east) {获取每个单词\\的翻译候选};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,red] (s1) at ([yshift=-0.7em,xshift=0.5em]remark1.north east){1};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,ugreen] (s2) at ([xshift=0.4em]s1.east) {2};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,orange] (s3) at ([xshift=0.4em]s2.east) {3};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=3.0pt,ublue] (s4) at ([xshift=0.4em]s3.east) {...};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=1.5pt,purple] (s5) at ([xshift=0.4em]s4.east) {$m$};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,red,fill=red] (t1) at ([yshift=-1.7em]s1.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ugreen,fill=ugreen] (t2) at ([yshift=-1.7em]s2.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,orange,fill=orange] (t3) at ([yshift=-1.7em]s3.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ublue,fill=ublue] (t4) at ([yshift=-1.7em]s4.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,purple,fill=purple] (t5) at ([yshift=-1.7em]s5.center) {{\color{white} $n$}};
\draw [->,thick] ([yshift=-0.1em]s1.south) -- ([yshift=0.1em]t1.north);
\draw [->,thick] ([yshift=-0.1em]s2.south) -- ([yshift=0.1em]t2.north);
\draw [->,thick] ([yshift=-0.1em]s3.south) -- ([yshift=0.1em]t3.north);
\draw [->,thick] ([yshift=-0.1em]s4.south) -- ([yshift=0.1em]t4.north);
\draw [->,thick] ([yshift=-0.1em]s5.south) -- ([yshift=0.1em]t5.north);
\begin{pgfonlayer}{background}
{
\node[rectangle,draw,inner sep=0.2em,fill=blue!10] [fit = (remark1) (t5)] (remark1label) {};
}
\end{pgfonlayer}
}
\end{scope}
%% end of remark 1
%% remark 2
\begin{scope}
{
\node [anchor=north west,draw,inner sep=2pt,fill=blue!10] (remark2) at ([xshift=-0.2em,yshift=-1em]remark1.south west) {$best$用于保存当前最好的翻译结果};
}
\end{scope}
%% end of remark 2
\node [anchor=north west] (remark4) at ([xshift=21.8em,yshift=-0.6em]line7.east) {};
%% remark 3
\begin{scope}
{
\node [anchor=north west,draw,inner sep=2pt,fill=blue!10] (remark3) at ([yshift=-0.5em]remark2.south west) {$h$用于保存每步生成的所有译文候选};
}
\end{scope}
%% end of remark 3
{
\draw [->,thick] (line2highlight.east) ..controls +(east:1em) and +(west:1em).. (remark1label.west);
}
{
\draw [->,thick] (line3highlight.east) ..controls +(east:1em) and +(west:1em).. ([yshift=0.3em]remark2.south west);
\draw [->,thick] (line5highlight.east) ..controls +(east:1em) and +(west:1em).. ([yshift=0.3em]remark3.south west);
}
}
\end{tikzpicture}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{
\node [anchor=north west,inner sep=2pt,align=left] (line1) at (0,0) {\textrm{\textbf{Function} \textsc{WordDecoding}($s$)}};
\node [anchor=north west,inner sep=2pt,align=left] (line2) at ([yshift=-1pt]line1.south west) {\textrm{1: $\pi = $\textsc{GetTransOptions}($s$)}};
\node [anchor=north west,inner sep=2pt,align=left] (line3) at ([yshift=-1pt]line2.south west) {\textrm{2: $best = \phi$}};
\node [anchor=north west,inner sep=2pt,align=left] (line4) at ([yshift=-1pt]line3.south west) {\textrm{3: \textbf{for} $i$ in $[1,m]$ \textbf{do}}};
\node [anchor=north west,inner sep=2pt,align=left] (line5) at ([yshift=-1pt]line4.south west) {\textrm{4: \hspace{1em} $h = \phi$}};
\node [anchor=north west,inner sep=2pt,align=left] (line6) at ([yshift=-1pt]line5.south west) {\textrm{5: \hspace{1em} \textbf{foreach} $j$ in $[1,m]$ \textbf{do}}};
\node [anchor=north west,inner sep=2pt,align=left] (line7) at ([yshift=-1pt]line6.south west) {\textrm{6: \hspace{2em} \textbf{if} $used[j]=$ \textbf{true} \textbf{then}}};
\node [anchor=north west,inner sep=2pt,align=left] (line8) at ([yshift=-1pt]line7.south west) {\textrm{7: \hspace{3em} $h = h \cup \textrm{\textsc{Join}}(best,\pi[j])$}};
\node [anchor=north west,inner sep=2pt,align=left] (line9) at ([yshift=-1pt]line8.south west) {\textrm{8: \hspace{1em} $best = \textrm{\textsc{PruneForTop1}}(h)$}};
\node [anchor=north west,inner sep=2pt,align=left] (line10) at ([yshift=-1pt]line9.south west) {\textrm{9: \hspace{1em} $used[best.j] = \textrm{\textsc{\textbf{true}}}$}};
\node [anchor=north west,inner sep=2pt,align=left] (line11) at ([yshift=-1pt]line10.south west) {\textrm{10: \textbf{return} $best.translatoin$}};
\node [anchor=south west,inner sep=2pt,align=left] (head1) at ([yshift=1pt]line1.north west) {输出: 找的最佳译文};
\node [anchor=south west,inner sep=2pt,align=left] (head2) at ([yshift=1pt]head1.north west) {输入: 源语句子$s=s_1...s_m$};
}
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow,minimum height=1.6cm] [fit = (head2) (line8) (line11)] (algorithm) {};
%% highlights
%\begin{pgfonlayer}{background}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line2highlight) at (line2.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line3highlight) at (line3.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line5highlight) at (line5.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line8highlight) at (line8.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line9highlight) at (line9.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line10highlight) at (line10.west) {};
}
%\end{pgfonlayer}
\end{pgfonlayer}
{
%% remark 1
\begin{scope}
{
\node [anchor=north west,align=left] (remark1) at ([xshift=0.4in]algorithm.north east) {获取每个单词\\的翻译候选};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,red] (s1) at ([yshift=-0.7em,xshift=0.5em]remark1.north east){1};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,ugreen] (s2) at ([xshift=0.4em]s1.east) {2};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,orange] (s3) at ([xshift=0.4em]s2.east) {3};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=3.0pt,ublue] (s4) at ([xshift=0.4em]s3.east) {...};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=1.5pt,purple] (s5) at ([xshift=0.4em]s4.east) {$m$};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,red,fill=red] (t1) at ([yshift=-1.7em]s1.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ugreen,fill=ugreen] (t2) at ([yshift=-1.7em]s2.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,orange,fill=orange] (t3) at ([yshift=-1.7em]s3.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ublue,fill=ublue] (t4) at ([yshift=-1.7em]s4.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,purple,fill=purple] (t5) at ([yshift=-1.7em]s5.center) {{\color{white} $n$}};
\draw [->,thick] ([yshift=-0.1em]s1.south) -- ([yshift=0.1em]t1.north);
\draw [->,thick] ([yshift=-0.1em]s2.south) -- ([yshift=0.1em]t2.north);
\draw [->,thick] ([yshift=-0.1em]s3.south) -- ([yshift=0.1em]t3.north);
\draw [->,thick] ([yshift=-0.1em]s4.south) -- ([yshift=0.1em]t4.north);
\draw [->,thick] ([yshift=-0.1em]s5.south) -- ([yshift=0.1em]t5.north);
\begin{pgfonlayer}{background}
{
\node[rectangle,draw,inner sep=0.2em,fill=blue!10] [fit = (remark1) (t5)] (remark1label) {};
}
\end{pgfonlayer}
}
\end{scope}
%% end of remark 1
%% remark 2
\begin{scope}
{
\node [anchor=north west,draw,inner sep=2pt,fill=blue!10] (remark2) at ([xshift=-0.2em,yshift=-1em]remark1.south west) {$best$用于保存当前最好的翻译结果};
}
\end{scope}
%% end of remark 2
%% remark 3
\begin{scope}
{
\node [anchor=north west,draw,inner sep=2pt,fill=blue!10] (remark3) at ([yshift=-0.5em]remark2.south west) {$h$用于保存每步生成的所有译文候选};
}
\end{scope}
%% end of remark 3
%% remark 4
\begin{scope}
{
\node [anchor=north west,inner sep=2pt,align=left] (remark4) at ([xshift=0.25em,yshift=-0.6em]remark3.south west) {\textsc{Join}($a,b$) 返回\\$a$$b$ 的所有组合};
{
\node [anchor=north west,inner sep=1pt,align=center,draw] (a1) at ([yshift=-0.2em]remark4.north east) {a1\\a2};
\node [anchor=west] (join) at (a1.east) {$\times$};
\node [anchor=north west,inner sep=1pt,align=center,draw] (b1) at ([xshift=1.5em]a1.north east) {b1\\b2};
\node [anchor=west] (join) at (b1.east) {$=$};
\node [anchor=north west,inner sep=1pt,align=center,draw] (result) at ([xshift=1.5em]b1.north east) {a1b1 a1b2\\a2b1 a2b2};
}
\begin{pgfonlayer}{background}
{
\node[rectangle,draw,inner sep=2pt,fill=blue!10] [fit = (remark4) (result)] (remark4label) {};
}
\end{pgfonlayer}
}
\end{scope}
%% end of remark 4
%% remark 5
\begin{scope}
{
\node [anchor=north west,align=left] (remark5) at ([xshift=0.0em,yshift=-1.3em]remark4.south west) {\textsc{PruneForTop1}\\保留得分最高的结果};
\node [anchor=west,draw,inner sep=1pt] (s1) at ([yshift=-0.5em,xshift=1.2em]remark5.north east){0.234};
\node [anchor=north west,draw,inner sep=1pt] (s2) at ([yshift=-0.2em]s1.south west){0.197};
\node [anchor=north west,draw,inner sep=1pt] (s3) at ([yshift=-0.2em]s2.south west){0.083};
\draw [-] ([yshift=-0.1em,xshift=-0.2em]s1.south west) -- ([yshift=-0.1em,xshift=3em]s1.south east);
\node [anchor=west] (top1) at ([xshift=0.1em]s1.east) {\color{red}{$\gets$ top1}};
\begin{pgfonlayer}{background}
{
\node[rectangle,draw,inner sep=0.2em,fill=blue!10] [fit = (remark5) (s3) (top1)] (remark5label) {};
}
\end{pgfonlayer}
}
\end{scope}
% end of remark 5
%% remark 6
\begin{scope}
{
\node [anchor=north west,align=left] (remark6) at ([xshift=0.0em,yshift=-1.3em]remark5.south west) {记录已经翻译过\\的源语单词};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,red] (s1) at ([yshift=-1.3em,xshift=0.5em]remark6.north east){1};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,ugreen] (s2) at ([xshift=0.4em]s1.east) {2};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,orange] (s3) at ([xshift=0.4em]s2.east) {3};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=3.0pt,ublue] (s4) at ([xshift=0.4em]s3.east) {...};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=1.5pt,purple] (s5) at ([xshift=0.4em]s4.east) {$m$};
\draw [-,thick,red] (s1.north east) -- (s1.south west);
\draw [-,thick,orange] (s3.north east) -- (s3.south west);
\begin{pgfonlayer}{background}
{
\node[rectangle,draw,inner sep=0.2em,fill=blue!10] [fit = (remark6) (s5)] (remark6label) {};
}
\end{pgfonlayer}
}
\end{scope}
% end of remark 6
{
\draw [->,thick] (line2highlight.east) ..controls +(east:1em) and +(west:1em).. (remark1label.west);
}
{
\draw [->,thick] (line3highlight.east) ..controls +(east:1em) and +(west:1em).. ([yshift=0.3em]remark2.south west);
\draw [->,thick] (line5highlight.east) ..controls +(east:1em) and +(west:1em).. ([yshift=0.3em]remark3.south west);
}
{
\draw [->,thick] (line8highlight.east) ..controls +(east:1em) and +(west:1em).. ([yshift=0.5em]remark4label.west);
}
{
\draw [->,thick] (line9highlight.east) ..controls +(east:1em) and +(west:1em).. ([yshift=0.5em]remark5label.west);
}
{
\draw [->,thick] (line10highlight.east) ..controls +(east:1em) and +(west:1em).. ([yshift=0.5em]remark6label.south west);
}
}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\begin{tikzpicture}
\begin{scope}
\node [anchor=west] (s1) at (0,0) {\textbf{}};
\node [anchor=west] (s2) at ([xshift=3em]s1.east) {\textbf{}};
\node [anchor=west] (s3) at ([xshift=3em]s2.east) {\textbf{}};
\node [anchor=west] (s4) at ([xshift=3em]s3.east) {\textbf{表示ʾ}};
\node [anchor=west] (s5) at ([xshift=3em]s4.east) {\textbf{满意}};
\node [anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west) {\scriptsize{\textbf{\color{red}{待翻译句子(已经分词):}}}};
{
\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.8em]t11.south) {me};
\node [anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t13) at ([yshift=-0.8em]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}}}};
\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.8em]t21.south) {with};
\node [anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t23) at ([yshift=-0.8em]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}}}};
\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}}}};
\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.8em]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}}}};
\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.8em]t51.south) {satisfied};
\node [anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t53) at ([yshift=-0.8em]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}}}};
}
}
\end{scope}
\begin{scope}
{\small
{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft11) at ([yshift=-1.2in]t11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft12) at ([xshift=6.0em]ft11.center) {satisfied};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft13) at ([xshift=6.0em]ft12.center) {with};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft14) at ([xshift=5.0em]ft13.center) {you};
}
{
\node [anchor=north west,inner sep=1pt,fill=black] (ftl11) at (ft11.north west) {\tiny{{\color{white} \textbf{1}}}};
\node [anchor=north west,inner sep=1pt,fill=black] (ftl12) at (ft12.north west) {\tiny{{\color{white} \textbf{5}}}};
\node [anchor=north west,inner sep=1pt,fill=black] (ftl13) at (ft13.north west) {\tiny{{\color{white} \textbf{2}}}};
\node [anchor=north west,inner sep=1pt,fill=black] (ftl14) at (ft14.north west) {\tiny{{\color{white} \textbf{3}}}};
}
{
\draw [->,thick] ([yshift=-0.1em]t13.south) -- ([yshift=0.1em]ft11.north);
\draw [->,thick] ([yshift=0.1em]t22.south east) ..controls +(280:3em) and +(north:3em).. ([yshift=0.1em]ft13.north);
\draw [->,thick] ([yshift=-0.1em,xshift=0.2em]t31.south west) ..controls +(south:3em) and +(north:3em).. ([yshift=0.1em,xshift=0.2em]ft14.north west);
\draw [->,thick] ([yshift=0.1em]t52.south west) ..controls +(250:4em) and +(north:4em).. ([yshift=0.1em]ft12.north);
\node [anchor=east,inner sep=1pt] (nulltranslabel) at (t42.south west) {\scriptsize{\textbf{翻空}}};
\draw [->,thick] ([yshift=0.1em]t41.south west) ..controls +(250:1em) and +(north:1em).. (nulltranslabel.north);
}
}
\end{scope}
\begin{scope}
{
\node [anchor=north west] (label1) at (ft11.south west) {\small{选择最佳单词翻译,调整词序,得到完美的结果}};
}
{
\draw[decorate,thick,decoration={brace,amplitude=5pt,mirror}] ([yshift=8em,xshift=-0.5em]t13.south west) -- ([xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=-0.5em,yshift=0.5em] (label2) {\footnotesize{\textbf{学习到的}}};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {\footnotesize{\textbf{单词翻译}}};
}
{
\draw[decorate,thick,decoration={brace,amplitude=5pt,mirror}] ([yshift=-0.2em,xshift=-0.5em]t13.south west) -- ([yshift=-5em,xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=-0.5em,yshift=0.5em] (label3) {\footnotesize{\textbf{运用知识}}};
\node [anchor=north west] (label3part2) at ([yshift=0.3em]label3.south west) {\footnotesize{\textbf{生成译文}}};
}
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\node [draw,red,fill=red!10,thick,anchor=center,circle,inner sep=3.5pt] (s) at (0,0) {\black{$s$}};
\node [draw,ublue,fill=blue!10,thick,anchor=center,circle,inner sep=3.3pt] (t) at ([xshift=1.5in]s.east) {\black{$t$}};
\draw [<->,thick,] (s.east) -- (t.west) node [pos=0.5,draw,fill=white] {噪声信道};
\node [anchor=east] at (s.west) {\scriptsize{信宿}};
\node [anchor=west] at (t.east) {\scriptsize{信源}};
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\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}
}
\node [anchor=west,ugreen] (P) at ([xshift=4em,yshift=-0.7em]corpus.east){P($t|s$)};
\node [anchor=south] (modellabel) at (P.north) {{\color{ublue} {\scriptsize \textbf{翻译模型}}}};
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow,minimum height=1.6cm] [fit = (P) (modellabel)] (model) {};
\end{pgfonlayer}
\draw [->,very thick,ublue] ([xshift=0.2em]corpus.east) -- ([xshift=3.2em]corpus.east) node [pos=0.5, above] {\color{red}{\scriptsize{模型学习}}};
{
\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) {\color{red}{\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{对任意句子}};
\node [anchor=north west] (sentpart2) at ([yshift=0.3em]sent.south west) {\textbf{进行翻译}};
}
}
\begin{pgfonlayer}{background}
{
\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}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tabular}{| l | l |}
\hline
& {\footnotesize{$\prod\limits_{(j,i) \in \hat{A}} \textrm{P}(s_j,t_i)$} \color{red}{{\footnotesize{$\times\textrm{P}_{lm}(t)$}}}} \\ \hline
\begin{tikzpicture}
\begin{scope}
{\footnotesize
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=2.2em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=3.2em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=3.6em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=1.9em]s4.east) {满意$_5$};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-3.6em]
\node [anchor=west] (t1) at (0.35em,0) {I$_1$};
\node [anchor=west] (t2) at ([xshift=2.3em,yshift=-0.1em]t1.east) {am$_2$};
\node [anchor=west] (t3) at ([xshift=2.3em,yshift=0.1em]t2.east) {satisfied$_3$};
\node [anchor=west] (t4) at ([xshift=2.3em]t3.east) {with$_4$};
\node [anchor=west] (t5) at ([xshift=2.3em,yshift=-0.2em]t4.east) {you$_5$};
\node [anchor=east] (t) at (t1.west) {$t'=$};
\end{scope}
\draw [-,thick,ublue,dashed] (s1.south) -- (t1.north);
\draw [-,thick,ublue,dashed] (s4.south) -- ([yshift=0.3em]t2.north);
\draw [-,thick,ublue,dashed] (s2.south) ..controls +(south:1em) and +(north:1em).. (t4.north);
\draw [-,thick,ublue,dashed] (s3.south) ..controls +(south:0.5em) and +(north:1.5em).. (t5.north);
\draw [-,thick,ublue,dashed] (s5.south) -- (t3.north);
}
\end{scope}
\end{tikzpicture}
& {\tikz{\node[minimum height=3.2em]{\small{0.0023}{\color{red}\small{$\times$0.0107}}};}} \\
\begin{tikzpicture}
\begin{scope}
{\footnotesize
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=2.5em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=2.5em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=2.5em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=2.5em]s4.east) {满意$_5$};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-3.6em]
\node [anchor=center] (t1) at ([yshift=-1.6em]s1.south) {I$_1$};
\node [anchor=center] (t2) at ([yshift=-1.6em]s2.south) {with$_2$};
\node [anchor=center] (t3) at ([yshift=-1.7em]s3.south) {you$_3$};
\node [anchor=center] (t4) at ([yshift=-1.7em]s4.south) {am$_4$};
\node [anchor=center] (t5) at ([yshift=-1.6em]s5.south) {satisfied$_5$};
\node [anchor=center] (t) at ([xshift=-1.3em]t1.west) {$t''=$};
\end{scope}
\draw [-,thick,ublue,dashed] (s1.south) -- (t1.north);
\draw [-,thick,ublue,dashed] (s2.south) -- (t2.north);
\draw [-,thick,ublue,dashed] (s3.south) -- (t3.north);
\draw [-,thick,ublue,dashed] (s4.south) -- (t4.north);
\draw [-,thick,ublue,dashed] (s5.south) -- (t5.north);
}
\end{scope}
\end{tikzpicture}
&{ \tikz{\node[minimum height=3em]{\small{0.0023}{\color{red}\small{$\times$0.0009}}};}}\\
\hline
\end{tabular}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
{
\node [pos=0.5,left,xshift=-0.5em,yshift=2.0em] (label2) {Input: a word pair (x, y) and a sentence pair (s, t)};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {Output: the number of (x, y) in the (s, t)};
\node [anchor=north west] (label2part3) at ([yshift=0.3em]label2part2.south west) {{1:$count$ $\leftarrow$ 0}};
\node [anchor=north west] (label2part4) at ([yshift=0.3em]label2part3.south west) {{2:\textbf{for} $s\underline{\hbox to 0.1cm{}}word$ $\leftarrow$ $S_1$$S_{length(s)}$ \textbf{do} }};
\node [anchor=north west] (label2part5)at ([yshift=0.3em]label2part4.south west) {{3:\quad\textbf{for} $t\underline{\hbox to 0.1cm{}}word$ $\leftarrow$ $t_1$$t_{length(t)}$ \textbf{do} }};
\node [anchor=north west] (label2part6)at ([yshift=0.3em]label2part5.south west) {{4:\quad\quad\textbf{if} $s\underline{\hbox to 0.1cm{}}word$ == x \textbf{and} $t\underline{\hbox to 0.1cm{}}word$==y \textbf{then} }};
\node [anchor=north west] (label2part7) at ([yshift=0.3em]label2part6.south west) {{5:\quad\quad\quad\quad $count$ $\leftarrow$ $count$ + 1 }};
\node [anchor=north west] (label2part8) at ([yshift=0.3em]label2part7.south west) {{6:\quad\quad \textbf{end if} }};
\node [anchor=north west] (label2part9) at ([yshift=0.3em]label2part8.south west) {{7:\quad \textbf{end for} }};
\node [anchor=north west] (label2part10) at ([yshift=0.3em]label2part9.south west) {{8: \textbf{end for} }};
}
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\definecolor{ugreen}{rgb}{0,0.5,0}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\node [anchor=west,draw,thick,minimum width=18.8em,minimum height=1.2em] (sent) at (0,0) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,red] (s1) at ([xshift=0.0em,yshift=-2em]sent.south west) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ugreen] (s2) at ([xshift=2.7em]s1.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,orange] (s3) at ([xshift=2.7em]s2.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ublue] (s4) at ([xshift=2.7em]s3.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,purple] (s5) at ([xshift=2.7em]s4.east) {};
{
\node [anchor=west,draw,thick,circle,minimum size=1.6em,red,fill=red] (t1) at ([yshift=-3.5em]s1.west) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ugreen,fill=ugreen] (t2) at ([xshift=2.7em]t1.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,orange,fill=orange] (t3) at ([xshift=2.7em]t2.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ublue,fill=ublue] (t4) at ([xshift=2.7em]t3.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,purple,fill=purple] (t5) at ([xshift=2.7em]t4.east) {};
}
{
\node [anchor=west,draw,thick,circle,minimum size=1.6em,red,fill=red] (ft1) at ([yshift=-3.5em]t1.west) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ublue,fill=ublue] (ft2) at ([xshift=2.7em]ft1.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,purple,fill=purple] (ft3) at ([xshift=2.7em]ft2.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,ugreen,fill=ugreen] (ft4) at ([xshift=2.7em]ft3.east) {};
\node [anchor=west,draw,thick,circle,minimum size=1.6em,orange,fill=orange] (ft5) at ([xshift=2.7em]ft4.east) {};
}
\draw [->,thick,double] ([yshift=-0.1em]sent.south) -- ([yshift=-.8em]sent.south);
{
\draw [->,thick] ([yshift=-0.1em]s1.south) -- ([yshift=0.1em]t1.north);
\draw [->,thick] ([yshift=-0.1em]s2.south) -- ([yshift=0.1em]t2.north);
\draw [->,thick] ([yshift=-0.1em]s3.south) -- ([yshift=0.1em]t3.north);
\draw [->,thick] ([yshift=-0.1em]s4.south) -- ([yshift=0.1em]t4.north);
\draw [->,thick] ([yshift=-0.1em]s5.south) -- ([yshift=0.1em]t5.north);
}
{
\draw [->,thick] ([yshift=-0.1em]t1.south) -- ([yshift=0.1em]ft1.north);
\draw [->,thick] ([yshift=-0.1em]t2.south) -- ([yshift=0.1em]ft4.north);
\draw [->,thick] ([yshift=-0.1em]t3.south) -- ([yshift=0.1em]ft5.north);
\draw [->,thick] ([yshift=-0.1em]t4.south) -- ([yshift=0.1em]ft2.north);
\draw [->,thick] ([yshift=-0.1em]t5.south) -- ([yshift=0.1em]ft3.north);
}
{
\node [anchor=north west] (label1) at ([xshift=1.5em,yshift=0.5em]s5.east) {\textbf{分析}};
\node [anchor=north west] (label2) at ([xshift=1.5em,yshift=0.5em]t5.east) {\textbf{转换}};
\node [anchor=north west] (label3) at ([xshift=1.5em,yshift=0.5em]ft5.east) {\textbf{生成}};
}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
{
\node [pos=0.5,left,xshift=-0.5em,yshift=2.0em] (label2) {\footnotesize{{$s^1$ = 机器\quad {\color{red}翻译}\quad\quad\quad\quad 计算机\quad\quad 进行\quad {\color{red}翻译} }}};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {\footnotesize{{$t^1$ = machine\; {\color{red}translation}\; is\; just\; {\color{red}translation}\; by\; computer }}};
\node [anchor=north west] (label2part3) at ([yshift=0.3em]label2part2.south west) {\footnotesize{{$s^2$ = 那\quad 人工\quad {\color{red}翻译}\quad\quad ? }}};
\node [anchor=north west] (label2part4) at ([yshift=0.3em]label2part3.south west) {\footnotesize{{$t^2$ = so\; what\; is\; human\; {\color{red}translation}\;? }}};
}
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{\small
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {$s_1$:在};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=1em]s1.east) {$s_2$:桌子};
\node [anchor=west,inner sep=2pt] (s3) at ([xshift=1em]s2.east) {$s_3$:上};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {$t_1$:on};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {$t_2$:the};
\node [anchor=north,inner sep=2pt] (t3) at ([yshift=-1.6em]s3.center) {$t_3$:table};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-1.5em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t0.north);
\draw [-] (s2.south) -- (t3.north);
\draw [-] (s3.south) -- (t1.north);
}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {$s_1$:在};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=2em]s1.east) {$s_2$:桌子};
\node [anchor=west,inner sep=2pt] (s3) at ([xshift=2em]s2.east) {$s_3$:上};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-2.4em]s1.center) {$t_1$:on};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-2.4em]s2.center) {$t_2$:the};
\node [anchor=north,inner sep=2pt] (t3) at ([yshift=-2.4em]s3.center) {$t_3$:table};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-2.2em]t1.west) {$t_0$};
\draw [-,dashed,thick] (s1.south) -- (t0.north);
\draw [-,dashed,thick] (s2.south) -- (t3.north);
\draw [-,dashed,thick] (s3.south) -- (t1.north);
}
\begin{pgfonlayer}{background}
{
\path [fill=red!20] (s2.north west) -- (s2.south west) -- (t3.north west) -- (t3.south west) -- (t3.south east) -- (t3.north east) -- (s2.south east) -- (s2.north east) -- (s2.north west);
}
\end{pgfonlayer}
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
{
\node [pos=0.5,left,xshift=-0.5em,yshift=2.0em] (label2) {\footnotesize{{s = 机器\quad {\color{red}翻译}\quad\quad\quad\quad 计算机\quad\quad 进行\quad {\color{red}翻译} }}};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {\footnotesize{{t = machine\; {\color{red}translation}\; is\; just\; {\color{red}translation}\; by\; computer }}};
}
\end{scope}
\end{tikzpicture}
%---------------------------------------------------------------------
\begin{center}
%%% outline
%-------------------------------------------------------------------------
{\footnotesize
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\begin{tikzpicture}
\begin{scope}
\node [anchor=west, font=\normalsize] (s1) at (0,0) {};
\node [anchor=west, font=\normalsize] (s2) at ([xshift=3em]s1.east) {};
\node [anchor=west, font=\normalsize] (s3) at ([xshift=5.6em]s2.east) {};
\node [anchor=west, font=\normalsize] (s4) at ([xshift=5.1em]s3.east) {感到};
\node [anchor=west, font=\normalsize] (s5) at ([xshift=3.1em]s4.east) {满意};
\end{scope}
\begin{scope}[yshift=-7em]
\node [anchor=west, font=\normalsize] (t1) at (0.4em,0) {I};
\node [anchor=west, font=\normalsize] (t2) at ([xshift=3.5em,yshift=-0.1em]t1.east) {am};
\node [anchor=west, font=\normalsize] (t3) at ([xshift=3.5em,yshift=0.1em]t2.east) {satisfied};
\node [anchor=west, font=\normalsize] (t4) at ([xshift=3.5em]t3.east) {with};
\node [anchor=west, font=\normalsize] (t5) at ([xshift=3.5em,yshift=-0.2em]t4.east) {you};
\end{scope}
{
\draw [-,very thick,ublue,dashed] (s1.south) -- (t1.north);
\draw [-,very thick,ublue,dashed] (s4.south) -- ([yshift=0.3em]t2.north);
\draw [-,very thick,ublue,dashed] (s2.south) ..controls +(south:1em) and +(north:1em).. (t4.north);
\draw [-,very thick,ublue,dashed] (s3.south) ..controls +(south:0.5em) and +(north:1.5em).. (t5.north);
\draw [-,very thick,ublue,dashed] (s5.south) -- (t3.north);
}
\end{tikzpicture}
}
%---------------------------------------------------------------------
\end{center}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=3em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=4.6em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=5.1em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=3.1em]s4.east) {满意$_5$};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-7.0em]
\node [anchor=west] (t1) at (0.4em,0) {I$_1$};
\node [anchor=west] (t2) at ([xshift=3.5em,yshift=-0.1em]t1.east) {am$_2$};
\node [anchor=west] (t3) at ([xshift=3.5em,yshift=0.1em]t2.east) {satisfied$_3$};
\node [anchor=west] (t4) at ([xshift=3.5em]t3.east) {with$_4$};
\node [anchor=west] (t5) at ([xshift=3.5em,yshift=-0.2em]t4.east) {you$_5$};
\node [anchor=east] (t) at ([xshift=-0.3em]t1.west) {$t=$};
\end{scope}
\draw [-,thick,ublue,dashed] (s1.south) -- (t1.north);
\draw [-,thick,ublue,dashed] (s4.south) -- ([yshift=0.3em]t2.north);
\draw [-,thick,ublue,dashed] (s2.south) ..controls +(south:1em) and +(north:1em).. (t4.north);
\draw [-,thick,ublue,dashed] (s3.south) ..controls +(south:0.5em) and +(north:1.5em).. (t5.north);
\draw [-,thick,ublue,dashed] (s5.south) -- (t3.north);
\end{tikzpicture}
%---------------------------------------------------------------------
\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{standalone}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z
\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning,fit,calc}
\usetikzlibrary{mindmap,backgrounds} % mind map
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\definecolor{ugreen}{rgb}{0,0.5,0}
\begin{document}
\begin{CJK}{UTF8}{you}
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
{\footnotesize
\node [anchor=west] (mid) at (0,0) {$\alpha(1,0)\alpha(2,0) + \alpha(1,0)\alpha(2,1) + \alpha(1,0)\alpha(2,2) +$};
\node [anchor=west] (mid2) at ([yshift=-2em]mid.west) {$\alpha(1,1)\alpha(2,0) + \alpha(1,1)\alpha(2,1) + \alpha(1,1)\alpha(2,2)+$};
\node [anchor=west] (mid3) at ([yshift=-2em]mid2.west) {$\alpha(1,2)\alpha(2,0) + \alpha(1,2)\alpha(2,1) + \alpha(1,2)\alpha(2,2)$};
}
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,red,inner sep=0.1em,fill=white] [fit = (mid) (mid2) (mid3)] (exampleeq) {};
\end{pgfonlayer}
{\footnotesize
{
\node [anchor=north] (eq1) at ([xshift=2em,yshift=-2em]exampleeq.south west) {$\sum\limits_{y_1=0}^{2} \sum\limits_{y_2=0}^{2} \alpha(1,y_1)\alpha(2,y_2)$};
\node [anchor=west] (eq1part2) at ([xshift=-1em,yshift=-3em]eq1.west) {$=$};
\node [anchor=west] (eq1part3) at ([xshift=-0.5em]eq1part2.east) {$\sum\limits_{y_1=0}^{2} \sum\limits_{y_2=0}^{2} \prod\limits_{x=1}^{2} $};
\node [anchor=west,inner sep=2pt] (eq1part4) at ([xshift=-0.3em]eq1part3.east) {$\alpha(x,y_x)$};
}
{
\node [anchor=north] (eq2) at ([xshift=-2em,yshift=-2em]exampleeq.south east) {$(\alpha(1,0)+\alpha(1,1)+\alpha(1,2))\cdot$};
\node [anchor=west] (eq2part2) at ([yshift=-1.5em]eq2.west) {$(\alpha(2,0)+\alpha(2,1)+\alpha(2,2))$};
\node [anchor=west] (eq2part3) at ([xshift=2.1in]eq1part2.east){$=$};
\node [anchor=west] (eq2part4) at ([xshift=-0.5em]eq2part3.east){$\prod\limits_{x=1}^{2} \sum\limits_{y=0}^{2}$};
\node [anchor=west,inner sep=2pt] (eq2part5) at ([xshift=-0.3em]eq2part4.east){$\alpha(x,y)$};
}
}
\begin{pgfonlayer}{background}
{
\node[rectangle,draw=ublue,red,inner sep=0.1em,fill=white] [fit = (eq1) (eq1part2) (eq1part3)] (eq1full) {};
}
{
\node[rectangle,draw=ublue,red,inner sep=0.1em,fill=white] [fit = (eq2) (eq2part2) (eq2part3) (eq2part4)] (eq2full) {};
}
\end{pgfonlayer}
{
\draw [->,thick] ([xshift=-3em]exampleeq.south) .. controls +(south:1.5em) and +(north:1.5em) .. (eq1full.north);
}
{
\draw [->,thick] ([xshift=3em]exampleeq.south) .. controls +(south:1.5em) and +(north:1.5em) .. (eq2full.north);
}
{
\node [anchor=west] at ([xshift=0.7em]eq1full.east) {\LARGE{\textbf{=}}};
}
{
{\large
\node [anchor=west] (feq) at ([xshift=3em,yshift=-3em]eq1full.south west) {$\sum\limits_{a_1=0}^{l} ... \sum\limits_{a_m=0}^{l} \prod\limits_{j=1}^{m}$};
\node [anchor=west,inner sep=2pt,fill=blue!20] (feqpart2) at ([xshift=-0.3em]feq.east) {$f(s_j|t_{a_j})$};
\node [anchor=west,inner sep=1pt] (feqpart3) at (feqpart2.east) {=};
\node [anchor=west] (feqpart4) at (feqpart3.east) {$\prod\limits_{j=1}^{m} \sum\limits_{i=0}^{l}$};
\node [anchor=west,inner sep=2pt,fill=blue!20] (feqpart5) at ([xshift=-0.3em]feqpart4.east) {$f(s_j|t_i)$};
}
\draw [->,thick] (eq1part4.south) .. controls +(south:2.5em) and +(north:2.5em) .. (feqpart2.north);
\draw [->,thick] (eq2part5.south) .. controls +(south:1.5em) and +(north:1.5em) .. (feqpart5.north);
\node [anchor=west,inner sep=2pt,fill=blue!20] (eq1part4) at ([xshift=-0.3em]eq1part3.east) {\footnotesize{$\alpha(x,y_x)$}};
\node [anchor=west,inner sep=2pt,fill=blue!20] (eq2part5) at ([xshift=-0.3em]eq2part4.east){\footnotesize{$\alpha(x,y)$}};
}
\end{tikzpicture}
%---------------------------------------------------------------------
\end{CJK}
\end{document}
\begin{center}
%%% outline
%-------------------------------------------------------------------------
{\footnotesize
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\begin{tikzpicture}
\begin{scope}
\node [anchor=west] (s1) at (0,0) {};
\node [anchor=west] (s2) at ([xshift=0.8em]s1.east) {};
\node [anchor=west] (s3) at ([xshift=0.8em]s2.east) {};
\node [anchor=west] (s4) at ([xshift=0.8em]s3.east) {感到};
\node [anchor=west] (s5) at ([xshift=0.8em]s4.east) {满意};
\end{scope}
\begin{scope}[yshift=-3em]
\node [anchor=west] (t1) at (0.35em,0) {I};
\node [anchor=west] (t2) at ([xshift=0.5em,yshift=-0.1em]t1.east) {am};
\node [anchor=west] (t3) at ([xshift=0.5em,yshift=0.1em]t2.east) {satisfied};
\node [anchor=west] (t4) at ([xshift=0.5em]t3.east) {with};
\node [anchor=west] (t5) at ([xshift=0.5em,yshift=-0.2em]t4.east) {you};
\end{scope}
{
\draw [-,thick,ublue,dashed] (s1.south) -- (t1.north);
\draw [-,thick,ublue,dashed] (s4.south) -- ([yshift=0.3em]t2.north);
\draw [-,thick,ublue,dashed] (s2.south) ..controls +(south:1em) and +(north:1em).. (t4.north);
\draw [-,thick,ublue,dashed] (s3.south) ..controls +(south:0.5em) and +(north:1.5em).. (t5.north);
\draw [-,thick,ublue,dashed] (s5.south) -- (t3.north);
}
\end{tikzpicture}
}
%---------------------------------------------------------------------
\end{center}
......@@ -6,20 +6,20 @@
\begin{tikzpicture}
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=3em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=4.6em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=5.1em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=3.1em]s4.east) {满意$_5$};
\node [anchor=west] (s1) at (0,0) {\footnotesize{$_1$}};
\node [anchor=west] (s2) at ([xshift=0.5em]s1.east) {\footnotesize{$_2$}};
\node [anchor=west] (s3) at ([xshift=0.5em]s2.east) {\footnotesize{$_3$}};
\node [anchor=west] (s4) at ([xshift=0.5em]s3.east) {感到\footnotesize{$_4$}};
\node [anchor=west] (s5) at ([xshift=0.5em]s4.east) {满意\footnotesize{$_5$}};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-7.0em]
\node [anchor=west] (t1) at (0.4em,0) {I$_1$};
\node [anchor=west] (t2) at ([xshift=3.5em,yshift=-0.1em]t1.east) {am$_2$};
\node [anchor=west] (t3) at ([xshift=3.5em,yshift=0.1em]t2.east) {satisfied$_3$};
\node [anchor=west] (t4) at ([xshift=3.5em]t3.east) {with$_4$};
\node [anchor=west] (t5) at ([xshift=3.5em,yshift=-0.2em]t4.east) {you$_5$};
\begin{scope}[yshift=-3.0em]
\node [anchor=west] (t1) at (0.35em,0) {I\footnotesize{$_1$}};
\node [anchor=west] (t2) at ([xshift=0.3em,yshift=-0.1em]t1.east) {am\footnotesize{$_2$}};
\node [anchor=west] (t3) at ([xshift=0.3em,yshift=0.1em]t2.east) {satisfied\footnotesize{$_3$}};
\node [anchor=west] (t4) at ([xshift=0.3em]t3.east) {with\footnotesize{$_4$}};
\node [anchor=west] (t5) at ([xshift=0.3em,yshift=-0.2em]t4.east) {you\footnotesize{$_5$}};
\node [anchor=east] (t) at ([xshift=-0.3em]t1.west) {$t=$};
\end{scope}
......
......@@ -14,21 +14,21 @@
{\footnotesize
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=2.2em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=3.2em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=3.6em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=1.9em]s4.east) {满意$_5$};
\node [anchor=west] (s1) at (0,0) {\footnotesize{$_1$}};
\node [anchor=west] (s2) at ([xshift=0.5em]s1.east) {\footnotesize{$_2$}};
\node [anchor=west] (s3) at ([xshift=0.5em]s2.east) {\footnotesize{$_3$}};
\node [anchor=west] (s4) at ([xshift=0.5em]s3.east) {感到\footnotesize{$_4$}};
\node [anchor=west] (s5) at ([xshift=0.5em]s4.east) {满意\footnotesize{$_5$}};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-3.6em]
\node [anchor=west] (t1) at (0.35em,0) {I$_1$};
\node [anchor=west] (t2) at ([xshift=2.3em,yshift=-0.1em]t1.east) {am$_2$};
\node [anchor=west] (t3) at ([xshift=2.3em,yshift=0.1em]t2.east) {satisfied$_3$};
\node [anchor=west] (t4) at ([xshift=2.3em]t3.east) {with$_4$};
\node [anchor=west] (t5) at ([xshift=2.3em,yshift=-0.2em]t4.east) {you$_5$};
\node [anchor=east] (t) at (t1.west) {$t'=$};
\begin{scope}[yshift=-2.6em]
\node [anchor=west] (t1) at (0.35em,0) {I\footnotesize{$_1$}};
\node [anchor=west] (t2) at ([xshift=0.3em,yshift=-0.1em]t1.east) {am\footnotesize{$_2$}};
\node [anchor=west] (t3) at ([xshift=0.3em,yshift=0.1em]t2.east) {satisfied\footnotesize{$_3$}};
\node [anchor=west] (t4) at ([xshift=0.3em]t3.east) {with\footnotesize{$_4$}};
\node [anchor=west] (t5) at ([xshift=0.3em,yshift=-0.2em]t4.east) {you\footnotesize{$_5$}};
\node [anchor=east] (t) at ([xshift=-0.3em]t1.west) {$t'=$};
\end{scope}
......@@ -51,20 +51,20 @@
{\footnotesize
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=2.5em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=2.5em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=2.5em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=2.5em]s4.east) {满意$_5$};
\node [anchor=west] (s1) at (0,0) {\footnotesize{$_1$}};
\node [anchor=west] (s2) at ([xshift=0.5em]s1.east) {\footnotesize{$_2$}};
\node [anchor=west] (s3) at ([xshift=0.5em]s2.east) {\footnotesize{$_3$}};
\node [anchor=west] (s4) at ([xshift=0.5em]s3.east) {感到\footnotesize{$_4$}};
\node [anchor=west] (s5) at ([xshift=0.5em]s4.east) {满意\footnotesize{$_5$}};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-3.6em]
\node [anchor=center] (t1) at ([yshift=-1.6em]s1.south) {I$_1$};
\node [anchor=center] (t2) at ([yshift=-1.6em]s2.south) {with$_2$};
\node [anchor=center] (t3) at ([yshift=-1.7em]s3.south) {you$_3$};
\node [anchor=center] (t4) at ([yshift=-1.7em]s4.south) {am$_4$};
\node [anchor=center] (t5) at ([yshift=-1.6em]s5.south) {satisfied$_5$};
\begin{scope}[yshift=-2.6em]
\node [anchor=center] (t1) at ([yshift=-1.6em]s1.south) {I\footnotesize{$_1$}};
\node [anchor=center] (t2) at ([yshift=-1.6em]s2.south) {with\footnotesize{$_2$}};
\node [anchor=center] (t3) at ([yshift=-1.7em]s3.south) {you\footnotesize{$_3$}};
\node [anchor=center] (t4) at ([yshift=-1.7em]s4.south) {am\footnotesize{$_4$}};
\node [anchor=center] (t5) at ([yshift=-1.6em]s5.south) {satisfied\footnotesize{$_5$}};
\node [anchor=center] (t) at ([xshift=-1.3em]t1.west) {$t''=$};
\end{scope}
......
......@@ -10,21 +10,21 @@
{\footnotesize
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=2.2em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=3.2em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=3.6em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=1.9em]s4.east) {满意$_5$};
\node [anchor=west] (s1) at (0,0) {\footnotesize{$_1$}};
\node [anchor=west] (s2) at ([xshift=0.5em]s1.east) {\footnotesize{$_2$}};
\node [anchor=west] (s3) at ([xshift=0.5em]s2.east) {\footnotesize{$_3$}};
\node [anchor=west] (s4) at ([xshift=0.5em]s3.east) {感到\footnotesize{$_4$}};
\node [anchor=west] (s5) at ([xshift=0.5em]s4.east) {满意\footnotesize{$_5$}};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-3.6em]
\node [anchor=west] (t1) at (0.35em,0) {I$_1$};
\node [anchor=west] (t2) at ([xshift=2.3em,yshift=-0.1em]t1.east) {am$_2$};
\node [anchor=west] (t3) at ([xshift=2.3em,yshift=0.1em]t2.east) {satisfied$_3$};
\node [anchor=west] (t4) at ([xshift=2.3em]t3.east) {with$_4$};
\node [anchor=west] (t5) at ([xshift=2.3em,yshift=-0.2em]t4.east) {you$_5$};
\node [anchor=east] (t) at (t1.west) {$t'=$};
\begin{scope}[yshift=-2.6em]
\node [anchor=west] (t1) at (0.35em,0) {I\footnotesize{$_1$}};
\node [anchor=west] (t2) at ([xshift=0.3em,yshift=-0.1em]t1.east) {am\footnotesize{$_2$}};
\node [anchor=west] (t3) at ([xshift=0.3em,yshift=0.1em]t2.east) {satisfied\footnotesize{$_3$}};
\node [anchor=west] (t4) at ([xshift=0.3em]t3.east) {with\footnotesize{$_4$}};
\node [anchor=west] (t5) at ([xshift=0.3em,yshift=-0.2em]t4.east) {you\footnotesize{$_5$}};
\node [anchor=east] (t) at ([xshift=-0.3em]t1.west) {$t'=$};
\end{scope}
......@@ -47,20 +47,20 @@
{\footnotesize
\begin{scope}
\node [anchor=west] (s1) at (0,0) {$_1$};
\node [anchor=west] (s2) at ([xshift=2.5em]s1.east) {$_2$};
\node [anchor=west] (s3) at ([xshift=2.5em]s2.east) {$_3$};
\node [anchor=west] (s4) at ([xshift=2.5em]s3.east) {感到$_4$};
\node [anchor=west] (s5) at ([xshift=2.5em]s4.east) {满意$_5$};
\node [anchor=west] (s1) at (0,0) {\footnotesize{$_1$}};
\node [anchor=west] (s2) at ([xshift=0.5em]s1.east) {\footnotesize{$_2$}};
\node [anchor=west] (s3) at ([xshift=0.5em]s2.east) {\footnotesize{$_3$}};
\node [anchor=west] (s4) at ([xshift=0.5em]s3.east) {感到\footnotesize{$_4$}};
\node [anchor=west] (s5) at ([xshift=0.5em]s4.east) {满意\footnotesize{$_5$}};
\node [anchor=east] (s) at (s1.west) {$s=$};
\end{scope}
\begin{scope}[yshift=-3.6em]
\node [anchor=center] (t1) at ([yshift=-1.6em]s1.south) {I$_1$};
\node [anchor=center] (t2) at ([yshift=-1.6em]s2.south) {with$_2$};
\node [anchor=center] (t3) at ([yshift=-1.7em]s3.south) {you$_3$};
\node [anchor=center] (t4) at ([yshift=-1.7em]s4.south) {am$_4$};
\node [anchor=center] (t5) at ([yshift=-1.6em]s5.south) {satisfied$_5$};
\begin{scope}[yshift=-2.6em]
\node [anchor=center] (t1) at ([yshift=-1.6em]s1.south) {I\footnotesize{$_1$}};
\node [anchor=center] (t2) at ([yshift=-1.6em]s2.south) {with\footnotesize{$_2$}};
\node [anchor=center] (t3) at ([yshift=-1.7em]s3.south) {you\footnotesize{$_3$}};
\node [anchor=center] (t4) at ([yshift=-1.7em]s4.south) {am\footnotesize{$_4$}};
\node [anchor=center] (t5) at ([yshift=-1.6em]s5.south) {satisfied\footnotesize{$_5$}};
\node [anchor=center] (t) at ([xshift=-1.3em]t1.west) {$t''=$};
\end{scope}
......
......@@ -5,14 +5,14 @@
\definecolor{ugreen}{rgb}{0,0.5,0}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\node [anchor=west,inner sep=2pt,fill=red!20,thick,minimum width=3.6em,minimum height=0.8em] (s1) at (0,0) {$\phi$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s1) at (0,0) {$\phi$};
{%第一列
\node [anchor=north west] (label1) at ([xshift=2.5em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第1步}}};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s21) at ([xshift=2.0em,yshift=3.5em]s1.east) {$w_1^1$};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s22) at ([xshift=2.0em,yshift=0.0em]s1.east) {$w_2^1$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s21) at ([xshift=2.0em,yshift=3.5em]s1.east) {$w_1^1$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s22) at ([xshift=2.0em,yshift=0.0em]s1.east) {$w_2^1$};
\node [anchor=west] (s23) at ([xshift=3.3em,yshift=-3.2em]s1.east) {$\vdots$};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s24) at ([xshift=2.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{m \bullet n}^1$}};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s24) at ([xshift=2.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{m \bullet n}^1$}};
}
{
\draw [->,thick] ([yshift=0.0em]s1.east) -- ([yshift=0.0em]s21.west);
......@@ -23,10 +23,10 @@
{%第二列
\node [anchor=north west] (label2) at ([xshift=9.3em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第2步}}};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s31) at ([xshift=8.8em,yshift=3.5em]s1.east) {$w_1^2$};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s32) at ([xshift=8.8em,yshift=0.0em]s1.east) {$w_2^2$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s31) at ([xshift=8.8em,yshift=3.5em]s1.east) {$w_1^2$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s32) at ([xshift=8.8em,yshift=0.0em]s1.east) {$w_2^2$};
\node [anchor=west] (s33) at ([xshift=10.1em,yshift=-3.2em]s1.east) {$\vdots$};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s34) at ([xshift=8.8em,yshift=-7.0em]s1.east) {\tiny{$w_{(m-1) \bullet n}^2$}};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s34) at ([xshift=8.8em,yshift=-7.0em]s1.east) {\tiny{$w_{(m-1) \bullet n}^2$}};
}
{
\draw [->,thick] ([yshift=0.0em]s21.east) -- ([yshift=0.0em]s31.west);
......@@ -79,10 +79,10 @@
{%第四列
\node [anchor=north west] (label3) at ([xshift=19.4em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第m步}}};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s51) at ([xshift=19.0em,yshift=3.5em]s1.east) {$w_1^m$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s52) at ([xshift=19.0em,yshift=0.0em]s1.east) {$w_2^m$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s53) at ([xshift=19.0em,yshift=-3.5em]s1.east) {$w_{?}^{m}$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s54) at ([xshift=19.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{1 \bullet n}^m$}};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s51) at ([xshift=19.0em,yshift=3.5em]s1.east) {$w_1^m$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s52) at ([xshift=19.0em,yshift=0.0em]s1.east) {$w_2^m$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s53) at ([xshift=19.0em,yshift=-3.5em]s1.east) {$w_{?}^{m}$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s54) at ([xshift=19.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{1 \bullet n}^m$}};
\draw [->,thick] ([yshift=0.0em]s41.east) -- ([yshift=0.0em]s51.west);
\draw [->,thick] ([yshift=0.0em]s42.east) -- ([yshift=0.0em]s52.west);
......
%%% outline
%-------------------------------------------------------------------------
\begin{tabular}{l | l | l}
句子长度$m$ & 单词翻译候选数量$n$ & 译文数量$n^m \cdot m!$ \\ \hline
1 & 1 & 1 \\
1 & 10 & 10 \\
2 & 10 & 200 \\
10 & 10 & 36288000000000000 \\
20 & 10 & 2.43290200817664 $\times 10^{38}$ \\
20 & 30 & 8.48300477127188 $\times 10^{47}$ \\
\end{tabular}
%---------------------------------------------------------------------
......@@ -6,14 +6,14 @@
\definecolor{ugreen}{rgb}{0,0.5,0}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\node [anchor=west,inner sep=2pt,fill=red!20,thick,minimum width=3.6em,minimum height=0.8em] (s1) at (0,0) {$\phi$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s1) at (0,0) {$\phi$};
{%第一列
\node [anchor=north west] (label1) at ([xshift=2.5em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第1步}}};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s21) at ([xshift=2.0em,yshift=3.5em]s1.east) {$w_1^1$};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s22) at ([xshift=2.0em,yshift=0.0em]s1.east) {$w_2^1$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s21) at ([xshift=2.0em,yshift=3.5em]s1.east) {$w_1^1$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s22) at ([xshift=2.0em,yshift=0.0em]s1.east) {$w_2^1$};
\node [anchor=west] (s23) at ([xshift=3.3em,yshift=-3.2em]s1.east) {$\vdots$};
\node [anchor=west,inner sep=2pt,fill=green!20,thick,minimum width=3.6em,minimum height=0.8em] (s24) at ([xshift=2.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{m \bullet n}^1$}};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s24) at ([xshift=2.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{m \bullet n}^1$}};
}
{
\draw [->,thick,red] ([yshift=0.0em]s1.east) -- ([yshift=0.0em]s21.west);
......@@ -24,10 +24,10 @@
{%第二列
\node [anchor=north west] (label2) at ([xshift=9.3em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第2步}}};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s31) at ([xshift=8.8em,yshift=3.5em]s1.east) {$w_1^2$};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s32) at ([xshift=8.8em,yshift=0.0em]s1.east) {$w_2^2$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s31) at ([xshift=8.8em,yshift=3.5em]s1.east) {$w_1^2$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s32) at ([xshift=8.8em,yshift=0.0em]s1.east) {$w_2^2$};
\node [anchor=west] (s33) at ([xshift=10.1em,yshift=-3.2em]s1.east) {$\vdots$};
\node [anchor=west,inner sep=2pt,fill=blue!20,thick,minimum width=3.6em,minimum height=0.8em] (s34) at ([xshift=8.8em,yshift=-7.0em]s1.east) {\tiny{$w_{(m-1) \bullet n}^2$}};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s34) at ([xshift=8.8em,yshift=-7.0em]s1.east) {\tiny{$w_{(m-1) \bullet n}^2$}};
}
{
\draw [->,thick,densely dashed] ([yshift=0.0em]s21.east) -- ([yshift=0.0em]s31.west);
......@@ -51,10 +51,10 @@
{%第四列
\node [anchor=north west] (label3) at ([xshift=19.4em,yshift=6.3em]s1.east) {{\scriptsize \textbf{第m步}}};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s51) at ([xshift=19.0em,yshift=3.5em]s1.east) {$w_1^m$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s52) at ([xshift=19.0em,yshift=0.0em]s1.east) {$w_2^m$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s53) at ([xshift=19.0em,yshift=-3.5em]s1.east) {$w_{?}^{m}$};
\node [anchor=west,inner sep=2pt,fill=orange!20,thick,minimum width=3.6em,minimum height=0.8em] (s54) at ([xshift=19.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{1 \bullet n}^m$}};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s51) at ([xshift=19.0em,yshift=3.5em]s1.east) {$w_1^m$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s52) at ([xshift=19.0em,yshift=0.0em]s1.east) {$w_2^m$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s53) at ([xshift=19.0em,yshift=-3.5em]s1.east) {$w_{?}^{m}$};
\node [anchor=west,draw,thick,minimum width=3.6em,minimum height=0.8em] (s54) at ([xshift=19.0em,yshift=-7.0em]s1.east) {\scriptsize{$w_{1 \bullet n}^m$}};
\draw [->,thick,densely dashed] ([yshift=0.0em]s41.east) -- ([yshift=0.0em]s51.west);
\draw [->,thick,densely dashed] ([yshift=0.0em]s42.east) -- ([yshift=0.0em]s52.west);
......
......@@ -5,7 +5,7 @@
\begin{tikzpicture}
{
{\scriptsize
\node [anchor=north west,inner sep=2pt,align=left] (line1) at (0,0) {\textrm{\textbf{Function} \textsc{WordDecoding}($s$)}};
\node [anchor=north west,inner sep=2pt,align=left] (line2) at ([yshift=-1pt]line1.south west) {\textrm{1: $\pi = $\textsc{GetTransOptions}($s$)}};
......@@ -30,43 +30,43 @@
%% highlights
%\begin{pgfonlayer}{background}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line2highlight) at (line2.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=1.71in] (line2highlight) at (line2.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line3highlight) at (line3.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line5highlight) at (line5.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=1.71in] (line3highlight) at (line3.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=1.71in] (line5highlight) at (line5.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line8highlight) at (line8.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=1.71in] (line8highlight) at (line8.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line9highlight) at (line9.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=1.71in] (line9highlight) at (line9.west) {};
}
{
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=2.21in] (line10highlight) at (line10.west) {};
\node[anchor=west,fill=blue!20,minimum height=0.16in,minimum width=1.71in] (line10highlight) at (line10.west) {};
}
%\end{pgfonlayer}
\end{pgfonlayer}
{
{\footnotesize
%% remark 1
\begin{scope}
{
\node [anchor=north west,align=left] (remark1) at ([xshift=0.4in]algorithm.north east) {获取每个单词\\的翻译候选};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,red] (s1) at ([yshift=-0.7em,xshift=0.5em]remark1.north east){1};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,ugreen] (s2) at ([xshift=0.4em]s1.east) {2};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,orange] (s3) at ([xshift=0.4em]s2.east) {3};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=3.0pt,ublue] (s4) at ([xshift=0.4em]s3.east) {...};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=1.5pt,purple] (s5) at ([xshift=0.4em]s4.east) {$m$};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,red] (s1) at ([yshift=-1.0em,xshift=0.5em]remark1.north east){\tiny{1}};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,ugreen] (s2) at ([xshift=0.4em]s1.east) {\tiny{2}};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,orange] (s3) at ([xshift=0.4em]s2.east) {\tiny{3}};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=3.0pt,ublue] (s4) at ([xshift=0.4em]s3.east) {.};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=1.5pt,purple] (s5) at ([xshift=0.4em]s4.east) {\tiny{$m$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,red,fill=red] (t1) at ([yshift=-1.7em]s1.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ugreen,fill=ugreen] (t2) at ([yshift=-1.7em]s2.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,orange,fill=orange] (t3) at ([yshift=-1.7em]s3.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ublue,fill=ublue] (t4) at ([yshift=-1.7em]s4.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,purple,fill=purple] (t5) at ([yshift=-1.7em]s5.center) {{\color{white} $n$}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,red,fill=red] (t1) at ([yshift=-1.7em]s1.center) {{\color{white} \tiny{$n$}}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ugreen,fill=ugreen] (t2) at ([yshift=-1.7em]s2.center) {{\color{white} \tiny{$n$}}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,orange,fill=orange] (t3) at ([yshift=-1.7em]s3.center) {{\color{white} \tiny{$n$}}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,ublue,fill=ublue] (t4) at ([yshift=-1.7em]s4.center) {{\color{white} \tiny{$n$}}};
\node [anchor=center,draw,thick,circle,minimum size=0.3em,inner sep=2pt,purple,fill=purple] (t5) at ([yshift=-1.7em]s5.center) {{\color{white} \tiny{$n$}}};
\draw [->,thick] ([yshift=-0.1em]s1.south) -- ([yshift=0.1em]t1.north);
\draw [->,thick] ([yshift=-0.1em]s2.south) -- ([yshift=0.1em]t2.north);
......@@ -104,8 +104,8 @@
{
\node [anchor=north west,inner sep=2pt,align=left] (remark4) at ([xshift=0.25em,yshift=-0.6em]remark3.south west) {\textsc{Join}($a,b$) 返回\\$a$$b$ 的所有组合};
{
\node [anchor=north west,inner sep=1pt,align=center,draw] (a1) at ([yshift=-0.2em]remark4.north east) {a1\\a2};
{\scriptsize
\node [anchor=north west,inner sep=1pt,align=center,draw] (a1) at ([yshift=-0.5em]remark4.north east) {a1\\a2};
\node [anchor=west] (join) at (a1.east) {$\times$};
\node [anchor=north west,inner sep=1pt,align=center,draw] (b1) at ([xshift=1.5em]a1.north east) {b1\\b2};
\node [anchor=west] (join) at (b1.east) {$=$};
......@@ -124,33 +124,33 @@
%% remark 5
\begin{scope}
{
\node [anchor=north west,align=left] (remark5) at ([xshift=0.0em,yshift=-1.3em]remark4.south west) {\textsc{PruneForTop1}\\保留得分最高的结果};
\node [anchor=west,draw,inner sep=1pt] (s1) at ([yshift=-0.5em,xshift=1.2em]remark5.north east){0.234};
\node [anchor=north west,draw,inner sep=1pt] (s2) at ([yshift=-0.2em]s1.south west){0.197};
\node [anchor=north west,draw,inner sep=1pt] (s3) at ([yshift=-0.2em]s2.south west){0.083};
\node [anchor=north west,align=left] (remark5) at ([xshift=0.0em,yshift=-1em]remark4.south west) {\textsc{PruneForTop1}\\保留得分最高的结果};
\node [anchor=west,draw,inner sep=1pt] (s1) at ([yshift=-0.5em,xshift=1.2em]remark5.north east){\tiny{0.234}};
\node [anchor=north west,draw,inner sep=1pt] (s2) at ([yshift=-0.2em]s1.south west){\tiny{0.197}};
\node [anchor=north west,draw,inner sep=1pt] (s3) at ([yshift=-0.2em]s2.south west){\tiny{0.083}};
\draw [-] ([yshift=-0.1em,xshift=-0.2em]s1.south west) -- ([yshift=-0.1em,xshift=3em]s1.south east);
\node [anchor=west] (top1) at ([xshift=0.1em]s1.east) {\color{red}{$\gets$ top1}};
\node [anchor=west] (top1) at ([xshift=0.1em]s1.east) {\tiny{\color{red}{$\gets$ top1}}};
\begin{pgfonlayer}{background}
{
\node[rectangle,draw,inner sep=0.2em,fill=blue!10] [fit = (remark5) (s3) (top1)] (remark5label) {};
\node[rectangle,draw,inner sep=0.2em,fill=blue!10] [fit = (remark5) (top1)] (remark5label) {};
}
\end{pgfonlayer}
}
\end{scope}
% end of remark 5
\%% end of remark 5
%% remark 6
\begin{scope}
{
\node [anchor=north west,align=left] (remark6) at ([xshift=0.0em,yshift=-1.3em]remark5.south west) {记录已经翻译过\\的源语单词};
\node [anchor=north west,align=left] (remark6) at ([xshift=0.0em,yshift=-1em]remark5.south west) {记录已经翻译过\\的源语单词};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,red] (s1) at ([yshift=-1.3em,xshift=0.5em]remark6.north east){1};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,ugreen] (s2) at ([xshift=0.4em]s1.east) {2};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,orange] (s3) at ([xshift=0.4em]s2.east) {3};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=3.0pt,ublue] (s4) at ([xshift=0.4em]s3.east) {...};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=1.5pt,purple] (s5) at ([xshift=0.4em]s4.east) {$m$};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,red] (s1) at ([yshift=-1.0em,xshift=0.5em]remark6.north east){\tiny{1}};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,ugreen] (s2) at ([xshift=0.4em]s1.east) {\tiny{2}};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=2.1pt,orange] (s3) at ([xshift=0.4em]s2.east) {\tiny{3}};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=3.0pt,ublue] (s4) at ([xshift=0.4em]s3.east) {.};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,inner sep=1.5pt,purple] (s5) at ([xshift=0.4em]s4.east) {\tiny{$m$}};
\draw [-,thick,red] (s1.north east) -- (s1.south west);
\draw [-,thick,orange] (s3.north east) -- (s3.south west);
......@@ -162,7 +162,7 @@
\end{pgfonlayer}
}
\end{scope}
% end of remark 6
\%% end of remark 6
{
\draw [->,thick] (line2highlight.east) ..controls +(east:1em) and +(west:1em).. (remark1label.west);
......
......@@ -13,7 +13,7 @@
\draw [->,thick,] (s1.north east) .. controls +(north east:1em) and +(north west:1em).. (t.north west) node[pos=0.5,below] {\tiny{正确翻译}};
\node [draw,red,fill=red!10,thick,anchor=center,circle,inner sep=3.5pt] (s) at ([xshift=13em,yshift=0em]s1.east) {\black{$s$}};
\node [draw,red,fill=red!10,thick,anchor=center,circle,inner sep=3.5pt] (s) at ([xshift=10em,yshift=0em]s1.east) {\black{$s$}};
\node [draw,ublue,fill=blue!10,thick,anchor=center,circle,inner sep=2pt] (t1) at ([xshift=1in]s.east) {\black{$t_1$}};
\node [draw,ublue,fill=blue!10,thick,anchor=center,circle,inner sep=2pt] (t2) at ([xshift=3em,yshift=2em]t1.north east) {\black{$t_2$}};
\node [draw,ublue,fill=blue!10,thick,anchor=center,circle,inner sep=2pt] (t3) at ([xshift=1em,yshift=4em]t1.north east) {\black{$t_3$}};
......@@ -28,10 +28,6 @@
\draw [->,thick,] (s.north) .. controls +(70:4em) and +(west:1em).. (t3.west) node[pos=0.5,above,xshift=-1em] {\tiny{P($t_3|s$)=0.3}};
\draw [->,thick,] (s.south east) .. controls +(300:3em) and +(south west:1em).. (t4.south west) node[pos=0.5,below] {\tiny{P($t_4|s$)=0.1}};
\node [anchor=center] (foot1) at ([xshift=3.8em,yshift=-3em]s1.south) {\footnotesize{人的翻译候选空间}};
\node [anchor=center] (foot2) at ([xshift=7em,yshift=-3em]s.south) {\footnotesize{机器的翻译候选空间}};
\end{tikzpicture}
......
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\definecolor{ugreen}{rgb}{0,0.5,0}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\node [anchor=west,draw,thick,minimum width=7.7em,minimum height=0.8em] (sent) at (0,0) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,red] (s1) at ([yshift=-1.5em]sent.south west) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,ugreen] (s2) at ([xshift=0.7em]s1.east) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,orange] (s3) at ([xshift=0.7em]s2.east) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,ublue] (s4) at ([xshift=0.7em]s3.east) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,purple] (s5) at ([xshift=0.7em]s4.east) {};
{
\node [anchor=west,draw,thick,circle,minimum size=0.3em,red,fill=red] (t1) at ([yshift=-2.0em]s1.west) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,ugreen,fill=ugreen] (t2) at ([xshift=0.7em]t1.east) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,orange,fill=orange] (t3) at ([xshift=0.7em]t2.east) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,ublue,fill=ublue] (t4) at ([xshift=0.7em]t3.east) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,purple,fill=purple] (t5) at ([xshift=0.7em]t4.east) {};
}
{
\node [anchor=west,draw,thick,circle,minimum size=0.3em,red,fill=red] (ft1) at ([yshift=-2.0em]t1.west) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,ublue,fill=ublue] (ft2) at ([xshift=0.7em]ft1.east) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,purple,fill=purple] (ft3) at ([xshift=0.7em]ft2.east) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,ugreen,fill=ugreen] (ft4) at ([xshift=0.7em]ft3.east) {};
\node [anchor=west,draw,thick,circle,minimum size=0.3em,orange,fill=orange] (ft5) at ([xshift=0.7em]ft4.east) {};
}
\draw [->,thick,double] ([yshift=-0.1em]sent.south) -- ([yshift=-0.8em]sent.south);
{
\draw [->,thick] ([yshift=-0.1em]s1.south) -- ([yshift=0.1em]t1.north);
\draw [->,thick] ([yshift=-0.1em]s2.south) -- ([yshift=0.1em]t2.north);
\draw [->,thick] ([yshift=-0.1em]s3.south) -- ([yshift=0.1em]t3.north);
\draw [->,thick] ([yshift=-0.1em]s4.south) -- ([yshift=0.1em]t4.north);
\draw [->,thick] ([yshift=-0.1em]s5.south) -- ([yshift=0.1em]t5.north);
}
{
\draw [->,thick] ([yshift=-0.1em]t1.south) -- ([yshift=0.1em]ft1.north);
\draw [->,thick] ([yshift=-0.1em]t2.south) -- ([yshift=0.1em]ft4.north);
\draw [->,thick] ([yshift=-0.1em]t3.south) -- ([yshift=0.1em]ft5.north);
\draw [->,thick] ([yshift=-0.1em]t4.south) -- ([yshift=0.1em]ft2.north);
\draw [->,thick] ([yshift=-0.1em]t5.south) -- ([yshift=0.1em]ft3.north);
}
{
\node [anchor=north west] (label1) at ([xshift=0.5em,yshift=0.3em]sent.south east) {{\scriptsize \textbf{分析}}};
\node [anchor=north west] (label2) at ([yshift=-0.5em]label1.south west) {{\scriptsize \textbf{转换}}};
\node [anchor=north west] (label3) at ([yshift=-0.5em]label2.south west) {{\scriptsize \textbf{生成}}};
}
\end{tikzpicture}
%---------------------------------------------------------------------
......@@ -6,34 +6,34 @@
\begin{scope}
{\small
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=2em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-2.2em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-2.45em]s2.center) {you};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=1em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.2em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.45em]s2.center) {you};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- (t2.north);
\node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (mark) at ([xshift=0.8em,yshift=-0.7em]s2.south east) {{\color{ugreen} \tiny{\textbf{Yes}}}};
\node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (mark) at ([xshift=0.5em,yshift=-0.2em]s2.south east) {{\color{ugreen} \tiny{\textbf{Yes}}}};
}
\end{scope}
\begin{scope}[xshift=1.8in]
\begin{scope}[xshift=1.3in]
{\small
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=2em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-2.2em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-2.45em]s2.center) {you};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=1em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.2em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.45em]s2.center) {you};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s1.south) -- (t2.north);
\node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1.5pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (mark) at ([xshift=0.8em,yshift=-0.7em]s2.south east) {{\color{red} \tiny{\textbf{No}}}};
\node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1.5pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (mark) at ([xshift=0.5em,yshift=-0.2em]s2.south east) {{\color{red} \tiny{\textbf{No}}}};
}
\end{scope}
\begin{scope}[xshift=3.6in]
\begin{scope}[xshift=2.6in]
{\small
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=2em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-2.2em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-2.45em]s2.center) {you};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=1em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.2em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.45em]s2.center) {you};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- ([yshift=-0.2em]t1.north);
\node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (mark) at ([xshift=0.8em,yshift=-0.7em]s2.south east) {{\color{ugreen} \tiny{\textbf{Yes}}}};
\node [anchor=center,draw=ublue,circle,thick,fill=white,inner sep=1pt,circular drop shadow={shadow xshift=0.1em,shadow yshift=-0.1em}] (mark) at ([xshift=0.5em,yshift=-0.2em]s2.south east) {{\color{ugreen} \tiny{\textbf{Yes}}}};
}
\end{scope}
\end{tikzpicture}
......
......@@ -4,146 +4,146 @@
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
{
{\scriptsize
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.9em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t0.north);
\draw [-] (s2.south) -- (t0.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
\node [anchor=west] (eq) at (p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=1.5in]
{
\begin{scope}[xshift=1.2in]
{\scriptsize
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.9em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t0.north);
\draw [-] (s2.south) -- (t1.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
\node [anchor=west] (eq) at (p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=3in]
{
\begin{scope}[xshift=2.4in]
{\scriptsize
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.9em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t0.north);
\draw [-] (s2.south) -- (t2.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
\node [anchor=west] (eq) at (p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[yshift=-0.6in]
{
\begin{scope}[yshift=-0.5in]
{\scriptsize
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.9em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- (t0.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
\node [anchor=west] (eq) at (p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=1.5in,yshift=-0.6in]
{
\begin{scope}[xshift=1.2in,yshift=-0.5in]
{\scriptsize
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.9em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- ([yshift=-0.2em]t1.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
\node [anchor=west] (eq) at (p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=3in,yshift=-0.6in]
{
\begin{scope}[xshift=2.4in,yshift=-0.5in]
{\scriptsize
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.9em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- ([yshift=-0.2em]t1.north);
\draw [-] (s2.south) -- (t2.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
\node [anchor=west] (eq) at (p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[yshift=-1.2in]
{
\begin{scope}[yshift=-1in]
{\scriptsize
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.9em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t2.north);
\draw [-] (s2.south) -- (t0.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
\node [anchor=west] (eq) at (p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=1.5in,yshift=-1.2in]
{
\begin{scope}[xshift=1.2in,yshift=-1in]
{\scriptsize
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.9em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t2.north);
\draw [-] (s2.south) -- (t1.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\small{+}};
\node [anchor=west] (eq) at (p2.east) {\small{+}};
}
}
\end{scope}
\begin{scope}[xshift=3in,yshift=-1.2in]
{
\begin{scope}[xshift=2.4in,yshift=-1in]
{\scriptsize
\node [anchor=west,inner sep=2pt] (s1) at (0,0) {谢谢};
\node [anchor=west,inner sep=2pt] (s2) at ([xshift=0.4em]s1.east) {};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.4em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.6em]s2.center) {you};
\node [anchor=north,inner sep=2pt] (t1) at ([yshift=-1.7em]s1.center) {thank};
\node [anchor=north,inner sep=2pt] (t2) at ([yshift=-1.9em]s2.center) {you};
\node [anchor=east,inner sep=2pt] (t0) at ([xshift=-0.2em,yshift=-0.05em]t1.west) {$t_0$};
\draw [-] (s1.south) -- (t2.north);
\draw [-] (s2.south) -- (t2.north);
{
\node [anchor=south east,inner sep=0pt] (p) at (t0.north west) {\small{{\color{ugreen} P(}}};
\node [anchor=south west,inner sep=0pt] (p2) at ([yshift=0.2em]t2.north east) {\small{{\color{ugreen} )}}};
\node [anchor=west] (eq) at ([xshift=0.7em]p2.east) {\normalsize{= \ P($s|t$)}};
\node [anchor=west] (eq) at (p2.east) {\normalsize{= \ P($s|t$)}};
}
}
\end{scope}
......
......@@ -6,10 +6,10 @@
\begin{scope}
\node [anchor=west] (s1) at (0,0) {\textbf{}};
\node [anchor=west] (s2) at ([xshift=3em]s1.east) {\textbf{}};
\node [anchor=west] (s3) at ([xshift=3em]s2.east) {\textbf{}};
\node [anchor=west] (s4) at ([xshift=3em]s3.east) {\textbf{表示ʾ}};
\node [anchor=west] (s5) at ([xshift=3em]s4.east) {\textbf{满意}};
\node [anchor=west] (s2) at ([xshift=2em]s1.east) {\textbf{}};
\node [anchor=west] (s3) at ([xshift=2em]s2.east) {\textbf{}};
\node [anchor=west] (s4) at ([xshift=2em]s3.east) {\textbf{表示ʾ}};
\node [anchor=west] (s5) at ([xshift=2em]s4.east) {\textbf{满意}};
\node [anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west) {\scriptsize{\textbf{\color{red}{待翻译句子(已经分词):}}}};
{
......@@ -21,15 +21,15 @@
{\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.8em]t11.south) {me};
\node [anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t13) at ([yshift=-0.8em]t12.south) {I'm};
\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}}}};
\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.8em]t21.south) {with};
\node [anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t23) at ([yshift=-0.8em]t22.south) {for};
\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}}}};
......@@ -38,13 +38,13 @@
\node [anchor=north west,inner sep=1pt,fill=black] (tl31) at (t31.north west) {\tiny{{\color{white} \textbf{3}}}};
\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.8em]t41.south) {show};
\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}}}};
\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.8em]t51.south) {satisfied};
\node [anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t53) at ([yshift=-0.8em]t52.south) {satisfies};
\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}}}};
......@@ -57,9 +57,9 @@
{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft11) at ([yshift=-1.2in]t11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft12) at ([xshift=6.0em]ft11.center) {satisfied};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft13) at ([xshift=6.0em]ft12.center) {with};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft14) at ([xshift=5.0em]ft13.center) {you};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft12) at ([xshift=5.0em]ft11.center) {satisfied};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft13) at ([xshift=5.0em]ft12.center) {with};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft14) at ([xshift=4.0em]ft13.center) {you};
}
{
......
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
\node [anchor=west] (s1) at (0,0) {\textbf{}};
\node [anchor=west] (s2) at ([xshift=3em]s1.east) {\textbf{}};
\node [anchor=west] (s3) at ([xshift=3em]s2.east) {\textbf{}};
\node [anchor=west] (s4) at ([xshift=3em]s3.east) {\textbf{表示}};
\node [anchor=west] (s5) at ([xshift=3em]s4.east) {\textbf{满意}};
\node [anchor=west] (s2) at ([xshift=2em]s1.east) {\textbf{}};
\node [anchor=west] (s3) at ([xshift=2em]s2.east) {\textbf{}};
\node [anchor=west] (s4) at ([xshift=2em]s3.east) {\textbf{表示}};
\node [anchor=west] (s5) at ([xshift=2em]s4.east) {\textbf{满意}};
\node [anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west) {\scriptsize{\textbf{\color{red}{待翻译句子(已经分词):}}}};
......@@ -18,15 +23,15 @@
{\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.8em]t11.south) {me};
\node [anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t13) at ([yshift=-0.8em]t12.south) {I'm};
\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}}}};
\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.8em]t21.south) {with};
\node [anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t23) at ([yshift=-0.8em]t22.south) {for};
\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}}}};
......@@ -35,13 +40,13 @@
\node [anchor=north west,inner sep=1pt,fill=black] (tl31) at (t31.north west) {\tiny{{\color{white} \textbf{3}}}};
\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.8em]t41.south) {show};
\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}}}};
\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.8em]t51.south) {satisfied};
\node [anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t53) at ([yshift=-0.8em]t52.south) {satisfies};
\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}}}};
......@@ -76,23 +81,23 @@
\begin{scope}
{\small
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft11) at ([yshift=-1.4in]t11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft12) at ([xshift=6.0em]ft11.center) {satisfied};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft13) at ([xshift=6.0em]ft12.center) {with};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft14) at ([xshift=5.0em]ft13.center) {you};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft11) at ([yshift=-1.2in]t11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft12) at ([xshift=5.0em]ft11.center) {satisfied};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft13) at ([xshift=5.0em]ft12.center) {with};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft14) at ([xshift=4.0em]ft13.center) {you};
{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft21) at ([yshift=-3em]ft11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft22) at ([xshift=6.0em]ft21.center) {satisfy};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft23) at ([xshift=6.0em]ft22.center) {to};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft24) at ([xshift=5.0em]ft23.center) {you};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft21) at ([yshift=-2em]ft11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft22) at ([xshift=5.0em]ft21.center) {satisfy};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft23) at ([xshift=5.0em]ft22.center) {to};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft24) at ([xshift=4.0em]ft23.center) {you};
}
{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft31) at ([yshift=-3em]ft21.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft32) at ([xshift=6.0em]ft31.center) {satisfy};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft33) at ([xshift=6.0em]ft32.center) {you};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft34) at ([xshift=5.0em]ft33.center) {to};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft31) at ([yshift=-2em]ft21.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft32) at ([xshift=5.0em]ft31.center) {satisfy};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft33) at ([xshift=5.0em]ft32.center) {you};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft34) at ([xshift=4.0em]ft33.center) {to};
}
\node [anchor=north west,inner sep=1pt,fill=black] (ftl11) at (ft11.north west) {\tiny{{\color{white} \textbf{1}}}};
......@@ -157,44 +162,27 @@
\end{scope}
\begin{scope}
{\small
\node [anchor=east] (label4) at ([yshift=0.8em]ft11.west) {翻译就是一条};
\node [anchor=north west] (label4part2) at ([yshift=0.7em]label4.south west) {译文选择路径};
}
{\small
\node [anchor=east] (label5) at ([yshift=0.4em]ft21.west) {不同的译文对};
\node [anchor=north west] (label5part2) at ([yshift=0.7em]label5.south west) {应不同的路径};
}
{\small
\node [anchor=east] (label6) at ([yshift=0.4em]ft31.west) {单词翻译的词};
\node [anchor=north west] (label6part2) at ([yshift=0.7em]label6.south west) {序也可能不同};
{
\node [anchor=east] (label4) at ([yshift=0.4em]ft11.west) {\scriptsize{翻译就是一条}};
\node [anchor=north west] (label4part2) at ([yshift=0.7em]label4.south west) {\scriptsize{译文选择路径}};
}
{\small
\node [anchor=east] (label7) at ([yshift=0.4em]ft41.west) {可能的翻译路};
\node [anchor=north west] (label7part2) at ([yshift=0.7em]label7.south west) {径非常多};
{
\node [anchor=east] (label5) at ([yshift=0.4em]ft21.west) {\scriptsize{不同的译文对}};
\node [anchor=north west] (label5part2) at ([yshift=0.7em]label5.south west) {\scriptsize{应不同的路径}};
}
\end{scope}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{scope}
{
\draw[decorate,thick,decoration={brace,amplitude=5pt}] ([yshift=8em,xshift=1.5em]t53.south east) -- ([xshift=1.5em]t53.south east) node [pos=0.5,right,xshift=0.5em,yshift=2.0em] (label2) {\footnotesize{\textbf{从双语数}}};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {\footnotesize{\textbf{据中自动}}};
\node [anchor=north west] (label2part3) at ([yshift=0.3em]label2part2.south west) {\footnotesize{\textbf{学习词典}}};
\node [anchor=north west] (label2part4) at ([yshift=0.3em]label2part3.south west) {\footnotesize{\textbf{(训练)}}};
\node [anchor=east] (label6) at ([yshift=0.4em]ft31.west) {\scriptsize{单词翻译的词}};
\node [anchor=north west] (label6part2) at ([yshift=0.7em]label6.south west) {\scriptsize{序也可能不同}};
}
{
\draw[decorate,thick,decoration={brace,amplitude=5pt}] ([yshift=-1.0em,xshift=5.7em]t53.south west) -- ([yshift=-10.5em,xshift=5.7em]t53.south west) node [pos=0.5,right,xshift=0.5em,yshift=2.0em] (label3) {\footnotesize{\textbf{利用概率}}};
\node [anchor=north west] (label3part2) at ([yshift=0.3em]label3.south west) {\footnotesize{\textbf{化的词典}}};
\node [anchor=north west] (label3part3) at ([yshift=0.3em]label3part2.south west) {\footnotesize{\textbf{进行翻译}}};
\node [anchor=north west] (label3part4) at ([yshift=0.3em]label3part3.south west) {\footnotesize{\textbf{(解码)}}};
\node [anchor=east] (label7) at ([yshift=0.4em]ft41.west) {\scriptsize{可能的翻译路}};
\node [anchor=north west] (label7part2) at ([yshift=0.7em]label7.south west) {\scriptsize{径非常多}};
}
\end{scope}
\end{scope}
\begin{scope}
......@@ -216,11 +204,15 @@
\begin{scope}
{
\draw [->,ultra thick,ublue,line width=2pt,opacity=0.7] ([xshift=-0.5em,yshift=-0.3em]t13.west) -- ([xshift=0.8em,yshift=-0.3em]t13.east) -- ([xshift=-0.2em,yshift=-0.3em]t21.west) -- ([xshift=0.8em,yshift=-0.3em]t21.east) -- ([xshift=-0.2em,yshift=-0.3em]t31.west) -- ([xshift=0.8em,yshift=-0.3em]t31.east) -- ([xshift=-0.2em,yshift=-0.3em]t41.west) -- ([xshift=0.8em,yshift=-0.3em]t41.east) -- ([xshift=-0.2em,yshift=-0.3em]t51.west) -- ([xshift=1.2em,yshift=-0.3em]t51.east);
\draw [->,ultra thick,ublue,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t21.west) -- ([xshift=0.8em]t21.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t51.west) -- ([xshift=1.2em]t51.east);
}
\draw [->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em,yshift=-0.5em]t13.west) -- ([xshift=0.8em,yshift=-0.5em]t13.east) -- ([xshift=-0.2em,yshift=-0.5em]t22.west) -- ([xshift=0.8em,yshift=-0.5em]t22.east) -- ([xshift=-0.2em,yshift=-0.5em]t31.west) -- ([xshift=0.8em,yshift=-0.5em]t31.east) -- ([xshift=-0.2em,yshift=-0.5em]t41.west) -- ([xshift=0.8em,yshift=-0.5em]t41.east) -- ([xshift=-0.2em,yshift=-0.5em]t52.west) -- ([xshift=1.2em,yshift=-0.5em]t52.east);
\draw [->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t22.west) -- ([xshift=0.8em]t22.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t52.west) -- ([xshift=1.2em]t52.east);
\end{scope}
\end{tikzpicture}
\ No newline at end of file
\end{tikzpicture}
%---------------------------------------------------------------------
%%% outline
%-------------------------------------------------------------------------
\begin{tikzpicture}
\begin{scope}
\node [anchor=west] (s1) at (0,0) {\textbf{}};
\node [anchor=west] (s2) at ([xshift=3em]s1.east) {\textbf{}};
\node [anchor=west] (s3) at ([xshift=3em]s2.east) {\textbf{}};
\node [anchor=west] (s4) at ([xshift=3em]s3.east) {\textbf{表示}};
\node [anchor=west] (s5) at ([xshift=3em]s4.east) {\textbf{满意}};
\node [anchor=west] (s2) at ([xshift=2em]s1.east) {\textbf{}};
\node [anchor=west] (s3) at ([xshift=2em]s2.east) {\textbf{}};
\node [anchor=west] (s4) at ([xshift=2em]s3.east) {\textbf{表示}};
\node [anchor=west] (s5) at ([xshift=2em]s4.east) {\textbf{满意}};
\node [anchor=south west] (sentlabel) at ([yshift=-0.5em]s1.north west) {\scriptsize{\textbf{\color{red}{待翻译句子(已经分词):}}}};
......@@ -18,15 +21,15 @@
{\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.8em]t11.south) {me};
\node [anchor=north,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (t13) at ([yshift=-0.8em]t12.south) {I'm};
\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}}}};
\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.8em]t21.south) {with};
\node [anchor=north,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (t23) at ([yshift=-0.8em]t22.south) {for};
\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}}}};
......@@ -35,13 +38,13 @@
\node [anchor=north west,inner sep=1pt,fill=black] (tl31) at (t31.north west) {\tiny{{\color{white} \textbf{3}}}};
\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.8em]t41.south) {show};
\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}}}};
\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.8em]t51.south) {satisfied};
\node [anchor=north,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=4.5em] (t53) at ([yshift=-0.8em]t52.south) {satisfies};
\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}}}};
......@@ -76,23 +79,23 @@
\begin{scope}
{\small
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft11) at ([yshift=-1.4in]t11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft12) at ([xshift=6.0em]ft11.center) {satisfied};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft13) at ([xshift=6.0em]ft12.center) {with};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft14) at ([xshift=5.0em]ft13.center) {you};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft11) at ([yshift=-1.2in]t11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft12) at ([xshift=5.0em]ft11.center) {satisfied};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft13) at ([xshift=5.0em]ft12.center) {with};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft14) at ([xshift=4.0em]ft13.center) {you};
{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft21) at ([yshift=-3em]ft11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft22) at ([xshift=6.0em]ft21.center) {satisfy};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft23) at ([xshift=6.0em]ft22.center) {to};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft24) at ([xshift=5.0em]ft23.center) {you};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft21) at ([yshift=-2em]ft11.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft22) at ([xshift=5.0em]ft21.center) {satisfy};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft23) at ([xshift=5.0em]ft22.center) {to};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft24) at ([xshift=4.0em]ft23.center) {you};
}
{
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft31) at ([yshift=-3em]ft21.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft32) at ([xshift=6.0em]ft31.center) {satisfy};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft33) at ([xshift=6.0em]ft32.center) {you};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft34) at ([xshift=5.0em]ft33.center) {to};
\node [anchor=west,inner sep=2pt,fill=red!20,minimum height=1.5em,minimum width=2.5em] (ft31) at ([yshift=-2em]ft21.west) {I'm};
\node [anchor=center,inner sep=2pt,fill=purple!20,minimum height=1.5em,minimum width=5em] (ft32) at ([xshift=5.0em]ft31.center) {satisfy};
\node [anchor=center,inner sep=2pt,fill=blue!20,minimum height=1.5em,minimum width=2.5em] (ft33) at ([xshift=5.0em]ft32.center) {you};
\node [anchor=center,inner sep=2pt,fill=green!20,minimum height=1.5em,minimum width=2.5em] (ft34) at ([xshift=4.0em]ft33.center) {to};
}
\node [anchor=north west,inner sep=1pt,fill=black] (ftl11) at (ft11.north west) {\tiny{{\color{white} \textbf{1}}}};
......@@ -157,45 +160,21 @@
\end{scope}
\begin{scope}
{\small
\node [anchor=east] (label4) at ([yshift=0.8em]ft11.west) {翻译就是一条};
\node [anchor=north west] (label4part2) at ([yshift=0.7em]label4.south west) {译文选择路径};
}
{\small
\node [anchor=east] (label5) at ([yshift=0.4em]ft21.west) {不同的译文对};
\node [anchor=north west] (label5part2) at ([yshift=0.7em]label5.south west) {应不同的路径};
}
{\small
\node [anchor=east] (label6) at ([yshift=0.4em]ft31.west) {单词翻译的词};
\node [anchor=north west] (label6part2) at ([yshift=0.7em]label6.south west) {序也可能不同};
}
{\small
\node [anchor=east] (label7) at ([yshift=0.4em]ft41.west) {可能的翻译路};
\node [anchor=north west] (label7part2) at ([yshift=0.7em]label7.south west) {径非常多};
}
\end{scope}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{scope}
{
\draw[decorate,thick,decoration={brace,amplitude=5pt}] ([yshift=8em,xshift=1.5em]t53.south east) -- ([xshift=1.5em]t53.south east) node [pos=0.5,right,xshift=0.5em,yshift=2.0em] (label2) {\footnotesize{\textbf{从双语数}}};
\draw[decorate,thick,decoration={brace,amplitude=5pt,mirror}] ([yshift=8em,xshift=-0.5em]t13.south west) -- ([xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=-0.5em,yshift=2.0em] (label2) {\footnotesize{\textbf{从双语数}}};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {\footnotesize{\textbf{据中自动}}};
\node [anchor=north west] (label2part3) at ([yshift=0.3em]label2part2.south west) {\footnotesize{\textbf{学习词典}}};
\node [anchor=north west] (label2part4) at ([yshift=0.3em]label2part3.south west) {\footnotesize{\textbf{(训练)}}};
}
{
\draw[decorate,thick,decoration={brace,amplitude=5pt}] ([yshift=-1.0em,xshift=5.7em]t53.south west) -- ([yshift=-10.5em,xshift=5.7em]t53.south west) node [pos=0.5,right,xshift=0.5em,yshift=2.0em] (label3) {\footnotesize{\textbf{利用概率}}};
\draw[decorate,thick,decoration={brace,amplitude=5pt,mirror}] ([yshift=-0.2em,xshift=-0.5em]t13.south west) -- ([yshift=-9.5em,xshift=-0.5em]t13.south west) node [pos=0.5,left,xshift=-0.5em,yshift=2.0em] (label3) {\footnotesize{\textbf{利用概率}}};
\node [anchor=north west] (label3part2) at ([yshift=0.3em]label3.south west) {\footnotesize{\textbf{化的词典}}};
\node [anchor=north west] (label3part3) at ([yshift=0.3em]label3part2.south west) {\footnotesize{\textbf{进行翻译}}};
\node [anchor=north west] (label3part4) at ([yshift=0.3em]label3part3.south west) {\footnotesize{\textbf{(解码)}}};
}
\end{scope}
\begin{scope}
{
......@@ -216,11 +195,14 @@
\begin{scope}
{
\draw [->,ultra thick,ublue,line width=2pt,opacity=0.7] ([xshift=-0.5em,yshift=-0.3em]t13.west) -- ([xshift=0.8em,yshift=-0.3em]t13.east) -- ([xshift=-0.2em,yshift=-0.3em]t21.west) -- ([xshift=0.8em,yshift=-0.3em]t21.east) -- ([xshift=-0.2em,yshift=-0.3em]t31.west) -- ([xshift=0.8em,yshift=-0.3em]t31.east) -- ([xshift=-0.2em,yshift=-0.3em]t41.west) -- ([xshift=0.8em,yshift=-0.3em]t41.east) -- ([xshift=-0.2em,yshift=-0.3em]t51.west) -- ([xshift=1.2em,yshift=-0.3em]t51.east);
\draw [->,ultra thick,ublue,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t21.west) -- ([xshift=0.8em]t21.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t51.west) -- ([xshift=1.2em]t51.east);
}
\draw [->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em,yshift=-0.5em]t13.west) -- ([xshift=0.8em,yshift=-0.5em]t13.east) -- ([xshift=-0.2em,yshift=-0.5em]t22.west) -- ([xshift=0.8em,yshift=-0.5em]t22.east) -- ([xshift=-0.2em,yshift=-0.5em]t31.west) -- ([xshift=0.8em,yshift=-0.5em]t31.east) -- ([xshift=-0.2em,yshift=-0.5em]t41.west) -- ([xshift=0.8em,yshift=-0.5em]t41.east) -- ([xshift=-0.2em,yshift=-0.5em]t52.west) -- ([xshift=1.2em,yshift=-0.5em]t52.east);
\draw [->,ultra thick,red,line width=2pt,opacity=0.7] ([xshift=-0.5em]t13.west) -- ([xshift=0.8em]t13.east) -- ([xshift=-0.2em]t22.west) -- ([xshift=0.8em]t22.east) -- ([xshift=-0.2em]t31.west) -- ([xshift=0.8em]t31.east) -- ([xshift=-0.2em]t41.west) -- ([xshift=0.8em]t41.east) -- ([xshift=-0.2em]t52.west) -- ([xshift=1.2em]t52.east);
\end{scope}
\end{tikzpicture}
\ No newline at end of file
\end{tikzpicture}
%---------------------------------------------------------------------
......@@ -4,16 +4,16 @@
\begin{tikzpicture}
\begin{scope}
{
\node [pos=0.5,left,xshift=-0.5em,yshift=2.0em] (label2) {Input: a word pair (x, y) and a sentence pair (s, t)};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {Output: the number of (x, y) in the (s, t)};
\node [anchor=north west] (label2part3) at ([yshift=0.3em]label2part2.south west) {{1:$count$ $\leftarrow$ 0}};
\node [anchor=north west] (label2part4) at ([yshift=0.3em]label2part3.south west) {{2:\textbf{for} $s\underline{\hbox to 0.1cm{}}word$ $\leftarrow$ $S_1$$S_{length(s)}$ \textbf{do} }};
\node [anchor=north west] (label2part5)at ([yshift=0.3em]label2part4.south west) {{3:\quad\textbf{for} $t\underline{\hbox to 0.1cm{}}word$ $\leftarrow$ $t_1$$t_{length(t)}$ \textbf{do} }};
\node [anchor=north west] (label2part6)at ([yshift=0.3em]label2part5.south west) {{4:\quad\quad\textbf{if} $s\underline{\hbox to 0.1cm{}}word$ == x \textbf{and} $t\underline{\hbox to 0.1cm{}}word$==y \textbf{then} }};
\node [anchor=north west] (label2part7) at ([yshift=0.3em]label2part6.south west) {{5:\quad\quad\quad\quad $count$ $\leftarrow$ $count$ + 1 }};
\node [anchor=north west] (label2part8) at ([yshift=0.3em]label2part7.south west) {{6:\quad\quad \textbf{end if} }};
\node [anchor=north west] (label2part9) at ([yshift=0.3em]label2part8.south west) {{7:\quad \textbf{end for} }};
\node [anchor=north west] (label2part10) at ([yshift=0.3em]label2part9.south west) {{8: \textbf{end for} }};
\node [pos=0.5,left,xshift=-0.5em,yshift=2.0em] (label2) {\footnotesize{\textbf{Input: a word pair (x, y) and a sentence pair (s, t)}}};
\node [anchor=north west] (label2part2) at ([yshift=0.3em]label2.south west) {\footnotesize{\textbf{Output: the number of (x, y) in the (s, t)}}};
\node [anchor=north west] (label2part3) at ([yshift=0.3em]label2part2.south west) {\footnotesize{{1:count $\leftarrow$ 0}}};
\node [anchor=north west] (label2part4) at ([yshift=0.3em]label2part3.south west) {\footnotesize{{2:\textbf{for} s\underline{\hbox to 0.1cm{}}word $\leftarrow$ $S_1$$S_length(s)$ \textbf{do} }}};
\node [anchor=north west] (label2part5)at ([yshift=0.3em]label2part4.south west) {\footnotesize{{3:\quad\textbf{for}t\underline{\hbox to 0.1cm{}}word $\leftarrow$ $t_1$$t_length(t)$ \textbf{do} }}};
\node [anchor=north west] (label2part6)at ([yshift=0.3em]label2part5.south west) {\footnotesize{{4:\quad\quad\textbf{if} s\underline{\hbox to 0.1cm{}}word == x \textbf{and} t\underline{\hbox to 0.1cm{}}word==y \textbf{then} }}};
\node [anchor=north west] (label2part7) at ([yshift=0.3em]label2part6.south west) {\footnotesize{{5:\quad\quad\quad\quad count $\leftarrow$ count + 1 }}};
\node [anchor=north west] (label2part8) at ([yshift=0.3em]label2part7.south west) {\footnotesize{{6:\quad\quad \textbf{end if} }}};
\node [anchor=north west] (label2part9) at ([yshift=0.3em]label2part8.south west) {\footnotesize{{7:\quad \textbf{end for} }}};
\node [anchor=north west] (label2part10) at ([yshift=0.3em]label2part9.south west) {\footnotesize{{8: \textbf{end for} }}};
}
......
%%% outline
%-------------------------------------------------------------------------
\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}
}
\node [anchor=west,ugreen] (P) at ([xshift=4em,yshift=-0.7em]corpus.east){P($t|s$)};
\node [anchor=south] (modellabel) at (P.north) {{\color{ublue} {\scriptsize \textbf{翻译模型}}}};
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow,minimum height=1.6cm] [fit = (P) (modellabel)] (model) {};
\end{pgfonlayer}
\draw [->,very thick,ublue] ([xshift=0.2em]corpus.east) -- ([xshift=3.0em]corpus.east) node [inner sep=0pt,pos=0.5,above,yshift=0.3em] (trainingarrow) {\color{red}{\scriptsize{模型学习}}};
\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) {\color{red}{\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{对任意句子}};
\node [anchor=north west] (sentpart2) at ([yshift=0.3em]sent.south west) {\textbf{进行翻译}};
}
\begin{pgfonlayer}{background}
\node[rectangle,draw=ublue,thick,inner sep=0.2em,fill=white,drop shadow,minimum height=1.6cm] [fit = (sentlabel) (sent) (sentpart2)] (segsystem) {};
\end{pgfonlayer}
\node[rectangle,fill=white,fill opacity=0.85,inner sep=0pt] [fit = (segsystem) (decodingarrow)] (segsystem2) {};
\node[rectangle,fill=white,fill opacity=0.85,inner sep=0pt] [fit = (corpus) (trainingarrow)] (corpus2) {};
\end{tikzpicture}
%---------------------------------------------------------------------
......@@ -219,4 +219,89 @@
pages={359--394},
year={1999},
publisher={Elsevier}
}
@book{chomsky2002syntactic,
title={Syntactic structures},
author={Chomsky, Noam},
year={2002},
publisher={Walter de Gruyter}
}
@article{shannon1948mathematical,
title={A mathematical theory of communication},
author={Shannon, Claude E},
journal={Bell system technical journal},
volume={27},
number={3},
pages={379--423},
year={1948},
publisher={Wiley Online Library}
}
@inproceedings{ng2002discriminative,
title={On discriminative vs. generative classifiers: A comparison of logistic regression and naive bayes},
author={Ng, Andrew Y and Jordan, Michael I},
booktitle={Advances in neural information processing systems},
pages={841--848},
year={2002}
}
@article{lafferty2001conditional,
title={Conditional random fields: Probabilistic models for segmenting and labeling sequence data},
author={Lafferty, John and McCallum, Andrew and Pereira, Fernando CN},
year={2001}
}
@article{huang2015bidirectional,
title={Bidirectional LSTM-CRF models for sequence tagging},
author={Huang, Zhiheng and Xu, Wei and Yu, Kai},
journal={arXiv preprint arXiv:1508.01991},
year={2015}
}
@article{ma2016end,
title={End-to-end sequence labeling via bi-directional lstm-cnns-crf},
author={Ma, Xuezhe and Hovy, Eduard},
journal={arXiv preprint arXiv:1603.01354},
year={2016}
}
@article{bengio2003neural,
title={A neural probabilistic language model},
author={Bengio, Yoshua and Ducharme, R{\'e}jean and Vincent, Pascal and Jauvin, Christian},
journal={Journal of machine learning research},
volume={3},
number={Feb},
pages={1137--1155},
year={2003}
}
@inproceedings{mikolov2010recurrent,
title={Recurrent neural network based language model},
author={Mikolov, Tom{\'a}{\v{s}} and Karafi{\'a}t, Martin and Burget, Luk{\'a}{\v{s}} and {\v{C}}ernock{\`y}, Jan and Khudanpur, Sanjeev},
booktitle={Eleventh annual conference of the international speech communication association},
year={2010}
}
@inproceedings{chen2014fast,
title={A fast and accurate dependency parser using neural networks},
author={Chen, Danqi and Manning, Christopher D},
booktitle={Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP)},
pages={740--750},
year={2014}
}
@article{zhu2015long,
title={Long Short-Term Memory Over Tree Structures.},
author={Zhu, Xiaodan and Sobhani, Parinaz and Guo, Hongyu},
journal={arXiv: Computation and Language},
year={2015}
}
@book{aho1972theory,
title={The theory of parsing, translation, and compiling},
author={Aho, Alfred V and Ullman, Jeffrey D},
volume={1},
year={1972},
publisher={Prentice-Hall Englewood Cliffs, NJ}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论