Maintenance Notice

Due to necessary scheduled maintenance, the JMIR Publications website will be unavailable from Wednesday, July 01, 2020 at 8:00 PM to 10:00 PM EST. We apologize in advance for any inconvenience this may cause you.

Who will be affected?

Accepted for/Published in: Journal of Medical Internet Research

Date Submitted: Jan 30, 2026
Date Accepted: Jun 18, 2026

The final, peer-reviewed published version of this preprint can be found here:

Exploring the Narratives of Patients With Cancer Using Large Language Models: Topic Modeling and Social Network Analysis

Feng X, Kwok HC, Chung CK, Yorke J, Hui V

Exploring the Narratives of Patients With Cancer Using Large Language Models: Topic Modeling and Social Network Analysis

J Med Internet Res 2026;28:e92539

DOI: 10.2196/92539

PMID: 42406894

Exploring cancer patients' narratives with large language models: topic modeling and social network analysis

  • Xinyu Feng; 
  • Hin Chi Kwok; 
  • Ching Kok Chung; 
  • Janelle Yorke; 
  • Vivian Hui

ABSTRACT

Background:

Cancer patients often experience diverse psychosocial stressors that profoundly affect disease trajectories, treatment adherence, and overall quality of life. Understanding how patients experience and articulate these issues is critical for designing patient-centered interventions. Conventional data collection methods such as surveys and interviews provide depth but are constrained by recall bias, scalability, and may overlook sensitive or underreported concerns. Patient-authored narratives in online health communities (OHCs) present a valuable opportunity to identify prevalent and underserved issues. However, critical analytic challenges remain in generating coherent and interpretable insights due to their unstructured and large-scale nature.

Objective:

This study aims to leverage TopicGPT, a prompt-based topic modeling framework powered by large language models (LLMs), in combination with network analysis for interpretable topic discovery and interrelationship analysis in cancer patient narratives.

Methods:

Patient-authored posts describing psychosocial challenges about cancer experience were collected from four OHCs. Eligible posts were pre-processed and analyzed using TopicGPT, wherein topics were generated hierarchically and mapped at sentence level. Comparison analyses were conducted among three state-of-the-art LLMs through cosine similarity and manual evaluation. Results from the best-performing model were used to construct the network subsequently. Topic co-occurrence was examined using the Pointwise Mutual Information (PMI) algorithm and centrality metrics to reveal influential topics and thematic interconnections across narratives.

Results:

A total of 11306 posts were collected from Reddit, Macmillan, Mijian, and Douban between Dec 6, 2006 and Apr 24, 2025. Of these, 3169 posts were retained for topic modeling and network analysis. DeepSeek-V3.2 consistently outperformed Gemini-2.5-Flash and GPT-4o, with similarity scores of 0.6295, 0.5342, and 0.5247, respectively. "Fear of cancer recurrence" and "psychological distress" emerged as both most frequent and bridging topics across a hierarchy comprising 42 top-level and 58 subtopics. Strong connections were observed among "sexual health concerns", "reproductive concerns", and "quality of life impact"; "family communication concerns" frequently co-occurred with "employment concerns", " diagnostic delays and misdiagnosis", and "social support".

Conclusions:

This study demonstrates the potential of LLM-based topic modeling for large-scale, context-sensitive analysis of patient-authored narratives. The proposed integrated, domain-adaptable pipeline enables the identification of high-fidelity topics and their interrelationships, offering a scalable and interpretable approach to qualitative data in healthcare. Importantly, our findings reveal substantial concerns and unmet needs among cancer patients, emphasizing the necessity for patient-tailored interventions and enhanced support strategies to improve their overall well-being.


 Citation

Please cite as:

Feng X, Kwok HC, Chung CK, Yorke J, Hui V

Exploring the Narratives of Patients With Cancer Using Large Language Models: Topic Modeling and Social Network Analysis

J Med Internet Res 2026;28:e92539

DOI: 10.2196/92539

PMID: 42406894

Download PDF


Request queued. Please wait while the file is being generated. It may take some time.

© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.