ABSA (Aspect-Based Sentiment Analysis)
Overview
ABSA (Aspect-Based Sentiment Analysis) extracts specific topics/aspects mentioned in employee reviews and their associated sentiment. This enables the "Topics" page in the dashboard to show what employees are talking about (salary, management, work-life balance, etc.) and whether sentiment is positive, neutral, or negative for each topic.
Architecture
graph LR
R[Reviews Table] --> A[ABSA Analyzer]
A --> O[review_aspects Table]
subgraph Extraction Methods
A1[Rule-based]
A2[AI-powered Gemini]
end
A -.-> A1
A -.-> A2
Database Schema
Table: review_aspects
| Column | Type | Description |
|---|---|---|
| id | INTEGER | Primary key |
| review_id | VARCHAR | FK to reviews.review_id |
| aspect | VARCHAR | Topic category (e.g., "salary and benefits") |
| sentiment | VARCHAR | positive, neutral, or negative |
| confidence | FLOAT | 0.0-1.0 confidence score |
| snippet | TEXT | Optional text snippet |
Predefined Aspect Categories
- salary and benefits
- work-life balance
- management
- company culture
- career growth
- job security
- work environment
- colleagues
- training and development
- communication
Automations & API
ABSA runs automatically after scraping via scraping_service.py.
API Endpoints
GET /api/aspects?company=Name: Returns aspect sentiment distribution.
CLI Usage
# Analyze specific company
python backend/absa_analyzer.py --company "Audi" --limit 200
# Use rule-based only (no AI costs)
python backend/absa_analyzer.py --company "Audi" --no-ai