Document classification with Hierarchical Attention Networks in TensorFlow
Switch branches/tags
Nothing to show
Clone or download
ematvey Merge pull request #16 from nthain/master
Bugfix, adding requirements, updating README
Latest commit 8e8ba74 Apr 17, 2018

Deep Text Classifier

Implementation of document classification model described in Hierarchical Attention Networks for Document Classification (Yang et al., 2016).

How to run

  1. Create a virtual environment, activate it, and install requirements:
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
  1. Download the English model for spaCy:
python -m spacy download en
  1. Get Yelp review dataset and extract it in this directory.
python3 dataset/review.json
python3 --mode=train --device=/gpu:0 --batch-size=30


I am getting 65% accuracy on a dev set (16% of data) after 3 epochs. Results reported in the paper are 71% on Yelp'15. No systemic hyperparameter optimization was performed.