Natural Language Processing (CSEP 517): Phrase Structure Syntax and Parsing
Noah Smith
c 2017 University of Washington nasmith@cs.washington.edu
April 24, 2017
1 / 87
Natural Language Processing (CSEP 517): Phrase Structure Syntax and - - PowerPoint PPT Presentation
Natural Language Processing (CSEP 517): Phrase Structure Syntax and Parsing Noah Smith 2017 c University of Washington nasmith@cs.washington.edu April 24, 2017 1 / 87 To-Do List Online quiz: due Sunday Ungraded mid-quarter
1 / 87
2 / 87
◮ Initial state s0 ∈ S ◮ Final states F ⊆ S
◮ Special case: deterministic FSA defines δ : S × Σ → S
3 / 87
◮ an empty string (usually denoted ǫ) or a symbol from Σ ◮ a concatentation of regular expressions (e.g., abc) ◮ an alternation of regular expressions (e.g., ab|cd) ◮ a Kleene star of a regular expression (e.g., (abc)∗)
4 / 87
5 / 87
6 / 87
7 / 87
8 / 87
9 / 87
10 / 87
11 / 87
12 / 87
13 / 87
14 / 87
15 / 87
16 / 87
◮ On September 17th, I’d like to fly from Atlanta to Denver ◮ I’d like to fly on September 17th from Atlanta to Denver ◮ I’d like to fly from Atlanta to Denver on September 17th 17 / 87
◮ On September 17th, I’d like to fly from Atlanta to Denver ◮ I’d like to fly on September 17th from Atlanta to Denver ◮ I’d like to fly from Atlanta to Denver on September 17th
◮ *On September I’d like to fly 17th from Atlanta to Denver 18 / 87
◮ On September 17th, I’d like to fly from Atlanta to Denver ◮ I’d like to fly on September 17th from Atlanta to Denver ◮ I’d like to fly from Atlanta to Denver on September 17th
◮ *On September I’d like to fly 17th from Atlanta to Denver
◮ I’d like to fly from Atlanta to Denver on September 17th and in the morning 19 / 87
20 / 87
21 / 87
◮ A start symbol S ∈ N
◮ The lefthand side N is a nonterminal from N ◮ The righthand side α is a sequence of zero or more terminals and/or nonterminals:
◮ Special case: Chomsky normal form constrains α to be either a single terminal
22 / 87
23 / 87
24 / 87
25 / 87
26 / 87
27 / 87
28 / 87
29 / 87
30 / 87
S NP-SBJ NP NNP Pierre NNP Vinken , , ADJP NP CD 61 NNS years JJ
, , VP MD will VP VB join NP DT the NN board PP-CLR IN as NP DT a JJ nonexecutive NN director NP-TMP NNP Nov. CD 29
31 / 87
32 / 87
33 / 87
34 / 87
35 / 87
36 / 87
37 / 87
38 / 87
S Aux does NP Det this Noun flight VP Verb include NP Det a Noun meal
39 / 87
40 / 87
41 / 87
42 / 87
◮ Often greedy, with a statistical classifier deciding what action to take in every state. 43 / 87
◮ Often greedy, with a statistical classifier deciding what action to take in every state.
44 / 87
◮ Often greedy, with a statistical classifier deciding what action to take in every state.
◮ Today: scores are defined using the rules.
t
t
45 / 87
◮ A start symbol S ∈ N
◮ The lefthand side N is a nonterminal from N ◮ The righthand side α is a sequence of zero or more terminals and/or nonterminals:
◮ Special case: Chomsky normal form constrains α to be either a single terminal
46 / 87
47 / 87
48 / 87
49 / 87
50 / 87
51 / 87
52 / 87
53 / 87
54 / 87
55 / 87
56 / 87
57 / 87
58 / 87
59 / 87
60 / 87
61 / 87
62 / 87
63 / 87
64 / 87
65 / 87
66 / 87
67 / 87
68 / 87
69 / 87
70 / 87
71 / 87
72 / 87
73 / 87
◮ Pop the highest-priority update from the agenda (item I with value v) ◮ If I = goal, then return v. ◮ If v > chart(I): ◮ chart(I) ← v ◮ Find all combinations of I with other items in the chart, generating new possible
74 / 87
75 / 87
SROOT NPS DTNP The NNNP luxury NNNP auto NNNP maker NPS JJNP last NNNP year VPS VBDVP sold NPVP CDNP 1,214 NNNP cars PPVP INPP in NPPP DTNP the NNPNP U.S.
76 / 87
77 / 87
Ssold NPmaker DTThe The NNluxury luxury NNauto auto NNmaker maker NPyear JJlast last NNyear year VPsold VBDsold sold NPcars CD1,214 1,214 NNcars cars PPin INin in NPU.S. DTthe the NNPU.S. U.S.
78 / 87
79 / 87
80 / 87
81 / 87
◮ K-best parsing: Huang and Chiang (2005) 82 / 87
◮ K-best parsing: Huang and Chiang (2005)
◮ These exploit dynamic programming algorithms for training (CKY for arbitrary
83 / 87
◮ K-best parsing: Huang and Chiang (2005)
◮ These exploit dynamic programming algorithms for training (CKY for arbitrary
84 / 87
◮ K-best parsing: Huang and Chiang (2005)
◮ These exploit dynamic programming algorithms for training (CKY for arbitrary
◮ Socher et al. (2013) define compositional vector grammars that associate each
◮ Dyer et al. (2016): recurrent neural network grammars, generative models like
85 / 87
86 / 87
87 / 87