CHATBOT

 Status : Completed

Tags: MySQL Python Ngrok. APIs RASA 2.0 Twilio



AIM

To develop an ML- AI-based chatbot that simulates human conversation and handles the contest, chit-chat, and replies accordingly.


COMPONENTS AND TECHNOLOGIES USED

  • Python

  • RASA 2.0

  • MySQL

  • APIs

  • Twilio

  • Ngrok.


OVERVIEW

 

Project report

CHATBOT


 

Aim -

To develop an ML- AI-based chatbot that simulates human conversation and handles the contest, chit-chat, and replies accordingly.

 

Tech stack -

Python, RASA 2.0, MySQL, API (Google, Open AI, and Telegram), Twilio, Ngrok.

Introduction -

Chatbot processes human conversation, allowing humans to interact with digital devices as if they were communicating with a real person.

 For this we need to understand the domain where it is to be deployed and the dataset is trained    accordingly.

 The chat is made and the data is stored to self-train and make the bot for user experience.


 

Working of the bot -

  •  While deploying on the server, a link and scanner are generated that drives you to the chatbot..The conversation begins on the user’s side with /start for which
  • “Hey! How are you  ?” comes from the bot’s side and the chatbot

starts.

  • The questions and conversations are made for which the bot

replies. In case, there is a question that is out of the box :

Two cases occur -

a. If restricted words are used then it displays “Not Adequate

   info provided, try again with more description”.

b. Else the bot gets connected to Google and chatgpt for

    accurate responses.

  •  The chats will be stored for later training of data and better user

experience.


 

Methodology -

  • The components and requirements mentioned above are fulfilled.
  •  We trained the machine using Natural Language Processing Toolkit at RASA 2.0 by giving examples of relevant questions. A chatbot is in action.  
  • The chatbot is then connected to a database for the storage of searches for future use. (MySQL using MySQL connector)  
  • Then, the chatbot is customized using the Spacy and changes in pipeline, configuration, and credenƟals of RASA 2.0.  
  • To increase our dimension of search, chats, and data , we :
  •    1. Extracted datasheet from the google data sheet.
  •    2. Connected the bot to open AI.  
  • After the bot training and customization as per requirement is completed, we test it on the command line and resolve issues if they occur.  
  • Then, we connected it to the web at a local server using the rasa-widget tool. (The modificaƟon of the web page can be with GUI creation using Flask (HTML, CSS, and JS in Jinja template ).  
  • We also connected it to Whatsapp and Telegram. We hosted the bot on Telegram using Twilio (API provider) and Ngrok (to provide a local server for implementation ). 

 

WorkFlow -

 

 


 

Problem faced -

 

  1. Initially faced errors in the domain file because the responses had to start with utter_in the syntax
  2. Faced eros trying to extract names of people especially Indian names fixed it by using NLTK and now can extract spacy NLTK and now can extract English names and full Hindi names as well.
  3. Faced error while running action file because of an outdated version of rasa_sdk software 
  4. Faced an error while directly connecting the Google sheet API. We needed a service account for it before extracting the Google sheet.
  5. Connection Timeout error in case of printing large data in rasa 2.0. We fixed it by limiting the number of tokens it can display.
  6. Error while connecting fallback action with policy resulting in all actions going to fallback.
  7. Open AI error update the sanic jwt version
  8. Mysql syntax and one word missing in the code
  9. Rasa deploy an error on
  10.  telegram: ngrok server
  11. WhatsApp: Twilio website error and syntax error in credentials.yml file
  12. GUI: While adding a server in html page and direct opening from the folder
  13. We have faced a memory full error while training the model



 

Video link - https://youtu.be/cP_AfVeRjo0

 

Resources -

 

Python Resource

Documentation: - https://docs.python.org/3.7/https://docs.python.org/3.7/

 Video link:-

 https://www.youtube.com/watch?v=YYXdXT2l-Gg&list=PLosiE80TeTt2d9bfVyTiXJA-UTHn6WwU

 RASA 2.0

 Documentation:  https://rasa.com/docs/rasa/2.x

 

 MySQL:-

Documentation

 https://dev.mysql.com/doc/

Video link

https://youtube.com/playlist?list=PLjVLYmrlmjGeyCPgdHL2vWmEGKxcpsC0E

 

Real-life applications -

  • Chatbots can be used for guiding customers, advising them, and avoiding abandonments and drop-offs.
  •  Nowadays, they can be used for money transacƟons like paying bills and checking transactions.
  •  It can also be used in an organization for answering FAQs (frequently asked questions).
  •  It can be used for 24/7 customer support by booking appointments, resolving queries, etc.
  •  It can also be used as an advertisement tool pitching and displaying products as per user.


 

CONTRIBUTORS -

Name

Branch

Reg. no.

Sneha Chaturvedi

Chemical Engineering

20218004

Bhanu Pratap Singh

Biotechnology Engineering

20210010

Sarthak Kumar

Electronics and communication engineering

20215089

Kirtiman Dubey

Electronics and communication engineering

20215005

MENTORS -

  1.  Anurag Gupta(20195168)
  2. Shashank Singh(20202085)
  3. Ankit Gupta (20202017)


 

Thank you, 

Team  chatbot