#Sentic GCN
Introduction
This repository was used in our paper:
Aspect-Based Sentiment Analysis via Affective Knowledge Enhanced Graph Convolutional Networks
Bin Liang, Hang Su, Lin Gui, Erik Cambria, Ruifeng Xu. Knowledge-Based Systems, 2021: 107643.
Please cite our paper and kindly give a star for this repository if you use this code.
Requirements
- Python 3.6
- PyTorch 1.0.0
- SpaCy 2.0.18
- numpy 1.15.4
Usage
- Please download SenticNet from https://sentic.net/downloads/.
- Install SpaCy package and language models with
pip install spacy
and
python -m spacy download en
- Generate dependency graph with
python generate_dependency_graph.py
- Generate sentic graph with
python generate_sentic_graph.py
Training
-
Train with command, optional arguments could be found in train.py & train_bert.py
-
Run senticgcn:
./run_senticgcn.sh
-
Run senticgcn_bert:
./run_senticgcn_bert.sh
Citation
The BibTex of the citation is as follow:
@article{liang2021aspect,
title={Aspect-based sentiment analysis via affective knowledge enhanced graph convolutional networks},
author={Liang, Bin and Su, Hang and Gui, Lin and Cambria, Erik and Xu, Ruifeng},
journal={Knowledge-Based Systems},
pages={107643},
year={2021},
publisher={Elsevier}
}
Credits
- The affective knowledge used in this work is from SenticNet, I would like to express my heartfelt thanks to all the authors of SenticNet.
- The code of this repository partly relies on ASGCN & ABSA-PyTorch.
- Here, I would like to express my gratitude to the authors of the ASGCN & ABSA-PyTorch repositories.