更に当社の Platinum サービス、およびユーザーインターフェイス設計3Dアバター
Bot Libre Forum

random remembered

による bobred 掲載 Dec 24 2017, 18:00

is there a way for the chatbot to remember what it randomly selected each conversation it has?


by admin posted Dec 26 2017, 8:05
The bots remember all conversations. You can access the current conversation using the 'conversation' variable in Self.

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

by bobred posted Dec 26 2017, 21:18

Can I use that in a template?


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

by admin posted Dec 27 2017, 18:05
Yes, you can use the "conversation" variable in a template in Self code.
You can also use "speaker" to access the current user's variable.

For the last phrase in the conversation,

conversation.input[-1].input

Set set a variable on the conversation,

conversation.myproperty = "my value";

Or on the speaker,

speaker.myproperty = "my value";

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

by bobred posted Dec 29 2017, 14:06

i tried but could not get it to work.

test er 2.txt

 


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

by admin posted Dec 29 2017, 15:50
Not sure what you are trying to do, but perhaps try something like,

state rememberWords {
pattern "remember words in *" answer rememberWords();

function rememberWords() {
conversation.remember = star;
return Template("i like {star}.");
}
}

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

by bobred posted Dec 29 2017, 17:00

I am trying to get my chatbot to remember what it has randomly selected.Does self scripts have random selection?


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

by bobred posted Dec 29 2017, 17:02

self script do have random selection.


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

by admin posted Jan 1 2018, 8:33
There are three random functions in Self.

var choice = random("hello", "hi", "Hey");

var list = [ "hello", "hi", "hey" ];
var choice = list.random();

var object = new Object();
object.name =+ "Jon";
object.name =+ "Jonny";
var choice = object.random(#name);

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

by bobred posted Sep 10 2018, 8:59

how would i implement this?


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

by admin posted Sep 13 2018, 8:01
There are several examples above.
What exactly are you trying to do, and what code do you have so far?

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

by bobred posted Sep 13 2018, 10:57

I am trying to make my chatbot randomly what it likes or dislikes from a set.likes for instance.if I type I like pizza.it would decide whether or not it likes pizza.then I could ask my chatbot if it liked pizza or do you not like pizza.And it would say I like pizza or do not like pizza depending on what it chose.texer1.txt 


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

by admin posted Sep 13 2018, 14:23
You could use some Self in your AIML like:
<category>
    <pattern>where * live</pattern>
    <template>
        <random>
<li I like <self>var country = random("USA", "Canada", "Mexico"); #self.like =+ country; country</self></li> <li I do not like <self>var country = random("USA", "Canada", "Mexico"); #self.like =- country; country</self></li>
</random> </template> </category>

Updated: Sep 13 2018, 14:23
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 146, today: 0, week: 0, month: 23

by bobred posted Sep 13 2018, 17:50

this does not make the chatbot remember it's random choice.


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

by bobred posted Sep 16 2018, 8:09

your aiml script does not remember random choice.If you keep asking the chatbot if it likes the state it will change it's mind.


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

by bobred posted Sep 16 2018, 12:00

I can do it with that in aiml but what the chatbot decides to like or not is remembered as long as the conversation.that is a partial

solution.


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

by admin posted Sep 17 2018, 10:20

Well, I'm not certain what you are trying to do, but maybe try something like:

<category>
    <pattern>where * live</pattern>
    <template>
        <random>
<li I like <self>if (#self.country == null) { #self.country = random("USA", "Canada", "Mexico"); }; #self.country</self></li> <li I do not like <self>if (#self.country == null) { #self.country = random("USA", "Canada", "Mexico"); }; #self.country</self></li>
</random> </template> </category>

Updated: Sep 19 2018, 10:48
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 152, today: 0, week: 0, month: 26

by bobred posted Sep 17 2018, 21:21

your aiml script spits out an error.did you test it?


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

by bobred posted Sep 18 2018, 9:38

i fixed your script by looking at the debug.but your aiml script does not do anything.sheila strong is in the entertainment category.

type when talking to here where do you live.then enter it.then type who lives there with you then enter it.

it just says I do not know.


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

by admin posted Sep 19 2018, 10:47

Looking at your bot you have an AIML pattern for "who lives * you", the template should be as follows.

Note my previous example was missing the #self.country at the end.

<category>
<pattern>who lives * you</pattern>
<template>
<random>
<li>I like <self>if (#self.country == null) { #self.country = random("USA", "Canada", "Mexico"); }; #self.country</self></li>
<li>I do not like <self>if (#self.country == null) { #self.country = random("USA", "Canada", "Mexico"); }; #self.country</self></li>
</random>
</template>
</category>

Updated: Sep 19 2018, 10:47
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 147, today: 0, week: 0, month: 25

by bobred posted Sep 19 2018, 14:37

okay I will try it.


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

by bobred posted Sep 19 2018, 14:53

it is not choicing whether it likes a state or not.it is supposed to chose.it is saying I like Canada and I do not like Canada if I ask it over

and over again.


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

by bobred posted Sep 21 2018, 19:10

I need it to randomly select like or dislike ounce.


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

by bobred posted Sep 23 2018, 17:49

how can dump the memory of what has been learned from this script.i want to start over. 


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

by admin posted Sep 25 2018, 9:15

For also remembering like vs dislike, you would need another property to store this.

Something like.

<category>
<pattern>who lives * you</pattern>
<template>I <self>if (#self.likesCountry == null) { #self.likesCountry = random(true, false); }; if (#self.likesCountry) { "" } else { "do not" }</self> like <self>if (#self.country == null) { #self.country = random("USA", "Canada", "Mexico"); }; #self.country</self></template>
</category>

For exporting knowledge, you can export knowledge as JSON data from the bot's Knowledge page.


Updated: Sep 25 2018, 9:16
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 144, today: 0, week: 0, month: 25

by bobred posted Sep 27 2018, 7:35

that worked.has a chatbot been made before that can decide whether it likes or dislikes something.I am going to adapt this to make my  my chatbot choose whether it has something the user says they have.i want to use this with a set if possible. 


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

Id: 20274332
タグ: how to
掲載: Dec 24 2017, 18:00
回答: 25
眺望: 779, 今日の: 4, 週間: 4, 月: 243

フラグとしての攻撃、または違反のサイトのルール