Multiple yes or no questions #409
Comments
@aklifsainie Can you paste your AIML code here, please? You might want to add a check for already asked question, using "sets" and "conditions". @ALL A general question: what would be the best and/or easiest way to implement "a button solution" for yes/no questions? In other words, if a yes/no answer is required, two buttons ("yes", "no") would appear on the screen. |
@AlekzNet Program O doesn't support AIML 2.0 sets, on either the pattern or template side, so that's out, I'm afraid. @aklifsainie I had a response that I had thought I had posted, but it doesn't seem to be here, so I'll try to recreate it in a moment. Sorry for the delay. @AlekzNet (again) what you're asking about would require a bit of HTML/JavaScript "trickery", I think, and wouldn't be very easy to pull off. It's certainly doable, but the challenge would be beyond all but the most experienced developers. If you want to contact me via email to discuss how to best implement this, please message me privately. 😄 |
Ok, as promised, I'll try to recreate the post that seems to have gone walkabout. @aklifsainie this is a situation where you need to have some context with your conversation in the form of relating the desired response to both the current input and the bot's previous response. This is where the pattern-side
When a chatbot asks yes/no questions, you'll see categories like this a lot, so this is something that you'll want to get familiar with. |
I meant something simpler. In every YES/NO category you set a variable according to the "that", for example: <category>
<pattern>YES</pattern>
<that>DO YOU LIKE PIZZA</that>
<template>
<think><set name="pizza">yes</set></think>
<!-- Deal with an accepted "YES" answer here -->
</template>
</category>
<category>
<pattern>NO</pattern>
<that>DO YOU LIKE PIZZA</that>
<template>
<think><set name="pizza">no</set></think>
<!-- Deal with an accepted "NO" answer here -->
</template>
</category> And in every question you check if the corresponding variable is set or undefined. If set - go to the next question, if undefined - ask this one. |
Ah, I see what you mean now. Oops? 😉 |
Yeah, it's ugly, requires a lot of checking and typing, but it works ;) An alternative to All questions can be listed within a |
Hey, how to make the chatbot can make a prediction like the Akinator.com? |
@aklifsainie take a look at Steve Worswick's AIML Downloads Page for some excellent ideas on some specialized AIML files. Among the files there is one that shows how to use AIML to create a "20 questions" game, which is pretty much what you seem to be looking for. |
why does my <category>
<pattern>LET DISCUSS MOVIES</pattern>
<template>Yes <set name = "topic">movies</set></template>
</category>
<topic name = "movies">
<category>
<pattern> * </pattern>
<template>Watching good movie refreshes our minds.</template>
</category>
<category>
<pattern> I LIKE WATCHING COMEDY! </pattern>
<template>I like comedy movies too.</template>
</category>
</topic> if I type "let discuss movies", it should enter the topic = "movies". then I type anything, it replies "I have no answer for that" |
@aklifsainie Please remove all unnessecary whitespaces and punctuation in your AIML and try again. <category>
<pattern>LET DISCUSS MOVIES</pattern>
<template>Yes <set name="topic">movies</set></template>
</category>
<topic name="movies">
<category>
<pattern>*</pattern>
<template>Watching good movie refreshes our minds.</template>
</category>
<category>
<pattern>I LIKE WATCHING COMEDY</pattern>
<template>I like comedy movies too.</template>
</category>
</topic> |
My Chatbot is about the Islamic Law of Inheritance. In Islam, if a person dies, the property of the deceased should be divided according to the calculation set by Islam. I give you an example. **If the deceased has a wife, and no sons or daughters, then the wife will earn ¼ of the property of the deceased. but if the deceased has a wife and children, then the wife will earn 1/8 of the property. if the deceased's children only a daughter, then the daughter will earn 1/2 of the property, if there are 2 or more daughter, then the daughter will earn 2/3 of the property.** How do I translate the above situation into AIML code??? Helpp ! :( this is for my final year project bachelor in computer science (artificial intelligence). |
I would say yes. Just like a human lawyer. And a chatbot is an emulation of a human. It can be done simpler using HTML forms, checkboxes, javascript, but still, the user will have to go "one by one". So I see no problem here. One possible problem I see is the absence of |
@aklifsainie Heya :) I think you might get the answer to your question alot quicker over at the AIML stackoverflow |
I need help ! @Dave-Morton
* Do you like pizza Yes Do you like pizza Do you like pickels yes Do you like pickels How about chicken?i have a problem with multiple "yes or no" questions.
for example, if the bot asked me a "yes or no" question from the previous pattern, such as "Do you like pizza"... i will answer "yes".
then, the bot will ask me again, "do you like pickels". i answer "yes".
the bot will ask me again "do you like pickels".
The text was updated successfully, but these errors were encountered: