Abstract
Modeling optimism and pessimism accurately in social media has important applications to personal health individually and society wellness collectively. In this paper, we predict optimism and pessimism in Twitter messages by building multiple models on top of XLNet, an integrated model using multiple auto-regressive language models to capture left and right contexts jointly in sentences. Utilizing multiple-head self attentions via multi-layer transformers, XLNet models are able to model negations and other semantic relationships by paying attentions to crucial and important words, leading to more accurate predictive models for optimism and pessimism. For example, using XLNet models, we have improved the state of the art accuracy of 9032% to 96.45%, a 6332% error reduction on a benchmark dataset. Based on the observations that all deep models should generalize to new messages based on the same training samples, we train multiple predictive models and use the consensus to further improve the accuracy on subsets of the test samples. We also demonstrate that positive emotions and sentiments in optimistic messages are much more common while negative emotions and sentiments are more so in pessimistic ones using XLNet models finetuned for emotion classification and sentiment analysis. The proposed models could be used for understanding optimism and pessimism in social media.