• Welcome to Valhalla Legends Archive.
 

An AI bot that pretends to be a real person

Started by MrMachineCode, September 18, 2003, 01:39 AM

Previous topic - Next topic

MrMachineCode

That's a neat idea, give it pseudo-emotions.  I like to keep the basic algorithm as straight-forward and uncomplicated as possible, so if I do that, it would be a separate module from the "logical" part of it's "brain".  An add-on, like Data's emotion chip.

One thing about the algorithm is that the longer the input phrase, the more interesting it's replies are.  It tends to respond in kind to what people say to it, so if you only say one word you'll tend to get one word back, but a full sentence usually triggers a different full sentence back.  I think I may make it so that the more words there are in someone's statement, the more likely it is to try to generate a reply off it.  I'd have to put in safe-guards to keep it from responding to spam.  One possibility is that if someone repeats the same, long phrase more than once (like when someone's spamming something) the bot could automatically quit "seeing" it.

I could also make it compare what it's about to say, to all the things that have been said before, and have it reject that response if it's just repeating itself.  This would both prevent people from "teaching" the bot to spam, and would make the replies more unique.

After many hours of thought, I realize that a Markov model AI can actually be trained in two different "directions".  What I mean is, the way I programmed the AI right now, it looks at sentences "horizontally", left to right.  It looks at one person's sentence and learns that one word in a sentence usually comes after some other word.  This doesn't work so well when people in a chat room are only using one or two words, then there's just not that much variation.

But there is another way to use a Markov model!  You can also train the model vertically in the chat room!  What I mean is, take something like this:

Bob: afk, brb
Tom: ok
....
Bob: back
Tom: welcome back

Training the bot vertically, i.e. across statement to statement, instead of horizontally within one statement, the bot will watch this exchange and it will associate these statements to one another, it will learn to say, "welcome back" when someone says "back"!!

EvilCheese

#16
On the subject of bot AI:

If you were planning to implement a bot that simulated emotions, it would probably be better to implement it as a state-based AI with a fuzzy-logic element, similar to the awareness AI for the bad guys in a game like Thief.

Basically predefine a set of possible moods, which could either be all discreet, or combinable (up to you).

Also define a set of stimuli which can affect those states, for example the bot may head towards "jovial" when people use the word "lol" a lot, finally reaching jovial at some point affected by a pseudo-random factor.

The other approach would be to have all moods present at all times and arranged in what I would call a "flower petal" arrangement. Take this picture as an example:



The cross represents the current "mood" of the AI, and affects to some degree the choice of responses, response structure and response frequency.

Each defined stimulus would act as a vector, moving the current mood by a specific factor in one or more directions, allowing a combination of moods.

Obviously you could include as many petals as you liked into your arrangement, but remember to keep opposing emotional states on opposing petals, else you might end up with your AI being happy and sad at the same time :P

Adron

Quote from: EvilCheese on September 19, 2003, 08:03 PM
Obviously you could include as many petals as you liked into your arrangement, but remember to keep opposing emotional states on opposing petals, else you might end up with your AI being happy and sad at the same time :P

Well, being happy and sad at the same time is possible. It's just not common, and it has to really attain both states at once. If it alternates between happiness and sadness it'll seem like a psycho :P

In general though, the bot having feelings that control parameters of the response process would probably make it much more realistic. When people go on talking about things that don't interest the bot, it goes silent, and when people come into a subject it's enthusiastic about it'll talk much more.

When people piss it off it'll get angry or perhaps pout, that is, unless it's mature enough to just ignore the insults. Or, the person might get banned, or someone else might say something to make it happy or bring up some interesting topic.

It could also get less likely to talk to people it doesn't like. It might dislike people trying to get it to spam and turn to just giving them an insult when it sees them and then keeping its mouth shut.

MyndFyre

Quote from: Adron on September 20, 2003, 05:46 AM
Well, being happy and sad at the same time is possible. It's just not common, and it has to really attain both states at once. If it alternates between happiness and sadness it'll seem like a psycho :P

Okay, now this thread is getting philosophical.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

iago

No, it's getting into the trickier questions about AI.. we discussed these things in AI class, and they're interesting problems.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Adron

Quote from: Myndfyre on September 21, 2003, 01:56 PM
Okay, now this thread is getting philosophical.

It's not my intention to make it philosophical. I try to approach this scientifically. Same goes for my approaches to the soul question - I try to give a scientifical comment/answer, not something based in not knowing anything i.e. knowing nothing about anything.

Arta

This is a fantastic idea! I love it. I hope you complete and release it with code at some point, I'd be very interested in looking it over :). Seriously, this is the best idea to arise from botdev for ages and Camel should just stfu (as usual).

iago

Quote from: Arta[vL] on September 23, 2003, 11:32 PM
This is a fantastic idea! I love it. I hope you complete and release it with code at some point, I'd be very interested in looking it over :). Seriously, this is the best idea to arise from botdev for ages and Camel should just stfu (as usual).

My friend is working on that for his final project for AI class..  hopefully he'll have something useful by the end of that :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


MrMachineCode

Quote from: Adron on September 20, 2003, 05:46 AM
Well, being happy and sad at the same time is possible. It's just not common, and it has to really attain both states at once. If it alternates between happiness and sadness it'll seem like a psycho :P

Hey now!  I happen to be bipolar (manic depressive), so I really do alternate between happy and sad sometimes!  Are you calling me a psycho?  lmao.  No, I'm not really offended by that, I just think it's kind of funny.

My understanding of what science knows so far about the way human emotions work is that there are certain chemicals in the brain, and the level of these chemicals influences how we're feeling emotionally, by increasing or inhibiting different brain cells.  So for an AI, representing it's emotional state by a combination of *vectors* is quite plausible, as those vectors could correspond to the *levels* of chemical messengers in a real brain.

I'm not certain, however, that different emotions ought to be on opposite ends of an axis.  Rather I think it makes more sense to have each emotion on it's own vector, and so you could have the AI be, for instance, happy and sad at the same time, or any other combination.  Each emotion could *affect* more than one attribute of it's behavior, and some emotions would have mutually opposite effects on some but not all of the attributes.  That way, the AI could have more than one emotion at once, but some emotions could neutralize each other.

Unfortunately the discussion of putting emotional states into my AI is, for me at least, just mental masterbation because I have no *earthly IDEA* how to actually code that into it.

On a more encouraging note, I believe I've figured out the solution to the problem of when should the bot talk and when should it be silent.  The vertical model will be continuously learning the context around each phrase, and it stands to reason that there will be times when the vertical model is going to have a very good idea for something to say, and other times when it just won't have a clue what to say because it's seeing a discussion on something it's not familiar with yet.  So when it doesn't have a good idea what to say, the bot should be silent, and when a topic comes up that the bot has become familiar with, then it can reply because it will (hopefully) have something relevant to add.

The threshold for how "sure" the bot has to be before it will reply can be automatically regulated.  How so?  Well you don't know in advance what people will say, so you don't know if they'll say lots that the bot knows about, turning it into a motormouth, or lots the bot knows nothing about, making it silent.  So what you do is you give the bot a general guideline of how many things per minute that the bot should say.  It continuously monitors how often it's said something against how often you want it to say things and if it's talking *too much* it starts upping the threshold (meaning the vertical model needs to be more sure before it says something); and if it's talking *too little* it can *lower* the threshold until it's talking more again.

Adron

Quote from: MrMachineCode on October 09, 2003, 02:53 PM
It continuously monitors how often it's said something against how often you want it to say things and if it's talking *too much* it starts upping the threshold (meaning the vertical model needs to be more sure before it says something); and if it's talking *too little* it can *lower* the threshold until it's talking more again.

That doesn't make total sense. If it just changes the threshold so it's always talking at the same rate, then it won't seem interested in the topics it knows and uninterested in the ones it doesn't...

MrMachineCode

I just put the core functionality of the bot into a DLL.  It only implements the horizontal models, not the vertical model and it doesn't take into account the "count" of how many times each pattern comes up (all have equal weight) but it DOES work.

It consists of ChatAI.dll, which is the AI itself, and other dll's will be created as necessary to provide wrapper functions for specific interfaces.  So far I've started on mAIintf.dll, which interfaces the chatAI.dll to mIRC scripts.  

For things that  can call the functions directly, such as a program written in Visual Basic, ChatAI.dll is all you need.  For programs such as mIRC that expect a specific function prototype I can write interface DLL's as long as I get enough information on what they require.

I've gotten it online with mIRC with mixed success--one person talked to it for 3 hours without ever figuring out it was a bot, instead he thought "she" was talking strangely only because she was on drugs.  (Because the bot told him "she" was on drugs.  I made the bot's name female because more people PM'd it when I did that.)  OTOH, it's gotten me permanently IP-banned from at least 6 EF-net IRC channels so far, so use it at your own risk.  For now I think the best thing would be to have it stay mostly silent in public chat, and talk freely when someone PM's it.

If someone wants to collaborate with me to put this on battlenet, I'll let you use the DLL if I can have a copy of the bot you interface it to.  I plan to put the DLL up for download on a website, along with documentation explaining all the functions the DLL exports and the format of the commands.  Sending commands to the AI will be a lot like sending commands to Stealthbot; passing the function AI_do_command() the string ".CLEAR" will clear the AI's memory, passing the string ".SAVE filename.bin" will save the AI's brain to filename.bin, etc.

Send me an email ([email protected]) for more information, and please include an email address for me to reply to.