Source code comparison method and system oriented to technical features and program product
A technology of technical features and source code, applied in the field of natural language processing, can solve the problems of not considering semantic information, calling information and structural semantics of code technical features, and achieving the effect of improving accuracy
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0069] like figure 1 As well as figure 2 Show, a method of comparison of technical characteristics, including:
[0070] Code file pre -processing phase, the function of the function, function name, and built -in class name for output code;
[0071] The functional semantic encoding phase of the function calls is used to use a self -encoder method based on the convolutional neural network of graphic convolutional neural network to obtain the function call structure vector for the function of the function. ,所述图语义编码具体按照以下文献实现:William L. Hamilton, RexYing, Jure Leskovec. Inductive representation learning on large graphs[C].Proceedings of the 31st International Conference on Neural InformationProcessing Systems. 2017: 1025-1035;
[0072] The call information of the function name and built-in class name uses the TF-IDF algorithm encoding phase, and the function vector and built-in class vector are obtained. Similar contrast;
[0073] Finally, the function calls the structure vector, func...
Embodiment 2
[0090] As described as described by an example 1, a technical -oriented source code comparison method, in order to make the structural semantic vector containing rich nodes and edges, so that the neighbor matrix that is constructed is similar to the original adjacent matrix as possible, and use it as possible. The cross -entropy of the adjacent matrix of the reconstruction diagram and the adjacent matrix of the original map is used as a loss function. The calculation of the loss function is as shown in the formula (VI):
[0091]
[0092] In the formula (VI), N Indicates the number of megs set by the function call; Indicates the elements in the adjacent matrix A of the original map; Indicates the adjacent matrix of the reconstruction of the original map Elements in.
Embodiment 3
[0094] An Example 1 The source code comparison method for technical characteristics described in the Example 1,
[0095] The call information coding phase of the function name and the built -in class name includes: in the functional part of the function, the call information vector based on the function name is performed by the function similarity contrast. The algorithm code contains a large number of functions that provide basic functions. The function has a clear function of the function , Entry call parameters and return values, so the function of the code with similar functions is also similar. According to the TF-IDF calculation module of the function name, the function calls the information vector. h f The calculation is as shown in the formula (VII):
[0096]
[0097] In the formula (VII), h f Indicates functional vector; f (fun i ) Indicate the code in the code i The TFIDF value of a single -called function;
[0098] In the similarity of the inner category class, the c...
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