论文标题
标签:键入代码注释生成的辅助指南
TAG : Type Auxiliary Guiding for Code Comment Generation
论文作者
论文摘要
现有的领先代码生成的方法与结构到序列框架的方法忽略了代码解释的类型信息,例如操作员,字符串等。但是,由于类型信息之间的层次依赖性,将类型信息引入现有框架中的类型信息是非琐事的。为了解决上面的问题,我们为代码注释生成任务的类型辅助指南编码器框架框架,该框架将源代码视为n- ary树,其中包含与每个节点相关的类型信息。具体而言,我们的框架具有与类型相关的编码器和类型限制的解码器的特征,该解码器可以自适应源代码的自适应摘要。我们进一步提出了一种分层增强学习方法,以解决我们提议的框架的培训困难。广泛的评估表明,通过自动评估的指标和案例研究,我们框架的最先进表现。
Existing leading code comment generation approaches with the structure-to-sequence framework ignores the type information of the interpretation of the code, e.g., operator, string, etc. However, introducing the type information into the existing framework is non-trivial due to the hierarchical dependence among the type information. In order to address the issues above, we propose a Type Auxiliary Guiding encoder-decoder framework for the code comment generation task which considers the source code as an N-ary tree with type information associated with each node. Specifically, our framework is featured with a Type-associated Encoder and a Type-restricted Decoder which enables adaptive summarization of the source code. We further propose a hierarchical reinforcement learning method to resolve the training difficulties of our proposed framework. Extensive evaluations demonstrate the state-of-the-art performance of our framework with both the auto-evaluated metrics and case studies.