# Offensive-Language Detection on Multi-Semantic Fusion Based on Data Augmentation
## 4 Experimentation
### Experimental Settings  
**Data Settings.** To prove the validity of the model, we conducted experiments on two public offensive-language datasets. On the two datasets, we only performed data augmentation on the training set. The amount of enhanced data was twice that of the original training set. The details of the datasets are shown in Table 2.  
The Offensive Language Identification Dataset (OLID) released by SemEval-2019 Task 6 has three subtasks. We only focused on subtask A: Offensive-Language Detection. The test set had 820 sentences, and the training set had 13,420 sentences. OLID is an unbalanced dataset, and the ratio of positive samples to negative samples is about 1:2.  
The Davidson Dataset (DV) was created by [11]. The DV dataset contains more than 20,000 sentences, which is relatively large. DV contains three categories, including hate speech, offensive language, and neither. It is also an unbalanced dataset, with the ratio of the three categories of 1:13:3, respectively.  
Data imbalance is fairly common in ecology, and it usually reflects an unequal distribution of classes within a dataset. Models built on imbalanced datasets will be constrained by its ability to predict rare and minority points. On the other hand, the predictive capabilities of the model are better by balancing the data compared with imbalanced data [28]. Therefore, whether to train on a balanced dataset does not affect the experimental results.  
**Evaluation Metrics.** To facilitate comparison with the baseline methods, we used different evaluation metrics. To be consistent with the SemEval competition, we used standard Acc and macro-F1. For the DV dataset, we used the five-fold cross-validation mechanism and used Acc and weighted F1. The formulas are as followings.  
\[macro-F1 =\frac{F_{p}+F_{n}}{2} \tag{10}\] \[Weighted-F1 =\frac{F_{p}*T_{p}+F_{n}*T_{n}}{T_{p}+T_{n}} \tag{11}\]  
where \(F_{p}\) and \(F_{n}\) represent positive F1 and negative F1, respectively. \(T_{p}\) is the total number of positive samples. \(T_{n}\) is the negative samples.  
**Implementation Details.** In our experiment, we augmented the dataset through the Google Translate API. The input sentence length was 128. For the CCM module, we randomly initialized the n-grams vector, and its dimension was 300. Then, we used the CNN with two layers of convolution kernels: 3 and 5, respectively. For the DSM module, we used BERTbase (\(L=12\), \(H=768\), \(A=12\), and \(total\,parameters=110\) M) where \(L\) is the number of transformer blocks; \(H\) is the hidden size; and \(A\) is the number of heads. The pyramid layer has three layers with 128, 64, and 32 hidden units. The adaptive fusion layer has 128 hidden units. There is a dropout layer after the adaptive fusion layer, and the dropout rate was 0.2. Finally, MSF was optimized by the Nadam optimizer where \(\beta_{1}=0.9\), \(\beta_{2}=0.999\), and the initial learning rate was \(10^{-4}\). The models were trained by a mini-batch of 16 instances. To prevent overfitting, we used an early stop in the training process.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Dataset** & **Total** & **Classes** \\ \hline OLID & 14,100 & OFF (33.23\%) \\  & & NOT (66.77\%) \\ \hline Davidson Dataset & 24,783 & Hate (5.77\%) \\  & & Offensive (77.43\%) \\  & & Neither (16.80\%) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Statistics of datasets.