Joined: 03 May 2006 Posts: 2292 Location: Colorado
Posted: Mon Jul 11, 2005 12:03 am Post subject: Learning/Response Method
Alright, so I think i'm ready to get back into this bot stuff. Fired up andromeda and she still runs! Now I think a new response module is in order.
So I want to sketch out the general needs of such a model:
learn in some fashion
remember who taught it what and probably when. For purging puoruposes.
remember being taught the same thing by several people
automaticaly remove bad teachers and all their teachings
do fuzzy matching of sentences. (u = you, r = are, etc) so that small gramatical errors don't throw it off
reverse said fuzzy matching on a dynamic basis to simulate humans
store data in some manner that can be hand edited. Perhaps this could be a teaching file fed into the main database. Would allow assimilation of AIML files if done right
take all the good stuff from AIML that it can. (need more research on this, please post any info on whats best about AIML
allow subjects and nested subjects
allow weighted scoring based on how fuzzy it had to get to match, how many subjects the person skipped over that they arn't in, (possibly the veracity of the teacher..better teachers repsonses get better scores
should be able to learn instance data about the people it is talking too, and long term data about people it is talking to....instance would be time of day or mood, long term would be name, birthday etc, favorite color
allow generic matching "what color is a blue car?" should be easy to program responses for.
it should allow lists for both matching and output.... have a (nice|good|beautiful) day ...
have an overall mood, and instance mood, one person might tick it off, but its still happy with another.
allow mood information to be encoded and used in responses as well as subjects..
use marchov chains or similar to form sentence patterns.
register each response and input in a normalized form that will allow the attatchment of moods and the use of marchov chains.
You can see this is pretty much a wish list. I am hoping that by listing my wishes i can now look at them all and search for some structure and method that will allow me plan a strategy to attack them.
So now the question to go with this long winded post. What would you add? What would you have if you could have anything? _________________ Eric256
Proud previous owner and current admin of Bot-depot.com
If ANYONE were to make that, chances are they would keep it to themself. That would be the ultimate reply system, and I'm sure the creator wouldn't want everyone to use it.
Joined: 03 May 2006 Posts: 2292 Location: Colorado
Posted: Mon Jul 11, 2005 12:34 pm Post subject:
Cheater wrote:
If ANYONE were to make that, chances are they would keep it to themself. That would be the ultimate reply system, and I'm sure the creator wouldn't want everyone to use it.
Actualy if you look, i have a pretty good history of releaseing pretty much everything. Some things i keep to myself, but generaly that is just until they are pretty enough to release. I will be attempting this, and will be releasing it (unless someone buys it off me lol).
Markov chains - Pretend each sentence has an ID number. Now a conversation would be a sequence of ID numbers. To make a markov chain you teach it several of these sequences. Then when you give it a partial sequence it makes a guess at what ID's would complete the sequence. I've seen it used to randomly create words (each letter), sentences (each word), and i've used it for what i'm talking about here with some limited sucess. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com
Actualy if you look, i have a pretty good history of releaseing pretty much everything. Some things i keep to myself, but generaly that is just until they are pretty enough to release. I will be attempting this, and will be releasing it (unless someone buys it off me lol).
You might, but your post said that this was a wish list for you. So I have a strange feeling you won't be the only one trying. And the others might not be so generous. But I might be wrong...and that would be good for me.
On a simular note, holding conversations would be good, and having both a long term and short term memory. For instance, if the users says "I am from London", then the bot should be able to pick up on it, even when not directly related, such as if the user says "The weather sucks", the bot could reply "Where? In London?", etc.
Also, a long term memory would mean it could recall *certain* things after the user has completed their conversation. Except it wouldn't be just name/age/location/gender, etc, but user inputted information, like a passing comment - "XX is a bastard" (or other word..) would, after a few days, trigger the response "Are you still not friends with XX?", etc.
Just ideas - *I* couldn't do it (without a hell-uva lot of loops), but I'm sure you could
Cheater - There have already been loads of chat programs, not doing exactly this, but simular stuff. Why not just search CPAN for "Chatbot-Eliza", "Chatbot-Alpha" (by Cer), or look in these forums for the Trigger, and Blab modules. There's also ALICE, although that isn't a module yet. Most good coders are open source, because that's how they become good - they share and expand. _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Each user would have a user ID number, starting from 0 and going up. In addition, each message an individual sends would also get an ID number, starting at 0.
So when the 15th user sends their 4th message, the tag on the 4th message learned would be <15:4>
So your response file would look like this (taken directly from my RIVE brain's datafile):
Code:
][Hi<2:9>|Hi<3:11>|Hei<4:20>|Hi<3:38>|Hey <4:41>|Hi<3:45>|Lol<4:46>|Vuh<4:51>|How do you do?<5:52>|Hi<6:57>|Hello<7:63>|Hello<2:64>|Hey<8:68>|Oi<8:93>|Who is this<9:125>|Hi<10:131>|Hey<8:137>|Hey<11:147>|Hi<12:148>Fuck this i'll talk normal<12:166>Lol<12:170>^o)<12:177>(ci)<12:181>:-p<12:185>:-d<12:192>|Hi casey<13:205>|Hey<14:209>|Hi<15:211>|How are you?<15:216>|Hi<4:218>|Hello<16:221>|Hello<17:226>|Top<17:227>|Test<17:229> is penis.<22:304>Penis!<22:306>|Hi<23:307>|Rofl<24:317>|Casey!<25:322>|Hi<24:335>|Jai is gay using his stupid chatbot<26:337>
HELLO<1:2>][What's up?<1:2>
WHATS UP<1:3>][Not much, you?<1:3>
NOT MUCH YOU<1:4>][Same here.<1:4>
SAME HERE<1:5>][Cool.<1:5>
COOL<1:6>][Hello.<1:6>
HELLO<1:7>][Not much, just chilling. You?<1:7>
NOT MUCH JUST CHILLING YOU<1:8>][Same here.<1:8>
HI<2:10>][How are you?<2:10>
HI<3:12>][Kn#kl<3:12>
KNKL<3:13>][Lol<3:13>
LOL<3:14>][Hahh<3:14>
HAHH<3:15>][Lol<3:15>
Joined: 03 May 2006 Posts: 2292 Location: Colorado
Posted: Mon Jul 11, 2005 7:08 pm Post subject:
Yea. The more i think about it the more i think this is either going to be some sort of perl data structure frozen with Storable or a database. It will probably be a combination of both.
It will be a layer system where the messages goes through several layers (called filters). Each filter will have some effect on the incoming message, the outgoing message, the mood, or the data storage of temporary and long term memory.
One hurdle will be figuring out what should be remembered long term and what short term. The way i figure one filter will watch for patterns that mean to store data (my name is (.*), my favorite color is (.*) ) and then the regular filter will still handle responses.
Moods should play a part in both picking a response and formating the output. For instance if the bot is pissed it might start to YELL some words, or eventualy all words. Maybe it throws in some stronger language or randomly ignore a user all together (or lashes out without provocation.)
So much to consider. It seems to me that if i look at this as a simulated intellegince and make it simulate these things, the better it simulates it, the smart it realy becomes.. Hmm. I've always approached AI from the "act like a brain would and AI will come", so looking at it as "pretend to be smart and you might actualy be" looks better. I would imagine that a true solution (if it exists) is some combination of both of these elements in a way we have never seen before.. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com
Learning new ways to respond to users (such as if your match is "my name is (.*)" and the user says "i am (.*)") on it's own would also be cool. So, if someone says something completely new which isn't programmed in, the bot will work out what's being said (either with past knowledge or further inquisition) and act upon it. _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Learning new ways to respond to users (such as if your match is "my name is (.*)" and the user says "i am (.*)") on it's own would also be cool. So, if someone says something completely new which isn't programmed in, the bot will work out what's being said (either with past knowledge or further inquisition) and act upon it.
Yeah, some open-ended things like "my (.*?) is (.*?)" so they could use any noun and then any adjective (or whatever it is that describes nouns) and it would take it as personal information to be remembered long-term. It would work on things like "my boyfriend is a jerk" too.
Although if it wanted to be true "AI" then it wouldn't have one word of English built into it directly, and would have to learn how to figure out when the user is talking about themself and stuff too. That's what my RIVE brain's original intent was. That's what makes things difficult. The more you program English into it the easier it is to make a brain. _________________ Current Site (2008) http://www.cuvou.com/
If you want intelligence (and not just a chatterbot), then being able to tell sarcasm, irony and jokes would be cool. Also, telling if the user is upset (without them actually saying it or saying bad words). This would be if their usual style of talking changed, etc.
Also, taking into account their screenname could be helpful for their mood _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Eric, are you making this in Perl 6? If so, are you using Parrot as well? I've only read some things about it. I would've put Andromeda on Botworld long ago but I never found a copy. _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com
Joined: 03 May 2006 Posts: 2292 Location: Colorado
Posted: Tue Jul 12, 2005 8:23 pm Post subject:
alienz wrote:
Eric, are you making this in Perl 6? If so, are you using Parrot as well? I've only read some things about it. I would've put Andromeda on Botworld long ago but I never found a copy.
I'm not sure yet. I already have the andromeda base to work with so i will probably stick with perl5. however there are some ways to mix p6 and p5 so i make well code the new stuff in perl 6. . I am currently using pugs...which does some form of magic, i don't realy understand if it is using parrot on the backend or not, i know that it uses parrot for regex but other than that i have no clue. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com