CS498JH: Introduction to NLP (Fall 2012)
http://cs.illinois.edu/class/cs498jh
Julia Hockenmaier
juliahmr@illinois.edu 3324 Siebel Center Office Hours: Wednesday, 12:15-1:15pm
Lecture 19: Lexical semantics and Word Senses Julia Hockenmaier - - PowerPoint PPT Presentation
CS498JH: Introduction to NLP (Fall 2012) http://cs.illinois.edu/class/cs498jh Lecture 19: Lexical semantics and Word Senses Julia Hockenmaier juliahmr@illinois.edu 3324 Siebel Center Office Hours: Wednesday, 12:15-1:15pm Key questions
CS498JH: Introduction to NLP (Fall 2012)
http://cs.illinois.edu/class/cs498jh
Julia Hockenmaier
juliahmr@illinois.edu 3324 Siebel Center Office Hours: Wednesday, 12:15-1:15pm
CS498JH: Introduction to NLP
What is the meaning of words?
Most words have many different senses: dog = animal or sausage?
How are the meanings of different words related?
Animal is more general than dog.
money is related to bank
2
CS498JH: Introduction to NLP
What does ‘bank’ mean?
(US banks have raised interest rates)
(the bank on Green Street closes at 5pm)
(In 1927, the bank of the Mississippi flooded)
(I donate blood to a blood bank)
3
CS498JH: Introduction to NLP
4
lemmas senses
CS498JH: Introduction to NLP
Word forms: runs, ran, running; good, better, best
Any, possibly inflected, form of a word
(i.e. what we talked about in morphology)
Lemma (citation/dictionary form): run
A basic word form (e.g. infinitive or singular nominative noun) that is used to represent all forms of the same word.
(i.e. the form you’d search for in a dictionary)
Lexeme: RUN(V), GOOD(A), BANK1(N), BANK2(N)
An abstract representation of a word (and all its forms), with a part-of-speech and a set of related word senses.
(Often just written (or referred to) as the lemma, perhaps in a different FONT)
Lexicon:
A (finite) list of lexemes
5
CS498JH: Introduction to NLP
Polysemy:
A lexeme is polysemous if it has different related senses bank = financial institution or building
Homonyms:
Two lexemes are homonyms if their senses are unrelated, but they happen to have the same spelling and pronunciation bank = (financial) bank or (river) bank
6
CS498JH: Introduction to NLP
Symmetric relations:
Synonyms: couch/sofa
Two lemmas with the same sense
Antonyms: cold/hot, rise/fall, in/out
Two lemmas with the opposite sense
Hierarchical relations:
Hypernyms and hyponyms: pet/dog
The hyponym (dog) is more specific than the hypernym (pet)
Holonyms and meronyms: car/wheel
The meronym (wheel) is a part of the holonym (car)
7
CS498JH: Introduction to NLP
Very large lexical database of English:
110K nouns, 11K verbs, 22K adjectives, 4.5K adverbs (WordNets for many other languages exist or are under construction)
Word senses grouped into synonym sets (“synsets”) linked into a conceptual-semantic hierarchy
81K noun synsets, 13K verb synsets, 19K adj. synsets, 3.5K adv synsets
Conceptual-semantic relations: hypernym/hyponym
also holonym/meronym Also lexical relations, in particular lemmatization
Available at http://wordnet.princeton.edu
8
CS498JH: Introduction to NLP 9
CS498JH: Introduction to NLP
Hypernym/hyponym (between concepts) The more general ‘meal’ is a hypernym of the more specific ‘breakfast’ Instance hypernym/hyponym (between concepts and instances) Austen is an instance hyponym of author Member holonym/meronym (groups and members) professor is a member meronym of (a university’s) faculty Part holonym/meronym (wholes and parts) wheel is a part meronym of (is a part of) car. Substance meronym/holonym (substances and components) flour is a substance meronym of (is made of) bread
10
CS498JH: Introduction to NLP
Hypernym/troponym (between events): travel/fly, walk/stroll Flying is a troponym of traveling: it denotes a specific manner of traveling Entailment (between events): snore/sleep Snoring entails (presupposes) sleeping
11
CS498JH: Introduction to NLP
12
CS498JH: Introduction to NLP
13
CS498JH: Introduction to NLP
14
This plant needs to be watered each day. ⇒ living plant This plant manufactures 1000 widgets each day. ⇒ factory Word Sense Disambiguation (WSD):
Identify the sense of content words (noun, verb, adjective) in context (assuming a fixed inventory of word senses) In WordNet: sense = synset Applications: machine translation, question answering, information retrieval, text classification
CS498JH: Introduction to NLP
15
CS498JH: Introduction to NLP
Evaluation metrics:
we predict/recover correctly?
Baseline accuracy:
WordNet: take the first (=most frequent) sense
Upper bound accuracy:
~75-80% for all words task with WordNet, ~90% for simple binary tasks
wb (door, banana) with a nonsense word wab (banana-door).
16
CS498JH: Introduction to NLP
17
CS498JH: Introduction to NLP
We often don’t have a labeled corpus, but we might have a dictionary/thesaurus that contains glosses and examples: bank1 Gloss: a financial institution that accepts deposits and channels the money into lending activities Examples: “he cashed the check at the bank”, “that bank holds the mortgage on my home” bank2 Gloss: sloping land (especially the slope beside a body of water) Examples: “they pulled the canoe up on the bank”, “he sat on the bank of the river and watched the current”
18
CS498JH: Introduction to NLP
Basic idea: Compare the context with the dictionary definition of the sense.
Assign the dictionary sense whose gloss and examples are most similar to the context in which the word occurs.
Compare the signature of a word in context with the signatures of its senses in the dictionary Assign the sense that is most similar to the context
Signature = set of content words (in examples/gloss or in context) Similarity = size of intersection of context signature and sense signature
19
CS498JH: Introduction to NLP
bank1:
Gloss: a financial institution that accepts deposits and channels the money into lending activities Examples: “he cashed the check at the bank”, “that bank holds the mortgage
Signature(bank1) = {financial, institution, accept, deposit, channel, money, lend, activity, cash, check, hold, mortgage, home}
bank2:
Gloss: sloping land (especially the slope beside a body of water) Examples: “they pulled the canoe up on the bank”, “he sat on the bank of the river and watched the current”
Signature(bank2) = {slope, land, body, water, pull, canoe, sit, river, watch, current}
20
CS498JH: Introduction to NLP
Test sentence: “The bank refused to give me a loan.” Simplified Lesk: Overlap between sense signature and (simple) signature of the target word:
Target signature = words in context: {refuse, give, loan}
Original Lesk: Overlap between sense signature and augmented signature of the target word
Augmented target signature with signatures of words in context {refuse, reject, request,... , give, gift, donate,... loan, money, borrow,...}
21
CS498JH: Introduction to NLP
22
CS498JH: Introduction to NLP
Supervised:
Semi-supervised (bootstrapping) approaches:
(and a lot of raw text)
23
CS498JH: Introduction to NLP
Basic insight: The sense of a word in a context depends on the words in its context. Features:
words) or do we care about the position of words (preceding/ following word)?
lemma (dictionary form)?
24
CS498JH: Introduction to NLP
A decision list is an ordered list of yes-no questions
bass1 = fish vs. bass2 = music:
Learning a decision list for a word with two senses:
25
score(fi) =
⇥P(sense1|fi) P(sense2|fi) ⇤
CS498JH: Introduction to NLP
The task:
Learn a decision list classifier for each ambiguous word (e.g. “plant”: living/factory?) from lots of unlabeled sentences.
Features used by the classifier:
Assumption 1: One-sense-per-collocation
“plant” in “plant life” always refers to living plants
Assumption 2: One-sense-per-discourse
A text talks either about living plants or about factories.
26
CS498JH: Introduction to NLP
into a new labeled data set.
get additional labels
27
CS498JH: Introduction to NLP
28
CS498JH: Introduction to NLP
29
CS498JH: Introduction to NLP
30
CS498JH: Introduction to NLP
31
CS498JH: Introduction to NLP
32
CS498JH: Introduction to NLP
33
CS498JH: Introduction to NLP
Many verbs describe actions (events):
Tom broke the window with a rock. The window broke. The window was broken by Tom/by a rock.
Thematic roles refer to participants of these events:
Agent (who performed the action): Tom Patient/Theme (who was the action performed on): window Tool/Instrument (what was used to perform the action): rock
Diathesis alternation: thematic roles are not tied to a particular grammatical role (subject or object)
Beth Levin’s verb classes: verbs with similar meanings undergo the same alternations.
34
CS498JH: Introduction to NLP
It is difficult to give a formal definition of thematic roles that generalizes across all verbs. Proposition Bank (PropBank):
Arg0 = proto-agent Arg1 = proto-patient Arg2...: specific to each verb ArgM-TMP/LOC/...: temporal/locative/... modifiers
FrameNet:
Verbs fall into classes that define different kinds of frames (change-position-on-a-scale frame: rise, increase,...). Each frame has its own set of frame elements.
35
CS498JH: Introduction to NLP
agree.01 Arg0: Agreer Arg1: Proposition Arg2: Other entity agreeing [Arg0 The group] agreed [Arg1 it wouldn’t make an offer] [Arg0 John] agrees with [Arg2 Mary] fall.01 Arg1: patient/thing falling Arg2: extent/amount fallen Arg3: start point Arg4: end point [Arg1 Sales] fell [Arg4 to $251 million] [Arg1 Junk bonds] fell [Arg2 by 5%]
Semantic role labeling: Recover the semantic roles of verbs (nowadays typically PropBank-style)
Machine learning; trained on PropBank Syntactic parses provide useful information
36
CS498JH: Introduction to NLP
Resources: WordNet, PropBank, FrameNet Word senses:
polysemy, homonymy hypernyms/hyponyms meronyms/holonyms
Semantic roles Readings: Ch. 19.1-4
37