Computation of Substring Probabilities in Stochastic Grammars Ana L. N. Fred Instituto de Telecomunicac~oes Instituto Superior Tecnico IST-Torre Norte
|
|
- Georgina Watts
- 5 years ago
- Views:
Transcription
1 Computation of Substring Probabilities in Stochastic Grammars Ana L. N. Fred Instituto de Telecomunicac~oes Instituto Superior Tecnico IST-Torre Norte, Av. Rovisco Pais, Lisboa, Portugal Abstract. The computation of the probability of string generation according to stochastic grammars given only some of the symbols that compose it underlies pattern recognition problems concerning the prediction and/or recognition based on partial observations. This paper presents algorithms for the computation of substring probabilities in stochastic regular languages. Situations covered include prex, sux and island probabilities. The computational time complexity of the algorithms is analyzed. 1 Introduction The computation of the probability of string generation according to stochastic grammars given only some of the symbols that compose it, underlies some pattern recognition problems such as prediction and recognition of patterns based on partial observations. Examples of this type of problems are illustrated in [2{ 4], in the context of automatic speech understanding, and in [5, 6], concerning the prediction of a particular physiological state based on the syntactic analysis of electro-encephalographic signals. Another potential application, in the area of image understanding, is the recognition of partially occluded objects based on their string contour descriptions. Expressions for the computation of substring probabilities according to stochastic context-free grammars written in Chomsky Normal Form have been proposed [1{3]. In this paper algorithms for the computation of substring probabilities for regular-type languages expressed by stochastic grammars of the form! F i F i! F i! F j 2 F i F j 2 V N ( representing the grammar start symbol and V N corresponding to the nonterminal and terminal symbols sets, respectively) are described. This type of grammars arises, for instance, in the process of grammatical inference based on Crespi-Reghizzi's method [7] when structural samples assume the form [:::[dc[fgb[e[cd[ab]]]] (meaning some sort of temporal alignment of sub-patterns).
2 The algorithms presented next explore the particular structure of these grammars, being essentially dynamic programming methods. Situations described include the recognition of xed length strings (probability of exact recognition { section 3.1, highest probability interpretation { section 3.2) and arbitrary length strings (prex { section 3.3, sux { section 3.5 and island probabilities { section 3.4). The computational complexity ofthemethods is analyzed in terms of worst case time complexity. Minor and obvious modications of the above algorithms enable the computation of probabilities according to the standard form of regular grammars. 2 Notation and Denitions Let G =(V N R s )beastochastic context-free grammar, where V N is the - nite set of non-terminal symbols or syntactical categories is the set of terminal symbols (vocabulary) R s is a nite set of productions of the form p i : A!, A 2 V N, 2 ( [ V N ), the star representing any combination of symbols in the set and p i is the rule probability and 2 V N is the start symbol. When rules take the particular form A! ab or A! a, with A B 2 V N and a 2, then the grammar is designated as nite-state or regular. Along the text the symbols A, G and will be used to represent non-terminal symbols. The following denitions are also useful: def w 1 :::w n = nite sequence of terminal symbols ) def = derivations of from through the application of an arbitrary number of rules C T () def = number of terminal symbols in (with repetitions) C N () def = number of non-terminal symbols in (with repetitions) n min ( G) def = min n max fc T () :! Gg The following graphical notation is used to represent derivation trees: { Arcs are associated with the direct application of rules. For instance, the rule! w 1 w 2 G is represented by or w1w2 G w1w2 G { The triangle represents derivation trees having the top non-terminal symbol as root and leading to the string on the base of the triangle: ) w 1 :::w n w1 :::w n
3 3 Algorithms Description 3.1 Probability of Derivation of Exact String { Pr( ) w i :::w in) Let Pr ( ) w i :::w in ) be the probability of all derivation trees having as root and generating exactly w i :::w in. According to the type of grammars considered the computation of this probability can be obtained as follows (see gure 1): Pr( ) w i :::w in )= G Pr(! G)Pr(G ) w i :::w in ) (1) Pr( ) w i :::w in ) 6= =Pr(! w i :::w in ) n min( G) k=1 Pr(! w i :::w ik;1 G)Pr(G ) w ik :::w in ) (2) w i w i1 A1 ::: w in w iw i1 ::: w i2 A1 ::: w in w i :::w in;1 A1 w in Fig. 1. Terms of the expression 2. This can be summarized by the iterative algorithm: 1. For all non-terminal symbols 2 V N ;fg, determine Pr(! w in ) 2. For k =1 :::n and for all non-terminal symbols 2 V N ;fg, compute: Pr( ) w in;k :::w in ) =Pr(! w in;k :::w in ) n min( G) j=1 Pr(! w in;k :::w in;kj;1 G) Pr(G ) w in;kj :::w in ) (3)
4 3. Pr( ) w i :::w in )= G Pr(! G)Pr(G ) w i :::w in ) (4) This corresponds to lling in the matrix of gure 2, column by column, from the right to the left. In this gure, each element corresponds to the probability of all derivation trees for the substring on the top of the column, with root on the non-terminal symbols indicated on the left of the row, i.e. Pr ( i ) w j :::w in ). w i :::w in ::: w in;1 :::w in w in 1 Pr (1! w in) 2 Pr (2 ) w in;1w in). jvn j Fig. 2. Array representing the syntactic recognition of strings according to the algorithm. Notice that the calculations on step 2 are based only on direct rules and access to previously computed probabilities on columns to the right of the position under calculation. Computational complexity analysis For strings of length n, the computational cycle is repeated n times, all non-terminal symbols being considered. Associating to the terms in equation 3 A: Pr(! w in;k :::w in ) B: G n min( G) j=1 Pr(! w in;k :::w in;kj;1 G)Pr(G ) w in;kj :::w in ) the worst case time complexity is of the order O 0 (jv N j;1) step 1 n;1 k=1 (jv N j;1) 0 B computation {z of A 1 computation of B C A step 2 {z} step 3 1 C A = O (jv N jn)
5 3.2 Maximum Probability of Derivation { P m ( ) w i :::w in) Let P m ( ) w 1 :::w n ) denote the highest probability over all derivation trees having as root and producing exactly w 1 :::w n and dene the matrix M u as follows: M u [i j] =P m ( i ) w j :::w n ) i =1 ::: jv N j j =1 ::: n (5) Observing that P m ( ) w 1 :::w n )= max G n o P m (G ) w 1 :::w n ) (6) and P m ( ) w 1 :::w n ) 6= =maxfpr(! w 1 :::w n ) max i G n Pr(! w 1 :::w i G)P m (G ) w i1 :::w n ) o (7) the following algorithm computes the desired probability: 1. For i =1 ::: jv N j i 6= M u [i n] = Pr(i! w n ) if ( i! w n ) 2 R s 0 otherwise 2. For j = n ; 1 ::: 1 and for i =1 ::: jv N j i 6= M u [i j] = max f Pr( i! w j :::w n ) max fpr( i! w j :::w k l )M u [l k 1]g g k>j l 3. For i : i = M u [i 1] =max j fpr(! j )M u [j 1]g This algorithm corresponds to the computation of an array similar to the one in gure 2, but where probabilities refer to maximum values of single derivations instead of total probability of derivation when ambiguous grammars are considered. Based on the similarity between this algorithm and the one developed in section 3.1 it is straightforward to conclude that it runs in O (jv N jn) time.
6 3.3 Prex Probability {Pr( ) w i :::w in ) The probability of all derivation trees having as root and generating arbitrary length strings with the prex w i :::w in {Pr( ) w i :::w in )){canbe expressed as follows: Pr( ) w i :::w in )= G Pr(! G)Pr(G ) w i :::w in ) (8) Pr( ) w i :::w in ) 6= =Pr(! w i :::w in ) n min( G) Pr(! w i :::w ik;1 G)Pr(G ) w ik :::w in ) G k=1 Pr(! w i :::w in G) G Pr(! w i :::w in v 1 :::v k G) G k2n =Pr(! w i :::w in ) G G k2n 0 n min( G) k=1 Pr(! w i :::w ik;1 G)Pr(G ) w ik :::w in ) Pr(! w i :::w in v 1 :::v k G) (9) ::: wi:::win wi A1 wi:::win;1 A1 wi:::win A1 wi:::win A1 wi1:::win win Fig. 3. Terms of the expression 9. The previous expression suggest the following iterative algorithm: 1. For all nonterminal symbols 2 V N ;fg, determine Pr(! w in ) k2n Pr(! w in v 1 :::v k ) 2. For k =1 ::: n and for all nonterminal symbols 2 V N ;fg, compute Pr( ) w in;k :::w in )
7 =Pr(! w in;k :::w in ) G G k min( G) j=1 j2n 0 Pr(! w in;k :::w in;kj;1 G) Pr(G ) w in;kj :::w in ) Pr(! w in;k :::w in v 1 :::v j G) (10) 3. Pr( ) w i :::w in )= G Pr(! G)Pr(G ) w i :::w in ) (11) This algorithm, like the one of section 3.1, corresponds to lling in a parsing matrix similar to the one in gure 2. The similarity with the algorithm in section 3.1 leads to the conclusion that this algorithm has O (jv N jn) time complexity. 3.4 Island Probability {Pr ( ) w i :::w in ) The island probability consists of Pr ( ) w i :::w in ), the probability of all derivation trees with root in that generate arbitrary length sequences containing the subsequence w i :::w in. Let P R (! G) def = Pr(! G) 2 (12) = probability of rewriting by sequences with the nonterminal symbol G as sux One can write Pr( ) w i :::w in )= G Pr(! G)Pr(G ) w i :::w in ) (13) Pr( ) w i :::w in ) 6= = G P R (! G)Pr(G ) w i :::w in ) n min( G) j=1 P R (! w i :::w ij;1 G)Pr(G ) w ij :::w in ) P R (! w i :::w in G)Pr(G ) ) =1
8 j k j k Pr(! v 1 :::v k w i :::w in z 1 :::z j G)Pr(G ) ) =1 Pr(! v 1 :::v k w i :::w in z 1 :::z j ) (14) For strings suciently long ( n> max G fc T () :G! g) the last three terms do not exist, therefore we will ignore them from now on. G wi:::wik G wi:::win G wi:::win wik1:::win wi:::win G wi:::win Fig. 4. Terms of the expression 14. Pr( ) w i :::w in ) 6= = G P R (! G)Pr(G ) w i :::w in ) n min( G) j=1 P R (! w i :::w ij;1 G)Pr(G ) w ij :::w in ) (15) Recursively applying the above expression and after some manipulation (details can be found in [6]) one obtains: Pr( ) w i :::w in ) 6= = Q R ( ) A) P R (A! w i :::w ij;1 G)Pr(G ) w ij :::w in ) A G j2n P R (! w i :::w ij;1 G)Pr(G ) w ij :::w in ) (16) G j2n with Q R ( ) G) =Pr( ) G) =P R (! G) P R (! A)P R (A! G) P R (! A 1 )P R (A 1! A 2 ) A A 1A 2 P R (A 2! G)::: (17) Q R ( ) G) obeys the equation Q R ( ) G) = P R (! A)Q R (A ) G)P R (! G) (18) A
9 Dening the matrices P R [ G] =P R (! G) (19) Q R [ G] =Q R ( ) G) (20) Q is given by [6]: The algorithm can thus be described as: Q R = P R [I ;P R ] ;1 (21) 1. O-line computation of Q R = P R [I ;P R ] ;1. 2. On-line computation of Pr(G ) w n ) Pr(G ) w n;1 w n ) ::: Pr(G ) w 2 :::w n ) for all nonterminal symbols G 2 V N ;fg using the algorithm in section For all nonterminal symbols 2 V N ;fg compute 4. Pr( ) w i :::w in ) = A Q R ( ) A) G j2n P R (A! w i :::w ij;1 G) Pr(G ) w ij :::w in ) j2n P R (! w i :::w ij;1 G)Pr(G ) w ij :::w in ) Pr( ) w i :::w in )= G Pr(! G)Pr(G ) w i :::w in ) The required on-line computations have the following time complexity: 0 B N j;1)(n ; 1) (jv N j;1)jv N j step 2 ; = max(o (jv N jn) O jv N j 2 step 3 A = step 4 {z} 1 C 3.5 Sux Probability {Pr() w i :::w in) Let Pr ( ) w i :::w in ) be the probability of all derivation trees with root in generating arbitrary length strings having w i :::w in as a sux. This probability can be derived as follows: Pr( ) w i :::w in )= G Pr(! G)Pr(G ) w i :::w in ) (22)
10 Pr( ) w i :::w in ) 6= = G P R (! G)Pr(G ) w i :::w in ) n min( G) j=1 P R (! w i :::w ij;1 G)Pr(G ) w ij :::w in ) P R (! w i :::w in ) (23) G wi:::wik G wi:::win wi:::win wik1 :::w in Fig. 5. Terms of the expression 23. For strings suciently long ( n> max G fc T () :G! g) the third term does not exist, so it will be ignored henceforth. Recursively applying the resulting expression to the second part of the rst term one obtains: Pr( ) w i :::w in ) 6= = A 1 ) w ij :::w in ) P R (! w i :::w ij;1 A 1 )Pr(A 1 j2n P R (! A 1 )P R (A 1! w i :::w ij;1 A 2 ): j2n A 1 A 2 :Pr(A 2 ) w ij :::w in ) ::: = A A 1 ::: A k P R (! A 1 )P R (A 1! A 2 ) ::: :::P R (A k;1! w i :::w ij;1 A k )Pr(A k ) w ij :::w in )::: (24) Q R ( ) A) G j2n P R (A! w i :::w ij;1 G)Pr(G ) w ij :::w in ) j2n P R (! w i :::w ij;1 G)Pr(G ) w ij :::w in ) (25) The algorithm is then: 1. O-line computation of Q R = P R [I ;P R ] ;1.
11 2. On-line computation of Pr(G ) w n ) Pr(G ) w n;1 w n ) ::: Pr(G ) w 2 :::w n ) for all non-terminal symbols G 2 V N ;fg using the algorithm in section For all non-terminal symbols 2 V N ;fg compute 4. Pr( ) w i :::w in ) = A Q R ( ) A) G j2n P R (A! w i :::w ij;1 G)Pr(G ) w ij :::w in ) j2n P R (! w i :::w ij;1 G)Pr(G ) w ij :::w in ) Pr( ) w i :::w in )= G Pr(! G)Pr(G ) w i :::w in ) On-line computations have the time complexity: 0 B N j;1)(n ; 1) (jv N j;1) step 2 step 3 A = O (jv N jn) step 4 {z} 1 C 4 Conclusions This paper described several algorithms for the computation of substring probabilities according to grammars written in the form! F i F i! F i! F j 2 F i F j 2 V N Table 1 summarizes the probabilities considered here, and the order of complexity of the associated algorithms. Algorithm Expression time Complexity Fixed length Pr( ) w1 :::w n) O(jV N jn) strings Pm( ) w1 :::w n) O(jV N jn) Arbitrary Pr( ) w1 :::w n ) O(jV N jn) length strings Pr( ) w1 :::w n) O(jV N jn) Pr( ) w1 :::w n ) max(o (jv N jn) O ; jv N j 2 Table 1. Summary of proposed algorithms for the computation of sub-string probabilities.
12 More general algorithms for the computation of sub-string probabilities according to stochastic context-free grammars, written in Chomsky Normal Form, can be found in [1{3]. owever, the later have O(n 3 ) time complexity [2]. The herein proposed algorithms, exhibiting linear time complexity in string's length, represent a computationally appealing alternative to be used whenever the application at hand can adequately be modeled by the types of grammars described above. Examples of application of the algorithms described in this paper can be found in [5, 6, 8, 9]. References 1. F. Jelinek, J. D. Laerty and R. L. Mercer. Basic Methods of Probabilistic Context Free Grammars. In Speech Recognition and Understanding. Recent Advances, pages 345{360. Springer-Verlag, A. Corazza, R. De Mori, R. Gretter, and G. Satta. Computation of Probabilities for an Island-Driven Parser. IEEE Trans. Pattern Anal. Machine Intell., vol. 13, No. 9, pages 936{949, A. Corazza, R. De Mori, and G. Satta. Computation of Upper-Bounds for Stochastic Context-Free Languages. In proceedings AAAI-92, pages 344{349, A. Corazza, R. De Mori, R. Gretter, and G. Satta. Some Recent results on Stochastic Language Modelling. In Advances in Structural and Syntactic Pattern Recognition, World-Scientic, pages 163{183, A. L. N. Fred, A. C. Rosa, and J. M. N. Leit~ao. Predicting REM in sleep EEG using a structural approach. In E. S. Gelsema and L. N. Kanal, editors, Pattern Recognition in Practice IV, pages 107 { 117. Elsevier Science Publishers, A. L. N. Fred, Structural Pattern Recognition: Applications in Automatic Sleep Analysis, PhD Thesis, Technical University of Lisbon, K. S. Fu and T. L. Booth. Grammatical inference: Introduction and survey { part IandII. IEEE Trans. Pattern Anal. Machine Intell., PAMI-8:343{359, May Ana L. N. Fred and T. Paiva. Sleep Dynamics and Sleep Disorders: a Syntactic Approach to ypnogram Classication. Em 10th Nordic-Baltic Conference on Biomedical Engineering and 1st International Conference on Bioelectromagnetism, pp 395{ 396, Tampere, Finl^andia Junho, A. L. N. Fred, J. S. Marques, P. M. Jorge, idden Markov Models vs Syntactic Modeling in Object Recognition, Proc. Intl. Conference on Image Processing,ICIP'97, 1997.
straight segment and the symbol b representing a corner, the strings ababaab, babaaba and abaabab represent the same shape. In order to learn a model,
The Cocke-Younger-Kasami algorithm for cyclic strings Jose Oncina Depto. de Lenguajes y Sistemas Informaticos Universidad de Alicante E-03080 Alicante (Spain) e-mail: oncina@dlsi.ua.es Abstract The chain-code
More informationTo make a grammar probabilistic, we need to assign a probability to each context-free rewrite
Notes on the Inside-Outside Algorithm To make a grammar probabilistic, we need to assign a probability to each context-free rewrite rule. But how should these probabilities be chosen? It is natural to
More informationCSCI Compiler Construction
CSCI 742 - Compiler Construction Lecture 12 Cocke-Younger-Kasami (CYK) Algorithm Instructor: Hossein Hojjat February 20, 2017 Recap: Chomsky Normal Form (CNF) A CFG is in Chomsky Normal Form if each rule
More informationcmp-lg/ Nov 1994
I 1947 Center St. Suite 600 Berkeley, California 94704-1198 (510) 643-9153 FAX (510) 643-7684 INTERNATIONAL COMPUTER SCIENCE INSTITUTE cmp-lg/9411029 28 Nov 1994 An Ecient Probabilistic Context-Free Parsing
More informationSpectral Learning for Non-Deterministic Dependency Parsing
Spectral Learning for Non-Deterministic Dependency Parsing Franco M. Luque 1 Ariadna Quattoni 2 Borja Balle 2 Xavier Carreras 2 1 Universidad Nacional de Córdoba 2 Universitat Politècnica de Catalunya
More informationHarvard CS 121 and CSCI E-207 Lecture 12: General Context-Free Recognition
Harvard CS 121 and CSCI E-207 Lecture 12: General Context-Free Recognition Salil Vadhan October 11, 2012 Reading: Sipser, Section 2.3 and Section 2.1 (material on Chomsky Normal Form). Pumping Lemma for
More informationA Graph Based Parsing Algorithm for Context-free Languages
A Graph Based Parsing Algorithm for Context-free Languages Giinter Hot> Technical Report A 01/99 June 1999 e-mail: hotzocs.uni-sb.de VVVVVV: http://vwv-hotz.cs.uni-sb. de Abstract We present a simple algorithm
More informationIntroduction 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 informationCPS 220 Theory of Computation
CPS 22 Theory of Computation Review - Regular Languages RL - a simple class of languages that can be represented in two ways: 1 Machine description: Finite Automata are machines with a finite number of
More informationProbabilistic Context-free Grammars
Probabilistic Context-free Grammars Computational Linguistics Alexander Koller 24 November 2017 The CKY Recognizer S NP VP NP Det N VP V NP V ate NP John Det a N sandwich i = 1 2 3 4 k = 2 3 4 5 S NP John
More informationA* 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 informationNatural Language Processing : Probabilistic Context Free Grammars. Updated 5/09
Natural Language Processing : Probabilistic Context Free Grammars Updated 5/09 Motivation N-gram models and HMM Tagging only allowed us to process sentences linearly. However, even simple sentences require
More informationLanguages. Languages. An Example Grammar. Grammars. Suppose we have an alphabet V. Then we can write:
Languages A language is a set (usually infinite) of strings, also known as sentences Each string consists of a sequence of symbols taken from some alphabet An alphabet, V, is a finite set of symbols, e.g.
More informationAn Efficient Context-Free Parsing Algorithm. Speakers: Morad Ankri Yaniv Elia
An Efficient Context-Free Parsing Algorithm Speakers: Morad Ankri Yaniv Elia Yaniv: Introduction Terminology Informal Explanation The Recognizer Morad: Example Time and Space Bounds Empirical results Practical
More informationImproved TBL algorithm for learning context-free grammar
Proceedings of the International Multiconference on ISSN 1896-7094 Computer Science and Information Technology, pp. 267 274 2007 PIPS Improved TBL algorithm for learning context-free grammar Marcin Jaworski
More informationFollow sets. LL(1) Parsing Table
Follow sets. LL(1) Parsing Table Exercise Introducing Follow Sets Compute nullable, first for this grammar: stmtlist ::= ε stmt stmtlist stmt ::= assign block assign ::= ID = ID ; block ::= beginof ID
More informationFinite 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 informationExpectation Maximization (EM)
Expectation Maximization (EM) The EM algorithm is used to train models involving latent variables using training data in which the latent variables are not observed (unlabeled data). This is to be contrasted
More informationAlgorithms for Syntax-Aware Statistical Machine Translation
Algorithms for Syntax-Aware Statistical Machine Translation I. Dan Melamed, Wei Wang and Ben Wellington ew York University Syntax-Aware Statistical MT Statistical involves machine learning (ML) seems crucial
More informationTop-Down Parsing, Part II
op-down Parsing, Part II Announcements Programming Project 1 due Friday, 11:59PM Office hours every day until then. ubmission instructions will be emailed out tonight. Where We Are ource Code Lexical Analysis
More informationProbabilistic Context-Free Grammar
Probabilistic Context-Free Grammar Petr Horáček, Eva Zámečníková and Ivana Burgetová Department of Information Systems Faculty of Information Technology Brno University of Technology Božetěchova 2, 612
More informationChapter 6. Properties of Regular Languages
Chapter 6 Properties of Regular Languages Regular Sets and Languages Claim(1). The family of languages accepted by FSAs consists of precisely the regular sets over a given alphabet. Every regular set is
More informationOn the Sizes of Decision Diagrams Representing the Set of All Parse Trees of a Context-free Grammar
Proceedings of Machine Learning Research vol 73:153-164, 2017 AMBN 2017 On the Sizes of Decision Diagrams Representing the Set of All Parse Trees of a Context-free Grammar Kei Amii Kyoto University Kyoto
More informationAUGMENTED REGULAR EXPRESSIONS: A FORMALISM TO DESCRIBE, RECOGNIZE AND LEARN A CLASS OF CONTEXT-SENSITIVE LANGUAGES.
AUGMENTED REGULAR EXPRESSIONS: A FORMALISM TO DESCRIBE, RECOGNIZE AND LEARN A CLASS OF CONTEXT-SENSITIVE LANGUAGES. Rene Alquezar () and Alberto Sanfeliu () () Dept. de Llenguatges i Sistemes Informatics,
More informationCS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa
CS:4330 Theory of Computation Spring 2018 Regular Languages Finite Automata and Regular Expressions Haniel Barbosa Readings for this lecture Chapter 1 of [Sipser 1996], 3rd edition. Sections 1.1 and 1.3.
More informationCSC 4181Compiler Construction. Context-Free Grammars Using grammars in parsers. Parsing Process. Context-Free Grammar
CSC 4181Compiler Construction Context-ree Grammars Using grammars in parsers CG 1 Parsing Process Call the scanner to get tokens Build a parse tree from the stream of tokens A parse tree shows the syntactic
More informationAddress for Correspondence
Proceedings of BITCON-2015 Innovations For National Development National Conference on : Research and Development in Computer Science and Applications Research Paper SUBSTRING MATCHING IN CONTEXT FREE
More informationCross-Entropy and Estimation of Probabilistic Context-Free Grammars
Cross-Entropy and Estimation of Probabilistic Context-Free Grammars Anna Corazza Department of Physics University Federico II via Cinthia I-8026 Napoli, Italy corazza@na.infn.it Giorgio Satta Department
More informationPrefix Probability for Probabilistic Synchronous Context-Free Grammars
Prefix Probability for Probabilistic Synchronous Context-Free rammars Mark-Jan Nederhof School of Computer Science University of St Andrews North Haugh, St Andrews, Fife KY16 9SX United Kingdom markjan.nederhof@googlemail.com
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 informationComputability and Complexity
Computability and Complexity Sequences and Automata CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard Janicki Computability
More informationSyntactical analysis. Syntactical analysis. Syntactical analysis. Syntactical analysis
Context-free grammars Derivations Parse Trees Left-recursive grammars Top-down parsing non-recursive predictive parsers construction of parse tables Bottom-up parsing shift/reduce parsers LR parsers GLR
More informationLogic. proof and truth syntacs and semantics. Peter Antal
Logic proof and truth syntacs and semantics Peter Antal antal@mit.bme.hu 10/9/2015 1 Knowledge-based agents Wumpus world Logic in general Syntacs transformational grammars Semantics Truth, meaning, models
More informationDecision problem of substrings in Context Free Languages.
Decision problem of substrings in Context Free Languages. Mauricio Osorio, Juan Antonio Navarro Abstract A context free grammar (CFG) is a set of symbols and productions used to define a context free language.
More informationThe Inside-Outside Algorithm
The Inside-Outside Algorithm Karl Stratos 1 The Setup Our data consists of Q observations O 1,..., O Q where each observation is a sequence of symbols in some set X = {1,..., n}. We suspect a Probabilistic
More informationNoisy Subsequence Recognition Using Constrained String Editing Involving Substitutions, Insertions, Deletions and Generalized Transpositions 1
Noisy Subsequence Recognition Using Constrained String Editing Involving Substitutions, Insertions, Deletions and Generalized Transpositions 1 B. J. Oommen and R. K. S. Loke School of Computer Science
More informationComputability Theory
CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Problems of CFLs and beyond Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable
More informationChap. 7 Properties of Context-free Languages
Chap. 7 Properties of Context-free Languages 7.1 Normal Forms for Context-free Grammars Context-free grammars A where A N, (N T). 0. Chomsky Normal Form A BC or A a except S where A, B, C N, a T. 1. Eliminating
More informationHarvard CS 121 and CSCI E-207 Lecture 9: Regular Languages Wrap-Up, Context-Free Grammars
Harvard CS 121 and CSCI E-207 Lecture 9: Regular Languages Wrap-Up, Context-Free Grammars Salil Vadhan October 2, 2012 Reading: Sipser, 2.1 (except Chomsky Normal Form). Algorithmic questions about regular
More informationProbabilistic Context Free Grammars
1 Defining PCFGs A PCFG G consists of Probabilistic Context Free Grammars 1. A set of terminals: {w k }, k = 1..., V 2. A set of non terminals: { i }, i = 1..., n 3. A designated Start symbol: 1 4. A set
More informationComputability and Complexity
Computability and Complexity Push-Down Automata CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard Janicki Computability
More informationA shrinking lemma for random forbidding context languages
Theoretical Computer Science 237 (2000) 149 158 www.elsevier.com/locate/tcs A shrinking lemma for random forbidding context languages Andries van der Walt a, Sigrid Ewert b; a Department of Mathematics,
More informationAdvanced Natural Language Processing Syntactic Parsing
Advanced Natural Language Processing Syntactic Parsing Alicia Ageno ageno@cs.upc.edu Universitat Politècnica de Catalunya NLP statistical parsing 1 Parsing Review Statistical Parsing SCFG Inside Algorithm
More informationDT2118 Speech and Speaker Recognition
DT2118 Speech and Speaker Recognition Language Modelling Giampiero Salvi KTH/CSC/TMH giampi@kth.se VT 2015 1 / 56 Outline Introduction Formal Language Theory Stochastic Language Models (SLM) N-gram Language
More informationSimplification of CFG and Normal Forms. Wen-Guey Tzeng Computer Science Department National Chiao Tung University
Simplification of CFG and Normal Forms Wen-Guey Tzeng Computer Science Department National Chiao Tung University Normal Forms We want a cfg with either Chomsky or Greibach normal form Chomsky normal form
More informationSimplification of CFG and Normal Forms. Wen-Guey Tzeng Computer Science Department National Chiao Tung University
Simplification of CFG and Normal Forms Wen-Guey Tzeng Computer Science Department National Chiao Tung University Normal Forms We want a cfg with either Chomsky or Greibach normal form Chomsky normal form
More informationOn Controllability and Normality of Discrete Event. Dynamical Systems. Ratnesh Kumar Vijay Garg Steven I. Marcus
On Controllability and Normality of Discrete Event Dynamical Systems Ratnesh Kumar Vijay Garg Steven I. Marcus Department of Electrical and Computer Engineering, The University of Texas at Austin, Austin,
More informationExtracted from a working draft of Goldreich s FOUNDATIONS OF CRYPTOGRAPHY. See copyright notice.
106 CHAPTER 3. PSEUDORANDOM GENERATORS Using the ideas presented in the proofs of Propositions 3.5.3 and 3.5.9, one can show that if the n 3 -bit to l(n 3 ) + 1-bit function used in Construction 3.5.2
More information82 A. P. CAETANO and R. F. PICKEN similar to the classical homotopy groups but having additional properties. A few words are devoted to the usefulness
Rend. Istit. Mat. Univ. Trieste Vol. XXX, 8{90 (998) On a Family of Topological Invariants Similar to Homotopy Groups A. P. Caetano and R. F. Picken () Summary. - The intimacy relation between smooth loops,
More informationAverage Reward Parameters
Simulation-Based Optimization of Markov Reward Processes: Implementation Issues Peter Marbach 2 John N. Tsitsiklis 3 Abstract We consider discrete time, nite state space Markov reward processes which depend
More informationA parsing technique for TRG languages
A parsing technique for TRG languages Daniele Paolo Scarpazza Politecnico di Milano October 15th, 2004 Daniele Paolo Scarpazza A parsing technique for TRG grammars [1]
More informationMusic as a Formal Language
Music as a Formal Language Finite-State Automata and Pd Bryan Jurish moocow@ling.uni-potsdam.de Universität Potsdam, Institut für Linguistik, Potsdam, Germany pd convention 2004 / Jurish / Music as a formal
More informationLecture 12 Simplification of Context-Free Grammars and Normal Forms
Lecture 12 Simplification of Context-Free Grammars and Normal Forms COT 4420 Theory of Computation Chapter 6 Normal Forms for CFGs 1. Chomsky Normal Form CNF Productions of form A BC A, B, C V A a a T
More informationRNA Secondary Structure Prediction
RNA Secondary Structure Prediction 1 RNA structure prediction methods Base-Pair Maximization Context-Free Grammar Parsing. Free Energy Methods Covariance Models 2 The Nussinov-Jacobson Algorithm q = 9
More informationCMPT-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 informationFall 1999 Formal Language Theory Dr. R. Boyer. Theorem. For any context free grammar G; if there is a derivation of w 2 from the
Fall 1999 Formal Language Theory Dr. R. Boyer Week Seven: Chomsky Normal Form; Pumping Lemma 1. Universality of Leftmost Derivations. Theorem. For any context free grammar ; if there is a derivation of
More informationContext-Free Grammars. 2IT70 Finite Automata and Process Theory
Context-Free Grammars 2IT70 Finite Automata and Process Theory Technische Universiteit Eindhoven May 18, 2016 Generating strings language L 1 = {a n b n n > 0} ab L 1 if w L 1 then awb L 1 production rules
More informationCS20a: summary (Oct 24, 2002)
CS20a: summary (Oct 24, 2002) Context-free languages Grammars G = (V, T, P, S) Pushdown automata N-PDA = CFG D-PDA < CFG Today What languages are context-free? Pumping lemma (similar to pumping lemma for
More informationTree Adjoining Grammars
Tree Adjoining Grammars TAG: Parsing and formal properties Laura Kallmeyer & Benjamin Burkhardt HHU Düsseldorf WS 2017/2018 1 / 36 Outline 1 Parsing as deduction 2 CYK for TAG 3 Closure properties of TALs
More informationSection 1 (closed-book) Total points 30
CS 454 Theory of Computation Fall 2011 Section 1 (closed-book) Total points 30 1. Which of the following are true? (a) a PDA can always be converted to an equivalent PDA that at each step pops or pushes
More informationParsing. Based on presentations from Chris Manning s course on Statistical Parsing (Stanford)
Parsing Based on presentations from Chris Manning s course on Statistical Parsing (Stanford) S N VP V NP D N John hit the ball Levels of analysis Level Morphology/Lexical POS (morpho-synactic), WSD Elements
More informationGrammar formalisms Tree Adjoining Grammar: Formal Properties, Parsing. Part I. Formal Properties of TAG. Outline: Formal Properties of TAG
Grammar formalisms Tree Adjoining Grammar: Formal Properties, Parsing Laura Kallmeyer, Timm Lichte, Wolfgang Maier Universität Tübingen Part I Formal Properties of TAG 16.05.2007 und 21.05.2007 TAG Parsing
More informationThe Pumping Lemma for Context Free Grammars
The Pumping Lemma for Context Free Grammars Chomsky Normal Form Chomsky Normal Form (CNF) is a simple and useful form of a CFG Every rule of a CNF grammar is in the form A BC A a Where a is any terminal
More informationCSCI 1010 Models of Computa3on. Lecture 17 Parsing Context-Free Languages
CSCI 1010 Models of Computa3on Lecture 17 Parsing Context-Free Languages Overview BoCom-up parsing of CFLs. BoCom-up parsing via the CKY algorithm An O(n 3 ) algorithm John E. Savage CSCI 1010 Lect 17
More informationDiagram-based Formalisms for the Verication of. Reactive Systems. Anca Browne, Luca de Alfaro, Zohar Manna, Henny B. Sipma and Tomas E.
In CADE-1 Workshop on Visual Reasoning, New Brunswick, NJ, July 1996. Diagram-based Formalisms for the Verication of Reactive Systems Anca Browne, Luca de Alfaro, Zohar Manna, Henny B. Sipma and Tomas
More informationLearning from Sequential and Time-Series Data
Learning from Sequential and Time-Series Data Sridhar Mahadevan mahadeva@cs.umass.edu University of Massachusetts Sridhar Mahadevan: CMPSCI 689 p. 1/? Sequential and Time-Series Data Many real-world applications
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 informationAutomata Theory CS F-08 Context-Free Grammars
Automata Theory CS411-2015F-08 Context-Free Grammars David Galles Department of Computer Science University of San Francisco 08-0: Context-Free Grammars Set of Terminals (Σ) Set of Non-Terminals Set of
More informationA note on stochastic context-free grammars, termination and the EM-algorithm
A note on stochastic context-free grammars, termination and the EM-algorithm Niels Richard Hansen Department of Applied Mathematics and Statistics, University of Copenhagen, Universitetsparken 5, 2100
More informationContext-Free Parsing: CKY & Earley Algorithms and Probabilistic Parsing
Context-Free Parsing: CKY & Earley Algorithms and Probabilistic Parsing Natural Language Processing CS 4120/6120 Spring 2017 Northeastern University David Smith with some slides from Jason Eisner & Andrew
More informationProbabilistic Context-Free Grammars. Michael Collins, Columbia University
Probabilistic Context-Free Grammars Michael Collins, Columbia University Overview Probabilistic Context-Free Grammars (PCFGs) The CKY Algorithm for parsing with PCFGs A Probabilistic Context-Free Grammar
More informationSome hierarchies for the communication complexity measures of cooperating grammar systems
Some hierarchies for the communication complexity measures of cooperating grammar systems Juraj Hromkovic 1, Jarkko Kari 2, Lila Kari 2 June 14, 2010 Abstract We investigate here the descriptional and
More informationHorst Bunke IAM
A Fast Algorithm for Finding the Nearest Neighbor of a Word in a Dictionary Horst Bunke IAM-93-25 November 993 A Fast Algorithm for Finding the Nearest Neighbor of a Word in a Dictionary Horst Bunke Abstract
More informationAspects of Tree-Based Statistical Machine Translation
Aspects of Tree-Based Statistical Machine Translation Marcello Federico Human Language Technology FBK 2014 Outline Tree-based translation models: Synchronous context free grammars Hierarchical phrase-based
More informationA Polynomial Time Algorithm for Parsing with the Bounded Order Lambek Calculus
A Polynomial Time Algorithm for Parsing with the Bounded Order Lambek Calculus Timothy A. D. Fowler Department of Computer Science University of Toronto 10 King s College Rd., Toronto, ON, M5S 3G4, Canada
More informationAdministrivia. 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 informationEven More on Dynamic Programming
Algorithms & Models of Computation CS/ECE 374, Fall 2017 Even More on Dynamic Programming Lecture 15 Thursday, October 19, 2017 Sariel Har-Peled (UIUC) CS374 1 Fall 2017 1 / 26 Part I Longest Common Subsequence
More informationLecture 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 informationUndecidability of ground reducibility. for word rewriting systems with variables. Gregory KUCHEROV andmichael RUSINOWITCH
Undecidability of ground reducibility for word rewriting systems with variables Gregory KUCHEROV andmichael RUSINOWITCH Key words: Theory of Computation Formal Languages Term Rewriting Systems Pattern
More informationThe Power of Amnesia: Learning Probabilistic. Automata with Variable Memory Length
The Power of Amnesia: Learning Probabilistic Automata with Variable Memory Length DANA RON YORAM SINGER NAFTALI TISHBY Institute of Computer Science, Hebrew University, Jerusalem 9904, Israel danar@cs.huji.ac.il
More informationGenerating All Permutations by Context-Free Grammars in Chomsky Normal Form
Generating All Permutations by Context-Free Grammars in Chomsky Normal Form Peter R.J. Asveld Department of Computer Science, Twente University of Technology P.O. Box 217, 7500 AE Enschede, the Netherlands
More informationHow to Pop a Deep PDA Matters
How to Pop a Deep PDA Matters Peter Leupold Department of Mathematics, Faculty of Science Kyoto Sangyo University Kyoto 603-8555, Japan email:leupold@cc.kyoto-su.ac.jp Abstract Deep PDA are push-down automata
More informationA characterization of consistency of model weights given partial information in normal linear models
Statistics & Probability Letters ( ) A characterization of consistency of model weights given partial information in normal linear models Hubert Wong a;, Bertrand Clare b;1 a Department of Health Care
More informationLinear Algebra (part 1) : Matrices and Systems of Linear Equations (by Evan Dummit, 2016, v. 2.02)
Linear Algebra (part ) : Matrices and Systems of Linear Equations (by Evan Dummit, 206, v 202) Contents 2 Matrices and Systems of Linear Equations 2 Systems of Linear Equations 2 Elimination, Matrix Formulation
More informationOn the Myhill-Nerode Theorem for Trees. Dexter Kozen y. Cornell University
On the Myhill-Nerode Theorem for Trees Dexter Kozen y Cornell University kozen@cs.cornell.edu The Myhill-Nerode Theorem as stated in [6] says that for a set R of strings over a nite alphabet, the following
More informationNonterminal complexity of programmed grammars
Theoretical Computer Science 296 (2003) 225 251 www.elsevier.com/locate/tcs Nonterminal complexity of programmed grammars Henning Fernau School of Electrical Engineering and Computer Science, University
More informationNote that neither ; nor are syntactic constituents of content models. It is not hard to see that the languages denoted by content models are exactly t
Unambiguity of Extended Regular Expressions in SGML Document Grammars Anne Bruggemann-Klein Abstract In the Standard Generalized Markup Language (SGML), document types are dened by context-free grammars
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 informationCKY & Earley Parsing. Ling 571 Deep Processing Techniques for NLP January 13, 2016
CKY & Earley Parsing Ling 571 Deep Processing Techniques for NLP January 13, 2016 No Class Monday: Martin Luther King Jr. Day CKY Parsing: Finish the parse Recognizer à Parser Roadmap Earley parsing Motivation:
More informationIn: Proc. BENELEARN-98, 8th Belgian-Dutch Conference on Machine Learning, pp 9-46, 998 Linear Quadratic Regulation using Reinforcement Learning Stephan ten Hagen? and Ben Krose Department of Mathematics,
More informationParsing. 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 informationChapter 14 (Partially) Unsupervised Parsing
Chapter 14 (Partially) Unsupervised Parsing The linguistically-motivated tree transformations we discussed previously are very effective, but when we move to a new language, we may have to come up with
More informationNon-elementary Lower Bound for Propositional Duration. Calculus. A. Rabinovich. Department of Computer Science. Tel Aviv University
Non-elementary Lower Bound for Propositional Duration Calculus A. Rabinovich Department of Computer Science Tel Aviv University Tel Aviv 69978, Israel 1 Introduction The Duration Calculus (DC) [5] is a
More information1 Introduction This work follows a paper by P. Shields [1] concerned with a problem of a relation between the entropy rate of a nite-valued stationary
Prexes and the Entropy Rate for Long-Range Sources Ioannis Kontoyiannis Information Systems Laboratory, Electrical Engineering, Stanford University. Yurii M. Suhov Statistical Laboratory, Pure Math. &
More informationA fast algorithm to generate necklaces with xed content
Theoretical Computer Science 301 (003) 477 489 www.elsevier.com/locate/tcs Note A fast algorithm to generate necklaces with xed content Joe Sawada 1 Department of Computer Science, University of Toronto,
More informationFigure : Learning the dynamics of juggling. Three motion classes, emerging from dynamical learning, turn out to correspond accurately to ballistic mot
Learning multi-class dynamics A. Blake, B. North and M. Isard Department of Engineering Science, University of Oxford, Oxford OX 3PJ, UK. Web: http://www.robots.ox.ac.uk/vdg/ Abstract Standard techniques
More informationA DOP Model for LFG. Rens Bod and Ronald Kaplan. Kathrin Spreyer Data-Oriented Parsing, 14 June 2005
A DOP Model for LFG Rens Bod and Ronald Kaplan Kathrin Spreyer Data-Oriented Parsing, 14 June 2005 Lexical-Functional Grammar (LFG) Levels of linguistic knowledge represented formally differently (non-monostratal):
More informationCourse 495: Advanced Statistical Machine Learning/Pattern Recognition
Course 495: Advanced Statistical Machine Learning/Pattern Recognition Lecturer: Stefanos Zafeiriou Goal (Lectures): To present discrete and continuous valued probabilistic linear dynamical systems (HMMs
More informationComputability and Complexity
Computability and Complexity Decidability, Undecidability and Reducibility; Codes, Algorithms and Languages CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario,
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 information