arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1809.07954cs.SEcs.LGstat.ML
收藏

用自然语言处理预测StackOverflow的问题和片段的程序设计语言

Predicting the Programming Language of Questions and Snippets of StackOverflow Using Natural Language Processing

University of Victoria(维多利亚大学)

Kamel Alreshedy, Dhanush Dharmaretnam, Daniel M. German, Venkatesh Srinivasan, T. Aaron Gulliver

摘要:

Stack Overflow是软件开发人员中最受欢迎的Q&A网站。作为一个知识共享和获取的平台,Stack Overflow中发布的问题通常包含一个代码片段。Stack Overflow依赖于用户正确地标记问题的程序设计语言,它只是假设问题内部代码段的程序设计语言与问题本身的标记相同。在本文中,我们提出了一个分类器来预测使用自然语言处理(NLP)和机器学习(ML)在堆栈溢出中发布的问题的程序设计语言。该分类器通过结合问题的标题、正文和代码片段的特征,在预测24种最流行的程序设计语言方面达到了91.1%的准确率。我们还提出了一个分类器,只使用标题和身体的问题,并有81.1%的准确率。最后,我们提出了一个分类器的代码片段,只有达到77.7%的准确率。这些结果表明,将机器学习技术部署在问题的文本和代码片段的组合上可以提供最佳性能。这些结果还表明,可以识别几行源代码的片段的程序设计语言。我们可视化的两个程序设计语言Java和SQL的特征空间,以确定堆栈溢出中的问题对应于这些语言的信息的一些特殊属性。

英文摘要:

Stack Overflow is the most popular Q&A website among software developers. As a platform for knowledge sharing and acquisition, the questions posted in Stack Overflow usually contain a code snippet. Stack Overflow relies on users to properly tag the programming language of a question and it simply assumes that the programming language of the snippets inside a question is the same as the tag of the question itself. In this paper, we propose a classifier to predict the programming language of questions posted in Stack Overflow using Natural Language Processing (NLP) and Machine Learning (ML). The classifier achieves an accuracy of 91.1% in predicting the 24 most popular programming languages by combining features from the title, body and the code snippets of the question. We also propose a classifier that only uses the title and body of the question and has an accuracy of 81.1%. Finally, we propose a classifier of code snippets only that achieves an accuracy of 77.7%. These results show that deploying Machine Learning techniques on the combination of text and the code snippets of a question provides the best performance. These results demonstrate also that it is possible to identify the programming language of a snippet of few lines of source code. We visualize the feature space of two programming languages Java and SQL in order to identify some special properties of information inside the questions in Stack Overflow corresponding to these languages.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑