An NLP Case Study on Predicting the Before and After of the U kraine– R ussia and Hamas– I srael Conflicts (2024)

Abstract: We propose a method to predict toxicity and other textual attributes through the use of natural language processing (NLP) techniques for two recent events: the Ukraine-Russia and Hamas-Israel conflicts. This article provides a basis for exploration in future conflicts with hopes to mitigate risk through the analysis of social media before and after a conflict begins. Our work compiles several datasets from Twitter and Reddit for both conflicts in a before and after separation with an aim of predicting a future state of social media for avoidance. More specifically, we show that: (1) there is a noticeable difference in social media discussion leading up to and following a conflict and (2) social media discourse on platforms like Twitter and Reddit is useful in identifying future conflicts before they arise. Our results show that through the use of advanced NLP techniques (both supervised and unsupervised) toxicity and other attributes about language before and after a conflict is predictable with a low error of nearly 1.2 percent for both conflicts.

## introduction in the past decade, social media has had a massive impact on how we communicate as a society in its ability to sway public opinion and shape political landscapes @xcite . in particular, the nature of the algorithms used in social networking platforms will oftentimes amplify extremist perspectives and provide users who hold these views a platform in which they can connect and share ideas @xcite . it is our hypothesis that through the use of natural language processing (nlp) we could potentially help avoid social media becoming a catalyst for conflict as it has in the past. in this study, we use nlp to examine interactions from social media on two well-known, recent conflicts: ukraine-russia and hamas-israel. we examine the role of social media in the emergence of both conflicts by gathering data from reddit foot_0 and twitter foot_1 and then segmenting the data into four main datasets based on date posted: (1) before ukraine-russia (2) after ukraine-russia (3) before hamas-israel and (4) after hamas-israel. we first reveal important insights on the segmented datasets using unsupervised techniques during development that lead to further exploration of predictive capabilities. for prediction, we use toxicity scores as a method of determining the type of language that leads up to and is used after a conflict begins based on the unsupervised results. by recognizing toxic language patterns leading up to a conflict, we can use these toxicity scores as a tool for avoidance-defined as a mechanism to prevent the escalation of a conflict by addressing or mitigating factors before they trigger or exacerbate a conflict. our findings show that avoidance through the use of state-of-the-art nlp techniques can be achieved on the two conflicts studied. to better illustrate our work we show that other work has not studied the more recent conflicts or used toxicity for prediction in section 2. we then illustrate the details of our dataset segmentation and methods in section 3. next, in section 4 and section 5 we provide results and discussion from our experimentation. finally, in section 6 we conclude with comments about achievements and next steps. ## related work when used as a source of information, social media platforms' user-driven model has been known to lead to self-reinforcing polarization, a method to shape specific narratives, and act as echo chambers containing negative rhetoric to describe political or social events @xcite @xcite as of this paper, research in the context of both the ongoing ukraine-russia and hamas-israel have not been compared. in the past, there has been investigations about the intricacies of toxic language on social media with the detoxify model @xcite @xcite , but many of this research identified toxic content that spanned a variety of categories, rather than focusing on discussions surrounding a potential or ongoing conflict. while previous literature observes public discourse of the ukraine-russia conflict through the use of latent dirichlet allocation (lda) for topic modeling @xcite @xcite , many of these are used in combination with sentiment analysis only to gain an understanding of the opinions of perception of users on social media platforms like twitter (now known as x). additionally, lda has also been used to observe russian state-sponsored accounts on twitter and their influence 2016 united states elections @xcite , and has been compared with alternative methods to estimate latent topics @xcite . other investigations of public sentiment surrounding the hamas-israel conflict have taken place using sentiment analysis prior to its beginning @xcite . likewise, @xcite utilizes an innovative keyword extraction framework on reddit posts created before and after the hamas-israel conflict, and the sentiment for a given comment was assessed using emotions like fear or sadness. our works compares two major conflicts on a before and after data segmentation. previous research has also been carried out by @xcite focusing on conflict prediction, but, to our knowledge, other work has not compiled the same corpora into four segmented datasets. additionally, we provide two major aspects of prediction: topic discovery and conflict prediction for avoidance as described in section 3. ## methodology in this section we focus on the data collection and preparation necessary to repeat our experiments along with the model preparation for both unsupervised discovery and supervised prediction for avoidance. the work is made publicly available foot_2 for others to consume with the aim of somehow "sounding the alarm" for future conflicts through social media. ## conclusion through the implementation of unsupervised and supervised machine-learning models, we have explored and observed how social media interactions can predict the escalation of two major conflicts. particularly in times of crisis, negative sentiments and extremist perspectives are amplified on platforms like twitter and reddit. furthermore, the limited regulation and addictive nature of these algorithms make these platforms effective tools for spreading misinformation and swaying public opinion, making them a catalyst for conflicts. with further fine-tuning and optimization, our models should have the ability to effectively predict a rise in toxicity in user interactions in real time. such improvements will help policymakers and social media platforms obtain a better grasp of the dynamics of social media leading up to and during a conflict. what is more, they can help in developing frameworks to mitigate hostility with customized content moderation, and even predict disputes before they can occur. in particular, prior knowledge of a conflict is pivotal as it gives policymakers or other leaders the opportunity to act appropriately, and even formulate the proper measures to maintain peace and prevent the escalation of violence.