An NLP-powered sentiment classifier that preprocesses text, extracts TF-IDF features, and uses Logistic Regression to predict Positive, Negative, or Neutral sentiment.
This project demonstrates the complete Natural Language Processing (NLP) pipeline, including:
- Data preprocessing
- Text cleaning
- TF-IDF feature extraction
- Machine Learning model training
- Sentiment prediction
- Model evaluation
The model uses Logistic Regression for sentiment classification and is trained on a labeled dataset.
- ✔ Text preprocessing
- ✔ Stopword removal
- ✔ TF-IDF vectorization
- ✔ Logistic Regression classifier
- ✔ Predicts Positive, Negative, and Neutral sentiments
- ✔ Model accuracy evaluation
- ✔ Confusion Matrix visualization
- ✔ User input sentiment prediction
- Python
- Pandas
- NumPy
- Scikit-learn
- NLTK
- Matplotlib
- Jupyter Notebook
Clone the repository:
git clone https://github.com/YourUsername/Sentiment-Analysis-Project.gitNavigate to the project folder:
cd Sentiment-Analysis-ProjectInstall the required libraries:
pip install -r requirements.txtLaunch Jupyter Notebook:
jupyter notebookOpen:
Sentiment_Analysis.ipynb
Run all the cells.
- Load the dataset
- Clean and preprocess text
- Remove stopwords
- Convert text into TF-IDF features
- Split data into training and testing sets
- Train Logistic Regression model
- Evaluate model performance
- Predict sentiment for new user input
The model successfully classifies text into:
- 😊 Positive
- 😐 Neutral
- 😞 Negative
Performance is evaluated using:
- Accuracy Score
- Classification Report
- Confusion Matrix
Through this project, I learned:
- Fundamentals of Natural Language Processing
- Text preprocessing techniques
- TF-IDF feature extraction
- Machine Learning model training
- Model evaluation using Scikit-learn
- GitHub project organization and documentation
- Deploy as a web application using Streamlit
- Train on larger datasets
- Experiment with Deep Learning models (LSTM/BERT)
- Improve prediction accuracy
- Add real-time sentiment analysis
This project is licensed under the MIT License.
Abhin R


