-
公开(公告)号:US20240036843A1
公开(公告)日:2024-02-01
申请号:US18379315
申请日:2023-10-12
Applicant: GOOGLE LLC
Inventor: Qianyu Zhang , Bin Ni , Rishabh Singh , Olivia Hatalsky
CPC classification number: G06F8/447 , G06F8/34 , G06F8/36 , G06F8/71 , G06F16/00 , G06F8/33 , G06F16/2425
Abstract: Implementations are described herein for adapting existing source code snippets to new contexts. In various implementations, a command may be detected to incorporate an existing source code snippet into destination source code. An embedding may be generated based on the existing source code snippet, e.g., by processing the existing source code snippet using an encoder. The destination source code may be processed to identify one or more decoder constraints. Subject to the one or more decoder constraints, the embedding may be processed using a decoder to generate a new version of the existing source code snippet that is adapted to the destination source code.
-
公开(公告)号:US12182555B2
公开(公告)日:2024-12-31
申请号:US18379315
申请日:2023-10-12
Applicant: GOOGLE LLC
Inventor: Qianyu Zhang , Bin Ni , Rishabh Singh , Olivia Hatalsky
IPC: G06F8/30 , G06F8/33 , G06F8/34 , G06F8/36 , G06F8/41 , G06F8/71 , G06F16/00 , G06F16/242 , G06N3/045 , G06N3/088
Abstract: Implementations are described herein for adapting existing source code snippets to new contexts. In various implementations, a command may be detected to incorporate an existing source code snippet into destination source code. An embedding may be generated based on the existing source code snippet, e.g., by processing the existing source code snippet using an encoder. The destination source code may be processed to identify one or more decoder constraints. Subject to the one or more decoder constraints, the embedding may be processed using a decoder to generate a new version of the existing source code snippet that is adapted to the destination source code.
-
公开(公告)号:US11886850B2
公开(公告)日:2024-01-30
申请号:US17903496
申请日:2022-09-06
Applicant: Google LLC
Inventor: Owen Lewis , Bin Ni
Abstract: Implementations are described herein for building and/or applying a library of transformation templates to automate migration of source code. In various implementations, pre-migration and post-migration versions of source code that exist prior to and after migration of the source code may be analyzed. Based on the analysis, one or more transformations made to the pre-migration version of the source code to yield the post-migration version of the source code may be identified. A library of transformation templates that are applicable subsequently to automate migration of new source code may be built. In some implementations, for one or more of the transformations, a plurality of candidate transformation templates may be generated with different permutations of tokens being replaced with placeholders. One of the plurality of candidate transformation templates may be selected for inclusion in the library based on one or more criteria.
-
公开(公告)号:US11656867B2
公开(公告)日:2023-05-23
申请号:US17945376
申请日:2022-09-15
Applicant: Google LLC
Inventor: Rishabh Singh , David Andre , Bin Ni , Owen Lewis
Abstract: Implementations are described herein for using machine learning to perform various tasks related to migrating source code based on relatively few (“few shots”) demonstrations. In various implementations, an autoregressive language model may be conditioned based on demonstration tuple(s). In some implementations, a demonstration tuple may include a pre-migration version of a first source code snippet and a post-migration version of the first source code snippet. In other implementations, demonstration tuples may include other data, such as intermediate forms (e.g., natural language descriptions or pseudocode), input-output pairs demonstrating intended behavior, etc. The autoregressive language model may be trained on corpora of source code and natural language documentation on the subject of computer programming. A pre-migration version of a source code file may be processed based on the conditioned autoregressive language model, and a post-migration version may be generated based on output generated based on the conditioned autoregressive model.
-
公开(公告)号:US11822909B2
公开(公告)日:2023-11-21
申请号:US17901128
申请日:2022-09-01
Applicant: Google LLC
Inventor: Qianyu Zhang , Bin Ni , Rishabh Singh , Olivia Hatalsky
CPC classification number: G06F8/447 , G06F8/34 , G06F8/36 , G06F8/71 , G06F16/00 , G06F16/2425 , G06N3/045 , G06N3/088
Abstract: Implementations are described herein for adapting existing source code snippets to new contexts. In various implementations, a command may be detected to incorporate an existing source code snippet into destination source code. An embedding may be generated based on the existing source code snippet, e.g., by processing the existing source code snippet using an encoder. The destination source code may be processed to identify one or more decoder constraints. Subject to the one or more decoder constraints, the embedding may be processed using a decoder to generate a new version of the existing source code snippet that is adapted to the destination source code.
-
16.
公开(公告)号:US20230214195A1
公开(公告)日:2023-07-06
申请号:US18119640
申请日:2023-03-09
Applicant: GOOGLE LLC
Inventor: Bin Ni , Owen Lewis , Qianyu Zhang
Abstract: Implementations are described herein for leveraging prior source code transformations to facilitate automatic creation and/or recommendation of tools for automating aspects of source code transformations captured in real time. In various implementations, a transformation made by a programmer to a source code snipped may be captured in a source code editor application in real time. Based on the transformation and the intent, one or more candidate source code transformations may be identified from one or more repositories of prior source code transformations made by one or more other programmers. The source code editor application may be caused to provide output indicative of a tool that is operable to automate one or more edits associated with both the transformation made by the programmer to the source code snippet and with one or more of the candidate source code transformations.
-
-
-
-
-