Перейти до основного вмісту

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

ColumnTypeDescription
idINTEGERPrimary key
review_idVARCHARFK to reviews.review_id
aspectVARCHARTopic category (e.g., "salary and benefits")
sentimentVARCHARpositive, neutral, or negative
confidenceFLOAT0.0-1.0 confidence score
snippetTEXTOptional text snippet

Predefined Aspect Categories

  1. salary and benefits
  2. work-life balance
  3. management
  4. company culture
  5. career growth
  6. job security
  7. work environment
  8. colleagues
  9. training and development
  10. 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