/DAGCN-ABSA

Dual-channel and Aspect-aware Graph Convolutional Network for Aspect-based Sentiment Analysis

Primary LanguagePython

DAGCN: Dual-channel and Aspect-aware Graph Convolutional Network for Aspect-based Sentiment Analysis in Computational Social Systems

This repository contains the code for the paper "DAGCN: Dual-channel and Aspect-aware Graph Convolutional Network for Aspect-based Sentiment Analysis in Computational Social Systems", IEEE Transactions on Computational Social Systems.

Requirements

  • numpy==1.23.5
  • pandas==2.0.3
  • torch==2.1.2+cuda
  • transformers==4.42.3

To install requirements, run pip install -r requirements.txt.

Preparation

  1. Prepare data

    • Restaurants, Laptop, Twitter and MAMS datasets. (We provide the parsed data at directory dataset)

    • Downloading Glove embeddings (glove.840B.300d.zip), and put it into glove directory after unzipping the file.

    • Downloading pretrained BERT (bert-base-uncased) and put it into bert-base-uncased folder.

  2. Build vocabulary

    bash build_vocab.sh
    

Training

Go to Corresponding directory and run scripts:

sh run.sh

The saved model and training logs will be stored at directory results automatically.

Results

GloVe-based Model

Database Acc F1 Log
Res14 84.90 78.34 log
Laptop 79.59 76.60 log
Twitter 76.96 75.92 log
MAMS 81.96 81.09 log

BERT-based Model

Database Acc F1 Log
Res14 87.67 81.56 log
Laptop 81.49 78.45 log
Twitter 78.14 77.61 log
MAMS 85.03 84.63 log

References

If you find this work useful, please cite as following.

@ARTICLE{10588956,
  author={Wanneng Shu and Cao Zhai and Ke Yu},
  journal={IEEE Transactions on Computational Social Systems}, 
  title={DAGCN: Dual-Channel and Aspect-Aware Graph Convolutional Network for Aspect-Based Sentiment Analysis in Computational Social Systems}, 
  year={2024},
  doi={10.1109/TCSS.2024.3418472}}

Credits

The code and datasets in this repository are based on DualGCN_ABSA and R-GAT, and we thank them.