Virtual Humans Forum
Virtual Humans Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Virtual Humans
Partner website:
Chatbots.org
 All Forums
 AIML and other chatbots environments
 AIML language and Pandorabots
 Multiple aiml files
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ajax
Curious Member



2 Posts

Posted - Dec 14 2010 :  20:22:21  Show Profile
Hi. I have a bot made by another person which is a modification of Alice and it contains 58 different aiml scripts. How are multiple aiml scripts implemented? Can you explain how this works and how it shifts from one file to another?

vrossi
Forum Admin



Italy
1455 Posts

Posted - Dec 15 2010 :  09:27:10  Show Profile  Visit vrossi's Homepage
Hi, Ajax,

welcome to our Forum.

As far as I know, the AIML interpreter initially loads all the AIML files in memory and then sorts all the patterns according to its internal logic.

So it doesn't matter in which file a pattern is stored.
Files are useful because each file is usually aimed at a certain subject, so it is easy to give your bot a different personality by simly replacing that file with another one or deleting a file.

Here is an explanation of the pattern matching logic:


- How are the patterns matched?

When a client enters an input, the program scans the categories to find the best match. By comparing the input with the patterns in the following order, the algorithm ensures that the most specific pattern matches first. "Specific" in this case has a formal definition, but basically it means that the program finds the "longest" pattern matching an input.

Search order:

ATOMIC with a THAT
ATOMIC
DEFAULT with a THAT
DEFAULT

Example:.

What type of heaters do you have?

will match the ATOMIC: "WHAT TYPE OF HEATERS DO YOU HAVE"
and not the REDUCTION of: WHAT TYPE OF *

The ATOMIC category will always take precidence over any other type of category, other than another ATOMIC with a THAT.
If you have two identical patters, but one has a THAT, then the THAT category, will take precidence over the ATOMIC category, if the THAT matches the bot's previous response.

If neither of the above is true, then a REDUCTION that matches part of the pattern will give it's response, and finally if none of the above matches, then the catch-all or pickup will take over.

Any categories that are contained within a TOPIC section will be searched first if the current setting of TOPIC matches a TOPIC section. This results in an extension of the search order to the following:

ATOMIC with a TOPIC and a THAT
ATOMIC with a TOPIC
DEFAULT with a TOPIC and a THAT
DEFAULT with a TOPIC
ATOMIC with a THAT
ATOMIC
DEFAULT with a THAT
DEFAULT

The TOPIC sections are always searched first if they match the current setting of TOPIC. This permits the botmaster to have identical category patterns within a TOPIC section and in the GENERAL section.

The wild-card character "*" comes before "A" in alphabetical order. For example, the "WHAT *" pattern is more general than "WHAT IS *". The default pattern "*" is first in alphabetical order and the most general pattern. For convenience AIML also provides a variation on "*" denoted "_", which comes after "Z" in alphabetical order.
- Do the categories need to be in alphabetical order by pattern?

No, the order is maintained internally when the categories load, but you can write them in any order.


For more info see http://www.alicebot.org/documentation/aiml-primer.html#pattern%20match

And also http://www.alicebot.org/aiml/aaa/


Vittorio
virtualhumansforum.com
Go to Top of Page

Ajax
Curious Member



2 Posts

Posted - Dec 15 2010 :  15:10:18  Show Profile
Thanks vrossi.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Virtual Humans Forum © V.R.Consulting Go To Top Of Page
This page was generated in 0.16 seconds. Snitz Forums 2000