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

Discard the wildcard at every new trigger
 
 

Why discard the wildcards at every new trigger instead to remember the last wildcards?
People normally remember the past and a bot to be more similar to a human should remember the past too. Maybe there is something that I don’t understand about rivescript?

 

 
  [ # 1 ]

RiveScript has a really similar design to AIML in that it’s a “canned response” system that doesn’t really keep track of history. (So, AIML has the same “attention deficit disorder” problem with not remembering what you just said to it). The only exceptions (in both RiveScript and AIML) is what variables the bot sets—those will persist between replies, but not the rest of the message/reply transaction.

Alice’s code base makes use of a variable named “it” as a way to kind of work around this. Anytime an AIML pattern detects that you’re talking about “something”, it sticks that something in the “it” variable and other replies call from it.

As an example, here’s one of Alice setting the “it” variable:

<category><pattern>IF YOU BELIEVE IN *</pattern>                                                                                                       
<
template>I was taught to believe in <set name="it"> <person/></set>.</template>                                                                       
</
category

And an example of the bot recalling that variable:

<category><pattern>YOU DO NOT SOUND INTERESTED</pattern>                                                                
<
template>Oh no I am very interested in <get name="it"/>.</template>                                                    
</
category

RiveScript example:

+ if you believe in *
- <
set it=<person>>I was taught to believe in <get it>.

you do not sound interested
Oh no I am very interested in <get it>. 

It’s not perfect, but neither RiveScript or AIML were designed from the ground up to solve this problem elegantly.

 

 
  [ # 2 ]

Yeah! thanks!

 

 
  [ # 3 ]

@ Noah,

Have you ever thought about developing a “Learning Bot?” One that actually accumulates knowledge / data with each conversation? The data could be added to a DB or Tables, etc.

Is there a provision that might allow “learning” within RiveScript with some modifications?

Just some thoughts, thanks!

 

 
  [ # 4 ]

Something like that could be a good idea to add.

RiveScript’s always had a stream() function to dynamically add more code, and some implementations have a write() which dumps all the loaded replies out to a single file, but that’s all error-prone and not very flexible.

Maybe something like this could be added: an addReply() function which takes all the different reply parts as parameters (keeping the formatting sane and safe from “injection” like you could get from stream()), and an optional file name for it to write the reply to for persistence across reboots. Like,

# python example
rs.add_reply(
    
trigger="hello bot",
    
reply=["Hello human!""Hello <get name>!"],
    
filename="./brain/learned.rive",

and it’d take params for conditions, redirects, etc. too.

 

 
  login or register to react