Code abstract generation method and system based on semantic and grammatical information fusion
A technology of grammatical information and code summarization, which is applied in code refactoring, neural learning methods, biological neural network models, etc., can solve problems such as inability to process in large batches, poor effect, and failure to reflect code grammatical information well. To achieve the effect of improving superiority and robustness
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Benefits of technology
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0040] This embodiment provides a code summary generation method based on the fusion of semantic and grammatical information;
[0041] Such as figure 1 As shown, the code summary generation method based on the fusion of semantic and grammatical information includes:
[0042] S101: Obtain the code of the abstract to be generated;
[0043] S102: Extract graph embedding vectors and node embedding vectors respectively from the code to generate the summary;
[0044] S103: Input the graph embedding vector and the node embedding vector into the pre-trained deep learning model, and output a code summary.
[0045] As one or more embodiments, the step of extracting a graph embedding vector includes:
[0046] Perform AST tree modeling on the code to be generated for summary;
[0047] Perform vector representation on the nodes in the tree modeling to obtain the syntax representation vector of each node;
[0048] Aggregate the syntax representation vectors of all nodes to obtain the g...
Embodiment 2
[0155] This embodiment provides a code summary generation system based on the fusion of semantic and grammatical information;
[0156] A code summary generation system based on the fusion of semantic and grammatical information, including:
[0157] An acquisition module configured to: acquire the code of the abstract to be generated;
[0158] A vector extraction module, which is configured to: respectively extract a graph embedding vector and a node embedding vector from the code to generate a summary;
[0159] The summary generation module is configured to: input the graph embedding vector and the node embedding vector into the pre-trained deep learning model, and output a summary of the code.
[0160] It should be noted here that the above acquisition module, vector extraction module and abstract generation module correspond to steps S101 to S103 in the first embodiment, and the examples and application scenarios implemented by the above modules are the same as those of the...
Embodiment 3
[0164] This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein, the processor is connected to the memory, and the one or more computer programs are programmed Stored in the memory, when the electronic device is running, the processor executes one or more computer programs stored in the memory, so that the electronic device executes the method described in Embodiment 1 above.
[0165] It should be understood that in this embodiment, the processor can be a central processing unit CPU, and the processor can also be other general-purpose processors, digital signal processors DSP, application specific integrated circuits ASIC, off-the-shelf programmable gate array FPGA or other programmable logic devices , discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, o...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com