Back

Detecting Medication Mentions in Social Media Data Using Large Language Models

Lopez-Garcia, G.; Xu, D.; Gonzalez-Hernandez, G.

2025-05-18 health informatics
10.1101/2025.05.16.25327791 medRxiv
Show abstract

The automatic extraction of medication mentions from social media data is critical for pharmacovigilance and public health monitoring. In this study, we present an end-to-end generative approach based on instruction-tuned large language models (LLMs) for medication mention extraction from Twitter. Reformulating the task as a text-to-text generation problem, our models achieve state-of-the-art results on both fine-grained span extraction and coarse-grained tweet-level classification, surpassing traditional sequence labeling baselines and previous best-performing systems. We demonstrate that fine-tuning Flan-T5 models enables efficient and accurate extraction while simplifying the architecture by eliminating complex multi-stage pipelines. Additionally, we show that lexicon-based filtering further improves performance by reducing false positives. Our models are publicly available, providing high-performing and efficient tools for large-scale pharmacological analysis of social media data.

Matching journals

The top 6 journals account for 50% of the predicted probability mass.

50% of probability mass above

"Similar papers" are the closest papers from that journal in the model's embedding space. They show what the match is built on, but the ranking comes mostly from a classifier over the whole training set, not from these examples alone.