arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1906.01032cs.LGcs.CLcs.SEstat.ML
收藏

语义Source Code标注的一种与语义无关的模型

A Language-Agnostic Model for Semantic Source Code Labeling

Two Six Labs, LLC.(Two Six Labs有限责任公司);Sophos(Sophos公司)

Ben Gelman, Bryan Hoyle, Jessica Moore, Joshua Saxe, David Slater

摘要:

近年来,由于可用源代码的快速扩展,代码搜索和理解变得更加困难。当前的工具缺乏一种方法来大规模地标记任意代码,同时保持新的程序设计语言、库和功能的最新表示。对源代码的全面标记使用户能够搜索感兴趣的文档并对其内容进行深入了解。我们使用Stack Overflow代码片段及其标签来训练一个与语言无关的深度卷积神经网络,以自动预测源代码文档的语义标签。在Stack Overflow代码片段上,我们展示了在4,508个标签的长尾列表上ROC下的平均面积为0.957。我们还在从Github检索的各种未标记源代码文档上手动验证了模型输出,我们获得了86.6%的top-1准确率。这强烈表明该模型成功地将其知识从Stack Overflow片段转移到任意源代码文档。

英文摘要:

Code search and comprehension have become more difficult in recent years due to the rapid expansion of available source code. Current tools lack a way to label arbitrary code at scale while maintaining up-to-date representations of new programming languages, libraries, and functionalities. Comprehensive labeling of source code enables users to search for documents of interest and obtain a high-level understanding of their contents. We use Stack Overflow code snippets and their tags to train a language-agnostic, deep convolutional neural network to automatically predict semantic labels for source code documents. On Stack Overflow code snippets, we demonstrate a mean area under ROC of 0.957 over a long-tailed list of 4,508 tags. We also manually validate the model outputs on a diverse set of unlabeled source code documents retrieved from Github, and we obtain a top-1 accuracy of 86.6%. This strongly indicates that the model successfully transfers its knowledge from Stack Overflow snippets to arbitrary source code documents.

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

↑