This project is a Sentiment Analysis system built using Python. It processes and analyzes customer reviews to determine their sentiment (Positive/Negative) while providing visual insights and machine learning predictions.
-
Data Preprocessing
- Clean text data using NLP techniques like lemmatization and stopword removal.
- Generate sentiment labels based on review scores.
-
Data Visualization
- Sentiment distribution analysis.
- Generate word clouds of frequent terms.
- Sentiment trends over time (if the dataset includes a
Date
column).
-
Machine Learning Model
- Train a Logistic Regression model to classify sentiment.
- Evaluate with confusion matrices, classification reports, and cross-validation scores.
Sentiment-Analysis-Project
├── assets/ # Folder for images used in README
│ ├── prprocessing.png
│ ├── visualization.png
│ ├── result.png
├── data/
│ ├── Reviews.csv # Input dataset
│ ├── preprocessed_reviews.csv # Preprocessed dataset
├── src/
│ ├── preprocessing.py # Script for data preprocessing
│ ├── visualization.py # Script for data visualization
│ ├── model.py # Script for machine learning model
├── README.md # Project documentation
Install all necessary dependencies using:
pip install -r requirements.txt
- pandas
- nltk
- matplotlib
- seaborn
- wordcloud
- scikit-learn
1️⃣ Data Preprocessing Clean and preprocess the dataset using:
python src/preprocessing.py
2️⃣ Data Visualization Generate visual insights using:
python src/visualization.py
3️⃣ Model Training Train and evaluate the sentiment classification model using:
python src/model.py
📈 Results Sentiment Over Time Trends over time based on the Date column:
Ensure the dataset (Reviews.csv) is in the data/ directory.
Minimum required columns:
- Text - Customer reviews.
- Score - Ratings for the reviews.
I welcome contributions! To contribute:
-
Fork the repository.
-
Create a new branch:
git checkout -b feature-branch
-
Commit your changes:
git commit -m "Add a new feature"
-
Push to your branch:
git push origin feature-branch
-
Submit a Pull Request.
📜 License This project is licensed under the MIT License. See the LICENSE file for details.
👤 Author : Deepti Gupta