SCATCom: Code Comment Generation by Fusing Multi-Information
Several code comment generation approaches based on sequence-to-sequence (Seq2Seq) models have been proposed. Such approaches often extract structure information from abstract syntax trees (ASTs) using a certain serialization method. However, some structural information is inevitably lost while serializing ASTs. Furthermore, existing serialization methods only consider the “type” attribute of the nodes, neglecting the “value” attribute of the nodes. To further improve the performance of code comment generation, we propose a code comment generation approach, called SCATCom, which integrates a more comprehensive set of information from source code and ASTs, encompassing semantic, sequential, syntactic, and hierarchical structure information for code comment generation. Meanwhile, an AST traversal method, called V-POT, is presented, which considers both the “type” and the “value” attributes of the nodes. Experiments were designed and conducted on two commonly used datasets to validate the performance of our approach and the impact of five different serialization ways of ASTs on two code comment generation methods. The BLEU, METEOR, and ROUGE scores for our approach reach 52.6, 34.16, and 63.26 with an improvement of [Formula: see text], [Formula: see text], and [Formula: see text] compared to the baselines. It is evident that V-POT, which retains both the “type” and the “value” attributes, is superior to other methods that use only the “type” attribute.
Authors
- Shujuan Jiang (ORCID: https://orcid.org/0000-0003-0643-0565)
- Jie Zhou (ORCID: https://orcid.org/0000-0001-5911-8554)
- Rongcun Wang (ORCID: https://orcid.org/0000-0002-9685-9893)
- Zhanqi Cui (ORCID: https://orcid.org/0000-0002-5537-9236)
- Xiang Chen (ORCID: https://orcid.org/0000-0002-1180-3891)
Institutions
- Nantong University (CN)
- China University of Mining and Technology (CN)
- Beijing Information Science & Technology University (CN)
Publication Details
- Journal
- International Journal of Software Engineering and Knowledge Engineering
- Published
- 2025-05-09
- DOI
- https://doi.org/10.1142/s0218194025500263
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00