Top Banner
Practical SCFGs
78
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Edinburgh MT lecture 13: Practical SCFGs

Practical SCFGs

Page 2: Edinburgh MT lecture 13: Practical SCFGs

Synchronous context-free grammar

S → NP1 VP2 / NP1 VP2

NP → watashi wa / I NP → hako wo / the boxVP → NP1 V2 / V2 NP1

V → akemasu / open

Originally: syntax-directed translation (Lewis & Stearns 1966; Aho and Ullman 1969)

Page 3: Edinburgh MT lecture 13: Practical SCFGs

Translation as parsingS

NP VP

NP Vwatashi wa

akemasuhako wo

S

NP VP

V NPI

open the box

watashi wa hako wo akemasu I open the box

Page 4: Edinburgh MT lecture 13: Practical SCFGs

Questions about SCFGs

•How do n-gram language models fit in?

•How do we get the grammar?

•Is this really a plausible model of translation?

•Does it actually work? Why or why not?

Page 5: Edinburgh MT lecture 13: Practical SCFGs

Parsing as weighted deductionFor sentence w1…wn, grammar G with nonterminals N

[i,X, j] 8i, j 2 0, ..., n,X 2 N

[X ! ZY ] 8X ! XY 2 PG

[X ! w] 8X ! w 2 PG

[wi = w] 8i 2 1, ..., naxioms:

items:inference rules:

[1, S, n]goal:

[X ! w] : u [wi+1 = w] : v

[i,X, i+ 1] : u⌦ v

[X ! Y Z] : u [i, Y, k] : v [k, Z, j] : y

[i,X, j] : u⌦ v ⌦ y

Page 6: Edinburgh MT lecture 13: Practical SCFGs

Parsing as weighted deductionFor sentence w1…wn, grammar G with nonterminals N

[i,X, j] 8i, j 2 0, ..., n,X 2 N

[X ! ZY ] 8X ! XY 2 PG

[X ! w] 8X ! w 2 PG

[wi = w] 8i 2 1, ..., naxioms:

items:inference rules:

[1, S, n]goal:

[X ! w] : u [wi+1 = w] : v

[i,X, i+ 1] : u⌦ v

[X ! Y Z] : u [i, Y, k] : v [k, Z, j] : y

[i,X, j] : u⌦ v ⌦ y

Page 7: Edinburgh MT lecture 13: Practical SCFGs

From proof to (pseudo)codeInput: w1…wn, grammar Gfor i in 1,…,n: for X->w_i in P(G): chart[i-1,X,i] := u(X->w_i)for l in 2,…,n: for i in 0,…,n-l: j := i+l for k in i+1,…,j-1: for X->YZ in P(G): chart[i,X,j] += ( chart[i,Y,k] * chart[k,Z,j] * u(X->YZ))return chart[0,S,n]

Page 8: Edinburgh MT lecture 13: Practical SCFGs

From proof to (pseudo)codeInput: w1…wn, grammar Gfor i in 1,…,n: for X->w_i in P(G): chart[i-1,X,i] := u(X->w_i)for l in 2,…,n: for i in 0,…,n-l: j := i+l for k in i+1,…,j-1: for X->YZ in P(G): chart[i,X,j] += ( chart[i,Y,k] * chart[k,Z,j] * u(X->YZ))return chart[0,S,n]

Page 9: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

VBD1,2

VP1,4

PRP$2,3 NN3,4

NP2,4

PRP2,3 VB3,4

SBAR2,4

S0,4

Page 10: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

VBD1,2

VP1,4

PRP$2,3 NN3,4

NP2,4

PRP2,3 VB3,4

SBAR2,4

S0,4

Page 11: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

VBD1,2

VP1,4

PRP$2,3 NN3,4

NP2,4

PRP2,3 VB3,4

SBAR2,4

S0,4

I saw her duck

NP

VP

PRP VBD PRP$ NN

S

Page 12: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

VBD1,2

VP1,4

PRP$2,3 NN3,4

NP2,4

PRP2,3 VB3,4

SBAR2,4

S0,4

I saw her duck

NP

VP

PRP VBD PRP$ NN

SNP

VP

PRP VBD PRP$ NN

S

yo vi su pato

Page 13: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

VBD1,2

VP1,4

PRP$2,3 NN3,4

NP2,4

PRP2,3 VB3,4

SBAR2,4

S0,4

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

Page 14: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

VBD1,2

VP1,4

PRP$2,3 NN3,4

NP2,4

PRP2,3 VB3,4

SBAR2,4

S0,4

I saw her duck

SBAR

VP

PRP VBD PRP VB

SSBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

Page 15: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

VBD1,2

VP1,4

PRP$2,3 NN3,4

NP2,4

PRP2,3 VB3,4

SBAR2,4

S0,4

I saw her duck

SBAR

VP

PRP VBD PRP VB

SSBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

Page 16: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

VBD1,2

VP1,4

PRP$2,3 NN3,4

NP2,4

PRP2,3 VB3,4

SBAR2,4

S0,4

I saw her duck

SBAR

VP

PRP VBD PRP VB

SSBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

Page 17: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

score(e, a|f) = ✓ · h(e, a, f)

Page 18: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

score(e, a|f) = ✓ · h(e, a, f)

Page 19: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

VP

PRP

SBAR

VBD

PRP VB

VP

PRPSBAR

VBD

VBPRP

score(e, a|f) = ✓ · h(e, a, f)

Page 20: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

S

VP

PRP

SBAR

VBD

PRP VB

VP

PRPSBAR

VBD

VBPRP

SCFG feature decomposes over structure!

PRP VBD PRP VB

yo vi ella agacharse

Page 21: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

VP

PRP

SBAR

VBD

PRP VB

VP

PRPSBAR

VBD

VBPRP

Bigram language model feature does not!p(e) =

JY

j=1

p(ej |ej�1)

$^

Page 22: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

score(e, a|f) = ✓ · h(e, a, f)

$^

Page 23: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

score(e, a|f) = ✓ · h(e, a, f)

$^

bigramhere

Page 24: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

score(e, a|f) = ✓ · h(e, a, f)

$^

bigramhere

only evaluated

here

Page 25: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

score(e, a|f) = ✓ · h(e, a, f)

$^

bigramhere

only evaluated

here

Page 26: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

score(e, a|f) = ✓ · h(e, a, f)

$^

bigramhere

only evaluated

here

Page 27: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I saw her duck

SBAR

VP

PRP VBD PRP VB

S

SBAR

VP

PRP VBD PRP VB

S

yo vi ella agacharse

score(e, a|f) = ✓ · h(e, a, f)

$^

bigramhere

only evaluated

here

Page 28: Edinburgh MT lecture 13: Practical SCFGs

Decoding as weighted deductionFor sentence w1…wn, grammar G with nonterminals N

[i,X, j] 8i, j 2 0, ..., n,X 2 N

[X ! ZY ] 8X ! XY 2 PG

[X ! w] 8X ! w 2 PG

[wi = w] 8i 2 1, ..., naxioms:

items:inference rules:

[1, S, n]goal:

[X ! w] : u [wi+1 = w] : v

[i,X, i+ 1] : u⌦ v

[X ! Y Z] : u [i, Y, k] : v [k, Z, j] : y

[i,X, j] : u⌦ v ⌦ y

Page 29: Edinburgh MT lecture 13: Practical SCFGs

Decoding as weighted deductionFor sentence w1…wn, grammar G with nonterminals N

[X ! ZY ] 8X ! XY 2 PG

[wi = w] 8i 2 1, ..., naxioms:

items:inference rules:

goal:

[X ! w/w0] 8X ! w/w0 2 PG

[w1, i,X, j, w2] 8i, j 2 0, ..., n,X 2 N

[X ! w/w0] : u [wi+1] = w] : v

[w0, i,X, i+ 1, w0] : u⌦ v

[X ! Y Z] : u [w1, i, Y, k, w2] : v [w3, k, Z, j, w4] : y

[w1, i,X, j, w4] : u⌦ v ⌦ y ⌦ ↵(w2w3)

[̂ , 1, S, n, $]

Page 30: Edinburgh MT lecture 13: Practical SCFGs

Decoding as weighted deductionFor sentence w1…wn, grammar G with nonterminals N

[X ! ZY ] 8X ! XY 2 PG

[wi = w] 8i 2 1, ..., naxioms:

items:inference rules:

goal:

[X ! w/w0] 8X ! w/w0 2 PG

[w1, i,X, j, w2] 8i, j 2 0, ..., n,X 2 N

[X ! w/w0] : u [wi+1] = w] : v

[w0, i,X, i+ 1, w0] : u⌦ v

[X ! Y Z] : u [w1, i, Y, k, w2] : v [w3, k, Z, j, w4] : y

[w1, i,X, j, w4] : u⌦ v ⌦ y ⌦ ↵(w2w3)

[̂ , 1, S, n, $]

Page 31: Edinburgh MT lecture 13: Practical SCFGs

Decoding as weighted deductionFor sentence w1…wn, grammar G with nonterminals N

[X ! ZY ] 8X ! XY 2 PG

[wi = w] 8i 2 1, ..., naxioms:

items:inference rules:

goal:

[X ! w/w0] 8X ! w/w0 2 PG

[w1, i,X, j, w2] 8i, j 2 0, ..., n,X 2 N

[X ! w/w0] : u [wi+1] = w] : v

[w0, i,X, i+ 1, w0] : u⌦ v

[X ! Y Z] : u [w1, i, Y, k, w2] : v [w3, k, Z, j, w4] : y

[w1, i,X, j, w4] : u⌦ v ⌦ y ⌦ ↵(w2w3)

[̂ , 1, S, n, $]

Page 32: Edinburgh MT lecture 13: Practical SCFGs

Decoding as weighted deduction

inference rules:

goal:

[X ! w/w0] : u [wi+1] = w] : v

[w0, i,X, i+ 1, w0] : u⌦ v

[X ! Y Z] : u [w1, i, Y, k, w2] : v [w3, k, Z, j, w4] : y

[w1, i,X, j, w4] : u⌦ v ⌦ y ⌦ ↵(w2w3)

[̂ , 1, S, n, $]

What is the complexity of this algorithm?

Page 33: Edinburgh MT lecture 13: Practical SCFGs

Decoding as weighted deduction

inference rules:

goal:

[X ! w/w0] : u [wi+1] = w] : v

[w0, i,X, i+ 1, w0] : u⌦ v

[X ! Y Z] : u [w1, i, Y, k, w2] : v [w3, k, Z, j, w4] : y

[w1, i,X, j, w4] : u⌦ v ⌦ y ⌦ ↵(w2w3)

[̂ , 1, S, n, $]

What is the complexity of this algorithm?

O(N3I3⌃2(n�1))

exponential in n-gram order

Page 34: Edinburgh MT lecture 13: Practical SCFGs

Huang and Chiang Forest Rescoring

Cube Pruning

12

(VP held ⋆ meeting3,6 )

(VP held ⋆ talk3,6 )

(VP hold ⋆ conference3,6 )

(PPwith

⋆Sh

aron

1,3

)

(PPalon

g⋆Sh

aron

1,3

)

(PPwith

⋆Sh

alon

g

1,3

)

PP1, 3 VP3, 6

VP1, 6

monotonic grid?1.0 3.0 8.0

1.0 2.0 4.0 9.0

1.1 2.1 4.1 9.1

3.5 4.5 6.5 11.5

Page 35: Edinburgh MT lecture 13: Practical SCFGs

Huang and Chiang Forest Rescoring

Cube Pruning

13

(VP held ⋆ meeting3,6 )

(VP held ⋆ talk3,6 )

(VP hold ⋆ conference3,6 )

(PPwith

⋆Sh

aron

1,3

)

(PPalon

g⋆Sh

aron

1,3

)

(PPwith

⋆Sh

alon

g

1,3

)

PP1, 3 VP3, 6

VP1, 6

non-monotonic grid due to LM combo costs 1.0 3.0 8.0

1.0 2.0 + 0.5 4.0 + 5.0 9.0 + 0.5

1.1 2.1 + 0.3 4.1 + 5.4 9.1 + 0.3

3.5 4.5 + 0.6 6.5 +10.5 11.5 + 0.6

Page 36: Edinburgh MT lecture 13: Practical SCFGs

Huang and Chiang Forest Rescoring

Cube Pruning

13

(VP held ⋆ meeting3,6 )

(VP held ⋆ talk3,6 )

(VP hold ⋆ conference3,6 )

(PPwith

⋆Sh

aron

1,3

)

(PPalon

g⋆Sh

aron

1,3

)

(PPwith

⋆Sh

alon

g

1,3

)

PP1, 3 VP3, 6

VP1, 6

non-monotonic grid due to LM combo costs 1.0 3.0 8.0

1.0 2.0 + 0.5 4.0 + 5.0 9.0 + 0.5

1.1 2.1 + 0.3 4.1 + 5.4 9.1 + 0.3

3.5 4.5 + 0.6 6.5 +10.5 11.5 + 0.6

bigram (meeting, with)

Page 37: Edinburgh MT lecture 13: Practical SCFGs

Huang and Chiang Forest Rescoring

Cube Pruning

14

1.0 3.0 8.0

1.0 2.5 9.0 9.5

1.1 2.4 9.5 9.4

3.5 5.1 17.0 12.1

(VP held ⋆ meeting3,6 )

(VP held ⋆ talk3,6 )

(VP hold ⋆ conference3,6 )

(PPwith

⋆Sh

aron

1,3

)

(PPalon

g⋆Sh

aron

1,3

)

(PPwith

⋆Sh

alon

g

1,3

)

PP1, 3 VP3, 6

VP1, 6

non-monotonic grid due to LM combo costs

Page 38: Edinburgh MT lecture 13: Practical SCFGs

Huang and Chiang Forest Rescoring

Cube Pruning

15

1.0 3.0 8.0

1.0 2.5 9.0 9.5

1.1 2.4 9.5 9.4

3.5 5.1 17.0 12.1

(VP held ⋆ meeting3,6 )

(VP held ⋆ talk3,6 )

(VP hold ⋆ conference3,6 )

(PPwith

⋆Sh

aron

1,3

)

(PPalon

g⋆Sh

aron

1,3

)

(PPwith

⋆Sh

alon

g

1,3

)k-best parsing

(Huang and Chiang, 2005)

• a priority queue of candidates

• extract the best candidate

Page 39: Edinburgh MT lecture 13: Practical SCFGs

Huang and Chiang Forest Rescoring

Cube Pruning

16

(VP held ⋆ meeting3,6 )

(VP held ⋆ talk3,6 )

(VP hold ⋆ conference3,6 )

(PPwith

⋆Sh

aron

1,3

)

(PPalon

g⋆Sh

aron

1,3

)

(PPwith

⋆Sh

alon

g

1,3

)

• a priority queue of candidates

• extract the best candidate

• push the two successors

1.0 3.0 8.0

1.0 2.5 9.0 9.5

1.1 2.4 9.5 9.4

3.5 5.1 17.0 12.1

k-best parsing (Huang and Chiang, 2005)

Page 40: Edinburgh MT lecture 13: Practical SCFGs

Huang and Chiang Forest Rescoring

Cube Pruning

17

(VP held ⋆ meeting3,6 )

(VP held ⋆ talk3,6 )

(VP hold ⋆ conference3,6 )

(PPwith

⋆Sh

aron

1,3

)

(PPalon

g⋆Sh

aron

1,3

)

(PPwith

⋆Sh

alon

g

1,3

)

1.0 3.0 8.0

1.0 2.5 9.0 9.5

1.1 2.4 9.5 9.4

3.5 5.1 17.0 12.1

• a priority queue of candidates

• extract the best candidate

• push the two successors

k-best parsing (Huang and Chiang, 2005)

Page 41: Edinburgh MT lecture 13: Practical SCFGs

Cube pruning

•Parse as usual using CKY.

•Revisit chart in topological order expanding language model.

•Only produce top k expansions per cell.

•Many variants (lazy, A*, etc.)

Page 42: Edinburgh MT lecture 13: Practical SCFGs

ParsingNN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR

Page 43: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR

Page 44: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR

Page 45: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR VBD1,2

Page 46: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR VBD1,2

PRP$2,3

Page 47: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR VBD1,2

PRP$2,3

PRP2,3

Page 48: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR VBD1,2

PRP$2,3

PRP2,3

NN3,4

VB3,4

Page 49: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR VBD1,2

PRP$2,3

PRP2,3

NN3,4

VB3,4

NP2,4

Page 50: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR VBD1,2

PRP$2,3

PRP2,3

NN3,4

VB3,4

NP2,4 SBAR2,4

Page 51: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR VBD1,2

PRP$2,3

PRP2,3

NN3,4

VB3,4

NP2,4 SBAR2,4

VP1,4

Page 52: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR VBD1,2

PRP$2,3

PRP2,3

NN3,4

VB3,4

NP2,4 SBAR2,4

VP1,4

Page 53: Edinburgh MT lecture 13: Practical SCFGs

Parsing

I1 saw2 her3 duck4

PRP0,1

NN → duck

PRP → I

VBD → saw

PRP$ → her

NP → PRP$ NN

VP → VBD NP

S → PRP VP

PRP → her

VB → duckSBAR → PRP VB

VP → VBD SBAR VBD1,2

PRP$2,3

PRP2,3

NN3,4

VB3,4

NP2,4 SBAR2,4

VP1,4

S0,4

Page 54: Edinburgh MT lecture 13: Practical SCFGs

Japanese watashi wa

hako wo hako wo akemasu akemasu

hako wo akemasu

English I

the box box open

open the open the box

p(E|J) 1.0 0.5 0.5 0.5 0.5 1.0

A translation model is simply a probabilistic phrase dictionary.

Page 55: Edinburgh MT lecture 13: Practical SCFGs

Japanese watashi wa

hako wo hako wo akemasu akemasu

hako wo akemasu

English I

the box box open

open the open the box

p(E|J) 1.0 0.5 0.5 0.5 0.5 1.0

Page 56: Edinburgh MT lecture 13: Practical SCFGs

Japanese watashi wa

hako wo hako wo akemasu akemasu

hako wo akemasu X1 X2 akemasu

akemasu X1 watashi wa X1 X2

X1 hako wo X2

English I

the box box open

open the open the box X1 open X2

open X1 I X2 X1

X1 X2 the box

p(E|J) 1.0 0.5 0.5 0.5 0.5 1.0 1.0 1.0 1.0 1.0

Page 57: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashiwa hako woakemasu

Page 58: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashiwa hako woakemasu

word alignment: expectation maximization

Page 59: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashi

wa

hako

wo

akemasu

Page 60: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashi

wa

hako

wo

akemasu

akemasu / open

Page 61: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashi

wa

hako

wo

akemasu

watashi wa / I

Page 62: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashi

wa

hako

wo

akemasu

hako wo / the box

Page 63: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashi

wa

hako

wo

akemasu

✘hako wo / open the box

Page 64: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashi

wa

hako

wo

akemasu

hako wo akemasu / open the box

Page 65: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashi

wa

hako

wo

_ akemasu / open _

Page 66: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashi

wa

hako

wo

_1 _2 akemasu/ _1 open _2

Page 67: Edinburgh MT lecture 13: Practical SCFGs

Phrase ExtractionI open the box

watashi

wa

hako

wo

watashi wa hako wo _ / I _ the box

Page 68: Edinburgh MT lecture 13: Practical SCFGs

Extrac0ng,Syntac0c,Rules

澳洲是 与 北 � 有 邦

交的 少数国家之一

Australia

is

one

of

the

few

countries

that

have

diplomatic

relations

with

North

Korea

Page 69: Edinburgh MT lecture 13: Practical SCFGs

NNP

PP

NP

NP

NP

NPPPNPCOMP

VP

Extrac0ng,Syntac0c,Rules

澳洲是 与 北 � 有 邦

交的 少数国家之一

Australia

is

one

of

the

few

countries

that

have

diplomatic

relations

with

North

Korea

VP

SNP

NP

Page 70: Edinburgh MT lecture 13: Practical SCFGs

NNP

PP

NP

NP

NP

NPPPNPCOMP

VP

Extrac0ng,Syntac0c,Rules

澳洲

是 与 北 � 有 邦交

的 少数

国家

之一

Australia

is

one

of

the

few

countries

that

have

diplomatic

relations

with

North

Korea

VP → 与 北 � 有 邦交, have diplomatic relations with North Korea

VP

SNP

NP

Page 71: Edinburgh MT lecture 13: Practical SCFGs

NNP

PP

NP

NP

NP

NPPPNPCOMP

VP

Extrac0ng,Syntac0c,Rules

澳洲

是 与 北 � 有 邦交

的 少数

国家

之一

Australia

is

one

of

the

few

countries

that

have

diplomatic

relations

with

North

Korea

VP → 与 北 � 有 邦交, have diplomatic relations with North Korea

NP → 与 北 � 有 邦交 的 少数 国家, the few countries that have diplomatic relations with North Korea

VP

SNP

NP

NP → VP 的 少数 国家, the few countries that VP

Page 72: Edinburgh MT lecture 13: Practical SCFGs

NNP

PP

NP

NP

NP

NPPPNPCOMP

VP

Extrac0ng,Syntac0c,Rules

澳洲

是 与 北 � 有 邦交

的 少数

国家

之一

Australia

is

one

of

the

few

countries

that

have

diplomatic

relations

with

North

Korea

VP → 与 北 � 有 邦交, have diplomatic relations with North Korea

NP → 与 北 � 有 邦交 的 少数 国家, the few countries that have diplomatic relations with North Korea

VP

SNP

NP

NP → VP 的 少数 国家, the few countries that VP

NP → VP 的 NP, the NP that VP

Page 73: Edinburgh MT lecture 13: Practical SCFGs

NNP

PP

NP

NP

NP

NPPPNPCOMP

VP

Extrac0ng,Syntac0c,Rules

澳洲

是 与 北 � 有 邦交

的 少数

国家

之一

Australia

is

one

of

the

few

countries

that

have

diplomatic

relations

with

North

Korea

VP → 与 北 � 有 邦交, have diplomatic relations with North Korea

NP → 与 北 � 有 邦交 的 少数 国家, the few countries that have diplomatic relations with North Korea

VP

SNP

NP

Page 74: Edinburgh MT lecture 13: Practical SCFGs

NNP

PP

NP

NP

NP

NPPPNPCOMP

VP

Extrac0ng,Syntac0c,Rules

澳洲

是 与 北 � 有 邦交

的 少数

国家

之一

Australia

is

one

of

the

few

countries

that

have

diplomatic

relations

with

North

Korea

VP → 与 北 � 有 邦交, have diplomatic relations with North Korea

??? → 的 少数 国家, !the few countries that

NP → 与 北 � 有 邦交 的 少数 国家, the few countries that have diplomatic relations with North Korea

VP

SNP

NP

Page 75: Edinburgh MT lecture 13: Practical SCFGs

NNP

PP

NP

NP

NP

NPPPNPCOMP

VP

Extrac0ng,Syntac0c,Rules

澳洲

是 与 北 � 有 邦交

的 少数

国家

之一

Australia

is

one

of

the

few

countries

that

have

diplomatic

relations

with

North

Korea

VP → 与 北 � 有 邦交, have diplomatic relations with North Korea

??? → 的 少数 国家, !the few countries that

NP → 与 北 � 有 邦交 的 少数 国家, the few countries that have diplomatic relations with North Korea

??? → 澳洲 是, !Australia is

VP

SNP

NP

Page 76: Edinburgh MT lecture 13: Practical SCFGs

(Fox, 2002)

Page 77: Edinburgh MT lecture 13: Practical SCFGs
Page 78: Edinburgh MT lecture 13: Practical SCFGs