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

Problem with concept match
 
 

I have a rejoinder in which I want to match an emotion users express and repeat it back to them.

a: (!feel _~emotionsWhat makes you feel '_0? 

Unfortunately, when users say certain emotions, it breaks in a weird way. If, for example, the user says “Gross”, the bot responds: “What makes you feel emodisgust?” Obviously gross falls under the concept of ~emodisgust, but I’m not sure why that’s coming through here when I’m specifically requesting the original text. I’ve tried using ^original(_0), too, but that didn’t change anything.

 

 
  [ # 1 ]

There are 2 ways of handling interjections (like ~emodisgust).  The old way was for CS to change the words to be the word for the emotion or dialog act (~emohappy ~emohowzit ~yes, etc). Which is what you are running. The newer way is to leave the original text alone but map the concept name to be matched across the words.  From the Practicum Spelling manual

## New-style Interjections

Nowadays you can choose to disable interjection processing and yet still see them where you want.
You disable the interjection substitution via your bot macro:
```
$cs_token = #JSON_DIRECT_FROM_OOB | #DO_INTERJECTION_SPLITTING | #DO_SUBSTITUTE_SYSTEM | #DO_SPELLCHECK | #DO_PRIVATE
$cs_token -= #DO_INTERJECTIONS
$cs_token -= #DO_TEXTING

```
and thereafter all entries in the interjections.txt file of LIVEDATA/ENGLISH/Substitutions
do not change your inputs. Texting has a mix of things including a bunch of interjections, hence turning that off.

Instead, they now also build up a legitimate concept set (like ~yes) that you can
match just as you did before. The difference is the the original input words are still there.
These concept sets are special, because the match is valid only at the start of a sentence and
may also require they end at end of sentence or at a comma.

So “Beyond a doubt I like apples” will remain a single sentence, and the words will remain unchanged.
```
u: (_~yes _*)  This matches.
```
_0 will bind to “beyond a doubt”. _1 is “I like apples”.

Note: Since the sentence is not changed to start with a concept name (interjection name)
interjection splitting has nothing to do. It also means that multiple
interjections in a row will not actually be the same.
“Damn, no, I won’t go.” in old-style becomes “~emocurse. ~no. I won’t go.”
But in new-style it remains unchanged. You can still match an interjection
just by doing
```
u: (~emocurse) ...
```
But if you want to treat the interjections as separate sentences you can do:
```
u: ( _~no _*)  do something, then
  if (_0) {^input('_0)}
  ^fail(SENTENCE)
u: ( _~emocurse _*)  do something, then
  if (_0) {^input('_0)}
  ^fail(SENTENCE)
```

This new-style interjection is much more flexible in how you process it.
You can do:
```
u: (_~no _*)  do something for the no, Then
  ^unmark(_0 *) 
```
After handling the no, the above simply hides the interjection and
the system now only sees whatever else was input.

 

 
  login or register to react