Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment-Analysis-Project

An NLP-powered sentiment classifier that preprocesses text, extracts TF-IDF features, and uses Logistic Regression to predict Positive, Negative, or Neutral sentiment.

Project Overview

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.


Features

  • ✔ 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

Technologies Used

  • Python
  • Pandas
  • NumPy
  • Scikit-learn
  • NLTK
  • Matplotlib
  • Jupyter Notebook

Installation

Clone the repository:

git clone https://github.com/YourUsername/Sentiment-Analysis-Project.git

Navigate to the project folder:

cd Sentiment-Analysis-Project

Install the required libraries:

pip install -r requirements.txt

Launch Jupyter Notebook:

jupyter notebook

Open:

Sentiment_Analysis.ipynb

Run all the cells.


Model Workflow

  1. Load the dataset
  2. Clean and preprocess text
  3. Remove stopwords
  4. Convert text into TF-IDF features
  5. Split data into training and testing sets
  6. Train Logistic Regression model
  7. Evaluate model performance
  8. Predict sentiment for new user input

Results

The model successfully classifies text into:

  • 😊 Positive
  • 😐 Neutral
  • 😞 Negative

Performance is evaluated using:

  • Accuracy Score
  • Classification Report
  • Confusion Matrix

Demonstration

working demonstration

Screenshots

Dataset Preview

Dataset Preview

Confusion Matrix

Confusion Matrix

Prediction Output

Prediction Output


Learning Outcomes

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

Future Improvements

  • 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

License

This project is licensed under the MIT License.


Author

Abhin R

About

An NLP-powered sentiment classifier that preprocesses text, extracts TF-IDF features, and uses Logistic Regression to predict Positive, Negative, or Neutral sentiment.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages