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
ef6fc825
Commit
ef6fc825
authored
Jan 07, 2020
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hyper graph
parent
6342f26c
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
101 行增加
和
4 行删除
+101
-4
Section04-Phrasal-and-Syntactic-Models/section04-test.tex
+32
-4
Section04-Phrasal-and-Syntactic-Models/section04.tex
+69
-0
没有找到文件。
Section04-Phrasal-and-Syntactic-Models/section04-test.tex
查看文件 @
ef6fc825
...
...
@@ -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=
2
em]node3.east)
{
\footnotesize
{
VP(AD
$_
1
$
VP(VV(下降)) AS
$_
2
$
)
}}
;
\node
[anchor=west] (rule1) at ([xshift=
6
em]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}
...
...
Section04-Phrasal-and-Syntactic-Models/section04.tex
查看文件 @
ef6fc825
...
...
@@ -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
=
2
pt,draw,fill
=
red
!
20
]
(
node
1
)
at
(
0
,
0
)
{
\tiny
{
[
1
,
1
]
}}
;
\node
[
anchor
=
west,circle,inner sep
=
2
pt,draw,fill
=
blue
!
20
]
(
node
2
)
at
([
xshift
=
3
.
3
em
]
node
1
.east
)
{
\tiny
{
[
3
,
3
]
}}
;
\node
[
anchor
=
north,circle,inner sep
=
2
pt,draw,fill
=
green
!
20
]
(
node
3
)
at
([
xshift
=
2
.
5
em,yshift
=
5
em
]
node
1
.north
)
{
\tiny
{
[
1
,
3
]
}}
;
\node
[
anchor
=
north
]
(
rulelabel
)
at
([
yshift
=-
0
.
5
em,xshift
=
2
em
]
node
1
.south east
)
{
\tiny
{
规则
$
r
$
所对应的超图
}}
;
\draw
[-
latex
]
(
node
1
.
90
)
..controls
+(
north:
3
em
)
and
+(
south:
3
em
)
..
(
node
3
.
-
90
)
;
\draw
[-
latex
]
(
node
2
.
90
)
..controls
+(
north:
3
em
)
and
+(
south:
3
em
)
..
(
node
3
.
-
90
)
;
\node
[
anchor
=
west
]
(
rule
1
)
at
([
xshift
=
6
em
]
node
3
.east
)
{
\footnotesize
{
VP
(
AD
$_
1
$
VP
(
VV
(
下降
))
AS
$_
2
$
)
}}
;
\node
[
anchor
=
north west
]
(
rule
2
)
at
(
rule
1
.south west
)
{
\footnotesize
{$
\to
$
AS
$_
2
$
AD
$_
1
$
fallen
}}
;
\node
[
anchor
=
south
]
(
rulelabel
)
at
([
yshift
=-
0
.
4
em
]
rule
1
.north
)
{
\tiny
{
规则
$
r
$}}
;
\begin
{
pgfonlayer
}{
background
}
\visible
<
2
-
>
{
\node
[
anchor
=
north west,fill
=
green
!
20
,inner sep
=
2
pt,minimum height
=
1
.
5
em,minimum width
=
1
.
3
em
]
(
nodebox
1
)
at
([
xshift
=
0
.
2
em
]
rule
1
.north west
)
{}
;
\node
[
anchor
=
north west,fill
=
red
!
20
,inner sep
=
2
pt,minimum height
=
1
.
5
em,minimum width
=
1
.
8
em
]
(
nodebox
2
)
at
([
xshift
=
0
.
2
em
]
nodebox
1
.north east
)
{}
;
\node
[
anchor
=
north east,fill
=
blue
!
20
,inner sep
=
2
pt,minimum height
=
1
.
5
em,minimum width
=
1
.
6
em
]
(
nodebox
1
)
at
([
xshift
=-
0
.
6
em
]
rule
1
.north east
)
{}
;
}
\end
{
pgfonlayer
}
\tikzstyle
{
chartnode
}
=[
rectangle,minimum size
=
1
.
3
em,draw
]
\node
[
chartnode,anchor
=
north west
]
(
cell
11
)
at
([
yshift
=-
2
em
]
rule
2
.south west
)
{}
;
\node
[
chartnode,anchor
=
north west
]
(
cell
21
)
at
([
yshift
=-
0
em
]
cell
11
.south west
)
{}
;
\node
[
chartnode,anchor
=
west
]
(
cell
22
)
at
(
cell
21
.east
)
{}
;
\node
[
chartnode,anchor
=
north west
]
(
cell
31
)
at
([
yshift
=-
0
em
]
cell
21
.south west
)
{}
;
\node
[
chartnode,anchor
=
west
]
(
cell
32
)
at
(
cell
31
.east
)
{}
;
\node
[
chartnode,anchor
=
west
]
(
cell
33
)
at
(
cell
32
.east
)
{}
;
\node
[
anchor
=
north
]
(
chartlabel
)
at
(
cell
32
.south
)
{
\scriptsize
{
chart
}}
;
\visible
<
3
-
>
{
\node
[
chartnode,anchor
=
north west,fill
=
red
!
20
]
(
cell
11
)
at
([
yshift
=-
2
em
]
rule
2
.south west
)
{}
;
\node
[
chartnode,anchor
=
north west,fill
=
blue
!
20
]
(
cell
31
)
at
([
yshift
=-
0
em
]
cell
21
.south west
)
{}
;
\node
[
chartnode,anchor
=
west,fill
=
green
!
20
]
(
cell
33
)
at
(
cell
32
.east
)
{}
;
\draw
[
<
-
,dotted,thick
]
([
xshift
=
0
.
1
em
]
node
3
.
60
)
..controls
+(
60
:
0
.
5
)
and
+(
120
:
0
.
5
)
..
(
rule
1
.north west
)
;
\draw
[-
>,dotted
]
([
xshift
=
0
.
1
em
]
node
3
.
-
60
)
..controls
+(-
60
:
3
em
)
and
+(
north:
7
em
)
..
(
cell
33
.center
)
;
\draw
[-
>,dotted
]
([
xshift
=
0
.
1
em
]
node
2
.
0
)
..controls
+(
east:
2
em
)
and
+(
west:
3
em
)
..
(
cell
31
.center
)
;
\draw
[-
>,dotted
]
([
xshift
=
0
.
1
em
]
node
1
.
60
)
..controls
+(
60
:
1
.
5
em
)
and
+(
120
:
2
em
)
..
(
cell
11
.center
)
;
}
\visible
<
4
-
>
{
\node
[
anchor
=
north west,fill
=
green
!
20
,drop shadow,align
=
left
]
(
cellbox
)
at
([
yshift
=
4
em,xshift
=
1
em
]
cell
33
.north east
)
{
\scriptsize
{
表单元表示覆盖单词
1
-
3
的跨度
}
\\\scriptsize
{
保存跨度
[
1
,
3
]
上的所有节点
}
\\\scriptsize
{
VP
[
1
,
3
]
}
\\\scriptsize
{
NP
[
1
,
3
]
}
\\\scriptsize
{
...
}}
;
\draw
[-
>
]
([
xshift
=-
0
.
2
em,yshift
=-
0
.
2
em
]
cell
33
.north east
)
..controls
+(
north:
2
.
5
em
)
and
+(
west:
1
em
)
..
([
yshift
=
2
em
]
cellbox.west
)
;
}
\end
{
scope
}
}
\end
{
tikzpicture
}
\end
{
center
}
\end
{
frame
}
%%%------------------------------------------------------------------------------------------------------------
%%% 基于串的解码
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论