[pandorabots-general] The Learning Curve

Dr. Rich Wallace drwallace at alicebot.org
Mon May 1 13:32:08 PDT 2006


Actually, I think if you want to capture all occurances of multi-word
keyphrases, you need to use the standard 4-category "keyword trick" in
AIML:

<pattern>AUTUMNAL EQUINOX</pattern>
<template>blah blah blah (the definition)</template>

<pattern>_ AUTUMNAL EQUINOX</pattern>
<template><srai>AUTUMNAL EQUINOX</srai></template>

<pattern>_ AUTUMNAL EQUINOX *</pattern>
<template><srai>AUTUMNAL EQUINOX</srai></template>

<pattern>AUTUMNAL EQUINOX *</pattern>
<template><srai>AUTUMNAL EQUINOX</srai></template>

The 1st category handles the key phrase by istelf.  The 2nd when the
phrase appears at the end of a sentence, the 3rd when it is in the middle
of a sentence, and the 4th when it appears at the beginning.  All three
give the same reply thanks to the <srai>.



> Don't you just hate it when you've spent hours, even days working on a
> project only to have an epiphany as you find a new and much better way of
> doing what you wanted to do in the first place.  The question becomes how
> well do I want my bot to perform a given task, in this case "What is it?"
> questions. The answer of course is I want my bot to do the best it can. So
> I
> throw out all the work I've done over the last few days and start over.
>
> But, I don't really start from scratch because I have all the things that
> I've learned and all the suggestions I've gotten to build upon and this
> time
> I will use them all to one degree or another. This seemingly oneside
> dialog
> is a journal of sorts of the journey. The things that worked and the
> things
> that didn't. I realize now I have made things more complicated than they
> needed to be.
>
> It occurred to me as I was driving to dinner just what I needed to do to
> get
> my bot to respond the astronomy type questions. I had already found a much
> better source material than NASA for the responses I wanted my bot to
> give.
> As I looked at the code in my mind, as I was driving, I saw that most
> phrases that were made up of 2 or more words that few would ever use in
> casual conversation. So I broke the code down into 3 groups: single words,
> multi-words, and people. In code it breaks down like this:
> <category>
> <pattern>DEFINE SINGLEWORD</pattern>
> <template>Blah blah blah bot reply here</template>
> </category>
>
> <category>
> <pattern>_ MULTI WORD</pattern>
> <template>Blah blah blah bot reply here</template>
> </category>
>
> <category>
> <pattern>DEFINE PERSONS NAME</pattern>
> <template>Blah blah blah bot reply here</template>
> </category>
>
> Single words and names can be dealt with in a single set of generic
> reduction categories that covers the many ways of asking, "What is it?"
> And
> in the event someone does find a new way to ask the question you just add
> that to your set. The set I have so far is as follows:
> <category>
> <pattern>*</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
>
> <category>
> <pattern>DO YOU KNOW ANYTHING ABOUT *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW ANYTHING ABOUT A *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW ANYTHING ABOUT AN *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW ANYTHING ABOUT THE *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
>
> <category>
> <pattern>DO YOU KNOW WHAT * IS</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW WHAT A * IS</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW WHAT AN * IS</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW WHAT THE * IS</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
>
> <category>
> <pattern>TELL ME ABOUT *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>TELL ME ABOUT A *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>TELL ME ABOUT AN *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>TELL ME ABOUT THE *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
>
> <category>
> <pattern>TELL ME ALL ABOUT *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>TELL ME ALL ABOUT A *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>TELL ME ALL ABOUT AN *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>TELL ME ALL ABOUT THE *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
>
> <category>
> <pattern>TELL ME EVERYTHING ABOUT *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>TELL ME EVERYTHING ABOUT A *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>TELL ME EVERYTHING ABOUT AN *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>TELL ME EVERYTHING ABOUT THE *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
>
> <category>
> <pattern>WHAT IS *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>WHAT IS A *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>WHAT IS AN *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>WHAT IS THE *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>WHAT ARE *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>WHAT ARE THE *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
>
> <category>
> <pattern>WHAT DO YOU KNOW ABOUT *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>WHAT DO YOU KNOW ABOUT A *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>WHAT DO YOU KNOW ABOUT AN *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>WHAT DO YOU KNOW ABOUT THE *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
>
> <category>
> <pattern>Who are *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>Who is *</pattern>
> <template><srai>DEFINE<star/></srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW WHO * IS</pattern>
> <template><srai>DEFINE *</srai></template>
> </category>
>
> I have no doubt that this set will grow over time but it is a nice place
> to
> start.
>
> Phrases or multi-words are much easier to deal with if you have no
> expectations of them being used except at the backend of a question like
> this:
> <category>
> <pattern>_ AUTUMNAL EQUINOX</pattern>
> <template>
> Equinoxes are days in which daytime and nighttime are of equal
> duration. The two yearly equinoxes occur when the Sun crosses the
> celestial equator. The autumnal equinox occurs around September
> 21; the vernal (spring) equinox occurs around March 21.
> </template>
> </category>
> The line symbol ( _ ) will handle most "What is it?" questions including
> "Do
> you know what an AUTUMNAL EQUINOX is?" The "is" at the end is ingored.
>
> People pose a different problem because most of the time they consist of
> multi-words. Initials cause problems DO NOT USE THEM with the name. Use
> the
> full name or just the first and last names. You will need a short series
> of
> reduction categories for each name. I used the following:
> <category>
> <pattern>WHO IS *</pattern>
> <template><srai>DEFINE *</srai></template>
> </category>
> <category>
> <pattern>TELL ME ABOUT *</pattern>
> <template><srai>DEFINE *</srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW WHO * IS</pattern>
> <template><srai>DEFINE *</srai></template>
> </category>
>
> At this point I do not see the need for a larger set than this. I double
> up
> on the set because I use multiple variation as follows:
> <category>
> <pattern>DEFINE ARMSTRONG NEIL</pattern>
> <template>
> Neil Alden Armstrong (1930- ) was the first person to walk on the
> moon. He piloted NASA's Apollo 11 mission, which took off on July
> 16, 1969. Armstrong and Edwin E. (Buzz) Aldrin, Jr., landed on the
> moon on July 20, 1969, in the lunar module (landing in the Mare
> Tranquilitatis), while Michael Collins orbited the moon in the
> command module. Upon his first step on the moon, Armstrong said,
> "One small step for man, one giant leap for mankind." Armstrong
> and Aldrin explored the Moon's surface for about 2 hours. Years
> earlier, in 1966, Armstrong and David R. Scott performed the first
> successful docking of two vehicles in space on the Gemini 8
> mission.
> </template>
> </category>
> <category>
> <pattern>WHO IS NEIL ARMSTRONG</pattern>
> <template><srai>DEFINE ARMSTRONG NEIL</srai></template>
> </category>
> <category>
> <pattern>TELL ME ABOUT NEIL ARMSTRONG</pattern>
> <template><srai>DEFINE ARMSTRONG NEIL</srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW WHO NEIL ARMSTRONG IS</pattern>
> <template><srai>DEFINE ARMSTRONG NEIL</srai></template>
> </category>
> <category>
> <pattern>WHO IS ARMSTRONG</pattern>
> <template><srai>DEFINE ARMSTRONG NEIL</srai></template>
> </category>
> <category>
> <pattern>TELL ME ABOUT ARMSTRONG</pattern>
> <template><srai>DEFINE ARMSTRONG NEIL</srai></template>
> </category>
> <category>
> <pattern>DO YOU KNOW WHO ARMSTRONG IS</pattern>
> <template><srai>DEFINE ARMSTRONG NEIL</srai></template>
> </category>
>
> There is a way to make an any condition response code for names but names
> have a way of dropping in anywhere as part of a sentence. "Did Captain
> Kirk
> push the red button or the yellow button in episode 6?" See what I mean?
> The
> easiest way is to treat them as a regular multi-words or phrases and train
> the bot for the exceptions. Who knows I may find a way to make a generic
> reduction category set that can handle 2 worded multi-word groups. Has
> anyone tried double wildcards <stars>?
>
> In the end I should have a fairly good astronomy dictionary my bot will be
> able to draw on for information.  The nice thing about my bot is that I
> can
> go in and cut out the parts of its brain that clash with the answers I
> want
> my bot to give.
>
> My Test Bot www.pandorabots.com/pandora/talk?botid=cdfa45a47e364514 with
> only the dictionary in its tiny microscopic brain.  I'm only up to C so
> far.
>
> www.shipscomputer.galacticenterprise.com is the actual bot I'm slowly
> constructing.  We do keep pace with our tested codes.
>
> Anybody besides me ever feel just a bit like Frankenstein.
>
>
> _______________________________________________
> This is the pandorabots-general mailing list
> To Post, reply to pandorabots-general at list.pandorabots.com
> Unsubscribe and change preferences at
> http://list.pandorabots.com/mailman/listinfo/pandorabots-general
> Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html
> Learn to read at http://www.literacy.org/
>



More information about the pandorabots-general mailing list