Objective Patients with chronic illness share their experiences in online communities and generate rich data on pain management. This study applied natural language processing methods, including large language models (LLMs), to Reddit discussions from lupus communities to characterize multidimensional pain experiences framed in the biopsychosocial model. Methods We extracted Reddit posts from the r/Lupus and r/LupusSupport subreddits posted from June 9, 2010, through December 31, 2023. Pain‐related posts were identified using a clinically informed pain lexicon. Topic modeling was used to identify thematic patterns, which were then compared with structured summaries generated by LLM instructions that were fine‐tuned using the biopsychosocial model of pain. Two reviewers conducted content analysis of the LLM‐generated summaries, evaluating thematic accuracy and coverage. Results Data from Reddit included 31,785 posts from 10,857 authors. We identified common pain complaints, management strategies, and sociocultural, affective, and nociplastic dimensions of pain. Instruction fine‐tuned LLMs produced structured summaries with an average thematic accuracy score of 3.1 of 4 (kappa = .09) and content coverage score of 2.9 of 4 (kappa = .38). Sociocultural features presented in 123 posts (33.8%), including peer support and validation (n = 106) and provider interactions or access issues (n = 35). Nociplastic pain presented in 205 posts (56.3%). Conclusion Natural language processing methods can be used to extract rich, multidimensional insights into pain experiences from online communities focused on lupus. These approaches highlight the psychological, social, and cultural facets of pain that may be underrepresented in clinical settings, supporting more patient‐centered approaches to care in rheumatology.
The Digital Narrative: Chronic Pain Self-Management Insights from Reddit in Systemic Lupus Erythematosus
Studies in Health Technology and Informatics | April 8, 2025 | Volume: No volume available | Issue: No issue available | Pages: No page available
Chronic pain is a pervasive and complex symptom experienced by patients with Systemic Lupus Erythematosus (SLE), often impacting their quality of life. Traditional data sources, such as clinical records and surveys, provide valuable insights but may not fully capture the breadth of patient experiences and self-management strategies. This study leverages Reddit discussions as a real-world data source to explore chronic pain patterns, management approaches, and unmet needs among individuals with SLE. Utilizing natural language processing (NLP), we analyzed over 30,000 posts from r/Lupus and r/LupusSupport subreddits to identify key themes, trends, and alternative therapies discussed by users. This approach highlights the potential of social media as a complementary resource for understanding chronic pain and guiding patient-centered care interventions.
A large language model–based generative natural language processing framework fine‐tuned on clinical notes accurately extracts headache frequency from electronic health records
Headache: The Journal of Head and Face Pain | March 25, 2024 | Volume: 64 | Issue: 4 | Pages: 400-409
Abstract Objective To develop a natural language processing (NLP) algorithm that can accurately extract headache frequency from free‐text clinical notes. Background Headache frequency, defined as the number of days with any headache in a month (or 4 weeks), remains a key parameter in the evaluation of treatment response to migraine preventive medications. However, due to the variations and inconsistencies in documentation by clinicians, significant challenges exist to accurately extract headache frequency from the electronic health record (EHR) by traditional NLP algorithms. Methods This was a retrospective cross‐sectional study with patients identified from two tertiary headache referral centers, Mayo Clinic Arizona and Mayo Clinic Rochester. All neurology consultation notes written by 15 specialized clinicians (11 headache specialists and 4 nurse practitioners) between 2012 and 2022 were extracted and 1915 notes were used for model fine‐tuning (90%) and testing (10%). We employed four different NLP frameworks: (1) ClinicalBERT (Bidirectional Encoder Representations from Transformers) regression model, (2) Generative Pre‐Trained Transformer‐2 (GPT‐2) Question Answering (QA) model zero‐shot, (3) GPT‐2 QA model few‐shot training fine‐tuned on clinical notes, and (4) GPT‐2 generative model few‐shot training fine‐tuned on clinical notes to generate the answer by considering the context of included text. Results The mean (standard deviation) headache frequency of our training and testing datasets were 13.4 (10.9) and 14.4 (11.2), respectively. The GPT‐2 generative model was the best‐performing model with an accuracy of 0.92 (0.91, 0.93, 95% confidence interval [CI]) and R 2 score of 0.89 (0.87, 0.90, 95% CI), and all GPT‐2–based models outperformed the ClinicalBERT model in terms of exact matching accuracy. Although the ClinicalBERT regression model had the lowest accuracy of 0.27 (0.26, 0.28), it demonstrated a high R 2 score of 0.88 (0.85, 0.89), suggesting the ClinicalBERT model can reasonably predict the headache frequency within a range of ≤ ± 3 days, and the R 2 score was higher than the GPT‐2 QA zero‐shot model or GPT‐2 QA model few‐shot training fine‐tuned model. Conclusion We developed a robust information extraction model based on a state‐of‐the‐art large language model, a GPT‐2 generative model that can extract headache frequency from EHR free‐text clinical notes with high accuracy and R 2 score. It overcame several challenges related to different ways clinicians document headache frequency that were not easily achieved by traditional NLP models. We also showed that GPT‐2–based frameworks outperformed ClinicalBERT in terms of accuracy in extracting headache frequency from clinical notes. To facilitate research in the field, we released the GPT‐2 generative model and inference code with open‐source license of community use in GitHub. Additional fine‐tuning of the algorithm might be required when applied to different health‐care systems for various clinical use cases.
Advances in Text Mining and Visualization for Precision Medicine
Biocomputing 2018 | November 17, 2017 | Volume: No volume available | Issue: No issue available | Pages: 559-565