Code Monkey home page Code Monkey logo

texting's Introduction

TextING

The code and dataset for the ACL2020 paper Every Document Owns Its Structure: Inductive Text Classification via Graph Neural Networks, implemented in Tensorflow.

Some functions are based on Text GCN. Thank for their work.

Requirements

  • Python 3.6+
  • Tensorflow/Tensorflow-gpu 1.12.0
  • Scipy 1.5.1

Usage

Download pre-trained word embeddings glove.6B.300d.txt from here and unzip to the repository.

Build graphs from the datasets in data/corpus/ as:

python build_graph.py [DATASET] [WINSIZE]

Provided datasets include mr,ohsumed,R8andR52. The default sliding window size is 3.

To use your own dataset, put the text file under data/corpus/ and the label file under data/ as other datasets do. Preprocess the text by running remove_words.py before building the graphs.

Start training and inference as:

python train.py [--dataset DATASET] [--learning_rate LR]
                [--epochs EPOCHS] [--batch_size BATCHSIZE]
                [--hidden HIDDEN] [--steps STEPS]
                [--dropout DROPOUT] [--weight_decay WD]

To reproduce the result, large hidden size and batch size are suggested as long as your memory allows. We report our result based on 96 hidden size with 1 batch. For the sake of memory efficiency, you may change according to your hardware.

Citation

@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}
}

texting's People

Contributors

magicat128 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.