更に当社の Diamond サービスを構築まで自分自身のアプリfor AndroidまたはiOS
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: 2445, today: 2, week: 4, month: 46

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

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: 2455, today: 1, week: 3, month: 43

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: 2422, today: 1, week: 2, month: 48

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: 2681, today: 0, week: 1, month: 42

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: 2486, today: 2, week: 3, month: 46

by bobred posted Dec 29 2017, 17:02

self script do have random selection.


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

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: 2596, today: 0, week: 1, month: 50

by bobred posted Sep 10 2018, 8:59

how would i implement this?


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

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

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: 2180, today: 1, week: 1, month: 57

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

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

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: 2244, today: 0, week: 2, month: 50

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

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

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

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: 2151, today: 0, week: 1, month: 46

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

by bobred posted Sep 19 2018, 14:37

okay I will try it.


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

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: 2148, today: 0, week: 2, month: 42

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: 2184, today: 0, week: 1, month: 43

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: 2147, today: 0, week: 2, month: 46

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: 2155, today: 0, week: 2, month: 59

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

Id: 20274332
タグ: how to
掲載: Dec 24 2017, 18:00
回答: 25
眺望: 4215, 今日の: 1, 週間: 4, 月: 163
0 0 0.0/5