What is AIML?
AIML or Artificial Intelligence Markup Language is an XML base language used for creating chatbots(AI), it is always saved with the extension (.aiml).
The tag always used in AIML used to specify a new function is the
category tag which has two other tags running under it that i s the
pattern tag and the
template tag. Inside the template tage we cound also have other tags inbute “Depnds on the type of BOT you are building” eg
But note something just as in HTML or any other programming Language or Scripting Language Even Markup Languages have a closing tag, here in AIML there is really not much a difference, the closing tags are
1<category><pattern>WHO IS ABRAHAM LINCOLN</pattern>23<template>was a great President of the United States, during the American Civil War.<br/>45</template>67</category>
When the user inputs this in on some very close to this, the bot will respond to the input
“WHO IS ABRAHAM LINCOLN” with the response “was a great President of the United States, during the American Civil War.”.
Now lets create a simple bot using AIML
1<!DOCTYPE html>2<html>3<body>45<em>Emphasized text</em><br>6<strong>Strong text</strong><br>7<code>A piece of computer code</code><br>8<samp>Sample output from a computer program</samp><br>9<kbd>Keyboard input</kbd><br>10<var>Variable</var>1112</body>13</html>
1<?xml version=”1.0" encoding=”UTF-8"?>23<aiml version=”1.0">45<category><pattern>Hi</pattern>67<template>Hi, I’m Oscar I was developed by Shodipo Ayomide 2017, <br/>How may I be of help</template>89</category>1011<category><pattern>What are you </pattern>1213<template>I said, My name is Oscar and I was developed by Shodipo Ayomide ok! </template>1415</category>1617<category><pattern>Why are you rude </pattern>1819<template>Oh sorry, Please forgive my manners do not report me PLEASE!!! </template>2021</category>2223<category><pattern>ok </pattern>2425<template>PLEASE!!! </template>2627</category>2829</aiml>
Now lets explain Templates
A template specifies the response to a matched pattern.
I am Oscar by name
A template may use variables such as
You told me you are
get name=”user-age” years old
which will fetch the users age if in db.
Thanks for reading! 🔥🚀