Font Size: a A A

Automatic Code Comment Generation Model Based On GRU+GCN Dual Encoder

Posted on:2022-05-24Degree:MasterType:Thesis
Country:ChinaCandidate:H B ZhanFull Text:PDF
GTID:2518306497451984Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
Comments can improve the readability of the code very well,and bring great convenience to the maintenance,cooperation and sharing of software projects.The importance of the project is self-evident;however,there are missing or incomplete comments in many projects.Automatic code comment generation can effectively make up for the missing comments of these projects and generate comments for newly developed projects to save developers time.In recent years,the research of automatic code annotation generation has focused on the implementation of deep learning methods,and the structural information of the code described by AST is integrated into the model.At present,these methods usually use sequence-to-sequence models based on cyclic networks,and cannot use tree-like AST as a direct input,resulting in incomplete utilization of AST information.We propose a dual encoder model of GRU+GCN to generate method-level annotations for Java code.The GRU network is selected to encode the semantic information of the code,and the GCN is used as the encoder of the AST to encode the structural information of the code.The experimental results show that the annotations generated by the model in this paper are generally qualified,which proves the effectiveness of the model.At the same time,the model in this paper has scores of 45.58,23.58,and 20.67 on S-BLEU(%),C-BLEU(%),and METEOR(%)respectively,and generally achieved relatively good results.But on the other hand,the model in this article is only about 1.4 higher than the single semantic encoder model.This phenomenon once again shows that the encoding of code structure information still has lots of work to do in the future.
Keywords/Search Tags:Code comment generation, AST, deep learning, GRU, GCN
PDF Full Text Request
Related items