AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Wildcard question
 
 

I’m trying AIML for the first time and have used the following patterns:

XADD *1 XADD *0
XADD * XADD *

Whilst the former correctly overrides the latter for XADD 1 XADD 0, the latter overrides the former whenever I do something like XADD 11 XADD 10 or XADD 11 XADD 0, etc. (so whenever multi-digit numbers are used). Am I doing something wrong?

EDIT: I should mention, the latter pattern even overrides XADD _1 XADD _0 in such cases.

EDIT2: To be clear, the idea is for *1 to match any number that ends in 1 and for *0 to match any number that ends in 0 (I’m aware that it’ll also match non-numbers ending in 0 as well, but don’t mind).

 

 
  [ # 1 ]

While I’m here, I might as well also ask a couple more questions that have been bugging me:

* Is it possible to forget categories learned through <learn> (within the same session)?
* How do you match the ‘*’ pattern (as opposed to * as a wildcard)?

 

 
  [ # 2 ]

You should have spaces between the wildcards and the numbers and also need to use the explode tag to split your numbers into separate chatracters.

There is currently no way to forget a learned category apart from overwriting it with a new one.

The only way to match * is to substitute * for “times” or “multiplied by”, as all punctuation is stripped out before the input is dealt with by the interpreter. If you are using a free Pandorabots account, you cannot do this directly and must pre-process your input.

Hope that makes sense. If you need any further help, please feel free to ask.

 

 
  [ # 3 ]

Thanks for the help. smile Another question: Is there any way to use the zero-or-more wildcards defined by the AIML 2.0 standard in a free pandorabot? (I had an odd experience where they actually seemed to be working for a time, but now # only matches ‘#’ and ^ only matches ‘^’)

EDIT: Also, what about AIML 2.0 sets and maps?

 

 
  [ # 4 ]

I believe Pandorabots are currently enabling AIML 2.0 features and so you may have caught a match when they were experimenting with this. You can’t currently use AIML 2.0 in a free pandorabot though.

 

 
  [ # 5 ]

Do you happen to know what the recursion limit is on the interpreter used with the Pandorabots Playground? For that matter, is there an AIML-standard limit or does it vary from interpreter to interpreter (or both)? I’m hitting the limit on some inputs, but I’m not sure whether it’s because of a flaw in the code or simply because I use a lot of recursion.

 

 
  [ # 6 ]

Never mind, it was a bug in my code (I’d still be interested to know the recursion limit though).

 

 
  [ # 7 ]

The recursion on the free server used to be about 20. Not sure with the playground format but you can work it out by using categories like this:

<category>
    <
pattern>TEST RECURSION</pattern>
    <
template>
        <
srai>srai 1</srai>
    </
template>
</
category>

<
category>
<
pattern>SRAI 1</pattern>
    <
template>
        <
srai>srai 2</srai>
    </
template>
</
category>

<
category>
<
pattern>SRAI 2</pattern>
    <
template>
        <
srai>srai 3</srai>
    </
template>
</
category

Keep adding srai categories until you get a too much recursion error. The maximum recursion on a paid server is 256.

I just checked out the free site and you can use AIML 2.0 in the “playground” part of the site.

 

 
  [ # 8 ]

Yeah, I found the playground and I’ve been using it. If the free server’s recursion limit used to be 20, then either that’s been increased or the playground has a higher limit, as I’m pretty sure I’d be hitting that all the time.

 

 
  [ # 9 ]

Tested - the playground appears to have a recursion limit of 256 (just defined an infinitely recursive category and then examined the trace to see how deep it got before stopping).

Another question: On some inputs, I get ‘srai input too long’. What’s the longest an srai input can be?

EDIT: Never mind, was able to test it myself. Limit appears to be 500 characters, or thereabouts.

 

 
  [ # 10 ]

...Which is odd. The trace doesn’t suggest that any srai inputs are ever getting close to being that long. <Confused>

 

 
  [ # 11 ]

Thanks for all the help. smile I’ve just completed my first AIML project - not a chatbot, but a question-answering system designed to answer arbitrary questions of the form a + b where a and b are nonnegative integers. My next step is to extend it to arbitrary arithmetic.

 

 
  [ # 12 ]

Cool! Always happy to help.

 

 
  login or register to react