Skip to content

πŸ”₯ Sentiment Classifier App: Instantly predict whether a review is positive or negative using machine learning! πŸ§ πŸ’¬ Built with Logistic Regression, trained on 84K+ reviews, with 91.22% accuracy! πŸš€

Notifications You must be signed in to change notification settings

Armanx200/Amazon-Reviews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ‰ Sentiment Classifier App πŸ’¬

Welcome to the Sentiment Classifier App! This app takes in a review and predicts whether it's positive or negative using machine learning. πŸš€

πŸ“‚ Dataset

We used a dataset of 84,166 reviews to train our model. The reviews are classified as positive or negative based on their content and score.


πŸ” Features

  • 🧠 Trained on Logistic Regression – Achieving 91.22% accuracy!
  • πŸ‹οΈ TF-IDF Vectorizer – Converts text to numerical features.
  • ⚑ Real-time Sentiment Prediction – Input your review and get instant feedback.

πŸ› οΈ How It Works

1. Train the Model

python train_model.py
  • Loads the dataset, preprocesses reviews, trains the classifier, and saves the model.

2. Use the Model

python app.py
  • Launch the interactive app where you can input reviews and receive predictions.

πŸš€ Getting Started

🧩 Prerequisites

  • Python 3.x
  • Pandas, Scikit-Learn, Joblib

πŸ”§ Installation

  1. Clone the repo:
    git clone https://github.com/your-username/sentiment-classifier.git
  2. Install dependencies:
    pip install -r requirements.txt
  3. Train the model:
    python train_model.py
  4. Start the app:
    python app.py

βš™οΈ File Structure

.
β”œβ”€β”€ train_model.py      # Model training script
β”œβ”€β”€ predict_model.py    # Prediction module
β”œβ”€β”€ app.py              # User interface script
β”œβ”€β”€ reviews.csv         # Dataset file (84,166 reviews)
β”œβ”€β”€ sentiment_model.pkl # Trained model
β”œβ”€β”€ vectorizer.pkl      # TF-IDF vectorizer
└── README.md           # This file 😎

πŸ€” How to Use

  1. Run the app with:
    python app.py
  2. Enter a review, and the app will predict whether it's positive or negative!
Enter a review: "I love this app, it’s amazing!"
The review is: positive πŸ‘

🧠 Model Performance

Achieved 91.22% accuracy on the dataset with Logistic Regression!


🌟 Contributing

Feel free to fork this repo and contribute! We welcome improvements and new features.


πŸ“§ Contact

For any inquiries, reach out at:


Give this repo a ⭐ if you find it helpful! 😊


Releases

No releases published

Packages

No packages published

Languages