Ask(K B.S(r)) Now it's easy to augment the nes Ambiguity e many problems for NLP Real language (Can add extra arguments to retum the parse structure,semantics) NP(Append(s.who"] Logical grammars contd. Squad helps dog bite victim Ambiguity Ambiguity AmbiguityLogical grammars contd. Now it’s easy to augment the rules NP(s1) ∧ EatsBreakfast(Ref(s1)) ∧ V P(s2) ⇒ NP(Append(s1, [“who”], s2)) NP(s1) ∧ Number(s1, n) ∧ V P(s2) ∧ Number(s2, n) ⇒ S(Append(s1, s2)) Parsing is reduced to logical inference: Ask(KB, S([“I” “am” “a” “wumpus”])) (Can add extra arguments to return the parse structure, semantics) Generation simply requires a query with uninstantiated variables: Ask K( B, S(x)) If we add arguments to nonterminals to construct sentence semantics, NLP generation can be done from a given logical sentence: Ask(KB, S(x, At(Robot, [1, 1])) Chapter 22 25 Real language Real human languages provide many problems for NLP: ♦ ambiguity ♦ anaphora ♦ indexicality ♦ vagueness ♦ discourse structure ♦ metonymy ♦ metaphor ♦ noncompositionality Chapter 22 26 Ambiguity Squad helps dog bite victim Chapter 22 27 Ambiguity Squad helps dog bite victim Helicopter powered by human flies Chapter 22 28 Ambiguity Squad helps dog bite victim Helicopter powered by human flies American pushes bottle up Germans Chapter 22 29 Ambiguity Squad helps dog bite victim Helicopter powered by human flies American pushes bottle up Germans I ate spaghetti with meatballs Chapter 22 30