Types of Chatbots and their implementation
Chatbots, also called Conversational Agents or Dialog Systems, are a hot topic. Microsoft is making big bets on chatbots, and so are companies like Facebook (M), Apple (Siri), Google, WeChat, and Slack. There is a new wave of startups trying to change how consumers interact with services by building consumer apps like Operator or x.ai, bot platforms like Chatfuel, and bot libraries like Howdy’s Botkit. Microsoft recently released their own bot developer framework.
Retrieval-based models (easier) use a repository of predefined responses and some kind of heuristic to pick an appropriate response based on the input and context. The heuristic could be as simple as a rule-based expression match, or as complex as an ensemble of Machine Learning classifiers. These systems don’t generate any new text, they just pick a response from a fixed set.
Generative models (harder) don’t rely on pre-defined responses. They generate new responses from scratch. Generative models are typically based on Machine Translation techniques, but instead of translating from one language to another, we “translate” from an input to an output (response).
There are some obvious and not-so-obvious challenges when building conversational agents most of which are active research areas.
- Incorporating Context
- Coherent Personality
- Evaluation of Models
Model /Algorithm (Easy way to Build Chat Bots)
AIML BASED (Simplest Approach) – Code basic Java/Servlet based framework, create jsp which call the servlet and uses JAVA Aiml files created by Program-ab (https://code.google.com/p/program-ab/)). This is the simplest approach which uses AIML files created by google and work with 80% accuracy for the inputted data in AIML . This has some AI/ML component in it , but If you are looking for 90+ % accuracy this might not be a way to go . But it’s a good place to start.
NLP- ML : I created the basic architecture below , hope this will help in creating a complicated but more accurate chatbot.
Step By Step
- We remove the stop words like extra words which don’t add value to sentence.
- Replace all the similar word with the words stored in DB
- Than Create a word cloud using K-Clustering
- Compare the word cloud with the database which is a neural net and keep adding the current chat.
- Give a probabilistic score to each match , add the old relevance weightage to the score