Improving Automatic Source Code Summarization via Deep Reinforcement Learning

被引:236
|
作者
Wan, Yao [1 ]
Zhao, Zhou [2 ]
Yang, Min [3 ]
Xu, Guandong
Ying, Haochao [1 ]
Wu, Jian [1 ]
Yu, Philip S. [4 ,5 ]
机构
[1] Zhejiang Univ, Coll Comp Sci & Technol, Hangzhou, Peoples R China
[2] Chinese Acad Sci, Shenzhen Inst Adv Technol, Shenzhen, Peoples R China
[3] Univ Technol Sydney, Adv Analyt Inst, Sydney, NSW, Australia
[4] Univ Illinois, Chicago, IL USA
[5] Tsinghua Univ, Inst Data Sci, Beijing, Peoples R China
关键词
dCode summarization; comment generation; deep learning; reinforcement learning; GO;
D O I
10.1145/3238147.3238206
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code summarization provides a high level natural language description of the function performed by code, as it can benefit the software maintenance, code categorization and retrieval. To the best of our knowledge, most state-of-the-art approaches follow an encoder-decoder framework which encodes the code into a hidden space and then decode it into natural language space, suffering from two major drawbacks: a) Their encoders only consider the sequential content of code, ignoring the tree structure which is also critical for the task of code summarization; b) Their decoders are typically trained to predict the next word by maximizing the likelihood of next ground-truth word with previous ground-truth word given. However, it is expected to generate the entire sequence from scratch at test time. This discrepancy can cause an exposure bias issue, making the learnt decoder suboptimal. In this paper, we incorporate an abstract syntax tree structure as well as sequential content of code snippets into a deep reinforcement learning framework (i.e., actor-critic network). The actor network provides the confidence of predicting the next word according to current state. On the other hand, the critic network evaluates the reward value of all possible extensions of the current state and can provide global guidance for explorations. We employ an advantage reward composed of BLEU metric to train both networks. Comprehensive experiments on a real-world dataset show the effectiveness of our proposed model when compared with some state-of-the-art methods.
引用
收藏
页码:397 / 407
页数:11
相关论文
共 50 条
  • [31] Crowd aware summarization of surveillance videos by deep reinforcement learning
    Junfeng Xu
    Zhengxing Sun
    Chen Ma
    [J]. Multimedia Tools and Applications, 2021, 80 : 6121 - 6141
  • [32] Deep Reinforcement Learning with Distributional Semantic Rewards for Abstractive Summarization
    Li, Siyao
    Lei, Deren
    Qin, Pengda
    Wang, William Yang
    [J]. 2019 CONFERENCE ON EMPIRICAL METHODS IN NATURAL LANGUAGE PROCESSING AND THE 9TH INTERNATIONAL JOINT CONFERENCE ON NATURAL LANGUAGE PROCESSING (EMNLP-IJCNLP 2019): PROCEEDINGS OF THE CONFERENCE, 2019, : 6038 - 6044
  • [33] Deep reinforcement and transfer learning for abstractive text summarization: A review
    Alomari, Ayham
    Idris, Norisma
    Sabri, Aznul Qalid Md
    Alsmadi, Izzat
    [J]. Computer Speech and Language, 2022, 71
  • [34] Revisiting Information Retrieval and Deep Learning Approaches for Code Summarization
    Zhu, Tingwei
    Li, Zhong
    Pan, Minxue
    Shi, Chaoxuan
    Zhang, Tian
    Pei, Yu
    Li, Xuandong
    [J]. 2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS, ICSE-COMPANION, 2023, : 328 - 329
  • [35] Piston Error Automatic Correction for Segmented Mirrors via Deep Reinforcement Learning
    Li, Dequan
    Wang, Dong
    Yan, Dejie
    [J]. SENSORS, 2024, 24 (13)
  • [36] Automatic Medical Code Assignment via Deep Learning Approach for Intelligent Healthcare
    Teng, Fei
    Ma, Zheng
    Chen, Jie
    Xiao, Ming
    Huang, Lufei
    [J]. IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS, 2020, 24 (09) : 2506 - 2515
  • [37] Autofolding for Source Code Summarization
    Fowkes, Jaroslav
    Chanthirasegaran, Pankajan
    Ranca, Razvan
    Allamanis, Miltiadis
    Lapata, Mirella
    Sutton, Charles
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2017, 43 (12) : 1095 - 1109
  • [38] Automatic View Generation with Deep Learning and Reinforcement Learning
    Yuan, Haitao
    Li, Guoliang
    Feng, Ling
    Sun, Ji
    Han, Yue
    [J]. 2020 IEEE 36TH INTERNATIONAL CONFERENCE ON DATA ENGINEERING (ICDE 2020), 2020, : 1501 - 1512
  • [39] Survey on Neural Network-based Automatic Source Code Summarization Technologies
    Song, Xiao-Tao
    Sun, Hai-Long
    [J]. Ruan Jian Xue Bao/Journal of Software, 2022, 33 (01): : 55 - 77
  • [40] Leveraging Code Generation to Improve Code Retrieval and Summarization via Dual Learning
    Ye, Wei
    Xie, Rui
    Zhang, Jinglei
    Hu, Tianxiang
    Wang, Xiaoyin
    Zhang, Shikun
    [J]. WEB CONFERENCE 2020: PROCEEDINGS OF THE WORLD WIDE WEB CONFERENCE (WWW 2020), 2020, : 2309 - 2319