Daniel Gildea Giorgio Satta University of Rochester Universit di - - PowerPoint PPT Presentation

daniel gildea giorgio satta
SMART_READER_LITE
LIVE PREVIEW

Daniel Gildea Giorgio Satta University of Rochester Universit di - - PowerPoint PPT Presentation

Synchronous Context-Free Grammars and Optimal Linear Parsing Strategies Daniel Gildea Giorgio Satta University of Rochester Universit di Padova Synchronous CFG Context-free Grammar: X A B Synchronous Context-free Grammar (SCFG) 4 , C 1


slide-1
SLIDE 1

Synchronous Context-Free Grammars and Optimal Linear Parsing Strategies

Daniel Gildea Giorgio Satta

University of Rochester Università di Padova

slide-2
SLIDE 2

Synchronous CFG

Context-free Grammar: X → A B Synchronous Context-free Grammar (SCFG) X →A

1 B 2 C 3 D 4 , C 3 A 1 D 4 B 2

C →Powell, 鲍威尔

slide-3
SLIDE 3

Synchronous CFG

  • Synchronous parsing: find tree from two strings

– used to learn grammar from parallel text

  • This talk: parsing strategies for long rules
  • Results also apply to translation with n-gram

language model

slide-4
SLIDE 4

Context-Free Grammar

A → B C

B C A

slide-5
SLIDE 5

Binary SCFG

A → B

1 C 2 , C 2 B 1

B C A

slide-6
SLIDE 6

SCFG with 4 nonterminals

A → B

1 C 2 D 3 E 4 , C 2 E 4 B 1 D 3

E D C B A

slide-7
SLIDE 7

Fan-Out

Number of spans in nonterminal. CFG: fan-out 1

B C A

SCFG: fan-out 2

E D C B A

ϕ(G) = max

N∈G ϕ(N)

(Rambow & Satta, 1999)

slide-8
SLIDE 8

Rank

Number of nonterminals on righthand side of rule. CFG: rank 2

B C A

SCFG: rank r

E D C B A

ρ(G) = max

P∈G ρ(P)

slide-9
SLIDE 9

Parsing Strategies

Reduce rank

E D C B A A → B C D E C B X D X Y E Y A X → B C Y → X D A → Y E

slide-10
SLIDE 10

Parsing Strategies

Reduce rank, may increase fan-out

E D C B A C B X

slide-11
SLIDE 11

Rule Length in Synchronous CFG

  • Binary grammar (ITG): parsing is O(n6) (Wu, 1997)

– Works in real MT (Zhang et al. 2006)

  • Many rules cannot be binarized without

increasing fan-out (Aho and Ullman, 1972)

  • Fan-out affects space and time complexity
slide-12
SLIDE 12

Parsing Complexity

Space complexity: O(n2ϕ(A)) Time complexity: O(nϕ(A)+ϕ(B)+ϕ(C))

B C A B C A O(n2) space O(n4) space O(n3) time O(n6) time

(Seki et al. 1991)

slide-13
SLIDE 13

SCFG Parsing Strategies

E D C B A C B X

naïve strategy: O(n2r+2) time best strategy: Ω(ncr) for some c

(Gildea and Štefankovi´ c 2007)

slide-14
SLIDE 14

This Talk

  • Finding optimal space complexity is

NP-complete

  • Finding optimal time complexity ⇒ better algs

for treewidth

slide-15
SLIDE 15

Example Rule

B

8

B

7

B

6

B

5

B

4

B

3

B

2

B

1

A

slide-16
SLIDE 16

Optimal Parsing Strategy

n7 n5 B

1

n3 B

2

n1 B

3

B

4

n6 B

5

n4 B

6

n2 B

7

B

8 B

4

B

3

n1

slide-17
SLIDE 17

Carving Width

2 3 4 1 G 1 2 3 4 tree layout of G

Carving width: max number edges of G routed through tree layout

slide-18
SLIDE 18

Cyclic Permutation Multigraph

B

1

B

2

B

3

B

4

B

5

B

6

B

7

B

8

A

A → B

1 B 2 B 3 B 4 B 5 B 6 B 7 B 8 ,

B

5 B 7 B 3 B 1 B 8 B 6 B 2 B 4

slide-19
SLIDE 19

Carving Width = Space Complexity

A n7 n5 n3 n1 n6 n4 n2 B

1

B

2

B

3

B

4

B

5

B

6

B

7

B

8

slide-20
SLIDE 20

Our Reduction

  • Carving width instance: (G, k)
  • Construct permutation multigraph G′, integer k′
  • Carving width of G ⇔ Carving width of G′ ⇔
  • ptimal parsing for SCFG
slide-21
SLIDE 21

Our Construction

2 3 4 1 G 1 2 3 4 tree layout of G

X1 G1 X2 G2 X3 G3 X4 G4

slide-22
SLIDE 22

G1 X1 G2 X2 G3 X3 G4 X4

slide-23
SLIDE 23

Space Complexity

Theorem 1: Finding the parsing strategy with optimal space complexity for an SCFG rule is NP-complete

slide-24
SLIDE 24

Treewidth

A C E G I K M B D F H J L N P R O Q S CDE DEF EFG FGH GHI HIJ IJK BCD GHN JKL ABC HNO KLM NOP OPQ PQR QRS

slide-25
SLIDE 25

Dependency Graph

x0 x1 x2 x3 x4 y0 y1 y2 y3 y4 x0 x1 x2 x3 x4 A → B C D E S → A

1 B 2 C 3 D 4 , B 2 D 4 A 1 C 3

slide-26
SLIDE 26

Treewidth = Time Complexity

x0 x1 x2 x3 x4 x0x1x2 x0x2x3 x0x3x4 A → B C D E C B X D X Y E Y A X → B C Y → X D A → Y E

slide-27
SLIDE 27

Our Reduction

  • Treewidth instance: (G, k)
  • Construct dependency graph G′, integer k′
  • Approx of treewidth of G ⇔ Treewidth of G′ ⇔
  • ptimal time complexity for SCFG
slide-28
SLIDE 28

Dependency Graph Construction

slide-29
SLIDE 29

Approximation Algorithm for Treewidth

SOL < 8∆(G)(OPT + 1) . SOL: solution using SCFG parsing strategy OPT: optimal treewidth of input graph G

∆(G) = degree (max num edges touching one vertex)

slide-30
SLIDE 30

Time Complexity

Theorem 2: Finding the parsing strategy with optimal time complexity for an SCFG rule implies a

∆(G)-factor approximation algorithm for treewidth.

slide-31
SLIDE 31

Time Complexity

Theorem 3: If finding the parsing strategy with

  • ptimal time complexity for an SCFG rule is

NP-complete, then treewidth for graphs of degree 6 is NP-complete.

slide-32
SLIDE 32

Conclusion

  • Finding parsing strategy with best space

complexity is NP-hard.

  • P-time alg for finding parsing strategy with best

time complexity implies better approximation algs for treewidth

  • NP-hardness for time complexity implies

NP-hardness for treewidth of graphs of degree six