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
NiuTrans
Toy-MT-Introduction
Commits
ba50f919
Commit
ba50f919
authored
Feb 03, 2020
by
姜雨帆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Rule Extraction
parent
5ba56e98
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
120 行增加
和
0 行删除
+120
-0
Section04-Phrasal-and-Syntactic-Models/section04.tex
+120
-0
没有找到文件。
Section04-Phrasal-and-Syntactic-Models/section04.tex
查看文件 @
ba50f919
...
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论