|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Pickup Line PuzzleI've got a puzzle for AIML writers.
Suppose I have a bot that has N pickup lines in an ultimate default category: <pattern>*</pattern> <template> <random> <li>Pickup1</li> <li>Pickup2</li> ... <li>PickupN</li> </random> </template> The desired goal is to make the bot respond with a different, specific answer (not one of the pickup lines) if the bot says any of the pickup lines 3 times in a row: Client: XXX Bot: Pickup1 Client: XXX Bot: Pickup7 Client: XXX Bot: Pickup3 Client: XXX Bot: I'm sorry I wasn't able to help you. Please try calling customer service. Assume the bot has a lot of other AIML content so it is possible to have lots of "normal" conversations without activating the ultimate default category 3 times in a row. Can someone think of a way to make the bot "break out" of the pickup lines after 3 in a row? Or in general, K in a row, where K is any positive integer? _______________________________________________ This is the alicebot-general mailing list Reply to alicebot-general@... Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html Learn to read at http://www.literacy.org/ |
|
|
|
|
|
Re: Pickup Line Puzzle<?xml version="1.0" encoding="UTF-8"?>
<aiml version="1.0"> <category> <pattern>*</pattern> <template> <condition name="maxtries"> <li value="1">Try number <set name="maxtries">2</set><srai>OM pickup</srai></li> <li value="2">Try number <set name="maxtries">3</set><srai>OM pickup</srai></li> <li value="3"><srai>OM Too many tries</srai></li> <li>Try number <set name="MAXTRIES">1</set></li> </condition> </template> </category> <category> <pattern>OM pickup</pattern> <template> <random> <li>Pickup1</li> <li>Pickup2</li> <li>Pickup3</li> </random> </template> </category> <category> <pattern>OM Too many tries</pattern> <template> Too many tries </template> </category> </aiml> --- "Dr. Rich Wallace" <drwallace@...> wrote: > I've got a puzzle for AIML writers. > > Suppose I have a bot that has N pickup lines in an > ultimate default category: > > <pattern>*</pattern> > <template> > <random> > <li>Pickup1</li> > <li>Pickup2</li> > ... > <li>PickupN</li> > </random> > </template> > > The desired goal is to make the bot respond with a > different, specific > answer (not one of the pickup lines) if the bot > says any of the > pickup lines 3 times in a row: > > Client: XXX > Bot: Pickup1 > Client: XXX > Bot: Pickup7 > Client: XXX > Bot: Pickup3 > Client: XXX > Bot: I'm sorry I wasn't able to help you. Please > try calling customer service. > > Assume the bot has a lot of other AIML content so it > is possible to > have lots of "normal" conversations without > activating the ultimate > default category 3 times in a row. > > Can someone think of a way to make the bot "break > out" of the pickup > lines after 3 in a row? Or in general, K in a row, > where K is any > positive integer? > _______________________________________________ > This is the alicebot-general mailing list > Reply to alicebot-general@... > Unsubscribe and change preferences at > > Learn netiquette at > http://www.dtcc.edu/cs/rfc1855.html > Learn to read at http://www.literacy.org/ > _______________________________________________ This is the alicebot-general mailing list Reply to alicebot-general@... Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html Learn to read at http://www.literacy.org/ |
|
|
Re: Pickup Line PuzzleWhat I had in mind was,
Client: xxx Bot: Pickup Line (1st try) Client: xxx Bot: Pickup Line (2nd try) Client: Hello Bot: Hi there! (normal chat restored) Client: xxx Bot: Pickup Line (1st try) Client: xxx Bot: Pickup Line (2nd try) Client: xxx Bot: Pickup Line (3rd try) Client: xxx Bot: Too many tries. In other words, drop out of pickup lines after 3 consecutive default matches. Whenever there is a non-defualt match (like "HELLO"), then reset the pickup counter to 1. Does that make sense? On Wed, May 21, 2008 at 5:23 PM, mehri <foreverlinux@...> wrote: > <?xml version="1.0" encoding="UTF-8"?> > <aiml version="1.0"> > > <category> > <pattern>*</pattern> > <template> > <condition name="maxtries"> > <li value="1">Try number <set > name="maxtries">2</set><srai>OM pickup</srai></li> > <li value="2">Try number <set > name="maxtries">3</set><srai>OM pickup</srai></li> > <li value="3"><srai>OM Too many tries</srai></li> > <li>Try number <set name="MAXTRIES">1</set></li> > </condition> > </template> > </category> > > <category> > <pattern>OM pickup</pattern> > <template> > <random> > <li>Pickup1</li> > <li>Pickup2</li> > <li>Pickup3</li> > </random> > </template> > </category> > > <category> > <pattern>OM Too many tries</pattern> > <template> > Too many tries > </template> > </category> > > </aiml> > > > --- "Dr. Rich Wallace" <drwallace@...> wrote: > >> I've got a puzzle for AIML writers. >> >> Suppose I have a bot that has N pickup lines in an >> ultimate default category: >> >> <pattern>*</pattern> >> <template> >> <random> >> <li>Pickup1</li> >> <li>Pickup2</li> >> ... >> <li>PickupN</li> >> </random> >> </template> >> >> The desired goal is to make the bot respond with a >> different, specific >> answer (not one of the pickup lines) if the bot >> says any of the >> pickup lines 3 times in a row: >> >> Client: XXX >> Bot: Pickup1 >> Client: XXX >> Bot: Pickup7 >> Client: XXX >> Bot: Pickup3 >> Client: XXX >> Bot: I'm sorry I wasn't able to help you. Please >> try calling customer service. >> >> Assume the bot has a lot of other AIML content so it >> is possible to >> have lots of "normal" conversations without >> activating the ultimate >> default category 3 times in a row. >> >> Can someone think of a way to make the bot "break >> out" of the pickup >> lines after 3 in a row? Or in general, K in a row, >> where K is any >> positive integer? >> _______________________________________________ >> This is the alicebot-general mailing list >> Reply to alicebot-general@... >> Unsubscribe and change preferences at >> > http://list.alicebot.org/mailman/listinfo/alicebot-general >> Learn netiquette at >> http://www.dtcc.edu/cs/rfc1855.html >> Learn to read at http://www.literacy.org/ >> > > > > > _______________________________________________ > This is the alicebot-general mailing list > Reply to alicebot-general@... > Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general > Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html > Learn to read at http://www.literacy.org/ > This is the alicebot-general mailing list Reply to alicebot-general@... Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html Learn to read at http://www.literacy.org/ |
|
|
Re: Pickup Line PuzzleYes, I'd like to see it. Is it too long to publish here?
On Wed, May 21, 2008 at 4:28 PM, Mike Procter <mikeprocter@...> wrote: > I did find a way to do this, but it was somewhat involved and somewhat > ugly. Basically I set up a topic called PREPROCESSOR with a category > with pattern "_" to capture all input, do some pre-processing, then > restore the actual topic and SRAI the input to continue on as normal. On > "returning" from the SRAI it saves the current topic before setting it > back to PREPROCESSOR. > > This allows the AIML to track the input during the pre-processing, keep > track of the input count, recognize consecutive events, etc. > > Let me know if you'd like to see the aiml. > > Mike > > > -----Original Message----- > Date: Wed, 21 May 2008 11:42:56 -0400 > From: "Dr. Rich Wallace" <drwallace@...> > Subject: [alicebot-general] Pickup Line Puzzle > To: "Alicebot and AIML General Discussion" > <alicebot-general@...> > Message-ID: > <d9aba65c0805210842v4254d712hfd437c2257c61c09@...> > Content-Type: text/plain; charset=ISO-8859-1 > > I've got a puzzle for AIML writers. > > Suppose I have a bot that has N pickup lines in an ultimate default > category: > > <pattern>*</pattern> > <template> > <random> > <li>Pickup1</li> > <li>Pickup2</li> > ... > <li>PickupN</li> > </random> > </template> > > The desired goal is to make the bot respond with a different, specific > answer (not one of the pickup lines) if the bot says any of the pickup > lines 3 times in a row: > > Client: XXX > Bot: Pickup1 > Client: XXX > Bot: Pickup7 > Client: XXX > Bot: Pickup3 > Client: XXX > Bot: I'm sorry I wasn't able to help you. Please try calling customer > service. > > Assume the bot has a lot of other AIML content so it is possible to have > lots of "normal" conversations without activating the ultimate default > category 3 times in a row. > > Can someone think of a way to make the bot "break out" of the pickup > lines after 3 in a row? Or in general, K in a row, where K is any > positive integer? > > > ------------------------------ > > _______________________________________________ > alicebot-general mailing list alicebot-general@... > http://list.alicebot.org/mailman/listinfo/alicebot-general > > > End of alicebot-general Digest, Vol 28, Issue 8 > *********************************************** > > _______________________________________________ > This is the alicebot-general mailing list > Reply to alicebot-general@... > Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general > Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html > Learn to read at http://www.literacy.org/ > This is the alicebot-general mailing list Reply to alicebot-general@... Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html Learn to read at http://www.literacy.org/ |
|
|
Re: Pickup Line PuzzleWell, here is an attempt to simplify the relevant aiml. Not all supporting categories are present but hopefully it demonstrates the concept adequately. Some background. This was developed as part of an on going study, by Bob Heller at Athabasca University, into the application of historical figure conversational agents in distance education. A few famous names from the field of Psychology are represented by Freudbot, Piagetbot, and Skinnerbot. Part of the challenge in using a conversational agent for education is keeping the conversation "on topic" (referring to the subject, not an aiml topic). One of the methods for addressing this is to identify when multiple consecutive non-matches occur. Basically, the pre-processor approach allows us to apply conditional(s) to every user input. The extra aiml processing associated with this is significant but does not seem to cause a problem in response times as a rule. If you'd like to try it out, visit Freudbot's office in SecondLife: http://slurl.com/secondlife/Athabasca%20University/178/153/249 Mike <category> <pattern>CONNECT</pattern> <template> <think> Saving actual topic: <set name="theactualtopic"><get name="topic"/></set>; Setting topic to: <set name="topic">PREPROCESSOR</set>; </think> </template> </category> <topic name="PREPROCESSOR"> <!-- Saves input pattern in ppstar, restores topic from theactualtopic --> <!-- SRAI's PREPROCESSOR --> <category> <pattern>_</pattern> <template> <think> Processing: <set name="ppstar"><star/></set>;<br/> <condition name="theactualtopic" value="PREPROCESSOR"> <set name="theactualtopic"><get name="startingtopic"></set> </condition> Restoring actual topic: <set name="topic"><get name="theactualtopic"/></set>;<br/> </think> <srai>PREPROCESSOR</srai> </template> </category> </topic> <!-- End PREPROCESSOR --> <!-- Increments inputcount (INCR * routine not shown) --> <!-- SRAI's user input from ppstar --> <!-- After processing user input... --> <!-- if otflag (ot = off topic) is 1 indicates * was matched so increments otcount --> <!-- if otflag is 0, resets otcount --> <!-- resets otflag to 0 --> <!-- saves current topic to theactualtopic and sets topic to PREPROCESSOR --> <category> <pattern>PREPROCESSOR</pattern> <template> <think> inputcount was: <set name="counter"><get name="inputcount"/></set>; setting inputcount: <set name="inputcount"><srai>INCR PP2</srai></set>; </think> <srai><get name="ppstar"/></srai> <think> <condition name="otflag"> <li value="1"> otcount was: <set name="counter"><get name="otcount"/></set>; setting otcount: <set name="otcount"><srai>INCR PP1</srai></set>; </li> <li>Setting otcount: <set name="otcount">0</set></li>; </condition> Setting otflag: <set name="otflag">0</set>; <br/><br/>Done executing...<br/> <condition name="topic"> <li value="PREPROCESSOR"></li> <li> Saving actual topic: <set name="theactualtopic"><get name="topic"/></set>;<br/> Setting topic to: <set name="topic">PREPROCESSOR</set>;<br/> </li> </condition> </think> </template> </category> <!-- Sets otflag (off topic flag) --> <!-- Checks otcount (how many consecutive hits on *), --> <!-- if 3 then suggests new topic (SUGGESTTOPIC not shown) --> <!-- else tries typical default categories (not shown) --> <category> <pattern>*</pattern> <template> <think> <set name="otflag">1</set> </think> <condition name="otcount"> <li value="3"><think><set name="otcount">0</set></think><srai>SUGGESTTOPIC</srai></li> <li> <random> <li><srai>SAY CONFUSION STATEMENT</srai></li> <li><srai>ASKRANDOMQUESTION</srai></li> <li><srai>SAYDEADENDSTATEMENT</srai></li> </random> </li> </condition> </template> </category> -----Original Message----- From: alicebot-general-bounces@... [mailto:alicebot-general-bounces@...] On Behalf Of Dr. Rich Wallace Sent: May 21, 2008 3:59 PM To: Alicebot and AIML General Discussion Subject: Re: [alicebot-general] Pickup Line Puzzle Yes, I'd like to see it. Is it too long to publish here? _______________________________________________ This is the alicebot-general mailing list Reply to alicebot-general@... Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html Learn to read at http://www.literacy.org/ |
|
|
Re: Pickup Line PuzzleHi, I may have found a slightly simpler solution using <that> and
<topic> that doesn't need <condition> tags. One limitation is that we don't bother to save the actual topic. We assume the rest of the AIML does not use the <topic> tag. Check this out: <!-- here is the default pattern category --> <category> <pattern>*</pattern> <template> <srai>RANDOM PICKUP LINE</srai> <think><set name="topic">one pickup</set></think> </template> </category> <!-- There are three random pickup lines: Pickup One. Pickup Two and Pickup Three --> <category> <pattern>RANDOM PICKUP LINE</pattern> <template> <random> <li>Pickup one.</li> <li>Pickup two.</li> <li>Pickup three.</li> </random> </template> </category> <!-- Here is the default line we want to say after 3 consecutive pickup lines --> <category> <pattern>DEFAULT PICKUP LINE</pattern> <template> I'm sorry we couldn't answer your question. Please call customer service at 1-xxx-xxxx. </template> </category> <!-- The following 3 categories use <that> to match the 3 different pickup lines. --> <!-- In this state the bot has said one pickup line as its last utterance. --> <!-- The bot sets the topic state to "two pickups". --> <category> <pattern>*</pattern><that>pickup one</that> <template>two pickups. <srai>RANDOM PICKUP LINE</srai> <think><set name="topic">two pickups</set></think> </template> </category> <category> <pattern>*</pattern><that>pickup two</that> <template>two pickups. <srai>RANDOM PICKUP LINE</srai> <think><set name="topic">two pickups</set></think> </template> </category> <category> <pattern>*</pattern><that>pickup three</that> <template>two pickups. <srai>RANDOM PICKUP LINE</srai> <think><set name="topic">two pickups</set></think> </template> </category> <!-- The following 3 categories match when the bot is in the state "two pickups". --> <!-- The bot says one of the random pickup lines and sets the state to "three pickups". --> <topic name="two pickups"> <category> <pattern>*</pattern><that>pickup one</that> <template>three pickups. <srai>RANDOM PICKUP LINE</srai> <think><set name="topic">three pickups</set></think> </template> </category> <category> <pattern>*</pattern><that>pickup two</that> <template>three pickups. <srai>RANDOM PICKUP LINE</srai> <think><set name="topic">three pickups</set></think> </template> </category> <category> <pattern>*</pattern><that>pickup three</that> <template>three pickups. <srai>RANDOM PICKUP LINE</srai> <think><set name="topic">three pickups</set></think> </template> </category> </topic> <!-- These 3 categories match in the state "three pickups" --> <!-- Now the bot has uttered three consecutive pickup lines, so we select the default line. --> <topic name="three pickups"> <category> <pattern>*</pattern><that>pickup one</that> <template><srai>DEFAULT PICKUP LINE</srai> </template> </category> <category> <pattern>*</pattern><that>pickup two</that> <template><srai>DEFAULT PICKUP LINE</srai> </template> </category> <category> <pattern>*</pattern><that>pickup three</that> <template><srai>DEFAULT PICKUP LINE</srai> </template> </category> </topic> <!-- One extra conversational category to test nonconsecutive pickups: --> <category> <pattern>HELLO</pattern> <template>Hi there!</template> </category> </aiml> On Wed, May 21, 2008 at 8:49 PM, Mike Procter <mikeprocter@...> wrote: > > Well, here is an attempt to simplify the relevant aiml. Not all > supporting categories are present but hopefully it demonstrates the > concept adequately. > > Some background. This was developed as part of an on going study, by Bob > Heller at Athabasca University, into the application of historical > figure conversational agents in distance education. A few famous names > from the field of Psychology are represented by Freudbot, Piagetbot, and > Skinnerbot. > > Part of the challenge in using a conversational agent for education is > keeping the conversation "on topic" (referring to the subject, not an > aiml topic). One of the methods for addressing this is to identify when > multiple consecutive non-matches occur. Basically, the pre-processor > approach allows us to apply conditional(s) to every user input. > > The extra aiml processing associated with this is significant but does > not seem to cause a problem in response times as a rule. > > If you'd like to try it out, visit Freudbot's office in SecondLife: > http://slurl.com/secondlife/Athabasca%20University/178/153/249 > > Mike > > > <category> > <pattern>CONNECT</pattern> > <template> > <think> > Saving actual topic: <set name="theactualtopic"><get > name="topic"/></set>; > Setting topic to: <set name="topic">PREPROCESSOR</set>; > </think> > </template> > </category> > > <topic name="PREPROCESSOR"> > > <!-- Saves input pattern in ppstar, restores topic from theactualtopic > --> > <!-- SRAI's PREPROCESSOR --> > <category> > <pattern>_</pattern> > <template> > <think> > Processing: <set name="ppstar"><star/></set>;<br/> > <condition name="theactualtopic" value="PREPROCESSOR"> > <set name="theactualtopic"><get name="startingtopic"></set> > </condition> > Restoring actual topic: <set name="topic"><get > name="theactualtopic"/></set>;<br/> > </think> > <srai>PREPROCESSOR</srai> > </template> > </category> > > </topic> > <!-- End PREPROCESSOR --> > > <!-- Increments inputcount (INCR * routine not shown) --> > <!-- SRAI's user input from ppstar --> > <!-- After processing user input... --> > <!-- if otflag (ot = off topic) is 1 indicates * was matched so > increments otcount --> > <!-- if otflag is 0, resets otcount --> > <!-- resets otflag to 0 --> > <!-- saves current topic to theactualtopic and sets topic to > PREPROCESSOR --> > <category> > <pattern>PREPROCESSOR</pattern> > <template> > <think> > inputcount was: <set name="counter"><get name="inputcount"/></set>; > setting inputcount: <set name="inputcount"><srai>INCR PP2</srai></set>; > </think> > <srai><get name="ppstar"/></srai> > <think> > <condition name="otflag"> > <li value="1"> > otcount was: <set name="counter"><get name="otcount"/></set>; > setting otcount: <set name="otcount"><srai>INCR PP1</srai></set>; > </li> > <li>Setting otcount: <set name="otcount">0</set></li>; > </condition> > Setting otflag: <set name="otflag">0</set>; > <br/><br/>Done executing...<br/> > <condition name="topic"> > <li value="PREPROCESSOR"></li> > <li> > Saving actual topic: <set name="theactualtopic"><get > name="topic"/></set>;<br/> > Setting topic to: <set name="topic">PREPROCESSOR</set>;<br/> > </li> > </condition> > </think> > </template> > </category> > > <!-- Sets otflag (off topic flag) --> > <!-- Checks otcount (how many consecutive hits on *), --> > <!-- if 3 then suggests new topic (SUGGESTTOPIC not shown) --> > <!-- else tries typical default categories (not shown) --> > <category> > <pattern>*</pattern> > <template> > <think> > <set name="otflag">1</set> > </think> > <condition name="otcount"> > <li value="3"><think><set > name="otcount">0</set></think><srai>SUGGESTTOPIC</srai></li> > <li> > <random> > <li><srai>SAY CONFUSION STATEMENT</srai></li> > <li><srai>ASKRANDOMQUESTION</srai></li> > <li><srai>SAYDEADENDSTATEMENT</srai></li> > </random> > </li> > </condition> > </template> > </category> > > > > -----Original Message----- > From: alicebot-general-bounces@... > [mailto:alicebot-general-bounces@...] On Behalf Of Dr. > Rich Wallace > Sent: May 21, 2008 3:59 PM > To: Alicebot and AIML General Discussion > Subject: Re: [alicebot-general] Pickup Line Puzzle > > > Yes, I'd like to see it. Is it too long to publish here? > > > _______________________________________________ > This is the alicebot-general mailing list > Reply to alicebot-general@... > Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general > Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html > Learn to read at http://www.literacy.org/ > This is the alicebot-general mailing list Reply to alicebot-general@... Unsubscribe and change preferences at http://list.alicebot.org/mailman/listinfo/alicebot-general Learn netiquette at http://www.dtcc.edu/cs/rfc1855.html Learn to read at http://www.literacy.org/ |
| Free embeddable forum powered by Nabble | Forum Help |