This repo accompanies the paper by the same name published in Natural Language Engineering (Volume 27, Issue 2) 2020, by
Jeremy Barnes, Lilja Øvrelid, and Erik Velldal. Pre-print available on arXiv.
Sentiment analysis is directly affected by compositional phenomena in language that act on the prior polarity of the words and phrases found in the text. Negation is the most prevalent of these phenomena and in order to correctly predict sentiment, a classifier must be able to identify negation and disentangle the effect that its scope has on the final polarity of a text. This paper proposes a multi-task approach to explicitly incorporate information about negation in sentiment analysis, which we show outperforms learning negation implicitly in a data-driven manner. We describe our approach, a cascading neural architecture with selective sharing of LSTM layers, and show that explicitly training the model with negation as an auxiliary task helps improve the main task of sentiment analysis. The effect is demonstrated across several different standard English-language datasets for both tasks and we analyze several aspects of our system related to its performance, varying types and amounts of input data and different multi-task setups.
- Single-task model
- Multi-task SFU
- Multi-task CD
- Transfer-learning
You can find the embeddings used in the experiments here. Untar the file and use the 'google.txt' embeddings.
- Python 3
- sklearn
pip install -U scikit-learn
- Pytorch
pip install torch torchvision torchtext
- nltk
pip install nltk
- matplotlib
pip install matplotlib
- tqdm
pip install tqdm