This Chatter Bot belongs more or less to the Eliza family. It tries to match a pattern in your input and produces an anwser from a list of available answer patterns for this input pattern. If there is none it will try to launch the conversation with a few random sentences or it also might look at you and your inventory and say something about you for the same purpose.
ELIZA was one of the first well known AI programs written (around 1966). The author was Weizenbaum who is an outspoken critique of AI. We do not wish to enter Philosophy of AI questions here but just point out that Eliza Bots do not keep track of the conversation which is one required mechanism for a working conversion. Anyhow, to learn more about Eliza Bots you can consult AI programming textbooks and/or play around with some widely available Eliza programs.
Here are pointers to programs you can try:
M-x doctor
Many AI programmer's do build conversation robots. You can even find some programs in MUDs (either connected from the outside or internal). Check out the following resources/pages:
Chatbots.org is a repository of chatbots (virtual assistants, chat bot, conversational agents, virtual agents) in the World). It also includes a large bibliography.
your (.*) problem - is more specific than - your (.*)So patterns like
(.*) is (.*)
should be put at the end
of the list.
hi Hi, how are you? Hello, how's it going? Hi, what's up ?
('seerandoms <bot>')
and random answers to questions ('seequestionresponses <bot>')
Of course you need to test your bot with various people before putting it in operation.
Here we show a few input/ouput patterns together with transcripts from the interaction.
A few example that you will find in each child of Ken's Bot:
This example matches everything between ``I'' and ``you'' as you can see in the interaction traces:
6 I (.*) you You $1 me? Why? Why do you say you $1 me? I really $1 you too.. <grin> >"I love you You say, "I love you" turing bot says, "Why do you say you love me?" >"I very much love you You say, "I very much love you" turing bot [to MooBoy]: I really very much love you too.. <grin>
This example matches any word before ``is'' and everything after it.
``w*
'' matches any chain of of word-constituent characters,
i.e. words composed of letters or digits.
Note that the ``(\\w*)
'' construct remembers the last ``word'' matched.
7 (\\w*) is (.*) Suppose $1 were not $2? What then? What is so $2 about $1? $1? how so? >"Colin is a MOO Master You say, "Colin is a MOO Master" turing bot says, "Colin? how so?" >"Fat Colin is a MOO Master You say, "Fat Colin is a MOO Master" turing bot says, "Suppose Colin were not a MOO Master? What then?"
A few examples in french:
The first example matches everything before and after ``tu es''.
Note that the first match ``.*
'' is not rembered.
3 .* tu es (.*) Keski te fais dire que je suis $1? Peut etre que c'est toi qui es $1! >"Moi je je pense que tu es un peu limite You say, "Moi je je pense que tu es un peu limite" bobo says, "Keski te fais dire que je suis un peu limite?"
This slightly more complex construct matches any string before ``son'' or ``sa'' appears and the first word that follows. Note that this example could be both simplified and improved.
11 (.*) (son|sa) (\\w*) Qu'est-ce que tu sous-entends par $2 $3 ? Est-tu es sur que c'est $2 $3 ? >"J'ai sa soeur You say, "J'ai sa soeur" bobo says, "Est-tu es sur que c'est sa soeur ?" >"ou est sa gentille mere You say, "ou est sa gentille mere" bobo says, "Est-tu sur que c'est sa gentille ?"
Here we have similar construction. We hunt any kind of sentences that start with ``mon .....'' and ``ma ....'' and we remember just the first two words.
4 m(on|a) (\\w*) Qu'en est-il de t$1 $2... t$1 $2 compte beaucoup pour toi ? t$1 $2 est surement a prendre au serieux >"mon velo est naze You say, "mon velo est naze" bobo says, "ton velo compte beaucoup pour toi ?"