This project dives into a sentiment analysis of pre-collected Twitter data regarding Narendra Modi and Rahul Gandhi, leading figures in the Indian elections. Leveraging Python, alongside prominent Natural Language Processing (NLP) and visualization libraries, this endeavor sifts through tweets to categorize sentiments into positive, negative, or neutral. This README outlines the project including its setup, execution instructions, and the insights it aims to provide.
- Process and analyze pre-collected Twitter data concerning Narendra Modi and Rahul Gandhi.
- Categorize tweet sentiments as positive, negative, or neutral.
- Compare sentiment distribution between the two political figures.
- Visualize the analysis results for intuitive comparative insights.
This project makes extensive use of the following technologies:
- Python 3.x: The core programming language used.
- NLP Library: TextBlob for easy text processing and sentiment analysis.
- Data Handling: Pandas for data manipulation and analysis.
- Numerical Operations: NumPy for numerical calculations.
- Visualization: Plotly (both
graph_objects
andexpress
modules) for creating interactive and static visualizations.
Ensure you have Python 3.x installed on your system. Follow these steps to set up the project environment:
- Clone the repository:
git clone https://github.com/jafararalikhan/
cd NLP-Project-Sentiment-Analysis-of--indian-Elections
- Install the necessary Python libraries:
pip install numpy pandas textblob plotly
The dataset comprises pre-collected Twitter data related to Narendra Modi and Rahul Gandhi, stored in a format suitable for analysis (e.g., CSV). (You might want to add more details about the dataset, such as how many tweets it contains or any preprocessing steps you took.)
To execute the sentiment analysis, navigate to the project directory and run:
python sentiment_analysis.py
Note: Replace sentiment_analysis.py
with the actual name of your Python script.
Discuss the project's findings here, possibly including the overall sentiment towards each politician, notable data trends, and what these trends could suggest about public opinion at the time of the elections.
The project utilizes Plotly for dynamic and engaging visualizations. Comparative sentiment analysis results are presented through bar charts, showcasing the distribution of sentiments (positive, negative, neutral) towards Narendra Modi and Rahul Gandhi.
Contributions to this project are welcome. If you'd like to contribute, please fork the repository, make your changes, and submit a pull request.