Sentiment and Emotion Analysis with Large Language Models for Political Security Prediction Framework
Sentiment and Emotion Analysis with Large Language Models for Political Security Prediction Framework
Liyana Safra Zaabar,Adriana Arul Yacob,4 Authors,N. Razali
TLDR
The NRC Emotion Lexicon is used to label emotions in a political-domain social media dataset and TextBlob is used to extract sentiment polarity, identifying potential threats where anger and fear intensities exceed a threshold alongside negative sentiment.
Abstract
—The increasing spread of textual content on social media, driven by the rise of Large Language Models (LLMs), has highlighted the importance of sentiment analysis in detecting threats, racial abuse, violence, and implied warnings. The subtlety and ambiguity of language present challenges in developing effective frameworks for threat detection, particularly within the political security domain. While significant research has explored hate speech and offensive content, few studies focus on detecting threats using sentiment analysis in this context. Leveraging advancements in Natural Language Processing (NLP), this study employs the NRC Emotion Lexicon to label emotions in a political-domain social media dataset. TextBlob is used to extract sentiment polarity, identifying potential threats where anger and fear intensities exceed a threshold alongside negative sentiment. The Bidirectional Encoder Representations from Transformers (BERT) was applied to enhance threat detection accuracy. The proposed framework achieved an Area Under the ROC Curve (AUC) of 87%, with the BERT model achieving 91% accuracy, 90.5% precision, 81.3% recall and F1-score of 91%, outperforming baseline models. These findings demonstrate the effectiveness of sentiment and emotion-based features in improving threat detection accuracy, providing a robust framework for political security applications.
