Masked Language Modelを利用したAPI推薦手法

書誌事項

タイトル別名
  • API Recommendation Method Using Masked Language Model

この論文をさがす

抄録

多くの開発者は,ソースコードを効率良く記述するためにソースコード推薦機能を用いている.これは,あるカーソル位置までに書かれたソースコードと,既存のソースコードやライブラリに基づいて,その次に記述が可能なコードを開発者に推薦する機能である.本研究では,メソッド呼び出し文の順序を用いてAPIの推薦に限定した手法を提案する.既存のソースコードからメソッド呼び出し文を抽出し,メソッド呼び出し文の並びを作成する.これを深層学習モデルの1つであるMasked Language Modelに学習させる.学習後,そのモデルを用いて,ある指定した場所に適切なメソッド呼び出し文を予測し,開発者に候補を提示する.また,提案する手法を実装しオープンソースコードを用いて実験を行った.記述中のソースコードにおいて,一番後ろの位置で推薦要求をすると,最大48%の精度で推薦された候補の1位に,適切なメソッド呼び出し文が出現することを確認した.また,ソースコードの途中に挿入する形で推薦要求をすると,最大70%の精度で推薦された候補の1位に,適切なものが出現することを確認した.

Many developers use source code recommendations to write source code efficiently. It recommends code that can be written next based on the code written up to a certain cursor position and existing source code and libraries. In this study, we propose a method that is limited to recommending APIs using the order of method call statements. This order is trained on the Masked Language Model, one of the deep learning models. After learning, the model is used to predict the appropriate method call statement for a specified location. The proposed method is implemented and experimented with using open source software. When a recommendation request is made at the end of the source code, an appropriate method call statement appears at the first position of the recommended candidates with an accuracy of up to 48%. When the recommendation request was inserted in the middle of the source code, the appropriate candidate appears at the first position of the recommended candidates with an accuracy of up to 70%.

収録刊行物

詳細情報 詳細情報について

問題の指摘

ページトップへ