24
Introduction to Introduction to Computational Computational Linguistics Linguistics Dr. Radhika Mamidi Dr. Radhika Mamidi ENG 270 ENG 270 Lecture 3

Introduction to Computational Linguistics Dr. Radhika Mamidi ENG 270 Lecture 3

Embed Size (px)

Citation preview

Introduction to Introduction to Computational Computational

LinguisticsLinguistics

Dr. Radhika MamidiDr. Radhika Mamidi

ENG 270ENG 270

Lecture 3

Semantic AnalysisSemantic Analysis

• Meaning Representation in LexiconMeaning Representation in Lexicon• Semantic FeaturesSemantic Features• Case FramesCase Frames

• Ambiguity ResolutionAmbiguity Resolution• Selectional RestrictionsSelectional Restrictions• Semantic FilteringSemantic Filtering

We are using a different representation for We are using a different representation for semantics –semantics –

from a computational perspective!from a computational perspective!

Defining words using:

Semantic Features: A semantic feature is a notational method which can be used to express the existence or non-existence of semantic properties by using plus and minus signs.

(+physical object)(+animal)(+human)(-male)

These features help in permitted and non permitted combination of words. Eg: happy pencil, table eats, green ideas will not be permitted.

Defining words using semantic features:

Man is [+HUMAN], [+MALE], [+ADULT]Woman is [+HUMAN], [-MALE], [+ADULT]Boy is [+HUMAN], [+MALE], [-ADULT]Girl is [+HUMAN], [-MALE], [-ADULT]

Defining words using:

Case FramesDefining words in terms of sentence contextsFormulated as case frames stating the cases for verbs Object Object

>------------’collide’----------------<

Agent Object >----------------’strike’------------------<

InstrumentRepresentation of case frames using predicate calculus

Verb is specified as predicate and the cases as its arguments

collide (Object1, Object2)strike (Agent, Object, Instrument)

Ambiguity Resolution

Selectional RestrictionsWord sense hierarchy based on subset relation helps in disambiguation. This relation allows restrictions in terms of broad classes of objects.Eg: The dishwasher read the article Dishwasher can be a ‘person’ or a ‘machine’

Article can be a ‘text’ or an ‘object’Constraints: for ‘read’- agent must be a person, theme must be text object

Allows now: boy, man, woman etc for agent and book, paper, journal etc for theme

So ‘dishwasher’ is a person and ‘article’ is a text.

Semantic FilteringEg: I wrote a letter to my aunt from London.

I saw the boy with a telescope.

PP (Prepositional Phrase) attachment ambiguity

Intuition for right reading is captured

Pragmatic AnalysisPragmatic Analysis

• Grice’s Conversational ImplicaturesGrice’s Conversational Implicatures• Speech Act TheorySpeech Act Theory• Austin’s Felicity ConditionsAustin’s Felicity Conditions

Think if it is easy to make the computers Think if it is easy to make the computers understand the pragmatics of language!understand the pragmatics of language!

Grice’s theory of Grice’s theory of implicaturesimplicatures

• Proposed by H.P.Grice (1975) Proposed by H.P.Grice (1975) • A theory of how people use the language.A theory of how people use the language.• Guidelines for effective & efficient use of Guidelines for effective & efficient use of

language in conversation.language in conversation.• Four Gricean MaximsFour Gricean Maxims

– Quality, Quantity, Relevance and MannerQuality, Quantity, Relevance and Manner– Together describe the general principle of Together describe the general principle of

co-operative interaction:co-operative interaction: “...make your contribution such as is “...make your contribution such as is required, at the stage at which it occurs, by required, at the stage at which it occurs, by the accepted purpose or direction of the the accepted purpose or direction of the talk exchange in which you are engaged.”talk exchange in which you are engaged.”

In short...In short...

... ... in order to converse in a maximally efficient, in order to converse in a maximally efficient, rational, co-operative way, the participants rational, co-operative way, the participants should speak sincerely, relevantly and clearly, should speak sincerely, relevantly and clearly, while providing sufficient information.while providing sufficient information.

Counter-example 1Counter-example 1

A: Is your father at home?A: Is your father at home?

B: Today is Monday.B: Today is Monday.

Counter-example 2Counter-example 2

A: Thanks for calling me for dinnerA: Thanks for calling me for dinner

B: I am very sorry…..B: I am very sorry…..

Speech Act TheorySpeech Act Theory

• Speech ActsSpeech Acts– Locutionary, Illocutionary, Perlocutionary ActsLocutionary, Illocutionary, Perlocutionary Acts– Indirect Speech ActsIndirect Speech Acts

• UtterancesUtterances– Constatives – stating Constatives – stating

Eg: I eat apples.Eg: I eat apples.

[You may not be eating when you utter this [You may not be eating when you utter this sentence]sentence]

– Performatives – performingPerformatives – performing

Eg: I apologise. Eg: I apologise.

[You are actually apologising when you utter this [You are actually apologising when you utter this sentence]sentence]

Speech Acts - illustrationSpeech Acts - illustration

John to his cousin: “I will come to your wedding definitely.”John to his cousin: “I will come to your wedding definitely.”

• Locutionary act: the utterance of a sentence with Locutionary act: the utterance of a sentence with determinate sense and referencedeterminate sense and reference– Reference of ‘I’, ‘your’Reference of ‘I’, ‘your’

• Illocutionary act: the making of a statement, offer, Illocutionary act: the making of a statement, offer, promise, etc. in uttering a sentence, by virtue of the promise, etc. in uttering a sentence, by virtue of the conventional force associated with it ( or with its explicit conventional force associated with it ( or with its explicit performative paraphrase)performative paraphrase)– Austin calls this act as SPEECH ACTAustin calls this act as SPEECH ACT– Here, it is an act of promise.Here, it is an act of promise.

• Perlocutionary act: the bringing about of effects on the Perlocutionary act: the bringing about of effects on the audience by means of uttering the sentence, such effects audience by means of uttering the sentence, such effects being special to the circumstances of utterancesbeing special to the circumstances of utterances– John’s cousin feels happy.John’s cousin feels happy.

Indirect Speech ActsIndirect Speech Acts

• A class of utterances whose syntactic forms do A class of utterances whose syntactic forms do not match their illocutionary force.not match their illocutionary force.

• The implicature arises when the sincerity The implicature arises when the sincerity conditions are not met.conditions are not met.

• Examples:Examples:1. Can you pass the salt? = ‘‘please pass the 1. Can you pass the salt? = ‘‘please pass the

salt’’salt’’2. Will you clean your room today? = ‘‘clean 2. Will you clean your room today? = ‘‘clean

your room today’’your room today’’3. It’s cold in here. = ‘‘can you shut the 3. It’s cold in here. = ‘‘can you shut the

windows’’windows’’4. You are standing on my foot. = ‘‘please move’’4. You are standing on my foot. = ‘‘please move’’

Examples of performative Examples of performative verbsverbs

• I apologiseI apologise• I declare the games openI declare the games open• I hereby christen the ship H.M.S. UlyssesI hereby christen the ship H.M.S. Ulysses• I promise to get you the books tomorrowI promise to get you the books tomorrow• I warn you that parking here is not allowedI warn you that parking here is not allowed• I objectI object• I sentence you to ten years of hard labourI sentence you to ten years of hard labour

Austin’s Felicity Conditions Austin’s Felicity Conditions

Austin (1962) formulated conditions for the Austin (1962) formulated conditions for the performatives to be successful:performatives to be successful:

A. (i) There must be a conventional procedure having A. (i) There must be a conventional procedure having a conventional effecta conventional effect

(ii) The circumstances and persons must be (ii) The circumstances and persons must be appropriate, as specified in the procedure appropriate, as specified in the procedure

B. The procedure must be executed (i) correctly and (ii) B. The procedure must be executed (i) correctly and (ii)

completelycompletely C. Often, (i) the persons must have the requisite C. Often, (i) the persons must have the requisite

thoughts, feelings and intentions, as specified in the thoughts, feelings and intentions, as specified in the procedure, and procedure, and

(ii) if consequent conduct is specified, then the (ii) if consequent conduct is specified, then the relevant parties must so do.relevant parties must so do.

ExamplesExamples

• A marriage ceremony cannot be A marriage ceremony cannot be performed by anyone.performed by anyone.

• Saying ‘sorry’ without actually feeling Saying ‘sorry’ without actually feeling apologetic.apologetic.

• Using a form but with a different Using a form but with a different function.function.

“ “Will you please shut up?”Will you please shut up?”

Form: PoliteForm: Polite

Function: ImpoliteFunction: Impolite

Discourse KnowledgeDiscourse Knowledge

• Co-reference relationsCo-reference relations• Anaphoric formsAnaphoric forms• Local Discourse ContextLocal Discourse Context• Pronouns and CenteringPronouns and Centering• EllipsisEllipsis• Cue PhrasesCue Phrases

Discourse knowledge is essential in building Discourse knowledge is essential in building Human-Computer interactive systems.Human-Computer interactive systems.

Co-reference relationsCo-reference relations

Co-referential forms cannot be Co-referential forms cannot be interpreted semantically in their interpreted semantically in their own right - they refer to something own right - they refer to something else for their interpretation.else for their interpretation.

Exophora: ‘Look at that’. that = Exophora: ‘Look at that’. that =

Endophora:Endophora:

Anaphoric: Look at the Anaphoric: Look at the fishfish. . ItIt is blue.is blue.

Cataphoric: Cataphoric: ItIt is blue, the is blue, the fishfish..

Types of Anaphoric formTypes of Anaphoric form

(a) Repeated form: (a) Repeated form: The Prime MinisterThe Prime Minister met the met the cricketers. cricketers. The Prime MinisterThe Prime Minister wished them good wished them good luck.luck.

(b) Partially repeated form: (b) Partially repeated form: Prof Ruslan MitkovProf Ruslan Mitkov met met the students. the students. Prof. MitkovProf. Mitkov had something nice to say had something nice to say to them.to them.

(c) Lexical Replacement: (c) Lexical Replacement: Mary’s daughterMary’s daughter came first came first again. again. The childThe child is good at studies. is good at studies.

(d) Pronominal form: (d) Pronominal form: ZohaZoha said said sheshe would have to take would have to take Noor to the doctor.Noor to the doctor.

(e) Substituted form: Mary has (e) Substituted form: Mary has a birthday in Maya birthday in May. Sue . Sue has has oneone too. too.

(f) Ellided form: Anne is in London. So is Kate. And (f) Ellided form: Anne is in London. So is Kate. And Linda.Linda.

Local Discourse ContextLocal Discourse Context

• Includes syntactic and semantic structures Includes syntactic and semantic structures of preceding sentences.of preceding sentences.

• Useful for:Useful for:– detecting antecedents of pronounsdetecting antecedents of pronouns– interpreting sentences with VP ellipsisinterpreting sentences with VP ellipsis

• Discourse Entity list is its important aspectDiscourse Entity list is its important aspect– to find likely antecedent of the pronounto find likely antecedent of the pronounEg: John loves this house. It is big. [‘It’ Eg: John loves this house. It is big. [‘It’ John, John,

house]house] John loves this house. He is funny. [‘He’ John loves this house. He is funny. [‘He’

John, house]John, house]

Some examplesSome examples• Ali slapped Sam. He was stunned.Ali slapped Sam. He was stunned.• Ali slapped Sam. He was scolded.Ali slapped Sam. He was scolded.

Expectation MatchingExpectation MatchingAli slapped SamAli slapped Sam

Expectation1: Hurt & Theme: SamExpectation1: Hurt & Theme: Sam

Expectation2: Wrong & Theme: AliExpectation2: Wrong & Theme: Ali

Expectation3: Stunned & Theme: SamExpectation3: Stunned & Theme: Sam

Expectation4: Scolded & Theme: AliExpectation4: Scolded & Theme: Ali

Anaphora based on Anaphora based on History ListsHistory Lists

Given the history list, recency constraint Given the history list, recency constraint helps in resolving pronominal referencehelps in resolving pronominal reference– check for the most recent local context that check for the most recent local context that

matches all the constraints related to the matches all the constraints related to the pronounpronoun

– if no antecedent is in the current local if no antecedent is in the current local context then search at the next most recent context then search at the next most recent local context in the history listlocal context in the history list

Eg: If the baby does not like Eg: If the baby does not like the new toythe new toy, throw , throw itit away. away. If If the babythe baby does not like the new toy, give does not like the new toy, give itit

the the old one.old one.

Pronouns and CenteringPronouns and CenteringEg: Mary went to the shopping mall. She met Sally. She Eg: Mary went to the shopping mall. She met Sally. She

bought some books.bought some books.

Centering Constraints:Centering Constraints:a. If any object in the local context is referred to by a a. If any object in the local context is referred to by a

pronoun in the current sentence, then the center of pronoun in the current sentence, then the center of that sentence must also be pronominalised.that sentence must also be pronominalised.

b. The center must be the most preferred discourse b. The center must be the most preferred discourse entity in the local context that is referred to by a entity in the local context that is referred to by a pronoun.pronoun.

c. Continuing with the same center from one sentence c. Continuing with the same center from one sentence to the next is preferred over changing the center. to the next is preferred over changing the center.

Eg: Mary went to the market. She met Sally. She bought Eg: Mary went to the market. She met Sally. She bought some books. Sally bought some chocolates. She wanted some books. Sally bought some chocolates. She wanted to give them to her brother .to give them to her brother .

EllipsisEllipsis

• Syntactically incomplete sentencesSyntactically incomplete sentences• Parts missing are retrieved from Parts missing are retrieved from

previous major clause.previous major clause.

Example: (Allen: 451)Example: (Allen: 451)Helen saw the movie. Mary did too.Helen saw the movie. Mary did too.

A correspondence between the two subject A correspondence between the two subject forms existforms exist

The subject from first sentence is abstracted and The subject from first sentence is abstracted and applied to the new information to produce the applied to the new information to produce the semantic form of the elliptical clause.semantic form of the elliptical clause.

Cue PhrasesCue Phrases

Two classesTwo classes– identifies semantic relationshipsidentifies semantic relationships between clauses or between clauses or

statesstates used for continuation, reason, contrast, conclusionused for continuation, reason, contrast, conclusion

eg. Jack went to the store. Sam stayed at home.eg. Jack went to the store. Sam stayed at home. (read with ‘and’, ‘because’, ‘but’, ‘so’ inserted in second (read with ‘and’, ‘because’, ‘but’, ‘so’ inserted in second

sentence)sentence)

– indicates discourse structureindicates discourse structure (they indicate segment (they indicate segment boundariesboundaries

used to end the current topic, to end the discourse, start used to end the current topic, to end the discourse, start digressiondigression

eg. OK/fine, Bye/thanks, By the way eg. OK/fine, Bye/thanks, By the way

Exercise 3Exercise 3

• Give the semantic features for the following Give the semantic features for the following nouns: puppy, husband, book, dreamnouns: puppy, husband, book, dream

• Give the case frames for the following verbs:Give the case frames for the following verbs:

sleep, eat, hit, read, seesleep, eat, hit, read, see• Give two examples for indirect speech acts.Give two examples for indirect speech acts.• Explain the speech acts for the utterance “I Explain the speech acts for the utterance “I

am so thirsty”am so thirsty”• Read all the slides!Read all the slides!