Abstract
Automatically obtaining descriptions of the functions of code snippets in natural language, i.e., code summarization, is an important issue in software engineering. In recent years, abstract syntax tree (AST)-based code summarization models for modelling syntactic structures have continued to emerge. In addition to syntactics, the semantics of the code are gradually gaining attention. In this paper, we propose a code summarization approach that incorporates local-ADG and AST, called GTsum. In particular, we introduce a novel local-ADG-based approach that can effectively filter out irrelevant semantics in the modelling of the semantic structure of code. GTsum learns semantics and syntactics in the local-ADG and AST through graph convolutional networks (GCNs) and then fuses them using Transformer. We evaluate our model on two Java language datasets with several metrics. The results demonstrate that our model achieves state-of-the-art performance compared to the existing models.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Chen, M., Wan, X.: Neural comment generation for source code with auxiliary code classification task. In: Asia-Pacific Software Engineering Conference, APSEC, pp. 522–529 (2019)
Hu, X., Li, G., Xia, X., Lo, D., Jin, Z.: Deep code comment generation. In: 2018 IEEE/ACM 26th International Conference on Program Comprehension (ICPC), pp. 200–210 (2018)
Lyu, C., Wang, R., Zhang, H., Zhang, H., Hu, S.: Embedding API dependency graph for neural code generation. Empir. Softw. Eng. 26(4), 1–51 (2021)
Iyer, S., Konstas, I., Cheung, A., Zettlemoyer, L.: Summarizing source code using a neural attention model. In: Association for Computational Linguistics, pp. 2073–2083 (2016)
Xu, K., Wu, L., Wang, Z., Feng, Y., Sheinin, V.: Sql-to-text generation with graph-to-sequence model. In: Association for Computational Linguistics (2014)
Hu, X., Li, G., Xia, X., Lo, D., Lu, S., Jin, Z.: Summarizing source code with transferred api knowledge. In: International Joint Conference on Artificial Intelligence (IJCAI), pp. 802–810 (2018)
Wang, W., et al.: Reinforcement-learning-guided source code summarization via hierarchical attention. IEEE Trans. Softw. Eng. (2020)
Allamanis, M., Peng, H., Sutton, C.: A convolutional attention network for extreme summarization of source code. In: International Conference on Machine Learning (ICML), vol. 48, pp. 2091–2100 (2016)
Ling, W., et al.: Latent predictor networks for code generation (2016)
Papineni, K., Roukos, S., Ward, T., Zhu, W.J.: Bleu: a method for automatic evaluation of machine translation. In: Association for Computational Linguistics, pp. 311–318 (2002)
Banerjeee, S., Lavie, A.: METEOR: an automatic metric for MT evaluation with improved correlation with human judgments. In: Association for Computational Linguistics, pp. 65–72 (2005)
Lin, C.Y.: Rouge: a package for automatic evaluation of summaries. In: Text Summarization Branches, pp. 74–81 (2004)
LeClair, A., Jiang, S., McMillan, C.: A neural model for generating natural language summaries of program subroutines. In: International Conference on Software Engineering (ICSE), pp. 795–806 (2019)
Acknowledgments
This work is financially supported by the National Natural Science Foundation of China (61602286, 61976127) and the Special Project on Innovative Methods (2020IM020100).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Gao, X., Jiang, X., Wu, Q., Wang, X., Lyu, C., Lyu, L. (2021). Multi-modal Code Summarization Fusing Local API Dependency Graph and AST. In: Mantoro, T., Lee, M., Ayu, M.A., Wong, K.W., Hidayanto, A.N. (eds) Neural Information Processing. ICONIP 2021. Communications in Computer and Information Science, vol 1516. Springer, Cham. https://doi.org/10.1007/978-3-030-92307-5_34
Download citation
DOI: https://doi.org/10.1007/978-3-030-92307-5_34
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-92306-8
Online ISBN: 978-3-030-92307-5
eBook Packages: Computer ScienceComputer Science (R0)