跳到主要导航 跳到搜索 跳到主要内容

Code Summarization with Project-Specific Features

  • East China Normal University

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

Code summarization aims to automatically generate natural language descriptions for code snippets, which help people maintain and understand code snippets. Existing code summarization methods are mostly based on the encoder-decoder structure, where the encoder learns latent features from a code snippet and the decoder generates the corresponding summary based on the features. Such methods do not leverage project-specific information and tend to generate general summaries. However, in practice developers want the generated summaries to be project-specific, i.e., being consistent with the existing summaries in the same project on aspects such as sentence patterns and domain concepts. In this work, we investigate project-specific code summarization. We propose a two-stage method CSWPS, which can be seamlessly integrated into any existing encoder-decoder summarization model. In the first stage, CSWPS learns project-specific features from existing summaries in each project using multi-task learning. In the second stage, CSWPS samples from the project-specific features conditioned on the input source code and project information, and extracts the features most relevant to the input code. The features guide the decoder to generate a project-specific summary for the input code. By incorporating CSWPS into existing code summarization models, we can always improve their performance and achieve the new state-of-the-art. We also empirically show that the summaries generated by incorporating CSWPS are more project-specific, via feature visualization and human study. A replication package for this work is available at https://github.com/DaSESmartEdu/CSWPS.

源语言英语
主期刊名Machine Learning and Knowledge Discovery in Databases. Applied Data Science Track - European Conference, ECML PKDD 2024, Proceedings
编辑Albert Bifet, Tomas Krilavičius, Ioanna Miliou, Slawomir Nowaczyk
出版商Springer Science and Business Media Deutschland GmbH
190-206
页数17
ISBN(印刷版)9783031703775
DOI
出版状态已出版 - 2024
活动European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, ECML PKDD 2024 - Vilnius, 立陶宛
期限: 9 9月 202413 9月 2024

出版系列

姓名Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
14949 LNAI
ISSN(印刷版)0302-9743
ISSN(电子版)1611-3349

会议

会议European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, ECML PKDD 2024
国家/地区立陶宛
Vilnius
时期9/09/2413/09/24

学术指纹

探究 'Code Summarization with Project-Specific Features' 的科研主题。它们共同构成独一无二的学术指纹。

引用此