How to make lie detection possible in aiml?

How to make lie detection possible in aiml?

Problem Description:

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 – 1

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

Rate this post
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept
Reject