Instructor: Nick Cercone CSEB -

Slides:



Advertisements
Similar presentations
Syntactic analysis using Context Free Grammars. Analysis of language Morphological analysis – Chairs, Part Of Speech (POS) tagging – The/DT man/NN left/VBD.
Advertisements

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.
Statistical NLP: Lecture 3
Introduction and Jurafsky Model Resource: A Probabilistic Model of Lexical and Syntactic Access and Disambiguation, Jurafsky 1996.
LING NLP 1 Introduction to Computational Linguistics Martha Palmer April 19, 2006.
1 Words and the Lexicon September 10th 2009 Lecture #3.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Word Classes and English Grammar.
Artificial Intelligence 2005/06 From Syntax to Semantics.
NLP and Speech 2004 English Grammar
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
Syntax and Context-Free Grammars CMSC 723: Computational Linguistics I ― Session #6 Jimmy Lin The iSchool University of Maryland Wednesday, October 7,
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Grammar Sentence Constructs.
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.
Linguistics II Syntax. Rules of how words go together to form sentences What types of words go together How the presence of some words predetermines others.
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.
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.
Probabilistic Parsing Reading: Chap 14, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Paul Tarau, based on Rada.
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.
Click to edit Master title style Instructor: Nick Cercone CSEB - CSE Introduction to Computational Linguistics Tuesdays,
GRAMMARS David Kauchak CS159 – Fall 2014 some slides adapted from Ray Mooney.
CSE Introduction to Computational Linguistics Tuesdays, Thursdays 14:30-16:00 – South Ross 101 Fall Semester, 2011 Instructor: Nick Cercone
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.
Linguistic Essentials
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.
Rules, Movement, Ambiguity
CSA2050 Introduction to Computational Linguistics Parsing I.
Section 11.3 Features structures in the Grammar ─ Jin Wang.
Artificial Intelligence 2004
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.
Handling Unlike Coordinated Phrases in TAG by Mixing Syntactic Category and Grammatical Function Carlos A. Prolo Faculdade de Informática – PUCRS CELSUL,
Instructor: Nick Cercone CSEB - 1 Parsing and Context Free Grammars Parsers, Top Down, Bottom Up, Left Corner, Earley.
CSA3050: NLP Algorithms Sentence Grammar NLP Algorithms.
NLP. Introduction to NLP #include int main() { int n, reverse = 0; printf("Enter a number to reverse\n"); scanf("%d",&n); while (n != 0) { reverse =
Chapter 3 – Describing Syntax CSCE 343. Syntax vs. Semantics Syntax: The form or structure of the expressions, statements, and program units. Semantics:
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
Natural Language Processing Vasile Rus
Chapter 3 – Describing Syntax
Statistical NLP: Lecture 3
Chapter 3 – Describing Syntax
SYNTAX.
4.3 The Generative Approach
Chapter Eight Syntax.
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27
Part I: Basics and Constituency
Syntax.
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
CS 388: Natural Language Processing: Statistical Parsing
CS 388: Natural Language Processing: Syntactic Parsing
Instructor: Nick Cercone CSEB -
CSCI 5832 Natural Language Processing
Probabilistic and Lexicalized Parsing
Chapter Eight Syntax.
Natural Language - General
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27
Linguistic Essentials
David Kauchak CS159 – Spring 2019
Structure of a Lexicon Debasri Chakrabarti 13-May-19.
David Kauchak CS159 – Spring 2019
Presentation transcript:

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Final Word on Syntax?, Semantics and Pragmatics CFG Notes; Typical phrase structure rules in English - (S) – (NP) – (AP) – (PP) – (VP); NL Phenomena; Heads, dependencies, arguments, adjuncts; Semantic analysis Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Final Thoughts on Syntax (for now) – Syntax = sentence structure; i.e., study of the phrase structure – s´yntaxis (Greek) — “setting out together, arrangement” – words are not randomly ordered— word order is important and non- trivial – There are “free-order” languages (e.g., Latin, Russian), but they are not completely order free. – a hierarchical view of sentence structure: – words form phrases – phrases form clauses – clauses form sentences Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Some Notions about CFGs CFG, also known as Phrase-Structure Grammar (PSG) – equivalent to BNF (Backus-Naur form) – idea from Wundt (1900), formally defined by Chomsky (1956) and Backus (1959) – typical notation (V, T, P, S); also (N,,R, S) – direct derivation, derivation – language generated by CFG – left-most and right-most derivation – parse tree, parsing – ambiguous sentences, grammars Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Bracket Representation of a Parse Tree (S (NP (DT That) (NN man)) (VP (VBD caught) (NP (DT the) (NN butterfly)) (PP (IN with) (NP (DT a) (NN net) ) ) ) ) Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Typical Phrase Structure Rules in English S  NP VP Declarative sentences, e.g.: I want a flight from Halifax to Chicago. S  VP Imperative sentences, e.g.: Show the lowest fare. S  Aux NP VP Yes-no questions, e.g.: Do any of these flights have stops? Can you give me some information for United? S  Wh-NP VP Wh-subject questions, e.g.: What airlines fly from Halifax? S  Wh-NP Aux NP VP Wh-non-subject questions, e.g.: What flights do you have on Tuesday? Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca About Typical Rules • only some typical rules are presented • for example: We see the cat, and you see a dog. • the sentence could be described with: S  S CC S • relative clauses are labeled in Penn treebank using SBAR nonterminal; e.g.: (S (NP (NP Lorillard Inc.) , (NP (NP the unit) (PP of (NP (ADJP New York-based) Loews Corp.))) (SBAR that (S (NP *gap*) (VP makes (NP Kent cigarettes)))) ,) (VP stopped (VP using (NP crocidolite)))) Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Noun Phrase (NP) typically: pronouns, proper nouns, or determiner-nominal construction some typical rules NP  PRP e.g.: you NP  NNP | NNPS e.g.: Halifax NP  PDT? DT JJ* NN PP* in the last rule, we use regular expression notation to describe a set of different rules example: all the various flights from Halifax to Toronto determiners and nominals modifiers before head noun and after head noun postmodifier phrases NP  DT JJ* NN RelC Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Relative Clauses RelC — relative clause clause (sentence-like phrase) following a noun phrase example: gerundive relative clause: flights arriving after 5pm example: infinitive relative clause: flights to arrive tomorrow example: restrictive relative clause: flight that was canceled yesterday Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Verb Phrase (VP) organizes arguments around the verb typical rules VP  Verb intransitive verbs; e.g.: disappear VP  Verb NP transitive verbs: e.g.: prefer a morning flight VP  Verb NP NP ditransitive verbs: e.g.: send me an email VP  Verb PP* sentential complements VP  Verb NP PP* VP  Verb NP NP PP* sentential complements, e.g.: You said these were two flights that were the cheapest. Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Prepositional Phrase (PP) Typical: PP  IN NP • examples: from Halifax, before tomorrow, in the city • PP-attachment ambiguity Adjective Phrase (ADJP) • less common • examples: – She is very sure of herself. – … the least expensive fare … . Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Adverbial Phrase (ADVP) • Example: (S (NP preliminary findings) (VP were reported (ADVP (NP a year) ago))) • more examples: years ago, easily rejected Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Natural Language Phenomena Three well-known phenomena: Agreement, Movement, Subcategorization Agreement Movement Subcategorization Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Agreement • subject-verb agreement For example, “I work.” and “He works.” vs. *“I works.” and *“He work.” • specifier-head agreement For example, “This book.” and “These books.” vs. *“This books.” and “These book.” Agreement can be a non-local dependency, e.g: The women who found the wallet were given a reward. Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Movement e.g, wh-movement Which book should Peter buy ? filler gap another example: (S (NP (NP Air Canada) , (NP (NP-*filler* one of many airline companies) (SBAR that (S (NP-*gap*) (VP flies from Halifax to Toronto)) )) , (VP cancelled the flights yesterday) ) . ) Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Subcategorization Example: The problem disappeared. and The defendant denied the accusation. are two valid sentences, however, the following two are grammatically incorrect: *The problem disappeared the accusation. and *The defendant denied. Explanation: • “disappear” does not take an object (verb valence) • “deny” requires an object Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Heads and Dependency the parse tree of “That man caught the butterfly with a net.” annotate dependencies, head words There is usually some way of annotating the head child among the left-hand-side symbols; e.g., NP → DT NNH or [NP] → [DT] H[NN] Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Head-feature Principle The features of a phrase are normally transferred from the features of the head word. Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Dependency Tree dependency grammar example with “That man caught the butterfly with a net.” Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Arguments and Adjuncts There ar two kinds of dependents: 1. arguments, which are required dependents, e.g., We deprived him of food. 2. adjuncts, which are not required; – they have a “less tight” link to the head, and – can be moved around more easily Example: We deprived him of food yesterday in the restaurant. Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Semantic Analysis meaning representation, e.g., as language or data structure typically syntax-driven principle of semantic compositionality, exceptions computational requirements verifiability unambiguous representation canonical form inference expressiveness example of a semantic representation language: First-Order Logic (FOL), and other logics Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Lexical Semantics word meaning— basic elements for compositional semantics What is a word? wordform— a word as it appears in text or speech; i.e., its orthographic or phonological representation lexeme— a pair (wordform, meaning), with optionally more information lexicon— a set of lexemes (or database) lemma or citation form— as it appears in a dictionary lemmatization— mapping of wordforms to lemmas Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Semantic Compositionality How meanings of the pieces combine into a meaning of the whole? Levels of compositionality: 1. compositional semantics e.g., white paper = white + paper 2. collocations e.g., white wine white + wine 3. idioms, examples: kick the bucket  kick + the bucket coupons are just the tip of the iceberg Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Semantic Roles Syntax is closely related to semantics. For example, subcategorization frames can be used to assign semantic roles of the verb arguments. E.g., verb send, semantic frame: NP[subject], NP[indirect object] NP[direct object] can be used to assign semantic roles of: SENDER, RECIPIENT, and OBJECT, resulting in the frame: Semantic preference can be used to properly disambiguate the sentences: He ate the cake with a frosting. and He ate the cake with a spoon. Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Bracket Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Bracket Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca

Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca Other Concluding Remarks MAKING AN EFFORT Our so-called limitations, I believe, apply to faculties we don't apply. We don't discover what we can't achieve until we make an effort not to try. Instructor: Nick Cercone - 3050 CSEB - nick@cse.yorku.ca