{"data":{"site":{"siteMetadata":{"title":"Developerayo","author":"Shodipo Ayomide"}},"markdownRemark":{"id":"2fa0eb46-d4d7-52b2-8b54-4383ceae2080","excerpt":"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…","html":"<p><img src=\"https://res.cloudinary.com/developerayo/image/upload/v1551555821/aiml.png\" alt=\"main image\"></p>\n<p>What is AIML?</p>\n<p>AIML or Artificial Intelligence Markup Language is an XML base language used for creating chatbots(AI), it is always saved with the extension (.aiml).</p>\n<p>The tag always used in AIML used to specify a new function is the <mark style=\"background-color: #9a69c2;\">category</mark> tag which has two other tags running under it that i s the <mark style=\"background-color: #9a69c2;\">pattern</mark> tag and the <mark style=\"background-color: #9a69c2;\">template</mark> tag. Inside the template tage we cound also have other tags inbute “Depnds on the type of BOT you are building” eg <mark style=\"background-color: #9a69c2;\">set</mark>, <mark style=\"background-color: #9a69c2;\">br/</mark>, <mark style=\"background-color: #9a69c2;\">srai</mark>…etc</p>\n<p>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 <mark style=\"background-color: #9a69c2;\">/category</mark>, <mark style=\"background-color: #9a69c2;\">/template</mark>, <mark style=\"background-color: #9a69c2;\">/srai></mark>, <mark style=\"background-color: #9a69c2;\">/set</mark>…etc</p>\n<h2>Example</h2>\n<div class=\"gatsby-highlight\" data-language=\"aiml\"><pre class=\"language-aiml\"><code class=\"language-aiml\">&lt;category&gt;&lt;pattern&gt;WHO IS ABRAHAM LINCOLN&lt;/pattern&gt;\n\n&lt;template&gt;was a great President of the United States, during the American Civil War.&lt;br/&gt;\n\n&lt;/template&gt;\n\n&lt;/category&gt;</code></pre></div>\n<p>When the user inputs this in on some very close to this, the bot will respond to the input</p>\n<p>“WHO IS ABRAHAM LINCOLN” with the response “was a great President of the United States, during the American Civil War.”.</p>\n<p>Now lets create a simple bot using AIML</p>\n<div class=\"gatsby-highlight\" data-language=\"html\"><pre class=\"language-html\"><code class=\"language-html\"><span class=\"token doctype\">&lt;!DOCTYPE html></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>html</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>body</span><span class=\"token punctuation\">></span></span>\n\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>em</span><span class=\"token punctuation\">></span></span>Emphasized text<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>em</span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>br</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>strong</span><span class=\"token punctuation\">></span></span>Strong text<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>strong</span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>br</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>code</span><span class=\"token punctuation\">></span></span>A piece of computer code<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>code</span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>br</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>samp</span><span class=\"token punctuation\">></span></span>Sample output from a computer program<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>samp</span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>br</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>kbd</span><span class=\"token punctuation\">></span></span>Keyboard input<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>kbd</span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>br</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>var</span><span class=\"token punctuation\">></span></span>Variable<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>var</span><span class=\"token punctuation\">></span></span>\n\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>body</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>html</span><span class=\"token punctuation\">></span></span></code></pre></div>\n<div class=\"gatsby-highlight\" data-language=\"aiml\"><pre class=\"language-aiml\"><code class=\"language-aiml\">&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;\n\n&lt;aiml version=”1.0&quot;&gt;\n\n&lt;category&gt;&lt;pattern&gt;Hi&lt;/pattern&gt;\n\n&lt;template&gt;Hi, I’m Oscar I was developed by Shodipo Ayomide 2017, &lt;br/&gt;How may I be of help&lt;/template&gt;\n\n&lt;/category&gt;\n\n&lt;category&gt;&lt;pattern&gt;What are you &lt;/pattern&gt;\n\n&lt;template&gt;I said, My name is Oscar and I was developed by Shodipo Ayomide ok! &lt;/template&gt;\n\n&lt;/category&gt;\n\n&lt;category&gt;&lt;pattern&gt;Why are you rude &lt;/pattern&gt;\n\n&lt;template&gt;Oh sorry, Please forgive my manners do not report me PLEASE!!! &lt;/template&gt;\n\n&lt;/category&gt;\n\n&lt;category&gt;&lt;pattern&gt;ok &lt;/pattern&gt;\n\n&lt;template&gt;PLEASE!!! &lt;/template&gt;\n\n&lt;/category&gt;\n\n&lt;/aiml&gt;</code></pre></div>\n<h2>Now lets explain Templates</h2>\n<p>A template specifies the response to a matched pattern.</p>\n<p><strong>I am Oscar by name</strong></p>\n<p>A template may use variables such as</p>\n<p>You told me you are <mark style=\"background-color: #9a69c2;\">get name=”user-age”</mark> years old\nwhich will fetch the users age if in db.</p>\n<p>Thanks for reading! 🔥🚀 </br></p>","timeToRead":2,"frontmatter":{"title":"Understanding the concept behind AIML","date":"December 08, 2017","description":"AIML or Artificial Intelligence Markup Language is an XML base language used for creating chatbots(AI), it is always saved with the extension (.aiml)."}}},"pageContext":{"isCreatedByStatefulCreatePages":false,"slug":"/understandng-the-concept-behind-AIML/","previous":null,"next":{"fields":{"slug":"/career-in-software-engineering/"},"frontmatter":{"title":"Career in Software Engineering"}}}}