EchoSense: A framework for Analyzing the Echo Chambers phenomenon: A Case Study on Qatar Events

The impact of social media on information exchange is profound, providing valuable access to public information, but it can also intensify negative eﬀects like cognitive bias, opinion extremism, and misinformation through the creation of echo chambers. These echo chambers, characterized by repeated information within closed systems, result from preferential exposure, homophily, and social impact. In this study, we present EchoSense, a framework that can conduct a comprehensive analysis of echo chambers on speciﬁc topics using both content and social network analysis and develop eﬀective strategies to address the impact of echo chambers on public discourse and democratic processes. The objective of our developed framework is to serve as a comprehensive guide for detecting echo chambers, with a particular focus on the issue of racial discrimination and worker conditions in the Qatar World cup of 2022, For this purpose, over one million tweets were collected and stored, spanning from January 2022 to the beginning of the World Cup in Qatar. Through this comprehensive analysis, we aspire to contribute to a better understanding of echo chambers while addressing polarization concerns within online communities.


Introduction
The advent of Web 2.0 technologies has unleashed a revolutionary era in communication, driven by the widespread adoption of social networking platforms such as Facebook1 , Twitter2 , Instagram3 , among others.This digital landscape empowers individuals to express their perspectives and ideas with unprecedented reach, fundamentally reshaping our age.The continuous flow of information via social network feeds has become the primary conduit for accessing a wide spectrum of news and opinions.The inherent structure of social networks allows users to engage with one another, selectively sharing their content.Within these platforms, virtual communities naturally coalesce, comprising of users who share common traits and engage in interactions such as friendships, likes, retweets, and mentions.
When considering the wide range of individuals, opinions and backgrounds in social media, it is important to recognize the potential for highly polarized groups (Bonabeau E 2019) to emerge within these virtual communities, giving rise to extreme viewpoints.This polarization poses significant risks (Goldner and Bloom 2023), a concern articulated by the World Economic Forum in 20134 , potentially impacting both the economy and giving rise to serious societal implications.It underscores the necessity for a comprehensive understanding of these dynamics and their potential consequences, as highlighted by (Pozzi et al. 2016) However, due to the complexity of the situation, solutions may prove to be incorrect and harmful.For example, depending solely on machine learning algorithms (and the scientists behind them) to discern the truth from the false is prone to bias and risky, with potentially dire results.This is due to the fact that individuals tend to consume information with content that most closely resembles their beliefs, rather than accepting views that contradict them, according to • theory of selective exposure (Dieter et al. 1988); which certainly aids the formation of polarized groups by allowing fake news to be deemed real news and based on • the concept that the emergence of echo chambers is expedited by social influence and the act of unfollowing (Chen et al. 2021).
Several strategies are used by social media platforms to provide tailored content to each user.Personalized search engines and recommendation strategies are primarily implemented to assist users in finding valuable information.Additionally, social media platforms facilitate connecting with and accessing information from others by emphasizing certain inherent, social, and psychological characteristics of individuals.Homophily, the principle that similar individuals are more likely to connect, and selective exposure, the tendency to seek out confirming information while rejecting conflicting information, are common traits in social media (Sasahara et al. 2019).
As a result of filtered information, personalized recommendations, homophily, and selective exposure, users tend to (i) receive information that aligns with their viewpoints and, in extreme cases, (ii) be confined within chambers surrounded by like-minded individuals.These phenomena are commonly referred to as filter bubbles and echo chambers.
Filter bubbles (Pariser et al. 2011;Bozdag et al. 2015) are primarily associated with the proliferation of technologies, such as personalized search and recommendation strategies, that filter and prioritize the information users see (Davies et al. 2018).These technologies present users with only what is deemed "relevant" or "of interest" based on their preferences, effectively placing them in a bubble where they are exposed to only a portion of the available information.This may present a challenge to democratic principles and the accessibility of a broad spectrum of information.
Acknowledging the challenge that echo chambers may pose to democratic principles (Guilherme A Russo et al. 2022) and well-informed public discourse, it is essential to address their implications in specific, impactful contexts, it is crucial to tackle their implications in particular, impactful situations.In light of this, we turn our attention to the discussions surrounding the living conditions of workers in Qatar on the Twitter microblogging platform.This case study holds particular significance owing to profound global influence on social and human rights, as noted by (Paul Brannagan et al. 2022).These conditions have ignited widespread concerns within the international community, making them a pertinent subject of analysis.
In an era where social media platforms, personalized search algorithms, and recommendation systems are playing an increasingly influential role in shaping public opinion, echo chambers pose a substantial challenge.As Flaxman et al. 2016 have highlighted, these chambers limit information diversity, reinforcing preexisting beliefs and opinions within homogenous groups.In this study, we conduct an analysis of tweets related to the Qatar workers' living conditions, with a dual purpose in mind.Firstly, we aim to assess the extent to which echo chambers may be at play in these online discussions, potentially contributing to polarization and controversy.Secondly, we seek to gauge the effectiveness of our proposed approach in addressing these challenges.Through this research, we endeavor to provide insights and strategies that may serve as a model for mitigating echo chamber effects in critical, real-world conversations.
By taking a first deep dive into the living conditions of the workers in Qatar (Amnesty International 2019), our main objective is to evaluate our approach and the treatment of the echo chambers we created and detected.In doing so, we try to decipher how these distinct groups were created on Twitter, how they spread information.
In order to grasp the prevailing public sentiment and behavioral tendencies surrounding the Qatar events, as well as to address the ensuing research inquiries, this investigation will analyze Twitter data pertaining to the circumstances endured by the labor force in Qatar.
• RQ 1 : How can echo chambers be effectively addressed controversy, specifically in discussions pertaining to the working conditions of laborers in Qatar?• RQ 2 : Can sentiment analysis of user-generated content associated with events in Qatar?• RQ 3 : Can graph theory and Social Network Analysis provide insights into the formation of echo chambers?
• RQ 4 What were the major challenges in the development of the EchoSense framework?• RQ 5 What are the most popular topics in events held in Qatar?
The study presents a methodological framework for the examination of echo chambers in a dataset comprising tweets centered around the Qatar events, spanning the timeframe from January 2022 to December 2022.A significant innovation lies in the creation of a new dataset5 specifically tailored to the Qatar events.This novel dataset enhances the social network analysis by providing unique insights into public sentiments during this period.The primary objective is to systematically address research inquiries pertaining to the elucidation of public sentiments concerning the aforementioned events, thereby fostering a more nuanced comprehension of the prevailing attitudes towards the conditions faced by Qatar's workers.This work draws inspiration from the (Garimella et al. 2016) prayer, which meticulously quantifies the initial controversy within social media accounts.

Related work at Echo chambers field
The study of echo chambers is a relatively new area of research, primarily driven by the widespread adoption and usage of social media platforms in recent years.As these platforms have expanded and garnered significant user bases, there has been a growing interest among service providers to engage as many individuals as possible.Consequently, the exploration of echo chamber identification has been relatively limited, given the evolving nature of the digital landscape In this particular scenario, we assume that a polarized state has already emerged or is currently unfolding, leaving us in a potential "faith accomplished" situation.Therefore, the accurate and timely identification of echo chambers becomes crucial.
However, in order to verify the actual presence of echo chambers, it is possible to define a series of 'steps' that together form an identification pipeline (Garimella et al. 2016), which will be detailed in Sect.3.4.In particular, they concern: • Graph construction: this phase is perhaps the most important as it prejudges, as the first stage, all future activities.Data modelling, in order to define a graph, can follow different paradigms and be based on different aspects and factors (e.g.retweets, tags, replies, comments, followers/followers, quotes).At this stage, one then goes on to define the social network representing the interactions between users, whatever these may be.• Partitioning of the graph: the partitioning of the graph is nothing more than the activity of Community Detection, with the constraint related to the number of communities.Once the two partitions have been defined, it is necessary to understand whether there are actually polarisations, which is the task of the third step.• Controversy measurement: The last step in the pipeline, the controversy measurement aims to check whether the two identified communities can be defined as echo chambers or not.It is therefore an assessment of the level of polarisation.
Other researchers, such as (Coletto et al. 2017), have delved even deeper into the structuring and interaction types within social networks associated with echo chambers.Their work involves multiple graphs for each topic, collected from various pages in domains like news, politics, gossip, and entertainment.Twitter was chosen as the data source due to the accessibility and streamlined organization of data.
In the study by (Coletto et al. 2017) , the discussion threads were reconstructed by crawling the responses to initial tweets, which served as the root posts.The depth of the discussion, represented by the k-value, ranged from 2 to 10, including the author of the post.The collected data were manually assessed to determine if they contained potentially controversial content.The labeling criteria considered a topic as controversial if the expressed opinion was deemed personal or subjective within the given context.
Another notable scientific perspective, which revolves around the concept of graph partitioning, was put forth by (Lanchineti A and Fortunato S 2009).Their work underscores the significance of "network science" within the realm of complex systems over the past decade.This is particularly relevant considering that numerous intricate systems, such as social networks, can be effectively depicted as networks or graphs.In this representation, the fundamental constituents of a system and their interconnections are captured by nodes and arcs, respectively.This approach allows us to dissect the underlying structure and interactions within these systems, offering a profound insight into their behavior and dynamics.
In other scienftific approaches, case studies was content based (Mejova et al. 2013).This approach has various constraints stemming from the vagueness of language and the tendency of models to rely heavily on specific languages and subjects.
Similarly, our study aligns with recent research conducted by Garimella and colleagues (Garimella et al. 2016), wherein the shared goal is the precise identification of controversies through an analysis of network structures.The distinctive contribution we bring to the social network community lies in the introduction of a novel dataset, will be described in Sect.3.1.It is noteworthy to acknowledge a limitation in their approach, specifically the implicit assumption that a given topic consistently polarizes the network.

Methodology
In this section we present the comprehensive end-to-end architecture of our framework, beginning with the initial step of acquiring data through the Twitter API6 .Subsequently, we employ graph partitioning and community detection techniques, and conduct an extensive analysis in these areas.Furthermore, we proceed to implement specific measures within the identified networks, aiming to quantify the level of controversy associated with different topics or discussions per Fig. 1, following the flow pipeline.

Twitter as a source of data
For the purposes of the study and for accomplishing the goals of the current study (RQs), a Twitter crawler was developed implementing the Twitter API, due to useful information from Campman (2018), and the Python library called Tweepy7 .Table 4 presents the research questions (RQ 4 ) addressed in this study, along with the features extracted from posts and the metrics used to evaluate controversy.The crawler was designed to extract various features for the users and the tweets espectively from Twitter data, including retweets, likes, replies, followers, impressions, and engagement rate and some other metrics for the users.By leveraging the functionalities provided by the Twitter API and the capabilities of Tweepy, the crawler was able to collect comprehensive information about tweets and user interactions.The API integration allowed access to real-time data and ensured compliance with Twitter's terms of service.
By leveraging the functionalities provided by the Twitter API and the capabilities of Tweepy, the crawler was able to collect comprehensive information about tweets and user interactions.The API integration allowed access to real-time data and ensured compliance with Twitter's terms of service.
The application of Tweepy library mostly facilitated the data collection process by providing a streamlined interface for interacting with the Twitter API.By incorporating the Twitter crawler and leveraging the capabilities of Tweepy, this research was able to analyze and derive meaningful conclusions based on a comprehensive set of features retrieved from the Twitter platform.The data were

Username
The unique identifier of the Twitter user.

Mentions
Usernames mentioned in the tweet.@user1, @user2 Quotes The number of times the tweet has been quoted by other users.

5
Verified Indicates whether the user is a verified account (blue checkmark).

Yes/No
Tweet-based Information

Date
The date and time when the tweet was posted.

Tweet Text
The actual content of the tweet.ARGENTINA -FRANCIA FINAL (Doblete), Mundial Qatar 2022

Replies Count
The number of replies the tweet has received.

Retweets Count
The number of times the tweet has been retweeted by other users.

Likes Count
The number of likes (favorites) the tweet has received. 100

Hashtags
Hashtags included in the tweet for topic categorization.
#Qatar, #Worldcup, #Boy-cottQatar2022 collected based on the different hashtags used; #hashtags are widely used by Twitter users as a 'label' and are placed directly on the shared tweet.Hashtags make it easy to identify a particular topic.The microblogging platform Twitter enables the creation of brief messages, or tweets, which are limited to 280 characters in length.These tweets can be categorized as follows: • Regular tweets: These are messages shared on Twitter that can include text, images, GIFs, and videos (RT).• Mentions: Tweets that incorporate the username of another Twitter account, preceded by the "@" symbol (MT).• Replies: Replies made to tweets that were originally posted by someone else (RL).
• Quotes: Reposting a tweet with accompanying personal commentary (QT).
Moreover, Twitter enables users to follow the tweets of one another.Generally, this permits the creation of a conversation network using data from Twitter, incorporating details regarding mentions, replies, retweets, or the follower/followee connection.Unlike prior studies that primarily concentrated on the latter connection type (as described in Garimella et al. 2016), our approach emphasizes the mention / quote connection.This is because we aim to highlight how content explicitly contributes to forming social interactions.
The twitter dataset that was created was associated with the Qatar events.It includes different features for the tweet text and for the user.In this study, the dataset under consideration exhibits a structured format with dimensions of (1,098,234, 10), implying 1,098,234 data points across 10 distinct columns.These columns encompass essential attributes, including these fields that illustrated in Table 1.The novel dataset that we made, includes all 1,098,234 tweets.The dataset consists of tweets collected based on hashtags mentioned in the Qatar workers condition and totally for the situation in the country this period.We created a list of hashtags that were quite popular on twitter during and before the world cup, as illustrated in

Getting historical tweets via Academic API
In this study, we wanted to assess how well these data collection methods would work when handling a subject with a significant influx of tweets (Chen et al. 2022;Salvatore et al. 2021).This inquiry took place during the events surrounding the 2022 World Cup in Qatar.We search for the 5 different terms as appeared in Table 2, via the v1.1 endpoint.Disregarding the predefined time constraints and script limitations for tweet retrieval, we initiated multiple requests to the aforementioned endpoint to acquire data.We intentionally set a higher limit on Twitter to expedite the process, aiming for a rapid yield of 500 tweets per request at a maximum rate of 500 tweets per second.This approach enabled us to amass 1 million tweets within a span of 33 minutes.
Following each request and the retrieval of 500 tweets, we systematically stored them in a MongoDB cluster8 , specifically in the MongoDB Atlas platform, within a collection named "Qatar events." Regarding for the (RQ 4 ), one noteworthy aspect of the Academic API (Wang et al. 2015) accommodation for researchers gathering data with a time lag rather than in real-time.As demonstrated in the previous section, a substantial portion of tweets tends to disappear over a ten-year span.In this section, we will delve into the initial hours and days immediately following the posting of tweets (Kim et al. 2020).Additionally, we will examine the longer-term decline in tweets, which conforms to a straightforward exponential decay model.
Illustrated in Fig. 2 is our state-of-the-art setup for data collection.Our search parameters were designed in such a way that we could, to the best of our knowledge, capture all tweets posted within a specific second.Our data collection spanned from January 1, 2022, at 12:00:00 am to December 31, 2022, at 11:59:59 pm UTC.To avoid any bias associated with individual time zones (Eriksson and Lindgren 2022), we consistently collected data from the same second on Twitter every hour for a 24-hour duration.Notably, data collection occurred 10 seconds after the commencement of each hourly time window, a necessity dictated by API limitations.
The iterative procedure involving concurrent requests commenced alongside the validation of data within the preexisting collection established on the initial day (day 0 ), as illustrated in the accompanying figure.This process persisted throughout subsequent days, including day 10 , and concluded on the final day of the year, December 31 (day 364 ).

Data pre-processing
In the subsequent stage of the establishment and storage of the Qatar events dataset in MongoDB Atlas , we incorporate a valuable tool known as the Natural Language Toolkit9 , or NLTK in short.NLTK serves as a versatile toolkit for the manipulation and understanding of natural language data.In our context, NLTK proves particularly useful due to the integration of the Vader Lexicon, a rule-based approach for sentiment analysis.
Incorporating the Vader Lexicon10 within the NLTK framework enables us to analyze the sentiment of textual content.This specialized tool operates based on predefined rules and patterns to gauge the sentiment expressed within the text.Specifically, the Vader model is an integral component of the NLTK package, offering a direct and efficient way to analyze text with existing labels.
In the subsequent phase of data preprocessing and textual analysis, our focus is on refining the dataset to exclusively include elements pertinent to our analytical objectives.To this end, a systematic approach is employed to eliminate components that do not contribute meaningfully to the analysis.These encompass URLs, emojis, hashtags, punctuation marks, stopwords, and numerical entries.
Starting with URLs, these web addresses are extraneous in the context of text analysis.Therefore, they are methodically removed from the dataset to streamline the corpus.Likewise, emojis, which are pictorial representations, are excluded since they do not align with the textual nature of the analysis.By removing emojis, we ensure the integrity and relevance of the textual content under examination.
Additionally, hashtags, often used for categorization and indexing, are excluded from the analysis.Punctuation marks, while aiding grammatical structure, are devoid of intrinsic analytical significance.Consequently, they are expunged to isolate the textual essence for closer examination.
Further enhancing the quality of the dataset, stopwords-commonly occurring words with limited analytical value-are eliminated.These words, such as "and," "the," and "is," often contribute little to the substantive meaning of the text and thus are systematically removed.Furthermore, numerical entries, which lack the linguistic nuance present in textual content, are excluded from the dataset.This step ensures that the focus remains on the qualitative aspects of the text rather than numerical quantities.

Graph Theory Fundamentals
Considering the nature of the research conducted within this study, it is imperative to represent the potential data for the proposed analyses and studies in the form of a graph.A graph, denoted as G (Alan Bickle 2020), is comprised of a collection of elements referred to as nodes or vertices, which are interconnected through lines known as arcs, sides, or edges.Formally, a graph G can be defined as a pair of sets (V, E) where V represents the set of nodes V = {v 1 , v 2 , v 3 , . . ., v n }, and E represents the set of arcs, which is a subset of the Cartesian product V × V , denoting pairs (vi, vj) where v ij ∈ V (Jonathan L. Gross and Yellen J 2003) The presence or absence of a particular property gives rise to two distinct types of graphs: • Non-oriented (or undirected) graphs: A graph G = (V, E) is considered nonoriented (or undirected) if and only if the relation E is symmetrical (Jonathan L. Gross and Yellen J 2003).
In a directed graph, the direction of the edges carries significant meaning, establishing an order or direction of traversal.On the other hand, an undirected graph is more flexible, allowing movement in any direction as long as there is an edge connecting the nodes.

Network creation
Concerning the (RQ 3 ), as depicted in Tab. 4, in our social media analysis framework, we create an edge between two users if UserA has quoted, mentioned or replied a tweet of UserB or vice versa.
The collected data already refer to the giant component, i.e. the largest connected component; the structuring of the data is as follows: userA, userB, ..., userN, weight (1) Each created edge has an associated weight that is the sum of the number of interactions between the two users.One interaction (a tweet QT / MT / RL11 ) in any direction (userA→userB or userB→userA) adds 1 to the weight of the edge.
We then have the (unique) usernames of the users and the total number of QT / MT / RL between the two.It is assumed that there is no sense of reading regarding the connection between the users since, taking any pair of users at random regardless of the associated weight, there will only ever be userA, userB weight and never userB userA weight; it is therefore assumed that the weight is given by the number of retweets between the two users in a certain observation period.
In the graph representing the social network, each node represents an individual user and will be labelled with that user's unique username; each arc represents the To narrow our attention to the most substantial part of the conversation graph, we chose to include only those edges with a weight equal to or greater than three.This criteria led to a selection of approximately seventy-five thousand edges.To visually illustrate the outcome, we generated a graphical representation of this graph using Gephi12 , which is depicted in Fig. 7 We now proceed to a detailed analysis of such modelling, given the possible case studies: In the event that a user does not quote anyone else, a self-loop arc will be created given the user.A user, hence a node, may have both outgoing arcs to other users,incoming arcs from other users and self-loop arcs.In the case of a single quotation, an arc will be created oriented according to the quotation, the arc itself will be enriched with all information about the tweet itself.In the case of more than one citation, n arcs will be created where n is the number of users cited.Each arc will contain information the mention or the quoted that a user made to another.
In the representation of the Qatar events graph, the vertices labeled as v i symbolize Twitter users who are engaged in discussions related to the Qatar events.Within this graph, the edges labeled as e i depict instances where users mention or quote each other in their conversations about the Qatar events.Notably, the graph is constructed to be undirected, meaning the connections are two-way, and it is also characterized by simplicity in nature, meaning there are no situations where a user is connected to themselves or where multiple identical connections exist between the same users.Additionally, the graph incorporates weights, and in this context, the weight w t , assigned to an edge corresponds to the frequency of mentions exchanged between the two linked vertices.The network creation is appeared in the Fig. 4 Fig. 4: user-tweet schema graph

User tweet Activity model
In Sect.3.3, we describe the process of constructing directed graphs, denoted as G k (V, E), where V represents the vertex set comprising all network users, as illustrated in Fig. 4, E is the edge set, and k belongs to the set {M T, QT, RL}.We establish directed edges from node v i to v j if user i engages in actions such as mentioning or quoting or reply to a user j, referring to the content presented in Fig. 4. A reply edge denotes a connection from a user (denoted as 'u') to a tweet (denoted as 't') authored by that user.Conversely, a quote edge represents a linkage from a user ('u') to another user who follows them.A mention edge signifies a connection from a tweet ('t') to a user ('u') engaging in a commentary on that tweet.Additionally, a quote edge is established from a tweet ('t') to another tweet, whereby a user("u") comment another's users tweet with his additional information.The user-tweet interaction model, depicted in Fig. 5, encompasses user nodes, tweet nodes, and three distinct types of edges.

Fig. 5: user-tweet interaction model
The following Table 3 provides a comprehensive overview of the precise node and edge counts within the graph following an extensive data preprocessing and cleaning procedure.The resulting graph is characterized by a substantial presence, consisting of a total of 214,512 nodes and 186,944 edges.Moreover, this table also encompasses a valuable measure of user influence, which is derived from the examination of user degrees within the network.It allows us to identify the most prominent users who exhibit the highest degrees of connectivity within the network, thereby shedding light on key influencers in the analyzed dataset.More information about Qatar events network in: Qatar events information 1 This signifies that the node is denoted by the user 'rawnaq maldives,' whose account lacks the verification status.
2 The edge originating from 'rawnaq maldives' and connecting back to itself is classified as a self-loop, which occurs when 'rawnaq maldives' initiates either a Mention (MT) or a Quote Tweet (QT) directed towards their own account, specifically targeting the user 'rawnaq maldives'.This procedure was executed twice, and as a result, the cumulative weight is computed as 2.

Enhancing the Graph with Meaningful Semantic Data
As briefly outlined in Sect.3.7, within the field of community detection algorithms, several approaches have endeavored to incorporate diverse semantic elements pertaining to content.In this research, we introduce the concept of "enriching" the mentions-based representation of the conversation graph by infusing it with this semantic information.Specifically, we focus on modifying the weights assigned to the edges connecting vertices within the graph.
Our approach involves substituting the original edge weights, denoted as "w t " with new weights meticulously designed to encompass not only topological aspects but also content-related semantic dimensions.Drawing inspiration from prior work (Natarajan et al. 2013), we consider three crucial components, as well as we will explain ( §3.6.1, 3.6.2,3.6.3): • Sentiment Analysis: Assessing the emotional tone of the tweets.
• Topic Analysis: Identifying the specific themes discussed in the tweets, such as workers' living conditions, stadium construction, government policies, and related subjects within the broader context of Qatar.• Hybrid Approach: Combining both sentiment and topic analysis to provide a comprehensive understanding of the content's semantic nuances.

Sentiment-based modeling
In the context of this modeling framework, we seek to ascertain a sentiment score for each user derived from their individual tweets.Subsequently, these sentiment scores are employed to modulate the weights associated with edges connecting users in a graph, particularly one structured according to topological relationships (Felice and Clementini 2018).
To provide a formal definition, let us consider a vertex denoted as "v" within this graph.This vertex v has contributed to the platform by composing a series of tweets, totaling "t" in number, all of which were generated during a discrete time interval confined to the integer range of [-α, +α] 13 .These tweets have been subjected to sentiment analysis using a predetermined technique, resulting in a set of sentiment scores, namely x1, x2, x3, and so forth.
Our objective is to calculate an aggregate user sentiment score, denoted as "s(v)" for vertex v, as illustrated in the Eq. ( 2).This composite sentiment score encapsulates the overarching sentiment exhibited by this user over the specified time interval: This computed user sentiment score (Fang and Zhan 2015), s(v), plays a pivotal role in the adjustment of edge weights within the graph.Specifically, it serves as a metric to gauge the extent to which this user's interactions with other users, already linked within the network, are influenced by the sentiments expressed within their tweets.

Topic Analysis
One of the most widely utilized and applied techniques in topic modeling is Latent Dirichlet alocation (LDA), introduced by (Blei D et al. 2003).The fundamental premise of this model is as follows: each document consists of multiple underlying topics, each topic is represented as a distribution over a collection of words, each document can be regarded as a mixture of terms associated with various potential topics, and a given word may pertain to more than one topic.
In this context, a topic is conceptualized as a probability distribution of words (referred to as W 1 to N ) across a vocabulary, where the vocabulary comprises a predefined set of words used to represent the entire corpus of documents.Various statistical distributions are used to mathematically characterize LDA and, more broadly, topic modeling techniques.

Hybrid Approach
Hybrid modeling (Shoeibi N et al. 2022) involved combining the sentiment-based and topic-based approaches by assigning a new weight.The goal was to distinguish users who discussed the same topic but had different sentiments, while also bringing together users with similar topics and sentiments.The goal of this modeling approach is to create a distinction, or "distance," between users who express differing sentiments while discussing similar topics.Conversely, it aims to bring together users who share the same topics and exhibit similar sentiments.The purpose is to foster a sense of connection and similarity among users with shared sentiments, and to identify and highlight the contrasting viewpoints among users with differing sentiments.
In hybrid modeling, an additional weight called the "Hybrid Weight" was defined.This weight was used in community detection activities and was a combination of the similarity measures previously defined for sentiment and topics: In this weight modeling approach, if v i and v j are completely dissimilar in terms of the sentiment expressed in their tweets and the topics they discuss across the entire set of topics (i.e., ss(vi, vj) = 0 and ts(v i , v j ) = 0), the w h weight (which replaces the wt weight in the mentions-based modeling) will be equal to 1.This value indicates the presence of a topological link, implying that there is a connection between v i and v j in the graph, regardless of their dissimilarity in sentiment and topics.

Restructuring the Graph through Partitioning: An
In-Depth Analysis The identification of an optimal algorithm for community detection (Javed M Aqib et al. 2018) was rendered difficult by the fact that the graphs on which these algorithms had to be applied had a considerable size, which meant that the computation time could be significantly increased; furthermore, most of the algorithms did not allow the number of communities required to be defined, rendering many algorithms useless with respect to the problem under consideration, as it was necessary to impose a value of two for the communities sought.The constraint of two communities may introduce bias (Wald C and Pfahler L 2023), given the identification operations of the communities, as it forces each node to belong to one of the two communities; in fact, one may think one is generalising and losing information by imposing a certain value.
The studies by Garimella et al. (2016) also raise and discuss this issue, again in which justifications are provided by pointing out how, in the political debates underlying the studies and in general with regard to certain controversial topics, it is always possible to identify two great opposing visions, which in the political sphere, for example, identify the two great political universes of left and right.
A scenario with smaller echo chambers has reason to exist but is less likely to appear, because users, on social media platforms, tend to select statements that adhere to their belief system and ignore dissenting information.The consequence of this process could be a kind of maximisation of homogeneity, which is better represented by two almost disjointed communities rather than several fragmented groups.
Modularity (Q) is a measure of the quality of the community structure in a network.It is defined by the equation: In this equation, A ij represents the presence of an edge between nodes i and j (where A ij = 1 if there is an edge and A ij = 0 otherwise), k i and k j represent the degrees of nodes i and j, respectively.The parameter m represents the total number of edges in the network, c i and c j represent the communities to which nodes i and j belong, and δ(c i , c j ) is the Kronecker delta function, defined as: 1, if c i = c j (nodes i and j belong to the same community), 0, otherwise.
In the context of the Qatar events graph, as discussed earlier, we explored four distinct representations: mentions-based, sentiment-based, topic-based, and hybrid.Within each, a community detection algorithm was employed.Our objective was to identify an algorithm capable of distinguishing two distinct factions within the online community.This selection aimed to emphasize strong speech polarization.In pursuit of this goal, we initially assessed various approaches.
The initial method was dismissed as it often proved unsuitable for practical real-world network data applications.Additionally, the efficiency was compromised when dealing with networks of a large and dynamic nature, as discussed by Newman (2006).The second approach was rejected based on our initial experiments, which indicated sensitivity to the initial selection.Varying the starting point for the partitioning process, determined by different seeds, led to substantial variations in the final outcomes.
The METIS process involves three main steps: • Reduction: Graph size is progressively decreased, preserving important connections and aggregating vertices using a heavy-edge matching method.• Partitioning: The graph is divided into two roughly equal parts, ensuring minimum weight cuts are retained .• Growth: The partitioning is projected back onto the initial graph, with improvements and refinements using partition refinement algorithms.

Assessing Polarization Dynamics
This section focuses on metrics for quantifying disputes in previously introduced graphs, crucial for community detection outcomes.Metrics, influenced by the Random Walk algorithm 2020, are intricately linked with data from the enhanced graph.They play a pivotal role in elucidating genuine controversies within identified partitions 2013.Random Walk Controversy (RWC) assesses controversy in discussions by employing random walks on a graph ((Garimella K, Morales F, Gionis A, Mathioudakis M, 2016)).It measures the likelihood of a random user from one community encountering content from an authoritative node in the opposing community.The metric (RW C ) quantifies controversy by examining probabilities of random walks within and between partitions: (5) Here, P XX and P Y Y represent probabilities of random walks staying within their partitions, while P XY and P Y X represent walks transitioning between partitions.The metric ranges from -1 to 1, indicating the presence or absence of controversy 2016.
Change Side Controversy (CSC) is another metric in this study, also rooted in the concept of Random Walk.Differing in approach, it selects 60% of vertices from each partition, calculates the average shortest path, and multiplies it by two.This value dictates the length of the subsequent Random Walk for each node.
Therefore, we have a set N of nodes from which the evaluation will begin.The measure of controversy is then quantified as follows: Here, lG is the average shortest path for the graph G, and κ ( v) is the steps in the Random Walk from vertex v resulting in the destination node belonging to a different community.The metric ranges from 0 to 1, with higher values indicating less community change during the Random Walk, helping assess segregation or interaction between communities within the graph.
Boundary Connectivity(BC).The last metric used in the paper by Garimella et al. (2016), should be attributed to Guerra et al. (2013).The measure is based on the concept of "internal vertices" and "frontier." Let us deliberate upon this matter a vertex u ∈ X in the partition X.This vertex u belongs to the "frontier" if and only if it is connected to at least one vertex in partition Y and at least one vertex in partition X that is not connected to any vertex in partition Y. Consequently, the set of "frontier" nodes is defined as B = Bx ∪ BY , while the vertices in I X = X − B X are referred to as the "internal vertices" of partition X (similarly, we define the "internal vertices" for partition Y as well).The set of "internal vertices" is denoted as The metric introduces terms "d i (u)" and "d b (u)", representing the edges between vertex "u" and sets I and B, respectively.

Results & Discussion
In this section, we present the outcomes of various state-of-the-art evaluations related to distinct aspects of our proposed approach for identifying echo chambers within the Qatar events graph.Initially, we provide statistical insights into the community detection task conducted on the four graph representations as defined in Sect.3.7.The comprehensive information extracted from Research Questions (RQs) is detailed in the following table, referenced as Tab. 4. Subsequently, we present the findings concerning the quantification of controversy among partitions, utilizing the measures explained in Sect.3.8.Finally, we present results pertaining to the qualitative analysis of the users, tweet sentiments and topics within the identified partitions, as briefly introduced.

Community detection partitioning
The outcomes presented in this section entail a rigorous quantitative examination of how the members within the Qatar events graph are partitioned.This partitioning process was accomplished using METIS and was applied to four distinct graph modeling approaches: (i) mentions-based (MB), (ii) sentiment-based (SB), (iii) topic-based (TB), and (iv) hybrid (H).Furthermore, the graphical representation of the partitioning results for members associated with the two identified communities, specifically referred to as Community 0 and Community 1, is visually depicted in the accompanying figure.
Concerning the modifications to Research Question 2 (RQ 2 ), conducting partitioning analysis using the METIS algorithm across four distinct graph modeling approaches, namely mentions-based (MB), sentiment-based (SB), topic-based (TB), and hybrid (Sect.3.6), we observed noteworthy differences in the distribution of community members.Notably, in mentions-based and sentiment-based approaches, Community 0 exhibited higher percentages, namely 57.9% and 60.5% (Fig. 6a & 6b), respectively, in contrast to the hybrid and topic-based methods, where the proportions of individuals in the two communities were approximately equal as depicted in the table below.
These variations can be attributed to the inherent characteristics of the dataset and the methodologies employed.In mentions-based partitioning, the structure of the network and the connections among nodes play a pivotal role.Hence, nodes with higher degrees or stronger connections tend to be grouped together, leading to more pronounced community boundaries.This is particularly evident in cases where certain users exhibit extensive interactions or connections within the network, causing them to gravitate towards specific communities.Similarly, users who share strong emotional affiliations or sentiments are more likely to be grouped together.Consequently, if a subset of users within the network expresses notably strong sentiments or affiliations, it can result in higher percentages in certain communities.
In the context of this research investigation, we introduce an enhanced rendition of the previously generated graph, originally crafted using Gephi (Fig. 7).However, in the updated version, we have employed a hybrid modeling approach, resulting in the emergence of two clearly distinguished and nearly evenly populated communities, as evident from the visual representation depicted in Fig. 6d.

Users behavior
In the realm of social network analysis, users within a network can be categorized into two distinct types: "out-degree" and "in-degree" users.(Lina Gomez-Vazquez et al. 2019), regarding to the Research question 2 (RQ 2 ), as illustrated in the Tab. 4. "Out-degree" users are those who actively engage in posting content, which may include tweeting, retweeting, or tagging other users.These individuals demonstrate a high level of engagement and awareness of others in the network, often sharing and disseminating information to a broader audience.
Conversely, "in-degree" users encompass individuals who are frequently tagged or mentioned / quoted in tweets by other users.These users tend to receive attention and references from their peers within the network (e.g.@Bragantinook 98 ARGENTINA -FRANCIA FINAL (Doblete), Mundial Qatar 2022 https:// twitter.com/Bragantinook/ status/ 1703329141754310852 ).In this example the user, Bragantinook 98 is tagged in the message with the @ symbol.In-degree, users tend to be popular, showin prestige and prominence.The most recurrent posters(out-degree) and mentioned users (in-degree) were both new media football-related platforms, like fifaworldcup & fifacom, and football organizations.Figure 8 indicates the most in-degree users on the network.
In the presented bar plot (Fig. 8), we examine the degrees of user engagement within a Qatar dataset on events in Qatar.Notably, two prominent users, 'fifacom' and 'fifaworldcup' stand out with exceptionally high degrees of 5.8k and 6.2k, respectively.These users are evidently central figures in discussions related to Qatar's events.Their substantial degrees reflect their influential roles in disseminating information and engaging with the Qatar-related content.
Among the remaining top-10 users, names such as 'abediqbal', 'england' ,'usmnt' feature prominently.These users, while not reaching the same degree levels as 'fifaworldcup' and 'fifacom' still command significant influence within the dataset.

Verified VS unverified users
Another noteworthy aspect of qualitative evaluation pertains to the concept of homogeneity and, in particular, the potential disparity in the trustworthiness of information exchanged within the conversation graph.An avenue for assessing this reliability involves the identification of the count of users within each community who possess a verified account.
In general practice, a verified account signifies that the platform has verified the authenticity of the account14 .This verification serves as an indicator that the account holds an official status, thereby making it more likely to be deemed trustworthy in accordance with the reputation heuristic.
Furthermore, the verified marker also conveys that the verified account has established a positive reputation.In fact, to attain the esteemed status of a "verified account" on Twitter, it is mandatory to demonstrate that the account is of significant "public interest"15 .Verified accounts are known to, on average, amass a considerably larger following than non-verified accounts.Consequently, tweets originating from these verified accounts enjoy a greater likelihood of being retweeted or liked, both of which serve as indicators of widespread endorsement.
As depicted in Fig. 9, the proportion of verified accounts within Community 1 exhibits fluctuations, ranging from 29% to 30% (Fig. 9b) of the total account population.In contrast, Community 0 registers a substantially lower percentage, with only 4% of accounts (Fig. 9a) being verified, particularly under the sentiment representation.
Furthermore, an additional qualitative analysis was undertaken, focusing on the average sentiment expressed by verified users within each partition.As illustrated in Fig. 10, verified users belonging to Community 0 tend to exhibit a more negative average sentiment, whereas their counterparts in Community 1 tend to have a comparatively more neutral sentiment disposition.

Wordclouds of user descriptions
In this rigorous qualitative analysis, our focus has been directed towards the examination of Twitter account descriptions associated with users from the two distinct communities.Within this investigation, we meticulously extracted the pivotal keywords employed by users to articulate their beliefs and perspectives.These discerned keywords have been meticulously presented in the form of word clouds.It is imperative to underscore that these word clouds encapsulate the linguistic expressions of the average user, providing a comprehensive glimpse into the prevailing sentiments, values, and viewpoints within each community.Fig. 11 refers the wordclouds for an average user under sentiment based approach that has the highest controversy results.
The word cloud for Community 0 (Fig. 11a) indicates a diverse range of interests.Firstly, There is a discernible emphasis on cryptocurrency and blockchain-related topics, as evidenced by keywords like "dogecoin," "binacn whale," and "bnbchain."This suggests that members of this community are likely engaged in cryptocurrency investments or trading.Additionally, the presence of words like "tournament," "soccer," and "time market" suggests an interest in sports events, potentially related to the 2022 FIFA World Cup held in Qatar.It is likely that discussions in this community revolve around soccer matches and related market dynamics.Furthermore, phrases like "trending now" and "potential" hint at an inclination towards trending and high-potential topics, indicating discussions about emerging trends in various fields.Lastly, terms like "look," "catch," and "join" convey a sense of inclusion and participation within this community.
The word cloud for Community 1 (Fig. 11b) presents a more focused set of keywords.The presence of terms like "croniarmy," "memecoin," "sure," "receive," and "holder" suggests a strong emphasis on cryptocurrency-related discussions."Croniarmy" and "memecoin" imply involvement in meme or community-driven cryptocurrencies, which often have a playful or speculative aspect.The word "sure" suggests confidence or assurance in these cryptocurrency investments."Receive" might indicate a focus on receiving rewards or payouts from these investments."Holder" is a common term in the cryptocurrency space referring to those who hold onto their assets rather than actively trading them.Overall, Community 1 seems to be primarily interested in cryptocurrency investments, possibly with a sense of camaraderie or loyalty among members.
The analysis of the two communities wordclouds suggests that they both exhibit a relatively neutral sentiment, mainly based on Fig. 10.This means that the overall tone of discussions within these communities does not appear strongly positive or negative based solely on the keywords provided.

Polarized results
The findings presented in this section shed light on the degree of controversy prevailing between the two communities identified by the METIS algorithm, considering four distinct representations of the conversation graph.Specifically, Table 2 provides a concise summary of the controversy scores computed using both conventional measures for assessing partition quality, such as Modularity and Average shortest path (Qi Ye et al. 2010), and measures specifically designed within the context of controversy evaluation, including Random Walk Controversy (RWC), Change Side Controversy (CSC), and Boundary Connectivity (BC).
From the tabulated data, it becomes apparent that, primarily due to non-alignment with the problem at hand, modularity does not effectively capture the nuances of echo chambers, as is more clearly accomplished by most other dedicated measures.Notably, the measure that consistently yields the highest controversy scores between communities is the one based on tracking community changes during random walks, i.e., CSC, as highlighted in italicized format within the table.
Conversely, the measure grounded in boundary connectivity (BC) emerges as the least effective in this regard.
Furthermore, in relation to the various representations of the conversation graphs, it is noteworthy that the sentiment-based representation consistently demonstrates the highest controversy values across nearly all controversy measures.This is emphasized in bold within the Table 6.The presented controversy measures serve as the response to Research Question 1 (RQ 1 ), as portrayed in the Tab. 4 indicating that the observed high controversy levels signify the presence of polarization within the dataset.This observation contributes to our understanding of the prevailing dynamics and polarization evident in the analyzed data.

Sentiment Approach
To begin with, the sentiment approach based on the RQ 2 , it present an intriguing observation that can be drawn from Fig. 12b, where the sentiment-based modeling notably "smooths" the peak associated with users in Community 1 who express neutral sentiment.This smoothing effect suggests that a significant number of users, originally situated in the mentions-based modeling of the graph, may have been relocated to Community 1. Evidently, this shift has led to an elevation in the peak of neutral sentiment within this community.Upon closer examination of the graph in Fig. 12c, we discern that the flattening of the neutral sentiment peak among Community 1 users is somewhat diminished within the topic-based modeling.However, when we turn our attention to the hybrid approach Fig. 12d, an entirely distinct sentiment distribution pattern emerges.In this scenario, users in Community 0 exhibit a tendency toward a more neutral emotional disposition.In contrast, the topic-based approach prominently highlights the neutrality of users across both communities.
This nuanced analysis underscores the diverse effects of different modeling approaches on sentiment distributions within the communities.It is worth noting that each approach introduces unique nuances to the sentiment landscape, thereby

Topic Approach
This section offers an in-depth examination of the topics derived, regarding to the RQ 5 , through the topic modeling process, as detailed in Sect.3.6.2As earlier emphasized, the selection of the LDA model was a crucial step in determining the number of topics to extract.After careful evaluation, the optimal configuration was found to be the consideration of 30 topics.This specific choice demonstrated remarkable performance, notably yielding one of the highest topic coherence scores, as visually presented in Fig. 13.  8.Each topic is correlated with a compilation of pertinent terms (excluding commonplace terms employed for the categorization of the studies such as "Qatar," "boycottQatar," "FIFA," "football," etc.), forming the foundation for extracting, to the utmost of our capability, a succinct description that mirrors the thematic dimensions of the research landscape.The Tab. 8 elucidates the topics, providing a basis for drawing more comprehensive insights into events in Qatar, with a particular emphasis on the working conditions therein.

Conclusion and future research
In our scientific research, we delved into the detection of echo chambers within a highly publicized event that occurred the year prior: the Qatar events during the World Cup and the living conditions experienced from January to December 2022.Our approach involved constructing a social network based on interactions among Twitter users, particularly focusing on quotes and mentions.After collecting a wealth of data, we created a graph representation and optimized it using Gephi.Our primary goal was to gain a deeper understanding of user interactions beyond the structural aspects of the network.To achieve this, we enriched the graph with four distinct representations: i) mentions, ii) sentiment, iii) topics, and iv) a hybrid approach.We employed state-of-the-art algorithms like METIS to divide the graph into two roughly distinct communities.To ensure that these two communities could potentially serve as echo chambers within the network, we calculated modularity metrics, which  ,club,footbal,graphic,beauti,potenti,featur,trendingnow,world,project,cryptopitch 20 best,footbal,particip,player,futubal,game,portug,world,xgem,profit,allow,club,doge,crypto, 21 need,ukrain,babydogecoin,doge,footbal,binanc,crypto,babi,fifa,saudi,europ,cryptocurreci 22 sponsor,offici,month,canada,link,book,canmnt,year,promot,hello,qatarworldcup,wakandaforev 23 list,worker,game,right,qatarworldcup,boycottqatar,usmnt,human,check,special,come, 24 world,fifa,group,fifaworldcup,event,game,share,money,experi,know,hope,footbal, 25 binanc,peopl,crypto,great,minifootbal,nftcommun,defi,bscgem,aant,gamefi,alphaapenetwork, 26 airlin,aw,save,ignor,alert,disgust,akbaralbak,miss,head,bag,liar,akbar,shame 27 fifaworldcup,fifa,bet,sport,world,token,launch,platform,leverag,live,trend,fifacatar,twitter, 28 wale,world,watch,worldcupqatar,qnasport,video,footbal,rich,theredwal,music,blitz 29 laeeb,laeebinu,worldcupmascot,bring,get,worldcupqatar,fifaworldcup,enjoy,laeebinueth, evaluate the quality of the network, and incorporated controversy measures based on existing literature.Our state-of-the-art results revealed the necessity of considering semantic information in addition to the network's existing topological data to gain a comprehensive understanding of the echo chamber phenomenon within the network.Current literature works that refer to the concept of echo chambers tend to perform a bipartite partitioning of the social network graph.This decision is justified by the fact that, typically, around a controversial topic, two opposing thoughts develop.This assumption may be correct in most cases, but it can be too restrictive as it forces everything to be seen as "black or white."This limitation becomes especially apparent when aiming to conduct a more detailed study that considers multiple levels of thought around a specific issue.It could be sensible, therefore, to try to overcome the bipartite logic and perform a par-titioning into a higher number of communities to identify different possible positions on a particular topic.In this perspective, the precise and accurate use of semantics in the network becomes crucial in order to more accurately model communities around a certain position.In this regard, the proposed enrichment of edges in this study may not be sufficient for this purpose.It would be useful to explore generative models based on LDA (Latent Dirichlet Alocation) that consider both the topological structure of the network and semantic information to perform community detection that takes into account topological and semantic information in the modeled social network.
In continuation of the primary study focused on identifying echo chambers within Qatar events, the next phase of our research endeavors to develop a user-friendly interface, an open-source tool that we be build with Django16 .This interface will not only harness the dataset collected during the Qatar events but also accommodate similar Twitter datasets structured in a comparable format.The ultimate aim is to construct a resilient application that can serve as a valuable resource for data analysts and researchers, facilitating their ability to conduct analogous analyses to the one conducted in our study.This expansion will contribute to a broader understanding of echo chambers in various contexts, enhancing the accessibility of these analytical tools.Building upon our initial investigation targeting echo chambers in the context of Qatar events, our forthcoming research direction involves the creation of an intuitive and user-friendly interface.This interface will be designed to effectively leverage not only the existing Qatar dataset but also datasets from Twitter following a similar format.The overarching objective is to establish a robust application that can be instrumental for data analysts and researchers, enabling them to replicate and extend the type of analysis conducted in our study across different datasets.By offering this accessible tool, we aspire to facilitate a more widespread exploration of echo chambers in diverse settings, thus broadening the scope and impact of our research.

Fig. 3 :
Fig. 3: The representation of the Qatar Events graph, generated using the ForceAt-las2 algorithm, a continuous graph layout algorithm tailored for network visualization within the Gephi software, serves the purpose of identifying closely interconnected groups within the network.(Jakomy et al. 2009)

Fig. 6 :
Fig. 6: The percentages of individuals within the Qatar events graph, classified into two distinct communities, namely Community 0 and Community 1, are determined based on four distinct graph modeling approaches.

Fig. 7 :
Fig. 7: The representation of the Qatar Events graph, categorizes based on hybrid approach, into two separate communities.Community 0 is visually represented using the color red, while Community 1 is denoted by the green color.(Jakomy et al. 2009)

Fig. 8 :
Fig.8: Top10 in-degree users.The x-axis denotes degree categories, representing user degrees, while the y-axis illustrates the number of tweets from users in each degree category.

Fig. 11 :
Fig. 11: Wordclouds obtained given the description of Twitter accounts according to their community of belonging (under the sentiment based representation)

Fig. 12 :
Fig. 12: Intracommunity sentiment distribution given the different representations used.On the x-axis the sentiment scores (-30 to 30), while on the y-axis their kernel density propability (KDE)

Table 1 :
Twitter User and Tweet Data Table

Table 2 Table 2 :
Twitter search based on #Hashtags Source: Data is available in the following repo Novel Dataset 1 https://www.qatar2022.qa/

Table 3 :
Network information

Table 4 :
Study aims & research objectives What were the major challenges in the development of the EchoSense framework?

Table 6 :
The outcomes of the metrics employed to assess the controversy among the communities identified by the community detection algorithm across the four representations of the conversation graph are as follows:

Table 8 :
Results of the LDA model