A Bayesian latent class analysis approach for assessing the accuracy of natural language processing models classifying topic and sentiment of public health-related social media content.
José Denis-Robichaud, Hélène Carabin, Jingcheng Niu, Erin E Rees
Independent Researcher, Amqui, Quebec G5J 2N5, Canada. · Groupe de recherche en épidémiologie des zoonoses et santé publique (GREZOSP), Université de Montréal, Saint-Hyacinthe, Quebec J2S 2M2, Canada.
Key points
From the paper's conclusion- This study demonstrates an approach to estimate the posterior distribution of the probability, adjusted for misclassification error, of including topic/sentiment for each social media post and derived classifier accuracy metrics for the tests.
Abstract
Natural language processing (NLP) models can classify unstructured social media content into structured data suitable for generating public health intelligence. Natural language processing models, however, can vary in performance, given differences in architecture and sensitivities to temporal drift. Our objective was measuring the performance of different NLP models for identifying topics and sentiment of social media posts related to COVID-19 within a framework that integrated model outputs and human-labeled posts. Posts were obtained from Twitter (Canada; December 2020-August 2021). Tweets were classified by public health measure (PHM) topic (mask-wearing, vaccination, social distancing, others) using 5 crowdsourcing annotators, a keyword-based filter (KB), and a large language model (LLM). Sentiment (in support, neutral, against) was categorized using the same crowdsourcing annotators and LLM, and a neural network sentiment analysis (NSA) model. Sensitivity and specificity of the NLP models were estimated using hierarchical Bayesian latent class models. A total of 443 and 801 tweets were assessed for topic and sentiment classification, respectively. Keyword-based and LLM models had similar specificity and sensitivity for all topics, except for LLM having higher sensitivity for vaccination (0.88). The NSA model yielded sensitivity < 0.50 for classifying "in support" and "against" sentiments, while the LLM had sensitivity > 0.60 for all sentiments. Deployment of NLP models for public health applications requires critical understanding of model performance. This study demonstrates an approach to estimate the posterior distribution of the probability, adjusted for misclassification error, of including topic/sentiment for each social media post and derived classifier accuracy metrics for the tests.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Evaluating Large Language Models for Sentiment Analysis and Hesitancy Analysis on Vaccine Posts From Social Media: Qualitative StudyJMIR Formative Research · 2025
- Real-Time Influenza Surveillance Using DeepSeek-Augmented BERT Classification on Chinese Social Media: Infodemiology Study.Journal of medical Internet research · 2026
- Do language families matter? Evaluating LLMs for sentiment analysis through a hierarchical cross-lingual lens.Frontiers in artificial intelligence · 2026
- Large language models in digital public health: closing the validation gap from data foundations to real-world applicationsFrontiers in Public Health · 2026
- Emotion and Cognition Based Mental Health Analysis from Social MediaJournal of Trends in Computer Science and Smart Technology · 2026
- Exploiting survey and online patient experience comments in general practice: validating a fine-tuned language model for automatic sentiment analysis.Family practice · 2026