Syntactically coherent code segmentation
AssigneeGoogle Inc.
InventorsNavneet Potti, Joshua Howland
Life of this patent
Estimating the term…
Abstract
Techniques are described herein for segmenting source code into syntactically coherent sequences of tokens that satisfy constraints inherent in sequence-to-sequence networks. In various implementations, source code may be processed to generate one or more graphs representing the source code. One or more of the graphs may then be traversed to identify one or more sequences of tokens within the source code that satisfy an input constraint of a sequence-to-sequence network. The source code may be segmented into the identified one or more sequences of tokens. The one or more sequences of tokens may then be processed using the sequence-to-sequence network.
Claims20
A method implemented by one or more processors and comprising:
- processing source code to generate one or more graphs representing the source code;
- traversing one or more of the graphs to identify one or more sequences of tokens within the source code that satisfy an input constraint of a sequence-to-sequence network;
- segmenting the source code into the identified one or more sequences of tokens;
- and
- processing the one or more sequences of tokens using the sequence-to-sequence network.
A system comprising one or more processors and memory storing instructions that, in response to execution by the one or more processors, cause the one or more processors to:
- process source code to generate one or more graphs representing the source code;
- traverse one or more of the graphs to identify one or more sequences of tokens within the source code that satisfy an input constraint of a sequence-to-sequence network;
- segment the source code into the identified one or more sequences of tokens;
- and
- process the one or more sequences of tokens using the sequence-to-sequence network.
At least one non-transitory computer-readable medium comprising instructions that, when executed by one or more processors, cause the one or more processors to:
- process source code to generate one or more graphs representing the source code;
- traverse one or more of the graphs to identify one or more sequences of tokens within the source code that satisfy an input constraint of a sequence-to-sequence network;
- segment the source code into the identified one or more sequences of tokens;
- and
- process the one or more sequences of tokens using the sequence-to-sequence network.
Dependencies are inferred from the claim text.