This project is an Artificial Intelligence Lab final project that performs Sentiment Analysis and Personality Insight extraction from textual data. The system fetches real-time tweets using the Twitter API, analyzes their sentiment using Natural Language Processing (NLP) and Machine Learning, and generates sentiment-based ratings from the extracted data.
- Fetch live tweets at runtime using Twitter API
- Analyze tweet text for sentiment classification
- Generate sentiment-based ratings from analyzed tweets
- Demonstrate practical implementation of NLP and ML techniques
- Tweets are fetched at runtime using the Twitter API
- User provides a keyword or hashtag
- Recent tweets related to the query are collected dynamically
- These tweets act as real-world input data for analysis
- Source: Live Twitter data fetched at runtime
- Format: Text data extracted from tweets
- Usage: Tweets are preprocessed and passed directly to the trained model
- Programming Language: Python
- Libraries Used:
- pandas
- scikit-learn
- re (Regular Expressions)
- joblib
- tweepy
- ML Model: Random Forest Classifier
- Feature Extraction: CountVectorizer (Bag of Words)
- Authenticate with Twitter API
- Fetch tweets based on a keyword or hashtag
- Clean and preprocess tweet text
- Convert text into numerical features using CountVectorizer
- Apply trained machine learning model
- Classify sentiment (Positive / Negative / Neutral)
- Calculate overall sentiment score
- Generate star-based rating from sentiment results
- Positive tweets increase rating
- Negative tweets decrease rating
- Neutral tweets maintain balance
- Final output is displayed as a sentiment-based rating (e.g., 1–5 stars)
- Trained sentiment model saved using
joblib - Vectorizer saved for reuse
- Sentiment predictions for fetched tweets
- Overall sentiment rating based on live Twitter data
- Open the project notebook in Jupyter Notebook or Google Colab
- Add your Twitter API credentials
- Enter a keyword or hashtag
- Run all cells sequentially
- View sentiment analysis and generated ratings
This project was developed as part of the Artificial Intelligence Lab to demonstrate:
- Real-time data collection using APIs
- NLP-based text preprocessing
- Machine learning–based sentiment analysis
- AI-driven decision and rating systems
- Personality trait detection using Big Five Model
- Deep learning models (LSTM, BERT)
- Web-based dashboard
- Visualization of sentiment trends
This project is licensed under the MIT License.
AI Lab Final Project
BSCS – Semester 6