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:
1.9K
Citations:
5.3K

Organization

N
Northern Arizona University
Scholars:
4.4K
Papers: 3.6K
Citations: 8.6K
P
pontifical catholic university of rio de janeiro
Scholars:
155
Papers: 70
Citations: 0
N
North Carolina State University
Scholars:
2.6W
Papers: 2.3W
Citations: 3.7W
researcher View more organizations