Coder Social home page Coder Social logo

avirup-bhattacharya / voice-enabled-chatbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scalability4all/voice-enabled-chatbot

0.0 0.0 0.0 25.02 MB

Implementing a voice enabled chatbot which converses with a user via their voice in natural language. Website: https://scalability4all.github.io/

License: MIT License

Python 100.00%

voice-enabled-chatbot's Introduction

Voice Enabled Chatbot

Build Status codecov

Implementing a voice enabled chatbot which converses with a user via their voice in natural language. The user should be able to interact with the application like a voice assistant and appropriate response will be returned by the application (also through voice). The number of topics to converse upon will be fixed however the user should be able to converse through natural language.

If we have topics like the weather, location information, inventory information etc the application should be able to converse in that particular topic. Like, if we have questions such as:-

Hey, what is the weather today? - Weather Information

I want to know if there are any shopping stores near me? - Location Information

Will it rain today? - Weather Information

Can you tell me availability of item in store X? - Inventory Information

Initially the application should be able to identify each particular topic and then return the appropriate response. After that, the chatbot should carry on the conversation regarding that particular topic. For eg:

User - I want to know if there are any shopping stores near me.

Chatbot - These are the nearest stores:- A, B, C. Where do you wanna go?

User - I want to go to the most popular one among them

Chatbot- All right, showing you directions to C.

So, mainly the chatbot should formulate appropriate responses to incoming questions and carry on the conversation. Keep in mind, the conversation would be in natural language and the user has returned sufficient information.

Concept

Before starting conversation, bot will fetch the location of the user and other details to give personalized results.

Step 1: Speech-2-Text: Given a speech through Microphone, store it and convert it using SpeechRecognition and PyAudio libraries.

Step 2: Topic Modelling: Get Entity and Intent of chat using model with a corpora. To get the trained model, we will use the classifier to categorize it into weather, location and inventory. After that using RASA-NLU with Spacy library, we will extract the entities.

Step 3: After Finding Intent and Entity, we will set the model using the following method: Intent = Weather: Based on entity specified, We will use weather API to fetch data of location. Intent = Location: Following conversation flow: Get Stores located or Any Nearby Stores Choose Store Inventory Details about Store

Step 4: Use cache mechanism to give result about recently used query.

Changelog

  • v0.1.1

    • Added support for speech to text
    • Added support of weather and google places api
    • Added basic introduction chat
    • Added voice support to chat

Usage

To change the language, enter the BCP-47 code from language support. If you want the language to be English (default), press enter.

Arguments:

         For now, you can use it for following domain:
         Introduction: Hi, Hello..
         Weather: Get weather info
         Google Search: get any google search
         Wikipedia Search: What is "query"?
         Google Places: Get me best places.

You can quit by pressing Ctrl+C

Build the application locally

  • Clone the repo
    • Clone the voice-enabled-chatbot repo locally. In the terminal, run :
      git clone https://github.com/satyammittal/voice-enabled-chatbot.git
  • Install the dependencies
    • We need PyAudio, a cross-platform audio I/O library.For this run :
      sudo apt-get install portaudio19-dev (linux)
      brew install portaudio (mac)
    • Further, install other requirements using :
      pip install -r requirements.txt
    • Using windows, install other requirements using:
      pip install -r requirements_windows.txt
    • Install english stopwords using :
      python -c "import nltk; nltk.download('stopwords')"
    • The pyowm is supposed to be instable in windows.
  • Configure Google API Key
    • Go to the Google Cloud Platform Console.
    • Select or create the project for which you want to add an API key.
    • Click the menu button and select APIs & Services > Credentials.
    • On the Credentials page, click Create credentials > API key.
    • Copy and paste the API key in config.py file.

Run the application

Run the application using command - python chatbot.py

Milestones

  1. Completing chat bot so that it works on multiple domain specified through config.
  2. Adding classification techniques for intent seperation.
  3. Automated method for Entity creation from sentences.
  4. Use cache mechanism to give result about recently used query.
  5. At the end, the deliverable will be to implement user interface for a sample chatbot implemented.
  6. We will also extend it to create plugin for companies requiring chatbot. They can put their domain in config file and data separately to give personalized result.
  7. Multi Language Support

Sample output

Chat-Sample

References

voice-enabled-chatbot's People

Contributors

satyammittal avatar kc2016 avatar shreyagupta30 avatar tush05tgsingh avatar tacigomess avatar paucaro avatar rn0311 avatar phpduke avatar harshini2898 avatar arxcruz avatar mahakbansal avatar mishrasubha avatar scalability4all-admin avatar vishi13 avatar poojithamiryala 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.