Code annotation generation method based on machine translation model

A comment and code technology, applied in the field of software development, can solve problems such as structural information improving model accuracy and unreasonableness

Active Publication Date: 2020-05-01
SUN YAT SEN UNIV
View PDF3 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0010] These two ideas are opposite to natural language processing. The generation of code comments uses code fragments to generate comments, and the source code written in a programming language has a clear structure. Existing methods have not utilized rich structural information to improve Model Accuracy
Secondly, since the code contains many variable names, the established dictionary will be very large. For example, there are 790,000 unique identifiers in the data set. If the common training dimension of 30,000 is used, more than 95% of the vocabulary will be regarded as unknown. According to the research shows that it is unreasonable

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
  • Code annotation generation method based on machine translation model
  • Code annotation generation method based on machine translation model
  • Code annotation generation method based on machine translation model

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0047] In describing the present invention, it should be understood that the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", " Back", "Left", "Right", "Vertical", "Horizontal", "Top", "Bottom", "Inner", "Outer", "Clockwise", "Counterclockwise", "Axial", The orientation or positional relationship indicated by "radial", "circumferential", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying the referred device or element Must be in a particular orientation, be constructed in a particular orientation, and operate in a particular orientation, and therefore should not be construed as limiting the invention.

[0048] In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative impo...

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 code annotation generation method based on a machine translation model. The code annotation generation method comprises the steps that an obtained code corpus containing annotations is divided into a source code method sequence corpus and a corresponding source code annotation corpus; inputting source code annotations in a source code annotation corpus into the seq2seq model; extracting a source code method sequence to generate an abstract syntax tree, replacing identifiers of nodes with node categories, performing structured traversal to obtain a sequence with reserved structure information, and inputting the sequence into a seq2seq model; inputting the structural information into a coding layer to generate a coding output of an implicit state sequence and the structural information, inputting the coding output into an attention mechanism layer, and calculating a context vector according to the matching degree between the coding output of the implicit state sequence and the structural information; inputting the coding output of the structure information and the context vector into a decoding layer, and calculating the sequence probability distribution ofthe training sample target; a sequence-based machine translation model is generated from the source code annotations and the sequence probability distribution.

Description

technical field [0001] The invention relates to the field of software development, in particular to a code comment generation method based on a machine translation model. Background technique [0002] With the continuous development of the Internet era, it involves more and more fields, and the various platform software systems applied to it are becoming larger and larger, which adds complicated difficulties to the maintenance work of later software maintenance personnel. In software engineering, reading code is a basic task, and generally speaking, software maintainers are usually not the original developers, and personnel turnover causes developers to have to take over unfamiliar software code, which also needs to be dealt with in code reviews Lots of unfamiliar source code. Another study shows that in the development of large-scale enterprise applications, developers often spend more time reading code than writing code. At this point, code comments can help in this matt...

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/73G06F40/58G06F40/242G06N3/04
CPCG06F8/73G06N3/049Y02D10/00
Inventor 郑子彬马蒙蒙周晓聪
Owner SUN YAT SEN 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