AI Zone Admin Forum Add your forum

Chatbot Conference London On Oct 3th Erwin will be moderating on the Chatbots conference in London. Why don't you meet him there? As a Chatbots.org visitor, you'll get a discount as well: Why don't we meet there? get a discount

We do experience some trouble with our forms and some details page. We'll fix this ASAP. Sorry for the inconvenience!
Problem with user input: period, separation and punctuation
 
 

Hello! i have a problem with user input. When user is trying to type keyword to trigger answer but that keyword is in other sentence, chatbot is not able to understand it. I think it’s because of searching until bot finds period or something like that. Same thing for some reason is with word “Hello”.
Code example:

topic: ~INTRODUCTIONS keep repeat [] 
t
Hello.
u: ([sup]test completed

u
: ([cya]test2 completed 

Output:

HARRY:  Hello.
qeqwe: > sup
HARRY
:  Test completed
qeqwe
: > hellosup
HARRY
:  I don't know what to say.
qeqwe: > asdasd, sup
HARRY:  Test completed
qeqwe: > asdasd. sup
HARRY:  I don'
t know what to say.
qeqwe: > . sup
HARRY
:  Test completed
qeqwe
: > 

How can i make my bot to ignore punctuation (period, colon, comma etc.) and “hello” word (or some other words if there will be some) ? I have tried different syntax of user input in my source code but non of that works.
Also to mention: my files%botname.txt only have simplecontrol.top of Harry and my introductions.top. I also added to simplecontrol.top

#DO_ESSENTIALS 
 

 
  [ # 1 ]

If you have a recent version of chatscript you should have the line

$singleResponse # issue only 1 output message 

in your bot outputmacro (e.g. harry()) in simplecontrol.top

This is the default behavior of the bot, it only answers to the first sentence and ignores all others.
When you remove the line your bot should answer to every sentence.

 

 
  [ # 2 ]

Thanks for the responce! I tried it and now it looks like this:

HARRY:  Hello.
asdsasda: > sup
HARRY
:  Test completed
asdsasda
: > hellosup
HARRY
:  I don't know what to say. Test completed
asdsasda: > asdasd. sup
HARRY:  I don'
t know what to sayTest completed
asdsasda
: > hellosup
HARRY
:  I don't know what to say. Test completed
asdsasda: > . sup
HARRY:  Test completed
asdsasda: > sup hello
HARRY:  Test completed 

It doesn’t match with my needs. Can i just skip the punctuation marks and find the matching word?

 

 
  [ # 3 ]
Peter Duda - Aug 24, 2017:

It doesn’t match with my needs. Can i just skip the punctuation marks and find the matching word?

I think you can, but as far as I know you have to deactivate all of the parsing and tagging chatscript does for you.

And this is probably not what you really want when you use chatscript for chatbot activity, you nearly use the basic functionality.

What I would recommend you to do is read the ControlScript manual and learn how the control script works. You can change nearly everything you can imagine there.

What you want to do is write a control script, which doesn’t say “I don’t know what to say.” for each sentence that didn’t generate a response, but only at the end if no sentence generated a response.

A quick and dirty solution would be to make the bot shut up completely if no topic matches and just deactivate the “I don’t know what to say”.
Simply delete the line which says “I don’t know what to say.” in simplecontrol.top for that (line 129/130)

 

 
  [ # 4 ]

Thanks for advice. I have read 50-60% of chatscript manual. Where can i find ControlScript manual?
Also i don’t want to remove “I don’t know what to say” line because I’ll replace it with some command to server. I mean if chatbot will not understand user input, then server will do some stuff. That’s why i need the “I don’t know what to say” line but i need to trigger it when nothing is matching, not one of the sentences.

 

 
  [ # 5 ]
Peter Duda - Aug 24, 2017:

Thanks for advice. I have read 50-60% of chatscript manual. Where can i find ControlScript manual?
Also i don’t want to remove “I don’t know what to say” line because I’ll replace it with some command to server. I mean if chatbot will not understand user input, then server will do some stuff. That’s why i need the “I don’t know what to say” line but i need to trigger it when nothing is matching, not one of the sentences.

https://github.com/bwilcox-1234/ChatScript/blob/master/WIKI/ESOTERIC-CHATSCRIPT/ChatScript-Control-Scripts.md

 

 
  [ # 6 ]

thanks, will definitely rear it.

 

 
  [ # 7 ]

Peter Duda - Aug 24, 2017:
It doesn’t match with my needs. Can i just skip the punctuation marks and find the matching word?

You can change token control to disable various ending sentence marks. It probably wont matter about parsing and canonical forms will probably still work. A sentence has a limit of 254 words, so it will still break there. 

THe control script manual is in ESOTHERIC-CHATSCRIPT folder.

You can edit the control script just before you say “I dont know what to say” to add this

if (%more OR %response) {^end(TOPIC)}

 

 
  login or register to react