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

when no gambits left…
 
 

Hello again! grin

I have a problem in simplecontrol with this rule:

if (%response == 0)
{
@8 = ^GambitTopics() # all topics with gambits (excluding system topics)
loop()
{
$$topic = pick(@8)
nofail(TOPIC ^Gambit($$topic)) # try a topic at random
if (%response != 0)
{
^end(RULE)
}
  }
}

The rule is followed by one last rule where I added a ^respond(DEFAULT_TOPIC) for when all else fails.  I don’t have many gambits and when I’ve used them all up the above rule causes

FAILRULE (^gambittopics)
—> FailTopic ~control

and hence the next rule never gets a chance. So how can I prevent that FAILRULE from occurring?

Thanks!

 

 
  [ # 1 ]

I’m not quite sure what you are saying…

1. you call ^respond(DEFAULT_TOPIC) if everything else fails, I presume to get a gambit, which means you should be calling ^gambit(DEFAULT_TOPIC) instead.

2. in currently released chatscript there may be a bug wherein gambittopics returns a fail code if it finds nothing. In the next release (probably this weekend), that will be fixed (my code no longer has that bug)

3. You can PATCH that temporarily by this I think (untested)
  @8 = null
  nofail(RULE @8 = ^gambittopics() )

 

 
  [ # 2 ]

nofail(RULE @8 = ^gambittopics() ) did the trick. I had tried nofail(TOPIC ..) but that prevented the plausible gambits from being called.

Thanks!


DEFAULT_TOPIC is mostly responders (I’ve been on/off on having gambits there). I’ll further comment in case you notice I should’ve done it some other(easier/efficient) way. Actually I read you changed the method of gambits and responders in 2.9, but I haven’t gotten into that yet. My method is older. (BTW the issue above I also had since 2.71, but couldn’t deal with it at the moment. I’m running 2.9 now).

So basically what I do is, if all else has failed (DEFAULT_TOPIC is not accessible through keywords), try to identify keywords from questions to respond with something similar to

  “I know you are asking about “keyword”, but I didn’t get it, maybe you wanted to ask something like….”

and give an appropriate suggestion.

In fact, some of these keywords are also topic keywords. I’ve been thinking of a method to determine which failed topic and responder was closest to matching and hence improve the suggested answer. Of course if my responders were perfect catchers this issue would be minimized… anyway, still thinking…

 

 
  [ # 3 ]

I’d like to test your sources… nofail(TOPIC ...) should have been no worse that nofail(RULE ...)
if you want me to play with your stuff and comment on the code…  gowilcox at gmail.com

 

 
  [ # 4 ]
Bruce Wilcox - Sep 7, 2012:

I’d like to test your sources… nofail(TOPIC ...) should have been no worse that nofail(RULE ...)

and so it seems. I don’t know why it didn’t work previously but it does. My only guess is maybe I didn’t properly :reset… I’ll blame it on the mess when tracing all wink

 

 
  [ # 5 ]

—about the changed gambits and responders—

the change in no way changes the ultimate effect and use of these things. Merely that you are now allowed to intermix them in a topic at your convenience instead of being forced to write all gambits before all responders.

—about your default topic—
sure. I have a variety of “keywordless” responder topics that come into play to see if they can answer a question, eventually including all the quibble topics.

—I’ve been thinking of a method to determine which failed topic and responder was closest to matching and hence improve the suggested answer—
Which failed topic is closest can be gotten from the facts of “KeywordTopics”. Which responder was closest is not available.

 

 
  login or register to react