Models of Generative Grammar Smriti Singh. Generative Grammar  A Generative Grammar is a set of formal rules that can generate an infinite set of sentences.

Slides:



Advertisements
Similar presentations
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Advertisements

Syntactic analysis using Context Free Grammars. Analysis of language Morphological analysis – Chairs, Part Of Speech (POS) tagging – The/DT man/NN left/VBD.
Grammars, constituency and order A grammar describes the legal strings of a language in terms of constituency and order. For example, a grammar for a fragment.
Grammars, Languages and Parse Trees. Language Let V be an alphabet or vocabulary V* is set of all strings over V A language L is a subset of V*, i.e.,
Chapter Chapter Summary Languages and Grammars Finite-State Machines with Output Finite-State Machines with No Output Language Recognition Turing.
GRAMMAR & PARSING (Syntactic Analysis) NLP- WEEK 4.
Amirkabir University of Technology Computer Engineering Faculty AILAB Efficient Parsing Ahmad Abdollahzadeh Barfouroush Aban 1381 Natural Language Processing.
Context-Free Grammars Lecture 7
© Patrick Blackburn, Johan Bos & Kristina Striegnitz Lecture 7: Definite Clause Grammars Theory –Introduce context free grammars and some related concepts.
1 Foundations of Software Design Lecture 23: Finite Automata and Context-Free Grammars Marti Hearst Fall 2002.
1 CONTEXT-FREE GRAMMARS. NLE 2 Syntactic analysis (Parsing) S NPVP ATNNSVBD NP AT NNthechildrenate thecake.
Normal forms for Context-Free Grammars
Chapter 3: Formal Translation Models
Lect. 11Phrase structure rules Learning objectives: To define phrase structure rules To learn the forms of phrase structure rules To compose new sentences.
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
Dr. Ansa Hameed Syntax (4).
Linguistic Theory Lecture 2 Phrase Structure. What was there before structure? Classical studies: Classical studies: –Languages such as Latin Rich morphology.
Three Generative grammars
Syntax: The Sentence Patterns of Language
Context Free Grammars Reading: Chap 12-13, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Paul Tarau, based on Rada.
CSI 3120, Grammars, page 1 Language description methods Major topics in this part of the course: –Syntax and semantics –Grammars –Axiomatic semantics (next.
Natural Language Processing Lecture 6 : Revision.
THE BIG PICTURE Basic Assumptions Linguistics is the empirical science that studies language (or linguistic behavior) Linguistics proposes theories (models)
GRAMMARS David Kauchak CS159 – Fall 2014 some slides adapted from Ray Mooney.
1 Chapter 3 Describing Syntax and Semantics. 3.1 Introduction Providing a concise yet understandable description of a programming language is difficult.
SYNTAX Lecture -1 SMRITI SINGH.
Syntax: 10/18/2015IT 3271 Semantics: Describe the structures of programs Describe the meaning of programs Programming Languages (formal languages) -- How.
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Parsing with Context Free Grammars.
Context Free Grammars Reading: Chap 9, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Rada Mihalcea.
Copyright © Curt Hill Languages and Grammars This is not English Class. But there is a resemblance.
Parsing Introduction Syntactic Analysis I. Parsing Introduction 2 The Role of the Parser The Syntactic Analyzer, or Parser, is the heart of the front.
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
November 2011CLINT-LN CFG1 Computational Linguistics Introduction Context Free Grammars.
CPE 480 Natural Language Processing Lecture 4: Syntax Adapted from Owen Rambow’s slides for CSc Fall 2006.
CSA2050 Introduction to Computational Linguistics Lecture 1 What is Computational Linguistics?
Daisy Arias Math 382/Lab November 16, 2010 Fall 2010.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Rules, Movement, Ambiguity
Artificial Intelligence: Natural Language
CSA2050 Introduction to Computational Linguistics Parsing I.
1 Context Free Grammars October Syntactic Grammaticality Doesn’t depend on Having heard the sentence before The sentence being true –I saw a unicorn.
Making it stick together…
November 16, 2004 Lexicon (An Interacting Subsystem in UG) Part-II Rajat Kumar Mohanty IIT Bombay.
© 2005 Hans Uszkoreit FLST WS 05/06 FLST Grammars and Parsing Hans Uszkoreit.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
SYNTAX.
November 9, Lexicon (An Interacting Subsystem in UG) Part-I Rajat Kumar Mohanty IIT Bombay.
Parsing and Code Generation Set 24. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program,
CSC312 Automata Theory Lecture # 26 Chapter # 12 by Cohen Context Free Grammars.
GRAMMARS & PARSING. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program, referred to as a.
NATURAL LANGUAGE PROCESSING
Chapter 3 Language Acquisition: A Linguistic Treatment Jang, HaYoung Biointelligence Laborotary Seoul National University.
Welcome to the flashcards tool for ‘The Study of Language, 5 th edition’, Chapter 8 This is designed as a simple supplementary resource for this textbook,
SYNTAX.
King Faisal University جامعة الملك فيصل Deanship of E-Learning and Distance Education عمادة التعلم الإلكتروني والتعليم عن بعد [ ] 1 King Faisal University.
10/31/00 1 Introduction to Cognitive Science Linguistics Component Topic: Formal Grammars: Generating and Parsing Lecturer: Dr Bodomo.
Context Free Grammars. Slide 1 Syntax Syntax = rules describing how words can connect to each other * that and after year last I saw you yesterday colorless.
Natural Language Processing Vasile Rus
System Software Unit-1 (Language Processors) A TOY Compiler
An Introduction to the Government and Binding Theory
Context-Free Grammars: an overview
Programming Languages Translator
SYNTAX.
What does it mean? Notes from Robert Sebesta Programming Languages
CHAPTER 2 Context-Free Languages
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Teori Bahasa dan Automata Lecture 9: Contex-Free Grammars
David Kauchak CS159 – Spring 2019
Lecture 7: Definite Clause Grammars
COMPILER CONSTRUCTION
Presentation transcript:

Models of Generative Grammar Smriti Singh

Generative Grammar  A Generative Grammar is a set of formal rules that can generate an infinite set of sentences that constitute the language as a whole. Chomsky insisted that a grammar -  Must systematically describe all of the sentences in a language that a native speaker would regard as grammatical.  Must sort out all of the possible "good" sentences from all of the possible "bad" ones.  Must use a finite set of rules.  Must provide a way to account for our perceived ambiguity of certain sentences.

Models of Generative Grammar  Several models of Generative Grammar have been formally investigated following Chomsky’s initial discussion of – 1.Finite State Grammars 2.Phrase Structure Grammars and 3.Transformational Grammars Chomsky reviewed the two conceptions of grammar (1957):  The simpler of the two, finite-state grammars, are the rule systems that strung words together, one by one, and acknowledge no larger phrase structure.  More complex than finite-state grammars are grammars called phrase structure grammars that build up phrases out of words and put the phrases together into sentences.

Finite State Machine Suppose we have a machine –  That has a finite number of different internal states - 1.One of these states is an initial state and 2.Another is a final state.  That switches from one state to another by producing a symbol.  That begins in the initial state, runs through a sequence of states and ends in the final state.

Finite State Machine (contd.) Representing Grammar/machine that produces just the two sentences – “the man comes” and “the man come”. State Diagram man comes The men come

Finite State Grammar  Each node in the diagram corresponds to a state.  The sequence of words that has been produced is a ‘sentence’.  Such machine defines a certain language; the set of sentences that can be produced in this way.  Language produced by such a machine is called a finite state language.  Machine that produces such a language is called a finite state grammar.  FSG is the simplest type of grammar which, with a finite amount of apparatus, can generate an infinite number of sentences.

Properties of Finite State Grammars  Such grammars allow transition from one state to another.  Each state represents the grammatical restrictions that limit the choice of the next word.  We can have any number of closed loops of any length.  Machines that produce languages in this manner are also known as “finite state Markov processes ”.

Problems with FSGs  As all languages are not finite state languages, it is impossible to produce all and only the grammatical sentences of a language.  There are processes that FSGs are not equipped to handle.

Context Free Grammar  In both linguistics and computer science, we are not merely interested in whether a string is grammatical or not, we want to know why it is grammatical.  CFG is a finite collection of rules which tells us that certain sentences/strings are grammatical and what their grammatical structure is.  A context free grammar is one in which all the rules apply regardless of the context i.e. they would be of the type ‘Rewrite X as Y’, no further conditions being specified.

An example of CFG  Here's a simple context free grammar for a small fragment of English: S -> NP VP NP -> Det N VP -> V NP VP -> V Det -> a Det -> the N -> woman N -> man V -> shoots

Ingredients and properties of this grammar  What are the ingredients of this grammar? It contains three types of symbol: 1.‘->’ = A n instruction to rewrite whatever symbol appears to the left of the arrow as the symbol or string of symbols that appears to the right of the arrow. 2.Symbols written like: S, NP, VP, Det, N, V. These symbols are called non-terminal symbols. Each of these symbols is shorthand for a grammatical category. 3.Symbols in italics: a, the, woman, man, and shoots. A computer scientist would probably call these terminal symbols and linguists would probably call them lexical items.  Why Context Free? As only single non-terminals occur on the left side of the rules.

Rule explanation  This grammar contains nine rules.  Each rule consists of a single non-terminal symbol, followed by ->, followed by a finite sequence made up of terminal and/or non-terminal symbols.  We interpret each rule X Y as the instruction “rewrite X as Y.”  For example, rule (2) rewrites the symbol VP as the string of symbols Verb + NP, and defines Verb + NP to be a construction of the type VP.  The symbol S (for "sentence") is designated as the initial symbol.  It is necessary to begin with a rule that has the initial symbol on the left.  Thereafter any rule may be applied in any order until no further rule is applicable.

Context Free Grammar (contd.) Consider the string of words – a woman shoots a man.  Is this grammatical according to our little grammar?  And if it is, what structure does it have? The following tree answers both the questions : Such a tree is called a parse tree, and it gives us two sorts of information: 1. Information about strings 2. Information about structure

Problems with CFGs  A context free language is a language that can be generated by a context free grammar.  Some languages are context free, and some are not e.g. it seems plausible that English is a context free language.  Some dialects of Swiss-German are not context free.  It can be proved mathematically that no context free grammar can generate all (and only) the sentences that native speakers find acceptable and..  For such dialects, one needs to employ additional grammatical mechanisms, not merely context free rules.

Phrase Structure Grammar  It builds up phrases out of words and put the phrases together into sentences.  The kind of structural description assigned by a phrase-structure grammar is, in fact, an immediate constituent analysis of the sentence.  It assigns to each sentence that it generates a structural description.  It makes use of phrase structure rules.

Phrase Structure Grammar (contd.)  It enables us to express patterns of grammaticality.  It provides a structural description to characterize the notion of grammaticality.  It provides a way to capture our intuitions about the constituent structure of sentences  It also provides a way to explain, or account for, our perceived ambiguity of certain sentences e.g. “mistrust wounds” S NP VP VP NP N V V N Mistrust wounds Mistrust wounds

An example of a Phrase Structure Grammar  It generates and thereby defines as grammatical such sentences as "The man will hit the ball" An example of a PSG (associated with constituent analysis) :

Derivation of a given sentence  Interpret each rule X Y as “rewrite X as Y.”  Derive the sentence “the man hit the ball” using the given grammar :  The numbers at the right of each line refer to the rule of the grammar used in constructing that line from the preceding line.

Representation using a Tree Diagram  The derivation of the last sentence using a Tree diagram : S NP VP Det N Verb NP Det N The man hit the ball  Such a tree does not tell in what order the rules have been applied.  Given a derivation of the sentence, its tree diagram can be constructed but not vice versa.  A tree diagram retains just what is essential in the derivation for determining the constituent analysis.  The sequence of words can be traced back to a single point of origin S

Inadequacies of PSG Although Chomsky found phrase-structure grammar to be necessary, he argued that this was not sufficient. 1.It under-generates i.e. fails to generate all the grammatical sentences of the language e.g.  He burst into a loud cry and left the room.  The man was bitten by the dog.  Did the dog bite the man?  Was the man bitten by the dog? 2. It over-generates. It blindly allows many sentences as grammatical which are in fact ungrammatical e.g.  *The boy died Bill.  *The men would put the book. 3.Not all cases of ambiguity are accounted for by such Grammar. 4.To account for such phenomena, the grammar must also include special transformational rules that grab phrases or pieces of phrases and move them around in specified ways.

References  Noam Chomsky. Syntactic Structures. The Hague: Mouton & Co., 1957  David Crystal. A Dictionary of Linguistics and Phonetics (Blackwell, 1984)  Noam Chomsky. Aspects of the Theory of Syntax (Cambridge, MA: MIT Press 1965)