[Paper Review] Applying BERT and ChatGPT for Sentiment Analysis of Lyme Disease in Scientific Literature
This paper presents a practical NLP pipeline for sentiment analysis of Lyme disease literature using BERT and ChatGPT, demonstrating how pre-trained language models and explainable AI (SHAP) can detect bias in scientific discourse on chronic Lyme disease. It shows that combining BERT with LLM-based validation improves interpretability and consistency in sentiment classification across 5,643 scientific abstracts.
This chapter presents a practical guide for conducting Sentiment Analysis using Natural Language Processing (NLP) techniques in the domain of tick-borne disease text. The aim is to demonstrate the process of how the presence of bias in the discourse surrounding chronic manifestations of the disease can be evaluated. The goal is to use a dataset of 5643 abstracts collected from scientific journals on the topic of chronic Lyme disease to demonstrate using Python, the steps for conducting sentiment analysis using pre-trained language models and the process of validating the preliminary results using both interpretable machine learning tools, as well as a novel methodology of using emerging state-of-the-art large language models like ChatGPT. This serves as a useful resource for researchers and practitioners interested in using NLP techniques for sentiment analysis in the medical domain.
Motivation & Objective
- To develop a reproducible NLP workflow for sentiment analysis in medical literature, focusing on controversial topics like chronic Lyme disease.
- To evaluate the presence of bias in scientific discourse surrounding post-treatment Lyme disease syndrome (PTLDS) using computational methods.
- To validate sentiment predictions using both SHAP for model interpretability and ChatGPT for human-like text interpretation.
- To demonstrate that hybrid approaches combining pre-trained models and LLMs enhance reliability in sentiment analysis of scientific text.
Proposed method
- Utilized a dataset of 5,643 scientific abstracts on chronic Lyme disease collected from journals (2000–2021).
- Applied the pre-trained BERT model 'nlptown/bert-base-multilingual-uncased-sentiment' for sentiment classification, handling long abstracts via tokenization and weighted averaging.
- Employed SHAP (SHapley Additive exPlanations) to generate feature-level interpretability, visualizing word-level contributions to sentiment predictions.
- Validated model outputs using GPT-3 via ChatGPT, prompting it to classify sentiment (1–5) and identify subjectively charged terms.
- Used Python with the Hugging Face Transformers and SHAP libraries for model inference and explainability.
- Addressed domain mismatch by acknowledging that general-purpose BERT models may misclassify medical terms due to training on non-medical text (e.g., 'pathology' as neutral in medicine, negative in business contexts).
Experimental results
Research questions
- RQ1Can pre-trained language models like BERT reliably detect sentiment in scientific abstracts that aim for objectivity?
- RQ2How consistent are sentiment predictions from BERT when cross-validated using a large language model like ChatGPT?
- RQ3To what extent can SHAP values explain the contribution of individual words to sentiment predictions in medical text?
- RQ4How does domain mismatch between pre-trained models (trained on reviews) and medical text affect sentiment classification accuracy?
- RQ5Can hybrid approaches using LLMs and explainable AI tools improve interpretability and trust in sentiment analysis of controversial medical topics?
Key findings
- The BERT model successfully assigned sentiment scores to 5,643 scientific abstracts despite the typically neutral tone of medical literature.
- SHAP analysis revealed that specific medical terms and phrases contributed meaningfully to sentiment predictions, enhancing model transparency.
- ChatGPT’s sentiment classification (1–5 scale) and subjectivity identification showed strong agreement with BERT predictions, validating the model’s output.
- The study confirmed that domain mismatch remains a challenge, as medical terminology like 'pathology' may be misclassified due to non-medical training data.
- The integration of LLMs like ChatGPT for validation provides a practical, interpretable method for cross-checking sentiment analysis results in scientific text.
- The authors conclude that combining BERT with LLMs and SHAP offers a robust, interpretable, and scalable approach for sentiment analysis in medical discourse.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.