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
0d5eebbc
Commit
0d5eebbc
authored
Jan 01, 2020
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
composed rules
parent
bb63b4d5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
341 行增加
和
158 行删除
+341
-158
Section04-Phrasal-and-Syntactic-Models/section04-test.tex
+36
-158
Section04-Phrasal-and-Syntactic-Models/section04.tex
+305
-0
没有找到文件。
Section04-Phrasal-and-Syntactic-Models/section04-test.tex
查看文件 @
0d5eebbc
...
...
@@ -146,144 +146,10 @@
\subsection
{
翻译规则抽取
}
%%%------------------------------------------------------------------------------------------------------------
%%%
规则抽取
\begin{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
边缘集合所对应的树切割,产生了若干树片段,这些树片段内部包含其它的切割点,每个树片段都对应了一条最小翻译规则(即无法继续分解的规则)。见如下示例
\item
最小规则之间可以进行组合,得到更大粒度的组合规则,可以使用更多上下文信息,并进行更复杂的调序。比如,三条最小规则组合成一条composed-3规则
\end{itemize}
\begin{minipage}
[b]
{
0.47
\textwidth
}
...
...
@@ -291,17 +157,17 @@
\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
$}
\\
&
\\
\visible
<
2->
{$
r
_
5
$}
&
\visible
<2->
{
PP(P
$_
1
$
NP
$_
2
$
)
$
\to
$
P
$_
1
$
NP
$_
2
$
}
\\
\visible
<
2->
{$
r
_
6
$}
&
\visible
<2->
{
VP(PP
$_
1
$
VP
$_
2
$
)
$
\to
$
VP
$_
2
$
PP
$_
1
$
}
\\
\visible
<
2->
{$
r
_
7
$}
&
\visible
<2->
{
IP(NP
$_
1
$
VP
$_
2
$
)
$
\to
$
NP
$_
1
$
VP
$_
2
$}
\\
\visible
<3->
{
\alert
{$
r
_{
1
,
7
}$}}
&
\visible
<3->
{
IP(NP(PN(他)) VP
$_
1
$
)
$
\to
$
}
\\
&
\visible
<3->
{
he VP
$_
1
$}
\\
\visible
<4->
{
\alert
{$
r
_{
1
,
6
}$}}
&
\visible
<4->
{
IP(NP(PN(他)) VP(PP
$_
1
$
VP
$_
2
$
))
}
\\
\visible
<
4->
{
\alert
{
\
$^{
,
7
}$}}
&
\visible
<4->
{$
\to
$
he VP
$_
2
$
PP
$_
1
$}
\\
\visible
<5->
{
\alert
{$
r
_{
1
,
5
}$}}
&
\visible
<5->
{
IP(NP(PN(他))
}
\\
\visible
<
5->
{
\alert
{
\
$^{
,
6
,
7
}$}}
&
\visible
<5->
{
VP(P
$_
1
$
NP
$_
2
$
VP
$_
3
$
))
}
\\
&
\visible
<5->
{$
\to
$
he VP
$_
3
$
P
$_
1
$
NP
$_
2
$}
\\
&
\\
\end{tabular}
\renewcommand*
{
\arraystretch
}{
1.0
}
}
...
...
@@ -313,7 +179,7 @@
{
\scriptsize
\begin{scope}
\visible
<
1
->
{
\visible
<
2
->
{
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,draw]
(cfrag1) at
(0,0.25)
{
\Tree
[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]
]
}
;
...
...
@@ -369,23 +235,35 @@
\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
->
{
\visible
<
3
->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel1) at (cfrag1.south east)
{{
\color
{
white
}
\tiny
{
1
}}}
;
\draw
[*-*,red,thick]
([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
}
\visible
<5->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel5) at (cfrag5.north west)
{{
\color
{
white
}
\tiny
{
5
}}}
;
\draw
[*-*,red]
([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
}
\visible
<4->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel6) at (cfrag6.north east)
{{
\color
{
white
}
\tiny
{
6
}}}
;
\draw
[*-*,red]
([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
}
\visible
<3->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel7) at (cfrag7.south west)
{{
\color
{
white
}
\tiny
{
7
}}}
;
}
\begin{pgfonlayer}
{
background
}
\visible
<3->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel2) at (cfrag2.south east)
{{
\color
{
white
}
\tiny
{
2
}}}
;
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag1)]
{}
;
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag7)]
{}
;
}
\visible
<4->
{
\node
[fill=
blue,circle,inner sep=2pt] (rlabel3) at (cfrag3.south east)
{{
\color
{
white
}
\tiny
{
3
}}
}
;
\node
[fill=
green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag6)]
{
}
;
}
\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
}}}
;
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag5)]
{}
;
}
\end{pgfonlayer}
}
\end{scope}
...
...
Section04-Phrasal-and-Syntactic-Models/section04.tex
查看文件 @
0d5eebbc
...
...
@@ -3158,6 +3158,7 @@ $\textrm{VP(VV(提高) NN}_1) \to \textrm{increases\ NN}_1$ \\
{
\scriptsize
\begin{scope}
[scale = 0.9, sibling distance=20pt, level distance=30pt]
{
\footnotesize
\Tree
[.
\node
(n1)
{
IP
}
;
[.
\node
(n2)
{
NP
}
; [.
\node
(n3)
{
PN
}
;
\node
(cw1)
{
他
}
; ]]
[.
\node
(n4)
{
VP
}
;
...
...
@@ -3173,6 +3174,7 @@ $\textrm{VP(VV(提高) NN}_1) \to \textrm{increases\ NN}_1$ \\
]
]
]
}
\begin{pgfonlayer}
{
background
}
...
...
@@ -3395,6 +3397,309 @@ $\textrm{VP(VV(提高) NN}_1) \to \textrm{increases\ NN}_1$ \\
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% unary rule
\begin{frame}
{
一元规则
}
\begin{itemize}
\item
上述例子中,词性生成单词的过程对应一种
\alert
{
一元规则
}
,即树的孩子节点只有一个,例如
\\
\vspace
{
0.5em
}
\begin{center}
NP(PN(他))
$
\to
$
he
\end{center}
\vspace
{
0.5em
}
显然,NP只有一个孩子PN,PN只有一个孩子he。实际上,这条规则对应两条规则的组合
\vspace
{
0.5em
}
\begin{center}
PN(他)
$
\to
$
he
\\
\vspace
{
0.3em
}
NP(PN
$_
1
$
)
$
\to
$
PN
$_
1
$
\end{center}
\vspace
{
0.5em
}
这里,把两条一元规则合并成``NP(PN(他))
$
\to
$
he''主要是出于系统实现的考虑,因为允许任意词性到句法标记的一元规则会大大增加翻译假设数量,但是本质上这些一元规则并没有带来太多新的信息
\\
\vspace
{
0.2em
}
这也是为什么上图中PN虽然是可信节点,但是没有作为树切割的边界
\end{itemize}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 处理空对其单词
\begin{frame}
{
更多的规则 - 处理空对齐
}
\begin{itemize}
\item
句法翻译系统成功的前提是规则可以覆盖尽可能多的语言现象。为了得到覆盖度更高的规则集,需要处理空对齐的情况 - 把空对齐单词附着在所有可能的规则上
\end{itemize}
\begin{minipage}
[b]
{
0.47
\textwidth
}
{
\footnotesize
\renewcommand*
{
\arraystretch
}{
1.3
}
\begin{tabular}
{
l l
}
\visible
<2->
{$
r
_
1
$}
&
\visible
<2->
{
NP(PN(他))
$
\to
$
he
}
\\
\visible
<2->
{$
r
_
4
$}
&
\visible
<2->
{
VP(VV(表示) NN(满意)
$
\to
$}
\\
&
\visible
<2->
{
satisfied
}
\\
\visible
<2->
{$
r
_
6
$}
&
\visible
<2->
{
VP(PP
$_
1
$
VP
$_
2
$
)
$
\to
$
VP
$_
2
$
PP
$_
1
$}
\\
\visible
<2->
{$
r
_
7
$}
&
\visible
<2->
{
IP(NP
$_
1
$
VP
$_
2
$
)
$
\to
$
NP
$_
1
$
VP
$_
2
$}
\\
\visible
<4->
{$
r
_
8
$}
&
\visible
<4->
{
NP(PN(他))
$
\to
$
he
\alert
{
was
}}
\\
\visible
<5->
{$
r
_
9
$}
&
\visible
<5->
{
VP(VV(表示) NN(满意))
$
\to
$}
\\
&
\visible
<5->
{
\alert
{
was
}
satisfied
}
\\
\visible
<6->
{$
r
_{
10
}$}
&
\visible
<6->
{
VP(PP
$_
1
$
VP
$_
2
$
)
$
\to
$}
\\
&
\visible
<6->
{
\alert
{
was
}
VP
$_
2
$
PP
$_
1
$}
\\
\visible
<7->
{$
r
_{
11
}$}
&
\visible
<7->
{
IP(NP
$_
1
$
VP
$_
2
$
)
$
\to
$}
\\
&
\visible
<7->
{
NP
$_
1
$
\alert
{
was
}
VP
$_
2
$}
\\
\end{tabular}
\renewcommand*
{
\arraystretch
}{
1.0
}
}
\end{minipage}
\hfill
\begin{minipage}
[t]
{
0.47
\textwidth
}
\begin{tikzpicture}
{
\scriptsize
\begin{scope}
\visible
<2->
{
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,draw]
(cfrag1) at
(0,0.25)
{
\Tree
[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]
]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag2) at
([xshift=1.2em]cfrag1.south east)
{
\Tree
[.\node(sn3){P}; 对 ]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag3) at
([xshift=1.2em]cfrag2.south east)
{
\Tree
[.\node(sn4){NP}; [.NN 回答 ]
]
}
;
\end{scope}
\begin{scope}
[sibling distance=15pt,level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag4) at
([xshift=1.4em]cfrag3.south east)
{
\Tree
[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ]
[.
\node
(sn7)
{
NN
}
; 满意 ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=20pt,,level distance=25pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag5) at
([xshift=0.3em,yshift=2.2em]cfrag2.north west)
{
\Tree
[.\node(sn8){PP}; [.\node(sn9){P}; ]
[.
\node
(sn10)
{
NP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=60pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag6) at
([xshift=1.6em,yshift=0.5em]cfrag5.north west)
{
\Tree
[.\node(sn11){VP}; [.\node(sn12){PP}; ]
[.
\node
(sn13)
{
VP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=80pt,level distance=18pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw]
(cfrag7) at
([xshift=-3.6em,yshift=0.5em]cfrag6.north east)
{
\Tree
[.\node(sn14){IP}; [.\node(sn15){NP}; ]
[.
\node
(sn16)
{
VP
}
; ]]
}
;
\end{scope}
\node
[scale=0.9,anchor=north,minimum size=18pt]
(tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south)
{
he
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east)
{
was
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east)
{
satisfied
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw14) at ([xshift=0.5em]tw13.east)
{
with
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw15) at ([xshift=0.5em]tw14.east)
{
the
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east)
{
answer
}
;
\draw
[dashed]
([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw
[dashed]
(cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw
[dashed]
(cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
\visible
<4->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel1) at (cfrag1.south east)
{{
\color
{
white
}
\tiny
{
1
}}}
;
}
%\node [fill=blue,circle,inner sep=2pt] (rlabel2) at (cfrag2.south east) {{\color{white} \tiny{2}}};
%\node [fill=blue,circle,inner sep=2pt] (rlabel3) at (cfrag3.south east) {{\color{white} \tiny{3}}};
\visible
<5->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel4) at (cfrag4.south east)
{{
\color
{
white
}
\tiny
{
4
}}}
;
}
%\node [fill=blue,circle,inner sep=2pt] (rlabel5) at (cfrag5.north west) {{\color{white} \tiny{5}}};
\visible
<6->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel6) at (cfrag6.north east)
{{
\color
{
white
}
\tiny
{
6
}}}
;
}
\visible
<7->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel7) at (cfrag7.south west)
{{
\color
{
white
}
\tiny
{
7
}}}
;
}
\visible
<3->
{
\node
[fill=white,draw=red,thick] (tw12label) at (tw12)
{
\alert
{
was
}}
;
}
\visible
<4->
{
\draw
[->,red] ([xshift=0.2em]tw12label.north west) .. controls +(north:0.4) and +(south:0.4) .. ([xshift=0em]cfrag1.south);
}
\visible
<7->
{
\draw
[->,red] ([xshift=0.8em]tw12label.north west) -- ([xshift=0.8em,yshift=16.8em]tw12label.north west);
}
\visible
<6->
{
\draw
[->,red] ([xshift=0.2em]tw12label.north) .. controls +(north:7em) and +(south:11em) .. ([xshift=0em]cfrag6.south);
}
\visible
<5->
{
\draw
[->,red] ([xshift=0.6em]tw12label.north) -- ([xshift=-2em]cfrag4.south);
}
\begin{pgfonlayer}
{
background
}
\visible
<4->
{
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag1)]
{}
;
}
\visible
<5->
{
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag4)]
{}
;
}
\visible
<6->
{
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag6)]
{}
;
}
\visible
<7->
{
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag7)]
{}
;
}
\end{pgfonlayer}
}
\end{scope}
}
\end{tikzpicture}
\end{minipage}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 组合规则
\begin{frame}
{
更多的规则 - 组合规则
}
\begin{itemize}
\item
最小规则之间可以进行组合,得到更大粒度的组合规则,可以使用更多上下文信息,并进行更复杂的调序。比如,三条最小规则组合成一条composed-3规则
\end{itemize}
\begin{minipage}
[b]
{
0.47
\textwidth
}
{
\footnotesize
\renewcommand*
{
\arraystretch
}{
1.3
}
\begin{tabular}
{
l l
}
\visible
<2->
{$
r
_
1
$}
&
\visible
<2->
{
NP(PN(他))
$
\to
$
he
}
\\
\visible
<2->
{$
r
_
5
$}
&
\visible
<2->
{
PP(P
$_
1
$
NP
$_
2
$
)
$
\to
$
P
$_
1
$
NP
$_
2
$}
\\
\visible
<2->
{$
r
_
6
$}
&
\visible
<2->
{
VP(PP
$_
1
$
VP
$_
2
$
)
$
\to
$
VP
$_
2
$
PP
$_
1
$}
\\
\visible
<2->
{$
r
_
7
$}
&
\visible
<2->
{
IP(NP
$_
1
$
VP
$_
2
$
)
$
\to
$
NP
$_
1
$
VP
$_
2
$}
\\
\visible
<3->
{
\alert
{$
r
_{
1
,
7
}$}}
&
\visible
<3->
{
IP(NP(PN(他)) VP
$_
1
$
)
$
\to
$}
\\
&
\visible
<3->
{
he VP
$_
1
$}
\\
\visible
<4->
{
\alert
{$
r
_{
1
,
6
}$}}
&
\visible
<4->
{
IP(NP(PN(他)) VP(PP
$_
1
$
VP
$_
2
$
))
}
\\
\visible
<4->
{
\alert
{
\
$^{
,
7
}$}}
&
\visible
<4->
{$
\to
$
he VP
$_
2
$
PP
$_
1
$}
\\
\visible
<5->
{
\alert
{$
r
_{
1
,
5
}$}}
&
\visible
<5->
{
IP(NP(PN(他))
}
\\
\visible
<5->
{
\alert
{
\
$^{
,
6
,
7
}$}}
&
\visible
<5->
{
VP(P
$_
1
$
NP
$_
2
$
VP
$_
3
$
))
}
\\
&
\visible
<5->
{$
\to
$
he VP
$_
3
$
P
$_
1
$
NP
$_
2
$}
\\
&
\\
\end{tabular}
\renewcommand*
{
\arraystretch
}{
1.0
}
}
\end{minipage}
\hfill
\begin{minipage}
[t]
{
0.47
\textwidth
}
\begin{tikzpicture}
{
\scriptsize
\begin{scope}
\visible
<2->
{
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,draw]
(cfrag1) at
(0,0.25)
{
\Tree
[.\node(sn1){NP}; [.\node(sn2){PN}; 他 ]
]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag2) at
([xshift=1.2em]cfrag1.south east)
{
\Tree
[.\node(sn3){P}; 对 ]
}
;
\end{scope}
\begin{scope}
[level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag3) at
([xshift=1.2em]cfrag2.south east)
{
\Tree
[.\node(sn4){NP}; [.NN 回答 ]
]
}
;
\end{scope}
\begin{scope}
[sibling distance=15pt,level distance=20pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag4) at
([xshift=1.4em]cfrag3.south east)
{
\Tree
[.\node(sn5){VP}; [.\node(sn6){VV}; 表示 ]
[.
\node
(sn7)
{
NN
}
; 满意 ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=20pt,,level distance=25pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag5) at
([xshift=0.3em,yshift=2.2em]cfrag2.north west)
{
\Tree
[.\node(sn8){PP}; [.\node(sn9){P}; ]
[.
\node
(sn10)
{
NP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=60pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south west,draw]
(cfrag6) at
([xshift=1.6em,yshift=0.5em]cfrag5.north west)
{
\Tree
[.\node(sn11){VP}; [.\node(sn12){PP}; ]
[.
\node
(sn13)
{
VP
}
; ]]
}
;
\end{scope}
\begin{scope}
[sibling distance=80pt,level distance=18pt]
\node
[scale=0.8, inner sep=0.1cm,align=center,anchor=south east,draw]
(cfrag7) at
([xshift=-3.6em,yshift=0.5em]cfrag6.north east)
{
\Tree
[.\node(sn14){IP}; [.\node(sn15){NP}; ]
[.
\node
(sn16)
{
VP
}
; ]]
}
;
\end{scope}
\node
[scale=0.9,anchor=north,minimum size=18pt]
(tw11) at ([xshift=-0.3em,yshift=-1.2em]cfrag1.south)
{
he
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw12) at ([yshift=-0.1em,xshift=0.5em]tw11.east)
{
was
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw13) at ([yshift=0.1em,xshift=0.5em]tw12.east)
{
satisfied
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw14) at ([xshift=0.5em]tw13.east)
{
with
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw15) at ([xshift=0.5em]tw14.east)
{
the
}
;
\node
[scale=0.9,anchor=west,minimum size=18pt]
(tw16) at ([yshift=-0.1em,xshift=0.5em]tw15.east)
{
answer
}
;
\draw
[dashed]
([xshift=-0.3em]cfrag1.south) -- ([yshift=-0.3em]tw11.north);
\draw
[dashed]
(cfrag2.south) -- ([yshift=-0.4em]tw14.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw15.north);
\draw
[dashed]
(cfrag3.south) -- ([yshift=-0.4em]tw16.north);
\draw
[dashed]
(cfrag4.south) .. controls +(south:0.6) and +(north:0.6) .. ([yshift=-0.4em]tw13.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag2.north) -- ([xshift=0.1em,yshift=2.5em]cfrag2.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.4em]cfrag3.north) -- ([xshift=0.1em,yshift=0.7em]cfrag3.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag4.north) -- ([xshift=0.0em,yshift=5.1em]cfrag4.north);
\draw
[*-*]
([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
\draw
[*-*]
([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
\visible
<3->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel1) at (cfrag1.south east)
{{
\color
{
white
}
\tiny
{
1
}}}
;
\draw
[*-*,red,thick]
([xshift=0.0em,yshift=-0.2em]cfrag1.north) -- ([xshift=0.0em,yshift=10.0em]cfrag1.north);
}
\visible
<5->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel5) at (cfrag5.north west)
{{
\color
{
white
}
\tiny
{
5
}}}
;
\draw
[*-*,red]
([xshift=0.0em,yshift=-0.2em]cfrag6.north) -- ([xshift=0.0em,yshift=0.9em]cfrag6.north);
}
\visible
<4->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel6) at (cfrag6.north east)
{{
\color
{
white
}
\tiny
{
6
}}}
;
\draw
[*-*,red]
([xshift=0.1em,yshift=-0.2em]cfrag5.north) -- ([xshift=0.1em,yshift=0.9em]cfrag5.north);
}
\visible
<3->
{
\node
[fill=blue,circle,inner sep=2pt] (rlabel7) at (cfrag7.south west)
{{
\color
{
white
}
\tiny
{
7
}}}
;
}
\begin{pgfonlayer}
{
background
}
\visible
<3->
{
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag1)]
{}
;
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag7)]
{}
;
}
\visible
<4->
{
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag6)]
{}
;
}
\visible
<5->
{
\node
[fill=green!20,inner sep=0pt] (cfrag1back) [fit = (cfrag5)]
{}
;
}
\end{pgfonlayer}
}
\end{scope}
}
\end{tikzpicture}
\end{minipage}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 基于树结构的翻译文法 - 树到树
\begin{frame}
{
树到树规则抽取
}
% 我的博士论文
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论