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
d9d8616e
Commit
d9d8616e
authored
Dec 26, 2019
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new pages
parent
207b21ac
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
192 行增加
和
1 行删除
+192
-1
Section04-Phrasal-and-Syntactic-Models/section04-test.tex
+192
-1
没有找到文件。
Section04-Phrasal-and-Syntactic-Models/section04-test.tex
查看文件 @
d9d8616e
...
...
@@ -206,8 +206,199 @@ $x$表示叶子非终结符(可替换的变量),显然这是调序规则
%%% 规则实例(树到树)
\begin{frame}
{
基于树的翻译规则(续)
}
\begin{itemize}
\item
\item
可以省略``
$
\sim
$
'',把规则重新写为易于计算机处理的格式
\\
\vspace
{
-1em
}
\begin{eqnarray}
\langle\ \textrm
{
VP
}
,
\textrm
{
VP
}
\ \rangle
&
\to
&
\langle\ \textrm
{
VP(PP
}_{
\alert
{
1
}}
\ \textrm
{
VP(VV(表示) NN
}_{
\alert
{
2
}}
)),
\nonumber
\\
&
&
\ \ \textrm
{
VP(VBZ(was) VP(VBZ
}_{
\alert
{
2
}}
\ \textrm
{
PP
}_{
\alert
{
1
}}
))
\ \rangle
\nonumber
\end{eqnarray}
其中变量的对应关系用下标数字表示,比如:
$
\textrm
{
PP
}_
1
\leftrightarrow
\textrm
{
PP
}_
1
$
,
$
\textrm
{
NN
}_
2
\leftrightarrow
\textrm
{
VBZ
}_
2
$
\item
<2-> 在这个规则的树结构中,每个叶子非终结符本质上定义了一个变量,这个节点也被称作边缘节点(frontier node)。边缘节点可以被其它树结构替换,组合为更大的树结构,这个操作被称作组合(composition) 或树替换
\end{itemize}
\visible
<2->
{
\begin{center}
\begin{tikzpicture}
{
\scriptsize
\begin{scope}
[sibling distance=5pt, level distance = 22pt]
\Tree
[.\node(s1){VP}; [.\node(s2){PP}; ]
[.
\node
(s3)
{
VP
}
; [.
\node
(s4)
{
VV
}
;
\node
[fill=white]
(w1)
{
表示
}
; ] [.
\node
(s5)
{
NN
}
; ] ] ]
\end{scope}
\begin{scope}
[xshift=1.2in, yshift=-0.2in, sibling distance=5pt, level distance = 22pt]
\Tree
[.\node(ws1){NN}; \node(ws2){满意}; ]
\end{scope}
\node
(anchor=west] (arrow) at ([xshift=0.4in]ws2.east)
{
\large
{$
\Rightarrow
$}}
;
\begin{pgfonlayer}
{
background
}
\node
[inner sep=0,fill=green!20] [fit = (ws1)] (snode1)
{}
;
\node
[inner sep=0,fill=green!20] [fit = (s5)] (snode2)
{}
;
\draw
[<-,thick,dotted] ([xshift=0.1em]s5.east) ..controls +(east:3em) and +(west:3em).. ([xshift=-0.1em]ws1.west);
\end{pgfonlayer}
\begin{scope}
[xshift=2.5in, sibling distance=5pt, level distance = 22pt]
\Tree
[.\node(s1){VP}; [.\node(s2){PP}; ]
[.
\node
(s3)
{
VP
}
; [.
\node
(s4)
{
VV
}
;
\node
[fill=white]
(w1)
{
表示
}
; ] [.
\node
(s5)
{
NN
}
;
\node
(w2)
{
满意
}
; ] ] ]
\end{scope}
}
\end{tikzpicture}
\end{center}
}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
%%% 规则的组装对应翻译过程
\begin{frame}
{
使用规则定义翻译过程
}
\begin{tikzpicture}
% target side
\begin{scope}
[xshift=-1em, level distance=25pt]
\node
[scale=0.8]
at (1.5, 2.2)
{
目标语言
}
;
\node
[scale=0.6, inner sep=0.1cm, draw]
(tfrag1) at
(0,0.05)
{
\Tree
[.NP [.DT the ]
[.NNS imports ]]
}
;
\visible
<4->
{
\node
[scale=0.6, inner sep=0.1cm, draw, sibling distance=115pt]
(tfrag2) at
(1.4,1.4)
{
\Tree
[.S [.NP ]
[.VP ]]
}
;
}
\visible
<3->
{
\node
[scale=0.6, inner sep=0.1cm, draw, sibling distance=30pt]
(tfrag3) at
(3,-0.2)
{
\Tree
[.VP [.VBZ have ]
[.ADVP [.RB ] [.VBN fallen ]]]
}
;
}
\visible
<2->
{
\node
[scale=0.6, inner sep=0.1cm, draw,xshift=-1.5em]
(tfrag4) at
(2.8,-1.8)
{
\Tree
[.RB drastically ]
}
;
}
\visible
<4->
{
\draw
[<->]
(0.00,0.7) -- (0.00,1.0);
}
\visible
<4->
{
\draw
[<->]
(2.9,0.7) -- (2.9,1.0);
}
\visible
<3->
{
\draw
[<->]
(2.4,-1.4) .. controls +(north:0.6) and +(south:0.6) .. (3.0,-0.6);
}
\end{scope}
% source side
\begin{scope}
[scale=0.8, level distance=25pt, xshift=-20em, yshift=1em]
\node
[scale=0.8]
at (2.1, 2.45)
{
源语言
}
;
\visible
<1->
{
\node
[scale=0.6, inner sep=0.1cm, draw]
(sfrag1) at
(0,0)
{
\Tree
[.NN 进口 ]
}
;
}
\visible
<4->
{
\node
[scale=0.6, inner sep=0.1cm, draw, sibling distance=135pt]
(sfrag2) at
(2.0,1.4)
{
\Tree
[.IP [.NN ]
[.VP ]]
}
;
}
\visible
<3->
{
\node
[scale=0.6, inner sep=0.1cm, xshift=1em, draw]
(sfrag3) at
(4,-0.7)
{
\Tree
[.VP [.AD ]
[.ADVP [.VV 下降 ] [.AS 了 ]]]
}
;
}
\visible
<2->
{
\node
[scale=0.6, inner sep=0.1cm, draw]
(sfrag4) at
(1.3,-1.3)
{
\Tree
[.AD 大幅度 ]
}
;
}
\visible
<4->
{
\draw
[<->]
(0.05,0.5) -- (0.05,0.95);
}
\visible
<4->
{
\draw
[<->]
(4.15,0.5) -- (4.15,0.95);
}
\visible
<3->
{
\draw
[<->]
(1.55,-0.95) .. controls +(east:1.0) and +(south:0.4) .. (3.5,-0.6);
}
\end{scope}
% rule 1
\begin{scope}
[scale=0.6, xshift=-22em, yshift=-13em, level distance=20pt]
\begin{scope}
[anchor=north east, xshift=-6em]
\Tree
[.NN 进口 ]
\end{scope}
\draw
[->]
(-1.7,0.1) -- (-0.9,0.1);
\begin{scope}
[anchor=north west]
\Tree
[.NP [.DT the ]
[.NNS imports ]]
\end{scope}
\end{scope}
% rule 2
\begin{scope}
[scale=0.6, xshift=-10em, yshift=-13em, level distance=20pt]
\begin{scope}
[anchor=north east, xshift=-6em]
\Tree
[.AD 大幅度 ]
\end{scope}
\draw
[->]
(-1.7,0.1) -- (-0.9,0.1);
\begin{scope}
[anchor=north west]
\Tree
[.RB drastically ]
\end{scope}
\end{scope}
% rule 3
\begin{scope}
[scale=0.6, xshift=3em, yshift=-13em, level distance=20pt]
\begin{scope}
[anchor=north east, xshift=-7em]
\Tree
[.VP [.AD ]
[.ADVP [.VV 下降 ] [.AS 了 ]]]
\end{scope}
\draw
[->]
(-1.7,0.1) -- (-0.9,0.1);
\begin{scope}
[anchor=north west, xshift=1em]
\Tree
[.VP [.VBZ have ]
[.ADVP [.RB ] [.VBN fallen ]]]
\end{scope}
\end{scope}
% rule 4
\begin{scope}
[scale=0.6, xshift=17em, yshift=-13em, level distance=20pt]
\begin{scope}
[anchor=north east, xshift=-6em]
\Tree
[.IP [.NN ]
[.VP ]]
\end{scope}
\draw
[->]
(-1.7,0.1) -- (-0.9,0.1);
\begin{scope}
[anchor=north west,xshift=-1em]
\Tree
[.S [.NP ]
[.VP ]]
\end{scope}
\end{scope}
% red rule 1
\begin{scope}
[red, scale=0.6, xshift=-22em, yshift=-13em, level distance=20pt]
\visible
<1>
{
\begin{scope}
[anchor=north east, xshift=-6em]
\Tree
[.NN 进口 ]
\end{scope}
\draw
[->]
(-1.7,0.1) -- (-0.9,0.1);
\begin{scope}
[anchor=north west]
\Tree
[.NP [.DT the ]
[.NNS imports ]]
\end{scope}
}
\end{scope}
\visible
<2>
{
% red rule 2
\begin{scope}
[red, scale=0.6, xshift=-10em, yshift=-13em, level distance=20pt]
\begin{scope}
[anchor=north east, xshift=-6em]
\Tree
[.AD 大幅度 ]
\end{scope}
\draw
[->]
(-1.7,0.1) -- (-0.9,0.1);
\begin{scope}
[anchor=north west]
\Tree
[.RB drastically ]
\end{scope}
\end{scope}
}
\visible
<3>
{
% red rule 3
\begin{scope}
[red, scale=0.6, xshift=3em, yshift=-13em, level distance=20pt]
\begin{scope}
[anchor=north east, xshift=-7em]
\Tree
[.VP [.AD ]
[.ADVP [.VV 下降 ] [.AS 了 ]]]
\end{scope}
\draw
[->]
(-1.7,0.1) -- (-0.9,0.1);
\begin{scope}
[anchor=north west, xshift=1em]
\Tree
[.VP [.VBZ have ]
[.ADVP [.RB ] [.VBN fallen ]]]
\end{scope}
\end{scope}
}
\visible
<4>
{
% rule 4
\begin{scope}
[red, scale=0.6, xshift=17em, yshift=-13em, level distance=20pt]
\begin{scope}
[anchor=north east, xshift=-6em]
\Tree
[.IP [.NN ]
[.VP ]]
\end{scope}
\draw
[->]
(-1.7,0.1) -- (-0.9,0.1);
\begin{scope}
[anchor=north west,xshift=-1em]
\Tree
[.S [.NP ]
[.VP ]]
\end{scope}
\end{scope}
}
\end{tikzpicture}
\end{frame}
%%%------------------------------------------------------------------------------------------------------------
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论