IRC chatbot determining the response

Started by
16 comments, last by DMINATOR 18 years, 5 months ago
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.
Free Mac Mini (I know, I'm a tool)
Advertisement
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]
Young Doc: No wonder this circuit failed. It says "Made in Japan".Marty McFly: What do you mean, Doc? All the best stuff is made in Japan.Young Doc: Unbelievable.
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.
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.
Young Doc: No wonder this circuit failed. It says "Made in Japan".Marty McFly: What do you mean, Doc? All the best stuff is made in Japan.Young Doc: Unbelievable.
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 ?
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.











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? ;-)
enum Bool { True, False, FileNotFound };
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.

This topic is closed to new replies.

Advertisement