Goal: Create a simple AI tool that categorizes customer feedback (e.g., from reviews, social media comments, or emails) into positive, negative, or neutral sentimen
A simple sentiment analysis tool that classifies customer feedback into Positive, Negative, or Neutral categories. This project uses Python and the TextBlob
library, making it easy to get started with natural language processing (NLP).
- Analyzes customer feedback to determine sentiment (Positive, Negative, Neutral).
- Uses a basic dataset for demonstration purposes (can be replaced with real customer reviews or comments).
- Outputs results in a structured table and saves them to a CSV file.
- Python 3.7 or higher installed on your system.
- Libraries:
TextBlob
,pandas
.
- Clone or download this repository:
git clone https://github.com/jrichardson-sol/Sentiment-Analysis-for-Customer-Feedback cd sentiment-analyzer
Install the required Python libraries:
bash Copy code pip install textblob pandas (Optional) Download and install the TextBlob corpora if needed:
bash Copy code python -m textblob.download_corpora Usage Open the sentiment_analysis.py file. Replace the sample dataset in the data dictionary with your customer feedback. Run the script: bash Copy code python sentiment_analysis.py View the sentiment analysis results in the terminal or check the saved sentiment_analysis_results.csv file. Example Output Input:
plaintext Copy code Customer Feedback:
- "I love this product! It's amazing and works perfectly."
- "Terrible experience, it broke after a week of use."
- "The service was okay, not great but not bad either." Output:
plaintext Copy code
Customer Feedback | Sentiment |
---|---|
I love this product! It's amazing and works perfectly. | Positive |
Terrible experience, it broke after a week of use. | Negative |
The service was okay, not great but not bad either. | Neutral |
Customization | |
Replace the Dataset | |
Replace the sample data with your actual dataset (e.g., customer reviews, comments from social media, etc.). You can load a CSV file or integrate APIs for live data. |
Enhance with Visualization Add visualizations using libraries like matplotlib or seaborn to create pie charts, bar graphs, or other data visualizations.
Build a Web Interface Use Streamlit or Flask to create a user-friendly interface where users can upload feedback files or type their own feedback for analysis.
Dependencies TextBlob pandas License This project is licensed under the MIT License. Feel free to use and modify it as needed.