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

Gambits with Rejoinders
 
 

Hello again,

I have another question regarding a problem of mine. In my testing script I have many gambits that ask questions and rejoinders to accept answers. For example:

FILEquestions.top

#! outer world
rIMPW () 
 
Would you prefer to focus on the outer world or on your own inner world?
 
a: (<<outer>>) ^ImpPoint(E)
 
a: (<<inner>>) ^ImpPoint(I

#! yes
r:EXPT () ^keep()
 
[Do you like to analyze pros and cons, and then be consistent and logical in deciding?]
 a
:(<<[~yes yes]>>) ^ExpPoint(T

When I run the script and these questions show up:

FILEintroductions.top
   
>test
Question 1
Would you prefer to focus on the outer world or on your own inner world?
   >
outer
Try again
   

The script gambits the questions script but it does not stay for a rejoinder to fire off. I wanted to make a loop that would choose a random gambit and record the users answer before moving on to the next question.

Im quite baffled on how to approach this situation. Is there anyone who can help?

 

 
  [ # 1 ]

is this CS 4.90 (which has a rejoinder bug) or CS 4.91 (in which that bug was fixed?)

 

 
  [ # 2 ]

This is CS 4.91 where the bug was fixed.

 

 
  [ # 3 ]

start the harry introductions topic as follows and see if it works. It works for me. Since your code is incomplete, I don’t know what ^ImpPoint(E) and the like do.


topic: ~INTRODUCTIONS (~emogoodbye ~emohello ~emohowzit name here )
r: IMPW ()
Would you prefer to focus on the outer world or on your own inner world?
a: (<<outer>>) outer is it
a: (<<inner>>) inner is it

 

 
  [ # 4 ]

Sorry about the confusion, I fixed the problem. The ^ImpPoint(E) and those functions are simple point acumulators for IMPlicit and EXPlicit question types.

At first, when the scripts in introduction.top called to a question, after answering it the gambit responder would register a point via function call in question.top. In addition, CS would try to respond to the user response in the responder in introductions.top. I forgot about this because the after the responder added the points for correct answers in question.top, the it would also try to generate a response in introductions.top which confused me.

after realizing this and making changes to the question.top adding keep to the topic rather individual questions the very opposite happened. After one volley in the questions.top the control was lost and the program bombarded me with questions.

As a solution, I made question.top a system topic and added and nostay it tags to it. Also taking some knowledge from the forum discussion about general rejoinders, I made functions to pull questions from question.top, The functions are:
^ask() - pulls random question
^askExplicit() - pulls random explicitly asked question
^askImplicit() - pulls random implicitly asked question

 

 
  [ # 5 ]

So currently you are happy?
Note:  system is automatically nostay.

 

 
  [ # 6 ]

Yes I am very happy. I can proctor an exam of qustions explicitly or I can test users passively by calling questions during casual conversational flow. 

A few side notes though;
I could not get the loop() {} function to ask one question at a time so I created a psuedo loop that works great:

# Ask user to take the test, if declined give the passive test
#! yes
t: Do you want to take a test?
 
a:(<<[~no no]>>) ok then.
 
a:(<<[~yes yes]>>)
  
AwesomeLets get started\n
  $questions 
10
  
^reuse(TEST)

# Ask random questions pulled from the question bank
uTEST ($questions>0) ^keep() ^repeat()
 ^
ask() 
 
$questions -= 

So far this worlk great for me. Another unrelevant side note, Is there a wiki for ChatScript? I believe that having a wiki would help the growth of the ChatScript community and also for the advanced programmers; could be a place to showcase their bots and share their knowledge also. If there is no existing wiki, I would be happy to make one.

 

 
  [ # 7 ]

You can give me an example of the loop code you used and I can probably tell you how to fix it.

There is currently no Wiki for ChatScript. I’m happy for you to make one, but the question becomes where is it hosted? I don’t know enough about wiki essentials, and permission for writing, otherwise I would probably put the entire set of manuals as a wiki on brilligunderstanding.com

bruce

 

 
  [ # 8 ]
Bruce Wilcox - Dec 23, 2014:

You can give me an example of the loop code you used and I can probably tell you how to fix it.

There is currently no Wiki for ChatScript. I’m happy for you to make one, but the question becomes where is it hosted? I don’t know enough about wiki essentials, and permission for writing, otherwise I would probably put the entire set of manuals as a wiki on brilligunderstanding.com

bruce

The code for my loop was:

tTEST () ^keep()
     Do 
you want to take a test?
     
a: (~noOkfine
     a
: (~yesok great
          $questions 
15
          $state 
testing
         
^reuse(TESTING)

uTESTING ($state=testing) ^keep() ^repeat()
     
$questionNum 1
     loop
($questions)
     
{
             Question $questionNum 
:\n
             
^ask() \n
             $questionNum 
+= 1
     } 

The code above displays all questions as a bulk paragraph. Can you help?


When it comes to the wiki, I plan on using https://www.openshift.com/ for hosting, Ive hosted a few school projects including my own private wiki on it so starting up a new account and hosting the wiki will be simple.

As for the wiki essentials and permissions for writing, look into media wiki, they created the wiki engine used by Wikipedia and most wiki websites. I will create a forum looking for Wiki admins, developers, and managers adding you as an administrator as well of course.

Learning how the wiki works is simple and they are extendable and programmable. Have you ever heard of a wiki bot? In a nut shell its an autonomous account that performs whatever its programmed for. I hope soon we can also be able ChatScript into wiki bots but thats future reference and speculation.

 

 
  [ # 9 ]

Skipping temporarily the question of wikis..

For your loop, Loop uses a COUNT, not a condition, so once it is started it doesnt stop until it “fails” in some way or runs out of count. So when you do ^ask, if that generates a question, you’ll need to fail the loop. Easiest way is:
before the loop do:  $$tmpcount = %response and inside the loop after ask,
  if (%response != $$tmpcount)  end(rule)
which will terminate the loop

 

 
  [ # 10 ]

Note this is redundant patterning:

a:(<<[~no no]>>)

you don’t need << >> because you are not providing more than a single “thing” inside it, so order is moot anyway.
a: ( [~no no])
does the same job in this case.

 

 
  [ # 11 ]

on this wiki, I’ll happily take your help.  I’m fine with having you create a wiki there. I would then point to it from sourceforge.

do we start with putting all the doc sections as wiki sections?

 

 
  [ # 12 ]

Yes we would have all of the docs converted as wiki pages and links to the source forge page and any other pages to be listed. Currently my Internet situation is extremely limited temporarily. Ill have things going soon though.

Also thank you for the tip on my redundant patterning

 

 
  [ # 13 ]

Also,
If you have any preference,  what would you like to have the domain name and the wiki name?

 

 
  [ # 14 ]

dont know how they get used….  obviously ChatScript is a good name….
does ChatScript as domain and documentation as another make sense.

 

 
  [ # 15 ]

Anything new on the wiki thing?
I think it would be helpful and I will also try my best to donate from what I’ve learn.

 

 1 2 > 
1 of 2
 
  login or register to react