Privacy-Preserving Topic-wise Sentiment Analysis of the Iran–Israel–USA Conflict Using Federated Transformer Models
Discuss this preprint
Start a discussion What are Sciety discussions?Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
The recent escalation of the Iran–Israel–USA conflict in 2026 has triggered widespread global discussions across social media platforms. As people increasingly use these platforms for expressing opinions, analyzing public sentiment from these discussions can provide valuable insights into global public perception. Understanding how public opinion evolves during international conflicts is important for researchers, policymakers, and media analysts. This study aims to analyze global public sentiment regarding the Iran–Israel–USA conflict by mining user-generated comments from YouTube news channels. The work contributes to public opinion analysis by introducing a privacy-preserving framework that combines topic-wise sentiment analysis with modern deep learning techniques and Federated Learning. To achieve this, approximately 19,000 YouTube comments were collected from major international news channels and preprocessed to remove noise and normalize text. Sentiment labels were initially generated using the VADER sentiment analyzer and later validated through manual inspection to improve reliability. Latent Dirichlet Allocation (LDA) was applied to identify key discussion topics related to the conflict. Several transformer-based models—including BERT, RoBERTa, XLNet, DistilBERT, ModernBERT, and ELECTRA—were fine-tuned for sentiment classification. The best-performing model was further integrated into a federated learning environment to enable distributed training by preserving user data privacy. Additionally, Explainable Artificial Intelligence (XAI) techniques using SHAP were applied to interpret model predictions and identify influential words affecting sentiment classification. Experimental results demonstrate that transformer models perform effectively and among them, ELECTRA achieved the best performance with 91.32% accuracy. The federated learning also maintained strong performance while preserving privacy, achieving 89.59% accuracy in a two-client configuration. Topic-wise sentiment analysis further revealed that discussions about geopolitical tensions and political controversies generated higher negative sentiment, while topics related to leadership, religion, and peace showed comparatively more positive reactions.