arrow
Return

Leveraging large language models for sentiment analysis in GitHub pull request discussions

delete2026-05-09
delete0
delete
OA
AI
D
Daniel Coutinho *
B
Breno Braga
T
Theo Canuto
J
Juliana Alves Pereira
W
Wesley K. G. Assunção
I
Igor Steinmacher
M
Marco Aurélio Gerosa
A
Alessandro Garcia
DOI:10.1007/s10664-026-10868-6delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Social coding platforms like GitHub facilitate collaborative software development through pull requests (PRs), which generate discussions that significantly impact code quality, requirements, and design. Such conversations become a rich source of insights for improving development practices and predicting project outcomes and are subject to several human aspects that have been linked to code quality and PR acceptance. Sentiment analysis is one of the many ways to try to understand these human aspects. However, PR discussions are multifaceted, often involving technical jargon and aspects which limits the utility of general-purpose sentiment analysis tools. This has led to the creation of SE-specific tools, but recent studies have also observed that they demonstrate limited effectiveness. Thus, this study explores the potential of using large language models (LLMs) for this purpose, given their enhanced contextual understanding and ability to process technical language. We evaluated ten LLMs across proprietary and open-source categories, using two complementary datasets: a curated Gold dataset and the PRemo dataset, which captures real-world PR discussions. The models were assessed under zero-shot, few-shot and chain-of-thought prompting techniques on 8,913 messages. In addition, we establish baselines by evaluating fine-tuned transformer-based models. Results show that GPT-4o achieved the highest overall performance across the LLMs, though smaller models, such as Mistral Small and Deepseek-R1 32B delivered competitive results. Transformer-based models achieved excellent performance on the Gold dataset but exhibited degradation on the PRemo dataset. Finally, we conducted a qualitative analysis of misclassified instances, revealing recurring challenges related to technical terminology, sentiment-charged keywords, message length, and contextual ambiguity. These findings suggest that model selection should balance performance requirements against practical constraints, rather than defaulting to the largest available models.
Keywords:
Large language models
Human aspects
Sentiment analysis
Prompt engineering

Journal

Empirical Software Engineering cover
Empirical Software Engineering
IF:
3.6
Papers:
2.0K
Citations:
5.3K

Organization

N
Northern Arizona University
Scholars:
4.5K
Papers: 3.7K
Citations: 8.6K
P
pontifical catholic university of rio de janeiro
Scholars:
170
Papers: 77
Citations: 0
N
North Carolina State University
Scholars:
2.6W
Papers: 2.3W
Citations: 3.7W
researcher View more organizations
Cited Papers

Cited Papers

errShare
errSave
GitHub Discussions: An exploratory study of early adoption
err2021-10-22
err22
errOAAI
errHata, Hideaki; Novielli, Nicole; Baltes, Sebastian; Kula, Raula Gaikovina; Treude, Christoph
errShare
errSave
Sentiment Analysis Based on Deep Learning: A Comparative Study
err2020-03-14
err0
errOAAI
errNhan Cach Dang; María N. Moreno-García; Fernando De la Prieta
errShare
errSave
Pull Request Decisions Explained: An Empirical Overview
err2023-02-01
err13
errOAAI
errZhang, Xunhui; Yu, Yue; Gousios, Georgios; Rastogi, Ayushi
errShare
errSave
Locating Latent Design Information in Developer Discussions: A Study on Pull Requests
err2021-07-01
err15
PREAI
errViviani, Giovanni; Famelis, Michalis; Xia, Xin; Janik-Jones, Calahan; Murphy, Gail C.
errShare
errSave
A topological analysis of communication channels for knowledge sharing in contemporary GitHub projects
err2019-12-01
err22
errOAAI
errTantisuwankul, Jirateep; Nugroho, Yusuf Sulistyo; Kula, Raula Gaikovina; Hata, Hideaki; Rungsawang, Arnon; Leelaprute, Pattara; Matsumoto, Kenichi
errShare
errSave
errShare
errSave
researcher View more