## 6 Conclusions  
The aim of this research was a comparative analysis of the most used Machine Learning classification models against the state of the art in Deep Learning, represented by BERTweet, focusing on the automatic detection of toxic messages in social networks.  
Using NLP techniques related to sentiment analysis, different models such as Logistic Regression, Random Forest, Support Vector Machine and Transformer were trained on the same dataset.  
Comparing the results of the experiment shown in Table 6, the BERTweet model can automatically detect toxic tweets with a rate of 91.40% in terms of F1-Score, but at a high computational cost. In fact, Transformer requires powerful hardware to cope with the complexity of its architecture, such as the number of trainable parameters, and this fact is also reflected in terms of training and inference time as shown in Table 8.  
As a matter of fact, if we focus on the results obtained by the other methods, we can see that they all performed well, reaching values around or above 90% in terms of F1-Score and proving to be much faster both in terms of training time and inference time compared to BERTweet's performance.  
Furthermore, Figure 4 highlights how all models have the same ROC curve, so the performance of the classification model is almost the same at all classification thresholds. This shows that the Transformer does not offer much improvement in solving this task, as the performance gains are too small compared to the computational overhead.  
Methodology, M.M.-S. and J.V.-F.; Investigation, A.B. and J.V.-F.; Data curation, A.B. and J.C.T.; Writing--original draft, A.B., J.C.T. and S.P.; Writing--review & editing, J.M.V. and J.V.-F.; Supervision, M.M.-S., J.C.T., S.P. and J.V.-F.; Project administration, J.M.V. and S.P. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
Not applicable.  
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to privacy restrictions.  
This paper is the result of a research carried out by IDAL-Intelligent Data Analysis Laboratory of the University of Valencia, in close collaboration with the private company: Allot Communications Spain SLU, to develop an automatic detector of toxic messages in social networks. Allot needed to create an agile and fast tool, without excessive computational costs, to be included in its services. Our research was based on this guideline.  
The authors declare no conflict of interest.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Dataset** & **Cleaning** & **Training Time** & **Inference Time** \\ \hline LR & 1 & Lemma & 38 & 14 \\ RF & 2 & Lemma & 187 & 43 \\ LSA+SVM & 1 & Lemma & /* & /* \\ BERTweet & 1 & Cleaned & 11,192 & 5754 \\ LDA+LR & 1 & Lemma & 2247 & 573 \\ LDA+RF & 2 & Lemma & 3163 & 784 \\ \hline \hline \end{tabular}
\end{table}
Table 8: Computational time. To facilitate time comparison among different models, we divide the total time of training and inference tasks by the number of tweets of each dataset, so results shown in Training Time [μs] and Inference Time [μs] columns represent the average time of single tweet in microseconds. Regarding Transformer, the average training time is referred to as 1 epoch. * Time information about LSA combined with the SVM model could not be computed under the same conditions, since the virtual machine used for time measurements did not have enough computational capacity to run this model.