Unlock instant, AI-driven research and patent intelligence for your innovation.

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 code comments, software maintenance will consume a lot of energy and time of programmers;
[0006] (2) The current method of code comment generation is often aimed at a specific task or requirement, but this method cannot satisfy a variety of programming methods, and cannot adapt to various software codes with different functions

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 sequ...

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 f...

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

technical field [0001] The present disclosure relates to the interdisciplinary technical field of artificial intelligence and software engineering, in particular to a method and system for automatically generating enhanced code annotations. Background technique [0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art. [0003] With the increasing complexity of the modern information environment, especially the large-scale popularization of the mobile Internet, a large number of software with complex functions have appeared, which has increased the difficulty for programmers to maintain and update iterative software. [0004] The inventors of the present disclosure have found that in the process of maintaining and updating the software, there are at least the following problems: [0005] (1) After the software is put into use, programmers need to maintain the software, remove o...

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/73G06N3/04
CPCG06F8/73G06N3/045
Inventor 吕晨姜雪王汝芸高学剑吕蕾刘弘
Owner SHANDONG NORMAL UNIV