Browse Prior Art Database

Deep Learning Methods for Source Code Understanding

IP.com Disclosure Number: IPCOM000248788D
Publication Date: 2017-Jan-11
Document File: 2 page(s) / 41K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method to automatically generate comments for a computer program block using trained machine learning models.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 79% of the total text.

1

Deep Learning Methods for Source Code Understanding

The amount of source code available in the world is quickly growing. A large portion of the source code is not well documented. There is very little comment in the source code, and/or comment is inconsistent due to code modifications. In addition, it is difficult for one person to read another’s code. The novel solution is a method to automatically generate comments for a computer program block using trained machine learning models, which includes a method to generate a machine learning model with trained parameters from existing well-documented computer code and a method to generate comments for a given computer code block based on a trained model.

The process comprises a training step and an inference step. (Figure 3)

In the training step, the method uses a deep-learning neural network to learn a sequence-to-sequence model. The training data comprises well-documented source code from existing code repositories. The input is a block of source/function /class with existing comments. The output is a machine learning (neural network) model with trained parameters. This step might require a large amount of computing power and storage.

In the inference step, the method uses the trained model to automatically provide an intelligent understanding for the source code. The input is a block of source/function/class. The output is the meaning of the input (i.e., simulate programmer writing comments for the source code, similar to t...