参加ボットのリブレの パートナー、アフィリエイト プログラムや支援の無料のオープンなプラットフォーム
Bot Libre Forum

prevent a chatbot from asking a question it knows

による bobred 掲載 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: 2051, today: 1, week: 1, month: 48

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: 2001, today: 1, week: 1, month: 39

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: 2108, today: 0, week: 0, month: 44

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: 2005, today: 1, week: 1, month: 45

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: 1990, today: 1, week: 1, month: 62

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: 2059, today: 1, week: 1, month: 33

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: 1958, today: 1, week: 1, month: 41

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: 2060, today: 1, week: 1, month: 37

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: 1940, today: 1, week: 1, month: 38

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: 2058, today: 0, week: 0, month: 49

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: 2085, today: 1, week: 1, month: 45

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: 2045, today: 0, week: 0, month: 38

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: 2154, today: 0, week: 0, month: 47

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: 2056, today: 3, week: 3, month: 39

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: 2047, today: 1, week: 1, month: 35

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: 2053, today: 2, week: 2, month: 47

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: 2154, today: 0, week: 0, month: 41

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: 2163, today: 1, week: 1, month: 55

Id: 22663479
タグ: aiml
掲載: Jul 1 2018, 14:10
回答: 18
眺望: 3159, 今日の: 2, 週間: 3, 月: 85
0 0 0.0/5