aiml stands for artificial intelligence markup language. aiml was developed by the alicebot free software community and dr. richard s. wallace during 1995-2000. aiml is used to create or customize alicebot which is a chat-box application based on a.l.i.c.e. (artificial linguistic internet computer entity) free software.
aiml tags
following are the important tags which are commonly used in aiml documents.
| s.no. | aiml tag / description |
|---|---|
| 1 |
<aiml> defines the beginning and end of a aiml document. |
| 2 |
<category> defines the unit of knowledge in alicebot's knowledge base. |
| 3 |
<pattern> defines the pattern to match what a user may input to an alicebot. |
| 4 |
<template> defines the response of an alicebot to user's input. |
we'll discuss each of these tags in aiml basic tags chapter.
following are some of the other widely used aiml tags. we'll be discussing each tag in details in coming chapters.
| s.no. | aiml tag / description |
|---|---|
| 1 |
<star> used to match wild card * character(s) in the <pattern> tag. |
| 2 |
<srai> multipurpose tag, used to call/match the other categories. |
| 3 |
<random> used <random> to get random responses. |
| 4 |
<li> used to represent multiple responses. |
| 5 |
<set> used to set value in an aiml variable. |
| 6 |
<get> used to get value stored in an aiml variable. |
| 7 |
<that> used in aiml to respond based on the context. |
| 8 |
<topic> used in aiml to store a context so that later conversation can be done based on that context. |
| 9 |
<think> used in aiml to store a variable without notifying the user. |
| 10 |
<condition> similar to switch statements in programming language. it helps alice to respond to matching input. |
aiml vocabulary
aiml vocabulary uses words, space and two special characters * and _ as wild cards. aiml interpreter gives preference to pattern having _ than pattern having *. aiml tags are xml compliant and patterns are case-insensitive.
example
<aiml version = "1.0.1" encoding = "utf-8"?>
<category>
<pattern> hello alice </pattern>
<template>
hello user!
</template>
</category>
</aiml>
following are the important points to be considered −
<aiml> tag signifies start of the aiml document.
<category> tag defines the knowledge unit.
<pattern> tag defines the pattern user is going to type.
<template> tag defines the response to the user if user types hello alice.
result
user: hello alice bot: hello user