chatbotaiml

How to make lie detection possible in aiml?


in aiml i am trying to make bot detect if user has lied there name or not. for instance if a user tells two different names to bot then bot will detect that user is lying by retrieving previous values. here is the code

<category>
    <pattern>MY NAME IS *</pattern>
    <template>
     cool name! 
     <think>
         <set name="name"><star/></set>
         <set name="naem">naem</set>
         </think>
    </template>
</category>


<category>
    <that>cool name</that>
    <pattern>MY NAME IS *</pattern>
    <template>
       i thought you are <get name="name"></get>
      </template>
</category>

there are 2 scenarios of this code

HUMAN: My name is jessop
ROBOT: cool name!
HUMAN: My name is siemens
ROBOT: I thought you are jessop

The above scenario works as it is but in second scenario it doesnt make any sense

HUMAN: My name is jessop
ROBOT: cool name!
HUMAN: My name is jessop
ROBOT: I thought you are jessop

I want to make sure that bot should able to recognize if user has told their name twice which are similar. like this one

HUMAN: My name is jessop
ROBOT: cool name!
HUMAN: My name is jessop
ROBOT: I know you are jessop 

is there any possibility to achieve output like above scenario?


Solution

  • Assuming you are using UNKNOWN for the default value of predicates

    <category>
        <pattern>MY NAME IS *</pattern>
        <template>
            <condition name="name">
                <li><value><star/></value>I know you are <star/>!</li>
                <li value="UNKNOWN"><think><set name="name"><star/></set></think>cool name!</li>
                <li>I thought you are <get name="name"/></li>
            </condition>
        </template>
    </category>
    

    enter image description here