semantic construction with s-graph grammars€¦ · example: the boy wants to sleep 25 term h s (t)...
TRANSCRIPT
Semantic construction withgraph grammars
Grammars for Trees and Graphs
Leonie Harter & Katharina Stein
1
Koller (2015)
Content
• Motivation
• Recap IRTGs
• Definition of s-graphs
• S-graph algebra
• S-graph grammar
• Formal aspects
• Conclusion
2
Motivation
• Task: construction of semantic representations derived from naturallanguage strings
• The data-based turnaround in semantic parsing resulted in a large number of semantically annotated corpora
3
Motivation
• A large proportion of these sembanks use graphs like this for semantic representation:
• The graphs in this paper arealso AMR (abstractmeaning representation) graphs like this one
4
Motivation
• Previous works about semantic parsing- are complicated- don't use grammars but statistics or have top-down perspective
→ differ strongly from traditional/linguistic approaches to semantic→ construction
• This grammar formalism- builds graphs bottom up with 3 combiningoperations
- is grammar based
→ doesn't want to give up previous linguistic research insights
5
Recap IRTGs
Figure 1: example of an IRTG
6
V
Definition of s-graphs
• Directed graph
• Labeled nodes
• Labeled edges
7
Definition of s-graphs
• Each node can be marked with a set of source names s ∈ S
• S: fixed finite set containing the source names
• Source names: represent the possible semantic argument positions
• Each source name s can only be label for one node
• s-source of G: node marked with source s
• Nodes marked with at least one source: sources of G
• Every graph has a root source
8
Example algebra for s-graphs
9
Values Operations
• The rename operationG[a → b] every a-source of G becomes a b-source of GG[b] is a shortcut for G[root → b]
• The forget operationfa1,…,an(G) every node, that was an ai-source is noai-source anymore
• The merge operationG1 ‖ G2 evaluates to a Graph G‘, that consists ofall nodes and edges of G1 and G2. If G1 has an a-source u and G2 has an a-source v, then u and v are mapped to the same node in G‘
The rename operation
10
The merge operation
11
The forget operation
12
Example: the boy wants to sleep
13
Example: the boy wants to sleep
14
Example: the boy wants to sleep
15
Example: the boy wants to sleep
16
Example: the boy wants to sleep
17
Example: the boy wants to sleep
18
Example: the boy wants to sleep
19
Example: the boy wants to sleep
20
Example: the boy wants to sleep
21
S-graph grammar
IRTG grammar formalism
Consits of :
• RTG rules
• Homomorphisms
−hs: for strings
−hg: for graphs
22
S-graph grammar for complements
23
Example: the boy wants to sleep
24
derivation tree t
comb_subj
boy
sleep
want1
Example: the boy wants to sleep
25
term hs(t)
•
the boy •
wants to sleep
fsubj(∙)
‖
fvcomp(∙) ∙[subj]
‖
G1 ∙[vcomp]
G3
G2
term hg(t)
Example: the boy wants to sleep
26
derivation tree tterm hs(t) term hg(t) s-graph [[hg(t)]]String [[hs(t)]]
The boy wants to sleep
S-graph grammar for adjuncts
27
Structural Ambiguities
The boy sometimes sleeps and snores
28
Structural Ambuiguities
The boy sometimes sleeps and snores
29
comb_subj
boy
snore
sleep
sometimes
coord
comb_subj
boy
snore
sometimes
sleep
coord
1. 2.
<root>
Lexicon graphs
30
Gsometimes
Gboy
Gsnore Gsleep
Gand
The boy sometimes sleeps and snores (1)
31
fsubj(∙)
Gboy
f1,2(∙) ∙[subj]
‖
‖
∙[2]
Gcoord
‖
Gsnore∙[1]
‖
GsleepGsometimes
f1,2(∙)
32
comb_subj
boy
snore
sleep
sometimes
coord
1.
33
Gsleep
Gsometimes Gsleep
1.
34
Gsleep
Gsometimes Gsleep
1.
G1
35
comb_subj
boy
snore
sleep
sometimes
coord
1.
36
1.
G1[1] ‖ Gsnore[2])
G1
G1[1]
37
1.
G1[1] ‖ Gsnore[2])
G1
G1[1]
G1[1]
38
1.
G1[1] ‖ Gsnore[2])
Gand
G1[1]
39
1.
G1[1] ‖ Gsnore[2])
G1[1] Gand
G1[1]
40
1.
G1[1] ‖ Gsnore[2])
Gsnore
Gsnore[2]
41
1.
G1[1] ‖ Gsnore[2])
Gsnore
Gsnore[2]
42
1.
G1[1] ‖ Gsnore[2])
G1[1] ‖ Gsnore[2]
43
1.
G1[1] ‖ Gsnore[2])
G1[1] ‖ Gsnore[2]
44
1.
G1[1] ‖ Gsnore[2])
45
1.
G1[1] ‖ Gsnore[2])
G2
46
comb_subj
boy
snore
sleep
sometimes
coord
1.
<root>
47
Gboy[subj]
fsubj(G2 ‖ Gboy[subj])
1.
Gboy
<root>
48
Gboy[subj]
fsubj(G2 ‖ Gboy[subj])
1.
Gboy
49
Gboy[subj]
G2 ‖ Gboy[subj]
fsubj(G2 ‖ Gboy[subj])
G2
1.
G2
50
Gboy[subj]
G2 ‖ Gboy[subj]
fsubj(G2 ‖ Gboy[subj])
G2
1.
G2
51
fsubj(G2 ‖ Gboy[subj])
1.
52
fsubj(G2 ‖ Gboy[subj])
1.
53
comb_subj
boy
snore
sleep
sometimes
coord
1.
The boy sometimes sleeps and snores (1)
54
fsubj(∙)
Gboy
f1,2(∙) ∙[subj]
‖
‖
∙[2]
Gcoord
‖
Gsnore∙[1]
‖
GsleepGsometimes
f1,2(∙)
The boy sometimes sleeps and snores (2)
55
fsubj(∙)
Gboy
∙[subj]
‖
‖
f1,2(∙)
Gcoord Gsnore∙[1]
Gsleep
Gsometimes
∙[2]‖
The boy sometimes sleeps and snores
56
fsubj(∙)
Gboy
∙[subj]
‖
‖
f1,2(∙)
Gcoord Gsnore∙[1]
Gsleep
Gsometimes
∙[2]‖
fsubj(∙)
Gboy
f1,2(∙) ∙[subj]
‖
‖
∙[2]
Gcoord
‖
Gsnore∙[1]
‖
GsleepGsometimes
f1,2(∙)
1. 2.
57
2.
comb_subj
boy
snore
sometimes
sleep
coord
58
Gsleep[1]
2.
Gsleep
Gsleep[1] ‖ Gsnore[2])
59
Gsleep[1]
2.
Gsleep
Gsleep[1] ‖ Gsnore[2])
60
2.Gsleep[1] ‖ Gsnore[2])
Gand
Gsleep[1]
61
2.Gsleep[1] ‖ Gsnore[2])
Gand
Gsleep[1]
62
2.Gsleep[1] ‖ Gsnore[2])
Gsnore
Gsnore[2]
63
2.Gsleep[1] ‖ Gsnore[2])
Gsnore
Gsnore[2]
64
2.Gsleep[1] ‖ Gsnore[2])
Gsleep[1] ‖ Gsnore[2]
65
2.Gsleep[1] ‖ Gsnore[2])
Gsleep[1] ‖ Gsnore[2]
66
2.
Gsleep[1] ‖ Gsnore[2])
G1
67
2.
comb_subj
boy
snore
sometimes
sleep
coord
68
G1
G1Gsometimes
2.
69
G1
G1Gsometimes
2.
G2
70
2.
comb_subj
boy
snore
sometimes
sleep
coord
71
Gboy
fsubj(G2 ‖ Gboy[subj])
2.
Gboy
<root>
72
Gboy
fsubj(G2 ‖ Gboy[subj])
2.
Gboy
<root>
73
fsubj(G2 ‖ Gboy[subj])
2.
G2
G2 ‖ Gboy[subj]
74
fsubj(G2 ‖ Gboy[subj])
2.
G2
G2 ‖ Gboy[subj]
75
fsubj(G2 ‖ Gboy[subj])
2.
76
2.
comb_subj
boy
snore
sometimes
sleep
coord
The boy sometimes sleeps and snores (2)
77
fsubj(∙)
Gboy
∙[subj]
‖
‖
f1,2(∙)
Gcoord Gsnore∙[1]
Gsleep
Gsometimes
∙[2]‖
Complement vs Adjunct
78
Combining complement with head Combining adjunct with head
Rename root of the complement with theargument position
Forget argument names because slot forcomplement is filled
S-graph for adjunct has a root source wherethe modifiee should be added
Merge s-graph for the adjunct with thes-graph for the head being modified
Relative clauses
79
Relative clauses
80
Formal aspects
• S-graph grammars: map strings to graphs
• Algorithmically:
• Compute parse chart from the string
• Pick best derivation tree t
• Compute the value of t in the graph interpretation
81
Conclusion
• Linguistically natural grammar formalism
• Possible to construct semantic graph representations with IRTGs
• Graph-based compositional semantic construction based on linguisticprinciples
• Source names of s-graphs are linguistically meaningful
82
Thank you for your attention
Questions?
83