# Enhancing Detection of Arabic Social Spam Using Data Augmentation and Machine Learning
## 3 Proposed Framework for Enhancing Arabic Spam Detection
### Applying Machine Learning for Spam Detection
#### 3.3.2 Feature Engineering  
The first step in applying machine learning classification is to extract suitable features that help identify spam tweets and to represent them as a feature vector (transform them into numerical feature vectors). In this step, three categories of features are extracted as shown in Table 2: Content features that represent the text included in the tweet, interaction features that describe the tweet spreading between users, and finally, user features that represent the users that propagate the spam text.  
* Content Features:
* TF-IDF: Some language features are used, such as Term-Frequency-based (TF-IDF), which is the most popular feature extraction method. This method typically represents each sentence as a vector of term frequencies (TF) and assigns a score for each word in the text based on the number of times its occurrence and how likely it can be found in texts. (TF-IDF) would show the relative importance of a term in a document compared to other words in the corpus.
* Hashtag count and URLs count: These features can help us detect spam profiles because they tend to share a lot of spam tweets with URLs and hashtags as an advertising strategy. These values should be higher for the spamer than for the regular users [66].
* Spam words: The number of spam words in tweets should be higher in spam profiles than in regular profiles. As a result, this feature is important in detecting spam tweets, and is calculated based on the spam words dictionary. This dictionary is constructed based on spam tweets in our labeled dataset, and only the  
Figure 3: Arabic text data augmentation example. (The colors represent the selected words and each word is distinguished by a different color.)most common and relevant words were selected from the resulting list, which was manually filtered [66].
* Interaction Features:
* Tweets duplication count: As noticed, the spammers frequently repeat the same tweet to gain the attention of users to its content. Therefore, we believe that this feature is critical to know whether content is spam or not [66].
* Retweet count: This feature can be used to distinguish between spam and non-spam tweets because spam tweets are not usually retweeted [66].
* Mention count: This feature can help us detect spam profiles because they tend to share a lot of spam tweets with mentions as an advertisement strategy. These values should be greater for the spammer than for the regular users [66].
* Favorite count: Spam tweets are usually not marked as favorites. This value should be higher for the regular than the spammer users [66].
* User Features:
* User followers and user friends count: These features can help us detect spam profiles. If the result of the ratio between followers and friends is too small, then the probability of being a spam user will increase [66].
* User description length: Number of characters in the user description. If the result is zero, then the probability of being a spam user will increase.