This project analyses the sentiment that a Corporation has in Twitter.
This Company wants to develop its social media monitoring by measuring the impact of their brand and commercial actions.
In order to make this analysis, the following tasks are performed:
Tweets nentioning the Corporation are collected from the twitter.
To perform this, the twitter Twitter-built v2 tools and libraries is used.
The following information is collected:
- Message id
- Body of the message text
- Date of the Tweet
- Author's id
- Author's name
- Author's username
- Public tweet metrics (retweet, reply, like, count)
A MySQL database and its related tables are created to store the information collected.
An exploratoty data analysis is performed to answer the following business questions:
- What are the tweets with the greatest social impact?
- Which are the users who mention the Corporation the most?
- What are the months with the highest number of tweets concentrated?
- What are the most frequent words?
- What is the mathematical correlation observed for the public metrics?
This is an example of the most frequent words in the tweets.
A pre-trained model previously developed is deployed to determine the sentiment of the 3 tweets with the most repercussion. This allows to answer the following questions:
- What are the sentiment predictions for such tweets?
- What are the variables most influencing the model's predictions?
- How could the model be improved?
- What other opportunities are foreseen with other ML models to measure the impact of Company's brand and commercial actions?
Sentiment polarity determines if the text expresses the positive, negative or neutral sentiment of the user about the entity in consideration. This is a visualization of the tweets' sentiment polarity. Most of the polarity is positive.
The model has been deployed on the pythonanywhere service provider with endpoints, for example, to return the sentiment prediction when a body of text is provided.
MySQL database was deployed in the Cloud with Amazon Web Services.