Creating Your Own Virtual Agent Chatbot using AIML

AIMLWe wrote in an earlier post about two virtual agent software vendors that offer tools you can use to quickly get a virtual agent up and running for your business’s website. If you have loftier ambitions and more time, you can construct a virtual agent from the ground up. There are several chatbot scripting language frameworks available that you can use to develop anything from a simple conversational chatbot to a more complex virtual customer support assistant. In this post, we’ll take a quick look at AIML.

AIML, which stands for Artificial Intelligence Markup Language, is the creation of Dr. Richard Wallace and is offered as an open source chatbot scripting framework by ALICE AI Foundation. AIML is similar to HTML or XML, in that it consists standard and extensible tags that you use to mark up text so that it can be understood by an the AIML interpreter.

Pandorabots offers an extensive tutorial on how to build your chatbot using AIML. The concept behind AIML and other similar frameworks if straightforward. As the botmaster, you need to try to predict all the possible inputs that your chatbot will have to respond to. For every input, you write a matching output. The art of writing good AIML lies in this predictive reasoning, but also in using the tools of AIML to try to account for all the different ways in which a human can say basically the same thing. For example, if your chatbot only recognizes the greeting “Hello,” it won’t have a good response if someone says “Hi,” “Howdy,” Hey,” or “Good Morning.” This multiplicity of common inputs is one of the challenges that botmasters face and that scripting languages like AIML are equipped to deal with.

In my experience, an effective way to build your AIML virtual assistant and test it out is to sign up for a free user account on Pandorabots. Pandorabots has been around for many years and provides both a free AIML bot hosting platform, as well as a more robust platform for commercial use for a monthly fee. I found the free environment to be easy to use and a good way to debug my first chatbots to help me better understand why some patterns weren’t matching up as I had expected.

Building your personal virtual assistant requires time. You’ll need to create enough input and matching response patterns to give your chatbot the ability to have at least a rudimentary conversation. Pandorabots offers you the option of beginning your virtual agent with pre-populated AIML templates. You’ll need to examine this content to determine if you want to use it, especially if you’re creating a chatbot to represent your business. Some of the default responses may not align with the message or tone that you’d like for your virtual agent, so it may be better to start from scratch.

AIML offers quite a bit of flexibility. There are techniques that enable your chatbot to remember the last thread of a conversation and respond appropriately. This response can be conditional. For example, you can have the virtual chatbot ask “How are you feeling today?” and it can offer a different response, depending on how the other party answers the question.

Skipper-Bot is an example of a fairly simple AIML chatbot that I created. Skipper-Bot’s only function is to test people’s seamanship and boating knowledge. The chatbot randomly asks a series of True or False questions and lets the quiz taker know whether their response was correct or not. Give Skipper-Bot a try and test your boating knowledge. At the end of this article you’ll find a short sample of the AIML mark-up that controls Skipper-Bot’s conversational ability:

As you add more patterns and work on training your virtual AIML agent, there are numerous forums you can turn to for help from other AIML developers. One such forum is located on Chatbots.org.

Once your conversational chatbot is ready to deploy, you have the option of using a hosting platform that provides a speaking avatar to represent your virtual agent. SitePal is an example of an intelligent agent hosting provider that offers a choice of animated, talking avatars. Research by experts such as Amy L. Baylor has shown that people are much more likely to make a meaningful connection with a life-like avatar than with a disembodied voice. If your virtual agent communicates via a simple text interface, then you should at least consider personalizing the chatbot with a representational photo.

In future posts, we’ll introduce some alternative virtual agent chatbot development frameworks that you might also want to consider for constructing virtual support agents to assist your online customers.

Sample AIML Snippet from Skipper-Bot

<?xml version=”1.0″ encoding=”UTF-8″?>

<aiml version=”1.0″>

<category>

<pattern>ASK</pattern>

<template>

<random>

<li>True or False: Midchannel buoys are always even numbered</li>

<li>True or False: The right side of the boat is called the port side</li>

<li>True or False: Boats 16 feet or more must carry at least two throwable PFDs on board</li>

</random>

</template>

</category>

<category>

<pattern>TRUE</pattern>

<that>Midchannel buoys are always even numbered</that>

<template>Nope. Trick question! Midchannel buoys aren’t numbered at all!</template>

</category>

<category>

<pattern>FALSE</pattern>

<that>Midchannel buoys are always even numbered</that>

<template>Very good! They aren’t numbered at all</template>

</category>

</aiml>

Virtual Agent Wendy Offers Customer Support

VirtuOz WendyVirtuOz, Inc. issued a press release back at the beginning of the year announcing the launch of Wendy, a virtual agent support rep for Windstream Communications. According to the press release, Wendy offers 24/7 support to Windstream customers who may be experiencing problems with their high-speed Internet, digital TV, home phone, or other Windstream services.

Wendy doesn’t speak, but her avatar appears onscreen as a young professional clad in a Windstream branded polo. She is trained in basic troubleshooting. For example, if you let her know that you’re having trouble with your Internet connection, she’ll suggest that you try rebooting your modem and wireless router. If her suggestions don’t help you fix the problem, she can direct you to live support or to an appropriate email address. For just about any support question you can think to ask, Wendy offers up multiple links to relevant information that she thinks might address your issue.

Wendy seems to be a good example of a virtual customer support agent, offering customers another channel to get their problems resolved.

Talking Robot Set to Join Astronaut in Space

KiroboSpace is lonely and if something bad happens up there, nobody can hear you scream, right? Well, one Japanese astronaut no longer needs to fear the isolation. iTechPost reports that a talking robot is set to journey to the International Space Station (ISS) to provide Japanese astronaut Koichi Wakata with companionship.  The robot is called “Kirobo” and it speaks Japanese.

Astronaut Wakata won’t actually be alone in the ISS. There will be other astronauts and cosmonauts around. But little Kirobo, who stands barely a foot tall, will be the only other Japanese speaker on the station. Wakata is scheduled to be the Commander of Expedition 39 to the ISS and spend about 6 months in space.

Another article on the talking robot Kirobo in Design Boom states that the chatty android uses natural language processing and recognition technology from Toyota. It would be interesting to know more about the little bot’s conversational abilities. Perhaps some of its skills can be leveraged in the future to improve the conversational skills of virtual agents serving people right here on Earth.

I’m Sorry You’re Upset

How Are You FeelingFeeling angry, depressed, or maybe happy as a clam? It may not be long before an intelligent virtual agent you’re conversing with is able to accurately gauge your emotional state. Advances in technology are enabling artificially intelligent software to pick up on subtle queues in human speech patterns. In the article Teaching Computers to Hear Emotions, IEEE reports on recent work by interns at Microsoft Research with spoken language software systems. Their work shows that software can have a surprising success rate at predicting a speaker’s emotional state by examining variations in the loudness and pitch of the speaker’s voice.

The implications for intelligent virtual agent technologies are just beginning to be explored. Obviously, a digital customer support agent that is able to sense when a customer is losing patience or becoming angry will be better equipped to serve the customer effectively. Recognizing the onset of negative emotions could prompt the virtual support agent to take a different approach with the customer. In some cases, a change in emotional state may be a signal to the virtual chatbot to escalate the conversation to a human support agent.

As speech recognition and spoken language systems become more sophisticated in picking up on human emotional queues, the applications in the realm of virtual agents, digital support representatives, and artificial intelligence in general are limitless.