## 4 Sehaa Tool: Methodology and Design
### Data Pre-Processing Module  
Data pre-processing or preparation is a crucial step within a data analytics pipeline, due to the unstructured and informal nature of the data generated by social media. It involves applying several techniques to the acquired data set in order to clean the data. Data pre-processing should be performed to ensure the data readiness for the subsequent steps wherein the actual analytics will be performed. It also enhances the quality and accuracy of data analytics. Some libraries are available for the pre-processing of text in various languages. The NLTK (natural language toolkit) library is an example. It is used to pre-process text in a wide range of languages including English. However, it does not provide satisfactory support for the Arabic language. Based on our design preferences and the nature of our data set, we have created a specific pre-processing algorithm appropriate for the Arabic language (see Algorithm 2). It starts by removing all advertisement tweets; then incomplete and non-Arabic tweets are removed. Duplicated and unwanted characters such as emoticons characters are also removed. Labeling the Tweets  
Subsequent to the data cleaning phase, the dataset needs to be labeled for training and testing purposes. We randomly selected a part of the data set and divided it into training (60%) and testing (40%) datasets. We manually labeled all the selected tweets using two levels of labeling. At the first level, we label tweets to distinguish between \"related\" and \"unrelated\" tweets, using the labels \"R\" and \"U\", respectively. Tweets that express sickness cases and include information about a specific disease or news about awareness events regarding certain health phenomena are considered as related. However, if the text contains one of the search keywords but the context does not reflect a health concern, such as applications, jokes, and poems, it is labeled as unrelated. A few examples of tweets and their labels are shown in Table 2.  
The second level of labeling is performed on the related tweets to distinguish between the tweets that communicate to create \"awareness\" about diseases and those which are reporting actual cases of \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**No.** & **Tweet’s Text (Arabic and Its Literal Translation)** & **Context Type** & **1 st Level** & **2 nd** \\  & & & **Label** & **Level** \\ \hline
1 & Pregnancy diabetes is diagnosed by blood test & Medical information (awareness tweet) & R & A \\  & before and after the syrup and based on the results, the doctor will tell you. & Medical information (awareness tweet) & R & A \\ \hline
2 & I am diabetic and my sugar level is more than 400 & Complaint (afflicted by disease) & R & I \\  & since Friday, five times a day, do I need to go to the hospital? & Complaint & R & I \\ \hline
3 & Sleepless upon sleepless and who is like me? & Complaint & R & I \\ \hline
4 & Riyadh is being delicate at late night. & Poem & U & U \\ \hline
5 & May [PERSON] cure cancer’s patients & Supplication & U & U \\ \hline
6 & It is not a disease, just a person such as sugar. & Joke & U & U \\ \hline
7 & Do not miss the chance, luxury mjarwsh suxiari & Advertisement & U & U \\  & dates, for delivery to all Saudi cities with 60 riyals. & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The manual labeling of the tweets in Sehaa: a few examples. being \"inflicted by\" a disease. The former category of the related tweets is labeled as \"A\" and the latter category of tweets as \"I\".