This project implements Yao et al. 2018. Graph Convolutional Networks for Text Classification. ArXiv. in Chainer. The project includes codes to reproduce the text classification experiment on the 20 news groups dataset. This is NOT an official implementation by the authors.
This project adopts hyperparamters specified in the original paper. I have greatly simplified text preprocessing to just splitting words with white spaces.
I referenced @takyamamoto's implementation of GCN to implement this project.
I have only tested the code on Python 3.6.4. Install dependent library by running:
pip install -r requirements.txt
You need to install cupy
to enable GPU.
Run:
python train.py
Refer to python train.py -h
for the options.
Note that you can enable early stopping by --early-stopping
flag, but the overhead for saving intermediate models is quite large.
Running this project with the original adjacency matrix normalization method (python train.py -g 0 --normalization gcn
) yields 0.8578 accuracy in the 20 News groups dataset.
The test accuracy was 0.8634 in the original paper.
I was not able to figure out the reason for slightly inferior performance.
Running python train.py -g 0 --normalization pygcn
which uses normalization method proposed in GCN authors' PyTorch implementation yields much better result of 0.8660 (comparable with the original paper).