Manuscript Offprint

arXiv:2610.19961

Taming the Online Software Engineering Tongue: Detecting and Reducing Offensive Language in Software Communities

Jithin Cheriyan, Bastin Tony Roy Savarimuthu, Stephen Cranefield

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Online Software Engineering (SE) communities such as Stack Overflow have become unwelcoming and hostile spaces, as evidenced by the presence of rude and offensive comments that are detrimental to the emotional wellbeing of participants. The main objective of this work is to investigate the prevalence and nature of offensive language in online SE communities, and develop approaches to classify them with the ultimate goal of reducing offensive language by proposing an Offensive Language Reduction System (OLRS-SE) that has the ability to detect, classify, and explain to the poster why a comment is offensive and also propose non-offensive alternative suggestions. Using data from 130,000 user comments on discussions held in four prominent SE platforms: Stack Overflow, GitHub, Gitter and Slack, we developed six sets of twelve (72 in total) different machine learning models (both traditional and deep learning). The F1-Score of the best performing models in the system ranges from 0.56 to 0.94, with an average F1-Score of 0.85, predominantly using BERT as the primary model for various classification tasks. Also, two language-based models were developed for paraphrasing offensive to non-offensive comments. The overall utility of the OLRS-SE was evaluated using user studies with 30 participants, which showed that the developed system is easy to use and also effective in reducing offensive language. Investigating the capabilities of different large language models for offensive language reduction is a promising avenue for future research.

Keywords: Online SE communities, Offensive language, Recommendation system

1. Introduction

Online social networking platforms such as Facebook and Twitter have created opportunities for individuals to interact within virtual communities. In the software development domain, Stack Overflow (SO) 1^{1}, is a platform well-known for its technical question-answering and problem-solving support for professionals and enthusiast programmers. Similar online SE platforms include GitHub 2^{2}, Gitter 3^{3} and Slack 4^{4}. Interactions between users of these applications are generally observed as professional, positive and inclusive [1]. The Code of Conduct (CoC) 5^{5} of SO calls for its members to be inclusive and respectful. However, hate speech and abusive language usage have increasingly been observed on the rise [1, 2, 3].

SO archive 6^{6} maintains sample offensive comments, which reveals the presence of offence and hostility in the platform 7^{7}. This normative shift of SO to unwelcoming and less inclusive creates mental health issues [4] that can cause members to leave the platform [5]. Moreover, newcomers face hurdles on the site such as negligence of posts, deleting or closing of posts, and downvoting from others without proper reasoning [6]. This gradual onset of impoliteness has been admitted by the former executive Vice President of SO who noted that “too many people experience Stack Overflow as a hostile or elitist place, especially newer coders, women, people of color, and others in marginalized groups” [5]. Thus, investigating the prevalence of offensive language, their classes, and exploring approaches that can reduce such offences on online SE platforms form the context of this work. To address this problem, we propose a novel framework termed Offensive Language Reduction System for Software Engineering (OLRS-SE) which can detect and classify offence, explain the reason for offensiveness in a comment and propose potential non-offensive suggestions for an offensive comment. Therefore, the specific research questions that we address in this work are:

RQ1: What is the nature and prevalence of offensive language in

1^{1}Stack Overflow: https://stackoverflow.com

2^{2}GitHub: https://github.com

3^{3}Gitter: https://gitter.im

4^{4}Slack: https://slack.com

5^{5}Stack Overflow CoC: https://stackoverflow.com/conduct

6^{6}Stack Overflow archive: https://meta.stackoverflow.com/questions/326494

7^{7}Disclaimer: This work contains comments that carry strong language or profanity, which may be offensive or upsetting to some readers. Hence, reader discretion is advised.

SE communities?

RQ2: How can an Offensive Language Reduction System for Software Engineering (OLRS-SE) be developed?

RQ2.1: How can we develop approaches to accurately detect and classify offensive language in online SE communities, using machine learning techniques?

RQ2.2: How can we develop approaches to explain offensive language to its poster and also rephrase offensive ones into less offensive ones using language models?

The paper is structured as follows. Section 2 presents the methodology for detecting and reducing offensive language in SE communities by proposing the recommendation system. The results for RQ1 and RQ2 are presented in Section 3. The utility of the developed system is evaluated in Section 4. Section 5 discusses the implications of the results, Section 6 discusses related work on the detection and classification of offensive language in SE communities, and Section 7 concludes the paper.

References (68)