CommitBERT:使用预训练的程序设计语言模型生成提交消息
CommitBERT: Commit Message Generation Using Pre-Trained Programming Language Model
摘要:
提交消息是用自然语言总结源代码更改的文档。一个好的提交消息可以清楚地显示源代码的更改,因此这可以增强开发人员之间的协作。因此,我们的工作是开发一个自动写入提交消息的模型。为此,我们发布了345 K数据集,其中包含六种程序设计语言(Python、PHP、Go、Java、JavaScript和Ruby)的代码修改和提交消息。类似于神经机器翻译(NMT)模型,使用我们的数据集,我们将代码修改馈送到编码器输入,将提交消息馈送到解码器输入,并使用BLEU-4测量生成的提交消息的结果。此外,我们提出了以下两种训练方法来改善生成提交消息的结果:(1)预处理输入的方法,以将代码修改馈送到编码器输入。(2)一种使用适合于代码域的初始权重来减小程序设计语言(PL)和自然语言(NL)之间的上下文表示中的差距的方法。训练代码、数据集和预训练权重可在https://github.com/graykode/commit-autosuggestions上获得
英文摘要:
Commit message is a document that summarizes source code changes in natural language. A good commit message clearly shows the source code changes, so this enhances collaboration between developers. Therefore, our work is to develop a model that automatically writes the commit message. To this end, we release 345K datasets consisting of code modification and commit messages in six programming languages (Python, PHP, Go, Java, JavaScript, and Ruby). Similar to the neural machine translation (NMT) model, using our dataset, we feed the code modification to the encoder input and the commit message to the decoder input and measure the result of the generated commit message with BLEU-4. Also, we propose the following two training methods to improve the result of generating the commit message: (1) A method of preprocessing the input to feed the code modification to the encoder input. (2) A method that uses an initial weight suitable for the code domain to reduce the gap in contextual representation between programming language (PL) and natural language (NL). Training code, dataset, and pre-trained weights are available at https://github.com/graykode/commit-autosuggestions
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。