Sarcasm Detection Using Sentiment Flow Shifts

One of the most frequently cited sarcasm realizations is the use of positive sentiment within negative context. We propose a novel approach towards modeling a sentiment context of a document via the sequence of sentiment labels assigned to its sentences. We demonstrate that the sentiment flow shifts (from negative to positive and from positive to negative) can be used as reliable classification features for the task of sarcasm detection. Our classifier achieves the F1-measure of 0.7 for all reviews, going up to 0.9 for the reviews with high star ratings (positive reviews), which are the reviews that are materially affected by the presence of sarcasm in the text.  Verbal irony or sarcasm has been studied by psychologists, linguists, and computer scientists for different types of text: speech, fiction, Twitter messages, Internet dialog, product reviews, etc. Sentiment is widely used as a classification feature for the detection of whether a text snippet or a document is sarcastic or not. The popularity of this feature can be explained by the fact that it is agreed that in many cases sarcasm is manifested in a document via a text snippet with positive sentiment applied to a negative situation. Given that the notion of sarcasm (or verbal irony, or irony for that matter) does not have a formal definition except that in the case of sarcasm/irony a nonsalient interpretation has the priority over a salient one, positive utterance within a negative context is a reliable feature to use (Riloff et al. 2013). Other features (textual and non-textual) used for the task of identifying sarcastic text are: emoticons (GonzalezIbáñez, Muresan, and Wacholder 2011), heavy punctuation (Carvalho et al. 2009), hashtags (Wang et al. 2015), quotation marks (Carvalho et al. 2009), positive interjections (Gonzalez-Ibáñez, Muresan, and Wacholder 2011), lexical N-gram cues associated with sarcasm (Davidov, Tsur, and Rappoport 2010), lists of positive and negative words (Gonzalez-Ibáñez, Muresan, and Wacholder 2011), etc. It must be noted that the above features are designed to predict sarcasm in short messages. In this work we demonstrate that these features do not work well for long documents. This means that other features should be devised for detecting sarcasm on a document level.  Recently the necessity of looking beyond the text snippets and into the context that surrounds the possibly sarcastic text utterance got a lot of attention. Researchers investigate the effect of context on sarcasm and design features to capture the global context within which sarcasm appears. Wallace et al. (2015) work on comments from Reddit threads about politics. Wang et al. (2015) work with Twitter messages and analyze these messages as a part of a larger Twitter thread. In both cases, the context is derived using lexical and nonlexical features of the surrounding messages and the information about the overall polarity of the thread (e.g., whether the Reddit thread is a part of the conversation among conservatives or not). The generated context has a certain sentiment that is used for the task of sarcasm detection. In our work we rely on the importance of context for sarcasm detection. Our approach to contexualization is based on the common belief that a sarcastic document contains a passage which, when taken out of context and analyzed as a stand-alone sentence with the priority of the salient meaning over non-salient one, can be classified as positive but within a given (typically negative) context becomes the holder of sarcasm. For example, the following sentence marked with a positive sentiment label1 while being a part of an overall negative (1 ) review of a Bill Clinton biography documentary signals the presence of sarcasm in the review2. This dvd is great if you think that Gennifer Flowers, Paula Jones and Monica Lewinsky were the highlights of the Clinton administration. However, sarcasm can be observed in overall positive (5 ) reviews as well. For example, in a positive (5 ) review about a movie, the following sentence marked as negative is a good signal of sarcasm being present in the review. I believe this film was secretly banned from Oscar consideration due to the fact the committee felt it would be unfair to the other nominees. All sentiment labels presented in this paper are obtained using the Stanford Sentiment Analysis tool (Socher et al. 2013) with the 5-point sentiment scale: very negative (-2), negative (-1), neutral (0), positive (+1), very positive (+2). The Stanford Sentiment Analysis tool sentence sentiment prediction accuracy is 85.4% All examples presented in this paper are from existing Amazon product reviews. We preserve the original orthography, punctuation, and capitalization Proceedings of the Thirtieth International Florida Artificial Intelligence Research Society Conference