Supercharge Your Innovation With Domain-Expert AI Agents!

Code annotation generation method based on multiple source code representation and recurrent neural network

A recurrent neural network and source code technology, applied in the field of code comment generation, can solve the problems of low efficiency and high comment cost

Inactive Publication Date: 2022-07-29
NANTONG UNIVERSITY
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] Manually writing comments is expensive and inefficient, so people try to use computers to automatically generate comments for code

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 multiple source code representation and recurrent neural network
  • Code annotation generation method based on multiple source code representation and recurrent neural network
  • Code annotation generation method based on multiple source code representation and recurrent neural network

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0038] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, the following will be described in detail with reference to the accompanying drawings and specific embodiments.

[0039] like figure 1 As shown, the present invention provides a code annotation generation method based on multiple source code representation and cyclic neural network, which is mainly used to help users generate code annotations, including the following steps:

[0040] S1. Collect Java code annotation pairs to build a corpus;

[0041] S2. In the serialization processing layer, the source code in the corpus is converted into token sequence, SBT sequence and API sequence;

[0042] S3. In the encoder layer, the bidirectional GRU is used as the encoder, and the codeseq encoder, the SBTseq encoder and the APIseq encoder are respectively constructed for the three sequences, and the information of different levels of the source...

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 code annotation generation method based on multiple source code representation and a recurrent neural network, comprising the following steps: S1, collecting Java code annotation pairs, and constructing a corpus; s2, in a serialization processing layer, converting the source code in the corpus into a token sequence, an SBT sequence and an API sequence; s3, in an encoder layer, a bidirectional GRU is used as an encoder, a codeseq encoder, an SBTseq encoder and an APIseq encoder are constructed for the three sequences respectively, and information of different levels of source codes is learned; s4, in a decoder layer, using a one-way GRU to construct a decoder, and using a teach forming strategy to train a model; and S5, adding an attention layer behind each encoder in the three encoders, linking attention matrixes input by the three encoders and input by the decoder, learning how to combine each input code by using a full connection layer, and finally outputting code annotations. The code annotation generation accuracy is improved, the efficiency of software developers in the software development process is improved, and the development time is saved.

Description

technical field [0001] The invention belongs to the technical field of code annotation generation, and in particular relates to a code annotation generation method based on multiple source code representations and a cyclic neural network, which is mainly used for generating corresponding annotations for source code fragments input by users. Background technique [0002] In the field of software engineering, when faced with a large number of large-scale software and complex systems, software personnel need to read the code quickly and accurately, and efficiently complete tasks such as software change and maintenance. Code comments can help developers and maintainers to read the source code faster, better understand the design ideas behind the code and the behavior of the code, greatly save the precious time of developers and maintainers, and improve work efficiency. Given this, code comments play a very important role throughout the software declaration cycle. [0003] Writi...

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/73G06F40/289G06N3/04G06N3/08
CPCG06F8/73G06F40/289G06N3/08G06N3/045
Inventor 文万志支宝胡晨楚加卫王晨宇陈义祁佳篁王楚越胡彬
Owner NANTONG UNIVERSITY
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More