This project demostrates how to approach building a program that can help in analyzing emotions or sometimes known as sentiment associated with textual data.
To get started with this script, you have to clone or download the repository just as shown below;
git clone https://github.com/Kalebu/Emotion-text-analyzer-
cd Emotion-text-analyzer-
Emotion-text-analyzer-->
In this project, I used textblob as natural language processing library(NLP),therefor you to make sure it installed before running.
pip install textblob
With textblob you can detect the sentiment analysis of a text in just one line, just as shown below;
>>> from textblob import TextBlob
>>> TextBlob('cool just like this').sentiment.polarity
0.35
The app.py demostrates how you can use that simplicity in real life by analyzing customer reviews or feebacks.
Feebacks Examples are included directly in the source code but in mostly cases you may be reading data from somewhere in your file system or even from cloud, this is just to show you hows it done.
feedbacks = ['I love the app is amazing ',
"The experience was bad as hell",
"This app is really helpful",
"Damn the app tastes like shit ",
'Please don\'t download the app you will regret it ']
Now your script and you will realize textblob has correctly grouped and counted negative reviews vs positive reviews
Positive_feebacks Count : 2
['I love the app is amazing ', 'This app is really helpful']
Negative_feedback Count : 3
['The experience was bad as hell', 'Damn the app tastes like shit ', "Please don't download the app you will regret it "]
Did you face any issue while trying to run the project, raise one and I'm looking forward fixing it as soon as I can.
Have something to add to the source code to make it more legit;
- fork it
- add your changes
- update documentation
- submit a pull request
All the credits to Kalebu