This project performs sentiment analysis on Amazon product reviews, classifying reviews into positive, neutral, or negative sentiments using various machine learning models.
.
├── data/ # Dataset
│ └── amazon_reviews.csv # Amazon product reviews dataset
│
├── scripts/ # Python Scripts
│ ├── data_preprocessing.py # Data loading & preprocessing
│ ├── model_training.py # Model training & evaluation
│ └── utils.py # Utility functions (e.g., evaluation metrics)
│
├── models/ # Saved models
│ └── saved_models/ # Serialized trained models (Optional)
│
├── outputs/ # Confusion matrix & evaluation results
│ ├── confusion_matrix_Naive_Bayes.png
│ ├── confusion_matrix_Logistic_Regression.png
│ ├── confusion_matrix_SVM.png
│ └── confusion_matrix_Random_Forest.png
│
├── README.md # Project documentation
└── requirements.txt # Dependencies for the project
Open a terminal or command prompt and run the following commands to clone the repository:
git clone https://github.com/sachi143/sentiment-analysis-amazon-reviews.git
cd sentiment-analysis-amazon-reviewsMake sure you have Python 3.x installed. Install the required dependencies by running:
pip install -r requirements.txtTo execute the entire sentiment analysis pipeline, run:
python scripts/model_training.py- Classification reports for all models will be displayed in the terminal.
- Confusion matrices for each model will be saved in the
outputs/directory:confusion_matrix_Naive_Bayes.pngconfusion_matrix_Logistic_Regression.pngconfusion_matrix_SVM.pngconfusion_matrix_Random_Forest.png
- Naive Bayes Classifier
- Logistic Regression
- Support Vector Machine (SVM)
- Random Forest Classifier
- Hyperparameter Tuning: Optimize model parameters to improve performance.
- Try Advanced Vectorization: Experiment with Word2Vec, GloVe, or BERT embeddings.
- Deploy the Model: Use Flask or FastAPI to deploy the best-performing model as an API.
- Visualization: Add more data visualizations for insights into the dataset and model performance.
List of dependencies:
numpy
pandas
scikit-learn
matplotlib
seaborn
joblib
You can install these dependencies with:
pip install -r requirements.txtThis project is licensed under the MIT License. Feel free to use and modify it as needed.
Contributions are welcome! If you find any bugs or want to add features, feel free to open an issue or submit a pull request.
For any questions or issues, please contact:
Sairam Chennaka
Email: sachi777@outlook.in
GitHub: https://github.com/ram-cs7