# 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  
In this phase, a labeled dataset called SenWave, which is the first available annotated dataset about COVID-19, is used to construct an Arabic sentiment lexicon automatically. This dataset was gathered from 1 March until 20 January 2020. It has been manually annotated and is available for download. Each tweet was annotated by at least three Arabic annotators with extensive expertise, all of whom were subjected to thorough quality control. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Emoji Group** & **Emoji** & **Emoji Sentiment** &
\begin{tabular}{c} **Number of Emojis** \\ **(320)** \\ \end{tabular} \\ \hline Smileys & & Positive & 69 \\ Happiness & & Positive & 69 \\ Love & & & \\ Straight face & & & \\ No expression & & & \\ Hesitation & & & \\ Surprise & & & \\ Shock & & & \\ Flags & & & \\ Animals & & & \\ Job & & & \\ Sadness & & & \\ Cry & & & \\ Anger & & & \\ Annoyed & & & \\ worry & & Negative & 52 \\ Disappointed & & & \\ Great dismay & & & \\ Horror & & & \\ Frowning & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Sentiment and emotion expressed by emojis. Table 3 contains instances of tweet text and its polarity culled from the SenWave corpus. The tweets in the corpus were primarily classified into four classes, negative, positive, joking, and neutral. In the dataset, there are 1418 joking tweets, however our suggested approach aims to identify only positive, neutral, and negative sentiments. As a result, in this study, we did not include any tweets having a joking sentiment. There are 1562 positive tweets in the dataset, 4269 neutral tweets, and 2750 negative tweets in the dataset. Table 4 provides statistical information about the SenWave dataset. As earlier noted in Algorithm 1, the dataset was read from a file, and then many pre-processing steps were performed, as explained in Section 3.2.2. After preprocessing, all of the unique words extracted from the dataset's tweets were aggregated into a single set, known as a bag-of-words as explained in step two. In step three, the number of times each term appeared in tweets that were either positive, negative, or neutral was determined using the training dataset. After that, in step four, the polarity of each word was computed using the following formula, considering a labeled dataset with (L) as the length of each tweet, which comprises tweets of three categories, negative, positive, and neutral. According to line 19, to calculate the positive score of word w (PositiveScore(w)) divide the number of occurrences in positive tweets (#pos) by the total number of times it appears in all tweets. As stated in line 21, the neutral score of word w (NeutralScore(w)) is the frequency with which the term appears in tweets that are neutral (#neu) divided by the total occurrences of the term. As shown in line 20, the negative score of word w \begin{table}
\begin{tabular}{l c} \hline \hline Total tweets in original SenWave dataset & 9999 \\ Total Tweets after removing joking sentiment tweets & 8581 \\ Total number of positive tweets & 1562 \\ Total number of negative tweets & 2750 \\ Total number of neutral tweets & 4269 \\ Total number of words & 122,005 \\ Total number of characters & 678,915 \\ Average words per tweet & 14.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Statistics and measurements for the SenWave dataset used in this research. \begin{table}
\begin{tabular}{l c} \hline \hline
**Tweet Text** & **Polarity** \\ \hline _L  
(NegativeScore(w)) is the number of occurrences in negative tweets (#neg) divided by the total number of occurrences. Finally, in step five, in lines 22-29, we determine the final polarity of every word as follows, when the PositiveScore(w) is greater than both the NegativeScore(w) and the NeutralScore(w)), the term is considered positive. A word is considered to be negative if the NegativeScore(w)) is larger than both the PositiveScore(w)) and NeutralScore(w)) values; otherwise, its polarity is neutral.