AIML wildcards match V/S EXACT/NEAREST match

49 Views Asked by At

As I was trying AIML chatbot using AB.jar, when I have a nearest match,chatbot is giving me a wildcard match response.

Suppose I have below categories ,

<aiml>
<category><pattern>^ NEFT ^ LIMIT</pattern>
  <template>NEFT_LIMIT</template>
</category>

<category><pattern>NEFT ^</pattern>
 <template><srai>NEFT_DEF</srai></template>
</category>
</aiml>

When I TRY TO CALL NEFT Transaction limit, I am getting response set for "NEFT ^", i.e. NEFT_DEF.

How to get response set for "^ NEFT ^ LIMIT" ?

Please let me know.

1

There are 1 best solutions below

4
On

AIML works by examining each part of the input and finding a path through its graph database. For an input such as "NEFT Transaction limit", it takes the first part NEFT and sees which category it matches. The choices being the ^ wildcard or NEFT, so naturally it matches your 2nd category. To override this, either change the ^ to # which overrides anything else or miss out the first ^ entirely.

<category>
    <pattern># NEFT ^ LIMIT</pattern>
    <template>NEFT_LIMIT</template>
</category>