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..

Sets and Synonyms
 
 

I am trying to formulate AIML to provide alternative ways for the user to ask the same question.
The following code, where * is name of an element, works OK.
<category>
HOW MANY PROTONS DOES * HAVE</pattern>
<template>
<srai>XCHECKELEMENT <star index=“1”></srai>
<get name=“element”> has <get name=“protons”> proton.
</template>
</category>

I would like to allow the user to ask the question in a different format. I have tried the following code, and several variations on it,  but it doesn’t work.
<category>
WHAT IS THE NUMBER OF PROTONS IN * </pattern>
<template><srai>HOW MANY PROTONS DOES HAVE<star></srai></template>
</category>

Any help would be greatly appreciated.

John Flynn
http://semanticsimulations.com

 

 
  [ # 1 ]

Hi, John.

This is one of the great challenges with AIML chatbots, in that in order for a chatbot to be most useful/lifelike/etc. you have to code a lot of semantically identical categories in order to cover nearly every means of asking the same question, or saying the same thing. I really don’t have an immediate answer for you, but your question got me to thinking about how something like this might be accomplished and I thought of an idea that may pay off in the long term. What if there was a tool that allowed a user to input a single statement or question, and this tool created a large corpus of alternative means of expressing the same thing? Heck, it’s entirely possible that an AIML chatbot could be coded to perform this function, with a bit of effort and brain sweat. Granted this doesn’t halp much in the here and now, but I think that the idea has merit, and some potential future benefits, if the project is shared.

Just a thought. wink

 

 
  [ # 2 ]

by the way, this site may help:

http://www.macmillandictionary.com/us/thesaurus-category/american/ways-of-asking-questions-and-making-requests

 

 
  [ # 3 ]

HOW MANY PROTONS DOES HAVE <star> will never match your original category, as you have the <star> at the end smile

Try this:

<category>
<
pattern>WHAT IS THE NUMBER OF PROTONS IN * </pattern
<
template><srai>HOW MANY PROTONS DOES <star/> HAVE</srai></template>
</
category

This would be more efficient as it misses an extra recursion step out:

<category>
<
pattern>WHAT IS THE NUMBER OF PROTONS IN * </pattern
<
template><srai>XCHECKELEMENT <star index="1"/></srai>
<
get name="element"/> has <get name="protons"/> proton. </template>
</
category
 

 
  [ # 4 ]

Yes,  that works just fine.

Thank you Steve

 

 
  [ # 5 ]

No problem John. Sometimes it just takes an extra pair of eyes.

 

 
  login or register to react