Skip to content

jparedesDS/tensorflow-twitter-sentiment-analysis

Repository files navigation

Twitter Sentiment Analysis

Analyze and interpret user sentiments from tweets, identifying positive and negative emotions while exploring various natural language characteristics.


Table of Contents


Overview

In recent decades, the way users interact and exchange opinions has significantly evolved due to the rise of social networks. Platforms like Twitter amplify discussions, with topics trending or going viral based on the volume of user interactions.

This project conducts a comprehensive study of user opinions on Twitter, identifying positive and negative sentiments through their tweets. It also delves into various natural language characteristics, providing deeper insights into text data.


Features

  • Sentiment Analysis: Classify tweets as positive, negative, or neutral based on their sentiment.
  • Natural Language Exploration: Study linguistic characteristics like word frequency, hashtags, and mentions.
  • Trend Analysis: Identify topics or hashtags driving virality.
  • Visualization: Generate plots to understand sentiment distribution and trends over time.

Methodology

  1. Data Collection:

    • Tweets are collected using the Twitter API based on specific keywords, hashtags, or time frames.
  2. Preprocessing:

    • Remove noise (e.g., URLs, emojis, stopwords).
    • Tokenize and lemmatize text for analysis.
  3. Sentiment Analysis:

    • Leverage pre-trained NLP models or libraries (e.g., TextBlob, VADER, or transformers) to classify sentiments.
  4. Data Visualization:

    • Use libraries like matplotlib or seaborn to create graphs showing sentiment trends, word clouds, and other insights.

Requirements

  • Python 3.x
  • Required Libraries:
    • tweepy (Twitter API integration)
    • pandas (Data manipulation)
    • numpy (Numerical computations)
    • matplotlib and seaborn (Visualization)
    • TextBlob or VADER (Sentiment analysis)

Install dependencies:

pip install tweepy pandas numpy matplotlib seaborn textblob  

Results

Sentiment distribution across the dataset. Identification of trends and key hashtags driving discussions. Word clouds showing common words in positive and negative tweets.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to:

  1. Report bugs or suggest features via issues.
  2. Submit pull requests to improve the codebase.
  3. Acknowledgments
  4. This project leverages Twitter API for data collection and NLP libraries for sentiment analysis.

Releases

No releases published

Packages

No packages published