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

Respond to ? and !
 
 

Sorry to ask this very simple question, but I couldn’t figure it out.

I want chatscript to respond to the enquiry:

what is blblblbl

with one standard response regardless if the user wrote:
what is blblblbl
what is blblblbl?
what is blblblbl.
what is blblblbl!

I thought using a u: or a s:  instead of ? or ! at the start of the rule would do the trick, but neither seem to.
topic: ~testest (blb blbl blblblbl)
t: How can I help you?
u: (what is blblblbl) blblbl is our new system

I am sure it is super simple, but I couldn’t find the answer in the manual.

PS: Is there a sample set of common enquiries somewhere? Something like in personalityforge with xintroduce etc. where I can easily add some standard answers?

 

 

 
  [ # 1 ]

I don’t know what you did wrong. I copied your topic directly into harry and rebuilt, and it worked fine.

There is no sample set of common enquires.

 

 
  [ # 2 ]

What might be an idea (or at least something to consider) would be for the ChatScript community to get together and create a “default chatbot”, something similar to AIML’s ALICE set (minus all of the identifiable responses, of course, and not as detailed), with the intended goal of sharing it with the world by including it with ChatScript. It doesn’t have to be anything fancy, mind you. Just something of a “bare bones framework” of simple responses to common inputs. smile

[edit]
Please note that I’m not suggesting that Bruce take time away from his busy schedule to contribute. He’s got enough on his plate. cheese
[/edit]

 

 
  [ # 3 ]

I am still not entirely sure why things are working now. Did a number of rebuilds and restart the program/windows command.

I am still struggling a lot with what I would call setting up even basic chat scripts. I am sorry to say it, but chatscript isn’t easy to learn. In my personal opinion I don’t find it has ” easily readable output rules “, as there are a lot of implications in all kind of parts that need to be know to understand the expected output. For simple scripts I find AIML easier (and certainly Personalityforge is much easier with it’s interface). I do belief though that chatscript is very powerful, but that seems to come with a price.

I am still willing to learn though, so one question I am currently battling with:

E.g. why does the last topic not work? When can I / have to use an empty [] vs a () with a keyword in it?

topic: ~introductions[]
t: [Hello][Hi], speak to me!
u: (what are you) ^keep() ^repeat() I am bot here to help you.
u: (how can you help) ^keep() ^repeat() I provide answers my botmaster collected.

topic: ~fnomad(nomad fringe)
u: (what is nomad) ^keep() ^repeat() Nomad is wanderer.
u: (what is a fringe) ^keep() ^repeat() It is a hairstyle.


topic: ~fss[]
u: (what title) Yes.

 

 
  [ # 4 ]

Topic keywords allow the system to automatically connect your input to rules that have matching keywords. So in your last topic, “what title” is never going to be found unless the topic contains the topic keywords of EITHER what or title or both. Logically “what” is a lousy keyword, so the keyword for the topic would be “topic”.

You can use a topic with 0 keywords IF it is directly called from your control script or from some other topic.

In my world I have a topic called ~keywordless, which is just a collection of rules that have no logical home topic, and this topic is called directly from the control script when other topics fail to match the input and respond.

 

 
  [ # 5 ]

I have rewritten the BASIC TOPICS documentation as follows:

Keywords allow the system to consider this topic based on matches with the user input.
If the user input has no keywords in common with the topic, then normally the topic and all its rules will not be considered.  User sentence keywords trigger the closest matching topic (based on number and length of keywords) for evaluation. If the engine can find a matching responder, then it shifts to that topic and replies. Otherwise the engine tries other matching topics. Eventually, if it can’t find an appropriate responder, it can go back to the most relevant topic and just dish out a gambit (the t: rule). 

It doesn’t matter if the new topic has responders that overlap some other topic’s responders (both could match the input). You can have a topic on ~burial_customs and another on ~death. An input sentence I don’t believe in death might route you to either topic, but that’s reasonable. 

Topics make it easy to bundle rules logically together. Topic keywords mean the author can script an independent area of conversation without regard to pre-existing script and the system will automatically find it and invoke it as appropriate.

Topics do not have to have keywords.  But if a rule in that topic is going to be considered, either the topic has keywords that can be found in the pattern of that rule, OR, the topic is already the current topic (some other rule had keywords in its pattern that also were topic keywords and got you entry into the topic) OR, the topic was directly called by the control script or some other topic.

 

 
  [ # 6 ]

Nothing is free—-  power always comes with a price.  smile

 

 
  [ # 7 ]

Let see if I understood. If there is already a topic without keywords e.g. topic: ~introductions[], chatscript won’t pick up the rule from another topic without keywords topic: ~fss[] . Even if it can’t find a match in the first topic?

 

 
  [ # 8 ]

And something else I can’t get my head around.

topic: ~introductions[]
t: ^keep() [Hello] [Hi] [Welcome], [how can I help][what can I][what can I for you]?

u: (fringe benefit)  ^keep() ^repeat() Zzzzz

u: (*fringe benefit*) ^keep() ^repeat() Yyyyy.

u: (what is BO) ^keep() ^repeat() BO stands for xxx.

u: (Can I go back) ^keep() ^repeat() xx.

?: (where do you live) ^keep() ^repeat() On a computer.


I am trying simple things, so I just enter exactly what is in the brackets.
In the script above, chatscript if I type “fringe benefit” it won’t execute the rule u: (fringe benefit)  , but only the rule u: (*fringe benefit*) with the *. Why is that so?
And why will it respond if I create a rule that has only the word fringe in the bracket e.g. u: (fringe) ?


This might be answered with the example above, because I struggle the same with this rule u: (Can I go back) ^keep() ^repeat() xx.    not being triggered, but this one does without a problem
?: (where do you live) ^keep() ^repeat() On a computer.

And it doesn’t even matter if I put a question mark in my input. I don’t understand why chatscript doesn’t respond to “Can I go back”, but does “where do you live”. Both are just a string of words, why does it handle them differently?

 

 

 

 

 

 
  [ # 9 ]

Sort of.  The ONLY reason CS can find anything in the ~introductions topic is because it was told to start there.  ONCE it leaves there, it will never be able to return unless it is told to go there. 

The control script defines how the bot behaves. The one that ships with Harry says:

1.  If you can find a responder in the current topic, use that
2.  Otherwise look at all topics having keywords in the current input. Prioritize them. Try them one at a time and see if a responder matches from there.
3. If not, perhaps generate a quibble (topics invoked by control script)
4. If not, find topics most matching keywords of input to keywords of topic. Take one of those and generate a gambit from it.  Keep trying them until a gambit is generated

That, roughly is the control defined.  It can NEVER go to a keywordless topic unless somewhere in your scripts that execute it is told to go there. 

 

 
  [ # 10 ]

Thanks Bruce. You said previously:

“In my world I have a topic called ~keywordless, which is just a collection of rules that have no logical home topic, and this topic is called directly from the control script when other topics fail to match the input and respond.”

So how do I active such a topic in the control script? I have to say that the control script is for now a bit beyond my capabilities. I am just trying the master the “simple” rule scripts.

 

 
  [ # 11 ]

Given that the control script is a bit beyond you, the question is really moot.

HOWEVER, I will say that if you added

if ( %response == 0 ) { respond(~keywordlesstopic) } at some appropriate moment in the control script, then it would call such a topic (if such a topic existed).

 

 
  [ # 12 ]

Mostly you are unlucky.  :prepare Fringe benefit will tell you how the system interprets the input and :trace would tell you what it tried to do…....

1. In wordnet, “fringe benefit” is a single word. So the system rewrote your u: (fringe benefit) as u: (fringe_benefit)
which is fine.

2. Fringe is the name of a TV show in the rawdata world, so it couldn’t decide that Fringe must be lower case.
Ergo it couldn’t merge your input Fringe benefit into the phrase fringe_benefit (a bug I have to fix).

3. Normal English doesn’t include * as part of words.  Your use of *fringe in a pattern is how you tell chatscript to do wildcard spellings of things…. so it handled your input as a match because under the rules of *spelled words, it is.

topic: ~introductions[]

u: (fringe benefit)  ^keep() ^repeat() Zzzzz

u: (*fringe benefit*) ^keep() ^repeat() Yyyyy.

u: (what is BO) ^keep() ^repeat() BO stands for xxx.

u: (Can I go back) ^keep() ^repeat() xx.

?: (where do you live) ^keep() ^repeat() On a computer.

 

 
  [ # 13 ]

Your rule:

u: (Can I go back) ^keep() ^repeat() xx.

needs to be u: (can I go back)

When you input “Can I go back”, the system decides that the capital word Can is not real, and you really mean “can” which is true. Your pattern should not be specifying capitalized words, UNLESS you mean the word is a proper noun of that name.

 

 
  [ # 14 ]

I have amended the documentation to discuss this issue of capitalizing words in patterns

 

 
  [ # 15 ]

Thank you very much for your help Bruce. I thought I was going mad on the fringe benefit thing.

Bruce Wilcox - Jul 3, 2013:

Your rule:

u: (Can I go back) ^keep() ^repeat() xx.

needs to be u: (can I go back)

I changed it and it still doesn’t seem to execute the rule properly.
fasd:_> can I go back
HARRY:_ Hi, what can I for you?

Looking at the :prepare it seems to transform the statement into:
MainSentence: I can go ?

Not clear why it does that and but guess that is way it doesn’t find my rule. I need the rule though to respond to enquiries where people want to undo a previous choice.

 

 1 2 > 
1 of 2
 
  login or register to react