I am trying to develop Artificial Bot i found AIML is something that can be used for achieving such goal i found these points regarding AIML parsing which is done by Program-O
1.) All letters in the input are converted to UPPERCASE 2.) All punctuation is stripped out and replaced with spaces 3.) extra whitespace chatacters, including tabs, are removed
From there, Program O performs a search in the database, looking for all potential matches to the input, including wildcards. The returned results are then “scored” for relevancy and the “best match” is selected. Program O then processes the AIML from the selected result, and returns the finished product to the user.
I am just wondering how to define score and find relevant answer closest to user input
Any help or ideas will be appreciated
@user3589042 (rather cumbersome name, don't you think?)
I'm Dave Morton, lead developer for Program O. I'm sorry I missed this at the time you asked the question. It only came to my attention today.
The way that Program O scores the potential matches pulled from the database is this:
aiml_userdefined
table? yes=300/no=0Does the current category have a
<topic>
tag? yes(see below)/no=0a. Does the
<topic>
contain one or more underscore (_) wildcards? yes=80/no=0b. Does the
<topic>
directly match the current topic? yes=50/no=0c. Does the
<topic>
contain a star (*) wildcard? yes=10/no=0Does the current category contain a
<that>
tag? yes(see below)/no=0a. Does the
<that>
contain one or more underscore (_) wildcards? yes=45/no=0b. Does the
<that>
directly match the current topic? yes=15/no=0c. Does the
<that>
contain a star (*) wildcard? yes=2/no=0Is the
<pattern>
a direct match to the user's input? yes=10/no=0Does the
<pattern>
contain one or more star (*) wildcards? yes=1/no=0Does the
<pattern>
match the default AIML pattern from the config? yes=5/no=0The script then adds up all passed tests listed above, and also adds a point for each word in the category's
<pattern>
that also matches a word in the user's input. The AIML category with the highest score is considered to be the "best match". In the event of a tie, the script will then select either the "first" highest scoring category, the "last" one, or one at random, depending on the configuration settings. this selected category is then returned to other functions for parsing of the XML.I hope this answers your question.