| With the continuous popularization of computers in human production and life,and the emergence of emerging computing models such as cloud computing and big data,software development and maintenance has become an important discipline.However,in the development and maintenance of computer software,it remains the same.There will be many problems,and the contradiction between high cost and low quality of software development has always existed objectively and needs to be solved urgently.In the process of developing new technologies and software systems,code auto-generation or search tools can help developers to quickly complete the programming tasks they want to implement.For a code function statement,developers often use some code-assisted tools.Write programs that reuse existing frameworks and libraries to increase the efficiency of programming.The natural language processing technology involved in code assisting tools has gradually become an important research direction.Programmers often search for the correct code fragments by inputting natural language queries to implement some or some code statement functions.In actual development,the query format input by the developer is diverse and free,such as Chinese,English or English mixed code query format.Therefore,how to separately process multiple free-form queries and automatically generate the optimal results to satisfy the query request is a potential challenge.To this end,this paper builds a code fragment generation method that responds to free-form queries.The basic idea is to specifically process the above three types of format queries and construct corresponding code generation tools respectively,and optimize the sorting algorithm to realize the optimal result recommendation when multiple formats query meet the same request,thereby generating user satisfaction based on user query.Code snippet.The free format referred to in this paper is a query that responds to the user’s Chinese input query,English input query,and English plus code.The specific research objectives are as follows:1)For the problem that the query has multiple free formats,a method for responding to multiple format queries is proposed,which can respond to the input free-form query request.In terms of inputting different formats,three different inputs are optimized and processed to improve the intelligence and practicability of the method.2)For the optimal result recommendation problem when querying the same request in multiple formats,a Markov model-based code segment sorting method is proposed,which can classify the generated results and score according to the probability model,thus providing developers with alternatives.A list of candidate rankings to quickly locate the best results.The main key issues addressed in this paper are as follows:1)Technically critical issues: For the processing of Chinese format input queries,Word2 vec and Encoder-Decoder are used;for inputting query processing in English plus code format,the model of Seq2 Seq with attention mechanism is used.2)Design critical issues: Designed a processing flow that responds to free-form queries,providing the accuracy of generating code snippets for input queries in three types of formats.3)Model key issues: A codeset library model and a Markov model that combine the corpus model and the bag model are proposed,which can improve the usability of the code segment generation method. |