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

Interrupting Rejoinders and returning
 
 

Hi Everyone, Can someone explain if this is possible.

What I want to do is have the ability to break rejoinders with random topics or inputs and then return back to the path.
Here is a sample of the dialouge I want to achieve by leaving a rejoinder with any random topic that a user might say, and that I have made.

Harry: Do you have any pets
User: Yes
Harry: What Kind?
User: Do you know about death?
Harry: I don’t want to die
User: When will you die?
Harry: I don’t know
Harry: What kind of pet do you have
User: Dog
Harry: I love animals


So for example in this code I found in the wiki, if we are in the pet interaction but break the rejoineder with the death topic and then return back to the pet discussion, how can we achieve this?


t: Do you have any pets
  a: (~yes) refine()
      b: (%more) Next(input) refine()
        c: (~pets) … wow # react to pet
        c: () ^retry(SENTENCE) # return to try input from scratch
      b: () What kind do you have?
        c: (~pets) … wow I love animals# react to pet

topic: ~DEATH [dead corpse death die body]

t: I don’t want to die
?: (When will you die) I don’t know.
t: lets get back to our topic

 

 
  [ # 1 ]

Normally CS maintains a stack of contexts so it might do this on its own. However you could script the following idea.

Start by memorizing the current topic (%topic) at the start of the conversation. During postporcessing, see if you are in a new topic at the end. If so, create a fact of the old topic (building a stack manually). When your new topic gets exhausted,
do a query to get this stack, and loop on the answer doing 1.delete the first found fact 2. ^gambit of the topic. If no answer is generated, stay in the loop. If one is generated break out of the loop

 

 
  [ # 2 ]

Thank you, Is this done in the control script?

 

 
  login or register to react
‹‹ clients using ChatScript      chatscript logo ››