Meta-learning-based code self-adaptive generation method

A code generation and self-adaptive technology, applied in neural learning methods, creating/generating source code, biological neural network models, etc., can solve problems such as inability to adapt quickly, damage generalization performance, and take a long time

Active Publication Date: 2020-12-22
NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF12 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, this approach may hurt generalization performance and takes a lot of

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
  • Meta-learning-based code self-adaptive generation method
  • Meta-learning-based code self-adaptive generation method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0020] Below in conjunction with accompanying drawing, technical scheme of the present invention is described in further detail:

[0021] The present invention is a code adaptive generation method based on meta-learning, comprising the following steps:

[0022] S1: Build the training data set

[0023] Preprocess the code data obtained from the open source code database - first parse the code data into an abstract syntax tree, (AST); use the names of the non-terminal symbols in the program grammar to mark the syntax nodes, and the syntax tokens are marked with strings; After data flow (Data Flow) analysis and control flow (Control Flow) analysis, the relationship between the nodes in the abstract syntax tree in the data flow and control flow is obtained. For example, we add additional edges to represent these relationship information in the abstract syntax tree. After preprocessing, the code map containing the semantic information of the code context is obtained; a simple expr...

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 discloses a meta-learning-based code self-adaptive generation method, which comprises the following steps of firstly, constructing a data set containing different code styles, training abasic code generation model which adopts an encoder decoder structure, and calculating the state vector of a code graph by using a graph neural network through an encoder; representing current context information of the program; enabling the decoder to generate a target code expression according to the context information by using a generation rule in the language grammar; learning different codestyles through meta-learning, so that a self-adaptive code generation model capable of quickly and accurately learning new style codes is trained; and finally, enabling the user to specify a target style code, carrying out a meta-training process on the adaptive code generation model, thus the model can generate a code with a target style. According to the code generation method, a meta-learningtechnology is introduced, and codes can be generated correctly and efficiently according to different personalized code styles of programmers.

Description

technical field [0001] The invention relates to a method for self-adaptive code generation based on meta-learning, in particular to a method for self-adaptive code generation by using program static analysis, graph neural network technology and meta-learning technology, and belongs to the technical field of software engineering. Background technique [0002] An integrated development environment (IDE) has become a fundamental paradigm for modern software engineers, providing a set of useful services to accelerate software development. Code generation (completion) is one of the most valuable features in an IDE, especially when the developer is new to the codebase. It can suggest the next possible code unit, such as a variable name or function call, including API calls. In recent years, researchers have proposed many code generation models, which use machine learning techniques to extract data from a large number of open source code databases for training. However, different ...

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
IPC IPC(8): G06F8/30G06N3/08
CPCG06F8/30G06N3/08
Inventor 张智轶方立宇黄志球陶传奇张静宣杨文华周宇
Owner NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
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