# ANTONIS ANASTASOPOULOS CS499 INTRODUCTION TO NLP PARSING WITH CFGS.

(1)

(2)

2

(3)

3

(4)

4

(5)

5

(6)

6

(7)

7

(8)

8

1

2

n

(9)

9

(10)

10

(11)

(12)

12

(13)

13

(14)

14

(15)

## CKY ALGORITHM

(16)

16

(17)

### CKY: CHART

17

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(18)

### CKY: CHART

18

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(19)

### CKY: CHART

19

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(20)

### CKY: CHART

20

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(21)

### CKY: CHART

21

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(22)

### CKY: CHART

22

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(23)

### CKY: CHART

23

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(24)

### CKY: CHART

24

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(25)

### CKY: CHART

25

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(26)

### CKY: CHART

26

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(27)

### CKY: CHART

27

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(28)

### CKY: CHART

28

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(29)

### CKY: CHART

29

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(30)

### CKY: CHART

30

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(31)

### CKY: CHART

31

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(32)

### CKY: CHART

32

For

For // width

For // left boundary

// right boundary

For // midpoint

Return true if

i = [1 … n]

C[i − 1, i] = {V ∣ V → wi} l = 2 … n :

i = 0 … n − l : k = i + l

j = i + 1 … k − 1 :

C[i, k] = C[i, k] ∪ {V ∣ V → YZ, Y ∈ C[i, j], Z ∈ C[j, k]}

S ∈ C[0,n]

(33)

33

(34)

34

(35)

35

Updating...

## References

Related subjects :