Skip to content

xndien2004/ViGSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

Authors

Dien X. Tran, Kien-Cao Van, Tinh-Nguyen Huu, Hoang-Tuan Dao-Xuan, Hung-Nguyen Viet, Khanh-Duy Cao-Phan


πŸ“Œ Overview

ViGSA (Vietnamese Global Sentiment Auxiliary) is a multi-task model for Vietnamese Aspect-Based Sentiment Analysis (ABSA). The model jointly performs:

  1. Aspect Detection
  2. Aspect-level Sentiment Classification
  3. 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.


✨ Features

  • 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

πŸ“‚ Project Structure

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

βš™οΈ Installation

git clone https://github.com/xndien2004/ViGSA
cd ViGSA
pip install -r requirements.txt

Requirements

  • Python β‰₯ 3.7
  • PyTorch β‰₯ 1.10
  • PyTorch Lightning β‰₯ 1.5
  • Transformers β‰₯ 4.10
  • CUDA-enabled GPU (recommended)

πŸ“Š Dataset

  • UIT-ABSA (Restaurant domain)

  • VLSP-2018 ABSA (Restaurant domain)

  • Supports multi-task data format:

    • Train.txt, Dev.txt, Test.txt

πŸš€ Usage

Train with default parameters

bash train.sh

Train with custom parameters

python3 -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

πŸ— Model Architecture

  1. Encoder β†’ Transformer-based (InfoXLM, PhoBERT, ViT5, RemBERT)
  2. Multi-head Attention β†’ Enhanced feature representation
  3. Aspect Detection β†’ Binary classification per aspect
  4. Aspect Sentiment Classification β†’ 4-class per aspect
  5. Global Sentiment Classification β†’ Overall sentiment prediction
  6. 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

πŸ“ˆ Evaluation

Metrics:

  • Aspect Detection β†’ Precision, Recall, F1
  • Sentiment Classification β†’ Precision, Recall, F1
  • Overall β†’ Combined task metrics

πŸ† Results

  • SOTA performance on UIT-ABSA & VLSP-2018
  • Detailed logs & checkpoints stored in output/ directory

πŸ“š Citation

@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}
}

About

ViGSA: A Multi-Task Aspect-Based Sentiment Analysis Model with Auxiliary Embedding and Global Sentiment Integration for Vietnamese Restaurant Reviews

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors