Welcome to the Sentiment Classifier App! This app takes in a review and predicts whether it's positive or negative using machine learning. π
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.
- π§ 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.
python train_model.py
- Loads the dataset, preprocesses reviews, trains the classifier, and saves the model.
python app.py
- Launch the interactive app where you can input reviews and receive predictions.
- Python 3.x
- Pandas, Scikit-Learn, Joblib
- Clone the repo:
git clone https://github.com/your-username/sentiment-classifier.git
- Install dependencies:
pip install -r requirements.txt
- Train the model:
python train_model.py
- Start the app:
python app.py
.
βββ 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 π
- Run the app with:
python app.py
- 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 π
Achieved 91.22% accuracy on the dataset with Logistic Regression!
Feel free to fork this repo and contribute! We welcome improvements and new features.
For any inquiries, reach out at:
- GitHub: Arman Kianian
- Email: Kianianarman1@gmail.com
Give this repo a β if you find it helpful! π