当前位置: X-MOL 学术arXiv.cs.SE › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
TranS^3: A Transformer-based Framework for Unifying Code Summarization and Code Search
arXiv - CS - Software Engineering Pub Date : 2020-03-06 , DOI: arxiv-2003.03238
Wenhua Wang, Yuqun Zhang, Zhengran Zeng, Guandong Xu

Code summarization and code search have been widely adopted in sofwaredevelopmentandmaintenance. However, fewstudieshave explored the efcacy of unifying them. In this paper, we propose TranS^3 , a transformer-based framework to integrate code summarization with code search. Specifcally, for code summarization,TranS^3 enables an actor-critic network, where in the actor network, we encode the collected code snippets via transformer- and tree-transformer-based encoder and decode the given code snippet to generate its comment. Meanwhile, we iteratively tune the actor network via the feedback from the critic network for enhancing the quality of the generated comments. Furthermore, we import the generated comments to code search for enhancing its accuracy. To evaluatetheefectivenessof TranS^3 , we conduct a set of experimental studies and case studies where the experimental results suggest that TranS^3 can signifcantly outperform multiple state-of-the-art approaches in both code summarization and code search and the study results further strengthen the efcacy of TranS^3 from the developers' points of view.

中文翻译:

TranS^3:一个基于 Transformer 的统一代码总结和代码搜索的框架

代码摘要和代码搜索在软件开发和维护中被广泛采用。然而,很少有研究探讨统一它们的有效性。在本文中,我们提出了 TranS^3,这是一种基于转换器的框架,用于将代码摘要与代码搜索相结合。具体来说,对于代码摘要,TranS^3 启用了 actor-critic 网络,其中在 actor 网络中,我们通过基于转换器和树转换器的编码器对收集的代码片段进行编码,并对给定的代码片段进行解码以生成其评论。同时,我们通过来自评论家网络的反馈迭代地调整演员网络,以提高生成评论的质量。此外,我们将生成的注释导入代码搜索以提高其准确性。为了评估 TransS^3 的有效性,
更新日期:2020-03-10
down
wechat
bug