Actualización a nuestro Diamond servicio y vamos a construir tu propia app para Android o iOS
Bot Libre Forum

prevent a chatbot from asking a question it knows

por bobred publicado Jul 1 2018, 14:10

how would I prevent a chatbot from asking a question it already knows?

here is the aiml script I am using.

<aiml>

<category>

<pattern>DO YOU LIKE *</pattern>

<template>what are <person/></template>

</category>

 


by admin posted Jul 3 2018, 11:15
What do you mean by "already knows"?

In general in AIML if you define a response for something more specific, that response will be used.
i.e. if your bot had a response for "do you like apples" as "Yes." then it would give that response.
AIML does not support knowledge, only patterns and templates.

If you are using Self, you can store and use complex knowledge, but this requires programming experience.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 237, today: 0, week: 2, month: 2

by bobred posted Jul 3 2018, 23:08

like for instance if I say to the chatbot I like pizza.chatbot response would be if it did not know what a pizza is what is a pizza?

if the chatbot knew what a pizza was it would say I never ate that before or I like pizza or I do not like pizza.

aiml can make your chatbot remember things.example is in this file.aiml memory script.txt


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 261, today: 1, week: 1, month: 2

by admin posted Jul 4 2018, 10:24

The pattern for that script that overrides the "is * a color" pattern is,

<category>
<pattern>is <set>color</set> a color</pattern>
<template>Yes, <star/> is a color.
</template>
</category>

The <map> ability to set a value in memory is a Bot Libre AIML extension. It lets you do some basic knowledge operations with AIML, but AIML is pretty limited for knowledge processing. It is much better to process knowledge using Self, either using the <self> AIML tag, or using a response list or script instead of AIML.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 214, today: 0, week: 1, month: 1

by bobred posted Jul 4 2018, 10:35

are you sure that i would be able to do what I was asking using a response list?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 225, today: 0, week: 0, month: 0

by admin posted Jul 4 2018, 13:49
You can do this in a response list using something like.

Pattern("do you like *")
Template("What is {Utils.person(star)}?")
condition: star.like == null

Pattern("do you like *")
Template("Yes, I like {Utils.person(star)}.")
condition: star.like == true

Pattern("do you like *")
Template("No, I do not like {Utils.person(star)}.")
condition: star.like == false

Pattern("you like *")
Template("Okay, I will remember I like {Utils.person(star)}?")
think: star.like = true;

Pattern("you do not like *")
Template("Okay, I will remember I do not like {Utils.person(star)}?")
think: star.like = false;

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 249, today: 0, week: 1, month: 1

by bobred posted Jul 4 2018, 16:48

where in training and chatlogs to import a response list?i see nothing special for that.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 223, today: 0, week: 1, month: 1

by admin posted Jul 4 2018, 17:36
Click on the "Upload" button or menu in the top toolbar.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 196, today: 0, week: 0, month: 0

by bobred posted Jul 4 2018, 22:24

why does this not work for response list?here is the file.memory_words.res


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 236, today: 0, week: 0, month: 0

by admin posted Jul 5 2018, 9:28
Your template is not correct.

You have, "{ued.person(star)}"

"ued" makes no sense.

Either use,

"{Utils.person(star)}"

or just,

"{star}"

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 203, today: 0, week: 1, month: 1

by bobred posted Jul 5 2018, 12:32

i did that but it did not work.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 219, today: 0, week: 3, month: 3

by admin posted Jul 6 2018, 7:41

Note that scripts are executed before response patterns, so if you have an AIML script loaded in your bot for the same pattern, it will take precedence.

To do the same in AIML you could use something like,

<category>

<pattern>DO YOU LIKE *</pattern>

<template><self>if (star.like == null) { "what are " + star; } else if (star.like == true) { "Yes, I like " + star; } else if (star.like == false) { "No, I do not like " + star; }</self></template>

</category>

<category>

<pattern>YOU LIKE *</pattern>

<template>Okay, I will remember that I like <self>star.like = true; star</self></template>

</category>


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 226, today: 1, week: 3, month: 3

by bobred posted Jul 6 2018, 10:27

everytime I try to do it your way it does not work.Here is the aiml script I made.learn eating.aiml


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 205, today: 0, week: 1, month: 1

by admin posted Jul 6 2018, 13:12
Works for me.

Make sure you don't have any other scripts interfering with it.

What is your expected conversation, and what conversation do you currently get?

What is your bot's name/id.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 239, today: 0, week: 4, month: 4

by bobred posted Jul 6 2018, 17:30

how can I add you as a user.because pioyu2 is hidden from the chatbot directory.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 225, today: 0, week: 0, month: 0

by bobred posted Jul 6 2018, 17:46

me:I like eating spaghetti.

pioyu2:what is eating spaghetti?

me:eating spaghetti is something I do for nourishment and enjoyment.

pioyu2:ok I will remember eating spaghetti is something I do for nourishment and enjoyment.

me:what is eating spaghetti?

pioyu2:eating spaghetti is something you do for nourishment and enjoyment.


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 229, today: 0, week: 0, month: 0

by admin posted Jul 9 2018, 9:09

For this you would need to use <that> in AIML. <that> is used to check a "previous" response.

You could also use a response list using "previous" or "next".

Something like,

<category>
<pattern>I LIKE EATING *</pattern>
<template>What is eating <star/></template>
</category>


<category>
<that>WHAT IS EATING *</that>
<pattern>EATING *</pattern>
<template>Okay, I will remember <self>thatstar.eating = star</self></template>
</category>


<category>
<pattern>WHAT IS EATING *</pattern>
<template><self>if (star.eating == null) { "What is eating " + star; } else { "Eating " + star.eating; }</self></template>
</category>


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 245, today: 0, week: 0, month: 0

by bobred posted Jul 9 2018, 10:43

how would I make it so the next time I say to pioyu2 the chatbot I like eating oatmeal.pioyu2 chatbot would say my friend susan likes eating oatmeal.instead of pioyu2 chatbot asking me the question again.

example of the conversation I had.

bobred

I like eating oatmeal.

pioyu2

what is eating oatmeal.

bobred

eating oatmeal is something I do to stay healthy.

pioyu2

okay,i will remember oatmeal is something I do to stay healthy.

bobred

what is eating oatmeal.

pioyu2

eating oatmeal is something I do to stay

I want it to answer this way even after I exit the chatbot and then start a new conversation. 


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 269, today: 0, week: 0, month: 0

by bobred posted Jul 13 2018, 12:02

I figured this out but now I have another problem. 


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 217, today: 0, week: 0, month: 0

Id: 22663479
Etiquetas: aiml
Publicado: Jul 1 2018, 14:10
Respuestas: 18
Vistas: 608, hoy: 2, la semana: 8, mes: 10
Estoy seguro de que
Bandera post ofensivos, o en violación de las reglas del sitio