Natural Language Processing CSCI 4152/6509 — Lecture 27 Parsing with Prolog
Instructor: Vlado Keselj Time and date: 09:35–10:25, 13-Mar-2020 Location: Dunn 135
CSCI 4152/6509, Vlado Keselj Lecture 27 1 / 23
Natural Language Processing CSCI 4152/6509 Lecture 27 Parsing with - - PowerPoint PPT Presentation
Natural Language Processing CSCI 4152/6509 Lecture 27 Parsing with Prolog Instructor: Vlado Keselj Time and date: 09:3510:25, 13-Mar-2020 Location: Dunn 135 CSCI 4152/6509, Vlado Keselj Lecture 27 1 / 23 Previous Lecture
CSCI 4152/6509, Vlado Keselj Lecture 27 1 / 23
◮ formal definition ◮ inducing a grammar from parse trees ◮ derivations ◮ some notions and terminology
CSCI 4152/6509, Vlado Keselj Lecture 27 2 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 3 / 23
Require: sentence = w1 . . . wn, and a CFG in CNF with nonterminals N 1 . . . N m, N 1 is the start symbol Ensure: parsed sentence 1: allocate matrix β ∈ {0, 1}n×n×m and initialize all entries to 0 2: for i ← 1 to n do 3: for all rules N k → wi do 4: β[i, 1, k] ← 1 5: for j ← 2 to n do 6: for i ← 1 to n − j + 1 do 7: for l ← 1 to j − 1 do 8: for all rules N k → N k1N k2 do 9: β[i, j, k] ← β[i, j, k] OR (β[i, l, k1] AND β[i + l, j − l, k2]) 10: return β[1, n, 1]
CSCI 4152/6509, Vlado Keselj Lecture 27 4 / 23
1
2
CSCI 4152/6509, Vlado Keselj Lecture 27 5 / 23
◮ more details are provided in the lab
CSCI 4152/6509, Vlado Keselj Lecture 27 6 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 7 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 8 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 9 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 10 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 11 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 12 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 13 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 14 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 15 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 16 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 17 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 18 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 19 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 20 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 21 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 22 / 23
CSCI 4152/6509, Vlado Keselj Lecture 27 23 / 23