论文标题

层次结构:学习用异质表示总结源代码

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.

论文摘要

我们提出了一种使用异质代码表示(HCR)和我们专门设计的层次网络的新方法来摘要。 HCR通过抽象粗粒的代码元素并将细粒的程序元素纳入层次结构中,可以有效地捕获词汇,句法和语义级别的基本代码特征。我们的层次网方法通过异质图变压器,基于树的CNN和变压器编码器的独特组合分别处理HCR的每一层。这种方法可以通过新颖的层次感知跨注意层来保留代码元素之间的依赖性,并捕获关系。我们的方法超过了当前的最新技术,例如PA形式,铸造和神经代码。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源