AI Zone Admin Forum Add your forum

CX Company, chatbot market leader in the Netherlands since 2005, will speak on the Amsterdam Chatbots Meetup on Wednesday, Oct 18!

Dialogue manager functions in RiveScript
 
 

Hello,

I’m new here. I’m playing with RiveScript (Python interpreter) and I really like the language, it’s expressive but concise. Probably in the future I’ll need some basic dialogue management functions for my chatbot (it should be able to keep some basic information from answers provided by humans, such as the position of an object in the house). Have someone tried a RiveScript implementation of these functions? If not, could you suggest where to look at (for example open source libraries in Python)?

Thanks

 

 
  [ # 1 ]

Welcome!

I don’t think Noah has solved possible Learning for RiveScript, based on user input (other than what the botmaster enters as information or data in the bots code).

I might not be understanding you completely but I think you might be wish to consider would be assigning a variety of items to various Trigger questions / statements, then have your bot provide answers based on these Triggers.

+ where is the (clock|couch|lamp|table|tv)
- It can be found in the living room.
- I am certain it is in the living room.
- According to my records, it is in the living room.

If you simply used a wildcard for the Trigger it would match anything like:

+ where is the *
- I think the <star> is in the living room.
- The <star> can be found in the living room.

Of course the wildcard might be improperly be used in that case if someone were to ask:

Where is the bathtub?
I think it is in the living room.

Arrays are great for containing lots of similar items like colors but wouldn’t work well in your instance.

I am learning RiveScript as well and find it to be 80% thinking about how to construct the language interactions and 20% actual coding.

Hopefully others will add some additional tips for you. Good luck!

 

 
  [ # 2 ]

Something else you can do in RiveScript is compose dynamic variable names using other tags/variables.

my favorite is *
- <
set fav<star1>=<star2>>Noted.

what is my favorite *
* <
get fav<star>> != undefined => You said your favorite <starwas <get fav<star>>.
You didn't tell me that yet. 

So the user can say “my favorite color is red” or “my favorite team is the Lakers” and the bot would put those in user variables named “favcolor” and “favteam” respectively.

You just need to be careful about syntax ambiguity when mixing tags like this, but for simple use cases it should work. It might cause trouble in UTF-8 mode, though, if the <star> could include symbols that might short-circuit matching for other tags like {random} and cause the tag handling regexps to do the wrong thing. (Think {random}<get fav<star>>{/random} where the value in <star> had text like “{/random}” in it, but more subtle things could possibly go wrong too wink ).

Ninja edit: you can limit the potential for things to break by using arrays or something instead of wildcards.

my favorite (color|team|bandis *
- <
set fav<star1>=<star2>>Ok
 

 
  [ # 3 ]

Thank you, Art and Noah! Concerning designing scenario I have in my mind some slots of information that human user should fill during the interaction but I want to be sure that what is said stay in the background of the interaction like common knowledge. So, it’s seems it is possible, I will try it and let you know smile Writing a conversational agent with RiveScript is like writing a screenplay, I’m having a lot of fun.LOL

 

 
  [ # 4 ]

Thank you, Art and Noah! Concerning designing scenario I have in my mind some slots of information that human user should fill during the interaction but I want to be sure that what is said stay in the background of the interaction like common knowledge. So, it’s seems it is possible, I will try it and let you know smile Writing a conversational agent with RiveScript is like writing a screenplay, I’m having a lot of fun.LOL

 

 
  login or register to react