Synchronous Grammars Synchronous grammars are a way of - - PowerPoint PPT Presentation

synchronous grammars synchronous grammars
SMART_READER_LITE
LIVE PREVIEW

Synchronous Grammars Synchronous grammars are a way of - - PowerPoint PPT Presentation

Synchronous Grammars Synchronous grammars are a way of simultaneously generating pairs of recursively related strings Synchronous grammar w w Synchronous grammars were originally invented for programming language compilation


slide-1
SLIDE 1

Synchronous Grammars

slide-2
SLIDE 2

Synchronous grammars

are a way of simultaneously generating pairs of recursively related strings Synchronous grammar

w wʹ

slide-3
SLIDE 3

Synchronous grammars

Synchronous grammar

for i := 1 to 10 do begin n := n + i end mov ax, 1 loop: add bx, ax cmp ax, 10 jle loop

were originally invented for programming language compilation

slide-4
SLIDE 4

Synchronous grammars

Synchronous grammar I open the box

  • pen′(me′, box′)

have been proposed as a way of doing semantic interpretation

slide-5
SLIDE 5

Synchronous grammars

Synchronous grammar I open the box watashi wa hako wo akemasu have been used for syntax-based machine translation

slide-6
SLIDE 6

Synchronous grammars

can do much fancier transformations than finite-state methods

shoonen ga gakusei ga sensei ga odotta to itta to hanashita The boy stated that the student said that the teacher danced

boy student teacher danced stated said that that

slide-7
SLIDE 7

Synchronous grammars

can do much fancier transformations than finite-state methods …dat Jan Piet de kinderen zag helpen zwemmen …that John saw Peter help the children swim

John Peter the children saw swim help

slide-8
SLIDE 8

Overview

Definitions Properties Algorithms Extensions

slide-9
SLIDE 9

Definitions

slide-10
SLIDE 10

Context-free grammars

S → NP VP NP → I NP → the box

VP → V NP V → open

S NP VP V NP I

  • pen the

box

slide-11
SLIDE 11

Context-free grammars

S → NP VP NP → watashi wa NP → hako wo

VP → NP V V → akemasu

S NP VP V NP akemasu hako wo watashi wa

slide-12
SLIDE 12

Synchronous CFGs

S → NP1 VP2 S → NP1 VP2 NP → I NP → watashi wa NP → the box NP → hako wo

VP → V1 NP2 VP → NP2 V1 V → open V → akemasu

slide-13
SLIDE 13

Synchronous CFGs

S → NP1 VP2, NP1 VP2 NP → I, watashi wa NP → the box, hako wo

VP → V1 NP2, NP2 V1 V → open, akemasu

S → NP1 VP2, NP1 VP2 NP → I, watashi wa NP → the box, hako wo

VP → V1 NP2, NP2 V1 V → open, akemasu

slide-14
SLIDE 14

NP2 VP3 NP2 VP3 S1 S1 S1 VP3 VP3 V4 NP5 V4 NP5 NP2 NP2 I watashi wa

Synchronous CFGs

V4 V4

  • pen

akemasu NP5 NP5 the box hako wo S1

slide-15
SLIDE 15

S → NP1 VP2, NP1 VP2 NP → I, watashi wa NP → the box, hako wo

VP → V1 NP2, NP2 V1 V → open, akemasu

Adding probabilities

0.3 0.1 0.6 0.5 0.2

slide-16
SLIDE 16

NP2 VP3 NP2 VP3 S1 S1 0.3

Synchronous CFGs

S1 S1 Derivation probability: V4 V4

  • pen

akemasu × 0.6 NP2 NP2 I watashi wa × 0.1 VP3 VP3 V4 NP5 V4 NP5 × 0.5 NP5 NP5 the box hako wo × 0.2

slide-17
SLIDE 17

Other notations

(VP → V1 NP2 , VP → NP2 V1) VP → 〈V NP〉 VP → ⋈ [1,2] ( V NP ) [2,1] V NP

Inversion transduction grammar (Wu) Multitext grammar (Melamed)

VP → (V1 NP2 , NP2 V1)

Syntax directed translation schema (Aho and Ullman; Lewis and Stearns)

slide-18
SLIDE 18

Properties

slide-19
SLIDE 19

Chomsky normal form

X → Y Z X → a

slide-20
SLIDE 20

Chomsky normal form

A → (((B C) D) E) F rank 5

slide-21
SLIDE 21

Chomsky normal form

A → [[[B C] D] E] F

A → V1 F V1 → V2 E V2 → V3 D V3 → B C

rank 5 rank 2

slide-22
SLIDE 22

A hierarchy of synchronous CFGs

1-SCFG ⊊ 2-SCFG = 3-SCFG ⊊ 4-SCFG ⊊ … = ITG (Wu, 1997) = 1-CFG ⊊ 2-CFG = 3-CFG = 4-CFG = …

slide-23
SLIDE 23

Synchronous CNF?

A → (B1 [C2 D3], [C2 D3] B1) rank 3

slide-24
SLIDE 24

Synchronous CNF?

A → (B1 [C2 D3], [C2 D3] B1) rank 3

A → (B1 V12 , V12 B1) V1 → (C1 D2 , C1 D2)

rank 2

slide-25
SLIDE 25

Synchronous CNF?

A → (B1 C2 D3 E4, C2 E4 B1 D3) A → ([B1 C2] D3 E4, [C2 E4 B1] D3) A → (B1 [C2 D3] E4, [C2 E4 B1 D3]) A → (B1 C2 [D3 E4], C2 [E4 B1 D3]) rank 4

slide-26
SLIDE 26

Synchronous CNF?

1 2 3 4 1

B

2

C

3

D

4

E

1 2 3 1

B

2

C

3

D

A → (B1 C2 D3, C2 D3 B1) A → (B1 C2 D3 E4, C2 E4 B1 D3)

slide-27
SLIDE 27

A hierarchy of synchronous CFGs

1-SCFG ⊊ 2-SCFG = 3-SCFG ⊊ 4-SCFG ⊊ … = ITG (Wu, 1997) = 1-CFG ⊊ 2-CFG = 3-CFG = 4-CFG = …

slide-28
SLIDE 28

Algorithms

slide-29
SLIDE 29

Overview

Translation Bitext parsing

slide-30
SLIDE 30

I

Review: CKY

  • pen the box

I NP V

  • pen

S → NP VP NP → I NP → the box VP → V NP V → open

slide-31
SLIDE 31

I

Review: CKY

  • pen the box

I NP NP the box V

  • pen

S → NP VP NP → I NP → the box VP → V NP V → open

slide-32
SLIDE 32

V NP I

Review: CKY

  • pen the box

NP NP V VP

S → NP VP NP → I NP → the box VP → V NP V → open

slide-33
SLIDE 33

NP VP I

Review: CKY

  • pen the box

NP VP S

S → NP VP NP → I NP → the box VP → V NP V → open

slide-34
SLIDE 34

I

Review: CKY

  • pen the box

S

S → NP VP NP → I NP → the box VP → V NP V → open

slide-35
SLIDE 35

Review: CKY

  • pen the box

NP3 V2 VP4 V2 NP3 O(n3) ways of matching

slide-36
SLIDE 36

Translation

S NP1 VP2 V3 NP4

  • pen the

box I I open the box O(n3)

slide-37
SLIDE 37

watashi wa NP1 V3 NP4 VP2 hako wo NP4 akemasu V3

Translation

S S NP1 VP2 V3 NP4

  • pen the

box I I open the box O(n3) O(n) NP1 VP2 S watashi wa hako wo akemasu O(n)

slide-38
SLIDE 38

Translation

B C D E A What about… O(n5) ways of combining?

slide-39
SLIDE 39

Translation

B C D E A V2 V1 B C D E A C E D B A flatten O(n) translate O(n) parse O(n3)

slide-40
SLIDE 40

Bitext parsing

I open the box S S NP1 VP2 NP1 VP2 V3 NP4 V3 NP4

  • pen

akemasu the box hako wo I watashi wa O(n?) watashi wa hako wo akemasu

slide-41
SLIDE 41

V3 V3

  • pen

akemasu NP4 NP4 the box hako wo NP1 NP1 I watashi wa

  • pen

akemasu the box hako wo I watashi wa

Bitext parsing

Consider rank-2 synchronous CFGs for now

slide-42
SLIDE 42

V3 V3

  • pen

akemasu NP4 NP4 the box hako wo NP1 NP1 I watashi wa

Bitext parsing

VP2 VP2 V3 NP4 V3 NP4

slide-43
SLIDE 43
  • pen

akemasu the box hako wo NP1 NP1 I watashi wa

Bitext parsing

VP2 VP2 S S NP1 VP2 NP1 VP2

slide-44
SLIDE 44
  • pen

akemasu the box hako wo I watashi wa

Bitext parsing

S S

slide-45
SLIDE 45

V3 V3

  • pen

akemasu NP4 NP4 the box hako wo

Bitext parsing

VP2 VP2 V3 NP4 V3 NP4 O(n6) ways of matching

slide-46
SLIDE 46

Bitext parsing

B1 C2 D3 E4 C2 E4 B1 D3 A A O(n10) ways of combining!

slide-47
SLIDE 47

Algorithms

Translation: easy Bitext parsing: polynomial in n but worst-case exponential in rank

slide-48
SLIDE 48

Algorithms

Translation with an n-gram language model Offline rescoring Intersect grammar and LM (Wu 1996; Huang et al. 2005): slower Hybrid approaches (Chiang 2005; Zollman and Venugopal 2006)

slide-49
SLIDE 49

Extensions

slide-50
SLIDE 50

Limitations of synchronous CFGs

S NP VP V NP John misses Mary S NP VP V NP Marie manque Jean PP P à

slide-51
SLIDE 51

One solution

S1 NP2 NP3 John misses Mary S1 NP3 NP2 Marie manque Jean à

slide-52
SLIDE 52

Synchronous tree substitution grammars

S NP1 VP V NP2 John misses S NP2 VP V NP1 manque PP P à NP Jean NP Mary NP Marie NP

slide-53
SLIDE 53

NP NP

Synchronous tree substitution grammars

S VP V NP misses S VP V NP manque PP P à NP Mary Marie NP NP John Jean NP

1 1 2 2

slide-54
SLIDE 54

Limitations of synchronous TSGs

…dat Jan Piet de kinderen zag helpen zwemmen …that John saw Peter help the children swim This pattern extends to n nouns and n verbs

slide-55
SLIDE 55

S

Limitations of synchronous TSGs

NP NP S VP V saw S VP V zag S NP Jan NP John

1 2 1 2

Peter help the children swim Piet de kinderen helpen zwemmen

? ?

slide-56
SLIDE 56

Tree-adjoining grammar

S S V zwemmen de kinderen NP VP V t S S V helpen Piet NP VP V t S*

slide-57
SLIDE 57

S S V zwemmen de kinderen NP VP V t S S V helpen Piet NP VP V t

S S V zwemmen de kinderen NP VP V t

S S V helpen Piet NP VP V t S*

slide-58
SLIDE 58

Synchronous TAG

S S1 V zwemmen de kinderen NP2 VP3 V t S1 the children NP2 VP3 V swim

slide-59
SLIDE 59

S S1 V zwemmen de kinderen NP2 VP3 V t S1 the children NP2 VP3 V swim S1 Peter NP2 VP3 V help S* S S1 V helpen Piet NP2 VP3 V t S*

slide-60
SLIDE 60

S the children NP4 VP5 V swim S1 Peter NP2 VP3 V help S S V zwemmen de kinderen NP4 VP5 V t S S1 V helpen Piet NP2 VP3 V t

slide-61
SLIDE 61

S the children NP4 VP5 V swim S1 Peter NP2 VP3 V help S S V zwemmen de kinderen NP4 VP5 V t S S1 V helpen Piet NP2 VP3 V t S S1 V zag Jan NP2 VP3 V t S* S1 John NP2 VP3 V saw S*

slide-62
SLIDE 62

S the children NP6 VP7 V swim S Peter NP4 VP5 V help S1 John NP2 VP3 V saw S S V zwemmen de kinderen NP6 VP7 V t S S V helpen Piet NP4 VP5 V t S V zag S1 Jan NP2 VP3 V t

slide-63
SLIDE 63

Summary

Synchronous grammars are useful for various tasks including translation Some rules “in the wild” (Chiang, 2005):

X → (de, ’s) X → (X1 de X2, the X2 of X1) X → (X1 de X2, the X2 that) X → (zai X1 xia, under X1) X → (zai X1 qian, before X1) X → (X1 zhiyi, one of X1)

slide-64
SLIDE 64

Summary

Synchronous context-free grammars vary in power depending on rank Translation is easy; bitext parsing is exponential in rank

slide-65
SLIDE 65

Summary

Beyond synchronous CFGs, synchronous TSGs allow multilevel rules synchronous TAGs allow discontinuous constituents