Blogs

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).

Common Challenges

There are some obvious and not-so-obvious challenges when building conversational agents most of which are active research areas.

  1. Incorporating Context
  2. Coherent Personality
  3. 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

  1. We remove the stop words like extra words which don’t add value to sentence.
  2. Replace all the similar word with the words stored in DB
  3. Than Create a word cloud using K-Clustering
  4. Compare the word cloud with the database which is a neural net and keep adding the current chat.
  5. Give a probabilistic score to each match , add the old relevance weightage to the score

Leave a Reply

Visit Us On TwitterVisit Us On FacebookVisit Us On YoutubeVisit Us On Linkedin