Reputation: 23
I'm trying to create a keyword based Chatterbot on the web. Simply look for keywords in an input and return relevant responses.
Example:
User(Input): What is your phone number?
Bot(Output): 555-555-5555
This would occur due to the presence of the the keyword "phone" or "number". You could create a database of keywords:
Output String: 555-555-5555
Related Keywords (that would trigger that output):
- phone
- number
- telephone
- cell
- landline
- call
- etc.
You could build upon that further and have it output multiple responses relating to the keywords in the input.
Example:
User: Is there a number where I can reach you? I need to talk to you about your new address!
Bot: 555-555-5555, 123 Main St.
Does anyone know where to start?
Thanks!
Upvotes: 1
Views: 407
Reputation: 425
Building on what @H_I said, I strongly recommend AIML. It is a very easy language to use: you don't even need much code using this software: http://riotsw.com/sae.html. To work with keywords, just remember to put in the input field * KEYWORD _
(include the spaces between the characters), so when the keyword is used, it automatically gives a set answer. You can then upload the chatbot's AIML file to Pandorabots and then load it onto your website from there! Hope this helps.
Upvotes: 0
Reputation: 385
If you want to know what already exists, take a look at "chatterbot" on delicious.
Maybe you could begin with AIML (ALICE).
I personally wrote such a chatterbot in C, but it was first hard-coded, and then I used a small table of stimuli-responses (Achille was the name of this software): http://francois.parmentier.free.fr/irc/achille_e.html (look at vlad-ons.c). Hum! I realize now that it is an old program, mainly hard-coded for French keywords :/
Upvotes: 2
Reputation: 9160
Well, you could start with a big if-else
statement just looking for keywords, like Eliza.
When that is not enough then you could move to pairs of ordered keywords and keyword modifiers , like NOT, MY, etc.
When that's not enough then you get in to grammars. You start with simple grammars like the ones used in the old infocom text-based games.
When that's still not enough then you enter the realm of natural language processing. You pick up Russel&Norvig's intro to AI book and then pickup a recent textbook from MIT Press on NLP and go to town on those algorithms.
Upvotes: 1