Preprocessing Solutions for Detection of Sarcasm and Sentiment for A rabic (2021)

Abstract: This paper describes our approach to detecting Sentiment and Sarcasm for Arabic in the ArSarcasm 2021 shared task. Data preprocessing is a crucial task for a successful learning, that is why we applied a set of preprocessing steps to the dataset before training two classifiers, namely Linear Support Vector Classifier (LSVC) and Bidirectional Long Short Term Memory (BiLSTM). The findings show that despite the simplicity of the proposed approach, using the LSVC model with a normalizing Arabic (NA) preprocessing and the BiLSTM architecture with an Embedding layer as input have yielded an encouraging F1score of 33.71% and 57.80% for sarcasm and sentiment detection, respectively.

## introduction sentiment analysis (sa) is a natural language processing field that aims to detect people's opinions and emotions @xcite . recently, sa becomes a big challenge in which several works were realized using different methods. considering works that investigate twitter/tweets as data source, we can cite @xcite who describe a collection of deep learning arabic social media processing tools (aranet) to analyze 15 datasets related to sentiment analysis of arabic including msa and its dialects by the way of a bidirectional encoder representations from transformers (bert). @xcite presented arsarcasm dataset to train a deep learning model for sarcasm detection based on sa using bidirectional long short term memory (bilstm). in @xcite , authors have carried out a comparative study by applying three deep learning techniques: convolutional neural network (cnn), bidirectional gated recurrent unit (bigru), and attention on two datasets (astd and labr). in the case of a single dialect, we find the work done for the algerian alged dataset by @xcite , who used classical and deep learning classification to tackle the problem of sentiment analysis. one of the main challenges of sa is the sarcasm detection which could be beneficial in many areas. sarcasm can be defined as a special form of verbal irony that is intended to express contempt or ridicule @xcite , where people convey the opposite of what they mean, using implicit indirect phrasing, where the intended meaning is different from the literal one @xcite . in recent years, we have noticed that arabic corpora are diversifying more and more according to the task at hand, for instance, one can mention those built by @xcite @xcite @xcite . in addition, irony and sarcasm detection has recently drawn a significant attention in computational linguistics @xcite . fewer studies considered in detail irony detection in arabic. the only and earliest corpus on arabic sarcasm/irony detection is soukhria corpus in @xcite , where the authors created a corpus of arabic tweets, by collecting a set of political keywords. they used the arabic equivalent of sarcasm # , # #. however, this corpus has not been released to public yet. there is also the work done by @xcite who proposed a classification model that detects arabic-sarcasm tweets by using some data mining algorithms. in the first shared task on irony detection for the arabic language organized by @xcite , where they collected their data using distant supervision and used similar arabic hashtags. the task consists of a binary classification of tweets as ironic or not using a dataset composed of 5,030 arabic tweets about different political issues and events related to the middle east and the maghreb. another contribution to the creation of new corpus, @xcite proposed a new open domain arabic corpus annotated for irony detection, which was also collected from twitter. the rest of the paper is organized as follows: in section 2, a description of the used dataset is presented. the applied cleaning steps and preprocessing are explained in section 3. in section 4, we expose the proposed approach and experiments. finally, the findings and discussion are presented in section 5. we conclude the paper in section 6. ## description of the dataset arsarcasm-v2 dataset @xcite has been built using previously available arabic sentiment analysis datasets (semeval 2017 @xcite and astd @xcite ) for which sarcasm and dialect labels have been assigned to them. more details about this dataset is addressed, in ## data cleaning and preprocessing the cleaning process is the first step to apply with arabic tweets. we define it as a surface preprocessing which includes one or many of the following steps: punctuation removal, emojis removal, stop words removal, arabic diacritics removal, arabic letter normalization, latin letter and words removal, repeating words and chars removal. the second step is morphological preprocessing: lemmatization (woradretlemmatizer (lem)), stemming (isri arabic stemmer (stem)) and part of speech tagging (postagger (postag) of nltk) foot_0 (lichouri and abbas, 2020; lichouri et al., 2020). ## experiments as our focus is on detecting sentiment and sarcasm, we present, in this section, our contribution which is preprocessing as a solution to improve detection, in order to build lsvc and bilstm classification models (see figure 1 ). after performing this preprocessing step, features are calculated using the tfidf vectorizer. these features are used to learn the lsvc model, where default parameters defined in the sklearn library are used @xcite . for bilstm, we adopted rnn model which uses an embedding layer with an input of 20k words which will be converted to vector with size 50. we fixed the max length of the input sequences (tweets) to 70 words ( ## results and discussion in the reported results shows that in the case of sentiment detection, the best performance is obtained using the arabic normalizer with an f-pn score of 88.29% and 98.46% with bilstm and lsvc, respectively. in the case of sarcasm detection, the best performance is achieved without applying any preprocessing step with an f1-sarcastic score of 86.05% and 98.83% with bilstm and lsvc, respectively. we should note that the combination of preprocessing steps didn't improve the performance of the system ( ## conclusion in this work, we presented a simple but intuitive detection system based on the investigation of a number of preprocessing steps and their combinations. a comparison between lsvc and bilstm classfiers was conducted where we tried to find the best combination of "preprocessing + classifiers". after conducting more than 200 experiments, we found that feeding bilstm (used for sarcasm @xcite with raw text without preprocessing is better and allowed to achieve a score of 33.71%. in the case of lsvc (used to detect the sentiment of tweets), we found that the better preprocessing step, in our case, is the arabic letter normalizer with an achieved score of 57.87%.