Giter Site home page Giter Site logo

ath3r / multilingual_chatbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shriramshagri/multilingual_chatbot

0.0 0.0 0.0 2.02 MB

A chat bot API

Python 15.76% JavaScript 29.50% CSS 6.32% Kotlin 0.12% Swift 0.38% Objective-C 0.04% Dart 17.05% EJS 30.83%

multilingual_chatbot's Introduction

Multilingual Chatbot

What's our idea?

Our idea is to build a multilingual chatbot which can be implemented over different development environments.

What will this improve?

A chatbot which can talk in more than one language finds itself useful to developers who are targeting to develop an mobile or web application which requires customer care services and which has the users from large geographical area. The support for multiple languages can be very user friendly as the users can interact with their language of choice.


Approach:

Our approach for multilingual chat bot model includes an API which takes user question as an input, tries to understand and delivers a proper reply for the question user asks as an output. Primary goal is to include as many regional languages of India as possible.

The type of chat bot that we are building is retrieval type chat bot or rule based chat bot. The replies are not generated runtime but are fetched from database which holds previously determined reply strings. The reason we chose on building a rule based chat bot is because of the domain we chose. The answers are mostly descriptive and are to be stored in database.


Architecture:

The model consists of following components:

  1. A front end for user interactions.
  2. A managing API which takes care of translation and categorizing, any changes on functionality of the API can be done here.
  3. A chat bot API which domain specific, which takes care of natural language processing.
  4. A database to store replies for the questions asked.

The working of this model is as follows:

  1. Front-end can be designed as both a mobile application or a website.
  2. The user string can be any of the languages mentioned later. The language of the string can be detected automatically but the drawback is that the accuracy decreases and also there may be an error if the user uses a language that is not supported by our API. The user chooses the language that he likes to give the input in and the output will be in the same corresponding language.
  3. In the API, the input is further translated to English from their corresponding languages to simplify the computations.
  4. This translated string is further fed into a neural network which takes care of prediction.
  5. This machine learning model returns back a reply after understanding what the user has asked.
  6. These replies and previously stored in a database in different languages supported and fetched accordingly.
  7. The replies are sent back in the language chosen to the application or website that posted the question string.

Languages Supported:

  1. English
  2. Kannada
  3. Tamil
  4. Malayalam
  5. Telugu
  6. Hindi

Planning to extend to more regional languages soon


Domain:

As building a general chat bot is very hard a suitable domain for the chat bot has been chosen. The domain we chose for the chat bot is COVID-19 outbreak. We designed a chat bot which answers any questions related to following topics.

  1. Symptoms of the disease.
  2. Modes of disease spread.
  3. Precautions to be taken.
  4. Cures
  5. About corona virus

What are the types questions that can be asked?

Questions can broadly classified into two kinds. First one is descriptive questions(Example: "What is COVID-19?") where the questions asked by the user has a unique descriptive answer. These kinds of questions are easier to handle. The second type of questions require chained replies(Example: "I visited hospital. Are there chances of me getting infected?"). This means in some particular types of questions, the answer can be only given after analyzing the situation the user is in. So once such question is asked, we will have to ask a few questions back to the user to get details on his current situation and only then a proper answer can be given.


This repository includes following contents:

  • Chatbot JavaScript Website
  • Chatbot Flutter Mobile Application
  • Node API (For Translation)
  • Flask API (For Machine Learning)

Website


Flutter Application


Node API


Flask API

To train the api to answer custom questions change the json files inside Categories file and train the bot.


Requirements

  • Python 3.6
  • Tensorflow 1.14
  • Nltk
  • Flask
  • Redis Database (Include config file for getting url port and password for database)

To setup environment in anaconda:

    conda create -n chatbot python=3.6
    activate chatbot

Install modules:

    pip install -r requirements.txt

Run server:

    flask run

Config file:

    def cred():
        redis = {
            'host' : "host url",
            'port' : 'port number',
            'password' : 'password'
        }
        return redis

Routes

  • Languages
  • Category
  • Prediction(POST Request)

JSON Format for POST Request:

{
	"ques": "Question String",
	"lang": "Language code"
}

Reply:

{
	"reply": "Reply String",
	"chain": "Boolean Value"
}

Contributions

Shrirama Shagri
Sai Pranav
Sumith SB
Subodh
Shivani
Shree Vidya
Vandana
Ather

multilingual_chatbot's People

Contributors

ath3r avatar shriramshagri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.