Abstract
The use of social media data, like Twitter, for biomedical research has been gradually increasing over the years. With the coronavirus disease 2019 (COVID-19) pandemic, researchers have turned to more non-traditional sources of clinical data to characterize the disease in near-real time, study the societal implications of interventions, as well as the sequelae that recovered COVID-19 cases present. However, manually curated social media datasets are difficult to come by due to the expensive costs of manual annotation and the efforts needed to identify the correct texts. As part of the 2021 Biomedical Linked Annotation Hackathon, we release our dataset of over 120 million automatically annotated tweets for biomedical research purposes. Incorporating best-practices, we identify tweets with potentially high clinical relevance. We evaluated our work by comparing several SpaCy-based annotation frameworks against a manually annotated gold-standard dataset. Selecting the best method to use for automatic annotation, we then annotated 120 million tweets and released them publicly for future downstream usage within the biomedical domain.
Introduction
While traditional clinical data sources, such as electronic health records, are highly reliable, they often suffer from significant reporting lags. Social media platforms like Twitter offer a "near-real-time" window into public health, allowing researchers to track emerging symptoms, vaccine sentiment, and the societal impact of health interventions as they happen.
However, leveraging this data effectively is challenging. Manually annotating millions of tweets is prohibitively expensive, and existing biomedical Natural Language Processing (NLP) tools are typically trained on formal scientific literature or clinical notes. When these models encounter the informal language of social media—replete with slang, typos, and emojis—their performance often drops. This study sought to identify which annotation method works best for social media and to create a massive, open-access resource for the research community.
Methodology
The research team evaluated four different pipelines, all built on the popular spaCy framework, to identify biomedical entities such as drugs, symptoms, and measurements:
- SMMT Tagger: A dictionary-based tagger from the Social Media Mining Toolkit that uses simple string matching against curated terminologies (SNOMED-CT, ICD-9/10, MeSH, and RxNorm).
- ScispaCy: A model specifically tuned for scientific and biomedical documents.
- MedaCy: A framework designed for predictive medical NLP.
- MedSpaCy: A toolkit for clinical NLP pipelines, often used with health records.
These systems were compared against a "gold standard" dataset of 10,315 tweets manually annotated by clinicians to identify symptoms, conditions, and prescriptions related to "Long Covid" phenotypes.
Data Sources
The source data was derived from Version 44 of the COVID-19 Twitter Chatter dataset, which contains over 900 million tweets. The authors filtered this to a "clean" subset of 226 million unique English tweets. From this, an automatically annotated dataset of 120 million tweets was produced and released publicly.
Results and Performance Comparison
The evaluation on the gold-standard dataset revealed a stark contrast in performance between the models. Surprisingly, the simplest tool—the dictionary-based SMMT Tagger—was the clear winner. It achieved a 60.35% average overlap with human clinicians, significantly outperforming more complex neural models.
The SMMT Tagger's success is attributed to its design, which specifically handles the linguistic quirks of social media, such as common misspellings (e.g., "fatige" instead of "fatigue"). Models like MedSpaCy and ScispaCy, while effective for medical journals, struggled with the informal nature of tweets, highlighting a significant "domain gap."
Scale and Efficiency
Beyond accuracy, the SMMT Tagger was the most computationally efficient, processing the test set in approximately 3 hours. On the full dataset of 226 million tweets, it produced over 751 million annotations. The scale of the final dataset and the cross-model overlap are detailed below.
Conclusion and Future Work
This study demonstrates that for the "noisy" environment of social media, dictionary-based approaches can outperform sophisticated clinical models that lack domain-specific fine-tuning. The release of this 120-million-tweet dataset provides a valuable resource for real-time pandemic monitoring.
Future work involves fine-tuning sophisticated Named Entity Recognition (NER) systems for social media noise, integrating tweet data with larger knowledge graphs (like PheKnowLator) for deeper insights, and expanding the dataset to include non-English tweets.
Availability: The code and documentation are available on GitHub.
Summary updated