Skip to content

Code for NLPCC 2021 accepted paper titled "An Aspect-Centralized Graph Convolutional Network for Aspect-based Sentiment Classification

Notifications You must be signed in to change notification settings

circle-hit/ACGCN

Repository files navigation

An Aspect-Centralized Graph Convolutional Network for Aspect-based Sentiment Classification

ACGCN - Aspect Centralized Graph Convolutional Network

  • Code for NLPCC 2021 accepted paper titled "An Aspect-Centralized Graph Convolutional Network for Aspect-based Sentiment Classification"
  • Weixiang Zhao, Yanyan Zhao, Xin Lu and Bing Qin.

Requirements

  • Python 3.7
  • PyTorch 1.6.0
  • Supar 1.0.0

Usage

  • Install SpaCy package and language models with
pip install spacy

and

python -m spacy download en
  • Install Biaffine parser with
pip install -U supar
  • Generate Aspect-Centralized Graph with
python generate_acg.py
  • Download pretrained GloVe embeddings with this link and extract glove.840B.300d.txt into glove/.

Train

  • optional arguments could be found in train.py
  • For dataset Lap14
python train.py --model_name acgcn --embed_type glove --layernorm True --highway True --batch_size 16 --dataset lap14
python train.py --model_name acgcn_bert --embed_type bert --hidden_dim 768 --learning_rate 5e-5 --dataset lap14
  • For dataset Rest14
python train.py --model_name acgcn --embed_type glove --layernorm True --highway True --batch_size 16 --dataset rest14
python train.py --model_name acgcn_bert --embed_type bert --hidden_dim 768 --learning_rate 5e-5 --dataset rest14
  • For dataset Rest15
python train.py --model_name acgcn --embed_type glove --dataset rest15
python train.py --learning_rate 5e-5 --model_name asgcn_bert --embed_type bert --hidden_dim 768 --dataset rest15
  • For dataset Rest16
python train.py --model_name acgcn --embed_type glove --highway True --dataset rest16
python train.py --learning_rate 5e-5 --model_name asgcn_bert --embed_type bert --hidden_dim 768 --dataset rest16
  • For dataset Twitter
python train.py --model_name acgcn --embed_type glove --layernorm True --dataset twitter
python train.py --learning_rate 5e-5 --model_name asgcn_bert --embed_type bert --hidden_dim 768 --layernorm True --dataset twitter

Model

An overview of proposed ACGCN model structure is given below

image

Credits

  • The code of this repository partly relies on ASGCN and I would like to show my sincere gratitude to authors of it.

About

Code for NLPCC 2021 accepted paper titled "An Aspect-Centralized Graph Convolutional Network for Aspect-based Sentiment Classification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages