ganeshjawahar / mem_absa

Aspect Based Sentiment Analysis using End-to-End Memory Networks
MIT License
199 stars 104 forks source link
aspect-based classification memory-networks neural-networks sentiment-analysis

Aspect Level Sentiment Classification with Deep Memory Network

TensorFlow implementation of Tang et al.'s EMNLP 2016 work.

Problem Statement

Given a sentence and an aspect occurring in the sentence, this task aims at inferring the sentiment polarity (e.g. positive, negative, neutral) of the aspect.

Example

For example, in sentence ''great food but the service was dreadful!'', the sentiment polarity of aspect ''food'' is positive while the polarity of aspect ''service'' is negative.

Quick Start

Download the 300-dimensional pre-trained word vectors from Glove and save it in the 'data' folder as 'data/glove.6B.300d.txt'.

Train a model with 7 hops on the Laptop dataset.

python main.py --show True

Note this code requires TensorFlow, Future and Progress packages to be installed. As of now, the model might not replicate the performance shown in the original paper as the authors have not yet confirmed the optimal hyper-parameters for training the memory network.

Training options

Performance - Laptop Dataset (todo)

Model In Paper This Code
MemNet (1) 67.66
MemNet (2) 71.14
MemNet (3) 71.74
MemNet (4) 72.21
MemNet (5) 71.89
MemNet (6) 72.21
MemNet (7) 72.37
MemNet (8) 72.05
MemNet (9) 72.21

Performance - Restaurant Dataset (todo)

Model In Paper This Code
MemNet (1) 76.10
MemNet (2) 78.61
MemNet (3) 79.06
MemNet (4) 79.87
MemNet (5) 80.14
MemNet (6) 80.05
MemNet (7) 80.32
MemNet (8) 80.14
MemNet (9) 80.95

Acknowledgements

Author

Ganesh J

Licence

MIT