Crowdsourcing-Based Knowledge Graph Construction for Drug Side Effects Using Large Language Models with an Application on Semaglutide
Zhijie Duan, Kai Wei, Zhaoqian Xue, Jiayan Zhou, Shu Yang, Siyuan Ma, Jin Jin, Lingyao li
TL;DR
This paper presents a scalable pipeline that leverages large language models to extract side-effect information from Reddit and construct a knowledge graph for semaglutide. The four-stage framework covers data collection, information extraction with prompt-based LLMs, KG construction with rich entity–relation metadata, and cross-source validation against FAERS using statistical tests. The resulting KG links four semaglutide-related medications to 1,775 side effects via 7,225 relations and 96 grouped terms, enabling both qualitative analyses and a quantitative cross-check with FDA data. The findings show general concordance with FAERS on common side effects while revealing Reddit-specific signals, including mental-health symptoms and rarer events, underscoring the value of patient-centered, crowdsourced real-world evidence for pharmacovigilance and highlighting the method’s generalizability to other drugs.
Abstract
Social media is a rich source of real-world data that captures valuable patient experience information for pharmacovigilance. However, mining data from unstructured and noisy social media content remains a challenging task. We present a systematic framework that leverages large language models (LLMs) to extract medication side effects from social media and organize them into a knowledge graph (KG). We apply this framework to semaglutide for weight loss using data from Reddit. Using the constructed knowledge graph, we perform comprehensive analyses to investigate reported side effects across different semaglutide brands over time. These findings are further validated through comparison with adverse events reported in the FAERS database, providing important patient-centered insights into semaglutide's side effects that complement its safety profile and current knowledge base of semaglutide for both healthcare professionals and patients. Our work demonstrates the feasibility of using LLMs to transform social media data into structured KGs for pharmacovigilance.
