GCD - TM : Graph-Driven Community Detection for Topic Modelling in Psychiatry Texts (2024)

Abstract: Psychiatry texts provide critical insights into patient mental states and therapeutic interactions. These texts are essential for understanding psychiatric conditions, treatment dynamics, and patient responses. However, the complex and diverse nature of psychiatric communications poses significant challenges for traditional topic modeling methods. The intricate language, subtle psychological nuances, and varying lengths of text segments make it difficult to extract coherent and meaningful topics. Conventional approaches often struggle to capture the depth and overlap of themes present in these texts. In this study, we present a novel approach to topic modeling that addresses these limitations by reformulating the problem as a community detection task within a graph constructed from the text corpus. Our methodology includes lemmatization for data standardization, TF-IDF vectorization to create a term-document matrix, and cosine similarity computation to produce a similarity matrix. This matrix is then binarized to form a graph, on which community detection is performed using the Louvain method. The detected communities are subsequently analyzed with Latent Dirichlet Allocation (LDA) to extract topics. Our approach outperforms traditional topic modeling methods, offering more accurate and interpretable topic extraction with improved coherence and lower perplexity.

## introduction psychiatric disorders like depression, bipolar disorder, anxiety, schizophrenia, and substance abuse are major contributors to disability, significantly impacting individuals' quality of life due to their prevalence and duration @xcite @xcite . traditionally, psychiatrists diagnose these conditions through detailed consultations, with linguistic research highlighting key speech patterns in various disorders @xcite . mental health interventions, including psychosocial, behavioral, pharmacological, and telemedicine methods, are vital for improving wellbeing but face systemic obstacles @xcite . the absence of objective diagnostic tools, variability in treatment quality, clinician shortages, especially in rural areas, and the high costs of training reduce the effectiveness of psychological therapies, underscoring the need for improved diagnostic and treatment tools @xcite . recently, there has been a surge in research aimed at diagnosing psychiatric disorders through natural language processing (nlp). studies have targeted a range of disorders, including schizophrenia, depression, bipolar disorder, obsessivecompulsive disorder, autism spectrum disorders, and dementia @xcite . topic modeling has emerged as a key nlp technique for extracting meaningful patterns and themes from psychiatric texts @xcite . topic modeling algorithms are designed to uncover latent topics within large corpora of text by analyzing word co-occurrence patterns @xcite . this approach can reveal underlying themes in patient narratives, therapy session transcripts, and clinical notes, providing valuable insights into the content and dynamics of psychiatric disorders. by applying topic modeling to mental health data, researchers can gain a deeper understanding of prevalent issues, treatment efficacy, and patient experiences, ultimately contributing to the improvement of diagnostic and therapeutic processes @xcite . latent dirichlet allocation (lda) is a widely used topic modeling technique based on the premise that documents are mixtures of topics and topics are distributions over words @xcite . latent semantic analysis (lsa) is another topic modeling technique that employs singular value decomposition to reduce dimensionality and uncover underlying semantic structures @xcite . non-negative matrix factorization (nmf) is also one of the topic modeling techniques, which factorizes term-document matrices into nonnegative components, focusing on additive topic combinations @xcite . bertopic enhances topic modeling by utilizing contextual embeddings from models like bert and mpnet, combined with advanced term weighting, which improves topic identification, particularly in specialized domains such as legal documents @xcite . spectral clustering further refines topic coherence by analyzing document similarity structures, though it requires careful parameter tuning and can be sensitive to noise @xcite . k-means clustering is used to extract precise topics from unstructured data, such as biomedical texts, with improvements in accuracy and efficiency @xcite . existing topic modeling approaches, such as lda and similar models, often face challenges in accurately capturing specific concepts of substantive interest within a corpus @xcite . while these models can explore the themes present in the data, they frequently produce multiple topics with overlapping content or merge distinct themes into a single topic. this can lead to difficulties in interpreting the topics and measuring key concepts accurately @xcite . additionally, these models do not inherently incorporate information about the topics of interest, making it challenging for researchers to determine whether the generated topics align with the intended substantive concepts until after the model has been fitted @xcite . this limitation highlights the need for human validation to ensure the relevance and accuracy of the topics. to address these issues, our graph-based method offers a more refined approach by constructing a network of terms, which better captures the relationships and nuances in the data, ultimately leading to clearer interpretations and more accurate measurements of the underlying thematic structures. in this study, we propose a novel approach to improve topic modeling in psychiatric text analysis by leveraging graph-driven community detection topic modelling (gcd-tm). this approach involves three key concepts: the paper is structured as follows: section 2 reviews related work, section 3 describes the methodology, section 4 discusses the results, section 5 gives the limitation, and section 6 concludes with findings and future directions. ## related works this section explains topic modeling methodologies, including word-assisted, clustering-based, and sequence-based approaches. word-assisted topic modelling: topic modeling is a technique used to identify themes and patterns in large text corpora by analyzing the cooccurrence of words and documents. traditionally, fully automated models such as latent dirichlet allocation (lda) have been used to extract topics without requiring prior knowledge @xcite . however, these models often struggle with interpretability and can produce overlapping or ambiguous topics. to address these limitations, the keyatm approach has been proposed, which integrates human input by requiring researchers to specify a few keywords related to the topics of interest before fitting the model @xcite . this enhancement has been shown to significantly improve both the interpretability and classification performance of the topics generated, providing more accurate and actionable insights from textual data. a model similar to the base keyatm assumes that each document has a single keyword topic, while other topics may lack keywords. in contrast, keyatm allows each document to belong to multiple keyword topics, providing a more flexible approach @xcite . clustering based topic modelling: this study explores a hybrid topic modeling approach combining bidirectional encoder representations (bert) with latent dirichlet allocation (lda) and unsupervised clustering methods @xcite @xcite . dimensionality reduction techniques such as pca, t-sne, and umap are employed to address computational inefficiencies in high-dimensional data. the approach, applied to the cord19 dataset, integrates lda's probabilistic topic assignments with bert's sentence embeddings. clustering is performed with k-means, and the elbow method identifies the optimal number of clusters @xcite . the results indicate that this hybrid framework enhances topic coherence and effectiveness in topic modeling applications. stel-lar is an interactive tool for topic exploration, using bert embeddings with umap and hdb-scan to model topics. human evaluation of the generated topics demonstrated their coherence and relevance @xcite . ## methodology the proposed method, illustrated in figure 1 , involves several key stages: text preprocessing, text vectorization, graph construction, community detection, and topic modeling. ## limitations despite its strong performance, gcd-tm has certain limitations. first, the method's reliance on graph construction and community detection makes it computationally intensive, especially with large datasets, which can lead to increased processing times. second, the model's effectiveness is sensitive to the choice of threshold for graph binarization and the number of topics specified, requiring careful hyperparameter tuning to achieve optimal results. additionally, while gcd-tm excels at capturing well-defined themes, it may struggle with topics that are highly interrelated or overlap significantly, potentially leading to less distinct topic separation. finally, the complexity of the method might make it less accessible for users who are not familiar with graph-based approaches or community detection techniques, limiting its broader applicability in different research contexts. ## conclusion in this study, we introduced the graph-driven community detection for topic modeling (gcd-tm) methodology and demonstrated its effectiveness in uncovering thematic structures within mental health datasets. by leveraging a combination of text preprocessing, tf-idf vectorization, graphbased community detection, and topic modeling with lda, gcd-tm offers a robust approach to identifying and analyzing latent topics. our method outperforms traditional techniques in terms of coherence and perplexity, highlighting its capacity to deliver a more nuanced and accurate representation of underlying themes. the comparative evaluation reveals that gcd-tm not only achieves superior results but also provides a more detailed understanding of thematic structures compared to methods like lda, sc, kmc, and bertopic. the combination of community detection and topic modeling enhances the model's ability to capture complex relationships within the data, leading to more meaningful and interpretable topics. to further enhance the gcd-tm methodology, it would be beneficial to explore the integration of additional data features and modalities, experiment with alternative algorithms, and assess the model's performance across more diverse datasets to improve robustness and adaptability. additionally, investigating methods to address computational efficiency and scalability will be crucial for handling larger and more complex datasets. finally, applying gcd-tm to other domains and comparing its performance with emerging techniques could provide valuable insights and drive innovation in topic modeling.