Current browse context:
cs.SE
Change to browse by:
References & Citations
Computer Science > Software Engineering
Title: Improving Code Summarization with Block-wise Abstract Syntax Tree Splitting
(Submitted on 14 Mar 2021 (v1), last revised 18 Mar 2021 (this version, v2))
Abstract: Automatic code summarization frees software developers from the heavy burden of manual commenting and benefits software development and maintenance. Abstract Syntax Tree (AST), which depicts the source code's syntactic structure, has been incorporated to guide the generation of code summaries. However, existing AST based methods suffer from the difficulty of training and generate inadequate code summaries. In this paper, we present the Block-wise Abstract Syntax Tree Splitting method (BASTS for short), which fully utilizes the rich tree-form syntax structure in ASTs, for improving code summarization. BASTS splits the code of a method based on the blocks in the dominator tree of the Control Flow Graph, and generates a split AST for each code split. Each split AST is then modeled by a Tree-LSTM using a pre-training strategy to capture local non-linear syntax encoding. The learned syntax encoding is combined with code encoding, and fed into Transformer to generate high-quality code summaries. Comprehensive experiments on benchmarks have demonstrated that BASTS significantly outperforms state-of-the-art approaches in terms of various evaluation metrics. To facilitate reproducibility, our implementation is available at this https URL
Submission history
From: Hui Li [view email][v1] Sun, 14 Mar 2021 05:04:06 GMT (621kb,D)
[v2] Thu, 18 Mar 2021 11:15:11 GMT (622kb,D)
Link back to: arXiv, form interface, contact.