RegionEmbedding

October 14, 2018 ยท View on GitHub

MXNet implementation of ICLR 2018 paper: A new method of region embedding for text classification.

Official implementation in TensorFlow.

0.Notes

  • I implemented both Word-Context and Context-Word Region Embedding in the paper.
  • Please see the original papar about the datasets and pre-pocessing.
  • All the hyper-parameters I used are copied from the official implementation.

1.Requirements

  • Python2 or Python3
  • Mxnet 1.2.1

2.Results

DatasetsAccuracy(%)
WordContext
Best Epoch
WordContext
Accuracy(%)
ContextWord
Best Epoch
ContextWord
Running Time
Per Epoch(mins)
Yahoo Answer73.07(73.7)273.42(73.4)3110
Amazon Polarity95.27(95.1)295.36(95.3)3247
Amazon Full61.58(60.9)261.59(60.8)2183
Ag news92.96(92.8)692.89(92.8)82
DBPedia98.91(98.9)498.88(98.9)323
Yelp Full64.98(64.9)364.94(64.5)225

Note:

  • The accuracy in brackets are results reported in the original paper.
  • The running speed is much faster than the origin implementation in Tensorflow.
    The running time was tested on the model of context-word region embedding, which run roughly the same as the word-context region embedding.
  • The code run on a Titan Xp GPU.