royaltca
Pro
Posts: 33
Joined: Mon Mar 30, 2015 5:18 pm

Random question

Tue Mar 31, 2015 2:40 am

I've got an idea. Let's say we're chatting with bot. We ask something, pattern matches, bot replies and so on. What if bot could randomly (maybe percent based chance) add a question to the reply. The "questions" could have if statement in it, so bot wouldn't ask for the same things if he already knows it. Below example of conversation using my idea:
Me: Hi, how are you?
Bot: Thanks, I'm fine.
Me: What does AI acronym mean?
Bot: It's Artificial Inteligence.
Me: What is your name?
Bot: My name is Louis. What are you doing? <-- the question here wasn't included in <Response>, it's somehow randomly added to keep conversation interesting.
What do you think ?

JeffersonStack
Pro
Posts: 44
Joined: Fri Apr 05, 2013 1:20 am

Re: Random question

Wed Apr 01, 2015 5:00 pm

i think you u can use javascript for this and use any saved <Random Name="questions> in ur response.

royaltca
Pro
Posts: 33
Joined: Mon Mar 30, 2015 5:18 pm

Re: Random question

Wed Apr 01, 2015 7:41 pm

Of course you can, but using the same code in every model to achieve what I want is not good solution of the problem.

User avatar
Leslie
Lead Software Architect
Posts: 353
Joined: Fri Sep 14, 2012 12:20 pm
Contact: Website

Re: Random question

Sun Apr 05, 2015 8:16 pm

One can use weighted Random to achieve this. Declare and name a Global Random element.

SIML Code

<Siml>
  <Random Name="random-question">
    <Item Weight="0.2">what are you doing ?</Item>
    <Item Weight="0.3">What are you upto ?</Item>
    <Item Weight="0.5"></Item>
  </Random>
</Siml>
And later use the random sequence in your SIML Model.

SIML Code

<Model>
  <Pattern>WHAT IS YOUR NAME</Pattern>
  <Response>My name is Louis. <Random Get="random-question"/></Response>
</Model>
I am assuming you are using Chatbot Studio 1.2 or above.

Return to “Feature Request and Suggestions”

Who is online

Users browsing this forum: No registered users and 1 guest