Twitter Sentiment Analysis is the process of using Python to understand the emotions or opinions expressed in tweets automatically. By analyzing the text, we can classify tweets as positive (1) or negative (0). This helps businesses and researchers track public mood, brand reputation, or reactions to events in real time.
This project includes a trained machine learning model, a user-friendly desktop GUI, and utilizes natural language processing techniques to make sentiment predictions from tweet text input.
-
Build a logistic regression model to classify sentiments in tweets.
-
Create a graphical interface using Tkinter for user interaction.
-
Predict the sentiment of custom tweet inputs (0 = Negative, 1 = Positive).
-
Accuracy of trained model: 80%
-
🔍 Predict sentiment of custom tweets in real-time.
-
🧠 Trained model with 88% accuracy.
-
📊 Clean and interactive desktop GUI.
-
🎯 Easy to use for non-technical users.
-
📦 Fully open-source and customizable.
The dataset used is the Sentiment140 dataset, which contains:
-
1.6 million tweets
-
Pre-labeled as 0 = Negative and 1 = Positive
-
Dataset includes tweet text and metadata
📂 Dataset link: Sentiment140 on Kaggle
-
Model Used: SVM Classifier
-
Vectorizer: TF-IDF
-
Accuracy Achieved: 80%
-
Sample Predictions:
Tool/Library | Purpose |
---|---|
Python | Core programming language |
Scikit-learn | Model training (SVM Classifier) |
NLTK | Tokenization, preprocessing |
TextBlob | Sentiment feature extraction |
Tkinter | GUI development |
Pandas | Data manipulation |
Matplotlib | Visualization |
Joblib | Model saving/loading |
PIL (Pillow) | Displaying GUI images |
- Positive:

Muqadas Ejaz
BS Computer Science (AI Specialization)
Machine Learning & Computer Vision Enthusiast
📫 Connect with me on LinkedIn
🌐 GitHub: github.com/muqadasejaz
This project is licensed under the MIT License.