Download Ambiguity

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Center for PersonKommunikation
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
P.1
Center for PersonKommunikation
Grammar: Simple Finite State Network
Det
0
Noun
1
Verb
2
Noun
Det
3
4
J
J
the:
Det (definite)
little:
Adj (size)
orange: Adj (colour)
Noun (fruit)
5
J
J
Adj
Adj
Lexicon:
!
ducks:
Noun (animal)
Verb (action)
swallow: Noun (animal)
Verb (action)
flies:
Noun (animal)
Verb (action)
P.2
Center for PersonKommunikation
Grammar: Simple Finite State Network
the
Det
orange
Noun
0
1
Verb
2
!
Noun
Det
3
4
J
J
orange
little
Adj
Lexicon:
the:
Det (definite)
little:
Adj (size)
orange: Adj (colour)
Noun (fruit)
5
J
J
Adj
ducks:
Noun (animal)
Verb (action)
swallow: Noun (animal)
Verb (action)
flies:
Noun (animal)
Verb (action)
P.3
Center for PersonKommunikation
Parsing with Finite State Grammar
“parse tree”
Det
Adj
Adj
Noun
Verb
the
little orange ducks swallow
(definite) size colur animal action
!
Noun
flies
animal
P.4
Center for PersonKommunikation
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 “Constraintgrammars), a preprocessor that resolves many lexical ambiguities. This speeds up syntactic
parsing. POS-tagging is normally based on trainable finite state machines).
P.5
Center for PersonKommunikation
Grammar: Simple Recursive Transition Network
(equivalent to fsn)
NP
!
VP
Equivalent BNF:
S:
Det
Noun
NP:
J
Adj
Verb
NP
VP:
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
J
P.6
Center for PersonKommunikation
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
P.7
Center for PersonKommunikation
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
P.8
Center for PersonKommunikation
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 SubjectPredicate relation
•
•
•
•
I/me/him...
NP->Pron
NP->(Det) Noun (PP)
VP->Verb (NP)
PP-> Prep NP
!
(the/a) man (in England/round the corner/with a hat)
eat (sth.)/see (sth.)
in England/round the corner/with a hat/with a telescope
P.9
Center for PersonKommunikation
Structural Ambiguity 2
Phrase Structure 1.
!
S
NP
VP
NP
PP
NP
Pron
I
Verb
saw
Det
the
Noun
man
Prep
with
Det
a
Noun
telescope
P.10
Center for PersonKommunikation
Structural Ambiguity 3
Phrase Structure 2.
!
S
NP
VP
PP
NP
NP
Pron
I
Verb
saw
Det
the
Noun
man
Prep
with
Det
a
Noun
telescope
P.11
Center for PersonKommunikation
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/
P.12
Center for PersonKommunikation
More about Ambiguity 1.
!
• How do humans resolve ambiguities?
– 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"
P.13
Center for PersonKommunikation
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
P.14
Center for PersonKommunikation
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
P.15
Center for PersonKommunikation
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?
P.16
Center for PersonKommunikation
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
P.17
Related documents