1 2 3 4 1 1 2 1 2.1 : : : : : : : : : : : : : : : : : : : : : : : : 1 2.2 : : : : : : : : : : : : : : : : : : : 1 2.3 : : : : : : : : : : : : : : : : : : : : : : : : : : : 2 2.4 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2 2.4.1 : : : : : : : : : : : : : : : : : 3 2.4.2 : : : : : : : : : : : : : : : : : : : : 3 2.4.3 : : : : : : : : : : : : : : : : : : : : : : : 4 2.5 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5 2.5.1 : : : : : 5 2.6 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 6 3 6 3.1 : : : : : : : : : : : : : : : : : : : : : : 6 3.2 : : : : : : : : : : : : : : : : : : : 6 3.3 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 7 3.4 : : : : : : : : : : : : : : : 8 3.5 : : : : : : : : : : : : : : : : : : : : : : : : 10 3.6 : : : : : : : : : : : : : : : : : : : : : : : : : 12 4 12 5 13 (1995/2/10) (1996/8/9)
1 2 2.1 ( ) 2.2 1
2.3 (morphological analysis) ( ) 2.1 2.1 (morpheme) 2.4 (syntactic analysis parsing) 2.2 2.2 I know the fact. S -- NP -- N ---------- VP -- V ---------- I know NP -- DET -- the N --- fact 2
(sentence, S) (noun phrase, NP) (verb phrase, VP) (verb, V) (noun, N) (determiner, DET) S NP S -> NP VP VP -> V NP NP -> DET N NP -> N 2.4.1 (context-free phrase structure grammar) (context-free language) (finite-state language) (context-sensitive language) (Recursively enumerable set) 2.3 2.3 That that that he is young is false is false is false. 1 2.4.2 2.4 2.4 I have a pen. I have an apple. 2.5 I have an pen. I have a apple. 1 3
DET N a DET1 an DET2 pen N1 apple N2 S -> NP VP VP -> V NP NP-> DET1 N1 NP-> DET2 N2 NP -> N1 NP -> N2 (subcategorization) (feature) 2 initial a, pen vowel an, apple consonant NP->DET N (DET initial) 3 =(N initial) 2.5 / 2.4.3 2.6 I saw a man with a telescope. "with a telescope" "man" "saw" 2 3 DET initial 4
2.5 (semantic analysis) (knowledge representation) (reasoning/inference) (first order predicate logic equation) (give tarohanakoflower) give taro, hanako, flower Frege (principle of compositionality) A B C A B C 2.7 Mary uses Tom's pencil. "Tom's pencil" Tom (own Tom penci l) "uses Tom's pencil" (Tom ) (use?someone pencil) 4 (use Mary pencil), (own Tom pencil) 2.5.1 2.8 Get a screwdriver with your left hand. "with your left hand" "screwdriver" "get" 4 5
2.6 (context) (anaphora) (ellipsis they Mary (illocuitionary act) 3 3.1 [1] 3.2 ( ) (setq rules '((Rule (S -> NP VP) (S cat) = S (VP cat) = VP) (Rule (VP -> V NP) (VP cat) = VP (V cat) = V ) (Rule (NP -> DET N) (DET cat) = DET 6
(DET initial) = (N initial)) (Rule (NP -> N) ))) (setq lexical_rules '((Word (this) (Word (is) (Word (a) (Word (an) ) (cat) = V) (Word (pen) (cat) = DET (initial) = con) (cat) = DET (initial) = vow) (initial) = con) (Word (eraser) (initial) = vow))) X f (X f) initial 3.3 (setq rules '((Rule (S -> N VP) (S cat) = S (VP cat) = VP (S sem) = (VP sem) (S sem arg0) = (N sem)) 7
(Rule (VP -> V NP) (VP cat) = VP (V cat) = V (VP sem predicate) = (V sem) (VP sem arg1) = (NP sem)) (Rule (NP -> DET N) (DET cat) = DET (NP sem) = (N sem)))) (setq lexical_rules '((Word (i) (sem) = i) (Word (love) (cat) = V (Word (the) (Word (man) (sem) = love) (cat) = DET) (sem) = man))) S sem 5 predicate arg0 arg1 arg3 4 (predicate arg0 arg1 arg2 arg3) arg3 3.4 (setq rules 5 C (VP sem arg1) VP.sem.arg1 8
'((Rule (S -> N VP) (S cat) = S (VP cat) = VP (S sem) = (VP sem) (S type) = (VP type) (S sem arg0 ) = (N sem) (S type arg0) = (N type) ) (Rule (VP -> V NP) (VP cat) = VP (V cat) = V (VP sem predicate) = (V sem) (VP type) = (V type) (VP sem arg1) = (NP sem) (VP type arg1) = (NP type) ) (Rule (NP -> DET N) (DET cat) = DET (NP sem) = (N sem) (NP type) = (N type) ))) (setq lexical_rules '((Word (i) (sem) = i (type) = animal ) (Word (eat) (cat) = V (sem) = eat (type arg0) = animal (type arg1) = food ) (Word (repair) (cat) = V (sem) = repair (type arg0) = animal (type arg1) = machine ) (Word (the) 9
(cat) = DET ) (Word (apple) (sem) = apple (type) = food ) (Word (computer) (sem) = computer (type) = machine ))) "eat" (animal) (food) type "I eat the apple." I eat the computer." 3.5 yes-no wh (S sem mode) declarative, yes-no-q, wh-q wh? "What does Mayumi eat?" (eat mayumi?) (setq rules '((Rule (S -> N VP) (S cat) = S (VP cat) = VP (S sem) = (VP sem) (S sem arg0) = (N sem) (S sem mode) = declarative ) (Rule (S -> WP N V) (S cat) = S (WP cat) = WP (V cat) = V 10
(S sem) = (VP sem) (S sem arg0) = (N sem) (S sem arg1) = (WP sem) (S sem mode) = wh-q (S sem predicate) = (V sem) ) (Rule (VP -> V NP) (VP cat) = VP (V cat) = V (VP sem predicate) = (V sem) (VP sem arg1) = (NP sem) ) (Rule (NP -> DET N) (DET cat) = DET (NP sem) = (N sem) ))) (setq lexical_rules '((Word (Mayumi) (sem) = mayumi ) (Word (eats) (cat) = V (sem) = eat ) (Word (eat) (cat) = V (sem) = eat ) (Word (the) (cat) = DET ) (Word (apple) (sem) = apple ) (Word (what does) (cat) = WP (sem) =? ) ))) 11
3.6 Common Lisp Lisp talk dialog.lisp, lisppart.lisp, dagunify.lisp, subst.lisp lisp-init.lisp Lisp % lisp # Lisp < > > (load "dialog.lisp") # > (load < >) # > (talk '(i have a pen)) # I cannot parse your utterance There are xx ambiguities There is no ambiguity mode yes-no yes no wh (debugon) (debugoff) (compile 'talk) (quit) 4 1. 2.4 2. 3. 4. 5. yes/no wh 6. 12
5 1. 2. 3. ( ) 4. 5. [1] Gerald Gazdar and Chris Mellish: Natural Language Processing in Lisp, Addison Wesley (1989). 13