Enhanced code annotation automatic generation method and system

An automatically generated and enhanced technology, which is applied to biological neural network models, software maintenance/management, program files, etc., can solve maintenance work that consumes energy and time of programmers, cannot adapt to software code, and cannot meet diversified programming methods and other issues to achieve the effect of improving accuracy

Active Publication Date: 2020-08-11
SHANDONG NORMAL UNIV
View PDF9 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] (1) After the software is put into use, programmers need to maintain the software, remove obstacles, make the software work normally, and expand the functions of the software to improve performance; and for a large number of software codes, if the software codes are not matched with high-quality , High-precision cod

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
  • Enhanced code annotation automatic generation method and system
  • Enhanced code annotation automatic generation method and system
  • Enhanced code annotation automatic generation method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0036] Such as figure 1 As shown, this embodiment provides an enhanced method for automatically generating code annotations, including:

[0037] S1: Extract functional keywords from the obtained code fragments, obtain the position vector of the code fragment according to the keyword vector composed of functional keywords, and use the pre-built function enhancer to obtain the function vector sequence of the code fragment according to the keyword vector and position vector ;

[0038] S2: Merge the obtained bidirectional representation vector and structure vector of the code fragment, and input the merged result and function vector sequence to the encoder to obtain an intermediate vector;

[0039] S3: Obtain the vector sequence of the target annotation and input it into the decoder, and perform multi-head attention mechanism calculation on the vector sequence of the target annotation and the intermediate vector and function vector sequence respectively, so as to construct a sequenc

Embodiment 2

[0114] This embodiment provides an enhanced code annotation automatic generation system, including:

[0115] The first preprocessing module is used to extract functional keywords from the obtained code fragments, obtain the position vector of the code fragment according to the keyword vector composed of the functional keywords, and use the pre-built function enhancer to obtain according to the keyword vector and the position vector A sequence of feature vectors for code snippets;

[0116] The second preprocessing module is used for merging the bidirectional representation vector and the structure vector of the obtained code fragment, and inputting the merging result and the function vector sequence to the encoder to obtain an intermediate vector;

[0117] The model building module is used to obtain the vector sequence of the target annotation and input it into the decoder. The vector sequence of the target annotation is calculated with the intermediate vector and the func

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 an enhanced code annotation automatic generation method and system, and the method comprises the steps: extracting function keywords from an obtained code snippet, obtaining aposition vector of the code snippet according to a keyword vector formed by the function keywords, and obtaining a function vector sequence of the code snippet according to the keyword vector and theposition vector; merging the obtained bidirectional representation vector and structure vector of the code snippet, and inputting the merged bidirectional representation vector and structure vector and a function vector sequence into an encoder to obtain an intermediate vector; obtaining a vector sequence of a target annotation, inputting the vector sequence into a decoder, performing multi-head attention mechanism calculation on the vector sequence of the target annotation with the intermediate vector and the function vector sequence separately, and constructing a sequence-to-sequence neuralnetwork model; and obtaining a target code snippet, and generating a target code annotation according to the model. The model can automatically convert the given code snippets into the target annotations, so that the automation degree and quality of software development are improved.

Description

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

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
Owner SHANDONG NORMAL 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