Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
Toy-MT-Introduction
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
单韦乔
Toy-MT-Introduction
Commits
bb63b4d5
Commit
bb63b4d5
authored
Jan 01, 2020
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimal rules
parent
d25e5421
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
450 行增加
和
46 行删除
+450
-46
Section04-Phrasal-and-Syntactic-Models/section04-test.tex
+196
-42
Section04-Phrasal-and-Syntactic-Models/section04.tex
+254
-4
没有找到文件。
Section04-Phrasal-and-Syntactic-Models/section04-test.tex
查看文件 @
bb63b4d5
...
...
@@ -147,28 +147,17 @@
%%%------------------------------------------------------------------------------------------------------------
%%% 规则抽取
\begin{frame}
{
规则抽取
}
\begin{frame}
{
规则抽取
- 树的切割
}
\begin{itemize}
\item
可信节点本质上定义了规则的边界,规则需要满足
\begin{itemize}
\item
左部树片段的根节点是可信节点
\item
左部树片段的叶子节点是终结符或者可信节点
\end{itemize}
\item
所有可信节点构成了句法树的边缘集合(frontier set),进而得到树的一种
\alert
{
切割
}
以及切割得到的树片段(或规则)
\end{itemize}
\begin{center}
{
\footnotesize
\visible
<2->
{
例如:
$
\textrm
{
VP
(
PP
(
P
(
对
)
NP
(
NN
(
回答
)))
VP
}_
1
)
\to
\textrm
{
VP
}_
1
\ \textrm
{
with the answer
}$
}
}
\end{center}
\begin{center}
\begin{tikzpicture}
{
\
footnote
size
\begin{scope}
[s
ibling distance=25pt, level distance=2
0pt]
{
\
script
size
\begin{scope}
[s
cale = 0.9, sibling distance=20pt, level distance=3
0pt]
\Tree
[.
\node
(n1)
{
IP
}
;
[.
\node
(n2)
{
NP
}
; [.
\node
(n3)
{
PN
}
;
\node
(cw1)
{
他
}
; ]]
...
...
@@ -186,30 +175,11 @@
]
]
\node
[anchor=north,minimum size=18pt,align=center]
(tw1) at ([yshift=-6.0em]cw1.south)
{
he
\\\scriptsize
{
1
}}
;
\node
[anchor=west,minimum size=18pt,align=center]
(tw2) at ([yshift=-0.1em,xshift=1.1em]tw1.east)
{
was
\\\scriptsize
{
2
}}
;
\node
[anchor=west,minimum size=18pt,align=center]
(tw3) at ([yshift=0.1em,xshift=1.1em]tw2.east)
{
satisfied
\\\scriptsize
{
3
}}
;
\node
[anchor=west,minimum size=18pt,align=center]
(tw4) at ([xshift=1.1em]tw3.east)
{
with
\\\scriptsize
{
4
}}
;
\node
[anchor=west,minimum size=18pt,align=center]
(tw5) at ([xshift=1.1em]tw4.east)
{
the
\\\scriptsize
{
5
}}
;
\node
[anchor=west,minimum size=18pt,align=center]
(tw6) at ([yshift=-0.1em,xshift=1.1em]tw5.east)
{
answer
\\\scriptsize
{
6
}}
;
\draw
[dashed]
(cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw
[dashed]
(cw2.south) .. controls +(south:1.6) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw
[dashed]
(cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw
[dashed]
(cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw
[dashed]
(cw4.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw
[dashed]
(cw5.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\begin{pgfonlayer}
{
background
}
\visible
<2->
{
\node
[fill=blue!20] [fit = (n5) (cw2) (cw3) (n8)] (rule1box1)
{}
;
\node
[fill=blue!20] [fit = (n4) (n5) (n9)] (rule1box2)
{}
;
\node
[fill=blue!20] [fit = (tw4) (tw5) (tw6)] (rule1box3)
{}
;
}
\visible
<2->
{
\node
[rectangle,fill=orange!20,inner sep=0] [fit = (n11)] (n11box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n4)] (n4box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n1)] (n1box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n2)] (n2box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n3)] (n3box)
{}
;
...
...
@@ -219,20 +189,88 @@
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n8)] (n8box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n9)] (n9box)
{}
;
\node
[rectangle,fill=orange!20,inner sep=0] [fit = (n10)] (n10box)
{}
;
\end{pgfonlayer}
\node
[anchor=north west, minimum size=1.2em, fill=green!20] (land1) at ([xshift=
1.5em,yshift=-1em]cw5.sou
th east)
{}
;
\node
[anchor=north west, minimum size=1.2em, fill=green!20] (land1) at ([xshift=
7.0em,yshift=0em]n1.nor
th east)
{}
;
\node
[anchor=west] (land1label) at (land1.east)
{
\scriptsize
{
可信
}}
;
\node
[anchor=north west, minimum size=1.2em, fill=orange!20] (land2) at ([yshift=-0.3em]land1.south west)
{}
;
\node
[anchor=west] (land2label) at (land2.east)
{
\scriptsize
{
不可信
}}
;
}
\end{pgfonlayer}
\node
[anchor=north,minimum size=18pt]
(tw1) at ([yshift=-10.0em]cw1.south)
{
he
}
;
\node
[anchor=west,minimum size=18pt]
(tw2) at ([yshift=-0.1em,xshift=0.3em]tw1.east)
{
was
}
;
\node
[anchor=west,minimum size=18pt]
(tw3) at ([yshift=0.1em,xshift=0.3em]tw2.east)
{
satisfied
}
;
\node
[anchor=west,minimum size=18pt]
(tw4) at ([xshift=0.3em]tw3.east)
{
with
}
;
\node
[anchor=west,minimum size=18pt]
(tw5) at ([xshift=0.3em]tw4.east)
{
the
}
;
\node
[anchor=west,minimum size=18pt]
(tw6) at ([yshift=-0.1em,xshift=0.3em]tw5.east)
{
answer
}
;
\draw
[dashed]
(cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw
[dashed]
(cw2.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw
[dashed]
(cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw
[dashed]
(cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw
[dashed]
(cw4.south) .. controls +(south:2.5) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw
[dashed]
(cw5.south) .. controls +(south:2.5) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\end{scope}
\begin{scope}
[yshift = -1.87in, xshift = 1.9in]
\visible
<3->
{
\node
[draw,thick,red,fill=red!20] [fit = (n9)] (var1)
{{
\color
{
black
}
VP
}}
;
\node
[draw,thick,red,fill=red!20] [fit = (tw3)] (var1v2)
{{
\color
{
black
}
\large
{
VP
}}}
;
\node
[anchor=west] (var1label) at ([yshift=0.5em]var1.east)
{
\tiny
{
\alert
{
变量
}}}
;
\node
[anchor=south] (var1v2label) at ([xshift=-2em]var1v2.north)
{
\tiny
{
\alert
{
变量
}}}
;
}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,draw]
(cfrag1) at
(0,0.25)
{
\Tree
[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]
]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag2) at
([xshift=1.2em]cfrag1.south east)
{
\Tree
[.\node(sn3){P}; 对 ]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag3) at
([xshift=1.2em]cfrag2.south east)
{
\Tree
[.\node(sn4){NP}; [.NN 回答 ]
]
}
;
\end{scope}
\begin{scope}
[sibling distance=15pt,level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag4) at
([xshift=1.4em]cfrag3.south east)
{
\Tree
[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ]
[.
\node
(sn7)
{
NN
}
; 满意 ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=20pt,,level distance=25pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag5) at
([xshift=0.3em,yshift=2.2em]cfrag2.north west)
{
\Tree
[.\node(sn8){PP}; [.\node(sn9){P}; ]
[.
\node
(sn10)
{
NP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=60pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag6) at
([xshift=1.6em,yshift=0.5em]cfrag5.north west)
{
\Tree
[.\node(sn11){VP}; [.\node(sn12){PP}; ]
[.
\node
(sn13)
{
VP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=80pt,level distance=18pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw]
(cfrag7) at
([xshift=-3.6em,yshift=0.5em]cfrag6.north east)
{
\Tree
[.\node(sn14){IP}; [.\node(sn15){NP}; ]
[.
\node
(sn16)
{
VP
}
; ]]
}
;
\end{scope}
\node
[scale=0.9,anchor=north,minimum size=18pt]
(tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south)
{
he
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east)
{
was
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east)
{
satisfied
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw14) at ([xshift=0.5em]tw13.east)
{
with
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw15) at ([xshift=0.5em]tw14.east)
{
the
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east)
{
answer
}
;
\draw
[dashed]
([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw
[dashed]
(cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw
[dashed]
(cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
}
\end{scope}
}
...
...
@@ -242,6 +280,122 @@
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 最小规则
\begin{frame}
{
规则抽取 - 最小规则
}
\begin{itemize}
\item
边缘集合所对应的树切割,产生了若干树片段,这些树片段内部包含其它的切割点,每个树片段都对应了一条最小翻译规则(即无法继续分解的规则)。见如下示例
\end{itemize}
\begin{minipage}
[b]
{
0.47
\textwidth
}
{
\footnotesize
\renewcommand*
{
\arraystretch
}{
1.3
}
\begin{tabular}
{
l l
}
\visible
<2->
{$
r
_
1
$}
&
\visible
<2->
{
NP(PN(他))
$
\to
$
he
}
\\
\visible
<3->
{$
r
_
2
$}
&
\visible
<3->
{
P(对)
$
\to
$
with
}
\\
\visible
<4->
{$
r
_
3
$}
&
\visible
<4->
{
NP(NN(回答))
$
\to
$
the answer
}
\\
\visible
<5->
{$
r
_
4
$}
&
\visible
<5->
{
VP(VV(表示) NN(满意)
$
\to
$}
\\
&
\visible
<5->
{
satisfied
}
\\
\visible
<6->
{$
r
_
5
$}
&
\visible
<6->
{
PP(P
$_
1
$
NP
$_
2
$
)
$
\to
$}
\\
&
\visible
<6->
{
P
$_
1
$
NP
$_
2
$}
\\
\visible
<6->
{$
r
_
6
$}
&
\visible
<6->
{
VP(PP
$_
1
$
VP
$_
2
$
)
$
\to
$}
\\
&
\visible
<6->
{
VP
$_
2
$
PP
$_
1
$}
\\
\visible
<6->
{$
r
_
7
$}
&
\visible
<6->
{
IP(NP
$_
1
$
VP
$_
2
$
)
$
\to
$}
\\
&
\visible
<6->
{
NP
$_
1
$
VP
$_
2
$}
\\
&
\\
\end{tabular}
\renewcommand*
{
\arraystretch
}{
1.0
}
}
\end{minipage}
\hfill
\begin{minipage}
[t]
{
0.47
\textwidth
}
\begin{tikzpicture}
{
\scriptsize
\begin{scope}
\visible
<1->
{
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,draw]
(cfrag1) at
(0,0.25)
{
\Tree
[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]
]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag2) at
([xshift=1.2em]cfrag1.south east)
{
\Tree
[.\node(sn3){P}; 对 ]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag3) at
([xshift=1.2em]cfrag2.south east)
{
\Tree
[.\node(sn4){NP}; [.NN 回答 ]
]
}
;
\end{scope}
\begin{scope}
[sibling distance=15pt,level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag4) at
([xshift=1.4em]cfrag3.south east)
{
\Tree
[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ]
[.
\node
(sn7)
{
NN
}
; 满意 ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=20pt,,level distance=25pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag5) at
([xshift=0.3em,yshift=2.2em]cfrag2.north west)
{
\Tree
[.\node(sn8){PP}; [.\node(sn9){P}; ]
[.
\node
(sn10)
{
NP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=60pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag6) at
([xshift=1.6em,yshift=0.5em]cfrag5.north west)
{
\Tree
[.\node(sn11){VP}; [.\node(sn12){PP}; ]
[.
\node
(sn13)
{
VP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=80pt,level distance=18pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw]
(cfrag7) at
([xshift=-3.6em,yshift=0.5em]cfrag6.north east)
{
\Tree
[.\node(sn14){IP}; [.\node(sn15){NP}; ]
[.
\node
(sn16)
{
VP
}
; ]]
}
;
\end{scope}
\node
[scale=0.9,anchor=north,minimum size=18pt]
(tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south)
{
he
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east)
{
was
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east)
{
satisfied
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw14) at ([xshift=0.5em]tw13.east)
{
with
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw15) at ([xshift=0.5em]tw14.east)
{
the
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east)
{
answer
}
;
\draw
[dashed]
([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw
[dashed]
(cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw
[dashed]
(cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
\visible
<2->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel1) at (cfrag1.south east)
{{
\color
{
white
}
\tiny
{
1
}}}
;
}
\visible
<3->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel2) at (cfrag2.south east)
{{
\color
{
white
}
\tiny
{
2
}}}
;
}
\visible
<4->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel3) at (cfrag3.south east)
{{
\color
{
white
}
\tiny
{
3
}}}
;
}
\visible
<5->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel4) at (cfrag4.south east)
{{
\color
{
white
}
\tiny
{
4
}}}
;
}
\visible
<6->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel5) at (cfrag5.north west)
{{
\color
{
white
}
\tiny
{
5
}}}
;
\node
[fill=blue,circle,inner sep=2pt] (rlabel6) at (cfrag6.north east)
{{
\color
{
white
}
\tiny
{
6
}}}
;
\node
[fill=blue,circle,inner sep=2pt] (rlabel7) at (cfrag7.south west)
{{
\color
{
white
}
\tiny
{
7
}}}
;
}
}
\end{scope}
}
\end{tikzpicture}
\end{minipage}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
\subsection
{
规则匹配
}
\end{CJK}
...
...
Section04-Phrasal-and-Syntactic-Models/section04.tex
查看文件 @
bb63b4d5
...
...
@@ -3066,7 +3066,6 @@ $\textrm{VP(VV(提高) NN}_1) \to \textrm{increases\ NN}_1$ \\
}
\end{center}
\begin{center}
\begin{tikzpicture}
...
...
@@ -3105,9 +3104,10 @@ $\textrm{VP(VV(提高) NN}_1) \to \textrm{increases\ NN}_1$ \\
\begin{pgfonlayer}
{
background
}
\visible
<2->
{
\node
[fill=blue!20] [fit = (n5) (cw2) (cw3) (n8)] (rule1box1)
{}
;
\node
[fill=blue!20] [fit = (n4) (n5) (n9)] (rule1box2)
{}
;
\node
[fill=blue!20] [fit = (tw4) (tw5) (tw6)] (rule1box3)
{}
;
\node
[fill=blue!30] [fit = (cw2) (cw3) (n7) (n8)] (rule1box1)
{}
;
\node
[fill=blue!30] [fit = (n4) (n9)] (rule1box2)
{}
;
\node
[fill=blue!30] [fit = (tw3) (tw4) (tw5) (tw6)] (rule1box3)
{}
;
\path
[fill=blue!30] ([xshift=0.05em]rule1box2.north west) -- ([xshift=-0.3em,yshift=0.3em]n5.north west) -- ([yshift=-0.05em]rule1box1.north west) -- ([xshift=0.05em,yshift=-0.05em]rule1box2.south west) -- ([xshift=0.05em]rule1box2.north west);
}
\node
[rectangle,fill=orange!20,inner sep=0] [fit = (n11)] (n11box)
{}
;
...
...
@@ -3145,6 +3145,256 @@ $\textrm{VP(VV(提高) NN}_1) \to \textrm{increases\ NN}_1$ \\
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 规则抽取
\begin{frame}
{
规则抽取 - 树的切割
}
\begin{itemize}
\item
所有可信节点构成了句法树的边缘集合(frontier set),进而得到树的一种
\alert
{
切割
}
以及切割得到的树片段(或规则)
\end{itemize}
\begin{center}
\begin{tikzpicture}
{
\scriptsize
\begin{scope}
[scale = 0.9, sibling distance=20pt, level distance=30pt]
\Tree
[.
\node
(n1)
{
IP
}
;
[.
\node
(n2)
{
NP
}
; [.
\node
(n3)
{
PN
}
;
\node
(cw1)
{
他
}
; ]]
[.
\node
(n4)
{
VP
}
;
[.
\node
(n5)
{
PP
}
;
[.
\node
(n6)
{
P
}
;
\node
(cw2)
{
对
}
; ]
[.
\node
(n7)
{
NP
}
;
[.
\node
(n8)
{
NN
}
;
\node
(cw3)
{
回答
}
; ]
]
]
[.
\node
(n9)
{
VP
}
;
[.
\node
(n10)
{
VV
}
;
\node
(cw4)
{
表示
}
; ]
[.
\node
(n11)
{
NN
}
;
\node
(cw5)
{
满意
}
; ]
]
]
]
\begin{pgfonlayer}
{
background
}
\visible
<2->
{
\node
[rectangle,fill=orange!20,inner sep=0] [fit = (n11)] (n11box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n4)] (n4box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n1)] (n1box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n2)] (n2box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n3)] (n3box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n5)] (n5box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n6)] (n6box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n7)] (n7box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n8)] (n8box)
{}
;
\node
[rectangle,fill=green!20,inner sep=0] [fit = (n9)] (n9box)
{}
;
\node
[rectangle,fill=orange!20,inner sep=0] [fit = (n10)] (n10box)
{}
;
\node
[anchor=north west, minimum size=1.2em, fill=green!20] (land1) at ([xshift=7.0em,yshift=0em]n1.north east)
{}
;
\node
[anchor=west] (land1label) at (land1.east)
{
\scriptsize
{
可信
}}
;
\node
[anchor=north west, minimum size=1.2em, fill=orange!20] (land2) at ([yshift=-0.3em]land1.south west)
{}
;
\node
[anchor=west] (land2label) at (land2.east)
{
\scriptsize
{
不可信
}}
;
}
\end{pgfonlayer}
\node
[anchor=north,minimum size=18pt]
(tw1) at ([yshift=-10.0em]cw1.south)
{
he
}
;
\node
[anchor=west,minimum size=18pt]
(tw2) at ([yshift=-0.1em,xshift=0.3em]tw1.east)
{
was
}
;
\node
[anchor=west,minimum size=18pt]
(tw3) at ([yshift=0.1em,xshift=0.3em]tw2.east)
{
satisfied
}
;
\node
[anchor=west,minimum size=18pt]
(tw4) at ([xshift=0.3em]tw3.east)
{
with
}
;
\node
[anchor=west,minimum size=18pt]
(tw5) at ([xshift=0.3em]tw4.east)
{
the
}
;
\node
[anchor=west,minimum size=18pt]
(tw6) at ([yshift=-0.1em,xshift=0.3em]tw5.east)
{
answer
}
;
\draw
[dashed]
(cw1.south) -- ([yshift=-0.4em]tw1.north);
\draw
[dashed]
(cw2.south) .. controls +(south:2.0) and +(north:0.6) .. ([yshift=-0.4em]tw4.north);
\draw
[dashed]
(cw3.south) -- ([yshift=-0.4em]tw5.north);
\draw
[dashed]
(cw3.south) -- ([yshift=-0.4em]tw6.north);
\draw
[dashed]
(cw4.south) .. controls +(south:2.5) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\draw
[dashed]
(cw5.south) .. controls +(south:2.5) and +(north:0.6) .. ([yshift=-0.4em]tw3.north);
\end{scope}
\begin{scope}
[yshift = -1.87in, xshift = 1.9in]
\visible
<3->
{
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,draw]
(cfrag1) at
(0,0.25)
{
\Tree
[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]
]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag2) at
([xshift=1.2em]cfrag1.south east)
{
\Tree
[.\node(sn3){P}; 对 ]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag3) at
([xshift=1.2em]cfrag2.south east)
{
\Tree
[.\node(sn4){NP}; [.NN 回答 ]
]
}
;
\end{scope}
\begin{scope}
[sibling distance=15pt,level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag4) at
([xshift=1.4em]cfrag3.south east)
{
\Tree
[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ]
[.
\node
(sn7)
{
NN
}
; 满意 ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=20pt,,level distance=25pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag5) at
([xshift=0.3em,yshift=2.2em]cfrag2.north west)
{
\Tree
[.\node(sn8){PP}; [.\node(sn9){P}; ]
[.
\node
(sn10)
{
NP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=60pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag6) at
([xshift=1.6em,yshift=0.5em]cfrag5.north west)
{
\Tree
[.\node(sn11){VP}; [.\node(sn12){PP}; ]
[.
\node
(sn13)
{
VP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=80pt,level distance=18pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw]
(cfrag7) at
([xshift=-3.6em,yshift=0.5em]cfrag6.north east)
{
\Tree
[.\node(sn14){IP}; [.\node(sn15){NP}; ]
[.
\node
(sn16)
{
VP
}
; ]]
}
;
\end{scope}
\node
[scale=0.9,anchor=north,minimum size=18pt]
(tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south)
{
he
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east)
{
was
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east)
{
satisfied
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw14) at ([xshift=0.5em]tw13.east)
{
with
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw15) at ([xshift=0.5em]tw14.east)
{
the
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east)
{
answer
}
;
\draw
[dashed]
([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw
[dashed]
(cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw
[dashed]
(cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
}
\end{scope}
}
\end{tikzpicture}
\end{center}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 最小规则
\begin{frame}
{
规则抽取 - 最小规则
}
\begin{itemize}
\item
边缘集合所对应的树切割,产生了若干树片段,这些树片段内部包含其它的切割点,每个树片段都对应了一条最小翻译规则(即无法继续分解的规则)。见如下示例
\end{itemize}
\begin{minipage}
[b]
{
0.47
\textwidth
}
{
\footnotesize
\renewcommand*
{
\arraystretch
}{
1.3
}
\begin{tabular}
{
l l
}
\visible
<2->
{$
r
_
1
$}
&
\visible
<2->
{
NP(PN(他))
$
\to
$
he
}
\\
\visible
<3->
{$
r
_
2
$}
&
\visible
<3->
{
P(对)
$
\to
$
with
}
\\
\visible
<4->
{$
r
_
3
$}
&
\visible
<4->
{
NP(NN(回答))
$
\to
$
the answer
}
\\
\visible
<5->
{$
r
_
4
$}
&
\visible
<5->
{
VP(VV(表示) NN(满意)
$
\to
$}
\\
&
\visible
<5->
{
satisfied
}
\\
\visible
<6->
{$
r
_
5
$}
&
\visible
<6->
{
PP(P
$_
1
$
NP
$_
2
$
)
$
\to
$}
\\
&
\visible
<6->
{
P
$_
1
$
NP
$_
2
$}
\\
\visible
<6->
{$
r
_
6
$}
&
\visible
<6->
{
VP(PP
$_
1
$
VP
$_
2
$
)
$
\to
$}
\\
&
\visible
<6->
{
VP
$_
2
$
PP
$_
1
$}
\\
\visible
<6->
{$
r
_
7
$}
&
\visible
<6->
{
IP(NP
$_
1
$
VP
$_
2
$
)
$
\to
$}
\\
&
\visible
<6->
{
NP
$_
1
$
VP
$_
2
$}
\\
&
\\
\end{tabular}
\renewcommand*
{
\arraystretch
}{
1.0
}
}
\end{minipage}
\hfill
\begin{minipage}
[t]
{
0.47
\textwidth
}
\begin{tikzpicture}
{
\scriptsize
\begin{scope}
\visible
<1->
{
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,draw]
(cfrag1) at
(0,0.25)
{
\Tree
[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]
]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag2) at
([xshift=1.2em]cfrag1.south east)
{
\Tree
[.\node(sn3){P}; 对 ]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag3) at
([xshift=1.2em]cfrag2.south east)
{
\Tree
[.\node(sn4){NP}; [.NN 回答 ]
]
}
;
\end{scope}
\begin{scope}
[sibling distance=15pt,level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag4) at
([xshift=1.4em]cfrag3.south east)
{
\Tree
[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ]
[.
\node
(sn7)
{
NN
}
; 满意 ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=20pt,,level distance=25pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag5) at
([xshift=0.3em,yshift=2.2em]cfrag2.north west)
{
\Tree
[.\node(sn8){PP}; [.\node(sn9){P}; ]
[.
\node
(sn10)
{
NP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=60pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag6) at
([xshift=1.6em,yshift=0.5em]cfrag5.north west)
{
\Tree
[.\node(sn11){VP}; [.\node(sn12){PP}; ]
[.
\node
(sn13)
{
VP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=80pt,level distance=18pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw]
(cfrag7) at
([xshift=-3.6em,yshift=0.5em]cfrag6.north east)
{
\Tree
[.\node(sn14){IP}; [.\node(sn15){NP}; ]
[.
\node
(sn16)
{
VP
}
; ]]
}
;
\end{scope}
\node
[scale=0.9,anchor=north,minimum size=18pt]
(tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south)
{
he
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east)
{
was
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east)
{
satisfied
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw14) at ([xshift=0.5em]tw13.east)
{
with
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw15) at ([xshift=0.5em]tw14.east)
{
the
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east)
{
answer
}
;
\draw
[dashed]
([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw
[dashed]
(cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw
[dashed]
(cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
\visible
<2->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel1) at (cfrag1.south east)
{{
\color
{
white
}
\tiny
{
1
}}}
;
}
\visible
<3->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel2) at (cfrag2.south east)
{{
\color
{
white
}
\tiny
{
2
}}}
;
}
\visible
<4->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel3) at (cfrag3.south east)
{{
\color
{
white
}
\tiny
{
3
}}}
;
}
\visible
<5->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel4) at (cfrag4.south east)
{{
\color
{
white
}
\tiny
{
4
}}}
;
}
\visible
<6->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel5) at (cfrag5.north west)
{{
\color
{
white
}
\tiny
{
5
}}}
;
\node
[fill=blue,circle,inner sep=2pt] (rlabel6) at (cfrag6.north east)
{{
\color
{
white
}
\tiny
{
6
}}}
;
\node
[fill=blue,circle,inner sep=2pt] (rlabel7) at (cfrag7.south west)
{{
\color
{
white
}
\tiny
{
7
}}}
;
}
}
\end{scope}
}
\end{tikzpicture}
\end{minipage}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 基于树结构的翻译文法 - 树到树
\begin{frame}
{
树到树规则抽取
}
% 我的博士论文
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论