2

Hi There! I have a chatbot which contains n number of AIML files. each AIML files are related to different topics. but it may contain same patterns which causing a conflict while getting a reply from the chatbot. I wanna identify which topic the user is looking for. So how can I configure my chatbot according to this requirement?

AIML file 1

<category>
      <pattern>ABC</pattern>
      <template>abcdefghijklmnopqrstuvwxyz</template>
</category>

AIML file 2

<category>
      <pattern>ABC</pattern>
      <template>1234567890ABCD</template>
</category>

Both are associated with a single chatbot. So as an end user I want to get the answer from AIML file 2. How can I make my chatbot to understand my needs using program-o

molbdnilo
  • 64,751
  • 3
  • 43
  • 82
  • You can prompt some question if the bot identifies same pattern in multiple files. If you are looking for something else, do let me know – Akshay N Shaju Dec 07 '17 at 05:13

2 Answers2

0

I think you may need to look at the topic tag.

The concept is that the botmaster uses the <set_topic> tags to set the current topic being discussed. Once the topic is set, when the client types in a statement for ALICE to find a response for, the categories defined within the <topic> tags matching the current topic will be searched first-- before any of the non-topic categories, or the default categories. If there is not a matching category defined in the current topic, then any categories that are not defined in topic tags are searched. As mentioned before, you can create categories with identical <pattern> phrases in different topics, each with different responses that cater to the current topic.

The bold is my emphasis.

Mark_Gibson
  • 922
  • 1
  • 12
  • 32
0

You can do this with topics as described in the previous answer, although AIML interpreters implement topics in different ways, depending on whether you're using Pandorabots, Alice, or v1 or v2 of AIML.

Look at this problem another way: as you load more categories and files into your chatbot they need to be more specific. So if possible, make your ABC patterns more specific according to what type of question they answer.

Another approach similar to topics (but does not use the AIML interpreter's topic handling) is to set a global predicate in a previous category to the subject of interest. Assume you have a global property "subject" which you set to "text" or "numbers" in other categories. You could then merge your ABC patterns as follows:

<category>
  <pattern>ABC</pattern>
  <template>
    <condition>
      <li name="subject" value="text">abcdef...</li>
      <li name="subject" value="numbers">0123456789</li>
      <li>?</li>
    </condition>
  </template>
</category>
Ubercoder
  • 711
  • 8
  • 24