November 2011Sentence Grammar1 CSA3202: HLT Sentence Grammar.

Slides:



Advertisements
Similar presentations
School of something FACULTY OF OTHER School of Computing FACULTY OF ENGINEERING Chunking: Shallow Parsing Eric Atwell, Language Research Group.
Advertisements

Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
07/05/2005CSA2050: DCG31 CSA2050 Introduction to Computational Linguistics Lecture DCG3 Handling Subcategorisation Handling Relative Clauses.
Semantics (Representing Meaning)
Chapter 4 Syntax.
Syntactic analysis using Context Free Grammars. Analysis of language Morphological analysis – Chairs, Part Of Speech (POS) tagging – The/DT man/NN left/VBD.
FSG, RegEx, and CFG Chapter 2 Of Sag’s Syntactic Theory.
Statistical NLP: Lecture 3
LING NLP 1 Introduction to Computational Linguistics Martha Palmer April 19, 2006.
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
1 Words and the Lexicon September 10th 2009 Lecture #3.
Artificial Intelligence 2005/06 From Syntax to Semantics.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
1 CONTEXT-FREE GRAMMARS. NLE 2 Syntactic analysis (Parsing) S NPVP ATNNSVBD NP AT NNthechildrenate thecake.
1 CSC 594 Topics in AI – Applied Natural Language Processing Fall 2009/ Outline of English Syntax.
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
Dr. Ansa Hameed Syntax (4).
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.
Linguistic Theory Lecture 2 Phrase Structure. What was there before structure? Classical studies: Classical studies: –Languages such as Latin Rich morphology.
Syntax Nuha AlWadaani.
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing INTRODUCTION Muhammed Al-Mulhem March 1, 2009.
THE PARTS OF SYNTAX Don’t worry, it’s just a phrase ELL113 Week 4.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
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.
November 2009HLT - Sentence Grammar1 Human Language Technology Sentence Grammar.
1 CPE 480 Natural Language Processing Lecture 5: Parser Asst. Prof. Nuttanart Facundes, Ph.D.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
IV. SYNTAX. 1.1 What is syntax? Syntax is the study of how sentences are structured, or in other words, it tries to state what words can be combined with.
Dr. Monira Al-Mohizea MORPHOLOGY & SYNTAX WEEK 11.
Natural Language Processing Lecture 6 : Revision.
GRAMMARS David Kauchak CS159 – Fall 2014 some slides adapted from Ray Mooney.
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Parsing with Context Free Grammars.
NLP. Introduction to NLP Is language more than just a “bag of words”? Grammatical rules apply to categories and groups of words, not individual words.
October 2005csa3180: Parsing Algorithms 11 CSA350: NLP Algorithms Sentence Parsing I The Parsing Problem Parsing as Search Top Down/Bottom Up Parsing Strategies.
GrammaticalHierarchy in Information Flow Translation Grammatical Hierarchy in Information Flow Translation CAO Zhixi School of Foreign Studies, Lingnan.
Context Free Grammars Reading: Chap 9, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Rada Mihalcea.
1 LIN6932 Spring 2007 LIN6932 Topics in Computational Linguistics Lecture 6: Grammar and Parsing (I) February 15, 2007 Hana Filip.
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
CSA2050 Introduction to Computational Linguistics Lecture 1 Overview.
November 2011CLINT-LN CFG1 Computational Linguistics Introduction Context Free Grammars.
Parsing with Context-Free Grammars for ASR Julia Hirschberg CS 4706 Slides with contributions from Owen Rambow, Kathy McKeown, Dan Jurafsky and James Martin.
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?
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.
1 LIN 1310B Introduction to Linguistics Prof: Nikolay Slavkov TA: Qinghua Tang CLASS 16, March 6, 2007.
CPSC 422, Lecture 27Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27 Nov, 16, 2015.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
SYNTAX.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 3.
1 Some English Constructions Transformational Framework October 2, 2012 Lecture 7.
CSA3050: NLP Algorithms Sentence Grammar NLP Algorithms.
NATURAL LANGUAGE PROCESSING
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
Beginning Syntax Linda Thomas
Statistical NLP: Lecture 3
SYNTAX.
Chapter Eight Syntax.
CS 388: Natural Language Processing: Syntactic Parsing
CSCI 5832 Natural Language Processing
Chapter Eight Syntax.
Introduction to Linguistics
David Kauchak CS159 – Spring 2019
Structure of a Lexicon Debasri Chakrabarti 13-May-19.
Presentation transcript:

November 2011Sentence Grammar1 CSA3202: HLT Sentence Grammar

November 2011Sentence Grammar2 Introduction This lecture has two aims: –Crash course in sentence-level grammar –Show how different linguistic phenomena can be captured by grammar rules. See also –Jurafsky and Martin Chapter 12 –Internet Grammar of English

November 2011Sentence Grammar3 Part 1 English Grammar

November 2011Sentence Grammar4 Different Kinds of Linguistic Rules Morphological rules.. govern how words may be composed: re+invest+ing = reinvesting. Grammatical (syntax) rules.. govern how words and constituents combine to form grammatical sentences. Semantic rules.. govern how meanings may be combined.

November 2011Sentence Grammar5 Syntax: What? Part of speech info Syntactic structure Grammatical relations, e.g. –X is the subject –Y is the object –Z is the main verb of sentence S

Syntax: Why? The grammatical relations provide strong clues to the computation of meaning. For example, in a simple active sentence –The verb corresponds to a logical predicate –The subject to the first argument –The object to the second argument

Grammatical Relations and Logic Representation John kicked Fido kicked(John, Fido) subject main verb object

Ideal Language - Logic Mapping subject verb comp1 comp2,..., compN predicate(arg0, arg1,arg2,..., argN) sentence logic

November 2011Sentence Grammar9 Syntax: Why? You need knowledge of syntax in many applications: Full versus superficial analysis?

November 2011Sentence Grammar10 Syntax: Why? Knowledge of syntax important e.g. for –Spellchecking: POS helps detect error come over hear –Computing meaning for QA how many pretty girls and boys in the room? –Information extraction a record breaking win for Arsenal in 2009 –Translation I miss you/tu me manques (you miss me) What depth of syntactic analysis is needed?

Depth of Analysis Full –Syntax tree of entire sentence –Typically deep trees –More appropriate for fine-grained QA Superficial –Good for spotting NP chunks or Verb clusters –Relations e.g. coreference (Lawrence Gonzi, Larry) –Shallow trees –More appropriate for text classification November 2011Sentence Grammar11

November 2011Sentence Grammar12 Levels of Grammar Organisation There are roughly three levels –Word Classes: different parts of speech (POS). –Phrase Classes: sequences of words inheriting the characteristics of certain word classes. –Clause Classes: sequences of phrases containing at least one verb phrase. On the basis of these one may define: –Grammatical Relations: role played by constitutents e.g. subject; verb; object –Syntax-Semantics interface

November 2011Sentence Grammar13 Word Classes Closed classes. –determiners : the, a, an, four. –pronouns : it, he etc. –prepositions : by, on, with. –conjunctions : and, or, but. Open classes. –nouns refer to objects or concepts: cat, beauty, Coke. –adjectives describe or qualify nouns: fried chickens. –verbs describe what the noun does: John jumps. –adverbs describe how it is done: John runs quickly.

November 2011Sentence Grammar14 Word Class Characteristics Different word classes have characteristic subclasses and properties SubclassesProperties Nounproper; mass; count number; gender Verbtransitive; intransitive Number; gender; person, tense Adjectivedimension; age; colour Number, gender

November 2011Sentence Grammar15 Phrases Longer phrases may be used rather than a single word, but fulfilling the same role in a sentence. –Noun phrases refer to objects: four fried chickens. –Verb phrases state what the noun phrase does: kicks the dog. –Adjective phrases describe/qualify an object: sickly sweet. –Adverbial phrases describe how it is done: very carefully. –Prepositional phrases: add information to a verb phrase: on the table

November 2011Sentence Grammar16 Phrases can become Complex e.g. Noun Phrases Proper Name or Pronoun: Monday; it Specifiers, noun: the day Specifier, premodifier, noun: the first wet day Specifiers, qualifiers, noun, postmodifier: The first wet day that I enjoyed in June

November 2011Sentence Grammar17 But they all fit the same context Monday It The day The first wet day The first wet day that I enjoyed in June was sunny.

November 2011Sentence Grammar18 Clauses A clause is a combination of noun phrases and verb phrases Clauses can exist at the top level (main clause) or can be embedded (subordinate clause) –Top level clause is a sentence. E.g. The cat ate the mouse. –Embedded clause is subordinate e.g. John said that Sandy is sick. Unlike phrases, whole sentences can be used to say something complete, e.g. to state a fact or ask a question.

November 2011Sentence Grammar19 Different Kinds of Sentence Assertion: John ate the cat. Yes/No question: Did John eat the cat? Wh- question: What did John eat? Command: Eat the cat John!

November 2011Sentence Grammar20 Part II Context Free Grammar Rules

November 2011Sentence Grammar21 Formal Grammar A formal grammar consists of –Terminal Symbols (T) –Non Terminal Symbols (NT, disjoint from TS) –Start Symbol (a distinguished NT) –Rewrite rules of the form , where  and  are strings of symbols Different classes of grammar result from various restrictions on the form of rules

November 2011Sentence Grammar22 Classes of Grammar TypeGrammarsLanguagesMachines 0Phrase Structure Unrestricted Recursively Enumerable TM 1Context Sensitive LBA 2Context Free PDA 3Regular FSA of grammar typeincreasing strength

English is not a Regular Language Central embedding: –The bird sang –The bird the cat ate sang –the bird the cat the dog chased ate sang –the bird the cat the dog the man walked chased ate sang. These sentences are of the form a n b n This language cannot be regular

November 2011Sentence Grammar24 Restrictions on Rules For all rules  Type 0 (unrestricted): no restrictions Type 1 (context sensitive): |  |  |  | Type 2 (context free): –  is a single NT symbol Type 3 (regular) –Every rule is of the form A  aB or A  a where A,B  NT and a  T

November 2011Sentence Grammar25 Example Grammar Cabinet discusses police chief ’ s case French gunman kills four s  np vp np  n np  adj n np  n np vp  v np

November 2011Sentence Grammar26 Types of Grammar Symbol NT – symbols appearing on the left S  NT– symbol appearing only on the left from which every other symbol can be derived. T – symbols appearing only on the right To include words we also need a lexicon - special rule that rewrite T symbols e,g. n  [police] n  [gunman]

November 2011Sentence Grammar27 Grammar induces Phrase Structure French gunman kills four adj n v n np np vp s

November 2011Sentence Grammar28 Phrase Structure PS includes information about –Hierarchy (vertical) –Ordering (horizontal) PS constitutes a trace of the rule applications used to derive a sentence but NB. PS does not tell you the order in which the rules were actually used

November 2011Sentence Grammar29 Handling Sentence Types with Rules Declaratives John left. S → NP VP Imperatives Leave! S →VP Yes-No Questions Did John leave? S →Aux NP VP WH Questions When did John leave? S →Wh-word Aux NP VP

November 2011Sentence Grammar30 Handling Recursive Structures Flights to Miami Flights to Miami from Boston Flights to Miami from Boston in April Flights to Miami from Boston in April on Friday Flights to Miami from Boston in April on Friday under $300. Flights to Miami from Boston in April on Friday under $300 with lunch.

November 2011Sentence Grammar31 Recursive Rules NP → NP PP PP → Preposition NP NP → n

November 2011Sentence Grammar32 Subcategorisation: verb types Intransitive verb: no object John disappeared John disappeared the cat* Transitive verb: one object John opened the window John opened* Ditransitive verb: two objects John gave Mary the book John promised Mary that he would come John gave Mary*

November 2011Sentence Grammar33 Subcategorisation Rules Intransitive verb: no object VP → V Transitive verb: one object VP → V NP Ditransitive verb: two objects VP → V NP NP If you take account of the category of items following the verb, you end up with about 40 VP rules.

November 2011Sentence Grammar34 Subcategorisation Rules Intransitive verb: no object VP → V Transitive verb: one object VP → V X Ditransitive verb: two objects VP → V X Y X,Y  {NP, PP, S}

November 2011Sentence Grammar35 Which Language Class for NLP? Type 3 (Regular). Good for morphology. Cannot handle central embedding of sentences. The man that John saw eating died. Type 2 (Context Free). OK but problems handling certain phenomena e.g. agreement, subcategorisation. Type 1 (Context Sensitive). Computational properties not well understood. Too powerful. Type 0 (Turing). Too powerful.

November 2011Sentence Grammar36 Handling Agreement NP → Determiner N Include these days, this day Exclude this days, these day NP → NPSing NP → NPPlur NPPlur → DetSing NSing NPPlur → DetPlur NPlur Agreement also includes number, gender, case. Problem: proliferation of categories/rules.

Feb MRCLINT - Lecture 137 Generative Power of a Grammar G G GL L L undergeneration only but not all overgeneration all but not only all and only

November 2011Sentence Grammar38 Robustess versus Overgeneration In the design of a language processor it is necessary to keep in mind two incompatible features –maintain robustness –avoid overgeneration Robustness is crucial for analysis and understanding: the system must sometimes be lenient wrt possible input. For analysis, –robustness can be achieved by having an overgenerating (i.e. underspecified) grammar. –But this comes at the price of more ambiguity For generation, overgeneration means many spurious sentences will be generated

November 2011Sentence Grammar39 Undergeneration A grammar should generate all sentences in the language. There should not be sentences in the language that are not generated by the grammar. s  n vp vp  v n  [John] n  [gold] v  [found]

November 2011Sentence Grammar40 Precision versus Undergeneration Analysis –It is possible to achieve high precision by limiting the class of acceptable input to manageable cases. –But there is a risk that some input will be ruled out Generation

November 2011Sentence Grammar41 Appropriate Stuctures –A grammar should assign linguistically plausible structures. n v d a n John ate a juicy hamburger vp s n v d a n John ate a juicy hamburger np vp s np vs.

November 2011Sentence Grammar42 Ambiguity np  np pp pp  prep np (the man) (on the hill with a telescope by the sea) (the man on the hill) (with a telescope by the sea) (the man on the hill with a telescope)( by the sea) etc.

November 2011Sentence Grammar43 Criteria for Evaluating Grammars Does it undergenerate? Does this matter? Does it overgenerate? Does this matter? Does it assign appropriate/useful structures to sentences it generates? Is it simple to understand? How many rules are there? Does it contain generalisations or is it just a collection of special cases? How ambiguous is it? How is ambiguity dealt with?

November 2011Sentence Grammar44 Summary Regular grammars insufficien for sentence structure. CFG is good for handling constituent structure and embedding but there are shortcomings in handling certain phenomena: –agreement –subcategorisation –coordination Criteria for evaluating grammars are complex

Summary Context free grammar is good for modelling constituent structure for –Different sentence types (declarative, imperative, question etc) –Different phrase types –Verb subcategorisation But agreement (subject/verb) presents certain problems which can only be resolved within CFG by inventing more rules. November 2011Sentence Grammar46