Sign in to follow this  
DMINATOR

IRC chatbot determining the response

Recommended Posts

Hi This is probably an unsolvable problem, but still I am going to ask you out, maybe someone has an idea. I am thinking of making a new system for my IRC chatbot. The old one was a plain simple one which responded only when asked by his name. Now I want him to behave intelligently :) only respond if the sentence is addressed directly to him, or if he has something to say about it. Here is an example: No problem here:
Quote:
<user1> Hi <bot> Hello <user1> How are you ? <bot> Thank you. I am fine.
But what about this:
Quote:
<user1> I am so drunk today :( <user1> I got one nasty headache <bot> Get an aspirin then :)
The bot here actually knows to what phrase to respond, and how to do that correctly. The problem itself: 1. How to make this system, completely language independent. 2. Learning new words, phrases and responses from users chatting (this is the hardest part for now - How to get the idea to what phrase the response is written) So what do you think ?

Share this post


Link to post
Share on other sites
a) Use Prolog. You can interface with C/C++ for the IRC connection.
b) Train it like any other person learning a language. Talk to it, if the response that it gives you is misplaced or irrelevant, give it negative feedback somehow and positive feedback when it does well. Of course, this is going to take a while and you'll still need to find a way of weighting responses in terms of their relevance to specific questions and subjects, etc.

Share this post


Link to post
Share on other sites
The easy way would be to have preprogrammed responses attached to keywords with a probability. If you want novel sentences that don't necessarily make sense, you could use Markov chains or something similar to assemble sentences from a data base of words or phrases. See Mark V Shaney

Share this post


Link to post
Share on other sites
What about the training how is it possible to train anything if you don't know to whom the question is related and to what question the response is made . This is the problem I am struggling with.

If we have 10 or more users on the IRC channel , and everyone is talking, How is it possible to teach a bot ? I don't really know :(

Share this post


Link to post
Share on other sites
jfclavette - That would probably be me and my team :-)

DMINATOR - You'd like to see S12, after i've gotten her finished.

<me>Hi
<s12>Hello
<me>How are ya?
<s12>Fine, you?
<me>good
<s12>Nice :-)
<me>Meh. Hear about the football?
<s12>Meh.
<me>Tigers won!
<s12>W00t!
<me>Bie
<s12>k, bi!

:-)

Currently she's in a very simple form, using AIML and a keyword responce matrix, all i need is some more training. I'm also working on her context mechanism. Thats what lets her talk to people in a channell without them needing a codeword, ect.

I probably won't have any more dev time for the next two months or so. (tho i might be able to put in some work from time to time).

We could always use another member for the project :-)

I could teach you how she works pretty quickly if we could chat for a bit... Email me.

Amadscientist10@hotmail.com

From,
Nice coder

Share this post


Link to post
Share on other sites
Great I am also very limited with time: colegge , other project , I can only spare a 1,5 * 3 hours for coding on my C++ lessons per week max. Anyway I will drop you email, let's see what we can figure out.

Share this post


Link to post
Share on other sites
go for the learning approuch ( stay away from AIML :) )

i was thinking about making a chatbot that learns a language by just looking at the array of characters it is sent. so it would have to figure for itself that words are seperated with a ' ' character for example. Never got round to start though. i wanna finish my emulator first

Share this post


Link to post
Share on other sites
An Ode to Fuzzy Logic

Fuzzy Logic,
Logic so Warm and Fuzzy,
how fuzzy is your navel,
how fuzzy is your brain?

Oh when I think of all the rules,
neither crisp nor sharp,
that neither algorithm nor formalism,
can dissect into a simple plan.

Fuzzy Logic,
how fuzzy are you?
probabilites are just a part of the plan.
When at last, we understand,
that Chaos is part of the master plan.

Fuzzy, fuzzy logic.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Name_Unknown
An Ode to Fuzzy Logic

Fuzzy Logic,
Logic so Warm and Fuzzy,
how fuzzy is your navel,
how fuzzy is your brain?

Oh when I think of all the rules,
neither crisp nor sharp,
that neither algorithm nor formalism,
can dissect into a simple plan.

Fuzzy Logic,
how fuzzy are you?
probabilites are just a part of the plan.
When at last, we understand,
that Chaos is part of the master plan.

Fuzzy, fuzzy logic.


Well done, very clever :)

Share this post


Link to post
Share on other sites
Quote:
Original post by DMINATOR
If we have 10 or more users on the IRC channel , and everyone is talking, How is it possible to teach a bot ? I don't really know :(

The bot would have to be able to distinguish between users. One way to train it with responses would be to allow you to speak through the bot and have it learn from what you say.

Share this post


Link to post
Share on other sites
An idea I have been working on involves starting the AI out with no knowlege at all. The AI divides the input into words as it receives them and compares them to an existing word database. If the word is not in the database (or the database is empty) the AI will add it. It will also add whole phrases in which the word appeared, partial phrases, or words adjacent to the word of interest - as helper words/phrases. As the AI learns more words it begins to associate certain words with other words, phrases, etc. As a result it will start to save fewer helper words/shorter phrases. Im sure you can see where this goes without me rambling on and on about it....but its still in the works and not very 'smart' yet.

Just an exapmle of a recognition process....

The AI has been compiling a word list and a new word is presented to it in a phrase - 'won't'

The AI has seen 'will not' in similar phrases before, each time padded by 'I' and 'do'. The AI now assumes that 'won't' means the same thing as 'will not' and links the two words together in its database.

Of course this is just a small part of what is needed to make an AI chat system, intended to get you thinking about different ways of approaching the task.

-edit-

Good Lord, you've got me rambling on about AI....

...more things from my work on making AI....

As for responding to only things addressed to the AI, its usually pretty simple to do as long as the AI knows its name, other user names, and is keeping track of messages. Im going to assume your chat users will address the AI by its name at least once, pretty customary whether you are talking to a bot or person.....

The AI must keep track of what it has said, and in particular the subject of each comment it makes (you could also keep track of context but thats beyond what I will discuss). If it does this then things become a little easier, because now the AI knows what it said and what it was about (duh). Once that happens your AI can now listen for comments from other users and decide if it should say something based on if the person MAY be responding to something the AI previously said. Another thing your AI could track is comments from other users - using your example of being drunk....

user1: I am so drunk today :(
user1: I got one nasty headache
bot: Get an aspirin then :)

Obviously the AI would have 'heard' someone say that they had a headache and also 'heard' someone respond with the aspirin comment. Based on this it would respond the same. Of course to make this even remotely successful your bot must remember many things and frequently 'weed' its knowlege database.

Im sure Ive confused people enough with my babbling, but Im also sure that Ill be back to post more things or clarify stuff.

[Edited by - Caitlin on October 29, 2005 12:47:42 AM]

Share this post


Link to post
Share on other sites
Well I already made a second version of my chatbot. Nothing special with the code, but result is pretty good sometimes, and should get better if the bot learns more.

It can be found here along with binaries and source : Q2 Clanbot 2

2 gni ferroque
Thats pretty hard task, Maybe even harder then make the bot logic. I was thinking of making mirror bot for IRC network. The bot should copy the actions of one user all the time (not only the chat responses but other IRC messages like JOIN , KICK , PART and so on).

2 Caitlin
Thats probably something similar I did in my latest bot version. The way my bot now works, he actually learns from normal chat of 2 users, and forms the responses for known sentences.

Quote:

<user1> Hi
<user2> Hello
<user1> How are you ?
<user2> Thank you. I am fine.


The bot learns that :

[hi] -> [Hello]
[Hello] -> [How are you ?]
[How are you ?] -> [Thank you I am fine.]

Then if someone asks bot:

Quote:

<user1> hi bot
<bot> Hello


This system is pretty simple, but can learn from scratch in any language, and gives acceptable results most of the time.

Share this post


Link to post
Share on other sites
aNOTHER SIDENOTE I REMEMBERED THATS PRETTY IMPORTANT AS I WAS WORKING ON SOME ai STUFF. tHERE MUST ALSO BE A WAY FOR YOU TO PROVIDE BOTH POSITIVE AND NEGATIVE REINFORCEMENT TO YOUR AI. yOU SHOULDN'T DO THIS BY USING WORDS, BUT RATHER BY USING SOME SORT OF POSITIVE/NEGATIVE 'EMOTIONAL' INPUTS. tHESE COULD JUST BE WORDS YOU MAKE UP SUCH AS 'RDWOTJF' OR A STRING OF SYMBOLS. tHE ai WOULD THEN INTERPRET THESE ACCORDINGLY TO ANALYZE ITS BEHAVIOR AND MODIFY IT ACCORDINGLY. eVENTUALLY YOUR ai *SHOULD* BE ABLE TO ASSOCIATE WORDS LIKE 'BAD', 'STOP', ETC WITH AN EMOTION, ENABLING IT TO DISTINGUISH BAD BEHAVIOR FROM GOOD BEHAVIOR USING REGULAR WORDS AND PHRASES.

aLSO YOU COULD INCLUDE A KEYWORD (AGAIN NOT A REAL WORD) THAT TELLS THE ai YOU ARE 'LOOKING' IN ITS DIRECTION. tHIS WOULD BE MOST USEFUL IN THE INITIAL LEARNING PROCESS FOR SUCH THINGS AS THE ai'S NAME, AND EMOTIONS DIRECTED AT IT.

oVERALL i THINK THAT ANYONE DESIGNING AN ai THAT IS SUPPOSED TO LEARN EVERYTHING IT KNOWS FROM INTERACTION NEEDS TO LOOK AT THE WAY ANIMALS, HUMANS IN PARTICULAR, INTERACT WITH THEIR YOUNG - INFANTS ESPECIALLY.

edit:

I'm really sorry for the caps lock thing, I was programming and forgot it was on.

Share this post


Link to post
Share on other sites
Quote:

aNOTHER SIDENOTE I REMEMBERED THATS PRETTY IMPORTANT AS I WAS WORKING ON SOME ai STUFF. tHERE MUST ALSO BE A WAY FOR YOU TO PROVIDE BOTH POSITIVE AND NEGATIVE REINFORCEMENT TO YOUR AI. yOU SHOULDN'T DO THIS BY USING WORDS, BUT RATHER BY USING SOME SORT OF POSITIVE/NEGATIVE 'EMOTIONAL' INPUTS. tHESE COULD JUST BE WORDS YOU MAKE UP SUCH AS 'RDWOTJF' OR A STRING OF SYMBOLS. tHE ai WOULD THEN INTERPRET THESE ACCORDINGLY TO ANALYZE ITS BEHAVIOR AND MODIFY IT ACCORDINGLY. eVENTUALLY YOUR ai *SHOULD* BE ABLE TO ASSOCIATE WORDS LIKE 'BAD', 'STOP', ETC WITH AN EMOTION, ENABLING IT TO DISTINGUISH BAD BEHAVIOR FROM GOOD BEHAVIOR USING REGULAR WORDS AND PHRASES.

aLSO YOU COULD INCLUDE A KEYWORD (AGAIN NOT A REAL WORD) THAT TELLS THE ai YOU ARE 'LOOKING' IN ITS DIRECTION. tHIS WOULD BE MOST USEFUL IN THE INITIAL LEARNING PROCESS FOR SUCH THINGS AS THE ai'S NAME, AND EMOTIONS DIRECTED AT IT.

oVERALL i THINK THAT ANYONE DESIGNING AN ai THAT IS SUPPOSED TO LEARN EVERYTHING IT KNOWS FROM INTERACTION NEEDS TO LOOK AT THE WAY ANIMALS, HUMANS IN PARTICULAR, INTERACT WITH THEIR YOUNG - INFANTS ESPECIALLY.

edit:

I'm really sorry for the caps lock thing, I was programming and forgot it was on.


I had been thinking about that. But I came up with a conclusion, that this system is going to be hard to make, I don't have a clue how it can be done even in theory.

Imagine an IRC bot, his library is completely empty, he don't know at least one word. How can he figure out what is good response and what is bad response. The animals they actually are physical beings, they can be heart - this gives them ability to feel what is bad and what good. But how is it possible to make a bot feel something similar ?

Share this post


Link to post
Share on other sites
Quote:
The problem itself:
1. How to make this system, completely language independent.
2. Learning new words, phrases and responses from users chatting (this is the hardest part for now - How to get the idea to what phrase the response is written)


The problem is you just end up programming a bot that mimics (kind of like a parrot) rather than a bot that understands the syntax and semantics of the language. So you eventually end up with gibberish, also people will abuse it by giving it rubbish as input too. So with your example with the asprin, the bot would never give that answer unless someone else had already said it before once (and chances are that noone will ever have used the word asprin)

We have years of experience in the world every minute of every day with language. This include all our senses and interaction with lots of people. There is no way a bot on IRC will pick up good use of english language and it's meaning.

The only possible way of getting something near it is to make a kind of expert system using a prebuilt database of links between words. So the word headache might be linked to the word asperin, with the type of link being "problem/solution". Therefore if anyone says "I have a headache" the bot could look up that word in it's dictionary, notice it's a problem and offer the solution "asperin". Kind of like a neandertal grunt of an answer, rather than perfect grammar, but it does show intelligence.











Share this post


Link to post
Share on other sites
Remember that it takes humans about 10 years of continual practice to get to the skill level of the average IRC chat.

It may be that the big problem is not the algorithms, but the amount of training needed.

Anyway, if I were to approach this, I'd go with a mimicry approach: connect to a busy IRC server, listen in on all channels and all users, and train the bot using separate contexts; one per active chatter per channel. This could make the bot take on the meta-personality of everyone on IRC ;-)

You'd probably need a clever association database and fuzzy searcher to make this go, and when the database grew, it would start running slowly, but I think this is the way forwards towards chatbots that are sufficiently hard to tell from someone trying to be a chatbot. And, once you're there, then does it matter if it's "mimicry" or "learning"? What's the difference? What will it answer when you ask it if it wants to cyber? ;-)

Share this post


Link to post
Share on other sites
Yes you are right. It is probably impossible to make a bot for IRC that can act as a real person. About expert system that is a good choice, although it would require allot of work to fill this information, and I don't think the bot would act like a human, more like a expert (problem -> solution).

So maybe the mimic is the way to go (although for IRC this is one big problems, as allot of people spam some garbage that ruins the whole library). About the humans they do learn by others, but they somehow interpolate the data and can output the different result then expected, thats the way to go I think.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this