ViGSA: Multi-Task Aspect-Based Sentiment Analysis with Auxiliary Embeddings & Global Sentiment Integration for Vietnamese Restaurant Reviews
π If you find this project interesting and useful, please give it a star β to support us!
Dien X. Tran, Kien-Cao Van, Tinh-Nguyen Huu, Hoang-Tuan Dao-Xuan, Hung-Nguyen Viet, Khanh-Duy Cao-Phan
ViGSA (Vietnamese Global Sentiment Auxiliary) is a multi-task model for Vietnamese Aspect-Based Sentiment Analysis (ABSA). The model jointly performs:
- Aspect Detection
- Aspect-level Sentiment Classification
- Global Sentiment Prediction
Key innovations:
- Auxiliary Aspect Embeddings from natural language descriptions
- Global Sentiment Supervision to improve aspect-level understanding
- Multi-loss Training (Cross-Entropy + Asymmetric + Contrastive Loss)
Results: Achieves state-of-the-art performance on UIT-ABSA and VLSP-2018 datasets, proving the effectiveness of integrating semantic priors with multitask learning in low-resource Vietnamese ABSA.
- Multi-task Learning β Aspect detection + Sentiment classification + Global sentiment
- Auxiliary Semantic Embeddings β Improves aspect representation
- Multi-domain Support β Trained and evaluated on Restaurant domain (UIT-ABSA, VLSP-2018)
- Transformer-based Encoder β Supports InfoXLM, PhoBERT, ViT5, RemBERT
- Contrastive Learning β Better representation via supervised contrastive loss
- Attention Mechanisms β Multi-head attention for feature extraction
ViGSA/
βββ main.py # Entry point for training/evaluation
βββ requirements.txt # Python dependencies
βββ train.sh # Training script
βββ dataset/ # Dataset processing modules
βββ evaluation/ # Evaluation metrics/utilities
βββ model/ # Model architecture & losses
β βββ train.py # Model training logic
β βββ loss.py # Custom loss functions
βββ processing/ # Data preprocessing utilities
git clone https://github.com/xndien2004/ViGSA
cd ViGSA
pip install -r requirements.txtRequirements
- Python β₯ 3.7
- PyTorch β₯ 1.10
- PyTorch Lightning β₯ 1.5
- Transformers β₯ 4.10
- CUDA-enabled GPU (recommended)
-
UIT-ABSA (Restaurant domain)
-
VLSP-2018 ABSA (Restaurant domain)
-
Supports multi-task data format:
Train.txt,Dev.txt,Test.txt
bash train.shpython3 -m absa_project.main \
--train_file "path/to/train.txt" \
--val_file "path/to/dev.txt" \
--test_file "path/to/test.txt" \
--model_name "microsoft/infoxlm-large" \
--topk_layer 4 \
--batch_size 40 \
--epochs 50 \
--learning_rate 2e-5 \
--output_dir "output/experiment_name" \
--save_top_k 1 \
--patience 10 \
--max_length 256- Encoder β Transformer-based (InfoXLM, PhoBERT, ViT5, RemBERT)
- Multi-head Attention β Enhanced feature representation
- Aspect Detection β Binary classification per aspect
- Aspect Sentiment Classification β 4-class per aspect
- Global Sentiment Classification β Overall sentiment prediction
- Pairwise Cosine Contrastive Learning β Improves inter-class separation
Loss Functions:
- Aspect Detection β Asymmetric Loss
- Aspect Sentiment β Asymmetric Loss
- Global Sentiment β Weight Cross-Entropy Loss
- Representation Learning β Contrastive Loss
Metrics:
- Aspect Detection β Precision, Recall, F1
- Sentiment Classification β Precision, Recall, F1
- Overall β Combined task metrics
- SOTA performance on UIT-ABSA & VLSP-2018
- Detailed logs & checkpoints stored in
output/directory
@misc{dien2025vigsa,
title={ViGSA: A Multi-Task Aspect-Based Sentiment Analysis Model with Auxiliary Embedding and Global Sentiment Integration for Vietnamese Restaurant Reviews},
author={Tran, Dien X. and Van, Kien-Cao and Huu, Tinh-Nguyen and Dao-Xuan, Hoang-Tuan and Viet, Hung-Nguyen and Cao-Phan, Khanh-Duy},
journal={Expert Systems with Applications (under review)},
year={2025}
}