Implement some text classification model with TensorFlow based on some papers:
Paper: Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification
See ABBLSTM.py
Paper: Hierarchical Attention Networks for Document Classification
See ALSTM_Hierarchical.py
Paper: Adversarial Training Methods For Semi-Supervised Text Classification
See adversarial_abblstm.py
You can load the data with
dbpedia = tf.contrib.learn.datasets.load_dataset('dbpedia', test_with_fake_data=FLAGS.test_with_fake_data)
The ABBLSTM model can get a 98.23 % accuracy on the dataset.
And the Aderversarial ABBLSTM achieves 98.5% accuracy, training with AWS p2 instance for almost 2 hours.
Learn a lot from ilivans/tf-rnn-attention .