Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t)...

83
Semantic construction with graph grammars Grammars for Trees and Graphs Leonie Harter & Katharina Stein 1 Koller (2015)

Transcript of Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t)...

Page 1: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Semantic construction withgraph grammars

Grammars for Trees and Graphs

Leonie Harter & Katharina Stein

1

Koller (2015)

Page 2: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Content

• Motivation

• Recap IRTGs

• Definition of s-graphs

• S-graph algebra

• S-graph grammar

• Formal aspects

• Conclusion

2

Page 3: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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

Page 4: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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

Page 5: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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

Page 6: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Recap IRTGs

Figure 1: example of an IRTG

6

V

Page 7: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Definition of s-graphs

• Directed graph

• Labeled nodes

• Labeled edges

7

Page 8: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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

Page 9: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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‘

Page 10: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

The rename operation

10

Page 11: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

The merge operation

11

Page 12: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

The forget operation

12

Page 13: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

13

Page 14: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

14

Page 15: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

15

Page 16: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

16

Page 17: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

17

Page 18: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

18

Page 19: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

19

Page 20: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

20

Page 21: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

21

Page 22: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

S-graph grammar

IRTG grammar formalism

Consits of :

• RTG rules

• Homomorphisms

−hs: for strings

−hg: for graphs

22

Page 23: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

S-graph grammar for complements

23

Page 24: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Example: the boy wants to sleep

24

derivation tree t

comb_subj

boy

sleep

want1

Page 25: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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)

Page 26: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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

Page 27: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

S-graph grammar for adjuncts

27

Page 28: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Structural Ambiguities

The boy sometimes sleeps and snores

28

Page 29: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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.

Page 30: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

<root>

Lexicon graphs

30

Gsometimes

Gboy

Gsnore Gsleep

Gand

Page 31: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

The boy sometimes sleeps and snores (1)

31

fsubj(∙)

Gboy

f1,2(∙) ∙[subj]

∙[2]

Gcoord

Gsnore∙[1]

GsleepGsometimes

f1,2(∙)

Page 32: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

32

comb_subj

boy

snore

sleep

sometimes

coord

1.

Page 33: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

33

Gsleep

Gsometimes Gsleep

1.

Page 34: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

34

Gsleep

Gsometimes Gsleep

1.

G1

Page 35: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

35

comb_subj

boy

snore

sleep

sometimes

coord

1.

Page 36: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

36

1.

G1[1] ‖ Gsnore[2])

G1

G1[1]

Page 37: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

37

1.

G1[1] ‖ Gsnore[2])

G1

G1[1]

G1[1]

Page 38: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

38

1.

G1[1] ‖ Gsnore[2])

Gand

G1[1]

Page 39: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

39

1.

G1[1] ‖ Gsnore[2])

G1[1] Gand

G1[1]

Page 40: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

40

1.

G1[1] ‖ Gsnore[2])

Gsnore

Gsnore[2]

Page 41: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

41

1.

G1[1] ‖ Gsnore[2])

Gsnore

Gsnore[2]

Page 42: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

42

1.

G1[1] ‖ Gsnore[2])

G1[1] ‖ Gsnore[2]

Page 43: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

43

1.

G1[1] ‖ Gsnore[2])

G1[1] ‖ Gsnore[2]

Page 44: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

44

1.

G1[1] ‖ Gsnore[2])

Page 45: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

45

1.

G1[1] ‖ Gsnore[2])

G2

Page 46: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

46

comb_subj

boy

snore

sleep

sometimes

coord

1.

Page 47: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

<root>

47

Gboy[subj]

fsubj(G2 ‖ Gboy[subj])

1.

Gboy

Page 48: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

<root>

48

Gboy[subj]

fsubj(G2 ‖ Gboy[subj])

1.

Gboy

Page 49: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

49

Gboy[subj]

G2 ‖ Gboy[subj]

fsubj(G2 ‖ Gboy[subj])

G2

1.

G2

Page 50: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

50

Gboy[subj]

G2 ‖ Gboy[subj]

fsubj(G2 ‖ Gboy[subj])

G2

1.

G2

Page 51: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

51

fsubj(G2 ‖ Gboy[subj])

1.

Page 52: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

52

fsubj(G2 ‖ Gboy[subj])

1.

Page 53: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

53

comb_subj

boy

snore

sleep

sometimes

coord

1.

Page 54: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

The boy sometimes sleeps and snores (1)

54

fsubj(∙)

Gboy

f1,2(∙) ∙[subj]

∙[2]

Gcoord

Gsnore∙[1]

GsleepGsometimes

f1,2(∙)

Page 55: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

The boy sometimes sleeps and snores (2)

55

fsubj(∙)

Gboy

∙[subj]

f1,2(∙)

Gcoord Gsnore∙[1]

Gsleep

Gsometimes

∙[2]‖

Page 56: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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.

Page 57: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

57

2.

comb_subj

boy

snore

sometimes

sleep

coord

Page 58: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

58

Gsleep[1]

2.

Gsleep

Gsleep[1] ‖ Gsnore[2])

Page 59: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

59

Gsleep[1]

2.

Gsleep

Gsleep[1] ‖ Gsnore[2])

Page 60: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

60

2.Gsleep[1] ‖ Gsnore[2])

Gand

Gsleep[1]

Page 61: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

61

2.Gsleep[1] ‖ Gsnore[2])

Gand

Gsleep[1]

Page 62: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

62

2.Gsleep[1] ‖ Gsnore[2])

Gsnore

Gsnore[2]

Page 63: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

63

2.Gsleep[1] ‖ Gsnore[2])

Gsnore

Gsnore[2]

Page 64: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

64

2.Gsleep[1] ‖ Gsnore[2])

Gsleep[1] ‖ Gsnore[2]

Page 65: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

65

2.Gsleep[1] ‖ Gsnore[2])

Gsleep[1] ‖ Gsnore[2]

Page 66: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

66

2.

Gsleep[1] ‖ Gsnore[2])

G1

Page 67: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

67

2.

comb_subj

boy

snore

sometimes

sleep

coord

Page 68: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

68

G1

G1Gsometimes

2.

Page 69: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

69

G1

G1Gsometimes

2.

G2

Page 70: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

70

2.

comb_subj

boy

snore

sometimes

sleep

coord

Page 71: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

71

Gboy

fsubj(G2 ‖ Gboy[subj])

2.

Gboy

<root>

Page 72: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

72

Gboy

fsubj(G2 ‖ Gboy[subj])

2.

Gboy

<root>

Page 73: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

73

fsubj(G2 ‖ Gboy[subj])

2.

G2

G2 ‖ Gboy[subj]

Page 74: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

74

fsubj(G2 ‖ Gboy[subj])

2.

G2

G2 ‖ Gboy[subj]

Page 75: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

75

fsubj(G2 ‖ Gboy[subj])

2.

Page 76: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

76

2.

comb_subj

boy

snore

sometimes

sleep

coord

Page 77: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

The boy sometimes sleeps and snores (2)

77

fsubj(∙)

Gboy

∙[subj]

f1,2(∙)

Gcoord Gsnore∙[1]

Gsleep

Gsometimes

∙[2]‖

Page 78: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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

Page 79: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Relative clauses

79

Page 80: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Relative clauses

80

Page 81: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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

Page 82: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

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

Page 83: Semantic construction with s-graph grammars€¦ · Example: the boy wants to sleep 25 term h s (t) • the boy • wants to sleep f subj(∙) ‖ f vcomp(∙) ∙[subj] ‖ G 1 ∙[vcomp]

Thank you for your attention

Questions?

83