Commit ba50f919 by 姜雨帆

Add Rule Extraction

parent 5ba56e98
......@@ -3460,6 +3460,126 @@ d = r_1 \circ r_2 \circ r_3 \circ r_4
%%% 翻译规则抽取
\begin{frame}{层次短语规则抽取}
% 还是David Chiang的论文
\begin{itemize}
\item 如何抽取规则
\begin{itemize}
\item 首先进行短语抽取,从词对齐矩阵中抽取得到所有与词对齐保持一致的短语对
\item<3-> 在抽取得到的短语中,找到其中包含的子短语,使用非终结符进行替换,就得到了一条规则
\end{itemize}
\end{itemize}
\vspace{-1.5em}
\begin{center}
\begin{tikzpicture}
\setlength{\wseg}{1.5cm}
\setlength{\hseg}{1.0cm}
\setlength{\wnode}{3.75cm}
\setlength{\hnode}{1.1cm}
\tikzstyle{elementnode} = [rectangle,text=white,anchor=center]
\tikzstyle{srcnode} = [rotate=45,font=\small,anchor=south west]
\tikzstyle{tgtnode} = [left,font=\small,anchor=north east]
\tikzstyle{alignmentnode} = [rectangle,draw,minimum height=3.6\hnode,minimum width=0.36\hnode]
\tikzstyle{probnode} = [fill=blue!30,minimum width=0.4\hnode]
\tikzstyle{labelnode} = [above]
% alignment matrix
\begin{scope}[scale=1.0,yshift=0.12in]
\foreach \i / \j / \c in
{0/5/0.15, 1/5/0.15, 2/5/0.15, 3/5/0.15, 4/5/0.15, 5/5/0.15, 6/5/0.15, 7/5/0.15,
0/4/0.15, 1/4/0.15, 2/4/0.15, 3/4/0.15, 4/4/0.15, 5/4/0.15, 6/4/0.15, 7/4/0.15,
0/3/0.15, 1/3/0.15, 2/3/0.15, 3/3/0.15, 4/3/0.15, 5/3/0.15, 6/3/0.15, 7/3/0.15,
0/2/0.15, 1/2/0.15, 2/2/0.15, 3/2/0.15, 4/2/0.15, 5/2/0.15, 6/2/0.15, 7/2/0.15,
0/1/0.15, 1/1/0.15, 2/1/0.15, 3/1/0.15, 4/1/0.15, 5/1/0.15, 6/1/0.15, 7/1/0.15,
0/0/0.15, 1/0/0.15, 2/0/0.15, 3/0/0.15, 4/0/0.15, 5/0/0.15, 6/0/0.15, 7/0/0.15}
\node[elementnode,minimum size=0.6*\hnode*\c,inner sep=0.1pt,fill=blue] (a\i\j) at (0.5*\hnode*\i-5.4*0.5*\hnode,0.5*\hnode*\j-0.05*\hnode) {};
% source
\node[srcnode] (src1) at (-5.4*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{The}};
\node[srcnode] (src2) at ([xshift=0.5\hnode]src1.south west) {\scriptsize{weather}};
\node[srcnode] (src3) at ([xshift=0.5\hnode]src2.south west) {\scriptsize{is}};
\node[srcnode] (src4) at ([xshift=0.5\hnode]src3.south west) {\scriptsize{very}};
\node[srcnode] (src5) at ([xshift=0.5\hnode]src4.south west) {\scriptsize{good}};
\node[srcnode] (src6) at ([xshift=0.5\hnode]src5.south west) {\scriptsize{today}};
\node[srcnode] (src7) at ([xshift=0.5\hnode]src6.south west) {\scriptsize{.}};
\node[srcnode] (src8) at ([xshift=0.5\hnode]src7.south west) {\scriptsize{EOS}};
% target
\node[tgtnode] (tgt1) at (-6.0*0.5*\hnode,-1.05*\hnode+7.5*0.5*\hnode) {\scriptsize{今天}};
\node[tgtnode] (tgt2) at ([yshift=-0.5\hnode]tgt1.north east) {\scriptsize{天气}};
\node[tgtnode] (tgt3) at ([yshift=-0.5\hnode]tgt2.north east) {\scriptsize{}};
\node[tgtnode] (tgt4) at ([yshift=-0.5\hnode]tgt3.north east) {\scriptsize{}};
\node[tgtnode] (tgt5) at ([yshift=-0.5\hnode]tgt4.north east) {\scriptsize{}};
\node[tgtnode] (tgt6) at ([yshift=-0.5\hnode]tgt5.north east) {\scriptsize{EOS}};
% word alignment
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l04) at (a04) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l14) at (a14) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l55) at (a55) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l33) at (a33) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l42) at (a42) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l61) at (a61) {};
\node[align=center,elementnode,minimum size=0.3cm,inner sep=0.1pt,fill=blue!50] (l70) at (a70) {};
\begin{pgfonlayer}{background}
\visible<2->{
\node [rectangle,draw=red,thick,inner sep=0.6em,fill=white,drop shadow] [fit = (a04) (a14) (a24) (a33) (a42)] (phrase1) {};
}
\visible<3->{
\node [rectangle,draw=ugreen,thick,inner sep=0.4em,fill=white,drop shadow] [fit = (a04) (a14)] (phrase2) {};
}
\end{pgfonlayer}
\end{scope}
\begin{scope}[xshift = 1.3in, yshift = 1.8in]
{\scriptsize
\node (phrase) {\textbf{抽取得到的短语:}};
\draw[-] (phrase.south west)--([xshift=1.9in]phrase.south west);
\node[anchor=north west] (rules) at ([yshift=-7.5em]phrase.south west) {\textbf{抽取得到的规则:}};
\draw[-] (rules.south west)--([xshift=1.9in]rules.south west);
\visible<2->{
\node[anchor=north west] (p1) at ([yshift=-0.3em]phrase.south west) {天气真好 -- The weather is very good};
}
\visible<3->{
\node[anchor=north west] (r1) at ([yshift=-0.3em]rules.south west) {$\mathrm{X_1}$真好 -- $\mathrm{X_1}$ is very good};
}
\visible<4->{
\node[anchor=north west] (p2) at ([yshift=-0.4em]p1.south west) {天气 -- The weather is};
\node[anchor=north west] (p3) at ([yshift=-0.4em]p2.south west) {天气真 -- The weather is very};
\node[anchor=north west] (p4) at ([yshift=-0.4em]p3.south west) {...};
\node[anchor=north west] (r2) at ([yshift=-0.4em]r1.south west) {天气真$\mathrm{X_1}$ -- The weather is very $\mathrm{X_1}$};
\node[anchor=north west] (r3) at ([yshift=-0.4em]r2.south west) {$\mathrm{X_1}$$\mathrm{X_2}$ -- $\mathrm{X_1}$ is very $\mathrm{X_2}$};
\node[anchor=north west] (r4) at ([yshift=-0.4em]r3.south west) {...};
}
\begin{pgfonlayer}{background}
\visible<2-3>{
\node [rectangle,thick,inner sep=0.1em,fill=red!20] [fit = (p1)] (pb1) {};
}
\visible<2>{
\draw [->,thick,dotted] ([xshift=0.1em]phrase1.east) .. controls +(east:2) and +(west:1.5) .. ([xshift=-0.1em]p1.west);
}
\visible<3>{
\node [rectangle,thick,inner sep=0.1em,fill=ugreen!20] [fit = (r1)] (rb1) {};
\draw [->,thick,dotted] ([xshift=0.1em]phrase1.east) .. controls +(east:2) and +(west:1.5) .. ([xshift=-0.1em]r1.west);
}
\visible<4->{
\node [rectangle,thick,inner sep=0.1em,fill=red!20] [fit = (p1) (p4)] (pb2) {};
\node [rectangle,thick,inner sep=0.1em,fill=ugreen!20] [fit = (r1) (r2) (r4)] (rb2) {};
}
\end{pgfonlayer}
}
\end{scope}
\end{tikzpicture}
\end{center}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论