Revisiting File Context for Source Code Summarization

Aakash Bansal, Chia-Yi Su, Collin McMillan
9/5/2023
cs.SEcs.AI

No confident code implementation found for this paper.

Abstract

Source code summarization is the task of writing natural language descriptions of source code. A typical use case is generating short summaries of subroutines for use in API documentation. The heart of almost all current research into code summarization is the encoder-decoder neural architecture, and the encoder input is almost always a single subroutine or other short code snippet. The problem with this setup is that the information needed to describe the code is often not present in the code itself -- that information often resides in other nearby code. In this paper, we revisit the idea of ``file context'' for code summarization. File context is the idea of encoding select information from other subroutines in the same file. We propose a novel modification of the Transformer architecture that is purpose-built to encode file context and demonstrate its improvement over several baselines. We find that file context helps on a subset of challenging examples where traditional approaches struggle.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{bansal2023revisiting,
  title  = {Revisiting File Context for Source Code Summarization},
  author = {Aakash Bansal and Chia-Yi Su and Collin McMillan},
  year   = {2023},
  eprint = {2309.02326},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2309.02326v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.02326.svg)](https://codeofpaper.com/paper/2309.02326)

Discussion