• Home
  • Search
  • Evaluating Large Language Models for Sentiment Analysis and Hesitancy Analysis on Vaccine Posts From Social Media: Qualitative Study
  • Cite Icon7
  • https://doi.org/10.2196/64723Copy DOI Icon

Evaluating Large Language Models for Sentiment Analysis and Hesitancy Analysis on Vaccine Posts From Social Media: Qualitative Study

Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

BackgroundIn the digital age, social media has become a crucial platform for public discourse on diverse health-related topics, including vaccines. Efficient sentiment analysis and hesitancy detection are essential for understanding public opinions and concerns. Large language models (LLMs) offer advanced capabilities for processing complex linguistic patterns, potentially providing valuable insights into vaccine-related discourse.ObjectiveThis study aims to evaluate the performance of various LLMs in sentiment analysis and hesitancy detection related to vaccine discussions on social media and identify the most efficient, accurate, and cost-effective model for detecting vaccine-related public sentiment and hesitancy trends.MethodsWe used several LLMs—generative pretrained transformer (GPT-3.5), GPT-4, Claude-3 Sonnet, and Llama 2—to process and classify complex linguistic data related to human papillomavirus; measles, mumps, and rubella; and vaccines overall from X (formerly known as Twitter), Reddit, and YouTube. The models were tested across different learning paradigms: zero-shot, 1-shot, and few-shot to determine their adaptability and learning efficiency with varying amounts of training data. We evaluated the models’ performance using accuracy, F1-score, precision, and recall. In addition, we conducted a cost analysis focused on token usage to assess the computational efficiency of each approach.ResultsGPT-4 (F1-score=0.85 and accuracy=0.83) outperformed GPT-3.5, Llama 2, and Claude-3 Sonnet across various metrics, regardless of the sentiment type or learning paradigm. Few-shot learning did not significantly enhance performance compared with the zero-shot paradigm. Moreover, the increased computational costs and token usage associated with few-shot learning did not justify its application, given the marginal improvement in model performance. The analysis highlighted challenges in classifying neutral sentiments and convenience, correctly interpreting sarcasm, and accurately identifying indirect expressions of vaccine hesitancy, emphasizing the need for model refinement.ConclusionsGPT-4 emerged as the most accurate model, excelling in sentiment and hesitancy analysis. Performance differences between learning paradigms were minimal, making zero-shot learning preferable for its balance of accuracy and computational efficiency. However, the zero-shot GPT-4 model is not the most cost-effective compared with traditional machine learning. A hybrid approach, using LLMs for initial annotation and traditional models for training, could optimize cost and performance. Despite reliance on specific LLM versions and a limited focus on certain vaccine types and platforms, our findings underscore the capabilities and limitations of LLMs in vaccine sentiment and hesitancy analysis, highlighting the need for ongoing evaluation and adaptation in public health communication strategies.

Similar Papers
  • PDF
  • Research Article
  • Citations75

A Comparison of ChatGPT and Fine-Tuned Open Pre-Trained Transformers (OPT) Against Widely Used Sentiment Analysis Tools: Sentiment Analysis of COVID-19 Survey Data.

  • Jan 25, 2024
  • JMIR mental health
  • Juan Antonio Lossio-Ventura +7
  • Research Article
  • Citations11

How Can IJDS Authors, Reviewers, and Editors Use (and Misuse) Generative AI?

  • Apr 01, 2023
  • INFORMS Journal on Data Science
  • Galit Shmueli +7
  • Research Article
  • Citations52

Sentiment Analysis of Product Reviews Using Machine Learning and Pre-Trained LLM

  • Dec 23, 2024
  • Big Data and Cognitive Computing
  • Pawanjit Singh Ghatora +4
  • PDF
  • Research Article
  • Citations34

Large Language Models Can Enable Inductive Thematic Analysis of a Social Media Corpus in a Single Prompt: Human Validation Study.

  • Aug 29, 2024
  • JMIR infodemiology
  • Michael S Deiner +5
  • PDF
  • Research Article
  • Citations171

A multimodal approach to cross-lingual sentiment analysis with ensemble of transformer and LLM

  • Apr 26, 2024
  • Scientific Reports
  • Md Saef Ullah Miah +5
  • Research Article

Comparative performance of LLMs and machine learning in predicting complications after percutaneous kyphoplasty for osteoporotic vertebral compression fractures

  • Apr 01, 2026
  • NPJ Digital Medicine
  • Tianyi Wang +9
  • Front Matter

Editorial: Women in language and computation 2022.

  • Oct 17, 2023
  • Frontiers in Artificial Intelligence
  • Róisín Loughran +3
  • Research Article

Comparison of Artificial Intelligence Tools With Human Coding for Sentiment, Topic, and Thematic Analysis Tasks of Public Health Datasets During the COVID-19 Pandemic in Australia: Case Study.

  • Apr 07, 2026
  • Online journal of public health informatics
  • Danielle Hutchinson +5
  • Research Article
  • Citations12

Enhancing Automated Trading with Sentiment Analysis: Leveraging Large Language Models for Stock Market Predictions

  • Mar 17, 2025
  • The American Journal of Engineering and Technology
  • Md Tarake Siddique +8
  • Research Article
  • Citations4

Enhancing sentiment and intent analysis in public health via fine-tuned Large Language Models on tobacco and e-cigarette-related tweets

  • Nov 28, 2024
  • Frontiers in Big Data
  • Sherif Elmitwalli +3
  • Research Article

Exploring Vulnerabilities and Threats in Large Language Models: Safeguarding Against Exploitation and Misuse

  • Aug 10, 2024
  • INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT
  • Mr Aarush Varma +1
  • PDF
  • Research Article
  • Citations19

FinSoSent: Advancing Financial Market Sentiment Analysis through Pretrained Large Language Models

  • Aug 02, 2024
  • Big Data and Cognitive Computing
  • Josiel Delgadillo +2
  • Research Article
  • Citations2

Harnessing the Power of Large Language Models for Real-World Sentiment Classification on Social Media

  • Feb 08, 2025
  • Advances in Economics, Management and Political Sciences
  • Jonathan Jin
  • Conference Article
  • Citations2

‘Advancing Sentiment Analysis in Serbian Literature: A Zero and Few–Shot Learning Approach Using the Mistral Model

  • Sep 01, 2024
  • Milica Ikonić Nešić +4
  • Research Article
  • Citations2

Using Large Language Models for sentiment analysis of health-related social media data: empirical evaluation and practical tips.

  • Jan 01, 2024
  • AMIA ... Annual Symposium proceedings. AMIA Symposium
  • Lu He +3
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.