Loading...
Home -> Blog
  • Follow Siavash on Twitter
  • Add Siavash on Facebook
  • Follow Siavash on Google+
Bot:
RSS Feed Add to Delicous! Add to Digg! Add to Technorati! Add to Furl! Add to Blinklist! Add to Reddit! Add to Oyax! Add to Balatarin!

AIML
(Posted on 2007/09/05, 19:18:48)

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

Background

The XML dialect called AIML was developed by Richard Wallace and a worldwide free software community between the years of 1995 and 2002. It 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 Contest for Most Human Computer three times, and was also the Chatterbox Challenge Champion in 2004.

Because the A.L.I.C.E. AIML set was released under the GNU 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 in several languages have been developed and made available by the user community. The two current most active free implementations of an AIML interpreter is Program D, which is Java-based and has a large and active user and development community and RebeccaAIML, which also has a large and active user and development community and supports C++, Java, C#, and Python. There are also free / open source AIML interpreters available in Ruby, Python, C++, C#, Pascal, and other languages. A formal specification and a W3C XML Schema for AIML are available.

Elements of AIML

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

Categories

Categories in AIML are the fundamental unit of knowledge. A category consists of at least two further elements: the pattern and template elements. Here is a simple category:
  1. <category>
  2. <pattern>WHAT IS YOUR NAME</pattern>
  3. <template>My name is Siavash.</template>
  4. </category>
When this category is loaded, an AIML bot will respond to the input "What is your name" with the response "My name is Siavash."

Patterns

A pattern is a string of characters intended to match one or more user inputs. A literal pattern like
  1. 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
  1. 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, far less complicated than regular expressions. It tends to suffice for most chat-oriented purposes, and where it lacks, AIML interpreters can provide preprocessing functions to expand abbreviations, remove misspellings, etc.

Template

A template specifies the response to a matched pattern. A template may be as simple as some literal text, like
  1. My name is viswanathreddy.
A template may use variables, such as the example
  1. My name is <bot name="vissu"/>.
which will substitute the bot's name into the sentence, or
  1. You told me you are <get name="user-23"/> 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 srai. This can be used to implement synonymy, as in this example:
  1. <category>
  2. <pattern>WHAT IS YOUR NAME</pattern>
  3. <template>My name is <bot name="name"/>.</template>
  4. </category>
  5. <category>
  6. <pattern>WHAT ARE YOU CALLED</pattern>
  7. <template>
  8. <srai>what is your name</srai>
  9. </template>
  10. </category>
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.

References

Tags

language, bot, robot, aiml, programming

Comments

Name:
Email:
Website:
Comment:
 
Ghafoor Taheri:
Posted on 2010/04/15, 01:33:40
" You: hi Bot: Huh? You: salam Bot: Salaaaaam! You: englisi balad nisti? Bot: Huh? You: english? Bot: Huh? You: can u speak english? Bot: Huh? You: سلام Bot: سلاااام! You: اسمتون چیه؟ Bot: Huh? You: خوبی؟ Bot: Huh? You: خوبید؟ Bot: Huh? You: برو بابا Bot: Huh? You: salam Bot: Salam khoobi? :D You: mer30 Bot: Huh? You: khoobi? Bot: Khooob! to khoobi? You: khoobi? Bot: Aaaali! To cheTori? You: khoobi? Bot: Aaaali! To cheTori? You: khoobi? Bot: Khooob! to khoobi? You: khoobam Bot: Khoda ro shokr :D, Chekhabara? You: salamati Bot: Salam! You: bot badi hasti Bot: Baleh, Azizam :D, Kari dari? You: bad Bot: Huh? You: boro Bot: Huh? You: dooset nadaram Bot: Huh? You: chikar mikoni? Bot: Huh? "
slowflake:
Posted on 2009/02/11, 06:07:50
" xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
fara:
Posted on 2008/12/17, 15:38:15
" hello "
bote mozahem:
Posted on 2008/12/15, 08:43:43
" Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam Spam "
sfd:
Posted on 2008/09/14, 04:12:34
" sfgsgfsgfsgfsgfsfsfsfsgfsgsgsfgsfgsfgsfgsfgsgfsfgsfgfsfg "
sfd:
Posted on 2008/09/14, 04:11:21
" sgfsgf "