This project provides a simple web interface using Streamlit that takes customer reviews as input, analyzes their sentiment, and generates an appropriate response. This tool can be useful for businesses looking to automate responses to customer feedback based on sentiment (positive, negative, or neutral).
The application:
- Takes a customer review as input.
- Analyzes the sentiment of the review using a sentiment analysis model.
- Returns a sentiment-based response, tailoring responses to positive, negative, and neutral feedback.
The project leverages the following approach:
-
Sentiment Analysis:
- We use Hugging Face's
transformers
library to load a pre-trained sentiment analysis pipeline. - Each review is passed through this pipeline, which returns a sentiment label (positive, negative, or neutral) and a confidence score for the prediction.
- We use Hugging Face's
-
Response Generation:
- Based on the detected sentiment, the app generates a tailored response:
- Positive Sentiment: Returns a message of appreciation.
- Negative Sentiment: Returns an apologetic response and an offer to improve.
- Neutral Sentiment: Returns a thank-you message for the feedback.
- Based on the detected sentiment, the app generates a tailored response:
-
Frontend:
- Built using Streamlit, allowing users to interact with the model by entering reviews and receiving real-time feedback responses.
- app.py: Main application file containing code to load the sentiment model, analyze input reviews, generate responses, and display them on the Streamlit interface.
- Clone the Repository:
git clone <repository-url> cd customer-review-sentiment-analyzer
- Install Required Libraries & Access the App:
Ensure that Python is installed on your machine. Then, install the required libraries using pip:
pip install -r requirenments.txt
streamlit run app.py