Transition-based dependency parsing

Size: px
Start display at page:

Download "Transition-based dependency parsing"

Transcription

1 Transition-based dependency parsing Daniël de Kok

2 Overview Dependency graphs and treebanks. Transition-based dependency parsing. Making parse choices using perceptrons.

3 Today Recap Transition systems Parsing algorithm

4 The book The slides on transition-based dependency parsing are based on Chapters 2 and 3 of Dependency Parsing by Sandra Kübler, Ryan McDonald, and Joakim Nivre This book is highly recommended if you want to learn about statistical dependency parsing.

5 Recap

6 Introduction Binary grammatical relations between tokens. Directed: one token is the head the other the dependent. Each word has a relation to another word.

7 Example Behinderte Menschen veranstalteten einen Protesttag in Bremen. Disabled people organized a protest-day in Bremen.

8 Example ROOT Behinderte Menschen veranstalteten einen Protesttag in Bremen. Disabled people organized a protest-day in Bremen.

9 Example ROOT SUBJ Behinderte Menschen veranstalteten einen Protesttag in Bremen. Disabled people organized a protest-day in Bremen.

10 Example ROOT ATTR SUBJ Behinderte Menschen veranstalteten einen Protesttag in Bremen. Disabled people organized a protest-day in Bremen.

11 Example ROOT OBJA ATTR SUBJ Behinderte Menschen veranstalteten einen Protesttag in Bremen. Disabled people organized a protest-day in Bremen.

12 Example ROOT OBJA ATTR SUBJ DET Behinderte Menschen veranstalteten einen Protesttag in Bremen. Disabled people organized a protest-day in Bremen.

13 Example ROOT PP OBJA ATTR SUBJ DET Behinderte Menschen veranstalteten einen Protesttag in Bremen. Disabled people organized a protest-day in Bremen.

14 Example ROOT PP OBJA ATTR SUBJ DET PN Behinderte Menschen veranstalteten einen Protesttag in Bremen. Disabled people organized a protest-day in Bremen.

15 Dependency graphs Following Kübler, et al., 2008: A sentence is a sequence of tokens: S = w 0 w 1... w n, wherein w 0 is an artificial root token. Let R = r 1... r m be the set of all possible dependency relation types. A dependency graph G =< V, A > is a labeled directed graph such that the following holds: V {S} A V R V if (w i, r, w j ) A then r r [(w i, r, w j ) A]

16 Dependency trees Dependency tree: A well-formed dependency-graph G =< V, A > for an input sentence S and a dependency relation set R is any dependency graph that is a directed tree originating out of w 0 and has the spanning node set V = V S. Properties: Root property: the root is not a dependent Spanning tree property Connectedness property: Every two words are connected via the reflexive transitive closure. Single-head property Acyclicity property Arc size property: A = V 1

17 Projectivity A dependency graph is non-projective if there are crossing edges. Common in languages with richer morphology and permit freer word orders: Czech Dutch German Why does this matter? Asuming projectivity allows for parsing algorithms that are computationally and conceptually simpler.

18 Example PP AUX ROOT ADV PN DET SUBJ DET OBJA Für diese Behauptung hat Beckmeyer bisher keinen Nachweis geliefert For this allegation has Beckmeyer until-now no proof given

19 Pseudo-projective parsing 1. Make trees projective 2. Train a projective parser on projective trees 3. Parse a new sentence 4. Convert the parsing result to a non-projective tree

20 Example OBJA:PP AUX ROOT ADV PN DET SUBJ DET OBJA Für diese Behauptung hat Beckmeyer bisher keinen Nachweis geliefert For this allegation has Beckmeyer until-now no proof given

21 Parsing techniques Grammar-based parsing: Context-Free Dependency Grammar Constraint Dependency Grammar Statistical dependency-parsing: Transition-based parsing Graph-based parsing

22 Transition systems

23 Introduction Transition system: Abstract machine Consisting of: Configurations (states) Transitions Initial state One or more accepting/final states Example: finite state automaton

24 Introduction (2) Transition-based dependency parsing also uses a transition system. However, in contrast to finite state automata: States have internal structure. Transitions correspond dependency tree derivation steps. We create states on-demand.

25 Configurations A configuration for a sentence S = w 0 w 1... w n is a triple c =< σ, β, A >, where: σ is a stack of words, w i σ : w i V S β is a buffer of words, w i β : w i V S A is a set of dependency arcs (w i, r, w j ) V S R V S

26 Configurations (2) A configuration represents a (partially) parsed sentence: σ: partially processed words β: unprocessed words 1 A: partially-built dependency tree 1 In some transition systems, the head of the buffer is partially processed.

27 Example σ = [ROOT, muß] β = [AWO-Konten, prüfen] A = {(muß, SUBJ, Staatsanwalt)}

28 Initial/final configuration For a sentence S: The initial configuration, c 0 (S), is ([w 0 ], [w 1... w n ], ) A final configuration has the form (σ, [], A)

29 Transitions Our states are now complex configurations as defined before. A transition can be seen as: A partial function from one state to another (like in finite state automata) A parsing action that e.g. adds an arc to the dependency tree. In the basic system for dependency parsing, three types of transitions are defined: Left-Arc r, Right-Arc r, and Shift.

30 Notation σ w i : the stack which results from pushing w i on the stack σ. w i β: a buffer with w i as the head and β as the tail.

31 Shift (σ, w i β, A) (σ w i, β, A) Remove the next word from the buffer, push it on the top of the stack. Precondition: buffer is non-empty

32 Shift (Example) Operation σ β A [ROOT] [Staatsanwalt,...] SH [ROOT, Staatsanwalt] [muß, ]

33 Left-Arc r (σ w i, w j β, A) (σ, w j β, A (w j, r, w i )) Add a dependency arc (w j, r, w i ) to the arc set. w i is the word on top of the stack. w j the next word in the buffer. w i is popped from the stack. Preconditions: 1. Stack and buffer are not empty. 2. i 0

34 Left-Arc r (example) (σ w i, w j β, A) (σ, w j β, A (w j, r, w i )) Operation σ β A [ROOT, Staatsanwalt] [muß, ] A LA SUBJ [ROOT] [muß, ] A = A (muß, SUBJ, Staatsanwalt)

35 Right-Arc r (σ w i, w j β, A) (σ, w i β, A (w i, r, w j )) Add a dependency arc (w i, r, w j ) to the arc set. w i is on top of the stack. w j is the next word in the buffer. w i is popped from the stack and replaces w j as the head of the buffer. Precondition: stack and buffer are not empty.

36 Right-Arc r (Example) (σ w i, w j β, A) (σ, w i β, A (w i, r, w j )) Operation σ β A [ROOT, muß] [prüfen] A RA AUX [ROOT] [muß] A = A (muß, AUX, prüfen)

37 Right-Arc r (Example) (σ w i, w j β, A) (σ, w i β, A (w i, r, w j )) Operation σ β A [ROOT, muß] [prüfen] A RA AUX [ROOT] [muß] A = A (muß, AUX, prüfen) Question: why is the head put on the buffer?

38 Transition sequence A transition sequence for a sentence S is a sequence of configurations, C 0,m = (c 0, c 1,..., c m ) such that 1. c 0 is the initial configuration c 0 (S) for S 2. c m is a terminal configuration, 3. for every i in 1... m, there is a transition t in the transition system such that c i = t(c i 1 ). The final dependency tree is G cm =< V S, A cm >

39 Example (Dependency tree) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check

40 Example (Transition sequence) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check Operation σ β A [ROOT] [Staatsanwalt,...]

41 Example (Transition sequence) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check Operation σ β A [ROOT] [Staatsanwalt,...] SH [ROOT, Staatsanwalt] [muß, ]

42 Example (Transition sequence) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check Operation σ β A [ROOT] [Staatsanwalt,...] SH [ROOT, Staatsanwalt] [muß, ] LA SUBJ [ROOT] [muß, ] A 1 = {(muß, SUBJ, Staatsanwalt)}

43 Example (Transition sequence) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check Operation σ β A [ROOT] [Staatsanwalt,...] SH [ROOT, Staatsanwalt] [muß, ] LA SUBJ [ROOT] [muß, ] A 1 = {(muß, SUBJ, Staatsanwalt)} SH [ROOT, muß] [AWO-Konten, ] A 1

44 Example (Transition sequence) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check Operation σ β A [ROOT] [Staatsanwalt,...] SH [ROOT, Staatsanwalt] [muß, ] LA SUBJ [ROOT] [muß, ] A 1 = {(muß, SUBJ, Staatsanwalt)} SH [ROOT, muß] [AWO-Konten, ] A 1 SH [ROOT, muß, AWO-Konten] [prüfen] A 1

45 Example (Transition sequence) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check Operation σ β A [ROOT] [Staatsanwalt,...] SH [ROOT, Staatsanwalt] [muß, ] LA SUBJ [ROOT] [muß, ] A 1 = {(muß, SUBJ, Staatsanwalt)} SH [ROOT, muß] [AWO-Konten, ] A 1 SH [ROOT, muß, AWO-Konten] [prüfen] A 1 LA OBJA [ROOT, muß] [prüfen] A 2 = A 1 {(prüfen, OBJA, AWO-Konten)}

46 Example (Transition sequence) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check Operation σ β A [ROOT] [Staatsanwalt,...] SH [ROOT, Staatsanwalt] [muß, ] LA SUBJ [ROOT] [muß, ] A 1 = {(muß, SUBJ, Staatsanwalt)} SH [ROOT, muß] [AWO-Konten, ] A 1 SH [ROOT, muß, AWO-Konten] [prüfen] A 1 LA OBJA [ROOT, muß] [prüfen] A 2 = A 1 {(prüfen, OBJA, AWO-Konten)} RA AUX [ROOT] [muß] A 3 = A 2 {(muß, AUX, prüfen)}

47 Example (Transition sequence) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check Operation σ β A [ROOT] [Staatsanwalt,...] SH [ROOT, Staatsanwalt] [muß, ] LA SUBJ [ROOT] [muß, ] A 1 = {(muß, SUBJ, Staatsanwalt)} SH [ROOT, muß] [AWO-Konten, ] A 1 SH [ROOT, muß, AWO-Konten] [prüfen] A 1 LA OBJA [ROOT, muß] [prüfen] A 2 = A 1 {(prüfen, OBJA, AWO-Konten)} RA AUX [ROOT] [muß] A 3 = A 2 {(muß, AUX, prüfen)} RA ROOT [] [ROOT] A 4 = A 3 {(ROOT, ROOT, muß)}

48 Example (Transition sequence) ROOT SUBJ AUX OBJA ROOT Staatsanwalt muß AWO-konten prüfen ROOT DA has-to AWO-accounts check Operation σ β A [ROOT] [Staatsanwalt,...] SH [ROOT, Staatsanwalt] [muß, ] LA SUBJ [ROOT] [muß, ] A 1 = {(muß, SUBJ, Staatsanwalt)} SH [ROOT, muß] [AWO-Konten, ] A 1 SH [ROOT, muß, AWO-Konten] [prüfen] A 1 LA OBJA [ROOT, muß] [prüfen] A 2 = A 1 {(prüfen, OBJA, AWO-Konten)} RA AUX [ROOT] [muß] A 3 = A 2 {(muß, AUX, prüfen)} RA ROOT [] [ROOT] A 4 = A 3 {(ROOT, ROOT, muß)} SH [ROOT] [] A 4

49 Properties of resulting graphs A graph produced using in a transition sequence using this transition system has the following properties: Single-headedness: since Left-Arc r and Right-Arc r remove the dependent token from the stack/buffer, this token cannot be attached as a dependant of another token. Root: the special ROOT token is never a dependeny of another token, Left-Arc r is not allowed when ROOT is on top of the stack. It is not possible to have ROOT as the next element on the buffer, while having a non-empty stack.

50 Properties of resulting graphs (2) Spanning: the dependency graph contains each token of the input sentence. The graph does not necessarily have the connectedness property: e.g. consider a transition sequence consisting of Shifts only. The resulting graphs/trees are projective.

51 In-class assignment Proof (informally) that the arc-standard system cannot introduce non-projective relations.

52 Try it yourself! OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Reminder: Shift: (σ, w i β, A) (σ w i, β, A) Left-Arc r : (σ w i, w j β, A) (σ, w j β, A (w j, r, w i )) Right-Arc r : (σ w i, w j β, A) (σ, w i β, A (w i, r, w j ))

53 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...]

54 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...]

55 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...]

56 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...] LA DET [ROOT, Veruntreute] [AWO,...] A 1 = {(AWO, DET, die)}

57 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...] LA DET [ROOT, Veruntreute] [AWO,...] A 1 = {(AWO, DET, die)} RA SUBJ [ROOT] [Veruntreute,...] A 2 = A 1 {(Veruntreute, SUBJ, AWO)}

58 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...] LA DET [ROOT, Veruntreute] [AWO,...] A 1 = {(AWO, DET, die)} RA SUBJ [ROOT] [Veruntreute,...] A 2 = A 1 {(Veruntreute, SUBJ, AWO)} SH [ROOT, Veruntreute] [Spendengeld,?] A 2

59 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...] LA DET [ROOT, Veruntreute] [AWO,...] A 1 = {(AWO, DET, die)} RA SUBJ [ROOT] [Veruntreute,...] A 2 = A 1 {(Veruntreute, SUBJ, AWO)} SH [ROOT, Veruntreute] [Spendengeld,?] A 2 SH [..., Spendengeld] [?] A 2

60 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...] LA DET [ROOT, Veruntreute] [AWO,...] A 1 = {(AWO, DET, die)} RA SUBJ [ROOT] [Veruntreute,...] A 2 = A 1 {(Veruntreute, SUBJ, AWO)} SH [ROOT, Veruntreute] [Spendengeld,?] A 2 SH [..., Spendengeld] [?] A 2 RA PUNCT [ROOT, Veruntreute] [Spendengeld] A 3 = A 2 {(Spendengeld, PUNCT,?)}

61 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...] LA DET [ROOT, Veruntreute] [AWO,...] A 1 = {(AWO, DET, die)} RA SUBJ [ROOT] [Veruntreute,...] A 2 = A 1 {(Veruntreute, SUBJ, AWO)} SH [ROOT, Veruntreute] [Spendengeld,?] A 2 SH [..., Spendengeld] [?] A 2 RA PUNCT [ROOT, Veruntreute] [Spendengeld] A 3 = A 2 {(Spendengeld, PUNCT,?)} RA OBJA [ROOT] [Veruntreute] A 4 = A 3 {(Veruntreute, OBJA, Spendengeld)}

62 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...] LA DET [ROOT, Veruntreute] [AWO,...] A 1 = {(AWO, DET, die)} RA SUBJ [ROOT] [Veruntreute,...] A 2 = A 1 {(Veruntreute, SUBJ, AWO)} SH [ROOT, Veruntreute] [Spendengeld,?] A 2 SH [..., Spendengeld] [?] A 2 RA PUNCT [ROOT, Veruntreute] [Spendengeld] A 3 = A 2 {(Spendengeld, PUNCT,?)} RA OBJA [ROOT] [Veruntreute] A 4 = A 3 {(Veruntreute, OBJA, Spendengeld)} RA ROOT [] [ROOT] A 5 = A 4 {(ROOT, ROOT, Veruntreute)}

63 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...] LA DET [ROOT, Veruntreute] [AWO,...] A 1 = {(AWO, DET, die)} RA SUBJ [ROOT] [Veruntreute,...] A 2 = A 1 {(Veruntreute, SUBJ, AWO)} SH [ROOT, Veruntreute] [Spendengeld,?] A 2 SH [..., Spendengeld] [?] A 2 RA PUNCT [ROOT, Veruntreute] [Spendengeld] A 3 = A 2 {(Spendengeld, PUNCT,?)} RA OBJA [ROOT] [Veruntreute] A 4 = A 3 {(Veruntreute, OBJA, Spendengeld)} RA ROOT [] [ROOT] A 5 = A 4 {(ROOT, ROOT, Veruntreute)} SH [ROOT] [] A 5

64 Solution OBJA ROOT SUBJ DET PUNCT ROOT Veruntreute die AWO Spendengeld? ROOT Did-embezzle the AWO donation-money? Operation σ β A [ROOT] [Veruntreute,...] SH [ROOT, Veruntreute] [die,...] SH [..., die] [AWO,...] LA DET [ROOT, Veruntreute] [AWO,...] A 1 = {(AWO, DET, die)} RA SUBJ [ROOT] [Veruntreute,...] A 2 = A 1 {(Veruntreute, SUBJ, AWO)} SH [ROOT, Veruntreute] [Spendengeld,?] A 2 SH [..., Spendengeld] [?] A 2 RA PUNCT [ROOT, Veruntreute] [Spendengeld] A 3 = A 2 {(Spendengeld, PUNCT,?)} RA OBJA [ROOT] [Veruntreute] A 4 = A 3 {(Veruntreute, OBJA, Spendengeld)} RA ROOT [] [ROOT] A 5 = A 4 {(ROOT, ROOT, Veruntreute)} SH [ROOT] [] A 5

65 Issues The transition system is clearly non-deterministic: Item(s) in the buffer and top of the stack is not ROOT: Shift, Left-Arc r, and Right-Arc r Item(s) in the buffer and top of the stack is ROOT: Shift and Right-Arc r Empty stack, non-empty buffer: Shift For Left-Arc r and Right-Arc r, is any r R possible?

66 Parsing algorithm

67 Introduction As observed: there is usually more than one transition that is valid for a non-terminal configuration. Each choice leads to a different transition sequence and (typically) dependency graph. We are interested in the best parse: the parse that is the most likely interpretation of a sentence. Choose the transition that will lead to the best parse.

68 Oracle Assume that we were given an oracle function o. The oracle function will, for a given configuration c, give a transition o(c) = t, such that t is the correct transition. Using the o, one can implement a deterministic parser that will give the best parse.

69 Parsing using an oracle c c 0 (S) while isterminal(c) do t o(c) c t(c) end while

70 Properties O(n), where n is S, provided that the oracle and transition functions can be computed in constant time: The buffer size is bound by n: The maximum size of the buffer is S 1 (in the initial configuration). None of the transitions increases the size of the buffer. The stack size is also bound by n: Each Shift increases the stack size by 1. Maximum stack size: Shift until all buffer tokens are on the stack. Maximum possible number of Shifts: β Each transition decreases the stack or buffer size by 1.

71 Classifier Of course, such an oracle function is normally not available. Rather than o, we use a classification function λ. λ is a function learned from training data. λ predicts the best transition based on features a configuration. Intuition: if a similar configuration occurred in the training data, it can say something about which transition should be chosen.

72 Parsing using a classifier c c 0 (S) while isterminal(c) do t λ c c t(c) end while

73 More on classifiers Next week!

Computational Linguistics

Computational 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 information

Computational Linguistics. Acknowledgements. Phrase-Structure Trees. Dependency-based Parsing

Computational 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 information

Transition-Based Parsing

Transition-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 information

Personal Project: Shift-Reduce Dependency Parsing

Personal Project: Shift-Reduce Dependency Parsing Personal Project: Shift-Reduce Dependency Parsing 1 Problem Statement The goal of this project is to implement a shift-reduce dependency parser. This entails two subgoals: Inference: We must have a shift-reduce

More information

Dependency grammar. Recurrent neural networks. Transition-based neural parsing. Word representations. Informs Models

Dependency grammar. Recurrent neural networks. Transition-based neural parsing. Word representations. Informs Models Dependency grammar Morphology Word order Transition-based neural parsing Word representations Recurrent neural networks Informs Models Dependency grammar Morphology Word order Transition-based neural parsing

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 2 Define push down automata Trace the computation of a push down automaton Design

More information

Lab 12: Structured Prediction

Lab 12: Structured Prediction December 4, 2014 Lecture plan structured perceptron application: confused messages application: dependency parsing structured SVM Class review: from modelization to classification What does learning mean?

More information

Pushdown Automata: Introduction (2)

Pushdown Automata: Introduction (2) Pushdown Automata: Introduction Pushdown automaton (PDA) M = (K, Σ, Γ,, s, A) where K is a set of states Σ is an input alphabet Γ is a set of stack symbols s K is the start state A K is a set of accepting

More information

Shift-Reduce parser E + (E + (E) E [a-z] In each stage, we shift a symbol from the input to the stack, or reduce according to one of the rules.

Shift-Reduce parser E + (E + (E) E [a-z] In each stage, we shift a symbol from the input to the stack, or reduce according to one of the rules. Bottom-up Parsing Bottom-up Parsing Until now we started with the starting nonterminal S and tried to derive the input from it. In a way, this isn t the natural thing to do. It s much more logical to start

More information

Einführung in die Computerlinguistik

Einführung in die Computerlinguistik Einführung in die Computerlinguistik Context-Free Grammars (CFG) Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Summer 2016 1 / 22 CFG (1) Example: Grammar G telescope : Productions: S NP VP NP

More information

Probabilistic Context Free Grammars. Many slides from Michael Collins

Probabilistic 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 information

Dependency Parsing. Statistical NLP Fall (Non-)Projectivity. CoNLL Format. Lecture 9: Dependency Parsing

Dependency Parsing. Statistical NLP Fall (Non-)Projectivity. CoNLL Format. Lecture 9: Dependency Parsing Dependency Parsing Statistical NLP Fall 2016 Lecture 9: Dependency Parsing Slav Petrov Google prep dobj ROOT nsubj pobj det PRON VERB DET NOUN ADP NOUN They solved the problem with statistics CoNLL Format

More information

A Tabular Method for Dynamic Oracles in Transition-Based Parsing

A Tabular Method for Dynamic Oracles in Transition-Based Parsing A Tabular Method for Dynamic Oracles in Transition-Based Parsing Yoav Goldberg Department of Computer Science Bar Ilan University, Israel yoav.goldberg@gmail.com Francesco Sartorio Department of Information

More information

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u,

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u, 1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u, v, x, y, z as per the pumping theorem. 3. Prove that

More information

A* Search. 1 Dijkstra Shortest Path

A* Search. 1 Dijkstra Shortest Path A* Search Consider the eight puzzle. There are eight tiles numbered 1 through 8 on a 3 by three grid with nine locations so that one location is left empty. We can move by sliding a tile adjacent to the

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Review of CFG, CFL, ambiguity What is the language generated by the CFG below: G 1 = ({S,T 1,T 2 }, {0,1,2}, { S

More information

Handout 8: Computation & Hierarchical parsing II. Compute initial state set S 0 Compute initial state set S 0

Handout 8: Computation & Hierarchical parsing II. Compute initial state set S 0 Compute initial state set S 0 Massachusetts Institute of Technology 6.863J/9.611J, Natural Language Processing, Spring, 2001 Department of Electrical Engineering and Computer Science Department of Brain and Cognitive Sciences Handout

More information

Models of Computation. by Costas Busch, LSU

Models of Computation. by Costas Busch, LSU Models of Computation by Costas Busch, LSU 1 Computation CPU memory 2 temporary memory input memory CPU output memory Program memory 3 Example: f ( x) x 3 temporary memory input memory Program memory compute

More information

NLP Homework: Dependency Parsing with Feed-Forward Neural Network

NLP Homework: Dependency Parsing with Feed-Forward Neural Network NLP Homework: Dependency Parsing with Feed-Forward Neural Network Submission Deadline: Monday Dec. 11th, 5 pm 1 Background on Dependency Parsing Dependency trees are one of the main representations used

More information

Computational Models - Lecture 4

Computational Models - Lecture 4 Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push

More information

13A. Computational Linguistics. 13A. Log-Likelihood Dependency Parsing. CSC 2501 / 485 Fall 2017

13A. Computational Linguistics. 13A. Log-Likelihood Dependency Parsing. CSC 2501 / 485 Fall 2017 Computational Linguistics CSC 2501 / 485 Fall 2017 13A 13A. Log-Likelihood Dependency Parsing Gerald Penn Department of Computer Science, University of Toronto Based on slides by Yuji Matsumoto, Dragomir

More information

Lecture 17: Language Recognition

Lecture 17: Language Recognition Lecture 17: Language Recognition Finite State Automata Deterministic and Non-Deterministic Finite Automata Regular Expressions Push-Down Automata Turing Machines Modeling Computation When attempting to

More information

Structured Prediction Models via the Matrix-Tree Theorem

Structured Prediction Models via the Matrix-Tree Theorem Structured Prediction Models via the Matrix-Tree Theorem Terry Koo Amir Globerson Xavier Carreras Michael Collins maestro@csail.mit.edu gamir@csail.mit.edu carreras@csail.mit.edu mcollins@csail.mit.edu

More information

Natural Language Processing CS Lecture 06. Razvan C. Bunescu School of Electrical Engineering and Computer Science

Natural Language Processing CS Lecture 06. Razvan C. Bunescu School of Electrical Engineering and Computer Science Natural Language Processing CS 6840 Lecture 06 Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.edu Statistical Parsing Define a probabilistic model of syntax P(T S):

More information

CISC4090: Theory of Computation

CISC4090: Theory of Computation CISC4090: Theory of Computation Chapter 2 Context-Free Languages Courtesy of Prof. Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Spring, 2014 Overview In Chapter

More information

Computational Models - Lecture 5 1

Computational Models - Lecture 5 1 Computational Models - Lecture 5 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. April 10/22, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Foundations of Informatics: a Bridging Course

Foundations 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 information

Parsing with Context-Free Grammars

Parsing 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 information

Dynamic-oracle Transition-based Parsing with Calibrated Probabilistic Output

Dynamic-oracle Transition-based Parsing with Calibrated Probabilistic Output Dynamic-oracle Transition-based Parsing with Calibrated Probabilistic Output Yoav Goldberg Computer Science Department Bar Ilan University Ramat Gan, Israel yoav.goldberg@gmail.com Abstract We adapt the

More information

Parsing with CFGs L445 / L545 / B659. Dept. of Linguistics, Indiana University Spring Parsing with CFGs. Direction of processing

Parsing with CFGs L445 / L545 / B659. Dept. of Linguistics, Indiana University Spring Parsing with CFGs. Direction of processing L445 / L545 / B659 Dept. of Linguistics, Indiana University Spring 2016 1 / 46 : Overview Input: a string Output: a (single) parse tree A useful step in the process of obtaining meaning We can view the

More information

Parsing with CFGs. Direction of processing. Top-down. Bottom-up. Left-corner parsing. Chart parsing CYK. Earley 1 / 46.

Parsing with CFGs. Direction of processing. Top-down. Bottom-up. Left-corner parsing. Chart parsing CYK. Earley 1 / 46. : Overview L545 Dept. of Linguistics, Indiana University Spring 2013 Input: a string Output: a (single) parse tree A useful step in the process of obtaining meaning We can view the problem as searching

More information

Word 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 Word Embeddings in Feedforward Networks; Tagging and Dependency Parsing using Feedforward Networks Michael Collins, Columbia University Overview Introduction Multi-layer feedforward networks Representing

More information

Finite Automata. Finite Automata

Finite Automata. Finite Automata Finite Automata Finite Automata Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers Parsers, Push-down Automata Context Free Grammar Finite State

More information

Pushdown Automata (Pre Lecture)

Pushdown Automata (Pre Lecture) Pushdown Automata (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Pushdown Automata (Pre Lecture) Fall 2017 1 / 41 Outline Pushdown Automata Pushdown

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation Bottom-up parsing Pumping Theorem for CFLs Recap: Going One Way Lemma: Each context-free language is accepted by some PDA. Proof (by construction): The idea: Let the stack

More information

CMSC 330: Organization of Programming Languages. Pushdown Automata Parsing

CMSC 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 information

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

More information

Pushdown Automata. Chapter 12

Pushdown Automata. Chapter 12 Pushdown Automata Chapter 12 Recognizing Context-Free Languages We need a device similar to an FSM except that it needs more power. The insight: Precisely what it needs is a stack, which gives it an unlimited

More information

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation LECTURE 7 Last time: Proving a language is not regular Pushdown automata (PDAs) Today: Context-free grammars (CFG) Equivalence of CFGs and PDAs Sofya Raskhodnikova 1/31/2016

More information

Chapter 1. Formal Definition and View. Lecture Formal Pushdown Automata on the 28th April 2009

Chapter 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 information

Administrivia. Test I during class on 10 March. Bottom-Up Parsing. Lecture An Introductory Example

Administrivia. Test I during class on 10 March. Bottom-Up Parsing. Lecture An Introductory Example Administrivia Test I during class on 10 March. Bottom-Up Parsing Lecture 11-12 From slides by G. Necula & R. Bodik) 2/20/08 Prof. Hilfinger CS14 Lecture 11 1 2/20/08 Prof. Hilfinger CS14 Lecture 11 2 Bottom-Up

More information

1. For the following sub-problems, consider the following context-free grammar: S AA$ (1) A xa (2) A B (3) B yb (4)

1. For the following sub-problems, consider the following context-free grammar: S AA$ (1) A xa (2) A B (3) B yb (4) ECE 468 & 573 Problem Set 2: Contet-free Grammars, Parsers 1. For the following sub-problems, consider the following contet-free grammar: S $ (1) (2) (3) (4) λ (5) (a) What are the terminals and non-terminals

More information

What we have done so far

What we have done so far What we have done so far DFAs and regular languages NFAs and their equivalence to DFAs Regular expressions. Regular expressions capture exactly regular languages: Construct a NFA from a regular expression.

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harry Lewis October 8, 2013 Reading: Sipser, pp. 119-128. Pushdown Automata (review) Pushdown Automata = Finite automaton

More information

Parsing Algorithms. CS 4447/CS Stephen Watt University of Western Ontario

Parsing 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 information

Lecture Notes on Inductive Definitions

Lecture 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 information

Recurrent neural network grammars

Recurrent neural network grammars Widespread phenomenon: Polarity items can only appear in certain contexts Recurrent neural network grammars lide credits: Chris Dyer, Adhiguna Kuncoro Example: anybody is a polarity item that tends to

More information

Computational Models: Class 3

Computational Models: Class 3 Computational Models: Class 3 Benny Chor School of Computer Science Tel Aviv University November 2, 2015 Based on slides by Maurice Herlihy, Brown University, and modifications by Iftach Haitner and Yishay

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 3: Finite State Automata Motivation In the previous lecture we learned how to formalize

More information

Lecture 11 Sections 4.5, 4.7. Wed, Feb 18, 2009

Lecture 11 Sections 4.5, 4.7. Wed, Feb 18, 2009 The s s The s Lecture 11 Sections 4.5, 4.7 Hampden-Sydney College Wed, Feb 18, 2009 Outline The s s 1 s 2 3 4 5 6 The LR(0) Parsing s The s s There are two tables that we will construct. The action table

More information

S NP VP 0.9 S VP 0.1 VP V NP 0.5 VP V 0.1 VP V PP 0.1 NP NP NP 0.1 NP NP PP 0.2 NP N 0.7 PP P NP 1.0 VP NP PP 1.0. N people 0.

S NP VP 0.9 S VP 0.1 VP V NP 0.5 VP V 0.1 VP V PP 0.1 NP NP NP 0.1 NP NP PP 0.2 NP N 0.7 PP P NP 1.0 VP  NP PP 1.0. N people 0. /6/7 CS 6/CS: Natural Language Processing Instructor: Prof. Lu Wang College of Computer and Information Science Northeastern University Webpage: www.ccs.neu.edu/home/luwang The grammar: Binary, no epsilons,.9..5

More information

CPS 220 Theory of Computation Pushdown Automata (PDA)

CPS 220 Theory of Computation Pushdown Automata (PDA) CPS 220 Theory of Computation Pushdown Automata (PDA) Nondeterministic Finite Automaton with some extra memory Memory is called the stack, accessed in a very restricted way: in a First-In First-Out fashion

More information

Parsing -3. A View During TD Parsing

Parsing -3. A View During TD Parsing Parsing -3 Deterministic table-driven parsing techniques Pictorial view of TD and BU parsing BU (shift-reduce) Parsing Handle, viable prefix, items, closures, goto s LR(k): SLR(1), LR(1) Problems with

More information

Statistical Methods for NLP

Statistical Methods for NLP Statistical Methods for NLP Stochastic Grammars Joakim Nivre Uppsala University Department of Linguistics and Philology joakim.nivre@lingfil.uu.se Statistical Methods for NLP 1(22) Structured Classification

More information

CSE 211. Pushdown Automata. CSE 211 (Theory of Computation) Atif Hasan Rahman

CSE 211. Pushdown Automata. CSE 211 (Theory of Computation) Atif Hasan Rahman CSE 211 Pushdown Automata CSE 211 (Theory of Computation) Atif Hasan Rahman Lecturer Department of Computer Science and Engineering Bangladesh University of Engineering & Technology Adapted from slides

More information

Bayesian Learning (II)

Bayesian Learning (II) Universität Potsdam Institut für Informatik Lehrstuhl Maschinelles Lernen Bayesian Learning (II) Niels Landwehr Overview Probabilities, expected values, variance Basic concepts of Bayesian learning MAP

More information

Harvard CS 121 and CSCI E-207 Lecture 10: Ambiguity, Pushdown Automata

Harvard CS 121 and CSCI E-207 Lecture 10: Ambiguity, Pushdown Automata Harvard CS 121 and CSCI E-207 Lecture 10: Ambiguity, Pushdown Automata Salil Vadhan October 4, 2012 Reading: Sipser, 2.2. Another example of a CFG (with proof) L = {x {a, b} : x has the same # of a s and

More information

Introduction to Computational Linguistics

Introduction to Computational Linguistics Introduction to Computational Linguistics Olga Zamaraeva (2018) Based on Bender (prev. years) University of Washington May 3, 2018 1 / 101 Midterm Project Milestone 2: due Friday Assgnments 4& 5 due dates

More information

Syntax Analysis, VI Examples from LR Parsing. Comp 412

Syntax Analysis, VI Examples from LR Parsing. Comp 412 COMP 412 FALL 2017 Syntax Analysis, VI Examples from LR Parsing Comp 412 source code IR IR target code Front End Optimizer Back End Copyright 2017, Keith D. Cooper & Linda Torczon, all rights reserved.

More information

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices Introduction to Theoretical Computer Science Motivation Automata = abstract computing devices Turing studied Turing Machines (= computers) before there were any real computers We will also look at simpler

More information

Final. Introduction to Artificial Intelligence. CS 188 Spring You have approximately 2 hours and 50 minutes.

Final. Introduction to Artificial Intelligence. CS 188 Spring You have approximately 2 hours and 50 minutes. CS 188 Spring 2014 Introduction to Artificial Intelligence Final You have approximately 2 hours and 50 minutes. The exam is closed book, closed notes except your two-page crib sheet. Mark your answers

More information

Automata Theory (2A) Young Won Lim 5/31/18

Automata Theory (2A) Young Won Lim 5/31/18 Automata Theory (2A) Copyright (c) 2018 Young W. Lim. 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

More information

Context- Free Parsing with CKY. October 16, 2014

Context- Free Parsing with CKY. October 16, 2014 Context- Free Parsing with CKY October 16, 2014 Lecture Plan Parsing as Logical DeducBon Defining the CFG recognibon problem BoHom up vs. top down Quick review of Chomsky normal form The CKY algorithm

More information

Methods for the specification and verification of business processes MPB (6 cfu, 295AA)

Methods for the specification and verification of business processes MPB (6 cfu, 295AA) Methods for the specification and verification of business processes MPB (6 cfu, 295AA) Roberto Bruni http://www.di.unipi.it/~bruni 07 - Introduction to nets 1 Object Overview of the basic concepts of

More information

MIDTERM: CS 6375 INSTRUCTOR: VIBHAV GOGATE October,

MIDTERM: CS 6375 INSTRUCTOR: VIBHAV GOGATE October, MIDTERM: CS 6375 INSTRUCTOR: VIBHAV GOGATE October, 23 2013 The exam is closed book. You are allowed a one-page cheat sheet. Answer the questions in the spaces provided on the question sheets. If you run

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of

More information

THEORY OF COMPILATION

THEORY OF COMPILATION Lecture 04 Syntax analysis: top-down and bottom-up parsing THEORY OF COMPILATION EranYahav 1 You are here Compiler txt Source Lexical Analysis Syntax Analysis Parsing Semantic Analysis Inter. Rep. (IR)

More information

Pushdown Automata. We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata.

Pushdown Automata. We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata. Pushdown Automata We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata. Next we consider a more powerful computation model, called a

More information

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions?

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions? Before We Start The Pumping Lemma Any questions? The Lemma & Decision/ Languages Future Exam Question What is a language? What is a class of languages? Context Free Languages Context Free Languages(CFL)

More information

1. For the following sub-problems, consider the following context-free grammar: S AB$ (1) A xax (2) A B (3) B yby (5) B A (6)

1. For the following sub-problems, consider the following context-free grammar: S AB$ (1) A xax (2) A B (3) B yby (5) B A (6) ECE 468 & 573 Problem Set 2: Contet-free Grammars, Parsers 1. For the following sub-problems, consider the following contet-free grammar: S AB$ (1) A A (2) A B (3) A λ (4) B B (5) B A (6) B λ (7) (a) What

More information

CS460/626 : Natural Language

CS460/626 : Natural Language CS460/626 : Natural Language Processing/Speech, NLP and the Web (Lecture 23, 24 Parsing Algorithms; Parsing in case of Ambiguity; Probabilistic Parsing) Pushpak Bhattacharyya CSE Dept., IIT Bombay 8 th,

More information

What is this course about?

What is this course about? What is this course about? Examining the power of an abstract machine What can this box of tricks do? What is this course about? Examining the power of an abstract machine Domains of discourse: automata

More information

CS 406: Bottom-Up Parsing

CS 406: Bottom-Up Parsing CS 406: Bottom-Up Parsing Stefan D. Bruda Winter 2016 BOTTOM-UP PUSH-DOWN AUTOMATA A different way to construct a push-down automaton equivalent to a given grammar = shift-reduce parser: Given G = (N,

More information

Push-down Automata = FA + Stack

Push-down Automata = FA + Stack Push-down Automata = FA + Stack PDA Definition A push-down automaton M is a tuple M = (Q,, Γ, δ, q0, F) where Q is a finite set of states is the input alphabet (of terminal symbols, terminals) Γ is the

More information

CMPT-825 Natural Language Processing. Why are parsing algorithms important?

CMPT-825 Natural Language Processing. Why are parsing algorithms important? CMPT-825 Natural Language Processing Anoop Sarkar http://www.cs.sfu.ca/ anoop October 26, 2010 1/34 Why are parsing algorithms important? A linguistic theory is implemented in a formal system to generate

More information

Theory of Computer Science

Theory of Computer Science Theory of Computer Science E1. Complexity Theory: Motivation and Introduction Malte Helmert University of Basel May 18, 2016 Overview: Course contents of this course: logic How can knowledge be represented?

More information

Automata Theory, Computability and Complexity

Automata Theory, Computability and Complexity Automata Theory, Computability and Complexity Mridul Aanjaneya Stanford University June 26, 22 Mridul Aanjaneya Automata Theory / 64 Course Staff Instructor: Mridul Aanjaneya Office Hours: 2:PM - 4:PM,

More information

Chapter 5. Finite Automata

Chapter 5. Finite Automata Chapter 5 Finite Automata 5.1 Finite State Automata Capable of recognizing numerous symbol patterns, the class of regular languages Suitable for pattern-recognition type applications, such as the lexical

More information

Machine Learning for NLP

Machine Learning for NLP Machine Learning for NLP Linear Models Joakim Nivre Uppsala University Department of Linguistics and Philology Slides adapted from Ryan McDonald, Google Research Machine Learning for NLP 1(26) Outline

More information

Theory of Computation

Theory of Computation Theory of Computation (Feodor F. Dragan) Department of Computer Science Kent State University Spring, 2018 Theory of Computation, Feodor F. Dragan, Kent State University 1 Before we go into details, what

More information

Theory of Computer Science. Theory of Computer Science. E1.1 Motivation. E1.2 How to Measure Runtime? E1.3 Decision Problems. E1.

Theory of Computer Science. Theory of Computer Science. E1.1 Motivation. E1.2 How to Measure Runtime? E1.3 Decision Problems. E1. Theory of Computer Science May 18, 2016 E1. Complexity Theory: Motivation and Introduction Theory of Computer Science E1. Complexity Theory: Motivation and Introduction Malte Helmert University of Basel

More information

Introduction to Bottom-Up Parsing

Introduction to Bottom-Up Parsing Introduction to Bottom-Up Parsing Outline Review LL parsing Shift-reduce parsing The LR parsing algorithm Constructing LR parsing tables 2 Top-Down Parsing: Review Top-down parsing expands a parse tree

More information

Chapter 4: Bottom-up Analysis 106 / 338

Chapter 4: Bottom-up Analysis 106 / 338 Syntactic Analysis Chapter 4: Bottom-up Analysis 106 / 338 Bottom-up Analysis Attention: Many grammars are not LL(k)! A reason for that is: Definition Grammar G is called left-recursive, if A + A β for

More information

Methods for the specification and verification of business processes MPB (6 cfu, 295AA)

Methods for the specification and verification of business processes MPB (6 cfu, 295AA) Methods for the specification and verification of business processes MPB (6 cfu, 295AA) Roberto Bruni http://www.di.unipi.it/~bruni 07 - Introduction to nets 1 Object Overview of the basic concepts of

More information

Maschinelle Sprachverarbeitung

Maschinelle Sprachverarbeitung Maschinelle Sprachverarbeitung Parsing with Probabilistic Context-Free Grammar Ulf Leser Content of this Lecture Phrase-Structure Parse Trees Probabilistic Context-Free Grammars Parsing with PCFG Other

More information

Probabilistic Context Free Grammars. Many slides from Michael Collins and Chris Manning

Probabilistic Context Free Grammars. Many slides from Michael Collins and Chris Manning Probabilistic Context Free Grammars Many slides from Michael Collins and Chris Manning Overview I Probabilistic Context-Free Grammars (PCFGs) I The CKY Algorithm for parsing with PCFGs A Probabilistic

More information

Maschinelle Sprachverarbeitung

Maschinelle Sprachverarbeitung Maschinelle Sprachverarbeitung Parsing with Probabilistic Context-Free Grammar Ulf Leser Content of this Lecture Phrase-Structure Parse Trees Probabilistic Context-Free Grammars Parsing with PCFG Other

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 43 Lecture 10: Overview Linear Bounded Automata Acceptance Problem for LBAs

More information

Introduction to Bottom-Up Parsing

Introduction to Bottom-Up Parsing Introduction to Bottom-Up Parsing Outline Review LL parsing Shift-reduce parsing The LR parsing algorithm Constructing LR parsing tables Compiler Design 1 (2011) 2 Top-Down Parsing: Review Top-down parsing

More information

Lecture VII Part 2: Syntactic Analysis Bottom-up Parsing: LR Parsing. Prof. Bodik CS Berkley University 1

Lecture VII Part 2: Syntactic Analysis Bottom-up Parsing: LR Parsing. Prof. Bodik CS Berkley University 1 Lecture VII Part 2: Syntactic Analysis Bottom-up Parsing: LR Parsing. Prof. Bodik CS 164 -- Berkley University 1 Bottom-Up Parsing Bottom-up parsing is more general than topdown parsing And just as efficient

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

More information

Business Processes Modelling MPB (6 cfu, 295AA)

Business Processes Modelling MPB (6 cfu, 295AA) Business Processes Modelling MPB (6 cfu, 295AA) Roberto Bruni http://www.di.unipi.it/~bruni 07 - Introduction to nets!1 Object Overview of the basic concepts of Petri nets Free Choice Nets (book, optional

More information

Parsing. Probabilistic CFG (PCFG) Laura Kallmeyer. Winter 2017/18. Heinrich-Heine-Universität Düsseldorf 1 / 22

Parsing. Probabilistic CFG (PCFG) Laura Kallmeyer. Winter 2017/18. Heinrich-Heine-Universität Düsseldorf 1 / 22 Parsing Probabilistic CFG (PCFG) Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Winter 2017/18 1 / 22 Table of contents 1 Introduction 2 PCFG 3 Inside and outside probability 4 Parsing Jurafsky

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 15 Ana Bove May 17th 2018 Recap: Context-free Languages Chomsky hierarchy: Regular languages are also context-free; Pumping lemma

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

Naïve Bayes Introduction to Machine Learning. Matt Gormley Lecture 18 Oct. 31, 2018

Naïve Bayes Introduction to Machine Learning. Matt Gormley Lecture 18 Oct. 31, 2018 10-601 Introduction to Machine Learning Machine Learning Department School of Computer Science Carnegie Mellon University Naïve Bayes Matt Gormley Lecture 18 Oct. 31, 2018 1 Reminders Homework 6: PAC Learning

More information

Compiler Principles, PS4

Compiler Principles, PS4 Top-Down Parsing Compiler Principles, PS4 Parsing problem definition: The general parsing problem is - given set of rules and input stream (in our case scheme token input stream), how to find the parse

More information

Accept or reject. Stack

Accept or reject. Stack Pushdown Automata CS351 Just as a DFA was equivalent to a regular expression, we have a similar analogy for the context-free grammar. A pushdown automata (PDA) is equivalent in power to contextfree grammars.

More information