Feature-Based Sentiment Analysis
Analyzing Competitor Product Reviews with NLP
What is Feature-Based Sentiment Analysis?
Also known as Aspect-Based Sentiment Analysis, this is an advanced NLP technique that goes beyond simple positive/negative ratings. It pinpoints specific **features** or **aspects** of a product that customers are discussing and determines the sentiment for each one individually.
This allows product, marketing, and strategy teams to get granular insights into what customers love, hate, or feel indifferent about.
How Does It Help?
- Define MVP features and build a data-driven product roadmap.
- Build a competitive matrix and understand market positioning.
- Gauge customer response to new feature releases or marketing campaigns.
- Identify new market entry opportunities by analyzing unmet needs.
Project Implementation
This project analyzes 3,150 customer reviews of Amazon Alexa products from a modified Kaggle dataset. The goal is to automatically extract key topics, analyze sentiment for each, and generate a comprehensive Excel report.
The core of the project is the absa.py script, which processes the raw review data and outputs a multi-sheet Excel file (Alexa.xlsx) with detailed insights, topic keywords, and individual review scores.
While this demo uses Alexa reviews, the tool is designed to be versatile and can be adapted for any text-based feedback, such as app store reviews, social media posts, or NPS survey responses.
The final Excel output, showing sentiment breakdown per feature.
How to Run the Analysis
1. Setup Your Project
Place the absa.py, stop_words_list.py, requirements.txt, and your reviews.csv file in a project folder. It's highly recommended to create a Python virtual environment to avoid dependency conflicts.
2. Install Libraries
From your terminal, run the following command to install all necessary libraries like NLTK and Scikit-learn:
pip install -r requirements.txt
3. Configure the Script
Open absa.py and modify the four settings at the top to match your dataset: app_name, aspects_no, reviews_name_col, and language_of_reviews.
4. Run & Get Insights
Execute the script from your terminal:
python absa.py
An Excel file will be generated in your folder. Use pivot tables and filters to explore the sentiment breakdown for each product feature.