arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2111.00580cs.SEcs.CLcs.LG
收藏

基于任务的Source Code相关问题的文本分类

Text Classification for Task-based Source Code Related Questions

Sairamvinay Vijayaraghavan, Jinxiao Song, David Tomassi, Siddhartha Punj, Jailan Sabet

摘要:

有一个关键的需求是为开发人员的小任务自动生成代码。像StackOverflow这样的网站提供了一种简单的方法,通过提供小片段的解决方案,为开发人员想要编码的任何任务问题提供完整的答案。自然语言处理,特别是语音识别系统在解决和处理这些任务方面非常有帮助。在本文中,我们开发了一个双重深度学习模型:Seq2Seq和一个二元分类器,它接受意图(自然语言)和Python中的代码片段。我们在Seq2Seq模型中训练意图和代码话语,其中我们决定比较来自编码器的隐藏层嵌入用于表示意图的效果,并且类似地,使用解码器的隐藏层嵌入用于代码序列。然后,我们结合这两个嵌入,然后训练一个简单的二进制神经网络分类器模型,用于预测如果意图是正确回答的预测代码序列从seq2seq模型。我们发现,隐藏状态层的嵌入执行略好于常规的标准嵌入从构造的词汇表。除了StaQC数据库(由简单的基于任务代码片段的对组成)之外,我们还在CoNaLa数据集上进行了测试。我们根据经验确定,与使用seq2seq模型中的隐藏状态上下文向量相比,在Python中为代码片段使用额外的预训练嵌入较少基于上下文。

英文摘要:

There is a key demand to automatically generate code for small tasks for developers. Websites such as StackOverflow provide a simplistic way by offering solutions in small snippets which provide a complete answer to whatever task question the developer wants to code. Natural Language Processing and particularly Question-Answering Systems are very helpful in resolving and working on these tasks. In this paper, we develop a two-fold deep learning model: Seq2Seq and a binary classifier that takes in the intent (which is in natural language) and code snippets in Python. We train both the intent and the code utterances in the Seq2Seq model, where we decided to compare the effect of the hidden layer embedding from the encoder for representing the intent and similarly, using the decoder's hidden layer embeddings for the code sequence. Then we combine both these embeddings and then train a simple binary neural network classifier model for predicting if the intent is correctly answered by the predicted code sequence from the seq2seq model. We find that the hidden state layer's embeddings perform slightly better than regular standard embeddings from a constructed vocabulary. We experimented with our tests on the CoNaLa dataset in addition to the StaQC database consisting of simple task-code snippet-based pairs. We empirically establish that using additional pre-trained embeddings for code snippets in Python is less context-based in comparison to using hidden state context vectors from seq2seq models.

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

↑