收藏切换
Class Summarization Generation Technology Based on Hierarchical Representation and Context Enhancement
收藏切换
Haoling Chen, Huiqun Yu*, Guisheng Fan, Mingchen Li, Zijie Huang
Journal of Computer Research and Development | 2024, 61(2) : 307 - 323
Less
收藏切换
Journal of Computer Research and Development | 2024, 61(2): 307-323
• Special Issue on Generative AI and Software Automation •
Class Summarization Generation Technology Based on Hierarchical Representation and Context Enhancement
Full
Haoling Chen, Huiqun Yu*, Guisheng Fan, Mingchen Li, Zijie Huang
Affiliations
  • 1Department of Computer Science and Engineering, East China University of Science and Technology, Shanghai 200237
  • born in 1999. Master candidate. Student member of CCF. Her main research interests include automatic code summarization and program comprehension

    born in 1967. PhD, professor, PhD supervisor. Senior member of CCF. His main research interests include software engineering, trusted computing, cloud computing, and formal methods

    born in 1980. PhD, associate research fellow, PhD supervisor. Member of CCF. His main research interests include software engineering, service computing, and software architecture analysis techniques

    born in 1998. PhD candidate. His main research interests include automatic code summarization and program comprehension

    born in 1994. PhD candidate. Student member of CCF. His main research interests include code smell, software quality assurance, program comprehension, and empirical software engineering

About Author:

born in 1999. Master candidate. Student member of CCF. Her main research interests include automatic code summarization and program comprehension

born in 1967. PhD, professor, PhD supervisor. Senior member of CCF. His main research interests include software engineering, trusted computing, cloud computing, and formal methods

born in 1980. PhD, associate research fellow, PhD supervisor. Member of CCF. His main research interests include software engineering, service computing, and software architecture analysis techniques

born in 1998. PhD candidate. His main research interests include automatic code summarization and program comprehension

born in 1994. PhD candidate. Student member of CCF. His main research interests include code smell, software quality assurance, program comprehension, and empirical software engineering

Published: 2024-02-02 doi: 10.7544/issn1000-1239.202330730
Outline
收藏切换

Code summarization is a natural language description of source code, and high-quality code summaries help to improve developers’ program understanding efficiency. In recent years, research on code summarization has focused on generating summaries for method-grained code snippet. However, in an object-oriented language such as Java, class is the basic programming unit. Due to the above problems, we propose a class summarization generation method based on hierarchical representation and context enhancement, called HRCE, as well as constructs a class summarization dataset containing 358992 pairs of <Java class, content, summary>. HRCE uses code simplification strategy to remove non-critical code of class to shorten the code length. Then, HRCE models the class hierarchy, including class signature, attribute and method respectively, to obtain the semantic information and hierarchical structure information of the class. In addition, HRCE selects parent’s class signature and class summary to describe the context that the class depends on in the project. Experiments show that a generative model for class summarization based on hierarchical representation and context enhancement is able to characterize the semantics and hierarchical structure of the code, and obtain information from both inside and outside of the target class. As a result, HRCE outperforms all baseline models on evaluation metrics such as BLEU, METEOR, ROUGE-L, etc.

automatic code summarization  /  hierarchical representation  /  context enhancement  /  deep learning  /  class summarization
陈豪伶, 虞慧群, 范贵生, 李明辰, 黄子杰. 基于分层表示和上下文增强的类摘要生成技术. 计算机研究与发展, 2024 , 61 (2) : 307 -323 . DOI: 10.7544/issn1000-1239.202330730
Haoling Chen, Huiqun Yu, Guisheng Fan, Mingchen Li, Zijie Huang. Class Summarization Generation Technology Based on Hierarchical Representation and Context Enhancement[J]. Journal of Computer Research and Development, 2024 , 61 (2) : 307 -323 . DOI: 10.7544/issn1000-1239.202330730
Year 2024 volume 61 Issue 2
79
37
Cite this Article
BibTeX
Article Info
doi: 10.7544/issn1000-1239.202330730
  • Receive Date:2023-09-11
  • Online Date:2026-11-17
  • Published:2024-02-02
Article Data
Affiliations
History
  • Received:2023-09-11
  • Revised:2023-12-05
Affiliations
    1Department of Computer Science and Engineering, East China University of Science and Technology, Shanghai 200237
References
Share
https://castjournals.cast.org.cn/joweb/jsjyjyfz/EN/10.7544/issn1000-1239.202330730
Share to
QR

Scan QR to access full text

Cite this article
BibTeX
Citations
表12种不同金属材料的力学参数
科
Family
属数
Number of
genus
种数
Number of
species
占总种数比例
Percentage of
total species (%)
属
Genus
种数
Number of
species
占总种数比例
Percentage of total
species (%)
鹅膏菌科Amanitaceae 2 11 5.26 鹅膏菌属 Amanita 10 4.78
小菇科 Mycenaceae 2 12 5.74 丝盖伞属 Inocybe 5 2.39
多孔菌科 Polyporaceae 8 14 6.70 蜡蘑属 Laccaria 5 2.39
红菇科 Russulaceae 3 23 11.00 小皮伞属 Marasmius 6 2.87
小菇属 Mycena 11 5.26
光柄菇属 Pluteus 5 2.39
红菇属 Russula 17 8.13
栓菌属 Trametes 5 2.39
关闭全屏
  • BibTeX
  • EndNote
  • RefWorks
  • TxT