Article (Scientific journals)
PyScribe–Learning to describe python code
Guo, Juncai; Liu, Jin; Liu, Xiao et al.
2023In Software: Practice and Experience, p. 1-27
Peer Reviewed verified by ORBi
 

Files


Full Text
2023-SPE-Guo-PyScribe.pdf
Publisher postprint (4.02 MB) Creative Commons License - Attribution, Non-Commercial
Download

All documents in ORBilu are protected by a user license.

Send to



Details



Keywords :
code comprehension; code documentation; code embedding; code summarization; deep learning; representation learning; Abstract Syntax Trees; Code comprehension; Code documentation; Code embedding; Code summarization; Deep learning; Embeddings; Python code; Representation learning; Source codes; Software
Abstract :
[en] Code comment generation, which attempts to summarize the functionality of source code in textual descriptions, plays an important role in automatic software development research. Currently, several structural neural networks have been exploited to preserve the syntax structure of source code based on abstract syntax trees (ASTs). However, they can not well capture both the long-distance and local relations between nodes while retaining the overall structural information of AST. To mitigate this problem, we present a prototype tool titled PyScribe, which extends the Transformer model to a new encoder-decoder-based framework. Particularly, the triplet position is designed and integrated into the node-level and edge-level structural features of AST for producing Python code comments automatically. This paper, to the best of our knowledge, makes the first effort to model the edges of AST as an explicit component for improved code representation. By specifying triplet positions for each node and edge, the overall structural information can be well preserved in the learning process. Moreover, the captured node and edge features go through a two-stage decoding process to yield higher qualified comments. To evaluate the effectiveness of PyScribe, we resort to a large dataset of code-comment pairs by mining Jupyter Notebooks from GitHub, for which we have made it publicly available to support further studies. The experimental results reveal that PyScribe is indeed effective, outperforming the state-ofthe-art by achieving an average BLEU score (i.e., av-BLEU) of (Formula presented.) 0.28.
Research center :
Interdisciplinary Centre for Security, Reliability and Trust (SnT) > Other
Disciplines :
Computer science
Author, co-author :
Guo, Juncai ;  School of Computer Science, Wuhan University, Wuhan, China
Liu, Jin;  School of Computer Science, Wuhan University, Wuhan, China ; Key Laboratory of Network Assessment Technology, Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China
Liu, Xiao;  School of Information Technology, Deakin University, Burwood, Melbourne, Australia
Wan, Yao;  School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan, China
Zhao, Yanjie;  Faculty of Information Technology, Monash University, Clayton, Australia
Li, Li;  School of Software, Beihang University, Beijing, China
Liu, Kui;  Huawei Software Engineering Application Technology LabHangzhou, China
KLEIN, Jacques  ;  University of Luxembourg > Interdisciplinary Centre for Security, Reliability and Trust (SNT) > TruX
BISSYANDE, Tegawendé François d Assise  ;  University of Luxembourg > Interdisciplinary Centre for Security, Reliability and Trust (SNT) > TruX
External co-authors :
yes
Language :
English
Title :
PyScribe–Learning to describe python code
Publication date :
December 2023
Journal title :
Software: Practice and Experience
ISSN :
0038-0644
eISSN :
1097-024X
Publisher :
John Wiley and Sons Ltd
Pages :
1-27
Peer reviewed :
Peer Reviewed verified by ORBi
Focus Area :
Security, Reliability and Trust
Funders :
China Scholarship Council
National Natural Science Foundation of China
Funding text :
This research is supported by the National Natural Science Foundation of China (Grant No.61972290), the Open Fund of Key Laboratory of Network Assessment Technology from Chinese Academy of Sciences, and the China Scholarship Council (Grant No.201906270158). Open access publishing facilitated by Deakin University, as part of the Wiley ‐ Deakin University agreement via the Council of Australian University Librarians.
Available on ORBilu :
since 11 January 2024

Statistics


Number of views
28 (1 by Unilu)
Number of downloads
25 (0 by Unilu)

Scopus citations®
 
0
Scopus citations®
without self-citations
0
OpenAlex citations
 
0
WoS citations
 
0

Bibliography


Similar publications



Contact ORBilu