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

Further improvements in AIML II (AIMLMultibot)
 
 

A new improvement is the use of variables.

AIML language there are three types of variables:
[ul]
[li] - The bot. These are used with the tag <bot name=“variable”> and are read-only.[/li]
[li] - From user. Are read and write tags are <set> and <get>. Are permanent.[/li]
[li] - The pattern. Any coincidence in a wildcard then its value can be obtained by <star> tag. These variables are temporary and its duration is within the category.[/li]
[/ul]


In the library AIMLBot (not standard).

This use of variables may cause some controversy, but the use for certain cases is necessary when more precision is required in the response.

We define new variables, and how they declare is:
[ul]
[li] - Permanent. $name[/li]
[li] - Temporary until the end of the category. $[/li]
[li] - Temporary until the end of AIML program. $$ name.[/li]
[/ul]

Why create them if they exist in the standard AIML?
I must say that its use is not necessary, but the use we can simplify the code and can use them to make code more powerful.

Let’s see one by one:

1) Temporary until the end of the category.

If we assume that:
  #eat = (chew, consume, devour, gobble, ingest, munch)
  #meat = (beef, veal, steak, pork, ham, #poultry)
  #poultry = (chicken, turkey)

You could write such examples:

<category>
  <
pattern> $*$#eat  $*0 $#meat  $*0 </pattern>  
  
<template>
    <
condition name=$4”>
      <
li value=#poultry”> I hate poultry </li>
      
<liI like too </li>
    </
condition
   </
template>
</
category

Temporary variables are numbered according to their appearance starting with the number one

In this example there was no need to put all the variables, just put:
  *0 #eat *0 $#meat *0 </pattern>
and we would read the variable $1, put the variables that could clarify it in any position.


2) Temporary until the end of the program.

<category>
  <
pattern>  *#eat  *0  $#meat  *0 </pattern>  
     
<template>
      <
condition name=$1”>
         <
li value=#poultry”> I hate poultry  {$$hate=poultry}</li>
         
<liI like too </li>
      </
condition
    </
template>
</
category>
 
<
category>
   <
pattern> Do you hate all poultry </pattern>  
   <
template>
     <
condition name=$$hate”>
       <
li value=”poultry”I prefer beef </li>
       <
liHow do you know I hate poultry? </li>
     </
condition
   </
template>
</
category

As you have noted the variable assignment I have done by putting the code between the {code} symbols. In subsequent post will move forward more in the possibilities that this new functionality.


3) Permanent. Variables could be considered as general in scope.

Same as above, but his life is permanent and is declared with a single $.

One could consider allocating {$variable = value} as a shorthand way of making what can be done by <set name=”variable”> value </set>.

 

 

 
  [ # 1 ]

As any botmaster here can tell you, the main obstacle to creating a bot with an original personality is content creation.  There are very few people who are good at both computer programming and creative writing.  Yet creative writing is the most important skill needed to a create an original bot (unless you use an unsupervised learning approach like Cleverbot does).  Because of the simplicity of AIML it is possible to train a non-technical creative writer to write AIML content in a few days. 

If you don’t have the ability to create content, it doesn’t matter how much complexity you add to to the pattern language or whether you can reduce 3000 rules to 250.  There are certainly many options for complex pattern languages (regular expressions come to mind—why reinvent the wheel?) but a creative writer with no programming skills is likely to be intimidated—this is why we made a simplified pattern language in the first place. 

Our current best estimate is that it take about 10,000 minutes or for practical purposes 2-3 months of work to write the bot’s responses whether it is in AIML or a fancier language.  It is roughly equivalent to writing a novel.  So my question for you is, how do your improvements help make the process of bot creation more efficient?  Not only in the sense of less typing of symbols but also in the sense of helping a creative non-programmer write a lot of original content?

 

 
  [ # 2 ]

I totally agree that the important thing when creating a robot is creativity and content creation.
A person without experience start with simpler features, but little by little, as you learn to write code with AIML language started to wonder ... Why I have to write so much to say the same? Could not do it any more simple? When you need to do something more complex will have to be complicated as a living doing something that otherwise would be simpler and would cover many more possibilities. Then write a series of alternatives, but you write an entry that was not covered by a category ... In short there are simple tools with few instructions (assembly) that may be enough to start, and there are more powerful tools (high-level languages​​) which serves to facilitate the task of making faster programming.

There are utilities, as discussed in a thread, but what if language itself were those profits? Serve the same language for all users.
When I write a program does not schedule a high-level language and then debug in assembler, it would be illogical. Should we write a file in AIML and then watch the ones and zeros?

AIML language has changed over your life for new features, but reached a point is tight. Are not there people who say that there are such shortcomings and is making new bots or is migrating to ChatScript? Do you think if with AIML had the same opportunities arise to change? These are questions you should ask yourself.

Someone you would like and use the new features, others think they are not necessary and may continue programming as usual.
I think the important thing is to give the developer the greatest tools, utilities, tutorials, etc ... make your life easier and do not say “only you can do it this way”.

 

 
  [ # 3 ]
Richard Wallace - Apr 17, 2011:

If you don’t have the ability to create content, it doesn’t matter how much complexity you add to to the pattern language or whether you can reduce 3000 rules to 250.  There are certainly many options for complex pattern languages (regular expressions come to mind—why reinvent the wheel?) but a creative writer with no programming skills is likely to be intimidated—this is why we made a simplified pattern language in the first place.

Just offering new, more powerful features is not the same as imposing their usage on users.
The people who do like computer programming can use the features, other people can
keep on using the basic functionality - I don’t necessarily see a conflict there?

BTW, if I understood correctly from a different post, mr. Ktaba already implemented word delimited regular expression support to recognize interjections like ah, aaah, aaaaaaaah, ahhhhhh, aaaahhhhhhhhh in one rule. I for one applaud his effort in that direction (I’m biased, since it was my idea grin ). I can’t begin to tell you how frustrating it is to have to keep on adding new variations of what is essentially the same regex, effectively always running after the facts.

I’m even wondering if such word delimited regex are not adding fundamental expressiveness to aiml (intuitively:  they succeed in reducing an infinite number of simple aiml categories into a single rule). I have read about Zipf’s law, but interjections are somewhat in a different league (at least that’s my experience with the bot I’m teaching).

Note that I explicitly proposed “word delimited” regex, because alllowing general regex probably would make it very hard to reason about what rules match which inputs.

As for new mechanisms involving variables: in standard AIML I already feel somewhat uncomfortable about defining topics and using <that>. I understand why it is needed, but whenever you add a new topic, it seems to me you have to reread your complete AIML, and update for the new topic where needed - disk space and maintenance time complexity quickly explode.

If I understood correctly, mr. Ktaba proposes to use a hierarchy of topics (an ontology?), where matching with the more specific topic is tried first. I’d have to experiment a bit with it to get a feeling for how practical it is. I’m afraid that adding more flexibility in this area will add complexity without adding fundamentally new possibilities. As Dr. Wallace indicated, even if you have a complete ontology at your disposal (opencyc anyone?), you still need to create creative content, and set the topics during the conversation.

Practical approaches to topic management to me seem like a good candidate for some research (I’m not informed about what exists in this area). Maybe integrating some bayesian classifier to automatically infer topics from conversations could be of help here. To be honest, I haven’t given it much thought (I’m just randomly associating as I type).

It could also be that part of the solution in aiml and topic management is in innovative aiml editors which can present information in a variety of ways, and which can perform semantic analysis of the aiml, and perform refactorings and (near)-clone-detection and -extraction on it.

 

 

 
  [ # 4 ]

It is very gratifying to see that the suggestions I made in 2011 to improve the AIML language have been incorporated into the new revision 2.0.

I see that it has been incorporated:
  * zero wildcards
  * maps and sets

However, this idea was undone by the supposed complexity since the AIML language was a minimalist language and that there were many more rules did not matter.

It has been shown that new specifications can be made and that thanks to this the number of rules can be reduced making it much easier to maintain and at the same time more powerful.

 

 
  login or register to react