## 5 Experimental Results and Discussion
### First Layer: Systematic Detection of Hate Speech  
The first experiment focused on detecting Arabic hate speech tweets. Table 4 presents the results obtained using various machine learning models, including the support vector machine (SVM), random forest (RF), naive Bayes (NB), and logistic regression (LR). It can be seen from Table 4 that the highest performance for Arabic hate speech detection was achieved by LR with a combination of word- and char-Ngrams as features. This configuration achieved an accuracy of 77.81%, a precision of 77.58%, a recall of 77.14% and an F1 score of 77.29%. These results show that the integration of features at the word and character level significantly improves the performance of the model compared to using the individual features.  
A repetition of the experiment with deep learning models showed a significant improvement in hate speech detection. As shown in Table 5, Figures 5-7, the highest performance was achieved by the convolutional neural network (CNN) with trainable embeddings, which achieved an accuracy of 91.95%, a precision of 92.59%, a recall of 93.36% and an F1 score of 92.96%. This result outperformed all other models, including recurrent architectures such as RNN, LSTM and BiLSTM, as well as models using pre-trained embeddings, such as AraVec, AraBERT and DistilBERT. These results highlight the effectiveness of CNNs, especially with trainable embeddings, in capturing complex patterns for detecting Arabic hate speech.  
\begin{table}
\begin{tabular}{l l c c c c} \hline \hline  & & & & & \\ \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Features**} & \multirow{2}{*}{**Accuracy**} & \multirow{2}{*}{**Precision**} & \multirow{2}{*}{**Recall**} & \multirow{2}{*}{**F1 Score**} \\ \cline{3-3} \cline{5-6}  & & & & & \\ \multirow{2}{*}{**LR**} & **WordNgrams** & **74.90** & **74.88** & **73.83** & **74.07** \\  & **Char-Ngrams** & **76.86** & **76.74** & **75.95** & **76.18** \\  & **Word + Char-N-grams** & **77.81** & **77.58** & **77.14** & **77.29** \\ \hline \multirow{3}{*}{SVM} & Word-N-grams & 74.49 & 74.16 & 74.26 & 75.02 \\  & Char-N-grams & 77.16 & 76.7 & 76.86 & 77.39 \\  & Word + Char-N-grams & 77.06 & 76.82 & 76.9 & 77.28 \\ \multirow{3}{*}{NB} & Word-N-grams & 76.24 & 76.89 & 74.69 & 75.06 \\  & Char-N-grams & 76.01 & 75.73 & 75.3 & 75.45 \\  & Word + Char-N-grams & 76.93 & 76.6 & 76.46 & 76.51 \\ \hline \multirow{3}{*}{RF} & Word-N-grams & 72.86 & 72.71 & 71.7 & 71.91 \\  & Char-N-grams & 74.76 & 74.91 & 73.42 & 73.71 \\ \cline{1-1}  & Word + Char-N-grams & 74.45 & 74.62 & 73.06 & 73.35 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Results obtained using various machine learning models, including support vector machine (SVM), random forest (RF), naive Bayes (NB), and logistic regression (LR).  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & & \multicolumn{4}{c}{**Metrics**} \\ \hline
**Model** & **Features** & **Accuracy** & **Precision** & **Recall** & **F1 Score** \\ \hline RNN & & 85.81 & 89.48 & 84.55 & 86.93 \\ LSTM & Trainble Embeddings & 90.09 & 91.22 & 91.16 & 91.19 \\ BiLSTM & & 88.82 & 91.52 & 88.07 & 89.73 \\
**CNN** & & **91.95** & **92.59** & **93.36** & **92.96** \\ (a) Trainable Embedding & & 79.77 & 84.97 & 77.83 & 81.24 \\ RNN & & 79.97 & 82.68 & 81.47 & 82.07 \\ LSTM & Embeddings & 79.68 & 82.02 & 81.87 & 81.93 \\
**CNN** & & **92.75** & **94.11** & **93.18** & **93.64** \\ Arabert & AraBERT pretrained & 91.67 & 91.78 & 91.28 & 91.49 \\ Distilbert & Embeddings & 80.37 & 80.25 & 79.66 & 79.88 \\ (b) Pretrained Embedding & & & & \\ \hline \hline \end{tabular}
\end{table}
Table 5: A repetition of the experiment with different deep learning models for the first layer.  
Figure 5: Precision–recall (PR) curve for a repetition of the experiment with different deep learning models for the first layer (trainable embeddings).  
Figure 6: Precision–recall (PR) curve for a repetition of the experiment with different deep learning models for the first layer (pretrained embedding).