arrow
返回

ClassSum: a deep learning model for class-level code summarization

delete2022-10-10
delete0
PRE
AI
M
Mingchen Li
H
Huiqun Yu *
G
Guisheng Fan *
Z
Ziyi Zhou
J
Jiawen Huang
DOI:10.1007/s00521-022-07877-zdelete
delete原文链接
delete分享
delete收藏
摘要

摘要

En 中文
Code summaries are clear and concise natural language descriptions of program entities. Meaningful code summaries assist developers in better understanding. Code summarization refers to the task of generating a natural language summary from a code snippet. Most researches on code summarization focus on automatically generating summaries for methods or functions. However, in an object-oriented language such as Java, class is the basic programming unit rather than method. To fill this gap, in this paper, we investigate how to generate summaries for Java classes utilizing deep learning-based approaches. We propose a novel encoder–decoder model called ClassSum to generate functionality descriptions for Java classes and build a dataset containing 172,639 pairs from 3185 repositories hosted on Github. Since the code of class is much longer and more complicated, encoding a whole class via neural network is more challenging than encoding a method. On the other hand, the content within a class may be incomplete. To overcome this difficulty, we reduce the code of a class by only keeping its key elements, namely class signatures, method signatures and attribute names. To utilize both lexical and structural information of code, our model takes token sequence and abstract syntax tree of the reduced class content as inputs. ClassSum and five baselines (designed for method-level code summarization) are evaluated on our dataset. Experiment results show that summaries generated by ClassSum are more accurate and readable than those generated by baselines. Our dataset is available at https://github.com/classsum/ClassSum .
Keyword:
Program comprehension
Code summarization
Class documentation
Deep learning
err分享
err收藏
Summarizing source code with hierarchical code representation用分层代码表示总结源代码
err2022-03-01
err14
PREAI
errZhou, Ziyi; Yu, Huiqun; Fan, Guisheng; Huang, Zijie; Yang, Xingguang
err分享
err收藏
An Extractive-and-Abstractive Framework for Source Code Summarization用于源代码摘要的提取和抽象框架
err2024-03-14
err5
errOAAI
errSun, Weisong; Fang, Chunrong; Chen, Yuchen; Zhang, Quanjun; Tao, Guanhong; You, Yudu; Han, Tingxu; Ge, Yifei; Hu, Yuling; Luo, Bin; Chen, Zhenyu
err分享
err收藏
err分享
err收藏
Autofolding for Source Code Summarization用于源代码摘要的自动折叠
err2017-12-01
err37
errOAAI
errFowkes, Jaroslav; Chanthirasegaran, Pankajan; Ranca, Razvan; Allamanis, Miltiadis; Lapata, Mirella; Sutton, Charles
err分享
err收藏
Esale: Enhancing Code-Summary Alignment Learning for Source Code SummarizationEsale: 用于源代码摘要的增强代码摘要对齐学习
err2024-08-01
err2
PREAI
errFang, Chunrong; Sun, Weisong; Chen, Yuchen; Chen, Xiao; Wei, Zhao; Zhang, Quanjun; You, Yudu; Luo, Bin; Liu, Yang; Chen, Zhenyu
err分享
err收藏

期刊

Neural Computing and Applications 封面图
Neural Computing and Applications
IF:
4.5
论文数:
2.4K
被引数:
3.4W

机构

暂无机构信息
引用论文

引用论文

BLEU布卢
err2001-01-01
err0
errOAAI
errKishore Papineni; Salim Roukos; Todd Ward; Wei-Jing Zhu
err分享
err收藏
err分享
err收藏
Source Code based On-demand Class Documentation Generation
err2020-09-01
err0
PREAI
errLiu,Mingwei; Peng,Xin; Meng,Xiujie; Xu,Huanjun; Xing,Shuangshuang; Wang,Xin; Liu,Yang; Lv,Gang
err分享
err收藏
Long Short-Term Memory长短期记忆
err1997-11-01
err0
PREAI
errSepp Hochreiter; Jürgen Schmidhuber
err分享
err收藏
On the Naturalness of Software论软件的自然性
err2016-04-26
err164
PREAI
errHindle, Abram; Barr, Earl T.; Gabel, Mark; Su, Zhendong; Devanbu, Premkumar
err分享
err收藏
学者 查看更多内容