954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Chatbot Database Issue

Ok, I'm developing a chat bot for a client. But I'm having a hard time figuring out the best way to do this.

Because the bot isn't that big, I thought use a table with the phrase and the response. Then use LIKE. Not as easy as I thought though.

Lets say I had the phrase "server down" and the response was "please contact [email]db@site.com[/email]". If the user typed in "Help, my server has gone down today for about 5 hours what can I do".

.... The issue is how should that be fed into the database to get that response?

Someone recommended creating a blacklist of words, like 'help', 'my', 'has', 'gone', 'today', 'for', 'about', 'five' .... Or a white list of common words.

Sort of lost. What would you recommened. I cant find anything on Google about it.

JayOne
Newbie Poster
13 posts since Dec 2009
Reputation Points: 17
Solved Threads: 0
 

Whether you use a blacklist or a whitelist... I think you must create the one which is smallest and/or with the least impact. I think a blacklist would be smaller, if you allow no words smaller than 4 characters to be used anyway.

You could add tagging to a response. So for example in your example the response is tagged with 'server' and 'down'. It would be possible to create a search on the tags.

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

I created a simple chat bot a year or so ago now. The way i went about it was to store keywords in the database that relate to a specific question, or desired output. (This is compiled with a very simple form)

To search the database I break the input down into an array of single words and use a group of functions to search for the entries whos keywords are all in the input array. I can if i want have a selection of different outputs for any set of keywords.

-- I did say it was simple! --

This is a very basic method but it does work. and allows an automated response from a "question".

A lack of spare time has prevented me from developing my chat bot much, but I would love to have a system that not just replies but can ask related questions back and be a little more interactive than just a dead end response, I have some ideas for that but its a huge task, and somewhat complex! If anyone has any ideas on how to structure this I would like to hear from you.

TheWabbit
Newbie Poster
2 posts since Mar 2010
Reputation Points: 13
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You