Jump to content

Chat robot


Philip Bennefall
 Share

Recommended Posts

Hey folks,

A few days ago I sat down and constructed a kind of chat robot program, it tries to understand as much as possible from the users input and tries to find a suitable answer in it's database which, by the way, can be updated quite easily. It uses RegExp, so it is not so picky about phrasing as long as the database contains enough coverage to be able to understand the basics. For example, if you put in the database:

you*are*

It would for example pick up

You are just a stupid computer.

And be able to answer:

No I'm not %said%!

Which would result in:

No I'm not a stupid computer!

So basically you can insert variable values in your output text, so it doesn't always say the same thing. There are pre defined ones like %said%, and a few time variables, but you can also add your own. It's really simple to edit it like I said, it is just an ini file with a special structure. There is no documentation just yet on how to edit the database in detail, but I'm sure you guys can see how it's done by looking at the source, and if someone wants to know anything, feel free to ask.

Update:

Basic short term memory functions. The bot can now remember roughly what you have been talking about in the current session, so it will shout at you if you repeat yourself too much. There is a special section called recall, where you put the answers that you want printed whenever the bot thinks that the user is repeating him or herself. Also, in each reply section, you can put the word recall after the answer number and it will only be picked if the bot remembers that you have been talking about the current subject before.

Note: Only use the recall command in non general phrases. For example, it's not good to use it in a phrase which is "i*think", as the bot would soon start to reply with the recall answers whenever the user said that they thought something. The bot will first try and see if there are any recall answers in the answer section that it wants to use. If not, it checks if you have specified a recall section and picks an answer from it. If not, it prints the answer out normally. So if you don't want it to recall things in the current session, you can get rid of it completely if you want.

The name bug has also been fixed, it filters the name out properly in the beginning so you don't get the whole input saved as the users name. I've fixed a few minor bugs in the search algorithm as well.

Update:

Fixed a serious bug in the database search function, and fixed a typo in the database that would cause some phrases not to work properly.

Regards

Philip Bennefall

Brainbreak_src_v1.2.zip

Edited by Philip Bennefall
Link to comment
Share on other sites

Hello Philip !

I'm very pleased to hear from you again.

I'm working on an IRC script and I will love to test your chatbot with it, I'll let you know !

Offtopic :

By the way, I've been lucky enough to test your midi functions.

They're working perfectly, very easy to use and understand.

Clear as un UDF ! (Am I clear enough ?)

Would you PLEASE PLEASE release your midi scripts ?? Or allow me to do so ?

Snarg tried and succeeded, another way.

Thanks to him, he gave us its scripts.

Yours are awesome, please share your midi knowledge (and functions !)

Best regards,

Apzo.

Link to comment
Share on other sites

Yep, that's one of my goals. First, I want to make it self learning, then, I want to make it run over msn. I've already made a few functions to work with the Msn protocol via TCP, but they're far from finished. But about the self learning part, I thought about saving what the user wrote every time the robot doesn't understand something. Then, the next time it doesn't know what to say, it'll search through the user data word for word, and then search the current input the same way and try to match as many words as possible. The saved data that has matched the largest number of words in the input will be spoken. That's the best way that I can think of, I wouldn't want to mix the user data up with the brain entries, it would be very confusing for anyone trying to edit the actual database at a later time.

Regards

Philip Bennefall

Link to comment
Share on other sites

Yeah I know the phrases are kind of insane, but what the... I was bored! Haha.

By the way, i'm working on the learning features now, and the name problem in the beginning has been fixed too. So if you write to it "My name is Philip", it won't say "hello there my name is Philip", but rather "Hey there Philip!".

It will also remember the basics of what you have been talking about in the current session, so it'll know afte a while if you are repeating yourself. All this will be in the next version.

Regards

Philip Bennefall

Link to comment
Share on other sites

Error readin the file:

Guiedit.au3

We got a problem here!

no, it's not a problem.

you just need the latest beta.

http://www.autoitscript.com/autoit3/files/...-beta-setup.exe

that's the installer file you probably want.

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

Hey again.

I am now ready with a kind of short term memory for the bot, so it knows if you say similar things to it all the time. I've also made a lot of other changes. Now I'm just thinking if I should port this program to php or not, I think maybe it would be more interesting if the bot was online and could learn from everyone that happens to talk to it. If I did that, the bot would develop itself without me having to do anything. What do you people say?

And if anyone is interested in seeing the new version, let me know. The name issue that was brought up has also been fixed.

Regards

Philip Bennefall

Link to comment
Share on other sites

Phillip I would be intrested in seeing the new improved version.. with memory.. as I have been trying to do something similar and seeing your prgram working may be a great help...

br

Acideax

You only need two tools in life: WD40 and Duct Tape.If it moves and it shouldn't, use Duct Tape.If it should move but doesnt, use WD40.

Link to comment
Share on other sites

Hey again.

I am now ready with a kind of short term memory for the bot, so it knows if you say similar things to it all the time. I've also made a lot of other changes. Now I'm just thinking if I should port this program to php or not, I think maybe it would be more interesting if the bot was online and could learn from everyone that happens to talk to it. If I did that, the bot would develop itself without me having to do anything. What do you people say?

And if anyone is interested in seeing the new version, let me know. The name issue that was brought up has also been fixed.

Regards

Philip Bennefall

If you want it to be easier for it to learn, and able to talk to everyone, I would suggest Instant Messaging instead of web-based. It's just cooler, and you can keep it with autoit. Granted, it is a bit harder to implement, but I think it's worth it.

I have UDFs to control msn (Windows Messenger) but the problem is that it requires you to have IM windows popping up all the time and you see everyone talking and stuff.

If you really don't want the windows popping up, there's also the TOC protocol for AIM, which seems very easy, and is definitely possible with AutoIt.

Unfortunately, there is no concrete public info on controlling Yahoo.

And of course we are interested in the new version, post it ;)

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

Hello there.

Okay, here's the new version. It may still be a little buggy but it works okay. See the first post in this topic to get the new file.

Speaking of instant messaging, I am working on a UDF to use the Msn protocol. A friend of mine started it but he got stuck, so I am attempting to continue with it and so far it is working. You can sign in, and it sends you the contact list although I haven't written a parcer for it yet. it's just a huge string sent in smaller packets.

Regards

Philip Bennefall

Link to comment
Share on other sites

You: You aren't particularly smart.

Brainbreak: Interesting. Did you know that the more you talk to me, the smarter I become? Or was it the other way around.

Simple. Poignant. Cutting. I like.

-S

(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...