Sarcasm Detection with TensorFlow


Author: Ludvig Persson; Jesper Larsson; [2018]

Keywords: ;

Abstract: Sentiment analysis is the process of letting a computer guess the senti- ment of someone towards something based on a text. This can among other things be useful in marketing, for example in the case of the computer figuring out that a certain person likes a certain product it can present ads for similar products to the person. Sentiment analy- sis in social media is when the texts analyzed are from a social media context like comments or posts on Twitter, Facebook, etc. One prob- lematic aspect of these texts is sarcasm. People tend to be sarcastic very often in social media, with sarcasm being something that can be hard to detect even for a human this does cause problems for the com- puter. This study was conducted with the intention of investigating how sarcasm detection can be performed in social media texts with the help of machine learning. For this purpose Google’s machine learning framework for Python, TensorFlow, was utilized. The machine learn- ing model created was a deep neural network with two hidden layers containing ten nodes each. As for the input a dataset of 4692 texts were used with a 80/20 training/testing split. For preprocessing the texts into a more suitable form for TensorFlow the methods Bag of Words, Bigrams and a naive method here refered to as Char for Char were con- sidered. However due to time constraints proper results from the more advanced approaches (Bigrams and Bag of Words) were not achieved. It was at least found that the rather simple approach was better than expected, with results notably better than 50% that would be highly unlikely to achieve through sheer luck.
