Pytorch implementation for the ACL2020 paper Every Document Owns Its Structure: Inductive Text Classification via Graph Neural Networks.
For official code please refer to TextING repository.
Some functions are based on Official Code and Text GCN. Thank for their work.
- Python 3.8.5
- install requirements.txt
Download pre-trained word embeddings glove.6B.300d.txt
from here and unzip to the ./pretrained_models
.
Build graphs from the datasets in data/corpus/
as:
python build_graph.py [DATASET] [WINSIZE]
Provided datasets include mr
,ohsumed
,R8
andR52
. The default sliding window size is 3.
Start training and inference as:
python pre_dataloader [--dataset DATASET]
python train.py [--dataset DATASET] [--learning_rate LR]
[--epochs EPOCHS] [--batch_size BATCHSIZE]
[--hidden HIDDEN] [--steps STEPS]
[--dropout DROPOUT] [--weight_decay WD]
@inproceedings{zhang2020every,
title={Every Document Owns Its Structure: Inductive Text Classification via Graph Neural Networks},
author={Zhang, Yufeng and Yu, Xueli and Cui, Zeyu and Wu, Shu and Wen, Zhongzhen and Wang, Liang},
booktitle="Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics",
year={2020}
}