arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1808.06880cs.AIcs.CL
收藏

代码块文本描述注释的自动生成

Automatic Generation of Text Descriptive Comments for Code Blocks

Shanghai Jiao Tong University(上海交通大学)

Yuding Liang, Kenny Q. Zhu

摘要:

我们提出了一个框架来自动生成源代码块的描述性注释。虽然这个问题已经被许多研究人员研究过,但他们的方法大多是基于固定模板,效果不佳。我们的框架不依赖于任何模板,而是利用一种新的递归神经网络称为Code-RNN从源代码中提取特征并将其嵌入到一个向量中。当这个向量表示被输入到一个新的递归神经网络(Code-GRU)时,整个框架生成的代码的文本描述的准确性(Rouge-2值)显着高于其他基于学习的方法,如序列到序列模型。Code-RNN模型也可以用于其他需要代码表示的场景。

英文摘要:

We propose a framework to automatically generate descriptive comments for source code blocks. While this problem has been studied by many researchers previously, their methods are mostly based on fixed template and achieves poor results. Our framework does not rely on any template, but makes use of a new recursive neural network called Code-RNN to extract features from the source code and embed them into one vector. When this vector representation is input to a new recurrent neural network (Code-GRU), the overall framework generates text descriptions of the code with accuracy (Rouge-2 value) significantly higher than other learning-based approaches such as sequence-to-sequence model. The Code-RNN model can also be used in other scenario where the representation of code is required.

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

↑