Text-Classification
Implement some text classification model with TensorFlow based on some papers:
Attention-Based Bidirection LSTM for Text Classification
Paper: Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification
See ABBLSTM.py
Hierarchical Attention Networks for Text Classification
Paper: Hierarchical Attention Networks for Document Classification
See ALSTM_Hierarchical.py
Adversarial Training Methods For Supervised Text Classification
Paper: Adversarial Training Methods For Semi-Supervised Text Classification
See adversarial_abblstm.py
Dataset and Performance
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.
Reference
Learn a lot from ilivans/tf-rnn-attention .