1

So i'm trying to create a chatbot with forward chaining on AIML. So far what I have known to do is to set values on variables on specific statements only and that won't simply do.

So here's what I have for now:

<category>
<pattern>THE COLOR OF THE * IS *</pattern>
<template>I will remember that

<learnf>
<category>
    <pattern>WHAT COLOR IS THE <eval><star/></eval></pattern>
    <template><eval><star index= "2"/></eval></template>
</category>
</learnf>

</template>

I'm using the <learnf> tag so that the bot will save the input of the user from the asterisks(*). This is just a basic way of saving inputs and it wont be viable to multiple statements.

What Im trying to do is to save the inputs into variables so that somehow, the bot can deduce something if I asked about it like for example saying "the law states that if you stole something, you're a criminal" and if you ask the bot "what does the law say if you stole something?" it will reply: "You're a criminal".

<category>
    <pattern>THE LAW SAYS IT IS A * FOR AN * TO * TO *</pattern>
    <template>So... for an <set name= "race"><star index= "2"/></set> to <set name= "action"><star index= "3"/></set> to <set name= "relation"><star index= "4"/></set>, it is a <set name= "law"><star/></set>? 
    Ok...</template>
</category>

<category>
    <pattern>What law</pattern>
    <template>it is a <get name= "law"></get>.</template>
</category>

This code is my try on Forward Chaining, if you guys can help me make the "algorithm" of FC more "visible" when the bot is being used, it would be great.

Thanks!

Xenos29
  • 17
  • 8

0 Answers0