HierarchyNet: Learning to Summarize Source Code with Heterogeneous Representations
Nguyen, Minh Huynh, Bui, Nghi D. Q., Hy, Truong Son, Tran-Thanh, Long, Nguyen, Tien N.
–arXiv.org Artificial Intelligence
We propose a novel method for code summarization utilizing Heterogeneous Code Representations (HCRs) and our specially designed HierarchyNet. HCRs effectively capture essential code features at lexical, syntactic, and semantic levels by abstracting coarse-grained code elements and incorporating fine-grained program elements in a hierarchical structure. Our HierarchyNet method processes each layer of the HCR separately through a unique combination of the Heterogeneous Graph Transformer, a Tree-based CNN, and a Transformer Encoder. This approach preserves dependencies between code elements and captures relations through a novel Hierarchical-Aware Cross Attention layer. Our method surpasses current state-of-the-art techniques, such as PA-Former, CAST, and NeuralCodeSum.
arXiv.org Artificial Intelligence
May-9-2023
- Country:
- Asia (1.00)
- Europe (0.93)
- North America > United States (0.93)
- Genre:
- Research Report > Promising Solution (0.86)
- Technology: