Architecture Diagram · Formal Visualization
Syntax-Aware K-Tran Transformer
Aspect-Based Sentiment Analysis · Multi-Task Learning Framework
→
🔤
Tokenize
RoBERTa Tokens
→
→
→
→
📊
Output
Aspects + Sentiment
RoBERTa-base
Pre-trained Transformer Encoder · 12 layers · 768-dim
token embeddings → [CLS] t₁ t₂ … tₙ [SEP] · 768-dim vectors
Syntax Processing (spaCy)
food ─nsubj→ was
was ─acomp→ great
service ─nsubj→ slow
1.0
0.8
0.1
0.0
0.8
1.0
0.7
0.1
0.1
0.7
1.0
0.2
0.0
0.1
0.2
1.0
Syntax-Aware Attention Bias Matrix
L_total = α·L_ATE + (1−α)·L_ASC
Adam Optimizer
Cross-Entropy Loss
Mini-Batch SGD
Dropout Reg.
Gradient Clipping
Early Stopping
Loss Balancing α
Syntax Bias λ
Task 1 · Aspect Term Extraction (ATE)
Sequence Labelling Head
BIO tagging for aspect boundary detection
Example: "The food quality was good but service was slow."
Task 2 · Aspect Sentiment Classification (ASC)
Classification Head
Polarity prediction per extracted aspect
food quality → Positive · service → Negative
Figure 1. Full architecture of the Syntax-Aware K-Tran Transformer for ABSA.
The model integrates a RoBERTa-base encoder with spaCy-derived dependency attention bias,
trained jointly on Aspect Term Extraction and Aspect Sentiment Classification via weighted cross-entropy loss.