Upgrade auf unsere Platinum service und lassen Sie uns bauen Sie Ihr bot für Sie
Bot Libre Forum

random remembered

durch bobred gepostet 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: 0, 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: 2379, today: 0, week: 2, month: 40

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

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: 0, 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: 2181, today: 0, week: 2, month: 58

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

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: 2245, today: 0, week: 3, month: 51

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

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: 2206, today: 1, week: 3, month: 51

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: 2388, today: 1, week: 4, month: 49

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: 2153, today: 1, week: 3, month: 48

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: 2137, today: 0, week: 2, month: 48

by bobred posted Sep 19 2018, 14:37

okay I will try it.


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

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: 2152, today: 1, week: 6, month: 46

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

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: 2149, today: 1, week: 4, month: 48

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: 2156, today: 0, week: 3, month: 60

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: 2125, today: 0, week: 2, month: 48

Id: 20274332
Tags: how to
Gepostet: Dec 24 2017, 18:00
Antworten: 25
Ansichten: 4219, heute: 2, Woche: 8, Monat: 167
0 0 0.0/5