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..

Newbie Questions
 
 

Hi, I am a new member of this forum and also a newbie in AIML coding. And I have some questions that I’d like to ask. Firstly, I know that * represent what the user input like if the code is Hi *, and I type Hi A.I, then A.I will be understand as the *. So what is the difference between *,# and _ ? Also another question is that can we setup rules using AIML ? so like if A is bigger than B, B is bigger than C then A is bigger than C ?
P.s: I don’t know if I am posting in the right Thread or not, so if I’m posting in a wrong Thread, can any of the admin move it into the right Thread for me ? :/ thank you so much.
P.s.s: Anybody here is an expert in Aiml ? :/ It would be great if any of you can help me out through facebook or skype since I have a lot of questions and posting new post over and over again is quite frustrating :/ Thank you.

 

 
  [ # 1 ]

Looks like you are using AIML 2.0
There are 4 wildcards:

* and _ from AIML 1. These represent 1 or more words. * matches if nothing else matches and _ overrules everything else. Let me show an example:

If you had 2 categories:

HI *
and
HI STEVE

and the user said, “Hi Steve”, the 2nd category would match as HI STEVE is an exact match.
Had the user said, “Hi Sue”, the 1st category would match.

Now let’s add a 3rd category:

HI _

Now when we say, “Hi Steve”, our new category matches as _ overrides everything else even the direct match of “HI STEVE” and so should be used sparingly.

^ and # are from AIML 2.0 and are the equivalent of * and _ but can represent 0 or more words.

Hope that makes sense

 

 
  [ # 2 ]

To set up such rules, you will need the <learn> tag to set up new categories on the fly, like so:

<category>
<
pattern>* IS BIGGER THAN *</pattern>

<
template>
Thanks for letting me know.
<
learn>
<
category>
<
pattern>IS <eval><uppercase><star/></uppercase></eval> BIGGER THAN <eval><star index="2"/></eval></pattern>
<
template>Yes</template>
</
category>

<
category>
<
pattern>IS <eval><uppercase><star index="2"/></uppercase></eval> BIGGER THAN <eval><star/></eval></pattern>
<
template>No</template>
</
category>

</
learn>
</
template>
</
category

Human: Joe is bigger than Jane
Bot: Thanks for letting me know
Human: Is Joe bigger than Jane?
Bot: Yes
Human: Is Jane bigger than Joe?
Bot: No

The categories above are not optimised and you would be better sending parameters to another category to create the new categories or your AIML is going to get very bloated indeed.

I would rather answer online than dealing direct, as that way people who are wondering the same things can search for the answers and come across pages like this.

 

 
  [ # 3 ]

Thank you much for your answer Steve, it really helps me out. Although I think I’ll need time to understand your code in the Rules part, but I hope I’ll manage to understand it in a short time. But again, thank you so much smile))

 

 
  [ # 4 ]

Also, what is the Eval and Uppercase tag for ?
And I tried your code in my Programm-O bot , and the result is like this :

A.I: Hey!
User: A is bigger than B
A.I
User: A IS BIGGER THAN B
A.I
User: is A bigger than B ?
A.I

There is no response, is it because of the Program-O or is it because of the code ? I try your code without any modification.

 

 
  [ # 5 ]

<uppercase> makes whatever is between the tags into uppercase. I am a traditionalist and like to see my patterns in uppercase.

<eval> says to evaluate the contents, so you get a pattern like “IS JANE BIGGER THAN JOE” instead of the actual values of “IS <star index=“2”> BIGGER THAN <star>” which would never match anything.

I guess Program O doesn’t support the eval and learn tags. I would point you in the direction of Dave Morton for clarification but he rarely posts any more.

 

 
  [ # 6 ]

Thank you so much, one final thing, since the learn tags doesn’t work for program - O ( I tried many times , it just doesn’t work ), what php based chatbot aiml that fully support those tags would you recommend ?
P.s :I’d like it to have it own source code so I can modify it as I wish,  not by using other’s service such as Bot Libre

 

 
  [ # 7 ]

I use the servers at http://www.pandorabots.com for my bots. You may want to look at Program AB which also supports the <learn> tags. Learn more at : https://code.google.com/p/program-ab/

 

 
  [ # 8 ]

Thank you so much smile))))) I’ll take a look at it smile)) thanks for helping me smile)))).

 

 
  [ # 9 ]

My pleasure. Please post again if you need any further help.

 

 
  login or register to react