Method for automatically completing code on basis of LSTM (Long Short Term Memory)

A technology of automatic completion and code, which is applied in the direction of code compilation, program code conversion, creation/generation of source code, etc. It can solve the problems that cannot be used directly, cannot be recommended by code completion, etc., to ensure accuracy, improve accuracy and The effect of recommendation efficiency

Active Publication Date: 2018-08-10
PEKING UNIV
View PDF11 Cites 26 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the disadvantage of this method is that only when the user enters special characters such as ".", the drop-down menu can appear for code completion, and it is impossible to perform code completion or recommendation in any place (for example, when entering any letter); The recommendation in the drop-down menu is only the class name instead of a piece of code, which still cannot be used directly

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for automatically completing code on basis of LSTM (Long Short Term Memory)
  • Method for automatically completing code on basis of LSTM (Long Short Term Memory)
  • Method for automatically completing code on basis of LSTM (Long Short Term Memory)

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0035] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0036] The invention discloses a deep automatic code generation method, which is realized based on the imported identifier of the long short-term memory network (LSTM). The approach of deep learning can well capture useful features and automatically build a mapping from input to output. The deep automatic code generation of the present invention adopts the import identifier based on LSTM to realize the task of automatic code completion. Apply ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention provides a method for automatically completing codes on the basis of LSTM (Long Short Term Memory). The method comprises the following steps: performing source code processing, and analyzing source codes by using an abstract grammar tree; performing off-line training, and training a language model by using an LSTM model; performing on-line code completion, and completing codes according to the trained language model. The LSTM model comprises constraint character level LSTM and mark character level LSTM with former context marking character encodes. By adopting the method, automatic code completion can be achieved by inputting any character into any place in the encoding process, recommendation of any code can be also achieved, and the recommendation process accuracy can be also ensured. The technical scheme of the invention has the characteristics of being simple and rapid, and the code recommendation accuracy and the recommendation efficiency can be relatively well improved.

Description

technical field [0001] The invention relates to the technical field of computer software engineering, in particular to a method for automatically completing codes based on LSTM. Background technique [0002] Computer automatic code generation is one of the research hotspots in software engineering in recent years. Automatic code generation greatly reduces the workload of programmers and improves development efficiency. With the development of the open source community, we can generate code by analyzing a large amount of code. A major difficulty in automatic code generation is that the source code itself has many constraints and limitations. In recent years, on the basis of the original research on program synthesis based on combinatorial optimization methods, some new methods for program generation based on machine learning techniques have emerged. [0003] According to different technologies and application scenarios, current program generation methods can be divided int...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/30G06F8/41
CPCG06F8/30G06F8/427
Inventor 李戈金芝
Owner PEKING UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products