# Analyzing the Effect of Negation in Sentiment Polarity of Facebook Dialectal Arabic Text
## 3 Materials and Methods
However, this alone cannot be considered as a rule because, in other cases, a real inverter changes the polarity of a sentence starting with the same letter. One way to reduce the number of misleading cases is to filter targets consisting of 4 letters (when pronouns are not used as suffixes such as _expa_ (not the most beautiful voice). The patterns that fail to satisfy these rules may not be targets of fake inverters. However, those who satisfy the rules can be fake or legitimate or inverter's targets. 3. **Odd Negation**: Although real inverters usually flip the polarity of sentimental targets, there are cases when this is not true. Consider the phrase _expa_ (do not curse). Although the negative word curse comes after a real inverter, the phrase is still negative after negation. The target in these cases has the exact properties as other patterns when negation is valid, i.e., flipping polarity. For example, the phrase _expa_ (do not be sad) has the same POS-features as the previous example because the two verbs are in the present tense). Furthermore, they have the same semantic features because both are negative patterns. Furthermore, they have the same syntactic features because both patterns come after the same inverter. Finally, they are representing orders; however, the overall outcome is still different. These cases make the aforementioned modified algorithm is prone to error. Work on this issue is still ongoing. 4. **Implicit Negation**: The sentiment of a negated pattern can be reversed by a dependent clause. Consider the phrase: _expa_ (the would have flawless if he did not worship status). In other words, the pattern \"flawless\" is implicitly negated because the overall sentence implies that \"he has flaws\". The first segment of the sentence is positive, but adding neutral phrases converts it to negative. MSA can easily detect these cases because few words imply exclusion, i.e., words used to show how something would change under a certain condition. In English, we can say, \"It would have been flawless if it was red\", which means that an object has flaws and can become flawless if a particular condition is met. In MSA three common words are used for this purpose (,, the example below is illustrated:  
* _i.e. When there is negation, the target cannot have sentiment by itself. For example, \(\$\)_yes_\(\$\)_yes_\(\$\)_y_ (translated as there is no sound and there is no picture) is inverting two neutral targets by negation. Thus, when negation is applied, neutral nouns become negative and mean that someone is ugly and cannot sing. These patterns were not split.  
The classification algorithm was modified to consider negation: when a positive (or negative) pattern is found, the previous word was checked to see if it is an inverter, and then if an inverter was found, the polarity of the pattern was inverted. The pseudocode, in Algorithm 1, below represents a modified algorithm that considers negation.  
``` Result: Pattern polarity inverted for each inverter. Input: The Unclassified Corpus P; Output: The Classified Corpus P;  SpameCount = 0; \(\$\



To study the effect of inverters from a different perspective, we ran the algorithm above on CA using SN and on CN using SA. To measure the performance of our approach, we use the classical F1-score that exploits precision and recall. If there is an exact match between automatic and manual classification, then a post is correctly classified, such as:

* tp: correct result and classified as being correct. * fn: correct result missed by the classifier. * fp: negative result that is incorrectly classified by the classifier as positive. The following equations are used to calculate the precision, recall, and \(F1\)-score:

\[precision=\frac{tp}{tp+fn} \tag{1}\]

\[recall=\frac{tp}{tp+fp} \tag{2}\]

\[F1-score=\frac{2\times precision}{precision+recall} \tag{3}\]

Table 3 represents the results achieved before and after treating negation. ## 5 Discussion

There are two main reasons behind the significant increase in performance of CA-SN and no improvement in CN-SA:

1.