CPC G06F 8/51 (2013.01) [G06F 8/73 (2013.01); G06F 18/23213 (2023.01)] | 14 Claims |
1. A method for translating a source code snippet from a first programming language to a second programming language, the method implemented by one or more processors and comprising:
processing the source code snippet written in the first programming language using an encoder portion of a transformer network to generate an embedding of the source code snippet;
processing the embedding of the source code snippet using an all-pair attention layer to generate an attended embedding of the source code snippet;
processing the attended embedding of the source code snippet using an output layer to generate, independently of sequence-to-sequence decoding by way of a single transformation of the attended embedding of the source code snippet, a matrix of probability distributions, wherein the matrix comprises an x by y matrix, with x being a non-zero integer equal to a number of tokens extracted from the source code snippet; and
once the matrix of probability distributions is generated, sampling a plurality of candidate second programming language snippets based on the matrix of probability distributions.
|