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.
- Python 3.7
- PyTorch 1.6.0
- Supar 1.0.0
- Install SpaCy package and language models with
pip install spacyand
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.txtintoglove/.
- 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 lap14python 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 rest14python 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 rest15python 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 rest16python 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 twitterpython train.py --learning_rate 5e-5 --model_name asgcn_bert --embed_type bert --hidden_dim 768 --layernorm True --dataset twitterAn overview of proposed ACGCN model structure is given below
- The code of this repository partly relies on ASGCN and I would like to show my sincere gratitude to authors of it.
