## 3 Methodology
### Machine and Deep Learning Algorithms  
In this study, we employed multiple machine learning and deep learning algorithms combined with word representations based on TF-IDF, various word embedding models such as Word2 Vec and FastText, or BERT embeddings. We selected TF-IDF for use with machine learning algorithms such as SVM, random forest, and ensemble classifiers, which integrate several algorithms. Utilizing TF-IDF enhances text vector relevance, reduces data dimensionality, and provides clear, discriminative vectors that help algorithms like SVM and random forest achieve higher classification accuracy. **Support vector machine (SVM)** is a supervised machine learning algorithm commonly used for both classification and regression tasks [27], handling both linear and non-linear data distributions. The primary objective of SVM is to identify a hyperplane that best separates data points into distinct classes within a multidimensional space by maximizing the margin between this hyperplane and the closest data points, known as support vectors. In this study, we use SVM for binary classification, where the labels 1 and -1 represent the positive and negative classes, respectively. The SVM algorithm separates these two classes by finding a hyperplane, represented by \(\mathbf{w}\mathbf{\cdot}\mathbf{x}+\mathbf{b}=\mathbf{0}\) that maximizes the margin between them. To achieve this, SVM applies the constraint \(\mathbf{y}_{i}(\mathbf{w}\mathbf{\cdot}\mathbf{x}_{i}+\mathbf{b})\geq\mathbf{1}\) for each data point while minimizing the function \(\frac{\mathbf{1}}{\mathbf{2}}\|\mathbf{w}\|^{2}\) to ensure an optimal classification. Here, \(\mathbf{w}\) represents the weight or coefficient vector, \(\mathbf{x}\) is the feature vector, b is the bias term, and \(\mathbf{y}_{i}\) is the label for each data point. **Random forest** is a supervised machine learning algorithm that can be used for both classification and regression tasks. It works by creating several independent decision trees from different subsets of the training data [28]. For classification tasks, the random forest model decides if an instance belongs to the positive or negative class by analyzing various data samples and features to build these trees. The final prediction comes from the majority vote among all the trees, which determines the class that the instance belongs to. **Stacking ensemble learning** is a robust technique in machine learning that enhances predictive accuracy by combining outputs from multiple models, known as base models, trained on the same dataset. A higher-level model then aggregates these predictions to produce a final output known as the meta model [29], improving performance in both classification and regression tasks. In this study, we employed ensemble classifiers (EC) with base models, including a random forest, support vector machine (SVM), and multi-layer perceptron, and combined their predictions using a simple logistic regression model to generate the final prediction. TF-IDF was combined with three machine learning techniques, SVM, random forest, and stacking (Figure 7), across the three datasets to compare their performance against each other and other embedding and deep learning techniques. Figure 6: Distribution of French and Arabic datasets before and after SMOTE. Word embeddings and BERT embeddings are used with deep learning algorithms like BiLSTM and GRU (Figure 8). This combination enhances the interpretation of text by providing contextual understanding and improves the processing of textual data while maintaining the semantic relationships between words. The deep learning algorithms applied in this study show better performance and are highly regarded for their effectiveness in processing textual data. **Bidirectional long short-term memory (BiLSTM)** network is an enhancement of traditional LSTM. BiLSTM is the combination of two layers, one processes the input data from start to end (forward direction), while the other processes it from end to start (backward direction).