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

Active Publication Date: 2020-09-04
SHANDONG NORMAL UNIV
View PDF14 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Benefits of technology

This invention relates to improvements over previous methods such as combining both symbolic and grammar aspects from binary codes or graphs. These new techniques help improve accuracy and quality when analyzed separately but they also combine them together effectively. Additionally, this method allows users to easily extract specific parts of these representations without having to manually analyze each part individually instead of collectively. Overall, it provides technical benefits like improved performance and flexibility in programming languages while maintaining good usability across different platforms.

Problems solved by technology

Technological Problem addressed in this patented text relates to improving programming speed while optimizing computer resources usage without sacrificing accuracy due to complex coding structures. Current solutions require significant effort and knowledge inputted manually through annotation commentation with extensive documentation. Therefore there exists a technical challenge where developing efficient codes requires understanding symbolic content and contextual relationships between different parts of the same code.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Code abstract generation method and system based on semantic and grammatical information fusion
  • Code abstract generation method and system based on semantic and grammatical information fusion
  • Code abstract generation method and system based on semantic and grammatical information fusion

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a code abstract generation method and system based on semantic and grammatical information fusion. The method comprises the steps of obtaining a code of a to-be-generated abstract; respectively extracting a graph embedding vector and a node embedding vector from a code of a to-be-generated abstract; and inputting the graph embedding vector and the node embedding vector intoa pre-trained deep learning model, and outputting an abstract of the code. Higher-quality code annotations and abstracts can be automatically obtained in a mode of combining code semantics and grammatical information with an automatic abstract model, so that the software development speed of programmers is increased, and the method and system have great practical significance.

Description

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Owner SHANDONG NORMAL UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products