BIROn - Birkbeck Institutional Research Online

    Automatic source code summarization with graph attention networks

    Yu, Z. and Shen, J. and Zhang, X. and Yang, W. and Han, Tingting and Chen, Taolue (2022) Automatic source code summarization with graph attention networks. Journal of Systems and Software 188 , ISSN 0164-1212.

    48300a.pdf - Published Version of Record
    Available under License Creative Commons Attribution.

    Download (2MB) | Preview


    Source code summarization aims to generate concise descriptions for code snippets in a natural language, thereby facilitates program comprehension and software maintenance. In this paper, we propose a novel approach–GSCS–to automatically generate summaries for Java methods, which leverages both semantic and structural information of the code snippets. To this end, GSCS utilizes Graph Attention Networks to process the tokenized abstract syntax tree of the program, which employ a multi-head attention mechanism to learn node features in diverse representation sub-spaces, and aggregate features by assigning different weights to its neighbor nodes. GSCS further harnesses an additional RNN-based sequence model to obtain the semantic features and optimizes the structure by combining its output with a transformed embedding layer. We evaluate our approach on two widely-adopted Java datasets; the experiment results confirm that GSCS outperforms the state-of-the-art baselines.


    Item Type: Article
    School: Birkbeck Faculties and Schools > Faculty of Science > School of Computing and Mathematical Sciences
    Depositing User: Tingting Han
    Date Deposited: 30 May 2022 14:47
    Last Modified: 09 Aug 2023 12:53


    Activity Overview
    6 month trend
    6 month trend

    Additional statistics are available via IRStats2.

    Archive Staff Only (login required)

    Edit/View Item Edit/View Item