Lexical Ambiguity ! Definition: a word belongs to two or more word (“part of speech”) classes Example: the round table (adjective), to round the corner.

Slides:



Advertisements
Similar presentations
Syntax and Context-Free Grammars Julia Hirschberg CS 4705 Slides with contributions from Owen Rambow, Kathy McKeown, Dan Jurafsky and James Martin.
Advertisements

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.
Natural Language Processing - Parsing 1 - Language, Syntax, Parsing Problems in Parsing Ambiguity, Attachment / Binding Bottom vs. Top Down Parsing.
Parsing I Context-free grammars and issues for parsers.
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 2004 Natural Language Processing - Syntax and Parsing - Language, Syntax, Parsing Problems in Parsing Ambiguity, Attachment.
NLP and Speech Course Review. Morphological Analyzer Lexicon Part-of-Speech (POS) Tagging Grammar Rules Parser thethe – determiner Det NP → Det.
 Christel Kemke /08 COMP 4060 Natural Language Processing PARSING.
Albert Gatt LIN3022 Natural Language Processing Lecture 8.
Matakuliah: G0922/Introduction to Linguistics Tahun: 2008 Session 11 Syntax 2.
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.
Context Free Grammar S -> NP VP NP -> det (adj) N
Artificial Intelligence 2004 Natural Language Processing - Syntax and Parsing - Language Syntax Parsing.
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.
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.
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
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.
Constituency Tests Phrase Structure Rules
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing INTRODUCTION Muhammed Al-Mulhem March 1, 2009.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
1 Syntax and Semantics The Purpose of Syntax Problem of Describing Syntax Formal Methods of Describing Syntax Derivations and Parse Trees Sebesta Chapter.
TEORIE E TECNICHE DEL RICONOSCIMENTO Linguistica computazionale in Python: -Analisi sintattica (parsing)
Lecture 12: 22/6/1435 Natural language processing Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
For Monday Read chapter 23, sections 1-2 FOIL exercise due.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
1 Statistical Parsing Chapter 14 October 2012 Lecture #9.
Overview Project Goals –Represent a sentence in a parse tree –Use parses in tree to search another tree containing ontology of project management deliverables.
Natural Language Processing Lecture 6 : Revision.
GRAMMARS David Kauchak CS159 – Fall 2014 some slides adapted from Ray Mooney.
SYNTAX Lecture -1 SMRITI SINGH.
10. Parsing with Context-free Grammars -Speech and Language Processing- 발표자 : 정영임 발표일 :
Natural Language Processing Artificial Intelligence CMSC February 28, 2002.
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.
Parsing I: Earley Parser CMSC Natural Language Processing May 1, 2003.
PARSING David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
ENGLISH SYNTAX Introduction to Transformational Grammar.
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
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.
Center for PersonKommunikation P.1 Background for NLP Questions brought up by N. Chomsky in the 1950’ies: –Can a natural language like English be described.
Rules, Movement, Ambiguity
The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase.
CSA2050 Introduction to Computational Linguistics Parsing I.
Natural Language - General
1 Context Free Grammars October Syntactic Grammaticality Doesn’t depend on Having heard the sentence before The sentence being true –I saw a unicorn.
Natural Language Processing
For Friday No reading Program 4 due. Program 4 Any questions?
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.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
GRAMMARS David Kauchak CS457 – Spring 2011 some slides adapted from Ray Mooney.
CSA3050: NLP Algorithms Sentence Grammar NLP Algorithms.
NATURAL LANGUAGE PROCESSING
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 =
SYNTAX.
Roadmap Probabilistic CFGs –Handling ambiguity – more likely analyses –Adding probabilities Grammar Parsing: probabilistic CYK Learning probabilities:
Statistical NLP: Lecture 3
Chapter Eight Syntax.
CS : Speech, NLP and the Web/Topics in AI
Chapter Eight Syntax.
Natural Language - General
Linguistic Essentials
David Kauchak CS159 – Spring 2019
Presentation transcript:

Lexical Ambiguity ! Definition: a word belongs to two or more word (“part of speech”) classes Example: the round table (adjective), to round the corner (verb), dance in a round (noun), come round and see us (adverb), he walked round the room (preposition) Finite state grammars can be used for resolving lexical ambiguity

Grammar: Simple Finite State Network ! Noun Det Noun Verb Det 1 2 3 4 5 J J J J Adj Adj the: Det (definite) little: Adj (size) orange: Adj (colour) Noun (fruit) ducks: Noun (animal) Verb (action) swallow: Noun (animal) flies: Noun (animal) Lexicon:

Grammar: Simple Finite State Network ! the orange Noun Det Noun Verb Det little 1 2 3 4 5 J J J J Adj Adj the: Det (definite) little: Adj (size) orange: Adj (colour) Noun (fruit) ducks: Noun (animal) Verb (action) swallow: Noun (animal) flies: Noun (animal) Lexicon:

Parsing with Finite State Grammar “parse tree” ! Det Adj Adj Noun Verb Noun the little orange ducks swallow flies (definite) size colur animal action animal

Finite State Grammar: Conclusion ! FSNs can resolve lexical ambiguities FSNs cannot assign actual structural descriptions to sentences. The generated structures are “flat” describing simple paths through the network. FSNs only describe legal sequences of terminal symbols (Note: In NLP, syntactic parsing is sometimes preceded by “POS-tagging” (or “Constraint-grammars), a preprocessor that resolves many lexical ambiguities. This speeds up syntactic parsing. POS-tagging is normally based on trainable finite state machines).

Grammar: Simple Recursive Transition Network (equivalent to fsn) ! NP VP S: Equivalent BNF: S -> NP VP NP ->Noun NP -> Det Noun NP -> AdjP Noun NP -> Det AdjP Noun AdjP -> Adj AdjP-> adj AdjP VP ->Verb VP -> Verb NP Det Noun Adj J NP: Verb J NP VP:

Det Adj Adj Noun Verb Noun the little orange ducks swallow flies Parsing with Recursive Transition Network Grammar Phrase Structure (“parse tree”) ! S VP NP NP Det Adj Adj Noun Verb Noun the little orange ducks swallow flies (definite) size colour animal action animal

Structural Ambiguity ! Definition: a context-free grammar can assign two or more phrase structures (“parse trees”) to one and the same sequence of terminal symbols (words or word classes). In formal language theory often referred to as the grammar being ambiguous (ambiguous vs. unambiguous grammars) Examples: old men and women time flies like an arrow I saw the man with the telescope

Structural Ambiguity 1 (ambiguous context-free grammars) ! S-> NP VP (PP) Subject+Predicate+a facultative prepositional phrase describing e.g. instrument/time/place of the Subject- Predicate relation NP->Pron I/me/him... NP->(Det) Noun (PP) (the/a) man (in England/round the corner/with a hat) VP->Verb (NP) eat (sth.)/see (sth.) PP-> Prep NP in England/round the corner/with a hat/with a telescope

Structural Ambiguity 2 Phrase Structure 1. ! S NP VP NP PP NP Pron Verb Det Noun Prep Det Noun I saw the man with a telescope

Structural Ambiguity 3 Phrase Structure 2. ! S NP VP PP NP NP Pron Verb Det Noun Prep Det Noun I saw the man with a telescope

Context-free Grammar: Conclusion ! Like FSNs, RTNs/BNFs can resolve lexical ambiguities Additionally, RTNs/BNFs can assign actual structural descriptions to sentences. The generated structures analyses the sentence into constituents. A proper constituent analysis is a vital step towards an actual semantic interpretation of the sentence In NLP, unification-based context-free grammars are often preferred because they can be used with a number of efficient parsing algorithms developed in formal-language theory. In general, such unification-grammars presuppose general parsing algorithms (no restrictions as regards left-recursion/right-recursion etc.) exhaustive parsing algorithms (because of ambiguities) Widespread are algorithms derived from the Earley chart parsing algorithm (cf. J. Earley). Example at http://www.sil.org/pcpatr/

! More about Ambiguity 1. How do humans resolve ambiguities? Example: Pragmatics: Understanding intentions World-knowledge Example: "Denmark will have a distinguished visit next year. The Russian president Boris Jeltsin and the American president Bill Clinton will attend a meeting on social problems in Copenhagen" Translated from Danish: "Danmark får fornemt besøg næste år. Den russiske præsident Boris Jeltsin og den amerikanske præsident Bill Clinton skal til møde om sociale problemer i København"

More about Ambiguity 2. ! How are ambiguities resolved in NLP applications? Implementation of less ambiguous domain-specific sub-grammars Application of preference rules. In spoken dialogue systems: Implementation of system-directed dialogues (system-prompts) Clarification sub-dialogues

Exercise 1 Consider the sentence I saw him with a telescope Is this sentence ambiguous according to the grammar on slide 9? It has been argued that a more “correct” name for the word class “pronoun” (e.g. I, him) would be “pronounphrase”. Elaborate on that based on the example/grammar above

Exercise 2 Do you know of anything that can be compared to “lexical ambiguity” in high level programming languages? Could we in C, theoretically, collapse the assignment and expression symbols (‘=‘, ‘==‘) into one symbol? Some C-compilers generate warnings on cases like int x=1,y=2; if (x=y) {/*do something*/} Should they do that?

Exercise 3 Download and install the CPK NLP Suite: www.cpk.auc.dk/~tb/nlpsuite and join the “quick tour” through the programs. Try the Winograd and Earley examples: apspars -T wino1.aps wino1.snt apspars -T wino2.aps wino2.snt psgpars -T earley.psg earley.snt Impatient people can read about the aps (Augmented Phrase Structure) grammar format on www.cpk.auc.dk/~tb/articles/mmuirp98_7.htm