# An Explainable Artificial Intelligence Model for Detecting Xenophobic Tweets
## 4 Our Approach for Detecting Xenophobic Tweets
### Mining Contrast Patterns  
Nowadays, various understandable classifications models can bring us an explanation about the classification [89]. Nevertheless, from all the understandable classification models, the contrast pattern-based models are one of the most prominent [90], not only for the explanatory power but also because different studies have proved that these models provide good results for class imbalance problems [36; 90]. Figure 4 shows the pipeline to extract the contrast patterns. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multicolumn{7}{c}{**(a) Sentiment features.**} \\ \hline
**Class** & **Negative** & **Positive** & **Agreement** & **Score tag** \\ \hline Non-Xenophobia & 0.202 & 0.458 & AGREEMENT & Neutral \\ Xenophobia & 0.707 & 0.094 & DISAGREEMENT & Negative \\ \hline \multicolumn{7}{c}{**(b) Emotion features.**} \\ \hline
**Class** & **Bored** & **Sad** & **Happy** & **Excited** & **Joy** & **Disgust** & **Anger** \\ \hline Non-Xenophobia & 0.0240 & 0.1341 & 0.2205 & 0.2371 & 0.1766 & 0.2272 & 0.1721 \\ Xenophobia & 0.0251 & 0.0566 & 0.0718 & 0.2963 & 0.0047 & 0.5043 & 0.4510 \\ \hline \multicolumn{7}{c}{**(c) Intent features.**} \\ \hline
**Class** & **News** & **Spam** & **Marketing** & **Feedback** & **Complaint** & **Appreciation** \\ \hline Non-Xenophobia & 0.6940 & 0.0410 & 0.0730 & 0.1770 & Null & Null \\ Xenophobia & 0.8260 & 0.0400 & 0.0480 & 0.0800 & Null & Null \\ \hline \multicolumn{7}{c}{**(d) Abusive content features.**} \\ \hline
**Class** & **Abusive** & **Hate-speech** & **Neither** \\ \hline Non-Xenophobia & 0.0092 & 0.8489 & 0.1408 \\ Xenophobia & 0.0005 & 0.9990 & 0.0005 \\ \hline \multicolumn{7}{c}{**(e) Unigram Xenophobia Keywords.**} \\ \hline
**Class** & **Country** & **Illegal** & **Foreigners** & **Alien** & **Criminal** \\ \hline Non-Xenophobia & not present & not present & not present & not present & not present & not present \\ Xenophobia & not present & not present & present & not present & not present \\ \hline \multicolumn{7}{c}{**(f) Bigram Xenophobia Keywords.**} \\ \hline
**Class** & **Back country** & **Illegal alien** & **Violent foreigners** & **Criminal foreigners** & **Criminal migrant** \\ \hline Non-Xenophobia & not present & not present & not present & not present & not present & not present \\ Xenophobia & not present & not present & present & not present & not present & not present \\ \hline \multicolumn{7}{c}{**(g) Syntactic features.**} \\ \hline
**Class** & **ADJ** & **AUX** & **NUM** & **PROPN** & **ALPHAS** & **HASITAGS** & **URLs** \\ \hline Non-Xenophobia & 2 & 1 & 0 & 5 & 19 & not present & 3 \\ Xenophobia & 3 & 0 & 0 & 2 & 20 & not present & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Example of our interpretable feature representation for tweets belonging to the Xenophobia and non-Xenophobia class grouped by different key labels. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multicolumn{1}{c}{**Class**} & \multicolumn{3}{c}{**Twect**} \\ \hline
**Class** & **Longion** & **Longion** & **Longion** & **Longion** & **Longion** & **Longion** \\ \hline Non-Xenophobia & 0.0092 & 0.0092 & 0.0092 & 0.0092 & 0. According to [PERSON] and [PERSON] [38], a pattern is a condition on data tuples that evaluates to either true or false. To be considered a pattern, the succinct state must be much simpler and smaller than the original length of the data. Ordinarily, a pattern is represented by a conjunction of relational statements, each with the form: [f\({}_{i}\) # v\({}_{j}\)], where v\({}_{j}\) is a value within the space of feature f\({}_{i}\), and # is a relational operator taken from the set { =, \(\
eq\), \(\leq\), >, \(\in\), \(\
ot\), } [33; 36; 38]. For example, [_violent foreigners_ = \"_present\"_] \(\wedge\) [_beta-speech_ \(\geq\) 0.11], is a pattern describing post xenophobes. In comparison, contrast patterns are a type of pattern whose supports differ significantly among the analyzed databases [38].