This project consists of a Django-based API for sentiment analysis and a Streamlit app that interacts with this API to display sentiment results for product reviews. The Django API provides both overall sentiment and aspect-based sentiment analysis, while the Streamlit app presents these results in a user-friendly format.
-
Clone the repository:
git clone https://github.com/VijayV28/Aspect-Based-Sentiment-Analysis.git
-
Create and activate a virtual environment:
conda create -n <env_name> python=3.10
-
Install dependencies:
pip install -r requirements.txt
-
Apply Django migrations:
python manage.py migrate
-
Run Django server:
python manage.py runserver
-
Run the Streamlit app:
cd apps streamlit run sentiment_analyzer.py
-
/sentiment/analyze/: POST request to analyze product reviews.Request Body:
{ "product_name": "Example Product", "product_review": "This is an example review." }Response:
{ "overall_sentiment": "Neutral", "aspect_based_sentiments": { "display": "Positive", "speakers": "Neutral" } }
- URL: Link in terminal
- Functionality: Allows users to input product reviews and displays sentiment analysis results. Results are shown with different background colors and optionally with icons or emojis.
- Django API: Provides endpoints for overall and aspect-based sentiment analysis using PyABSA and VADER.
- Streamlit App: Provides a user interface to interact with the Django API and displays sentiment analysis results in a visually appealing manner.
- Submit Review for Analysis: Enter the product name and review in the Streamlit app, and click "Analyze Sentiment".
- View Results: Results are displayed with sentiment analysis on overall review and aspect-based sentiment.
This project is licensed under the MIT License - see the LICENSE file for details.