Text Sentiment Analysis 


Now, after gathering data from any data source and treating it you may want to do some sentiment analysis of text data, so to understand the opinion of people about your brand. (0) Neuters; (1) Positive; (-1) Negative.

Actually, to do an accurate sentiment analysis we should prepare machine learning models, but this is a hard work and it takes a long time to perform it. That’s why; in python we have some libraries that can do this analysis for us.

In this tutorial, I’ll provide you a script that helps you to analyze the sentiment of your customers or followers very simply.

Imagine that you have extracted retweets of your Twitter account and you saved them in a CSV file. As I shown you it the previous articles;

We install these libraries:
pip install textblob // this library is used for translating text, analyze sentiments …
pip install textblob_fr //this is reserved for French text

In this code I’ll explain how to use the 2 different analyzers: Naïve bayes for English & Arabic text. And PatternAnalyzer() in case of French, in order to have an idea how to deal with the two ones. But of course naïve bayes returns more accurate results.

The details are in the code. So I invite you to consult it: https://github.com/dihiaselma/Tweeter/blob/master/Sentiment%20Analysis.py 



Comments

  1. thank you for this paper

    ReplyDelete
  2. This is a fantastic post. I found this blog to be quite interesting and informative. Continue to share more insightful posts. Also check out Gestion des accès.

    ReplyDelete

Post a Comment

Put your comments here, please.
Share with us you vision...

Popular posts from this blog