IP Library Patent Application 18558200
Patent Application
App. No. 18/558,200

PROGRAM GENERATION APPARATUS, PROGRAM GENERATION METHOD AND PROGRAM

Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US None
App. No.
18/558,200
Abstract

A program generation device includes a calculation unit that calculates, for a plurality of first source codes, a similarity between the first source code and a sentence explaining a specification of a desired program in a natural language, and calculates an attention degree of each token constituting the first source code in calculation of the similarity, and a generation unit that generates a plurality of synthesis codes by synthesizing a token having a relatively high attention degree among the first source codes having a relatively high similarity with a second source code prepared in advance, thereby improving a probability that a desired program is generated.

Claims (32)

1 . A program generation device comprising a processor configured to execute operations comprising:

calculating, for a plurality of first source codes, a similarity between the first source code and a sentence explaining a specification of a desired program in a natural language;

calculating an attention degree of each token constituting the first source code in calculation of the similarity; and

automatically generating a plurality of synthesis codes by synthesizing a token having a relatively high attention degree among the first source codes having a relatively high similarity with a second source code prepared in advance.

2 . The program generation device according to claim 1 , wherein the calculating the similarity further comprises calculating the similarity between the sentence explaining the specification of the desired program in the natural language and the first source code and the attention degree of each token constituting the first source code by using a neural network, and the neural network calculates a similarity between a sentence explaining a specification of a program in a natural language and a source code of the program and an attention degree of each token constituting the source code in calculation of the similarity.

3 . The program generation device according to claim 2 , further comprising:

training the neural network such that the similarity calculated by the neural network for a sentence of first learning data and a source code of second learning data in a set of learning data including a set of a source code of a program and a sentence explaining a specification of the program in a natural language approaches a predetermined similarity between the source code of the first learning data and the source code of the second learning data.

4 . A method for generating a program, the method comprising:

calculating, for a plurality of first source codes, a similarity between the first source code and a sentence explaining a specification of a desired program in a natural language;

calculating an attention degree of each token constituting the first source code in calculation of the similarity; and

automatically generating a plurality of synthesis codes by synthesizing a token having a relatively high attention degree among the first source codes having a relatively high similarity with a second source code prepared in advance.

5 . The method according to claim 4 , wherein the calculating the similarity further comprises calculating the similarity between the sentence explaining the specification of the desired program in the natural language and the first source code and the attention degree of each token constituting the first source code by using a neural network, and the neural network calculates a similarity between a sentence explaining a specification of a program in a natural language and a source code of the program and an attention degree of each token constituting the source code in calculation of the similarity.

6 . The method according to claim 5 , further comprising:

training the neural network such that the similarity calculated by the neural network for a sentence of first learning data and a source code of second learning data in a set of learning data including a set of a source code of a program and a sentence explaining a specification of the program in a natural language approaches a predetermined similarity between the source code of the first learning data and the source code of the second learning data.

7 . A computer-readable non-transitory recording medium storing computer-executable program instructions that when executed by a processor cause a computer to execute operations comprising:

calculating, for a plurality of first source codes, a similarity between the first source code and a sentence explaining a specification of a desired program in a natural language;

calculating an attention degree of each token constituting the first source code in calculation of the similarity; and

automatically generating a plurality of synthesis codes by synthesizing a token having a relatively high attention degree among the first source codes having a relatively high similarity with a second source code prepared in advance.

8 . The program generation device according to claim 1 , wherein the neural network represents a similarity calculation model, and the similarity calculation model includes a first set of neural networks to generate a first vector based on each word in the sentence.

9 . The program generation device according to claim 8 , wherein the similarity calculation model further includes a second set of neural networks to generate a second vector based on each token in the first source codes.

10 . The program generation device according to claim 9 , wherein the similarity is based on a cosine similarity between the first vector and the second vector.

11 . The program generation device according to claim 1 , wherein the automatically generated plurality of synthesis codes represents an executable code.

12 . The method according to claim 4 , wherein the neural network represents a similarity calculation model, and the similarity calculation model includes a first set of neural networks to generate a first vector based on each word in the sentence.

13 . The method according to claim 4 , wherein the automatically generated plurality of synthesis codes represents an executable code.

14 . The method according to claim 12 , wherein the similarity calculation model further includes a second set of neural networks to generate a second vector based on each token in the first source codes.

15 . The method according to claim 14 , wherein the similarity is based on a cosine similarity between the first vector and the second vector.

16 . The computer-readable non-transitory recording medium according to claim 7 , wherein the calculating the similarity further comprises calculating the similarity between the sentence explaining the specification of the desired program in the natural language and the first source code and the attention degree of each token constituting the first source code by using a neural network, and the neural network calculates a similarity between a sentence explaining a specification of a program in a natural language and a source code of the program and an attention degree of each token constituting the source code in calculation of the similarity.

17 . The computer-readable non-transitory recording medium according to claim 16 , the computer-executable program instructions when executed further causing the computer to execute operations comprising:

training the neural network such that the similarity calculated by the neural network for a sentence of first learning data and a source code of second learning data in a set of learning data including a set of a source code of a program and a sentence explaining a specification of the program in a natural language approaches a predetermined similarity between the source code of the first learning data and the source code of the second learning data.

18 . The computer-readable non-transitory recording medium according to claim 7 , wherein the neural network represents a similarity calculation model, and the similarity calculation model includes a first set of neural networks to generate a first vector based on each word in the sentence.

19 . The computer-readable non-transitory recording medium according to claim 18 , wherein the similarity calculation model further includes a second set of neural networks to generate a second vector based on each token in the first source codes.

20 . The computer-readable non-transitory recording medium according to claim 19 , wherein the similarity is based on a cosine similarity between the first vector and the second vector.

Assignments (2)
CHANGE OF NAME Recorded Jan 1, 2026
From: NIPPON TELEGRAPH AND TELEPHONE CORPORATION
To: NTT, INC.
Reel/Frame 074164/0725 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 31, 2023
From: KURABAYASHI, TOSHIYUKI; YOSHIMURA, YU; TANNO, HARUTO
To: NIPPON TELEGRAPH AND TELEPHONE CORPORATION
Reel/Frame 065399/0191 →