Welcome to the Sentiment Analysis Voice Assistant project! This assistant uses speech recognition to take a spoken sentence as input and then performs sentiment analysis using both TextBlob and VaderSentiment. The analysis results are provided as verbal and printed feedback.
- Speech Recognition: Uses Google's speech recognition to capture and understand spoken sentences.
- Sentiment Analysis: Performs sentiment analysis using both TextBlob and VaderSentiment, then averages the results for a final sentiment score.
- Voice Feedback: Provides the sentiment result through voice feedback using pyttsx3.
To use this project, you need to install the following libraries:
pip install vaderSentiment textblob numpy speechrecognition pyttsx3Additionally, you need to install the necessary dependencies for pyttsx3 which vary depending on your operating system.
- Run the script: Start the script to initiate the voice assistant.
- Provide Input: The assistant will prompt you to provide a sentence for sentiment analysis.
- Receive Output: The assistant will perform sentiment analysis on the input sentence and provide the result both verbally and in the console.
- Speak a sentence like: "I love programming!" or "I am feeling sad today."
- Initialization: The script initializes the text-to-speech engine and sets up the voice properties.
- Listening: The
takeCommandfunction listens for a sentence using the microphone. - Sentiment Analysis: The
sentimentAnalysisfunction calculates the sentiment score using TextBlob and VaderSentiment, then averages the two scores. - Feedback: The sentiment result is spoken out loud and printed in the console.
