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

Newbie question on stopping pre-processing of simple input
 
 

I suspect I’m missing something very basic here, as I just started looking at the manual and tutorial for Chatscript.

I took the basic simpletopic.top that comes with Chatscript (v 2.93 on windows ) and that does the basic questions shown in the tutorial, and tried to replace the “what is your name” rule with this modified one:


#! what is your name $bot = harry
u: ($bot=harry what is your name) My name is Harry Potter—what’s yours?
a: (My name is _*1 _*1 >) $firstninny = ‘_0 $lastnanny = ‘_1 Hello $firstninny $lastnanny .

This syntax is taken out of the manual, page 21, aside from the output. I believe the characters at the start of ‘_0 and ‘_1 are indeed ASCII character 39,  an apostrophe.

In order to run this multiple times I also had to modify the INTRRODUCTIONS topic to add noerase and repeat:

topic: ~INTRODUCTIONS noerase repeat (~emogoodbye ~emohello ~emohowzit name here )

That’s all I changed.  Here’s what I get, on two different machines:

My name             output name
============  =========
a b                 a B
A B                 a B
aaa bbb             AAA B
one two             rule does not fire
zdkjf zdkfjs         passed through correctly
Wade Schuette       rule does not fire
wade schuette       Wade Schutte   (  changed “ue” to “u” in the last name)

I would have expected (as a newbie) that by single quoting ‘_0 and ‘_1 that I would have
bypassed all pre-processing of the first and last name, but this is clearly not true.

What else do I need to do to simply capture, correctly, the two input words, and print them (capitalized or not) without other change in the output stream?

Thank you!

Wade

File Attachments
simpletopic.top  (File Size: 3KB - Downloads: 0)
 

 
  [ # 1 ]

I had the same issue with that one as well. Wish I could help.

 

 
  [ # 2 ]

First, you’d have to block all lower level preprocessing done on tokens. In simplecontrol.top,the bot definition of harry has this:
$token = #DO_INTERJECTION_SPLITTING | #DO_SUBSTITUTES   | #DO_NUMBER_MERGE   | #DO_PROPERNAME_MERGE | #DO_SPELLCHECK | #DO_POSTAG | #DO_PARSE

You would need to (for simplicity) make that $token = 0

Then it will not try to merge tokens that are proper names, or correct spellings of input that do not show up in the dictionary.

 

 
  [ # 3 ]

Ahh,  thank you.
Is $token just a user variable that I can change safely for the duration of one question, say? Or or there other side-effects I should know about?

The following seems to work.  Is this construction fairly safe?

#! what is your name $bot=harry
u: ($bot=harry what is your name) $oldtoken = $token $token = 0 My name is Harry Potter—what’s yours? Token is now $token . Oldtoken is saving value $oldtoken .
a: (My name is _*1 _*1 >) $firstname = ‘_0 $lastname = ‘_1 $token = $oldtoken Hello, $firstname $lastname . Token was restored to $token for the happy case.
      a: ($bot=harry) $token = $oldtoken Greetings, whoever you are.  Token was restored to $token for all other cases.

 

 
  [ # 4 ]

Yes, $token is just a user variable (albeit a privledged one) that you can change for any duration. In fact, you can change it after the fact.  Because things like user names are OFTEN a problem, when my asks for a user’s name, it alters $token for that volley, as you propose.  But also, if it detects something like the user pattern s: (my name is)  then it changes $token and does a ^retry(SENTENCE) to force a reanalysis of the sentence in the new format.  It can tell on the second pass that it has already done this because $token is now different from the default one.

 

 
  [ # 5 ]

What a great idea!  Thank you, Bruce!

 

 
  login or register to react