# Developing Analytical Tools for Arabic Sentiment Analysis of COVID-19 Data
## 3 Research Methodology
### Lexicon Construction
#### 3.1.2 Constructing a Lexicon Using the Trained Data
It is essential to specify the scope of negation, i.e., the word order in the sentence that may be modified by a negation term. In a preliminary experiment, we determined that a window size of three is effective for finding negated terms and according to [24] a window size of four yields excessive error rates. Consequently, we decided to examine the following three words at most. We were able to assess the sentiment of each tweet by referring to the lists of positive, negative, and neutral emojis that had been provided. The technique is as follows. We started by converting text messages into Unicode representations, and then using regular expressions, we were able to extract Unicode characters that corresponded to the Unicode Consortium's emoji list. From our original dataset, we were able to identify a total of 316 distinct emoji characters. Afterwards, we compare each emoji using the following criteria. If the emoji is identified in the positive emoji file, it will be added to the positive counter by one. The negative counter is increased by one if an emoji from the negative emoji file is discovered. If an emoji is detected in a neutral word file, it will be added to the neutral counter as an additional one. Figure 4: An example of preprocessing steps. #### 3.2.4 Sentiment Computation

To obtain the sentiment of an Arabic tweet we check the positive counter, negative counter, and neutral counter of the words of specific tweet as the following: Tweet is considered positive if its positive counter is larger than both its negative counter and the neutral counter. Tweet is considered negative if its negative counter is larger than both its positive counter and its neutral counter. otherwise, the tweet is considered as neutral

#### 3.2.5 Dataset Description

A sample annotated dataset and their corresponding labels are shown in Table 6. To sum it up, there are 42,461 tweets in the dataset, with an average of 7.44 words per tweet and a total character count of 1,904,517 in the 315,936 words. For each sentiment class, Table 7 lists the statistics about the dataset. \begin{table}
\begin{tabular}{c c c} \hline
**Tweet** & **Label** \\ \hline RT @[PERSON]\_b\_saud:\_useful\_iseful\_iseful\_iseful\_iseful\_iseful\_iseful\_iseful\_iseful\_is\_eful\_is\_eful\_is\_eful\_is\_eful\_is\_eful\_is\_eful\_is\_eful\_is\_



## 4 Experimentation and Simulation

### Experimental Setup

#### 4.1.1 Dataset Description

The authors in [25] construct and distribute an annotated Arabic dataset in context of COVID-19 called AraCOVID19-SSD. This dataset contains 5162 tweets that have been annotated for two purposes, SA and sarcasm identification. Tweets were collected between 15 December 2019 and 15 December 2020. All tweets in the dataset have been annotated and confirmed manually by human annotators. Only tweet-ids have been made available by the authors, thus we had to create a Python script to retrieve the tweet text of each tweet-id. Because 614 of the tweet-ids return no data, the size of the AraCOVID19-SSD dataset after hydration is equal to 4548 tweets. For each sentiment class, Table 8 lists the statistics about the dataset. #### 4.1.2 Feature Representation

Features are a numerical representation of factors that are extracted from text and utilized as inputs to a specific machine learning classifier. Selecting appropriate features is crucial to the success of machine learning categorization. In this study, we examined the impact of combining TF-IDF with N-gram (unigram, bigram, trigram, fourgrm) technique to represent text. Furthermore, we define an extensive set of features as described in Table 9. We organized these features for three feature sets, sentiment-based features, emoji-based features, and negation-based features. N-gram is one of the well-known models used in NLP fields and language modeling. N-gram is a model that consists of an adjacent sequence of elements (words, bytes, syllables, or characters) of N-length. In this work, Several baseline word-based n-gram features are tested.