Cross-lingual Semantic Parsing
|
|
- Hubert Reynard Wilcox
- 5 years ago
- Views:
Transcription
1 Cross-lingual Semantic Parsing Part I: 11 Dimensions of Semantic Parsing Kilian Evang University of Düsseldorf 1 / 94
2 Abbreviations NL natural language e.g., English, Bulgarian NLU natural language utterance e.g., a sentence, a question, a command MRL meaning representation language (a formal language) e.g., first-order logic, SQL MR meaning representation e.g., a first-order logical formula, an SQL query 2 / 94
3 What Is a Semantic Parser? A program that translates NLUs to MRs, which a computer can execute. Example (1) a. Give me the cities in Virginia. b. answer(a, (city(a), loc(a, B), const(b, stateid(virginia)))) 3 / 94
4 Semantic Parsing Why? Virtual assistants Wake me up at seven. Natural-language database interfaces List all 1990s French comedy movies. Machine reading Extract structured information from text 4 / 94
5 Canonicalization many ways to say the same thing in NL semantic parsers need to canonicalize Example (2) a. What s the population of Alabama? b. How many people live in Alabama? c. How many citizens in Alabama? d. answer(a, (population(b, A), const(b, stateid(alabama))) 5 / 94
6 Subproblems of Semantic Parsing 1. Predict the meaning of each word 2. Predict how to assemble word meanings into NLU meanings 6 / 94
7 Rule-based vs. Learning-based Methods Rule-based semantic parsing high precision, low recall requires expert effort for each new construction suitable for small domains, controlled NL Learning-based semantic parsing learns from examples important for scaling to large domains, variable NL focus of this course 7 / 94
8 Subproblems of Semantic Parser Learning 1. lexicon learning: which words mean what? 2. parser learning: how to assemble word meanings into sentence meanings? 8 / 94
9 11 Questions for Learning a Semantic Parser 1. What is the input? (NL) 2. What is the output? (MRL) 3. What kind of supervision is available? 4. How do we structure the lexicon? 5. What parsing algorithm do we use? 6. What features do we use? 7. What kind of model do we use? 8. What learning algorithm do we use? 9. How do we learn the lexicon? 10. What experimental setup do we use? 11. How do we evaluate the semantic parser? 9 / 94
10 Example Semantic Parser GeoPar simple semantic parser for illustration parses questions about United States geography into GeoQuery MRs inspired by Zelle and Mooney (1996) optional exercise: implement GeoPar starter code: solution for peeking: texttheater/geopar/tree/solution 10 / 94
11 What Is the Input? Some Possible Answers List of words (GeoPar) e.g., [ what, is, the, capital, of, the, state, with, the, largest, population,? ] List of words + part-of-speech tags List of words + word vectors 11 / 94
12 What Is the Output? depends on purpose Some Possible Answers MRs in a special-purpose MRL e.g., GeoQuery (GeoPar) MRs in a query language for databases/knowlege bases e.g., SQL, SPARQL, description logics MRs in a wide-coverage MRL e.g., DRT, AMR 12 / 94
13 GeoQuery Example (3) a. What is the capital of the state with the largest population? b. answer(c, (capital(c), loc(c, S), largest(p, (state(s), population(s, P))))) Zelle and Mooney (1996) 13 / 94
14 GeoQuery (cont.) supports queries about U.S. states, cities, rivers, etc. Prolog subset datasets Geo880: 880 NLU-MRL pairs, English, widely used as a benchmark in early work on learning-based semantic parsing (c ), ml/nldata/geoquery.html Geo250: subset with three additional NLs (Turkish, Spanish, Japanese), 14 / 94
15 GeoQuery Predicates Concepts capital( ) city( ) lake( ) major( ) mountain( ) place( ) state( ) river( ) Properties area(, ) density(, ) elevation(, ) high point(, ) len(, ) population(, ) size(, ) Relations capital(, ) loc(, ) next to(, ) traverse(, ) 15 / 94
16 GeoQuery Predicates (cont.) Constants const(, countryid(usa)) const(, stateid(mississippi)) const(, cityid( los angeles, ca)) const(, riverid(mississippi)) const(, placeid( mount whitney ))... Aggregation count(,, ) fewest(,, ) higher(, ) highest(, ) largest(, ) longer(, ) lowest(, ) most(,, ) shortest(, ) smallest(, ) sum(,, ) Negation \+ 16 / 94
17 Description Logics (DL) Example (4) a. What college did Obama go to? b. Type.University Education.BarackObama Berant et al. (2013) 17 / 94
18 Description Logics (cont.) DL expressions describe concepts Application-dependent set of concept symbols and relation symbols.: join a relation with a concept : intersection of concepts translated to SQL or SPARQL for querying databases such as Freebase datasets Free917 (917 NLU-MR pairs) WebQuestions (5810 NLU-answer pairs) 18 / 94
19 Discourse Representation Structures (DRS) Example (5) a. All equipment will be completely manufactured. b. x1 equipment.n.01(x1) e1 s1 manufacture.v.01(e1) Manner(e1, s1) Result(e1, x1) complete.r.01(s1) Bjerva et al. (2016) 19 / 94
20 Discourse Representation Structures (DRS) (cont.) Discourse Representation Theory (DRT) (Kamp, 1984) general-purpose meaning representation language uses discourse referents, event semantics, logical connectives WordNet sense inventory, VerbNet frame inventory datasets Groningen Meaning Bank ( English Parallel Meaning Bank ( English, Dutch, Italian, German 20 / 94
21 Example Abstract Meaning Representations (AMR) (6) a. All equipment will be completely manufactured. b. Bjerva et al. (2016) 21 / 94
22 Abstract Meaning Representations (AMR) (cont.) graph-based general-purpose meaning representation (Banarescu et al., 2013) somewhat limited expressive power compared to DRS (Bos, 2016) no word sense annotation, PropBank frame inventory datasets 22 / 94
23 What Kind of Supervision is Available? Some Possible Answers NLU-MR pairs (GeoPar) question-answer pairs + database text + database NLU-MR pairs in another language (cross-lingually supervised) 23 / 94
24 Supervised Learning from NLU-MR Pairs Example (7) a. What is the capital of the state with the largest population? b. answer(c, (capital(c), loc(c, S), largest(p, (state(s), population(s, P))))) Zelle and Mooney (1996) 24 / 94
25 Supervised Learning from NLU-MR Pairs (cont.) parser trained to produce gold-standard MRs requires expert annotation 25 / 94
26 Supervised Learning from Question-Answer Pairs + Database Liang et al. (2011) 26 / 94
27 Supervised Learning from Question-Answer Pairs + Database (cont.) parser trained to produce any MR, as long as executing it on DB gives gold-standard answer enables annotation by non-experts 27 / 94
28 Weakly Supervised Learning from Text + Database Reddy et al. (2014) 28 / 94
29 Weakly Supervised Learning from Text + Database (cont.) convert output of syntactic parser to ungrounded MR learn to map ungrounded MRs to grounded MRs (database subgraphs) so that facts found in Web text correspond to facts found in database 29 / 94
30 Cross-lingually Supervised Learning from NLU-MR Pairs in another Language Evang and Bos (2016) 30 / 94
31 Cross-lingually Supervised Learning from NLU-MR Pairs in another Language (cont.) have: semantic parser for language A want: semantic parser for language B use parallel data to project parses from A to B, train semantic parser on projected parses 31 / 94
32 How do We Structure the Lexicon? Some Possible Answers Lexicon = a mapping from (multi)words to predicates (GeoPar) Lexicon = a mapping from (multi)words to lambda expressions often with CCG categories (adding syntactic type and word order information) 32 / 94
33 The GeoPar Lexicon Format Example NLU-MR Pair (8) a. What states border Texas? b. answer(s, (state(s), next to(s, T), const(t, stateid(texas)))) Corresponding Lexicon Entries states state(, ) border next to(, ) Texas const(, stateid(texas)) 33 / 94
34 A λ-based Lexicon Format Example NLU-MR Pair (9) a. What states border Texas? b. λs.state(s) next to(s, texas) Corresponding Lexicon Entries What λf.λg.λx.(f (x) g(x)) states λx.state(x) border λx.λy.next to(y, x) Texas texas Zettlemoyer and Collins (2005) 34 / 94
35 A λ-based Lexicon Format with CCG Categories Example NLU-MR Pair (9) a. What states border Texas? b. λs.state(s) next to(s, texas) Corresponding Lexicon Entries What λf.λg.λx.(f (x) g(x)) states λx.state(x) border λx.λy.next to(y, x) Texas texas Zettlemoyer and Collins (2005) 34 / 94
36 A λ-based Lexicon Format with CCG Categories Example NLU-MR Pair (9) a. What states border Texas? b. λs.state(s) next to(s, texas) Corresponding Lexicon Entries What λf.λg.λx.(f (x) g(x)) states N : λx.state(x) border λx.λy.next to(y, x) Texas texas Zettlemoyer and Collins (2005) 34 / 94
37 A λ-based Lexicon Format with CCG Categories Example NLU-MR Pair (9) a. What states border Texas? b. λs.state(s) next to(s, texas) Corresponding Lexicon Entries What λf.λg.λx.(f (x) g(x)) states N : λx.state(x) border λx.λy.next to(y, x) Texas NP : texas Zettlemoyer and Collins (2005) 34 / 94
38 A λ-based Lexicon Format with CCG Categories Example NLU-MR Pair (9) a. What states border Texas? b. λs.state(s) next to(s, texas) Corresponding Lexicon Entries What λf.λg.λx.(f (x) g(x)) states N : λx.state(x) border (S \ NP)/ NP : λx.λy.next to(y, x) Texas NP : texas Zettlemoyer and Collins (2005) 34 / 94
39 A λ-based Lexicon Format with CCG Categories Example NLU-MR Pair (9) a. What states border Texas? b. λs.state(s) next to(s, texas) Corresponding Lexicon Entries What (S /(S \ NP))/ N : λf.λg.λx.(f (x) g(x)) states N : λx.state(x) border (S \ NP)/ NP : λx.λy.next to(y, x) Texas NP : texas Zettlemoyer and Collins (2005) 34 / 94
40 What Parsing Algorithm Do We Use? Some Possible Answers CYK variant Shift-reduce variant (GeoPar) 35 / 94
41 CYK Parsing for a long time the most popular algorithm for syntactic and semantic parsing each cell stands for one subspan of the input cells filled with all possible constituents/arcs/mrs over that span shorter spans first, longer spans later quadratic running time even with beam search 36 / 94
42 Shift-reduce Parsing a transition-based family of algorithms more popular for syntactic and semantic parsing recently processes input from left to right builds constituents/arcs/mrs from left to right advantage: linear running time (when greedy or using beam search) advantage: psychological plausbility 37 / 94
43 A Shift-reduce Algorithm for GeoQuery a parser state (aka parse item, configuration) consists of a stack and a queue in the initial state, the stack contains 1 term: answer(, ), and the queue contains the whole input NLU in a final state, the stack contains 1 term (the output MR) and the queue is empty actions (aka transitions) take the parser from one state (the predecessor) to the next state (its successor) 38 / 94
44 We Need Actions to... Example (10) a. What is the capital of the state with the largest population? b. answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 39 / 94
45 We Need Actions to... Example (10) a. What is the capital of the state with the largest population? b. answer(c, ( capital (S, C), largest(p, (state(s), population(s, P)))))...introduce predicate instances 39 / 94
46 We Need Actions to... Example (10) a. What is the capital of the state with the largest population? b. answer(c, (capital( S, C), largest(p, (state( S ), population(s, P)))))...introduce predicate instances...coreference variables 39 / 94
47 We Need Actions to... Example (10) a. What is the capital of the state with the largest population? b. answer(c, (capital(s, C), largest (P, (state(s), population (S, P)))))...introduce predicate instances...coreference variables...embed one predicate instance under another 39 / 94
48 We Need Actions to... Example (10) a. What is the capital of the state with the largest population? b. answer(c, (capital(s, C), largest(p, ( state (S), population (S, P)))))...introduce predicate instances...coreference variables...embed one predicate instance under another...conjoin two predicate instances 39 / 94
49 Notation q[0]: leftmost element of queue q[:n]: first n elements of queue s[0]: topmost element of stack s[1]: second-topmost element of stack Each stack element s[i] has a secondary stack s[i].sec which is initially empty but may later contain subterms of s[i]. When s[i].sec is empty, then s[i].sec[0] refers to s[i]. j marks the subterm found at s[i].sec[j] t.args: the arguments of the term t 40 / 94
50 Action Types shift-n-p: remove q[:n] from queue and append P to stack such that q[:n] P in lexicon skip: remove q[0] coref- i -j- k -l: unify the variables at s[1].sec[i].args[j - 1] and s[0].sec[k].args[l - 1] drop-i: move s[0] into s[1].sec[0].args[i - 1], push it onto s[1].sec precondition: s[0].sec is empty lift-i: move s[1] into s[0].sec[0].args[i - 1], push it onto s[0].sec precondition: s[1].sec is empty conj: move s[0] to form a conjunction with s[1].sec[0], push it onto s[1].sec pop: pop 1 element from s[0].sec idle: no-op for final items 41 / 94
51 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 42 / 94
52 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 42 / 94
53 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 42 / 94
54 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 42 / 94
55 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 42 / 94
56 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 42 / 94
57 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 42 / 94
58 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 42 / 94
59 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 42 / 94
60 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 42 / 94
61 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 42 / 94
62 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 42 / 94
63 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 42 / 94
64 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 42 / 94
65 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 42 / 94
66 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 42 / 94
67 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 42 / 94
68 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 42 / 94
69 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 42 / 94
70 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 42 / 94
71 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 42 / 94
72 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 42 / 94
73 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 42 / 94
74 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 42 / 94
75 Example Parse answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 24 skip answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 42 / 94
76 Parser States as Python Objects class ParserState: def init (self, stack, queue, pred, action): self.stack = stack self.queue = queue self.pred = pred # predecessor parser state self.action = action # action leading from pred # to self def shift(self, n, term): queue = self.queue for i in range(n): queue = queue.pop() stack = self.stack.push(term) return ParserState(stack, queue, self, ( shift, n, term.to_string())) def skip(self): return ParserState(self.stack, self.queue.pop(), self, ( skip,)) # / 94
77 What Features Do We Use? parser must be decide what is the next action for each state represent state as feature vectors to make this easier Some Possible Answers Discrete representations of parser states (do feature engineering; GeoPar) Continuous representations of parser states (use neural network) 44 / 94
78 Predicting Actions using Features action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 skip answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 45 / 94
79 Predicting Actions using Features action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 skip answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 45 / 94
80 Predicting Actions using Features action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 skip answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 45 / 94
81 Predicting Actions using Features action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 skip answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 45 / 94
82 Predicting Actions using Features action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 skip answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 46 / 94
83 Predicting Actions using Features action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 skip answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 46 / 94
84 Predicting Actions using Features action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 skip answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 46 / 94
85 Predicting Actions using Features action stack queue 0 answer(, ) what is the capital of the state with the largest population? 1 skip answer(, ) is the capital of the state with the largest population? 2 skip answer(, ) the capital of the state with the largest population? 3 skip answer(, ) capital of the state with the largest population? 4 shift-1-capital(, ) answer(, ) capital(, ) of the state with the largest population? 5 coref answer(c, ) capital(, C) of the state with the largest population? 6 drop-2 answer(c, 0 capital(, C)) of the state with the largest population? 7 skip answer(c, 0 capital(, C)) the state with the largest population? 8 skip answer(c, 0 capital(, C)) state with the largest population? 9 shift-1-state( ) answer(c, 0 capital(, C)) state( ) with the largest population? 10 coref answer(c, 0 capital(s, C)) state(s) with the largest population? 11 skip answer(c, 0 capital(s, C)) state(s) the largest population? 12 skip answer(c, 0 capital(s, C)) state(s) largest population? 13 shift-1-largest(, ) answer(c, 0 capital(s, C)) state(s) largest(, ) population? 14 lift-2 answer(c, 0 capital(s, C)) largest(, 0 state(s)) population? 15 shift-1-population(, ) answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(, )? 16 coref answer(c, 0 capital(s, C)) largest(, 0 state(s)) population(s, )? 17 coref answer(c, 0 capital(s, C)) largest(p, 0 state(s)) population(s, P)? 18 conj answer(c, 0 capital(s, C)) largest(p, 1 (state(s), 0 population(s, P)))? 19 pop answer(c, 0 capital(s, C)) largest(p, 0 (state(s), population(s, P)))? 20 pop answer(c, 0 capital(s, C)) largest(p, (state(s), population(s, P)))? 21 conj answer(c, 1 (capital(s, C), 0 largest(p, (state(s), population(s, P)))))? 22 pop answer(c, 0 (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 pop answer(c, (capital(s, C), largest(p, (state(s), population(s, P)))))? 23 skip answer(c, (capital(s, C), largest(p, (state(s), population(s, P))))) 46 / 94
86 Feature Extraction Code class ParserState: #... def local_features(self): def get_stack_terms(): for sp, ssp in ((0, 0), (0, 1), (1, 0), (1, 1), (1, 2)): try: yield self.stack[sp].sec[ssp] except IndexError: yield None (s00, s01, s10, s11, s12) = get_stack_terms() # / 94
87 Feature Extraction Code (cont.) class ParserState: #... def local_features(self): #... def get_words(): for i in (-4, -3, -2, -1, 0, 1, 2, 3): try: yield self.words[self.offset + i] except IndexError: yield None (W4, W3, W2, W1, w0, w1, w2, w3) = get_words() # / 94
88 Feature Extraction Code (cont.) class ParserState: #... def local_features(self): #... tf = {} # map from templates to features # feature group 1: stack predicates tf[ s00p ] = s00.pred if s00 is not None else None tf[ s01p ] = s00.pred if s01 is not None else None tf[ s10p ] = s10.pred if s10 is not None else None tf[ s11p ] = s11.pred if s10 is not None else None tf[ s12p ] = s12.pred if s12 is not None else None # / 94
89 Feature Extraction Code (cont.) class ParserState: #... def local_features(self): #... # feature group 2: combinations of stack predicates for s0ip in ( s00p, s01p ): for s1jp in ( s10p, s11p, s12p ): tf[(s0ip, s1jp)] = (tf[s0ip], tf[s1jp]) # / 94
90 Feature Extraction Code (cont.) class ParserState: #... def local_features(self): #... # feature group 3: unigrams tf[ W4 ] = W4 tf[ W3 ] = W3 tf[ W2 ] = W2 tf[ W1 ] = W1 tf[ w0 ] = w0 tf[ w1 ] = w1 tf[ w2 ] = w2 tf[ w3 ] = w3 # / 94
91 Feature Extraction Code (cont.) class ParserState: #... def local_features(self): #... # feature group 4: bigrams unigram_templates = ( W4, W3, W2, W1, w0, w1, w2, w3 ) for (wi, wj) in zip(unigram_templates, unigram_templates[1:]): tf[(wi, wj)] = (tf[wi], tf[wj]) # feature group 5: trigrams for (wi, wj, wj) in zip(unigram.templates, unigram_templates[1:], unigram.templates[2:]): tf[(wi, wj, wk)] = (tf[wi], tf[wj], tf[wk]) # / 94
92 Feature Extraction Code (cont.) class ParserState: #... def local_features(self): #... # Yield all template features as strings: for (template, value) in tf.items(): if isinstance(template, tuple): template =.join(template) if isinstance(value, tuple): value =.join(str(x) for x in value) yield template + = + value # Also yield a bias feature: yield bias 53 / 94
93 Feature Extraction Code (cont.) class ParserState: #... def features(self): if self._features is None: # memoize if self.pred is None: self._features = collections.counter() else: self._features = collections.counter( self.pred.features()) action =.join( str(x) for x in self.action) for f in self.pred.local_features(): f = f + : + action self._features[f] += 1 return self._features 54 / 94
94 Some Caveats in practice, use numpy arrays rather than collections.counter for efficiency use a vector compression method such as hash kernels (Bohnet, 2010) to limit vector size need more complex features for good performance, e.g., combinations of queue words and stack predicates stack predicate classes, e.g. aggregate vs. concept previous actions various combinations thereof 55 / 94
95 Example Features Features Usually Indicative of Good Parsing Decisions w0 = capital : shift 1 capital s10p W3 W2 W1 = answer what is the : coref Features Usually Indicative of Bad Parsing Decisions w0 = capital : skip W1 = the : skip 56 / 94
96 What Kind of Model Do We Use? Some Possible Answers Linear model (GeoPar) Log-linear model Neural network 57 / 94
97 Linear Model associates every feature with a real-valued weight positive weights for features indicative of good parsing decisions negative weights for features indicative of bad parsing decisions weights close to 0 for features not very indicative the score of a parser state is the sum of the counts of each of its features multiplied by its weight parser will choose actions that lead to parser states with higher scores 58 / 94
98 Model Code class LinearModel: def init (self): self.weights = collections.counter() def score(self, features): result = 0 for feature in features: result += self.weights[feature] return result 59 / 94
99 Parsing with Beam Search def parse(words, model, beam_size=10): agenda = [initial_state(words)] while any(not st.is_final() for st in agenda): agenda = [su for st in agenda for su in st.successors()] agenda.sort( key=lambda st: model.score(st.features()), reverse=true) beam = agenda[:min(beam_size, len(agenda))] agenda = beam if not agenda: raise ValueError( no parse found ) return agenda[0].stack[0] 60 / 94
100 What Learning Algorithm Do We Use? How do we set the weights? Need to train our model on the training data Some Possible Answers Perceptron (GeoPar) Some variant of stochastic gradient descent 61 / 94
101 Perceptron Update class LinearModel: #... def update(self, gold_features, predicted_features): update = collections.counter() for gf in gold_features: update[gf] += 1 for pf in predicted_features: update[pf] -= 1 for feature, delta in update.items(): if delta!= 0: self.weights[feature] += delta 62 / 94
102 Perceptron Training def train_one_epoch(train_data, model, beam_size=10): for words, gold_action_sequence in train_data: def is_correct(state): # a state is considered correct if the action sequence leading up # to it is a prefix of the complete gold action sequence, or vice # versa: return all(g == i for g, i in zip(gold_action_sequence, state.action_sequence())) agenda = [initial_state(words)] while any(not st.is_final() for st in agenda): agenda = [su for st in agenda for su in st.successors()] agenda.sort( key=lambda st: model.score(st.features()), reverse=true) beam = agenda[:min(beam_size, len(agenda))] if not any(is_correct(st) for st in beam): break # early update agenda = beam best = agenda[0] best_correct = next(st for st in agenda if is_correct(st)) if best!= best_correct: model.update(best_correct.features(), best.features()) 63 / 94
103 Perceptron Training for Multiple Epochs def train(train_data, num_epochs): train_data = list(train_data) model = LinearModel() for t in range(num_epochs): random.shuffle(train_data) train_one_epoch(train_data, model) return model 64 / 94
104 Some Caveats again, model.weights should be a numpy array in practice use averaged perceptron: keep track of weights after each update, average them at the end rather than fixing number of epochs, use validation data to stop training once further epochs do not improve accuracy 65 / 94
105 How Do We Learn the Lexicon? Some Possible Answers specify lexicon manually (GeoPar) use some combination of unsupervised word-predicate alignment extension-based lexicon induction lexical templates splitting via higher-order unification iterative lexicon refinement cross-lingual lexicon induction 66 / 94
106 Unsupervised Word-predicate Alignment What states border Texas answer(s, ( state(s), next to(s, T) const(t, stateid(texas))))
107 Unsupervised Word-predicate Alignment What states border Texas answer(s, ( state(s), next to(s, T) const(t, stateid(texas)))) 67 / 94
108 Unsupervised Word-predicate Alignment (cont.) widely used technique in machine translation use, e.g., GIZA++ or fast align alignments are uncertain possible solution: generate multiple lexical entries; let the learning algorithm figure out which ones are good/bad 68 / 94
109 Extension-based Lexicon Induction Berant et al. (2013) 69 / 94
110 Extension-based Lexicon Induction (cont.) use predicates in a DB, e.g., PlaceOfBirth the extension of a predicate is the set of pairs of entities it is true of, e.g., (BarackObama, Honolulu), (MichelleObama, Chicago) find phrases in raw text, e.g., lived in the extension of a phrase is the set of pairs of entities mentioned in the same sentence, e.g. (BarackObama, Honolulu), (BarackObama, Chicago) map entity mentions to entities based on string similarity heuristics learn to map phrases to predicates based on the similarity of their extensions 70 / 94
111 Lexical Templates Zettlemoyer and Collins (2005) 71 / 94
Introduction to Semantic Parsing with CCG
Introduction to Semantic Parsing with CCG Kilian Evang Heinrich-Heine-Universität Düsseldorf 2018-04-24 Table of contents 1 Introduction to CCG Categorial Grammar (CG) Combinatory Categorial Grammar (CCG)
More informationLearning Dependency-Based Compositional Semantics
Learning Dependency-Based Compositional Semantics Semantic Representations for Textual Inference Workshop Mar. 0, 0 Percy Liang Google/Stanford joint work with Michael Jordan and Dan Klein Motivating Problem:
More informationDriving Semantic Parsing from the World s Response
Driving Semantic Parsing from the World s Response James Clarke, Dan Goldwasser, Ming-Wei Chang, Dan Roth Cognitive Computation Group University of Illinois at Urbana-Champaign CoNLL 2010 Clarke, Goldwasser,
More informationA Probabilistic Forest-to-String Model for Language Generation from Typed Lambda Calculus Expressions
A Probabilistic Forest-to-String Model for Language Generation from Typed Lambda Calculus Expressions Wei Lu and Hwee Tou Ng National University of Singapore 1/26 The Task (Logical Form) λx 0.state(x 0
More informationNLU: Semantic parsing
NLU: Semantic parsing Adam Lopez slide credits: Chris Dyer, Nathan Schneider March 30, 2018 School of Informatics University of Edinburgh alopez@inf.ed.ac.uk Recall: meaning representations Sam likes Casey
More informationAppears in Proceedings of the Joint SIGDAT Conference on Empirical Methods in Natural Language Processing and Very Large Corpora (EMNLP/VLC-2000),
Appears in Proceedings of the Joint SIGDAT Conference on Empirical Methods in Natural Language Processing and Very Large Corpora (EMNLP/VLC-2000), pp.133-141, Hong Kong, October, 2000 Automated Construction
More informationOutline. Learning. Overview Details Example Lexicon learning Supervision signals
Outline Learning Overview Details Example Lexicon learning Supervision signals 0 Outline Learning Overview Details Example Lexicon learning Supervision signals 1 Supervision in syntactic parsing Input:
More informationLecture 5: Semantic Parsing, CCGs, and Structured Classification
Lecture 5: Semantic Parsing, CCGs, and Structured Classification Kyle Richardson kyle@ims.uni-stuttgart.de May 12, 2016 Lecture Plan paper: Zettlemoyer and Collins (2012) general topics: (P)CCGs, compositional
More informationQuestion Answering on Statistical Linked Data
Question Answering on Statistical Linked Data AKSW Colloquium paper presentation Konrad Höffner Universität Leipzig, AKSW/MOLE, PhD Student 2015-2-16 1 / 18 1 2 3 2 / 18 Motivation Statistical Linked Data
More informationTALP at GeoQuery 2007: Linguistic and Geographical Analysis for Query Parsing
TALP at GeoQuery 2007: Linguistic and Geographical Analysis for Query Parsing Daniel Ferrés and Horacio Rodríguez TALP Research Center Software Department Universitat Politècnica de Catalunya {dferres,horacio}@lsi.upc.edu
More informationBringing machine learning & compositional semantics together: central concepts
Bringing machine learning & compositional semantics together: central concepts https://githubcom/cgpotts/annualreview-complearning Chris Potts Stanford Linguistics CS 244U: Natural language understanding
More informationAN ABSTRACT OF THE DISSERTATION OF
AN ABSTRACT OF THE DISSERTATION OF Kai Zhao for the degree of Doctor of Philosophy in Computer Science presented on May 30, 2017. Title: Structured Learning with Latent Variables: Theory and Algorithms
More informationComputational Linguistics
Computational Linguistics Dependency-based Parsing Clayton Greenberg Stefan Thater FR 4.7 Allgemeine Linguistik (Computerlinguistik) Universität des Saarlandes Summer 2016 Acknowledgements These slides
More informationComputational Linguistics. Acknowledgements. Phrase-Structure Trees. Dependency-based Parsing
Computational Linguistics Dependency-based Parsing Dietrich Klakow & Stefan Thater FR 4.7 Allgemeine Linguistik (Computerlinguistik) Universität des Saarlandes Summer 2013 Acknowledgements These slides
More informationOutline. Parsing. Approximations Some tricks Learning agenda-based parsers
Outline Parsing CKY Approximations Some tricks Learning agenda-based parsers 0 Parsing We need to compute compute argmax d D(x) p θ (d x) Inference: Find best tree given model 1 Parsing We need to compute
More informationTransition-Based Parsing
Transition-Based Parsing Based on atutorial at COLING-ACL, Sydney 2006 with Joakim Nivre Sandra Kübler, Markus Dickinson Indiana University E-mail: skuebler,md7@indiana.edu Transition-Based Parsing 1(11)
More informationProposition Knowledge Graphs. Gabriel Stanovsky Omer Levy Ido Dagan Bar-Ilan University Israel
Proposition Knowledge Graphs Gabriel Stanovsky Omer Levy Ido Dagan Bar-Ilan University Israel 1 Problem End User 2 Case Study: Curiosity (Mars Rover) Curiosity is a fully equipped lab. Curiosity is a rover.
More informationOutline. Learning. Overview Details
Outline Learning Overview Details 0 Outline Learning Overview Details 1 Supervision in syntactic parsing Input: S NP VP NP NP V VP ESSLLI 2016 the known summer school is V PP located in Bolzano Output:
More informationPart of Speech Tagging: Viterbi, Forward, Backward, Forward- Backward, Baum-Welch. COMP-599 Oct 1, 2015
Part of Speech Tagging: Viterbi, Forward, Backward, Forward- Backward, Baum-Welch COMP-599 Oct 1, 2015 Announcements Research skills workshop today 3pm-4:30pm Schulich Library room 313 Start thinking about
More informationLanguage to Logical Form with Neural Attention
Language to Logical Form with Neural Attention Mirella Lapata and Li Dong Institute for Language, Cognition and Computation School of Informatics University of Edinburgh mlap@inf.ed.ac.uk 1 / 32 Semantic
More informationSemantic Parsing with Combinatory Categorial Grammars
Semantic Parsing with Combinatory Categorial Grammars Yoav Artzi, Nicholas FitzGerald and Luke Zettlemoyer University of Washington ACL 2013 Tutorial Sofia, Bulgaria Learning Data Learning Algorithm CCG
More informationParsing with Context-Free Grammars
Parsing with Context-Free Grammars Berlin Chen 2005 References: 1. Natural Language Understanding, chapter 3 (3.1~3.4, 3.6) 2. Speech and Language Processing, chapters 9, 10 NLP-Berlin Chen 1 Grammars
More informationMarrying Dynamic Programming with Recurrent Neural Networks
Marrying Dynamic Programming with Recurrent Neural Networks I eat sushi with tuna from Japan Liang Huang Oregon State University Structured Prediction Workshop, EMNLP 2017, Copenhagen, Denmark Marrying
More informationSpatial Role Labeling CS365 Course Project
Spatial Role Labeling CS365 Course Project Amit Kumar, akkumar@iitk.ac.in Chandra Sekhar, gchandra@iitk.ac.in Supervisor : Dr.Amitabha Mukerjee ABSTRACT In natural language processing one of the important
More informationIntroducing GIS analysis
1 Introducing GIS analysis GIS analysis lets you see patterns and relationships in your geographic data. The results of your analysis will give you insight into a place, help you focus your actions, or
More informationα-acyclic Joins Jef Wijsen May 4, 2017
α-acyclic Joins Jef Wijsen May 4, 2017 1 Motivation Joins in a Distributed Environment Assume the following relations. 1 M[NN, Field of Study, Year] stores data about students of UMONS. For example, (19950423158,
More informationUnanimous Prediction for 100% Precision with Application to Learning Semantic Mappings
Unanimous Prediction for 00% Precision with Application to Learning Semantic Mappings Fereshte Khani Stanford University fereshte@cs.stanford.edu Martin Rinard MIT rinard@lcs.mit.edu Percy Liang Stanford
More informationRecall that the expression x > 3 is not a proposition. Why?
Predicates and Quantifiers Predicates and Quantifiers 1 Recall that the expression x > 3 is not a proposition. Why? Notation: We will use the propositional function notation to denote the expression "
More informationCMSC 330: Organization of Programming Languages. Pushdown Automata Parsing
CMSC 330: Organization of Programming Languages Pushdown Automata Parsing Chomsky Hierarchy Categorization of various languages and grammars Each is strictly more restrictive than the previous First described
More informationThe exam is closed book, closed calculator, and closed notes except your one-page crib sheet.
CS 188 Fall 2015 Introduction to Artificial Intelligence Final You have approximately 2 hours and 50 minutes. The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.
More informationQuantification in the predicate calculus
Quantification in the predicate calculus PHIL 43916 eptember 5, 2012 1. The problem posed by quantified sentences... 1 2. yntax of PC... 2 3. Bound and free iables... 3 4. Models and assignments... 4 5.
More informationLecture Notes on Inductive Definitions
Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 August 28, 2003 These supplementary notes review the notion of an inductive definition and give
More informationNatural Language Processing. Slides from Andreas Vlachos, Chris Manning, Mihai Surdeanu
Natural Language Processing Slides from Andreas Vlachos, Chris Manning, Mihai Surdeanu Projects Project descriptions due today! Last class Sequence to sequence models Attention Pointer networks Today Weak
More informationSemantics and Generative Grammar. Formal Foundations: A Basic Review of Sets and Functions 1
Formal Foundations: A Basic Review of Sets and Functions 1 1. Naïve Set Theory 1.1 Basic Properties of Sets A set is a group of objects. Any group of objects a, b, c forms a set. (1) Representation of
More informationA Discriminative Model for Semantics-to-String Translation
A Discriminative Model for Semantics-to-String Translation Aleš Tamchyna 1 and Chris Quirk 2 and Michel Galley 2 1 Charles University in Prague 2 Microsoft Research July 30, 2015 Tamchyna, Quirk, Galley
More informationThe Importance of Being Formal. Martin Henz. February 5, Propositional Logic
The Importance of Being Formal Martin Henz February 5, 2014 Propositional Logic 1 Motivation In traditional logic, terms represent sets, and therefore, propositions are limited to stating facts on sets
More informationStatistical Machine Translation. Part III: Search Problem. Complexity issues. DP beam-search: with single and multi-stacks
Statistical Machine Translation Marcello Federico FBK-irst Trento, Italy Galileo Galilei PhD School - University of Pisa Pisa, 7-19 May 008 Part III: Search Problem 1 Complexity issues A search: with single
More informationPropositional Logic and Semantics
Propositional Logic and Semantics English is naturally ambiguous. For example, consider the following employee (non)recommendations and their ambiguity in the English language: I can assure you that no
More informationLearning Goals of CS245 Logic and Computation
Learning Goals of CS245 Logic and Computation Alice Gao April 27, 2018 Contents 1 Propositional Logic 2 2 Predicate Logic 4 3 Program Verification 6 4 Undecidability 7 1 1 Propositional Logic Introduction
More informationPropositional Logic: Part II - Syntax & Proofs 0-0
Propositional Logic: Part II - Syntax & Proofs 0-0 Outline Syntax of Propositional Formulas Motivating Proofs Syntactic Entailment and Proofs Proof Rules for Natural Deduction Axioms, theories and theorems
More informationReasoning About Imperative Programs. COS 441 Slides 10b
Reasoning About Imperative Programs COS 441 Slides 10b Last time Hoare Logic: { P } C { Q } Agenda If P is true in the initial state s. And C in state s evaluates to s. Then Q must be true in s. Program
More informationThe natural numbers. Definition. Let X be any inductive set. We define the set of natural numbers as N = C(X).
The natural numbers As mentioned earlier in the course, the natural numbers can be constructed using the axioms of set theory. In this note we want to discuss the necessary details of this construction.
More informationA proof theoretical account of polarity items and monotonic inference.
A proof theoretical account of polarity items and monotonic inference. Raffaella Bernardi UiL OTS, University of Utrecht e-mail: Raffaella.Bernardi@let.uu.nl Url: http://www.let.uu.nl/ Raffaella.Bernardi/personal
More informationTHE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.
CHAPTER 3 THE LOGIC OF QUANTIFIED STATEMENTS SECTION 3.1 Predicates and Quantified Statements I Copyright Cengage Learning. All rights reserved. Copyright Cengage Learning. All rights reserved. Predicates
More informationIntroduction to Semantics. Common Nouns and Adjectives in Predicate Position 1
Common Nouns and Adjectives in Predicate Position 1 (1) The Lexicon of Our System at Present a. Proper Names: [[ Barack ]] = Barack b. Intransitive Verbs: [[ smokes ]] = [ λx : x D e. IF x smokes THEN
More informationa. ~p : if p is T, then ~p is F, and vice versa
Lecture 10: Propositional Logic II Philosophy 130 3 & 8 November 2016 O Rourke & Gibson I. Administrative A. Group papers back to you on November 3. B. Questions? II. The Meaning of the Conditional III.
More informationDecember 3, Dipartimento di Informatica, Università di Torino. Felicittà. Visualizing and Estimating Happiness in
: : Dipartimento di Informatica, Università di Torino December 3, 2013 : Outline : from social media Social media users generated contents represent the human behavior in everyday life, but... how to analyze
More informationAutomata Theory and Formal Grammars: Lecture 1
Automata Theory and Formal Grammars: Lecture 1 Sets, Languages, Logic Automata Theory and Formal Grammars: Lecture 1 p.1/72 Sets, Languages, Logic Today Course Overview Administrivia Sets Theory (Review?)
More informationTHE LOGIC OF COMPOUND STATEMENTS
CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS Copyright Cengage Learning. All rights reserved. SECTION 2.1 Logical Form and Logical Equivalence Copyright Cengage Learning. All rights reserved. Logical Form
More informationChapter 1. Formal Definition and View. Lecture Formal Pushdown Automata on the 28th April 2009
Chapter 1 Formal and View Lecture on the 28th April 2009 Formal of PA Faculty of Information Technology Brno University of Technology 1.1 Aim of the Lecture 1 Define pushdown automaton in a formal way
More informationMarkov Networks. l Like Bayes Nets. l Graphical model that describes joint probability distribution using tables (AKA potentials)
Markov Networks l Like Bayes Nets l Graphical model that describes joint probability distribution using tables (AKA potentials) l Nodes are random variables l Labels are outcomes over the variables Markov
More informationTute 10. Liam O'Connor. May 23, 2017
Tute 10 Liam O'Connor May 23, 2017 proc Search(value g : G, value s : V g, value k : K, result v : T, result f : B) Where a graph g : G is dened as a 4-tuple (V, Γ, κ, λ) containing a set of vertices V,
More informationLECTURER: BURCU CAN Spring
LECTURER: BURCU CAN 2017-2018 Spring Regular Language Hidden Markov Model (HMM) Context Free Language Context Sensitive Language Probabilistic Context Free Grammar (PCFG) Unrestricted Language PCFGs can
More informationParsing Algorithms. CS 4447/CS Stephen Watt University of Western Ontario
Parsing Algorithms CS 4447/CS 9545 -- Stephen Watt University of Western Ontario The Big Picture Develop parsers based on grammars Figure out properties of the grammars Make tables that drive parsing engines
More informationCS460/626 : Natural Language Processing/Speech, NLP and the Web
CS460/626 : Natural Language Processing/Speech, NLP and the Web Lecture 23: Binding Theory Pushpak Bhattacharyya CSE Dept., IIT Bombay 8 th Oct, 2012 Parsing Problem Semantics Part of Speech Tagging NLP
More information3 Propositional Logic
3 Propositional Logic 3.1 Syntax 3.2 Semantics 3.3 Equivalence and Normal Forms 3.4 Proof Procedures 3.5 Properties Propositional Logic (25th October 2007) 1 3.1 Syntax Definition 3.0 An alphabet Σ consists
More informationPropositional Logic: Methods of Proof (Part II)
Propositional Logic: Methods of Proof (Part II) You will be expected to know Basic definitions Inference, derive, sound, complete Conjunctive Normal Form (CNF) Convert a Boolean formula to CNF Do a short
More information1 First-order logic. 1 Syntax of first-order logic. 2 Semantics of first-order logic. 3 First-order logic queries. 2 First-order query evaluation
Knowledge Bases and Databases Part 1: First-Order Queries Diego Calvanese Faculty of Computer Science Master of Science in Computer Science A.Y. 2007/2008 Overview of Part 1: First-order queries 1 First-order
More informationCompiling Techniques
Lecture 11: Introduction to 13 November 2015 Table of contents 1 Introduction Overview The Backend The Big Picture 2 Code Shape Overview Introduction Overview The Backend The Big Picture Source code FrontEnd
More informationINTRODUCTION TO LOGIC. Propositional Logic. Examples of syntactic claims
Introduction INTRODUCTION TO LOGIC 2 Syntax and Semantics of Propositional Logic Volker Halbach In what follows I look at some formal languages that are much simpler than English and define validity of
More informationArtificial Intelligence Chapter 7: Logical Agents
Artificial Intelligence Chapter 7: Logical Agents Michael Scherger Department of Computer Science Kent State University February 20, 2006 AI: Chapter 7: Logical Agents 1 Contents Knowledge Based Agents
More informationHYPERGRAPH BASED SEMI-SUPERVISED LEARNING ALGORITHMS APPLIED TO SPEECH RECOGNITION PROBLEM: A NOVEL APPROACH
HYPERGRAPH BASED SEMI-SUPERVISED LEARNING ALGORITHMS APPLIED TO SPEECH RECOGNITION PROBLEM: A NOVEL APPROACH Hoang Trang 1, Tran Hoang Loc 1 1 Ho Chi Minh City University of Technology-VNU HCM, Ho Chi
More informationn Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B
Discrete Math Review Discrete Math Review (Rosen, Chapter 1.1 1.7, 5.5) TOPICS Sets and Functions Propositional and Predicate Logic Logical Operators and Truth Tables Logical Equivalences and Inference
More informationTopics in Lexical-Functional Grammar. Ronald M. Kaplan and Mary Dalrymple. Xerox PARC. August 1995
Projections and Semantic Interpretation Topics in Lexical-Functional Grammar Ronald M. Kaplan and Mary Dalrymple Xerox PARC August 199 Kaplan and Dalrymple, ESSLLI 9, Barcelona 1 Constituent structure
More informationCMSC 451: Lecture 7 Greedy Algorithms for Scheduling Tuesday, Sep 19, 2017
CMSC CMSC : Lecture Greedy Algorithms for Scheduling Tuesday, Sep 9, 0 Reading: Sects.. and. of KT. (Not covered in DPV.) Interval Scheduling: We continue our discussion of greedy algorithms with a number
More informationLecture Notes on Inductive Definitions
Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 September 2, 2004 These supplementary notes review the notion of an inductive definition and
More informationCS481F01 Solutions 6 PDAS
CS481F01 Solutions 6 PDAS A. Demers 2 November 2001 1. Give a NPDAs that recognize the following languages: (a) The set of all strings in {0, 1} that contain twice as many 1s as 0s. (answer a) We build
More informationIntelligent Systems (AI-2)
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 19 Oct, 24, 2016 Slide Sources Raymond J. Mooney University of Texas at Austin D. Koller, Stanford CS - Probabilistic Graphical Models D. Page,
More informationAutomata Theory for Presburger Arithmetic Logic
Automata Theory for Presburger Arithmetic Logic References from Introduction to Automata Theory, Languages & Computation and Constraints in Computational Logic Theory & Application Presented by Masood
More informationProbabilistic Context Free Grammars. Many slides from Michael Collins
Probabilistic Context Free Grammars Many slides from Michael Collins Overview I Probabilistic Context-Free Grammars (PCFGs) I The CKY Algorithm for parsing with PCFGs A Probabilistic Context-Free Grammar
More informationWord Embeddings in Feedforward Networks; Tagging and Dependency Parsing using Feedforward Networks. Michael Collins, Columbia University
Word Embeddings in Feedforward Networks; Tagging and Dependency Parsing using Feedforward Networks Michael Collins, Columbia University Overview Introduction Multi-layer feedforward networks Representing
More informationIncomplete Information in RDF
Incomplete Information in RDF Charalampos Nikolaou and Manolis Koubarakis charnik@di.uoa.gr koubarak@di.uoa.gr Department of Informatics and Telecommunications National and Kapodistrian University of Athens
More informationBeyond points: How to turn SMW into a complete Geographic Information System
Beyond points: How to turn SMW into a complete Geographic Information System SMWCon 2013, New-York Pierre Racine Contributor to PostGIS Research Professional Center for Forest Research Québec, Canada Objectives
More informationSection 3.1 Statements, Negations, and Quantified Statements
Section 3.1 Statements, Negations, and Quantified Statements Objectives 1. Identify English sentences that are statements. 2. Express statements using symbols. 3. Form the negation of a statement 4. Express
More informationDeclarative Programming Techniques
Declarative Programming Techniques Accumulators and Difference Lists (CTM 3.4.3-3.4.4) Carlos Varela RPI Adapted with permission from: Seif Haridi KTH Peter Van Roy UCL February 12, 2015 C. Varela; Adapted
More informationPrice: $25 (incl. T-Shirt, morning tea and lunch) Visit:
Three days of interesting talks & workshops from industry experts across Australia Explore new computing topics Network with students & employers in Brisbane Price: $25 (incl. T-Shirt, morning tea and
More informationINF3170 Logikk Spring Homework #8 For Friday, March 18
INF3170 Logikk Spring 2011 Homework #8 For Friday, March 18 Problems 2 6 have to do with a more explicit proof of the restricted version of the completeness theorem: if = ϕ, then ϕ. Note that, other than
More informationParts 3-6 are EXAMPLES for cse634
1 Parts 3-6 are EXAMPLES for cse634 FINAL TEST CSE 352 ARTIFICIAL INTELLIGENCE Fall 2008 There are 6 pages in this exam. Please make sure you have all of them INTRODUCTION Philosophical AI Questions Q1.
More informationIntroduction to first-order logic:
Introduction to first-order logic: First-order structures and languages. Terms and formulae in first-order logic. Interpretations, truth, validity, and satisfaction. Valentin Goranko DTU Informatics September
More information173 Logic and Prolog 2013 With Answers and FFQ
173 Logic and Prolog 2013 With Answers and FFQ Please write your name on the bluebook. You may have two sides of handwritten notes. There are 75 points (minutes) total. Stay cool and please write neatly.
More informationCS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010
CS311 Computational Structures NP-completeness Lecture 18 Andrew P. Black Andrew Tolmach 1 Some complexity classes P = Decidable in polynomial time on deterministic TM ( tractable ) NP = Decidable in polynomial
More informationAbstract parsing: static analysis of dynamically generated string output using LR-parsing technology
Abstract parsing: static analysis of dynamically generated string output using LR-parsing technology Kyung-Goo Doh 1, Hyunha Kim 1, David A. Schmidt 2 1. Hanyang University, Ansan, South Korea 2. Kansas
More informationFirst-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms
First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO
More informationSoftware Testing Lecture 7 Property Based Testing. Justin Pearson
Software Testing Lecture 7 Property Based Testing Justin Pearson 2017 1 / 13 When are there enough unit tests? Lets look at a really simple example. import u n i t t e s t def add ( x, y ) : return x+y
More informationDatabase Theory VU , SS Complexity of Query Evaluation. Reinhard Pichler
Database Theory Database Theory VU 181.140, SS 2018 5. Complexity of Query Evaluation Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 17 April, 2018 Pichler
More information7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and
7 RC Simulates RA. We now show that DRC (and hence TRC) is at least as expressive as RA. That is, given an RA expression E that mentions at most C, there is an equivalent DRC expression E that mentions
More informationPushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen
Pushdown automata Twan van Laarhoven Institute for Computing and Information Sciences Intelligent Systems Version: fall 2014 T. van Laarhoven Version: fall 2014 Formal Languages, Grammars and Automata
More informationCS:4420 Artificial Intelligence
CS:4420 Artificial Intelligence Spring 2018 Propositional Logic Cesare Tinelli The University of Iowa Copyright 2004 18, Cesare Tinelli and Stuart Russell a a These notes were originally developed by Stuart
More informationPenn Treebank Parsing. Advanced Topics in Language Processing Stephen Clark
Penn Treebank Parsing Advanced Topics in Language Processing Stephen Clark 1 The Penn Treebank 40,000 sentences of WSJ newspaper text annotated with phrasestructure trees The trees contain some predicate-argument
More informationFoundations of Informatics: a Bridging Course
Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html
More informationPolynomial-time Computation via Local Inference Relations
Polynomial-time Computation via Local Inference Relations ROBERT GIVAN Purdue University and DAVID MCALLESTER AT&T Labs Research We consider the concept of a local set of inference rules. A local rule
More informationLogic (3A) Young W. Lim 10/29/13
Copyright (c) 2013. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software
More informationMapOSMatic, free city maps for everyone!
MapOSMatic, free city maps for everyone! Thomas Petazzoni thomas.petazzoni@enix.org Libre Software Meeting 2012 http://www.maposmatic.org Thomas Petazzoni () MapOSMatic: free city maps for everyone! July
More informationSolving Equations by Adding and Subtracting
SECTION 2.1 Solving Equations by Adding and Subtracting 2.1 OBJECTIVES 1. Determine whether a given number is a solution for an equation 2. Use the addition property to solve equations 3. Determine whether
More informationCompiler Design Spring 2017
Compiler Design Spring 2017 3.4 Bottom-up parsing Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation 1 Bottom up parsing Goal: Obtain rightmost derivation in reverse w S Reduce
More informationCA Compiler Construction
CA4003 - Compiler Construction Bottom Up Parsing David Sinclair Bottom Up Parsing LL(1) parsers have enjoyed a bit of a revival thanks to JavaCC. LL(k) parsers must predict which production rule to use
More informationThe statement calculus and logic
Chapter 2 Contrariwise, continued Tweedledee, if it was so, it might be; and if it were so, it would be; but as it isn t, it ain t. That s logic. Lewis Carroll You will have encountered several languages
More informationMath 1 Variable Manipulation Part 5 Absolute Value & Inequalities
Math 1 Variable Manipulation Part 5 Absolute Value & Inequalities 1 ABSOLUTE VALUE REVIEW Absolute value is a measure of distance; how far a number is from zero: 6 is 6 away from zero, and " 6" is also
More informationCSE 1400 Applied Discrete Mathematics Definitions
CSE 1400 Applied Discrete Mathematics Definitions Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Arithmetic 1 Alphabets, Strings, Languages, & Words 2 Number Systems 3 Machine
More informationLong-Short Term Memory and Other Gated RNNs
Long-Short Term Memory and Other Gated RNNs Sargur Srihari srihari@buffalo.edu This is part of lecture slides on Deep Learning: http://www.cedar.buffalo.edu/~srihari/cse676 1 Topics in Sequence Modeling
More information