| CPC G06F 8/33 (2013.01) [G06F 8/35 (2013.01); G06F 40/274 (2020.01); G06N 3/08 (2013.01)] | 19 Claims |

|
1. A system comprising:
a processor; and
a memory that stores one or more programs that are configured to be executed by the processor, the one or more programs including instructions to perform actions that:
obtain a method signature from a source code program in a source code development tool, wherein the method signature comprises a method name and at least one parameter;
convert the method signature into an input sequence of tokens;
form a context tensor for the input sequence of tokens, wherein the context tensor comprises a token embedding for each token of the input sequence of tokens;
provide the context tensor to a neural transformer model with attention;
perform a beam search to generate the method body for the method signature in the source code development tool using the context tensor to invoke the neural transformer model with attention, wherein the beam search generates partial sequences of tokens iteratively at each of a plurality of timesteps, wherein the beam search invokes the neural transformer model with attention, given the method signature, to generate a probability distribution, at each timestep of the plurality of timesteps, to identify top tokens to be a next token in a respective partial sequence, wherein the beam search expands each partial sequence from the top tokens identified by the probability distribution generated from the neural transformer model with attention, wherein the beam search ends when a termination token appears as the most probable next token for a select partial sequence which is then output as the method body, wherein the neural transformer model with attention generates the method body given the method signature; and
present the method body in the source code program as a candidate for code completion in the source code development tool.
|