AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Pandorabots - order of precedence of wild cards
 
 
  [ # 16 ]

Sorry about the delay in responding. Sometimes I get so busy I lose track of things. downer

I’ve created a chatbot to test and expand your smoking quiz (I’ve also added your Christmas quiz to it, and will test that while I’m at it). As I mentioned in this post, I’ll report back with my findings. Given the trouble you’re reporting, I’ll have to add some additional, unrelated AIML categories that have patterns of “YES” and “NO” so I can perform more thorough testing. smile

 

 
  [ # 17 ]

In the smoking quiz there are a few questions that require a country name as the answer.  It was only when I purposely typed in a wrong answer, e.g. France, that I spotted that it matched another simple catergory that just had ‘France’ as the pattern. 

I had assumed that the quiz pattern with * as a catchall for wrong answers which had topic set to ‘quiz’ and had a ‘that’ which matched as well would have caught all the wrong answers but what I found was that if the wrong answer matched another category, it matched to that despite the topic and that matching which surprised me.

If in your new chatbot you can make a category with for example pattern ‘France’ with say template ‘How do you like living in France’ (actually one of the original ALICE categories which was still in my files) and answer France to one of the country questions - will be interesting to see if it matches the * catchall (which is what I want it to do) then that would indicate something wrong with my code at my end or the implementation on Pandorabots or if it matches the France category then it is a more general aiml quirk I suppose.

 

 
  [ # 18 ]

I can do that, no problem. smile I just need to work it in between chores, breakfast, and Mom wanting her bedroom re-arranged. wink

 

 
  [ # 19 ]

I think I have to accept that this is a generic aiml issue at least on Pandorabots.  I’ve tested it every which way with <TOPIC> and <THAT> set and wherever I have a category with wildcard * if the user happens to type in something that exactly matches the pattern in another category, then the current process (such as a quiz) is broken and the user gets an answer back from this other category rather than ‘That was incorrect, would you like to try again’.  So it seems that <TOPIC> and <THAT> used in conjunction with * has a lower precedence than a matching word which doesn’t seem logical - you would have thought that <TOPIC> and/or <THAT> would have kept the user within the category rather than jumping out.

To make sure it wasn’t me, I tested this on Steve’s Square Bear chatbot.  For instance if playing his Rock, Paper, Scissors game if I give an incorrect answer it tells me I am incorrect but if I say something that matches another category for example ‘red’ then I get answer back ‘What do I have that is red’ and the Rock, Paper, Scissors game is finished without any warning.

If I use wildcard _ then it does stay within the category but that doesn’t work for me in many cases where it would take precedence over correct answers or give other undesirable effects.  I’ll probably rewrite my various quiz type files to use _ and conditions to avoid using * in these type of situations.

 

 
  [ # 20 ]

So would I be right then that <THAT> and <TOPIC> only influence the preference of wild cards within their domain so that the order of precedence in aiml 1.0 is:

-  plus <THAT> and <TOPIC>
-  plus <THAT> or <TOPIC>
-
word plus <THAT> and <TOPIC>
word plus <THAT> or <TOPIC>
word
*  plus <THAT> and <TOPIC>
*  plus <THAT> or <TOPIC>
*

which would be the answer to my first posting in this thread?

 

 
  [ # 21 ]

That is correct. If you want to force the user to stay in a topic you need to use the _ and conditions to flow the conversation. Here is a quick quiz to demonstrate this:

<category>
<
pattern>QUIZ</pattern>
<
template>
  <
think><set name="topic">QUESTION1</set></think>
  
1st question:<br/>In which country could you find the Pyramids.
</
template>
</
category>


<
topic name="QUESTION1">
<
category>
<
pattern>_</pattern>
<
template>
  <
think><set name="answer"><star/></set><set name="topic">QUESTION2</set></think>
  <
condition name="answer">
    <
li value="EGYPT">That is correct.</li>
    <
li>Sorrythe answer was Egypt.</li>
  </
condition>
  
Next question:<br/>What colour is a red ball?
</
template>
</
category>
</
topic>

<
topic name="QUESTION2">
<
category>
<
pattern>_</pattern>
<
template>
  <
think><set name="answer"><star/></set><set name="topic"></set></think>
    <
condition name="answer">
      <
li value="RED">That is correct.</li>
      <
li>Sorrythe answer was red.</li>
    </
condition>
  
YayYou answered all the questions.
</
template>
</
category>
</
topic

Now if the user says “France” (or anything else that has a direct match), the use of topics and wildcards will force them into the flow that you want. Remember on the last question to set a null topic or the user will be trapped.

 

 
  [ # 22 ]

Although it took me some time to realise that the <TOPIC> and <THAT> weren’t as powerful as I had imagined, which was the question first posed, as a result of this fairly long thread I have picked up some good tips from you, Steve & Dave that has made my Christmas quiz more engaging for the user and less likely to break.  Thanks guys.

 

 < 1 2
2 of 2
 
  login or register to react