Artificial Intelligence Markup Language Explained

Artificial Intelligence Markup Language
Icon Size:100px
Extension:.aiml
Owner:Dr. Richard S. Wallace
Released: [1]
Latest Release Version:2.1[2] (rev 1.0.2.22)
Latest Preview Version:2.0
Latest Preview Date: [3] -->
Genre:Artificial intelligence
Extended From:XML
Open:Yes

Artificial Intelligence Markup Language (AIML) is an XML dialect for creating natural language software agents.

History

The XML dialect called AIML was developed by Richard Wallace and a worldwide free software community between 1995 and 2002. AIML formed the basis for what was initially a highly extended Eliza called "A.L.I.C.E." ("Artificial Linguistic Internet Computer Entity"), which won the annual Loebner Prize Competition in Artificial Intelligence[4] three times, and was also the Chatterbox Challenge[5] Champion in 2004.

Because the A.L.I.C.E. AIML set was released under the GPL, and because most AIML interpreters are offered under a free or open source license, many "Alicebot clones" have been created based upon the original implementation of the program and its AIML knowledge base. Free AIML sets[6] in several languages have been developed and made available by the user community. There are AIML interpreters available in Java, Ruby, Python, C++, C#, Pascal, and other languages (see below).A semi-formal specification[7] and a W3C XML Schema for AIML[8] are available.

Since early 2013, The A.L.I.C.E foundation has been working on a draft specification for AIML 2.0.[9]

Elements of AIML

AIML contains several elements. The most important of these are described in further detail below.

Categories

Categories in AIML form the fundamental unit of knowledge. A category consists of at least two further elements: the pattern and template elements. Here is a simple category:

WHAT IS YOUR NAME

When this category is loaded, an AIML bot will respond to the input "What is your name" with the response "My name is Michael N.S Evanious."

Patterns

A pattern is a string of characters intended to match one or more user inputs. A literal pattern like

WHAT IS YOUR NAME

will match only one input, ignoring case: "what is your name". But patterns may also contain wildcards, which match one or more words. A pattern like

WHAT IS YOUR *

will match an infinite number of inputs, including "what is your name", "what is your shoe size", "what is your purpose in life", etc.

The AIML pattern syntax is a very simple pattern language, substantially less complex than regular expressions and as such less than level 3 in the Chomsky hierarchy. To compensate for the simple pattern matching capabilities, AIML interpreters can provide preprocessing functions to expand abbreviations, remove misspellings, etc.

The AIML syntax itself is at least as complex as finite state machines and as such at least of level 3 in the Chomsky hierarchy. This is because a state correlates to one topic. To implement that behavior, the topic should have a "*" Pattern to make sure, that the state is not left accidentally. A state transit is implemented with the Tag. This way, the bot will be able to "remember" the topic talked about or even user privileges, which are gained during the chat.

Templates

A template specifies the response to a matched pattern. A template may be as simple as some literal text, like

My name is John.

A template may use variables, such as the example

My name is .

which will substitute the bot's name into the sentence, or

You told me you are years old.

which will substitute the user's age (if known) into the sentence.

Template elements include basic text formatting, conditional response (if-then/else), and random responses.

Templates may also redirect to other patterns, using an element called (Symbolic Reduction in Artificial Intelligence). This can be used to implement synonymy, as in this example (where CDATA is used to avoid the need for XML escaping): WHAT IS YOUR NAME WHAT ARE YOU CALLED

The first category simply answers an input "what is your name" with a statement of the bot's name. The second category, however, says that the input "what are you called" should be redirected to the category that matches the input "what is your name"—in other words, it is saying that the two phrases are equivalent.

Templates can contain other types of content, which may be processed by whatever user interface the bot is talking through. So, for example, a template may use HTML tags for formatting, which can be ignored by clients that don't support HTML.

Notes and References

  1. Web site: Press Release: AIML 1.0 Standard Passed (A.L.I.C.E. AI Foundation) . alicebot.org . 1 December 2013 . https://web.archive.org/web/20070715113602/http://www.alicebot.org/press_releases/2001/aiml10.html . 15 July 2007 . San Francisco CA . en . 16 July 2001.
  2. Web site: AIML 2.1 (AIML Foundation) . aiml.foundation/ . 2022-06-11 . https://web.archive.org/web/20190514124117/http://www.aiml.foundation/doc.html . 14 May 2019 . live.
  3. Web site: Wallace . Richard S. . AIML 2.0 Working Draft . docs.google.com . ALICE A.I. Foundation . 1 December 2013 . en.
  4. Web site: loebner.net - Informationen zum Thema loebner. . loebner.net . 10 November 2010 . https://web.archive.org/web/20101230195120/http://www.loebner.net/Prizef/loebner-prize.html . 30 December 2010 . 26 October 2007.
  5. Web site: Chatterbox Challenge . chatterboxchallenge.com . 10 November 2010 . https://web.archive.org/web/20060325195507/http://www.chatterboxchallenge.com/ . 25 March 2006 . dead.
  6. Web site: Free AIML sets - aitoold.org . aitools.org . https://web.archive.org/web/20061009222437/http://aitools.org/Free_AIML_sets . 9 October 2006 . 17 May 2006.
  7. Web site: AIML 1.0.1 (A.L.I.C.E. AI Foundation) . alicebot.org . 1 December 2013 . https://web.archive.org/web/20131118214101/http://www.alicebot.org/TR/2011/ . 18 November 2013 . en . 13 October 2011 . dead .
  8. Web site: AIML.xsd . aitools.org . 10 November 2010 . https://web.archive.org/web/20060317085750/http://aitools.org/programd/resources/schema/AIML.xsd . 17 March 2006.
  9. Web site: AIML 2.0 draft specification released . alicebot.blogspot.com . 19 June 2014 . https://web.archive.org/web/20130518171303/http://alicebot.blogspot.com/2013/01/aiml-20-draft-specification-released.html . 18 May 2013 . 16 January 2013.