| API completion is one of the most frequently used code completion methods by developers.In recent years,the continuous improvement of computing power and the rapid development of big data and artificial intelligence technology bring new possibilities for API completion methods.Among them,statistical language model has been widely concerned in the field of code completion.It uses program representation technology to transform program code into idiom sentence sequence,and then uses n-gram,RNN(recurrent neural network)and other models to predict method calls in code,so as to achieve code completion.However,training model needs to use a large number of corpora,which often come from open source projects on the Internet.There are bound to be differences between the programming habits represented by these projects and the real individual developers.For example,there will be a large number of custom classes and methods in user's personal projects,which has a great negative impact on the performance of code completion in practical application.In order to improve this problem,this paper proposes a method of personalized code completion based on statistical language model,which adds a language model trained by user's personal programming data on the basis of existing methods.Specifically,the main work of this paper includes:1.A complete method of extracting API call sequence from Java program code and converting it into statement sequence is implemented,and a corpus is generated based on a large number of code.2.Through the combination of multiple language models,the personalized API completion model based on user's personal programming habits is realized.In this paper,we first implement a set of mixed language model composed of Ngram model and LSTM model with full data from the Internet Based on this model,a set of language model generated by user's personal data is implemented.3.Based on the above work,the prediction performance of different models in different feature test sets is compared.The experimental results show that the application of personalized model in personal project code completion will have a higher accuracy than the existing model. |