Internet of Everything

Internet of Things Journal

Subscribe to Internet of Things Journal: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Internet of Things Journal: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


IoT Authors: Automic Blog, Pat Romanski, Liz McMillan, Kevin Benedict, Elizabeth White

Related Topics: Artificial Intelligence Journal, Apache Web Server Journal, XML Magazine

Artificial Intelligence: Article

A.L.I.C.E. And Artificial Intelligence Markup Language

A.L.I.C.E. And Artificial Intelligence Markup Language

Hundreds of companies, schools, and other organizations are currently using A.L.I.C.E. and Artificial Intelligence Markup Language (AIML) as the foundation of their chatbots for customer service, educational guidance, Web site help, and most of all, for fun. But let's take a closer look at the open-source chatbot and natural language technology A.L.I.C.E., and the XML language powering it, AIML.

A.L.I.C.E. (Artificial Linguistic Internet Computer Entity) was released by Dr. Richard S. Wallace under the GNU Public License in the hope that it would become the de facto standard in chatbot technology. What makes AIML and its technology promising for both developers and users of chatbots are its simple design, the fact that it serves multiple purposes, and its ability to respond to any device (including VoiceXML browsers).

Dr. Wallace currently releases A.L.I.C.E. in the form of 30,000 categories (which I'll discuss later) hoping that his example will demonstrate that it's as easy to begin writing AIML as it is HTML.

The A.L.I.C.E. 'Core'
Interpreting the AIML core (see Figure 1) requires a pattern-matching engine called Graphmaster and an AIML parser to evaluate the responses. The two modules are interleaved because the AIML response, called a <template>, may contain a callback to the <i>Graphmaster</i> (see Figure 2) through a recursive tag, <srai>.

One feature alone makes A.L.I.C.E. and AIML a much more powerful alternative to both HTML and VoiceXML: the language permits use of a database. The open-source database HypersonicSQL is used in the latest release. This allows a single user to be identified and exposes a number of properties (or predicates) defined by the botmaster. A user property can be any variable that you might associate with an individual user.

While there's some argument that designing and editing such technology can be tedious, the fact that AIML is XML 1.0-based makes room for a number of editors. A popular one is AIMLBuilder 1.0 by Bram Rooijmans that allows easy editing of AIML files to customize your bot and give it a "personality."

AIML 1.0 - Just the Beginning
Many developments are underway in defining the expanded library of AIML, but let's talk about its current state and the five major elements that make up the language. Since it's CVS under an open-source license and an open-source project currently exposed to nearly 300 developers worldwide (much of A.L.I.C.E.'s base is outside the U.S.), anyone can tinker with the "mind" of Dr. Wallace's creation.

I recently visited Dr. Wallace in San Francisco and witnessed a large number of people who have been "fooled" into thinking A.L.I.C.E. is a real human being, a sure sign that Alan Turing's 50-year-old predictions were prophetic.

The Basics
AIML currently makes use of Java, XML, P2P Networking (via SOAP), and JDBC. It can be considered a Gnutella form of knowledge basing but with a twist of personality. Bots can be fun to program and a good introduction to artificial intelligence (AI) in general. Dr. Wallace is a major supporter of open source and the Linux movements and hopes that one day chatting with A.L.I.C.E. will become an operating system in and of itself. Actually, there are ways of using your system on top of A.L.I.C.E., which we'll discuss.

Since I'm the lead developer for the Alicebot.Net project (a networked implementation of A.L.I.C.E.), I have the opportunity of introducing you to some of the elements that make up the wonderful world known as A.L.I.C.E. I recently successfully created A.L.I.C.E. to work with a number of text-to-speech synthesizers and speech-recognition engines (notably Microsoft's SAPI 5.0 and IBM's ViaVoice). Doing this has sparked a lot of interest in the notion that HAL, from 2001: A Space Odyssey, may become more than a fictional character.

Our First AIML Document, Hello World
Let's start by looking at Listing 1, which contains two examples (or categories) that define and show some powerful features in XML language.

Here is a dialog that would occur in a conversation with the bot:

User: Hello.
A.L.I.C.E.: Greetings user! Hello world!

Writing AIML is a world by itself since there's so much you can do with it, but let's examine what happened in the conversation above and explain it a little. When Dr. Wallace designed A.L.I.C.E., he introduced a concept known as Symbolic Reductionism, a format that allows any given sentence to reduce itself to its most basic form. What he might not have realized was that this type of "looping" is also a powerful introduction to speech recognition.

In its present state, AIML has two wildcards, "*" and "_". The former (more commonly referred to as "star") is meant as user input with no match, which is how we are able to "match" our first category. In other words, there were no patterns to effectively match what we entered. "_" is used for prefixes and suffixes of sentences (see Figure 1).

Setting and Getting
The area that allows the greatest flexibility is "setting" and "getting" a user's properties. Most users are commonly identified by an IP, a user/pass, SessionID, or, in the case of VoiceXML, the CallerID. Other interests have been in the area of facial recognition and mic array inputs, but most users are identifiable in some way or another - leaving them room in the built-in database to have their own properties.

The get and set have the common syntax:

<get name="property">default</get>
<set name="property">value</set>

If a property isn't found or doesn't return a value from the database, a default value can be used. In the previous example, if the user's "name" property was known, you would've gotten the following response:

User: Hello.
A.L.I.C.E.: Greetings Jon! Hello world!

Using XML with the database allows great flexibility and ease in assigning values to one particular user who is chatting with A.L.I.C.E..

Thinking and Learning
Probably the most frequent question I get from users and developers is whether A.L.I.C.E. can "learn" and "think" for itself. The answer is yesŠto some extent. A.L.I.C.E. thinks mostly like humans (via setting values - see Figure 2) while learning occurs in the notion of being able to absorb content (AIML, HTML, Text via OCR, Images, etc.). Many of these areas are still unexplored, but the truth is that A.L.I.C.E. can go out onto the network and "learn" about other resources. Keep in mind that this is still being defined and has yet to go through testing and debugging. It's mere speculation at this point that any items within the <learn> tags of AIML means something to A.L.I.C.E., but the goal is to allow A.L.I.C.E. to surf the Web just as we do.

Symbolic Reductionism
When a user attempts to pass on some dialog, the sentences can be long and complex, but, in essence, they may have a single purpose in mind. When A.L.I.C.E. reduces sentences to their simplest forms, it enables developers to focus on what exactly the user is requesting. For example:

HELLO ALICE. CAN YOU PLEASE TELL ME WHAT LINUX IS

From this sentence we can attempt:

<pattern>HELLO <name/> *</pattern>
<template><srai><star/></srai></template>

We have now reduced the input to:

CAN YOU PLEASE TELL ME WHAT LINUX IS

From this sentence we can attempt:

<pattern>CAN YOU PLEASE *</pattern>
<template><srai><star/></srai></template>

We have now reduced the input to:

TELL ME WHAT LINUX IS

From this we can finally attempt:

<pattern>TELL ME WHAT * IS</pattern>
<template><srai>DEFINE <star/></srai></template>

We have now reduced it to its simplest input form:

DEFINE LINUX

If you're thinking this may be a lot of work to start from scratch, you may be right. Dr. Wallace and his collaborators have developed the A.L.I.C.E. personality after more than five years of research. Fortunately, he has released A.L.I.C.E. and its 30,000 categories under GNU Public license for all to share.

When I discovered A.L.I.C.E. about six months ago, I added my own items, such as Database Pooling and JavaScript support (via Mozilla's Rhino). Combined with JavaScript, a developer now has the ability to determine items at runtime rather than static patterns.

That's a basic introduction to the world of A.L.I.C.E., but there's far more to be learned and explored than just chatterbot technology (in fact A.L.I.C.E. is used on the Web site for the Steven Spielberg movie A.I. Artificial Intelligence, and powers Ramona, Ray Kurzweil's artificial intelligence project).

Recently, Dr. Wallace and his collaborators established the A.L.I.C.E. Artificial Intelligence Foundation, a nonprofit corporation, to promote the adoption of A.L.I.C.E. and AIML technology worldwide.

Following the precedents established by other open-source nonprofits, such as the Free Software Foundation, the Apache Foundation, and the Python Foundation, the A.L.I.C.E. A.I. Foundation will protect and preserve the open-source software, making it available to all commercial players equally.

Just be careful the next time you're chatting with someone on the Internet: "someone" may turn out to be an Alicebot.

Acknowledgment
Special thanks to the members of the Alicebot mailing list ([email protected]) for their continued support of the project.                       .

Resources

  • A.L.I.C.E. AI Foundation: www.alicebot.org
  • The Alicebot.Net AI Project: www.alicebot.net
  • A.I.:Artificial Intelligence: http://aimovie.warnerbros.com
  • AgentLand (Cybelle): www.agentland.com
  • AIML Programming Language: www.alicebot.net/aiml/index.html
  • AIML Builder 1.0 by Bram Rooijmans: www.infobots.nl/Downloads/AIMLBuilder100.zip
  • MacALICE by Joost Van Brug: www.extrapink.com/alicemac
  • Open Source Foundation: www.opensource.org
  • More Stories By Jon Baer

    Jon Baer is a Java, Speech, and VoiceXML developer for MTV, Musicphone, Inc., and the lead developer for the Alicebot.Net AI Project. He has been developing wireless application for the past 3 years (including ThinAirMail 1.4 for PalmVII) and is currently working on an open source speech enabled Alicebot browser. Jon recently presented A.L.I.C.E. to the Interactive Telecommunications Program at New York University. He lives in Brooklyn, New York.

    Comments (1) View Comments

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    Most Recent Comments
    edward siew 05/23/03 12:44:00 PM EDT

    ai