Settings.xml and bot.aiml

tiger
2007-02-14
2013-04-22
  • tiger

    tiger - 2007-02-14

    I set   <item name="gender" value="male"/>, but still got the response below. How to get around it?
    You: are you a woman
    Bot: Yes I have long hair. I am also wearing a dress.

    The above is because bot.aiml has:
    <category><pattern>ARE YOU A WOMAN</pattern><template>Yes I have long hair. I am also wearing a dress.</template></category>         

    JW

     
    • Nicholas Tollervey

      Hi JW,

      This isn't a problem with the bot, rather that the AIML is not correct. The only way around this is to change the AIML so that (for example) the pattern: "are you a woman" is matched using a category like the following:

      <category>
        <pattern>
          ARE YOU A WOMAN
        </pattern>
        <template>
          <condition>
            <li name="gender" value="female">Yes I have long hair. I am also wearing a dress.</li>
            <li name="gender" value="male">Certainly not! I'm most definitely a male of the species!</li>
            <li>You think computers have gender? Weird....</li>
          </condition>
        </template>
      </category>

      Using the <condition> tag I've listed a number of options depending on what value "gender" is set to. Each <li> tag has a name (referencing the name of the predicate) and value (referencing the value we're testing against) attribute with the response as the inner text. Notice that I have a "default" <li> tag with no predicate matching just in case we can't match the previous two checks.

      I hope this clears things up for you.

      Best wishes,

      Nicholas

       
      • tiger

        tiger - 2007-02-14

        Great. Thanks.

         

Log in to post a comment.