# Threatening URDU Language Detection from Tweets Using Machine Learning
###### Abstract  
Technology's expansion has contributed to the rise in popularity of social media platforms. Twitter is one of the leading social media platforms that people use to share their opinions. Such opinions, sometimes, may contain threatening text, deliberately or non-deliberately, which can be disturbing for other users. Consequently, the detection of threatening content on social media is an important task. Contrary to high-resource languages like English, Dutch, and others that have several such approaches, the low-resource Urdu language does not have such a luxury. Therefore, this study presents an intelligent threatening language detection for the Urdu language. A stacking model is proposed that uses an extra tree (ET) classifier and Bayes theorem-based Bernoulli Naive Bayes (BNB) as the based learners while logistic regression (LR) is employed as the meta learner. A performance analysis is carried out by deploying a support vector classifier, ET, LR, BNB, fully connected network, convolutional neural network, long short-term memory, and gated recurrent unit. Experimental results indicate that the stacked model performs better than both machine learning and deep learning models. With 74.01% accuracy, 70.84% precision, 75.65% recall, and 73.99% F1 score, the model outperforms the existing benchmark study. 22 September 202211 October  
have become prevalent on social media platforms. In this regard, several works are carried out for cyber-threat detection. For example, a cascaded convolutional neural network (CNN) is presented in [6] for the detection and classification of cyber-threats on Twitter. Similarly, a comprehensive overview of ransomware is presented in [7]. However, to address this issue on a larger scale on social media networks such as Twitter, more research efforts are needed. In addition, research works on offensive text detection, cyberbullying, and abusive language are carried out for high-resource languages like English. Automatic threatening language detection techniques on Twitter have extended outside the English language as well [8; 9]. Automated detection of threatening language is studied in other languages, and particularly Bengali, German, Dutch, Italian, Indonesian, and Arabic were the subjects of many research works [5; 10; 11]. To automatically identify threatening languages, these researchers looked into linguistic expertise and resources. Very little work is done for threatening language detection for low-resource languages like Urdu. [PERSON] et al. 's work [12] is the only significant effort for automated threatening language identification in Urdu [12]. To fill this research gap in the Urdu language, this study endeavors to build a stacking model for threatening Urdu language detection. In this regard, this study makes the following contributions:  
* For threatening language detection, we conduct a series of experiments employing machine learning algorithms such as the extra tree (ET) classifier, Bernoulli Naive Bayes (BNB), support vector classifier (SVC), and logistic regression (LR). In addition, deep learning models CNN, fully connected network (FCN), gated recurrent unit (GRU), and long short-term memory (LSTM) are utilized. * One of the main contributions in this study is the stacking of features for machine learning approaches. We propose a stacked feature vector based on preprocessed tweets and verbs extracted from preprocessed tweets. A stacking classifier is developed for threatening text detection for the Urdu language. The proposed models use ET and BNB as the base learners while LR is used as the meta-learner. * For machine-learning term frequency-inverse document frequency (TF-IDF) and bag of words (BoW) are employed for the construction of features, and embedding has been employed as feature vector deep neural networks. * To evaluate the performance of the proposed approach, accuracy, precision, recall, F1 score, and receiver operating curve (ROC) area under the curve (AUC) is used.