Giter Club home page Giter Club logo

ai-speech-text_chatbot's Introduction

AI Text-Speech & Speech-Text Chatbot

  • Combines speech & text recognition system with an AI algorithm.
  • It is uses Natural Language Processing, NLP.
To commence this project, I'll start by installing the required packages such as;

1. SpeechRecognition - to allow conversion from speech to text
2. gTTs - (Google Text to Spech library) to convey text to speech and also speak it.
3. transformers - language model
4. tensorflow - deep learning/ml library

How to install

  • Make sure that python and virtual environment is installed. In my case, i'm using PyCharm.

  • or

  • Use Google Colab

Now install the requirements

pip install -r requirements.txt

Microsoft DialoGPT

This project also used Microsoft DialoGPT; a SOTA large-scale pretrained 
dialogue response generation model for multiturn conversations.

Source: https://huggingface.co/microsoft/DialoGPT-medium & https://github.com/microsoft/DialoGPT

Note: This model is no longer maintained and you might encounter issues.

Project Summary

Overall, this code defines a ChatBot class with several methods that allow it to convert speech 
to text, convert text to speech, check whether its name is mentioned in the input text, and return 
the current time. When run, the code creates an instance of the ChatBot class and uses its methods to 
interact with the user.

The wake_up method returns True if the chatbot's name appears in the text attribute of the ChatBot instance,
and False otherwise.

The action_time method returns the current time in the format 'HH:MM'.

The last code block at the end runs the chatbot. It creates an instance of the
ChatBot class, named ai, and enters a loop that listens for speech, processes it, and responds with 
text-to-speech. The chatbot can recognise when it is being called by its name, respond with the 
current time when asked, and thank the user when appropriate. It can also exit the loop and shut down
when told to do so. The chatbot uses the transformers library and the DialoGPT model to generate 
responses to other kinds of input.

Thanks to ChatGPT for the helping out with the summary.

Credit

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.