Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring

  • Slides: 26
Download presentation
Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006 -Lecture 4 1

Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006 -Lecture 4 1

What’s the plan for today? • • Practice on top-down parsing (on board) Practice

What’s the plan for today? • • Practice on top-down parsing (on board) Practice on bottom-up chart parsing Chomsky’s hierarchy On-line processing of syntactic ambiguity in adults and children (psycholinguistic studies) 2

Review of parsing strategies • Top-down – A top down parser starts with S

Review of parsing strategies • Top-down – A top down parser starts with S and attempts to rewrite it into a sequence of terminal symbols that matches the words in the input sentence • Bottom-up – You take a sequence of symbols and match it to the right hand side of the rule, i. e. start with Det N and match it to get the NP • Bottom-up chart parsing – To avoid unnecessary repetition of the matching process you use a data structure called chart that allows you to record partial results We’ll see examples in J. Allen’s Natural Language Understanding, Chapter 3 3

Exercise • Write the phrase structure rules that are needed to parse the sentences:

Exercise • Write the phrase structure rules that are needed to parse the sentences: – The boy arrived in the morning. – My sister gave me a wonderful gift. – He wrote the letter quickly. – The teacher put the book on the shelf. • Simulate a top-down parse for each of the sentences above. • Simulate a bottom-up chart parse for each of the sentences above. 4

What makes a good grammar? • Generality – The range of sentences covered by

What makes a good grammar? • Generality – The range of sentences covered by the rules • Selectivity – The range of sentences that can be identified as ungrammatical • Understandability – How simple the grammar is 5

Hint for making rules general • Pay attention to constituents • Diagnostic of constituency

Hint for making rules general • Pay attention to constituents • Diagnostic of constituency – Conjunction • Compare – – – I ate a hamburger and a hot dog I will eat the hamburger and throw away the hot dog I ate a hamburger and John ate a hot dog *I ate a hamburger and on the stove *I ate a cold hot dog and well burned *I ate the hot dog 6

How the conjunction test can help • Compare – I looked up John’s number

How the conjunction test can help • Compare – I looked up John’s number – I looked up John’s chimney – *I looked up John’s number and in his cupboards – I looked up John’s chimney and in his cupboards 7

What is generative capacity? • The range of languages that a formalism can describe

What is generative capacity? • The range of languages that a formalism can describe • Formal languages allow a precise (mathematic) characterization • Natural languages CANNOT be characterized precisely enough to define generative capacity 8

Chomsky’s Hierarchy • Containment hierarchy of classes of formal grammars that generate formal languages

Chomsky’s Hierarchy • Containment hierarchy of classes of formal grammars that generate formal languages • Type 0: unrestricted, include all formal grammars – Any string of terminals and non-terminals to any string of terminals and non-terminals • Type 1: context sensitive – A any string of terminals and non-terminals – e. g. , a. Ab a. Cb • Type 2: context free (the theoretical basis for the syntax of most programming languages) – A a, A Ba, A a. Bb – You can count up to elements (any n of a’s followed by any n of b’s, BUT NOT any n of a’s followed by any n of b’s followed by any n of c’s) • Type 3: regular grammars – A a, A a. B – You can’t count 9

Processing ambiguity • How do humans (adults and children) process syntactic ambiguity? 10

Processing ambiguity • How do humans (adults and children) process syntactic ambiguity? 10

Trueswell et al 1999 • “The kindergarten-path effect: Studying on line sentence processing in

Trueswell et al 1999 • “The kindergarten-path effect: Studying on line sentence processing in young children”, in Cognition (1999) 11

The garden-path theory • At points of syntactic ambiguity the syntactically simplest alternative is

The garden-path theory • At points of syntactic ambiguity the syntactically simplest alternative is chosen: e. g. minimal attachment (e. g. , Frazier and Rayner 1982, Ferreira and Clifton 1986) • However, it has been shown that non-syntactic sources of information can mediate garden-path effects (e. g. , Altmann and Steedman 1988, Tanenhaus et al 1995) 12

Referential principle • Example: if two thieves are evoked in the context and then

Referential principle • Example: if two thieves are evoked in the context and then we hear Ann hit the thief with… we prefer the NP-attachment reading (Crain & Steedman 1985) 13

Experiment 1 • Methodology: eye-tracking • Participants: 16 5 -year-old children • Material: –

Experiment 1 • Methodology: eye-tracking • Participants: 16 5 -year-old children • Material: – Put the frog on the napkin in the box (ambiguous between DESTINATION and MODIFIER) – Put the frog that’s on the napkin in the box (unambiguous) 14

Head mounted eye tracker 15

Head mounted eye tracker 15

1 and 2 referent context 16

1 and 2 referent context 16

Unambiguous 17

Unambiguous 17

Analysis • Percentage of trials with eye-fixation to INCORRECT DESTINATION (I. e. the empty

Analysis • Percentage of trials with eye-fixation to INCORRECT DESTINATION (I. e. the empty napkin) 18

19

19

Results • VP-attachment preference for children: 5 -year olds prefer to interpret the ambiguous

Results • VP-attachment preference for children: 5 -year olds prefer to interpret the ambiguous ‘on the napkin’ as destination regardless of referential context • Children are insensitive to the “Referential Principle” • They don’t ‘recover’ from initial interpretation • In the 2 -referent ambiguous condition they picked the Target animal at chance 20

Experiment 2 • Participants: 12 adults • Same material • Same methodology 21

Experiment 2 • Participants: 12 adults • Same material • Same methodology 21

22

22

Results • Adults experienced garden path in the 1 referent ambiguous condition only 23

Results • Adults experienced garden path in the 1 referent ambiguous condition only 23

24

24

Conclusions • Adults and children differ in how they handle temporary syntactic ambiguity –

Conclusions • Adults and children differ in how they handle temporary syntactic ambiguity – Adults resolve ambiguity according to the Referential Principle: modifier in 2 -referent context, destination in 1 -referent context – Children are insensitive to the Referential Principle: They resolve the ambiguity to the VP-attachment interpretation, i. e. , destination 25

Explanation of VP-attachment preference in children • Minimal attachment? • Lexical frequency? 26

Explanation of VP-attachment preference in children • Minimal attachment? • Lexical frequency? 26