/tweets-sentiment-analysis--Morocco

Perform sentiment analysis on Twitter data with ease! This Python project utilizes Selenium and NLTK to collect tweets, analyze their sentiment using VADER, and store the results in MongoDB. Gain insights into public opinion on any topic by analyzing the sentiment of tweets in real-time.

Primary LanguageJupyter Notebook

tweets-sentiment-analysis-Morocco

This project aims to perform sentiment analysis on Twitter data related to Morocco using Selenium, NLTK (Natural Language Toolkit), and MongoDB. It collects tweets from Twitter, analyzes their sentiment using the VADER sentiment analysis tool, and stores the results in a MongoDB database.

Table of Contents

Features

  • Collect tweets related to a specific topic from Twitter using Selenium.
  • Perform sentiment analysis on the collected tweets using NLTK's VADER sentiment analyzer.
  • Store tweet data and sentiment analysis results in a MongoDB database.
  • Analyze word frequency of positive and negative words in the tweets.

Prerequisites

Before running the project, make sure you have the following installed:

  • Python 3.x
  • MongoDB
  • Microsoft Edge WebDriver (for Selenium)

Installation

  1. Clone the repository:

    git clone https://github.com/abenelfqih/tweets-sentiment-analysis--Morocco.git
  2. Install the required Python packages:

    pip install -r requirements.txt
  3. Install Microsoft Edge WebDriver from here.

Usage

  1. Update the MongoDB connection string in the code with your MongoDB server details.
  2. Run the script

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request for any improvements or new features you'd like to add.