Based on Attention Based Aspect Extraction implementation by Anton Alekseev.
-
Attention-Based Aspect Extraction model (ABAE) described in paper ‘‘An unsupervised neural attention model for aspect extraction’’. (pdf)
-
Capsule-Based Aspect Extraction model (CBAE) in which the attention mechanism is replaced by a capsule network with dynamic routing.
You can find the pre-processed datasets and the pre-trained word embeddings in [Download]. The zip file should be decompressed and put in the main folder.
- python 3.8
- nvidia GPU with cuda capability 3.5 and 6gb memory size
$ pip install -r requirements.txt
$ jupyter notebook
If you use the code, please consider citing original paper:
@InProceedings{he-EtAl:2017:Long2,
author = {He, Ruidan and Lee, Wee Sun and Ng, Hwee Tou and Dahlmeier, Daniel},
title = {An Unsupervised Neural Attention Model for Aspect Extraction},
booktitle = {Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
month = {July},
year = {2017},
address = {Vancouver, Canada},
publisher = {Association for Computational Linguistics}
}