当前位置: X-MOL 学术Sci. China Inf. Sci. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
LSTM-based argument recommendation for non-API methods
Science China Information Sciences ( IF 7.3 ) Pub Date : 2020-08-14 , DOI: 10.1007/s11432-019-2830-8
Guangjie Li , Hui Liu , Ge Li , Sijie Shen , Hanlin Tang

Automatic code completion is one of the most useful features provided by advanced IDEs. Argument recommendation, as a special kind of code completion, is widely used as well. While existing approaches focus on argument recommendation for popular APIs, a large number of non-API invocations are requesting for accurate argument recommendation as well. To this end, we propose an LSTM-based approach to recommending non-API arguments instantly when method calls are typed in. With data collected from a large corpus of open-source applications, we train an LSTM neural network to recommend actual arguments based on identifiers of the invoked method, the corresponding formal parameter, and a list of syntactically correct candidate arguments. To feed these identifiers into the LSTM neural network, we convert them into fixed-length vectors by Paragraph Vector, an unsupervised neural network based learning algorithm. With the resulting LSTM neural network trained on sample applications, for a given call site we can predict which of the candidate arguments is more likely to be the correct one. We evaluate the proposed approach with tenfold validation on 85 open-source C applications. Results suggest that the proposed approach outperforms the state-of-the-art approaches in recommending non-API arguments. It improves the precision significantly from 71.46% to 83.37%.



中文翻译:

针对非API方法的基于LSTM的参数建议

自动代码完成是高级IDE提供的最有用的功能之一。参数推荐作为一种特殊的代码完成方式,也被广泛使用。尽管现有方法侧重于流行API的参数推荐,但大量非API调用也要求准确的参数推荐。为此,我们提出了一种基于LSTM的方法,该方法可在键入方法调用时立即推荐非API参数。利用从大量开源应用程序集收集的数据,我们训练了LSTM神经网络以根据以下内容推荐实际参数:所调用方法的标识符,相应的形式参数以及语法正确的候选参数列表。为了将这些标识符输入到LSTM神经网络中,我们可以通过“段落向量”将其转换为固定长度的向量,一种无监督的基于神经网络的学习算法。通过在示例应用程序上训练得到的LSTM神经网络,对于给定的调用站点,我们可以预测哪个候选参数更可能是正确的参数。我们通过对85个开源C应用程序进行十倍验证来评估所提出的方法。结果表明,在建议使用非API参数时,建议的方法优于最新方法。它将精度从71.46%提高到83.37%。结果表明,在建议使用非API参数时,建议的方法优于最新方法。它将精度从71.46%提高到83.37%。结果表明,在建议使用非API参数时,建议的方法优于最新方法。它将精度从71.46%提高到83.37%。

更新日期:2020-08-19
down
wechat
bug