零样本学习让软件工程情感分析不再依赖标注数据。
Sentiment analysis for software engineering: How far can zero-shot learning (ZSL) go?
- 用零样本学习技术直接分析代码评论情绪,无需人工标注。
- 部分方法性能接近微调模型,宏平均F1值达0.68以上。
- 适合缺乏标注数据的软件工程研究者快速开展情绪分析。
软件工程中的情感分析旨在理解代码相关文本中表达的情绪。以往研究指出,通用情感分析工具在该领域表现有限,亟需针对特定场景定制化工具。但这类工具开发依赖有监督机器学习,需大量人工标注数据,而获取这些数据需领域知识且成本高昂。本研究探索零样本学习(ZSL)在解决标注数据稀缺问题上的潜力。我们通过实证实验评估了基于嵌入、自然语言推理(NLI)、TARS和生成式等多种ZSL技术,在不同标签设置下的表现,并与最先进的微调Transformer模型进行对比。结果表明,结合专家标注标签与嵌入或生成式模型的ZSL方法,可达到与微调模型相当的性能,宏平均F1得分最高达0.68。错误分析显示,标注主观性及事实极性是主要误判原因。结论:ZSL在软件工程情感分析中具有显著潜力,能有效缓解对标注数据的依赖。
原文摘要 · Abstract (English)
Sentiment analysis in software engineering focuses on understanding emotions expressed in software artifacts. Previous research highlighted the limitations of applying general off-the-shelf sentiment analysis tools within the software engineering domain and indicated the need for specialized tools tailored to various software engineering contexts. The development of such tools heavily relies on supervised machine learning techniques that necessitate annotated datasets. Acquiring such datasets is a substantial challenge, as it requires domain-specific expertise and significant effort. Objective: This study explores the potential of ZSL to address the scarcity of annotated datasets in sentiment analysis within software engineering Method:} We conducted an empirical experiment to evaluate the performance of various ZSL techniques, including embedding-based, NLI-based, TARS-based, and generative-based ZSL techniques. We assessed the performance of these techniques under different labels setups to examine the impact of label configurations. Additionally, we compared the results of the ZSL techniques with state-of-the-art fine-tuned transformer-based models. Finally, we performed an error analysis to identify the primary causes of misclassifications. Results: Our findings demonstrate that ZSL techniques, particularly those combining expert-curated labels with embedding-based or generative-based models, can achieve macro-F1 scores comparable to fine-tuned transformer-based models. The error analysis revealed that subjectivity in annotation and polar facts are the main contributors to ZSL misclassifications. Conclusion: This study demonstrates the potential of ZSL for sentiment analysis in software engineering. ZSL can provide a solution to the challenge of annotated dataset scarcity by reducing reliance on annotated dataset.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。