๐ค AI Summary
This study addresses the prevalence of toxic comments in open-source code review discussions, which undermines collaborative environments. To mitigate this issue, the authors propose ToxiShieldโthe first real-time system tailored for detecting and detoxifying harmful remarks in code review contexts. ToxiShield integrates three core components: toxicity identification, multi-category classification, and text detoxification. Methodologically, it leverages a fine-tuned BERT model achieving 97% F1 in binary toxicity detection, prompt engineering with Claude 3.5 Sonnet yielding 42% F1 for multi-class categorization, and a fine-tuned Llama 3.2 model for high-fidelity detoxification, attaining a style-transfer accuracy of 95.27% and a J-score of 84%. Empirical validation by developers demonstrates that ToxiShield significantly enhances community inclusivity and effectively reduces toxicity in practice.
๐ Abstract
Toxic interactions in open-source software development harm community collaboration. To combat this, we propose ToxiShield, a realtime browser extension that identifies and detoxifies toxic code reviews. The framework comprises three modules: toxicity identification, reasoned multiclass classification, and code review detoxification. Our fine-tuned BERT-based binary classifier achieved a 97% F1-score on 38,761 code review texts. For multiclass classification, Claude 3.5 Sonnet with prompt engineering achieved a 39% MCC and 42% F1 on 1,200 samples. Finally, our fine-tuned Llama 3.2 detoxification model reached 95.27% style transfer accuracy, 97.03% fluency, 67.07% content preservation, and an 84% J-score. Validation with 10 software developers suggests ToxiShield effectively fosters a more inclusive open-source environment.