This project implements a comprehensive sentiment analysis system for Snapfood restaurant reviews using various machine learning approaches, from traditional algorithms to advanced deep learning models. The system is designed to accurately classify customer sentiments from Persian text reviews.
git clone https://github.com/AminRezaeeyan/SnappFood-Sentiment-Analysis.git
cd SnappFood-Sentiment-Analysis
- Make sure you have Docker and Docker Compose installed on your system
- Build and run the container:
docker-compose up --build
The application will be available at http://localhost:8501
- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
- Install the required packages:
pip install -r requirements.txt
- Run the application:
streamlit run app/app.py
The project initially explored several traditional machine learning algorithms:
- Logistic Regression: Used as a baseline model for binary classification
- Random Forest: Implemented with optimized hyperparameters for better feature importance analysis
- XGBoost: Utilized for its superior performance in handling imbalanced datasets
The project implemented various neural network architectures:
- RNN (Recurrent Neural Network): Basic implementation for sequence modeling
- LSTM (Long Short-Term Memory): Used to capture long-term dependencies in review texts
- GRU (Gated Recurrent Unit): Implemented as a more efficient alternative to LSTM
The final and most successful implementation uses:
- ParsBERT: A pre-trained Persian BERT model
- Fine-tuned on the Snapfood review dataset
- Achieved state-of-the-art results in sentiment classification
- Optimized for Persian language understanding
The fine-tuned ParsBERT model achieved the best performance in sentiment classification, demonstrating superior accuracy in understanding Persian language nuances and context in restaurant reviews.