- Title
- CAST: enhancing code summarization with hierarchical splitting and reconstruction of abstract syntax trees
- Creator
- Shi, Ensheng; Wang, Yanlin; Du, Lun; Zhang, Hongyu; Han, Shi; Zhang, Dongmei; Sun, Hongbin
- Relation
- 2021 Conference on Empirical Methods in Natural Language Processing. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (Online & Punta Cana, Dominican Republic November, 2021) p. 4053-4062
- Publisher Link
- http://dx.doi.org/10.18653/v1/2021.emnlp-main.332
- Publisher
- Association for Computational Linguistics
- Resource Type
- conference paper
- Date
- 2021
- Description
- Code summarization aims to generate concise natural language descriptions of source code, which can help improve program comprehension and maintenance. Recent studies show that syntactic and structural information extracted from abstract syntax trees (ASTs) is conducive to summary generation. However, existing approaches fail to fully capture the rich information in ASTs because of the large size/depth of ASTs. In this paper, we propose a novel model CAST that hierarchically splits and reconstructs ASTs. First, we hierarchically split a large AST into a set of subtrees and utilize a recursive neural network to encode the subtrees. Then, we aggregate the embeddings of subtrees by reconstructing the split ASTs to get the representation of the complete AST. Finally, AST representation, together with source code embedding obtained by a vanilla code token encoder, is used for code summarization. Extensive experiments, including the ablation study and the human evaluation, on benchmarks have demonstrated the power of CAST. To facilitate reproducibility, our code and data are available at https://github.com/DeepSoftwareAnalytics/CAST.
- Subject
- code summarization; source code; abstract syntax trees; hierarchical splitting
- Identifier
- http://hdl.handle.net/1959.13/1446170
- Identifier
- uon:42783
- Identifier
- ISBN:9781955917094
- Language
- eng
- Reviewed
- Hits: 858
- Visitors: 858
- Downloads: 0
Thumbnail | File | Description | Size | Format |
---|