Natural language code search
US-2021303989-A1 · Sep 30, 2021 · US
US12547382B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-12547382-B2 |
| Application number | US-202318310749-A |
| Country | US |
| Kind code | B2 |
| Filing date | May 2, 2023 |
| Priority date | Nov 2, 2020 |
| Publication date | Feb 10, 2026 |
| Grant date | Feb 10, 2026 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
Code inputted by a user is received through a user interface. A feature of context of to-be-completed code is determined based on the code inputted by the user. Next, at least one candidate item of the to-be-completed code is determined from a context database based on the feature of context of the to-be-completed code. The context database stores sample code and a feature of context of the sample code. Then, the at least one candidate item is presented to the user through the user interface.
Opening claim text (preview).
What is claimed is: 1 . A code processing method, comprising: receiving, through a user interface, first code from a user; determining a first feature of context of to-be-completed code based on the first code; determining at least one candidate item of the to-be-completed code from a context database based on the first feature, wherein the context database stores sample code and a second feature of context of the sample code; and filtering a candidate item with a circular reference out of the at least one candidate item to obtain at least one first candidate item; and presenting the at least one first candidate item to the user through the user interface. 2 . The code processing method of claim 1 , further comprising: obtaining statistical information of the at least one first candidate item in the context database; and filtering the at least one first candidate item based on the statistical information to obtain at least one second candidate item, and wherein presenting the at least one first candidate item to the user comprises presenting the at least one second candidate item to the user through the user interface. 3 . The code processing method of claim 1 , further comprising inputting the at least one first candidate item and the first feature into an assessment model to obtain a recommendation probability of the at least one first candidate item, and wherein presenting the at least one first candidate item to the user comprises: determining a target candidate item in the at least one first candidate item based on the recommendation probability; and presenting the target candidate item to the user through the user interface. 4 . The code processing method of claim 1 , wherein the first candidate item comprises a function name, wherein the code processing method further comprises filling the at least one first candidate item with a parameter based on second code in a code file that comprises the first code to generate a filled-in at least one first candidate item that is filled with the parameter, and wherein presenting the at least one first candidate item to the user comprises presenting, to the user through the user interface, the filled-in at least one first candidate item. 5 . The code processing method of claim 1 , wherein determining the at least one first candidate item comprises: searching the context database based on the first feature using a depth-first search algorithm; and determining the at least one first candidate item based on the searching. 6 . The code processing method of claim 1 , wherein the first code comprises a prefix of the to-be-completed code, and wherein determining the at least one first candidate item comprises determining, from the context database based on the first feature, one or more candidate items that match the prefix. 7 . The code processing method of claim 1 , wherein the context database comprises at least one of a first database based on an open source dataset or a second database based on a private dataset of the user. 8 . The code processing method of claim 1 , wherein the to-be-completed code comprises second code in a class method, and wherein the first code comprises a return type. 9 . The code processing method of claim 8 , further comprising determining, based on the first feature, a role called by the class method corresponding to the to-be-completed code, wherein the role is for assisting in determining a recommendation probability of the at least one first candidate item. 10 . A device comprising: a memory configured to store executable instructions; and a processor coupled to the memory and configured to execute instructions to cause the device to: receive, through a user interface, first code from a user; determine a first feature of context of to-be-completed code based on the first code; determine at least one candidate item of the to-be-completed code from a context database based on the first feature, wherein the context database stores sample code and a second feature of context of the sample code; filter a candidate item with a circular reference out of the at least one candidate item to obtain at least one first candidate item; and present the at least one first candidate item to the user through the user interface. 11 . The device of claim 10 , wherein the processor is further configured to execute the instructions to cause the device to: obtain statistical information of the at least one first candidate item in the context database; filter the at least one first candidate item based on the statistical information to obtain at least one second candidate item; and present at least one second candidate item to the user through the user interface. 12 . The device of claim 10 , wherein the processor is further configured to execute the instructions to cause the device to: input the at least one first candidate item and the first feature into an assessment model to obtain a recommendation probability of the at least one first candidate item; determine a target candidate item in the at least one first candidate item based on the recommendation probability; and present the target candidate item to the user through the user interface. 13 . The device of claim 10 , wherein the processor is further configured to execute the instructions to cause the device to: fill, when the first candidate item obtained through filtering comprises a function name, the at least one first candidate item with a parameter based on second code in a code file that comprises the first code to generate a filled-in at least one first candidate item that is filled with the parameter; and present, to the user through the user interface, the filled-in at least one first candidate item. 14 . The device of claim 10 , wherein the processor is further configured to execute the instructions to cause the device to: search the context database based on the first feature o using a depth-first search algorithm; and determine the at least one first candidate item based on the search. 15 . The device of claim 10 , wherein the first code comprises a prefix of the to-be-completed code, and wherein the processor is further configured to execute the instructions to cause the device to determine, from the context database based on the first feature, one or more candidate items that match the prefix of the to-be-completed code. 16 . The device of claim 10 , wherein the context database comprises at least one of a first database based on an open source dataset or a second database based on a private dataset of the user. 17 . The device of claim 10 , wherein the to-be-completed code comprises second code in a class method, and wherein the first code comprises a return type. 18 . The device of claim 17 , wherein the processor is further configured to execute the instructions to cause the device to determine, based on the first feature, a role called by the class method corresponding to the to-be-completed code, wherein the role is for assisting in determining a recommendation probability of the at least one first candidate item.
Related publications grouped by family.
Answers are generated from the same data shown on this page.