Sign in to follow this  
blackviper91

Chatbots

Recommended Posts

I am currently working on a chatbot (program that intelligently talks to the user) using javascript. I plan to make it so the program responds based on keywords in the users message. What ideas does anyone have on this subject? What features should be implemented? [Edited by - blackviper91 on March 12, 2006 11:40:21 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
I am currently a chatbot

I sinceriely hope not :) Admin do you allow forum bots? ;)

Share this post


Link to post
Share on other sites
making something that actually chats is pretty difficult but if you just want it to respon to keywords that shouldnt be too hard

have a class for responses, it contain string response and a collection of strings for keywords
just parse the string and see which instance of response has the most keyword or combination of keyword hits

Share this post


Link to post
Share on other sites
Well, I'm sure everyone knows about this already but there is always the classic Eliza that turns your statements into questions, ie:

I think I am coming down with flu

You think you are coming down with flu?

just by mapping I to you, mine to your etc.

If you randomly intersperse a few of these with other methods it can produce quite a surprisingly realistic conversation flow.

Share this post


Link to post
Share on other sites
Hey there.

I'm also working on a chatbot. (well, between bots, but i've worked on joan for awhile now). i've made heaps, so if you have any questions, or just want to chat about it add my msn.


Uh, in terms of features, what you should be aiming to do is less in terms of outright hardcoded "features" as they are hell for balance. (look at matrixbot *cringe*. worked ok, but was tempermental as hell. There is no way i could get everything working at once).

I am currently using a very (Very, very) simple algorithm called maximatch, which basically allows the program to respond, based on keywords on the input of the user. (and a kb which is built up over conversations that the bot records).

Ask me about it.

As per the bot, add Joanstable@hotmail.com to your contacts list. (i rarely keep her on tho. She's getting a bit old, and the fan support is wearing thin).

[Edited by - Nice Coder on November 24, 2009 3:38:19 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Quote:
I am currently a chatbot

I sinceriely hope not :) Admin do you allow forum bots? ;)


Some among us suspect that kSquared really is a chatbot. Or possibly a brain in a jar.

Share this post


Link to post
Share on other sites
popolon: Thank you for the link

Nice Coder: Could you tell me more about maximatch please?


The way I do it is I separate each word in the user input into an array, then process it with a for loop. Here is some sample code:

if (LowCaseMsg[i] == "what" && LowCaseMsg[i+1] == "is") {
//LowCaseMsg is the array of words from user input, i is the variable used in the 'for' loop. This checks for 'what is'.
if (LowCaseMsg[i+2] == "a" || LowCaseMsg[i+2] == "an") {
//this checks to see if it is 'what is a'
if (LowCaseMsg[i+3] == "chatbot") {
printout = "A program that is designed to intelligently talk to a user, like me."
whatis = 1 //if the computer doesn't recognize the word this will be 0 at the end so it will print 'I have never heard of that'.
}

tell if you don't understand that.

Share this post


Link to post
Share on other sites
You might consider checking out Megahal, as it responds to keywords, or maybe even ALICE, although it features a more sophisticated grammer and syntax analysis engine that might make it difficult to isolate the code relevant to the program you're designing.

Share this post


Link to post
Share on other sites
first you will need the tags that the chat room uses to read them (just ask for them like yahoo gives the tag to you for good causes) then use a script like this

if value1 contains keyword then value2=responce

and make one of thes lines for every key word.

Share this post


Link to post
Share on other sites
Quote:
Original post by tjweb92
Quote:
Original post by Anonymous Poster
Quote:
I am currently a chatbot

I sinceriely hope not :) Admin do you allow forum bots? ;)


not what he typed


Note in the original post:
Quote:

[Edited by - blackviper91 on March 12, 2006 11:40:21 AM]

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