Skip to content

Set of scripts to build a chatbot which will answer based on the FAQs supplied.

License

Notifications You must be signed in to change notification settings

yogeshhk/FAQChatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FAQs ChatBot

Getting answer automatically is magic!! its real AI (remember, the Turing Test?)

This project is a Simple Question-Answer (atomic query) based chatbot framework. Uses similarity based on different vectorizers, to find the matching question then responds with its corresponding answer.

Application Scope:

  • Huge demand to take care of mundane queries
  • Scales (leverage, automation, passive)
  • Not much work in vernacular chatbot (serve humanity)

Notes:

  • This chatbot is based on category classification first and then to similarity within the selected category.
  • Different than the popular open source chatbot framework, Rasa, where NLU is based on intent and entities, whereas dialog management is based on sequence/LSTM prediction.
  • Conceptually it is similar to Microsoft's QnA Maker. But the big difference is that, if you get whole this whole github code-base, your models would be local. Nothing on Server. So better security especially for sensitive data chatbots like HR or Finance.

Copyright (C) 2019 Yogesh H Kulkarni

To Dos

  • Implement sentence embedding via HuggingFace or Spacy
  • Build full FAQ chatbot platform using switchable embediddings
  • [New] LangChain + Vector Db like GPT-Index or Pinecone (cloud) can be used to perform FAQs

The way it works:

  • You supply FAQs in the form of csv (comma separated file) having Question-Answer-Class in each row (e.g. "What is GST rate for Toothpaste?,12,rate")
  • Questions are vectorized and kept ready for matching, along with the classifier model [X=vector(question), y=class]
  • Once user query comes, its 'class' is predicted using the classifier model and within the class, vectorized query is matched against existing vectorized questions.
  • Whichever is most similar, it's answer is presented to the user.

Scripts:

  • app.py: Chatbot UI built using Flask, using templates/*.html
  • bankfaqs.py: Chatbot core logic as well as knowledge-base.

Other Data:

  • faqs: csv files containing questions and answers
  • static and templates: Flask UI related files

To run:

chatwindow

Dependencies:

  • Needs Python 3.6, numpy, scipy, sklearn

References

  • Bhavani Ravi’s event-bot code, Youtube Video
  • Banking FAQ Bot code

Disclaimer:

  • Author (yogeshkulkarni@yahoo.com) gives no guarantee of the results of the program. It is just a fun script. Lot of improvements are still to be made. So, don’t depend on it at all.

About

Set of scripts to build a chatbot which will answer based on the FAQs supplied.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •