paper-with-me

홈 › Papers

Code Attention: Translating Code to Comments by Exploiting Domain Features

2017-09-22 · Wenhao Zheng, Hong-Yu Zhou, Ming Li, Jianxin Wu

Appropriate comments of code snippets provide insight for code functionality, which are helpful for program comprehension. However, due to the great cost of authoring with the comments, many code projects do not contain adequate comments. Automatic comment generation techniques have been proposed to generate comments from pieces of code in order to alleviate the human efforts in annotating the code. Most existing approaches attempt to exploit certain correlations (usually manually given) between code and generated comments, which could be easily violated if the coding patterns change and hence the performance of comment generation declines. In this paper, we first build C2CGit, a large dataset from open projects in GitHub, which is more than 20$\times$ larger than existing datasets. Then we propose a new attention module called Code Attention to translate code to comments, which is able to utilize the domain features of code snippets, such as symbols and identifiers. We make ablation studies to determine effects of different parts in Code Attention. Experimental results demonstrate that the proposed module has better performance over existing approaches in both BLEU and METEOR.

📄 PDF Abstract BibTeX arXiv:1709.07642

Code (2)

mf1832146/tree-transformer pytorch
mf1832146/tree_transformer_2.0 pytorch

Tasks

Comment Generation

Similar Papers 제목 키워드 기반

Leveraging Reward Models for Guiding Code Review Comment Generation

2025-06-04 · Oussama Ben Sghaier, Rosalia Tufano, Gabriele Bavota, Houari Sahraoui

Code review is a crucial component of modern software development, involving the evaluation of code quality, providing feedback on potential issues, and refining the code to address identified problems. Despite these ben…

Comment Generation

Code to Comment "Translation": Data, Metrics, Baselining & Evaluation

2020-10-03 · David Gros, Hariharan Sezhiyan, Prem Devanbu, Zhou Yu

The relationship of comments to code, and in particular, the task of generating useful comments given the code, has long been of interest. The earliest approaches have been based on strong syntactic theories of comment-s…

Information RetrievalRetrievalTranslation

Cold Start Problem For Automated Live Video Comments

2021-06-01 · NAACL (maiworkshop) 2021 6 · Hao Wu, François Pitie, Gareth Jones

Live video comments, or ”danmu”, are an emerging feature on Asian online video platforms. Danmu are time-synchronous comments that are overlaid on a video playback. These comments uniquely enrich the experience and engag…

Recommendation SystemsRetrieval

Bangla hate speech detection on social media using attention-based recurrent neural network

2022-03-31 · Amit Kumar Das, Abdullah Al Asif, Anik Paul, Md. Nur Hossain

Hate speech has spread more rapidly through the daily use of technology and, most notably, by sharing your opinions or feelings on social media in a negative aspect. Although numerous works have been carried out in detec…

Decoder

STANKER: Stacking Network based on Level-grained Attention-masked BERT for Rumor Detection on Social Media

2021-11-01 · EMNLP 2021 11 · Dongning Rao, Xin Miao, Zhihua Jiang, Ran Li

Rumor detection on social media puts pre-trained language models (LMs), such as BERT, and auxiliary features, such as comments, into use. However, on the one hand, rumor detection datasets in Chinese companies with comme…