Get started with AIML C# programming (IV): Train your own robot

10 Apr

It is very, very easy to train or coach your own robot. The way is to teach your robot in a question-answer fashion.

Q: Where is City University of Hong Kong?
A: It is located in Tat Chee Avenue, Kowloon, Hong Kong SAR.

By asking your robot to memorize this Q-A pair, your robot gets smarter. And when you ask the question, it will simply output your given answer!

Well this is my interpretation of AIML’s term, in AIML, question or input = Pattern, whereas the answer or output = Template, and the Q-A pair = category


So if you add a test.aiml file and edit above pattern-template category, you have finished training your robot to learn this! That is it! Believe it or not, it simply works!

Now let’s try another interesting question, as shown below:


Hah! Stupid your robot! But as the bot master, how can you make it smarter to handle this? Do you want to add another pattern-template category? This will result in unlimited items, that is not an intelligent robot! However, AIML understand your needs, and proposes a special tag <srai>:


<srai> in simply words, it means “equivalent”. When you ask “Where is CityU” (1) , it equals you are asking “Where is City University of Hong Kong” (2). Since (1) = (2), you will then get the right answer! Try it!

Happy training your robot!

Leave a comment

Posted by on April 10, 2014 in AI, Programming


Tags: , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: