A web-based application for analyzing the sentiment of product reviews using advanced NLP models.
This project provides a comprehensive solution for sentiment analysis, combining a FastAPI backend with a React frontend. The application allows users to upload CSV files containing product reviews, analyze the sentiment using a pre-trained DistilBERT model, and visualize the results through an interactive dashboard. The application consists of two main components:
- Backend API: Built using FastAPI, providing endpoints for sentiment analysis of text data.
- Frontend Dashboard: A user-friendly interface (built with React or similar framework) that visualizes the sentiment analysis results.
-
Sentiment Analysis API:
- Analyze text data from CSV files.
- Supports batch processing of reviews.
- Provides detailed sentiment results including confidence scores.
- Returns summary statistics and visualizable data.
-
Dashboard Features:
- File upload functionality for CSV files.
- Visual representations of sentiment data through charts.
- Tabular view of processed reviews with sentiment labels.
- Summary statistics dashboard.
-
Clone the repository:
git clone https://github.com/Abhay-Kanwasi/Sentiment-Dashboard.git cd Sentiment Dashboard/backend -
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On macOS/Linux # OR .\venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Navigate to the frontend directory:
cd Sentiment Dashboard/frontend -
Install dependencies:
npm install
-
Start the FastAPI server:
uvicorn app.main:app --reload
The API will be available at
http://localhost:8000.
-
Start the frontend development server:
npm run dev
The dashboard will be available at
http://localhost:3000.
- Method: POST
- Description: Analyzes the sentiment of product reviews provided in a CSV file.
- Request Body:
file: CSV file containing a 'review' column with text data.
- Response:
{ "summary": { "positive_count": int, "negative_count": int, "positive_avg_confidence": float, "negative_avg_confidence": float, "total_reviews": int }, "reviews": [ { "review": str, "sentiment": str, "confidence": float } ] }
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes with clear commit messages.
- Push to the branch.
- Open a Pull Request against the
mainbranch.
- Add more detailed error handling and validation.
- Implement user authentication for access control.
- Add support for different types of input files and data sources.
- Enhance the dashboard with additional visualizations and interactive features.