Commit ef6fc825 by xiaotong

hyper graph

parent 6342f26c
......@@ -158,34 +158,62 @@
\item 规则匹配后形成的超图,每个节点可以由两部分信息决定:节点的句法标记 + 跨度
\begin{itemize}
\item 这本质上和单语句法分析中的表示方法是一致的
\item 存储形式有很多中,这里采用常用的chart结构,即,用一个二维表存储,其中每一个单元对应一个跨度(span)。同一个跨度的节点都可以放到同一个表单元中,一表单元的节点用句法标记区分
\item 存储形式有很多中,这里采用常用的chart结构,即,用一个二维表存储,其中每一个单元对应一个跨度(span)。同一个跨度的节点都可以放到同一个表单元中,一表单元的节点用句法标记区分
\end{itemize}
\end{itemize}
\begin{center}
\begin{tikzpicture}
\visible<2->{
\begin{scope}
\node [anchor=west,circle,inner sep=2pt,draw,fill=red!20] (node1) at (0,0) {\tiny{[1,1]}};
\node [anchor=west,circle,inner sep=2pt,draw,fill=blue!20] (node2) at ([xshift=3.3em]node1.east) {\tiny{[3,3]}};
\node [anchor=north,circle,inner sep=2pt,draw,fill=green!20] (node3) at ([xshift=2.5em,yshift=5em]node1.north) {\tiny{[1,3]}};
\node [anchor=north] (rulelabel) at ([yshift=-0.5em,xshift=2em]node1.south east) {\tiny{规则$r$所对应的超图}};
\draw [-latex] (node1.90) ..controls +(north:3em) and +(south:3em).. (node3.-90);
\draw [-latex] (node2.90) ..controls +(north:3em) and +(south:3em).. (node3.-90);
\node [anchor=west] (rule1) at ([xshift=2em]node3.east) {\footnotesize{VP(AD$_1$ VP(VV(下降)) AS$_2$)}};
\node [anchor=west] (rule1) at ([xshift=6em]node3.east) {\footnotesize{VP(AD$_1$ VP(VV(下降)) AS$_2$)}};
\node [anchor=north west] (rule2) at (rule1.south west) {\footnotesize{$\to$ AS$_2$ AD$_1$ fallen}};
\node [anchor=south] (rulelabel) at ([yshift=-0.4em]rule1.north) {\tiny{规则$r$}};
\begin{pgfonlayer}{background}
\visible<2->{
\node [anchor=north west,fill=green!20,inner sep=2pt,minimum height=1.5em,minimum width=1.3em] (nodebox1) at ([xshift=0.2em]rule1.north west) {};
\node [anchor=north west,fill=red!20,inner sep=2pt,minimum height=1.5em,minimum width=1.8em] (nodebox2) at ([xshift=0.2em]nodebox1.north east) {};
\node [anchor=north east,fill=blue!20,inner sep=2pt,minimum height=1.5em,minimum width=1.6em] (nodebox1) at ([xshift=-0.6em]rule1.north east) {};
}
\end{pgfonlayer}
\end{scope}
\tikzstyle{chartnode}=[rectangle,minimum size=1.3em,draw]
\node [chartnode,anchor=north west] (cell11) at ([yshift=-2em]rule2.south west) {};
\node [chartnode,anchor=north west] (cell21) at ([yshift=-0em]cell11.south west) {};
\node [chartnode,anchor=west] (cell22) at (cell21.east) {};
\node [chartnode,anchor=north west] (cell31) at ([yshift=-0em]cell21.south west) {};
\node [chartnode,anchor=west] (cell32) at (cell31.east) {};
\node [chartnode,anchor=west] (cell33) at (cell32.east) {};
\node [anchor=north] (chartlabel) at (cell32.south) {\scriptsize{chart}};
\visible<3->{
\node [chartnode,anchor=north west,fill=red!20] (cell11) at ([yshift=-2em]rule2.south west) {};
\node [chartnode,anchor=north west,fill=blue!20] (cell31) at ([yshift=-0em]cell21.south west) {};
\node [chartnode,anchor=west,fill=green!20] (cell33) at (cell32.east) {};
\draw [<-,dotted,thick] ([xshift=0.1em]node3.60) ..controls +(60:0.5) and +(120:0.5).. (rule1.north west);
\draw [->,dotted] ([xshift=0.1em]node3.-60)..controls +(-60:3em) and +(north:7em).. (cell33.center);
\draw [->,dotted] ([xshift=0.1em]node2.0)..controls +(east:2em) and +(west:3em).. (cell31.center);
\draw [->,dotted] ([xshift=0.1em]node1.60)..controls +(60:1.5em) and +(120:2em).. (cell11.center);
}
\visible<4->{
\node [anchor=north west,fill=green!20,drop shadow,align=left] (cellbox) at ([yshift=4em,xshift=1em]cell33.north east) {\scriptsize{表单元表示覆盖单词1-3的跨度}\\\scriptsize{保存跨度[1,3]上的所有节点}\\\scriptsize{VP [1,3]}\\\scriptsize{NP [1,3]}\\\scriptsize{...}};
\draw [->] ([xshift=-0.2em,yshift=-0.2em]cell33.north east)..controls +(north:2.5em) and +(west:1em).. ([yshift=2em]cellbox.west);
}
\begin{scope}
\end{scope}
}
\end{tikzpicture}
\end{center}
......
......@@ -4539,6 +4539,75 @@ NP-BAR(NN$_1$ NP-BAR$_2$) $\to$ NN$_1$ NP-BAR$_2$
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 基于树的解码方法 - chart
\begin{frame}{基于树的解码 - chart}
\begin{itemize}
\item 规则匹配后形成的超图,每个节点可以由两部分信息决定:节点的句法标记 + 跨度
\begin{itemize}
\item 这本质上和单语句法分析中的表示方法是一致的
\item 存储形式有很多中,这里采用常用的chart结构,即,用一个二维表存储,其中每一个单元对应一个跨度(span)。同一个跨度的节点都可以放到同一个表单元中,同一表单元的节点用句法标记区分
\end{itemize}
\end{itemize}
\begin{center}
\begin{tikzpicture}
\visible<2->{
\begin{scope}
\node [anchor=west,circle,inner sep=2pt,draw,fill=red!20] (node1) at (0,0) {\tiny{[1,1]}};
\node [anchor=west,circle,inner sep=2pt,draw,fill=blue!20] (node2) at ([xshift=3.3em]node1.east) {\tiny{[3,3]}};
\node [anchor=north,circle,inner sep=2pt,draw,fill=green!20] (node3) at ([xshift=2.5em,yshift=5em]node1.north) {\tiny{[1,3]}};
\node [anchor=north] (rulelabel) at ([yshift=-0.5em,xshift=2em]node1.south east) {\tiny{规则$r$所对应的超图}};
\draw [-latex] (node1.90) ..controls +(north:3em) and +(south:3em).. (node3.-90);
\draw [-latex] (node2.90) ..controls +(north:3em) and +(south:3em).. (node3.-90);
\node [anchor=west] (rule1) at ([xshift=6em]node3.east) {\footnotesize{VP(AD$_1$ VP(VV(下降)) AS$_2$)}};
\node [anchor=north west] (rule2) at (rule1.south west) {\footnotesize{$\to$ AS$_2$ AD$_1$ fallen}};
\node [anchor=south] (rulelabel) at ([yshift=-0.4em]rule1.north) {\tiny{规则$r$}};
\begin{pgfonlayer}{background}
\visible<2->{
\node [anchor=north west,fill=green!20,inner sep=2pt,minimum height=1.5em,minimum width=1.3em] (nodebox1) at ([xshift=0.2em]rule1.north west) {};
\node [anchor=north west,fill=red!20,inner sep=2pt,minimum height=1.5em,minimum width=1.8em] (nodebox2) at ([xshift=0.2em]nodebox1.north east) {};
\node [anchor=north east,fill=blue!20,inner sep=2pt,minimum height=1.5em,minimum width=1.6em] (nodebox1) at ([xshift=-0.6em]rule1.north east) {};
}
\end{pgfonlayer}
\tikzstyle{chartnode}=[rectangle,minimum size=1.3em,draw]
\node [chartnode,anchor=north west] (cell11) at ([yshift=-2em]rule2.south west) {};
\node [chartnode,anchor=north west] (cell21) at ([yshift=-0em]cell11.south west) {};
\node [chartnode,anchor=west] (cell22) at (cell21.east) {};
\node [chartnode,anchor=north west] (cell31) at ([yshift=-0em]cell21.south west) {};
\node [chartnode,anchor=west] (cell32) at (cell31.east) {};
\node [chartnode,anchor=west] (cell33) at (cell32.east) {};
\node [anchor=north] (chartlabel) at (cell32.south) {\scriptsize{chart}};
\visible<3->{
\node [chartnode,anchor=north west,fill=red!20] (cell11) at ([yshift=-2em]rule2.south west) {};
\node [chartnode,anchor=north west,fill=blue!20] (cell31) at ([yshift=-0em]cell21.south west) {};
\node [chartnode,anchor=west,fill=green!20] (cell33) at (cell32.east) {};
\draw [<-,dotted,thick] ([xshift=0.1em]node3.60) ..controls +(60:0.5) and +(120:0.5).. (rule1.north west);
\draw [->,dotted] ([xshift=0.1em]node3.-60)..controls +(-60:3em) and +(north:7em).. (cell33.center);
\draw [->,dotted] ([xshift=0.1em]node2.0)..controls +(east:2em) and +(west:3em).. (cell31.center);
\draw [->,dotted] ([xshift=0.1em]node1.60)..controls +(60:1.5em) and +(120:2em).. (cell11.center);
}
\visible<4->{
\node [anchor=north west,fill=green!20,drop shadow,align=left] (cellbox) at ([yshift=4em,xshift=1em]cell33.north east) {\scriptsize{表单元表示覆盖单词1-3的跨度}\\\scriptsize{保存跨度[1,3]上的所有节点}\\\scriptsize{VP [1,3]}\\\scriptsize{NP [1,3]}\\\scriptsize{...}};
\draw [->] ([xshift=-0.2em,yshift=-0.2em]cell33.north east)..controls +(north:2.5em) and +(west:1em).. ([yshift=2em]cellbox.west);
}
\end{scope}
}
\end{tikzpicture}
\end{center}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 基于串的解码
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论