Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT - - PowerPoint PPT Presentation

artificial intelligence
SMART_READER_LITE
LIVE PREVIEW

Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT - - PowerPoint PPT Presentation

CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 18-19-20 Natural Language Processing (ambiguities and parsing) Importance of NLP Text based computation needs NLP Linguistics+Computation


slide-1
SLIDE 1

CS344: Introduction to Artificial Intelligence

Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 18-19-20– Natural Language Processing (ambiguities and parsing)

slide-2
SLIDE 2

Importance of NLP

Text based computation needs NLP

Machine translation High Quality Information Retrieval Linguistics+Computation

slide-3
SLIDE 3

Perpectivising NLP: Areas of AI and their inter-dependencies

Search Vision Planning Machine Learning Knowledge Representation Logic Expert Systems Robotics NLP

AI is the forcing function for Computer Science, and NLP of AI

slide-4
SLIDE 4
slide-5
SLIDE 5

Languages and the speaker population

Language Population (2001 census; rounded to most significant digit)

Hindi 450, 000, 000 Marathi 72, 000, 000 Konkani 7, 000, 000 Sanskrit 6000 Nepali 13, 000, 000

slide-6
SLIDE 6

Languages and the speaker population (contd.)

Language Population (2001 census; rounded to most significant digit)

Kashmiri 5, 000, 000 Assamese 13, 000, 000 Tamil 60, 000, 000 Malayalam 33, 000, 000 Bodo 1, 000, 000 Manipuri 1, 000, 000

slide-7
SLIDE 7

Great Linguistic Diversity

 Major streams

 Indo European  Dravidian  Sino Tibetan  Austro-Asiatic

 Some languages are

ranked within 20 in the world in terms of the populations speaking them

slide-8
SLIDE 8

Interesting “mixed-race” languages

 Marathi and Oriya: confluence of

Indo Aryan and Dravidian families

 Urdu: structure from Indo Aryan

(Hindi), vocabulary from Persian and Semitic (Arabic)

 आज मेरी परीक्सा है (aaj merii pariikshaa

hai) {today I have my examination}

 आज मेरा इमॎतहान है (aaj meraa imtahaan

hai)

slide-9
SLIDE 9

3 Language Formula

Every state has to implement

 Hindi  The state language

(Marathi, Gujarathi, Bengali etc.)

 English

Big time translation requirement, e.g.,during the financial year ends

slide-10
SLIDE 10

Multilingual Information Access needed for large GoI sector

Legislature Judiciary Education Employment Agriculture Healthcare Cultural

Provide one-stop access and insight into information related to key Government bodies and execution areas Enable citizens exercise their fundamental rights and duties

Science Housing Taxes Travel & Tourism Banking & Insurance International Sports

slide-11
SLIDE 11

Need for NLP

 Machine Translation  Information Retrieval and Extraction with NLP

 Better precision and recall

 Summarization  Question Answering  Cross Lingual Search (very relevant for India)  Intelligent interfaces (to Robots, Databases)  Combined image and text based search

 Automatic Humour analysis and

generation

 Last but not the least, window into

human mind; language and brain

slide-12
SLIDE 12
slide-13
SLIDE 13

Roles of Broca’s and Wernicke’s areas

Broadly, Broca’s area is concerned with Grammar while Wernick’s area is concerned with semantics

Damage to former interferes with grammar, e.g. role confusion with voice change: “Ram was seen by Shyam” interpreted as Ram is the seer

Damage to Wernick’s area: finds it difficult to put a name to an entity (which is a tough categorization task)

Evidence of difference between humans and apes in the complexity of language processing: Frontal lobe heavily used in humans ("The brain differentiates human and non-human grammars: Functional localization and structural connectivity" (Volume 103, Number 7, Pages 2458-2463, February 14, 2006)).

slide-14
SLIDE 14

MT is needed: Internet Accessibility Pattern

User Type (script) % of World Population % access to the Internet Latin 39 84 Kanzi (CJK) 22 13 Arabic 9 1.2 Brahmi and Indic 22 0.3

slide-15
SLIDE 15

Number of Potential users of Internet

50 100 150 200 250 300 350 400 450 English Japanese Chinese French Spanish German Hindi Indian Languages Languages Population in million Series1 Series2 No of Internet Users in the year 2001 No of Internet Users in the year 2010 (Projected)

slide-16
SLIDE 16

Living Languages

Continent No of languages Africa 2092 Americas 1002 Asia 2269 Europe 239 Pacific 1310 Total 6912

slide-17
SLIDE 17

Stages and Challenges of NLP

slide-18
SLIDE 18

NLP is concerned with Grounding

Ground the language into perceptual, motor and cognitive capacities.

slide-19
SLIDE 19

Grounding

Chair Computer

slide-20
SLIDE 20

Grounding faces 3 challenges

 Ambiguity.  Co-reference resolution (anaphora is a

kind of it).

 Elipsis.

slide-21
SLIDE 21

Ambiguity

Chair

slide-22
SLIDE 22

Co-reference Resolution

Sequence of commands to the robot: Place the wrench on the table. Then paint it. What does it refer to?

slide-23
SLIDE 23

Elipsis

Sequence of command to the Robot: Move the table to the corner. Also the chair. Second command needs completing by using the first part of the previous command.

slide-24
SLIDE 24

Stages of processing (traditional view)

 Phonetics and phonology  Morphology  Lexical Analysis  Syntactic Analysis  Semantic Analysis  Pragmatics  Discourse

slide-25
SLIDE 25

Phonetics

Processing of speech

Challenges

 Homophones: bank (finance) vs. bank (river

bank)

 Near Homophones: maatraa vs. maatra (hin)  Word Boundary

 aajaayenge (aa jaayenge (will come) or aaj aayenge (will

come today)

 I got [ua]plate

 Phrase boundary

 Milind Sohoni’s mail announcing this seminar: mtech1

students are especially exhorted to attend as such seminars are integral to one's post-graduate education

 Disfluency: ah, um, ahem etc.

slide-26
SLIDE 26

Morphology

Word formation rules from root words

Nouns: Plural (boy-boys); Gender marking (czar-czarina)

Verbs: Tense (stretch-stretched); Aspect (e.g. perfective sit-had sat); Modality (e.g. request khaanaa khaaiie)

First crucial first step in NLP

Languages rich in morphology: e.g., Dravidian, Hungarian, Turkish

Languages poor in morphology: Chinese, English

Languages with rich morphology have the advantage of easier processing at higher stages of processing

A task of interest to computer science: Finite State Machines for Word Morphology

slide-27
SLIDE 27

Lexical Analysis

Essentially refers to dictionary access and obtaining the properties of the word e.g. dog noun (lexical property) take-’s’-in-plural (morph property) animate (semantic property) 4-legged (-do-) carnivore (-do) Challenge: Lexical or word sense disambiguation

slide-28
SLIDE 28

Lexical Disambiguation

First step: part of Speech Disambiguation

 Dog as a noun (animal)  Dog as a verb (to pursue)

Sense Disambiguation

 Dog (as animal)  Dog (as a very detestable person)

Needs word relationships in a context

 The chair emphasised the need for adult education

Very common in day to day communications and can occur in the form of single or multiword expressions e.g., Ground breaking ceremony (Prof. Ranade’s email to faculty 14/9/07)

slide-29
SLIDE 29

Technological developments bring in new terms, additional meanings/nuances for existing terms

 Justify as in justify the right margin (word

processing context)

 Xeroxed: a new verb  Digital Trace: a new expression  Communifaking: pretending to talk on

mobile when you are actually not

 Discomgooglation: anxiety/discomfort at

not being able to access internet

 Helicopter Parenting: over parenting

slide-30
SLIDE 30

Syntax

Structure Detection

S NP VP V NP I like mangoes

slide-31
SLIDE 31

Parsing Strategy

 Driven by grammar

 S-> NP VP  NP-> N | PRON  VP-> V NP | V PP  N-> Mangoes  PRON-> I  V-> like

slide-32
SLIDE 32

Challenges: Structural Ambiguity

Scope

 The old men and women were taken to safe locations

(old men and women) vs. ((old men) and women) Seen in Amman airport: No smoking areas will allow Hookas inside

Preposition Phrase Attachment

 I saw the boy with a telescope

(who has the telescope?)

 I saw the mountain with a telescope

(world knowledge: mountain cannot be an instrument of seeing)

 I saw the boy with the pony-tail

(world knowledge: pony-tail cannot be an instrument of seeing) Very ubiquitous: today’s newspaper headline “20 years later, BMC pays father 20 lakhs for causing son’s death”

slide-33
SLIDE 33

Structural Ambiguity…

 Overheard

 I did not know my PDA had a phone for 3

months

 An actual sentence in the newspaper

 The camera man shot the man with the

gun when he was near Tendulkar

slide-34
SLIDE 34

Headache for parsing: Garden Path sentences

 Consider

 The horse raced past the garden (sentence

complete)

 The old man (phrase complete)  Twin Bomb Strike in Baghdad (news paper

heading: complete)

slide-35
SLIDE 35

Headache for Parsing

 Garden Pathing

 The horse raced past the garden fell  The old man the boat  Twin Bomb Strike in Baghdad kill 25

(Times of India 5/9/07)

slide-36
SLIDE 36

Semantic Analysis

 Representation in terms of

 Predicate calculus/Semantic

Nets/Frames/Conceptual Dependencies and Scripts

 John gave a book to Mary

 Give action: Agent: John, Object: Book,

Recipient: Mary

 Challenge: ambiguity in semantic role labeling

 (Eng) Visiting aunts can be a nuisance  (Hin) aapko mujhe mithaai khilaanii padegii

(ambiguous in Marathi and Bengali too; not in Dravidian languages)

slide-37
SLIDE 37

Pragmatics

 Very hard problem  Model user intention

 Tourist (in a hurry, checking out of the hotel,

motioning to the service boy): Boy, go upstairs and see if my sandals are under the divan. Do not be late. I just have 15 minutes to catch the train.

 Boy (running upstairs and coming back panting):

yes sir, they are there.

 World knowledge

 WHY INDIA NEEDS A SECOND OCTOBER (ToI,

2/10/07, yesterday)

slide-38
SLIDE 38

Discourse

Processing of sequence of sentences Mother to John: John go to school. It is open today. Should you bunk? Father will be very angry. Ambiguity of open bunk what? Why will the father be angry? Complex chain of reasoning and application of world knowledge (father will not be angry if somebody else’s son bunks the school) Ambiguity of father father as parent

  • r

father as headmaster

slide-39
SLIDE 39

Complexity of Connected Text

John was returning from school dejected – today was the math test He couldn’t control the class Teacher shouldn’t have made him responsible After all he is just a janitor

slide-40
SLIDE 40

ML-NLP

slide-41
SLIDE 41

NLP as an ML task

 France beat Brazil by 1 goal to 0 in the

quarter-final of the world cup football

  • tournament. (English)

 braazil ne phraans ko vishwa kap

phutbal spardhaa ke kwaartaar phaainal me 1-0 gol ke baraabarii se haraayaa. (Hindi)

slide-42
SLIDE 42

Categories of the Words in the Sentence

France beat Brazil by 1 goal to 0 in the quarter final of the world cup football tournament by to in the

  • f

Brazil beat France 1 goal quarter final world cup Football tournament content words function words

slide-43
SLIDE 43

Further Classification 1/2

Brazil beat France 1 goal quarter final world cup football tournament Brazil France 1 goal quarter final world cup football tournament beat Brazil France 1 goal quarter final world cup Football tournament noun verb proper noun common noun

slide-44
SLIDE 44

Further Classification 2/2

by to In the

  • f

the by to in

  • f

determiner preposition

slide-45
SLIDE 45

Why all this?

 Fundamental and ubiquitous

information need

 who did what  to whom  by what  when  where  in what manner

slide-46
SLIDE 46

Semantic roles

beat France Brazil world cup football quarter finals 1 goal to 0 agent patient/theme manner time modifier

slide-47
SLIDE 47

Semantic Role Labeling: a classification task

 France beat Brazil by 1 goal to 0 in the

quarter-final of the world cup football tournament

 Brazil: agent or object?  Agent: Brazil or France or Quarter Final or

World Cup?

 Given an entity, what role does it play?  Given a role, it is played by which

entity?

slide-48
SLIDE 48

A lower level of classification: Part of Speech (POS) Tag Labeling

 France beat Brazil by 1 goal to 0 in the

quarter-final of the world cup football tournament

 beat: verb of noun (heart beat, e.g.)?  Final: noun or adjective?

slide-49
SLIDE 49

Uncertainty in classification: Ambiguity

 Visiting aunts can be a nuisance

 Visiting:

 adjective or gerund (POS tag ambiguity)

 Role of aunt:

 agent of visit (aunts are visitors)  object of visit (aunts are being visited)

 Minimize uncertainty of classification

with cues from the sentence

slide-50
SLIDE 50

What cues?

Position with respect to the verb:

 France to the left of beat and Brazil to the right: agent-

  • bject role marking (English)

Case marking:

 France ne (Hindi); ne (Marathi): agent role  Brazil ko (Hindi); laa (Marathi): object role

Morphology: haraayaa (hindi); haravlaa (Marathi):

 verb POS tag as indicated by the distinctive suffixes

slide-51
SLIDE 51

Cues are like attribute-value pairs prompting machine learning from NL data

Constituent ML tasks

 Goal: classification or clustering  Features/attributes (word position, morphology, word label etc.)  Values of features  Training data (corpus: annotated or un-annotated)  Test data (test corpus)  Accuracy of decision (precision, recall, F-value, MAP etc.)  Test of significance (sample space to generality)

slide-52
SLIDE 52

What is the output of an ML-NLP System

(1/2)

Option 1: A set of rules, e.g.,

 If the word to the left of the verb is a noun and has animacy

feature, then it is the likely agent of the action denoted by the verb.

 The child broke the toy (child is the agent)  The window broke (window is not the agent; inanimate)

slide-53
SLIDE 53

What is the output of an ML-NLP System

(2/2)

Option 2: a set of probability values

 P(agent|word is to the left of verb and has animacy) >

P(object|word is to the left of verb and has animacy)> P(instrument|word is to the left of verb and has animacy) etc.

slide-54
SLIDE 54

How is this different from classical NLP

 The burden is on the data as opposed

to the human.

corpus Text data Linguist Computer rules rules/probabilities Classical NLP Statistical NLP

slide-55
SLIDE 55

Classification appears as sequence labeling

slide-56
SLIDE 56

A set of Sequence Labeling Tasks: smaller to larger units

 Words:

 Part of Speech tagging  Named Entity tagging  Sense marking

 Phrases: Chunking  Sentences: Parsing  Paragraphs: Co-reference annotating

slide-57
SLIDE 57

Example of word labeling: POS Tagging

<s> Come September, and the IIT campus is abuzz with new and returning students. </s> <s> Come_VB September_NNP ,_, and_CC the_DT IIT_NNP campus_NN is_VBZ abuzz_JJ with_IN new_JJ and_CC returning_VBG students_NNS ._. </s>

slide-58
SLIDE 58

Example of word labeling: Named Entity Tagging

<month_name> September </month_name> <org_name> IIT </org_name>

slide-59
SLIDE 59

Example of word labeling: Sense Marking

Word Synset WN-synset-no come {arrive, get, come} 01947900 . . . abuzz {abuzz, buzzing, droning} 01859419

slide-60
SLIDE 60

Example of phrase labeling: Chunking

Come July, and is abuzz with .

the IIT campus new and returning students

slide-61
SLIDE 61

Example of Sentence labeling: Parsing

[S1[S[S[VP[VBCome][NP[NNPJuly]]]] [,,] [CC and] [S [NP [DT the] [JJ UJF] [NN campus]] [VP [AUX is] [ADJP [JJ abuzz] [PP[IN with] [NP[ADJP [JJ new] [CC and] [ VBG returning]] [NNS students]]]]]] [..]]]

slide-62
SLIDE 62

Parsing of Sentences

slide-63
SLIDE 63

Are sentences flat linear structures? Why tree?

 Is there a principle in branching  When should the constituent give rise

to children?

 What is the hierarchy building principle?

slide-64
SLIDE 64

Structure Dependency: A Case Study

  • Interrogative Inversion

(1) John will solve the problem. Will John solve the problem? Declarative Interrogative (2) a. Susan must leave. Must Susan leave?

  • b. Harry can swim.

Can Harry swim?

  • c. Mary has read the book. Has Mary read the book?

d.

Bill is sleeping. Is Bill sleeping?

……………………………………………………….

The section, “Structure dependency a case study” here is adopted from a talk given by Howard Lasnik (2003) in Delhi university.

slide-65
SLIDE 65

Interrogative inversion Structure Independent (1st attempt)

(3)Interrogative inversion process Beginning with a declarative, invert the first and second words to construct an interrogative. Declarative Interrogative (4) a. The woman must leave. *Woman the must leave?

  • b. A sailor can swim.

*Sailor a can swim?

  • c. No boy has read the book.

*Boy no has read the book?

  • d. My friend is sleeping.

*Friend my is sleeping?

slide-66
SLIDE 66

Interrogative inversion correct pairings

Compare the incorrect pairings in (4) with the correct pairings in (5):

Declarative Interrogative

(5) a. The woman must leave. Must the woman leave?

  • b. A sailor can swim.

Can a sailor swim?

  • c. No boy has read the book. Has no boy read the book?
  • d. My friend is sleeping.

Is my friend sleeping?

slide-67
SLIDE 67

Interrogative inversion Structure Independent (2nd attempt)

(6) Interrogative inversion process:

 Beginning with a declarative, move the auxiliary

verb to the front to construct an interrogative.

Declarative Interrogative (7) a. Bill could be sleeping. *Be Bill could sleeping? Could Bill be sleeping?

  • b. Mary has been reading.

*Been Mary has reading? Has Mary been reading?

  • c. Susan should have left.

*Have Susan should left? Should Susan have left?

slide-68
SLIDE 68

Structure independent (3rd attempt):

(8) Interrogative inversion process 

Beginning with a declarative, move the first auxiliary verb to the front to construct an interrogative.

Declarative Interrogative

(9) a. The man who is here can swim. *Is the man who here can swim?

  • b. The boy who will play has left.

*Will the boy who play has left?

slide-69
SLIDE 69

Structure Dependent Correct Pairings

 For

the above examples, fronting the second auxiliary verb gives the correct form:

Declarative Interrogative (10) a.The man who is here can swim. Can the man who is here swim?

b.The boy who will play has left. Has the boy who will play left?

slide-70
SLIDE 70

Natural transformations are structure dependent

(11) Does the child acquiring English learn these properties?

(12) We are not dealing with a peculiarity of English. No known human language has a transformational process that would produce pairings like those in (4), (7) and (9), repeated below:

(4) a. The woman must leave. *Woman the must leave? (7) a. Bill could be sleeping. *Be Bill could sleeping?

(9) a. The man who is here can swim. *Is the man who here can swim?

slide-71
SLIDE 71

Deeper trees needed for capturing sentence structure

NP PP AP big The

  • f poems

with the blue cover [The big book of poems with the Blue cover] is on the table. book This wont do! Flat structure! PP

slide-72
SLIDE 72

Other languages

NP PP AP big The

  • f poems

with the blue cover [niil jilda vaalii kavita kii kitaab] book English NP PP AP niil jilda vaalii kavita kii kitaab PP badii Hindi PP

slide-73
SLIDE 73

Other languages: contd

NP PP AP big The

  • f poems

with the blue cover [niil malaat deovaa kavitar bai ti] book English NP PP AP niil malaat deovaa kavitar bai PP motaa Bengali PP ti

slide-74
SLIDE 74

PPs are at the same level: flat with respect to the head word “book”

NP PP AP big The

  • f poems

with the blue cover [The big book of poems with the Blue cover] is on the table. book No distinction in terms of dominance or c-command PP

slide-75
SLIDE 75

“Constituency test of Replacement” runs into problems

 One-replacement:

 I bought the big [book of poems with the

blue cover] not the small [one]

 One-replacement targets book of poems

with the blue cover

 Another one-replacement:

 I bought the big [book of poems] with the

blue cover not the small [one] with the red cover

 One-replacement targets book of poems

slide-76
SLIDE 76

More deeply embedded structure

NP PP AP big The

  • f poems

with the blue cover N’1 N book PP N’2 N’3

slide-77
SLIDE 77

To target N1’

 I want [NPthis [N’big book of poems with

the red cover] and not [Nthat [None]]

slide-78
SLIDE 78

Bar-level projections

 Add intermediate structures

 NP (D) N’  N’ (AP) N’ | N’ (PP) | N (PP)

 () indicates optionality

slide-79
SLIDE 79

New rules produce this tree

NP PP AP big The

  • f poems

with the blue cover N’1 N book PP N’2 N’3 N-bar

slide-80
SLIDE 80

As opposed to this tree

NP PP AP big The

  • f poems

with the blue cover book PP

slide-81
SLIDE 81

V-bar

 What is the element in verbs

corresponding to one-replacement for nouns

 do-so or did-so

slide-82
SLIDE 82

As opposed to this tree

NP PP AP big The

  • f poems

with the blue cover book PP

slide-83
SLIDE 83

I [eat beans with a fork]

VP NP beans eat with a fork PP No constituent that groups together V and NP and excludes PP

slide-84
SLIDE 84

Need for intermediate constituents

 I [eat beans] with a fork but Ram [does

so] with a spoon

V2’ NP beans eat with a fork PP VP V1’ V VPV’ V’ V’ (PP) V’ V (NP)

slide-85
SLIDE 85

How to target V1’

 I [eat beans with a fork], and Ram

[does so] too.

V2’ NP beans eat with a fork PP VP V1’ V VPV’ V’ V’ (PP) V’ V (NP)

slide-86
SLIDE 86

Parsing Algorithms

slide-87
SLIDE 87

A simplified grammar

 S  NP VP

 NP  DT N | N  VP  V ADV | V

slide-88
SLIDE 88

A segment of English Grammar

 S’(C) S  S{NP/S’} VP  VP(AP+) (VAUX) V (AP+)

({NP/S’}) (AP+) (PP+) (AP+)

 NP(D) (AP+) N (PP+)  PPP NP  AP(AP) A

slide-89
SLIDE 89

Example Sentence

People laugh

1

2 3 Lexicon: People - N, V Laugh - N, V

These are positions This indicate that both Noun and Verb is possible for the word “People”

slide-90
SLIDE 90

Top-Down Parsing

State Backup State Action

  • 1.

((S) 1) -

  • 2. ((NP VP)1) -
  • 3a. ((DT N VP)1) ((N VP) 1) -
  • 3b. ((N VP)1) -
  • 4. ((VP)2) -

Consume “People”

  • 5a. ((V ADV)2) ((V)2) -
  • 6. ((ADV)3) ((V)2) Consume “laugh”
  • 5b. ((V)2) -
  • 6. ((.)3) -

Consume “laugh” Termination Condition : All inputs over. No symbols remaining. Note: Input symbols can be pushed back.

Position of input pointer

slide-91
SLIDE 91

Discussion for Top-Down Parsing

 This kind of searching is goal driven.  Gives importance to textual precedence (rule

precedence).

 No regard for data, a priori (useless expansions

made).

slide-92
SLIDE 92

Bottom-Up Parsing

Some conventions: N12 S1? -> NP12 ° VP2?

Represents positions End position unknown Work on the LHS done, while the work on RHS remaining

slide-93
SLIDE 93

Bottom-Up Parsing (pictorial representation)

S -> NP12 VP23 °

People Laugh 1 2 3

N12 N23 V12 V23 NP12 -> N12 ° NP23 -> N23 ° VP12 -> V12 ° VP23 -> V23 ° S1? -> NP12 ° VP2?

slide-94
SLIDE 94

Problem with Top-Down Parsing

  • Left Recursion
  • Suppose you have A-> AB rule.

Then we will have the expansion as follows:

  • ((A)K) -> ((AB)K) -> ((ABB)K) ……..
slide-95
SLIDE 95

Combining top-down and bottom-up strategies

slide-96
SLIDE 96

Top-Down Bottom-Up Chart Parsing

 Combines advantages of top-down & bottom-

up parsing.

 Does not work in case of left recursion.

 e.g. – “People laugh”

 People – noun, verb  Laugh – noun, verb

 Grammar –

S  NP VP

NP  DT N | N VP  V ADV | V

slide-97
SLIDE 97

Transitive Closure

People laugh 1 2 3

S NP VP NP N VP  V  NP DT N S  NPVP S  NP VP  NP N VP V ADV success VP V

slide-98
SLIDE 98

Arcs in Parsing

 Each arc represents a chart which

records

 Completed work (left of )  Expected work (right of )

slide-99
SLIDE 99

Example

People laugh loudly 1 2 3 4

S  NP VP NP  N VP  V VP  V ADV NP  DT N S  NPVP VP  VADV S  NP VP NP  N VP  V ADV S  NP VP VP  V

slide-100
SLIDE 100

 Advantage of Combination of Bottom Up & Top Down

parsing over either of top down / bottom down

 In top down bottom up parsing

  • 1. Like top down parsing productions are brought, but

inline top down parsing rules are not necessarily expanded

  • 2. Unlike bottom up parsing uncontrolled lexical options

(parts of speech) are not even considered.

slide-101
SLIDE 101

Dealing With Structural Ambiguity

 Multiple parses for a sentence

 The man saw the boy with a telescope.  The man saw the mountain with a

telescope.

 The man saw the boy with the ponytail.

At the level of syntax, all these sentences are ambiguous. But semantics can disambiguate 2nd & 3rd sentence.

slide-102
SLIDE 102

Prepositional Phrase (PP) Attachment Problem

V – NP1 – P – NP2 (Here P means preposition) NP2 attaches to NP1 ?

  • r NP2 attaches to V ?
slide-103
SLIDE 103

Parse Trees for a Structurally Ambiguous Sentence

Let the grammar be – S  NP VP NP  DT N | DT N PP PP  P NP VP  V NP PP | V NP For the sentence, “I saw a boy with a telescope”

slide-104
SLIDE 104

Parse Tree - 1

S NP VP N V NP Det N PP P NP Det N

I saw a boy with a telescope

slide-105
SLIDE 105

Parse Tree -2

S NP VP N V NP Det N PP P NP Det N

I saw a boy with a telescope