Jump to content
  • Advertisement
Sign in to follow this  
blackviper91

Chatbots

This topic is 4463 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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 == "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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!