Source code annotation automatic generation method

A code and annotation technology, applied in the field of automatic generation of source code annotations, can solve problems such as inability to generate readable summaries, inability to generate new sentences, etc.

Active Publication Date: 2019-11-01
BEIHANG UNIV
View PDF8 Cites 20 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] 1. Since most of the existing information retrieval-based methods extract part of the term vocabulary, it is impossible to generate a readable abstract
Furthermore, methods that simply retrieve existing summaries cannot generate new sentences

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
  • Source code annotation automatic generation method
  • Source code annotation automatic generation method
  • Source code annotation automatic generation method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0010] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not constitute a conflict with each other.

[0011] Such as figure 1 As shown, the present invention proposes a method for automatically generating source code annotations, including an offline stage and a testing stage. In the offline stage, the encoder-decoder model of the training corpus is first collected to train the attention mechanism, and then the code of the training corpus is used to construct the code Retrieval library, the tra...

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 source code annotation automatic generation method. The method comprises an offline stage and a testing stage. In the offline stage, firstly, training corpora are collected totrain an encoder-decoder model of an attention mechanism. Then, the codes of the training corpora are used for constructing a code retrieval library. The training corpora comprise source code fragments and corresponding annotations. In the line testing stage, for the input code snippets, two existing code snippets are searched with similar grammar levels and semantic levels in the code retrievallibrary, and then annotations corresponding to the input code snippets are generated by taking the two similar existing code snippets and the input code snippets as inputs of a neural annotation generation module based on retrieval.

Description

technical field [0001] The invention relates to an automatic generation method, in particular to a source code annotation automatic generation method. Background technique [0002] The purpose of source code summary (code comment generation) is to generate short summary information for a given code, usually in the form of comments. This summary is very important for understanding and maintaining the source code. In the absence of documentation, developers often spend a long time reading and understanding program code. At the same time, when the code is modified, the comments of the code must also be updated accordingly, which increases the maintenance cost. Therefore, exploring the technology of automatically generating code comments can effectively help developers to carry out software development activities. [0003] Most of the early technologies were based on information retrieval methods. Most studies usually extract some keywords from code snippets as the correspon...

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/75
CPCG06F8/75
Inventor 王旭孙海龙张建刘旭东
Owner BEIHANG 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