AlphaGo | Google DeepMindと人類の戦いが最高潮なのにかこつけて、人工知能ネタを紹介します。
EmacsにELIZA(イライザ)と呼ばれる、簡素な対話プログラムが入っているのはご存知でしょうか? ELIZAはJoseph Weizenbaumによって1964から1966年に書かれたプログラムで、人間の入力した言葉に対して、サイコセラピストであるかのような返答を返すというプログラムです。Emacs版の実装を試すには、M-x doctor
とします。すると
I am the psychotherapist. Please, describe your problems. Each time you are finished talking, type RET twice.
と、問診が始まります。「頭痛がする」と返してみましょう。
(私) I have a headache. (ELIZA) Maybe you should consult a medical doctor; I am a psychotherapist. .
医者にかかれと怒られてしまいました。では、今度は「気持ちが落ち込んでいる」と返してみます。
(私) I am depressed. (ELIZA) Are you depressed often?
会話を続けてみます。
(私) Yes. (ELIZA) I see... Well, why do you say this is so? (私) I have a lot of work. (ELIZA) What makes you believe you have a lot of work?
この辺で早くも限界を感じますが、続けてみます。
(私) I have to overwork every day. (ELIZA) Earlier you said you felt depressed? (私) Yes. (ELIZA) Yes, hmmm... so, are you sure that this is so? (私) Yes. (ELIZA) I understand. So do you really think this is so? (私) Yes. (ELIZA) Oh. ...And what makes you think this is so?
堂々巡りになり埒が明きません。目先を変えて、「死にたい」と伝えてみます。
(私) I want to die (ELIZA) This is not a healthy way of thinking.
さらに直球で自殺をほのめかすと
(私) I wanna commit suicide. (ELIZA) If you are really suicidal, you might want to contact the Samaritans via E-mail: jo@samaritans.org or, at your option, anonymous E-mail: samaritans@anon.twwells.com . Or find a Befrienders crisis center at http://www.befrienders.org/ . I would appreciate it if you would continue.
こころの相談室的なところを紹介されてしまいました。急にマジレスされて驚きました。
ソースコードらしきものがEmacs Doctorにあります。これを見るとELIZAが反応しそうな単語が分かります。
最後に、さよならの挨拶をしてみましょう。
(私) Bye! (ELIZA) My secretary will send you a bill.