topic-sentiment-integration-enhances-social-network-communities-through-content-enriched-leiden-clustering
Topic-Sentiment Integration Enhances Social Network Communities Through Content-Enriched Leiden Clustering

Topic-Sentiment Integration Enhances Social Network Communities Through Content-Enriched Leiden Clustering

Social media communities may be far more than clusters of users who interact frequently. A new study proposes that the groups forming around online conversations can be mapped more accurately when researchers consider not only who retweets or mentions whom, but also what people are discussing and how they feel about it. The framework, developed by Ghaidaa A. Al-Sultany, Hayder M. Alash, Raman Kumar and colleagues, combines network structure with topic and sentiment information to reveal communities that are semantically and emotionally coherent. Published in Knowledge and Information Systems, the work addresses a central problem in computational social science: conventional community-detection algorithms can identify densely connected groups while overlooking the meaning carried by the messages linking them.

Online networks are commonly represented as graphs. In such a graph, each user becomes a node, while an interaction such as a retweet or mention becomes an edge connecting two nodes. Algorithms then search for regions in which edges are unusually dense compared with connections between regions. This approach has proved powerful for studying political discourse, breaking news, online movements and the spread of misinformation, but it treats interactions largely as abstract structural signals. Two users may be connected repeatedly even when they discuss unrelated issues or express sharply opposing views. Conversely, users who rarely interact directly may belong to the same intellectual or emotional community because they share a topic, vocabulary or outlook. The researchers argue that ignoring these content signals can produce communities that are structurally neat but socially misleading.

Their solution enriches the network with attributes extracted from user-generated text. Topic modeling estimates the subjects present in posts, while sentiment analysis assigns information about affective orientation, such as positive, neutral or negative expression. These measurements can be obtained using relatively lightweight methods, including latent semantic analysis, latent Dirichlet allocation or term-frequency representations, or through more computationally demanding transformer-based language models. The framework is therefore designed to work across different levels of technical sophistication. A research team with limited computing resources could use compact text representations, whereas large-scale investigations could employ contextual embeddings that capture more subtle relationships between words and phrases.

The first major component is a learnable edge-weighting mechanism. Instead of assuming that every retweet or mention represents the same degree of connection, the method estimates interaction strength from a combination of structural, topical and sentiment features. An edge can become more influential when two users interact often and discuss similar subjects, or when their messages display a consistent affective relationship. The approach can also distinguish between different kinds of alignment: users may share a topic while disagreeing emotionally, or express similar sentiment about entirely different subjects. By allowing the weighting function to learn from these signals, the model creates a richer representation of user affinity than a simple count of interactions.

The second component modifies the objective used to identify communities. The researchers build on the Leiden algorithm, a widely used method that optimizes a quantity related to modularity. Standard modularity rewards partitions in which many edges remain inside communities and relatively few cross between them. The study introduces a content-aware modularity function called Qattr, which adds rewards for semantic and affective alignment within each proposed group. During optimization, a candidate community is favored not merely because its members are densely connected, but because their conversations exhibit meaningful topical coherence and compatible sentiment patterns. This makes the procedure a form of graph clustering in which network geometry and language jointly influence the final partition.

The researchers evaluated the framework using Twitter data under several challenging conditions. In-domain experiments tested performance when the method was trained and assessed on related subject areas. Leave-one-domain-out experiments examined whether it could generalize to a topic not represented during development, while cross-platform testing explored its potential beyond the original social-media environment. This design matters because algorithms can appear successful when they learn the vocabulary or interaction habits of a single discussion. A system that identifies genuine communities should remain useful when topics, users and platforms change. The study also used multiple kinds of evaluation rather than relying on a single score.

Structural quality was assessed with modularity and the Clique Percolation Method, which can identify overlapping groups by linking together densely connected network structures. Semantic agreement was measured with Normalized Mutual Information and the Adjusted Rand Index, metrics that compare discovered communities with reference assignments while accounting for chance agreement. The authors additionally used blinded human evaluation, asking annotators to judge topic coherence and sentiment grouping. Human assessment is particularly important for content-enriched clustering because a mathematically strong partition is not automatically understandable or socially meaningful. Agreement between annotators provided a further check on whether the communities produced by the algorithm reflected recognizable patterns in the underlying conversations.

Across the experiments, the researchers report that jointly using structure, topic and sentiment produced more coherent and semantically aligned communities than structure-only baselines. The improvement was observed while preserving practical scalability, suggesting that adding language information need not make network analysis unusably expensive. Statistical significance testing across repeated runs was used to assess the robustness of the results, rather than treating one favorable partition as conclusive. The authors describe the framework as model-agnostic: its central mechanisms can operate with either conventional text-processing pipelines or transformer-based models. That flexibility could make the method attractive for applications ranging from monitoring public opinion to studying crisis communication, political polarization and the organization of online interest groups.

The findings also point to a more complicated picture of online polarization. A network divided into communities by interaction alone may conceal internal disagreement, mixed identities or topic crossovers. A content-aware method can potentially separate groups that share the same subject but differ in emotional stance, while recognizing bridges between users who participate in distinct conversations with similar attitudes. Such distinctions could help analysts investigate how opinions form and spread, how narratives migrate between communities and how coordinated campaigns exploit existing social divisions. At the same time, sentiment classifiers and topic models are imperfect. Sarcasm, irony, slang, multilingual posts and rapidly changing meanings can all distort automated interpretation, and an algorithmic label should not be mistaken for a definitive judgment about an individual user.

The study’s data practices reflect another challenge in social-media research. The Twitter material was collected from publicly available streams through the platform’s API under its developer policy, but the raw tweet text cannot be redistributed because of data-sharing restrictions. The researchers say tweet IDs and annotation guidelines are available from the corresponding author upon reasonable request, while preprocessing scripts and evaluation code can be shared for academic and non-commercial use. These constraints make independent replication more difficult than in studies based on fully open datasets, especially as platform access and policies change. Even so, the proposed framework offers a clear conceptual shift: online communities should be understood as structures of interaction, meaning and emotion at the same time. By bringing those dimensions into a single Leiden-based clustering process, the work could help turn the chaotic flow of social media into a more faithful map of how collective conversation is actually organized.

Subject of Research: Content-enriched community detection in social networks using interaction structure, topic modeling and sentiment analysis

Article Title: Enhanced community detection in social networks via topic-sentiment integration and content-enriched Leiden clustering

Article References: Al-Sultany, G. A., Alash, H. M., Kumar, R. et al. “Enhanced community detection in social networks via topic-sentiment integration and content-enriched Leiden clustering.” Knowledge and Information Systems 68, 246 (2026). Original research article

Image Credits: AI Generated

DOI: 10.1007/s10115-026-02860-9

Keywords: community detection, social network analysis, topic modeling, sentiment analysis, Leiden algorithm, semantic graph enrichment, Twitter data mining

Tags: computational social science methodscontent-enriched Leiden clusteringemotional content in social networksmeaning-aware community detectionmulti-dimensional social network modelingonline discourse and misinformation spreadretweet and mention analysissemantically coherent online communitiessentiment-based community detectionsocial media community detectionsocial network graph algorithmstopic-aware social network analysis