Search device and search method

The search device uses a function code embedding model to mask function names and generate distributed vectors, accurately identifying semantically similar source code functions, thereby improving debugging accuracy.

JP7797369B2Active Publication Date: 2026-01-13HITACHI LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2022204819
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2026-01-13
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

Conventional methods for source code debugging, such as keyword searches and code clone tools, struggle to accurately identify semantically similar code portions due to their reliance on rule-based approaches, often missing defects that are written differently but functionally equivalent.

Method used

A search device and method that utilizes a trained function code embedding model to generate distributed representation vectors for source code functions, masking function names to focus on processing content, enabling accurate detection of semantically similar functions by comparing masked query and search target vectors.

Benefits of technology

Enables precise extraction of source code sections with similar processing contents, enhancing debugging efficiency by identifying functions with defects that may appear differently but perform similar operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007797369000001
    Figure 0007797369000001
  • Figure 0007797369000002
    Figure 0007797369000002
  • Figure 0007797369000003
    Figure 0007797369000003
Patent Text Reader

Abstract

To provide a search device and a search method that support debugging of a source code by accurately extracting a description part that has substantially similar processing contents.SOLUTION: A similarity function search system (search device) is configured to: input processing unit data, in which each name part of a plurality of processing units among an input source code are replaced with masking data, into a trained model so as to generate search target function feature data representing a feature of the processing contents of each processing unit of the input source code for each of the plurality of processing units; receive input of the processing unit and input processing unit data, in which the name part of the processing unit out of the received processing units is replaced with masking data, into the trained model so as to generate query function feature data representing the feature of the processing contents of the input processing unit; and search for similar search target function feature data from each search target function feature data so as to output information on the processing unit related to the searched search target function feature data.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a search device and a search method. [Background technology]

[0002] In recent years, system development work has become increasingly complex and large-scale, and there is a demand for developing high-quality systems in a short period of time. As systems become more complex and larger, the probability of bugs occurring in the system's source code increases. Therefore, there is an increasing need for comprehensive and accurate source code debugging.

[0003] When a bug is found in a certain part of the source code, there is a high probability that bugs exist in other parts that perform similar processing. Conventional methods for finding bugs in such other parts include users performing keyword searches specifying keywords related to the bug (variable names, function names, etc.), or using code clone tools to check cloned parts of the processing part related to the bug.

[0004] However, keyword searches often produce a large number of search results, requiring a significant amount of effort to verify them. Furthermore, even when using code clone tools, if a defect is essentially the same as the original defect but written differently, it may not be detected as a separate defect. Such rule-based methods have difficulty detecting other defects that are written differently from the original defect but are semantically equivalent.

[0005] In this regard, as a technology for performing similarity search of text using machine learning techniques, for example, Patent Document 1 describes a context-aware data mining method that receives a list of parsed and preprocessed words from an input query, calculates a related distributed embedding representation for each word in the list of words using a word embedding model of the queried text document, aggregates the related distributed embedding representations of all words in the list of words to represent the input query with a single embedding using either the average of all related distributed embedding representations or the maximum of all related distributed embedding representations, obtains a ranked list of N rows (N is a positive integer provided by the user) of document segments that are similar to the aggregated word embedding representation of the query, and returns the list of obtained segments to the user. [Prior art documents] [Patent documents]

[0006] [Patent Document 1] Special Publication No. 2022-536241 Summary of the Invention [Problem to be solved by the invention]

[0007] Patent Document 1 uses a word embedding model to convert text into distributed representation vectors, and searches for similar texts based on the similarity between the vectors.

[0008] However, source code often contains a variety of processes, and contains both important and unimportant parts for implementing a function. In such cases, Patent Document 1 performs learning without distinguishing between important and unimportant parts, which may result in the extraction of code that is similar in description but not semantically similar, or conversely, may not extract code that is different in description but semantically similar.

[0009] The present invention has been made in view of the above circumstances, and its object is to provide a method for processing a The present invention provides a search device and a search method capable of supporting the debugging of source code by accurately extracting substantially similar description portions of source code. [Means for solving the problem]

[0010] One aspect of the present invention for solving the above problem is a storage device that stores a trained model that receives input of processing unit data in which name portions assigned to processing units in source code are replaced with predetermined masking data, and outputs data representing the characteristics of the processing content of the processing units; and a storage device that receives input of source code including a plurality of processing units, and inputs processing unit data in which name portions assigned to each of the plurality of processing units in the input source code are replaced with the masking data into the trained model, thereby generating search target function feature data, which is data representing the characteristics of the processing content of each processing unit of the input source code, from the plurality of processing units. a search target function feature data generation process that receives an input of a processing unit, and generates query function feature data that represents the features of processing content of the input processing unit by inputting data of the processing unit in which a name portion assigned to the input processing unit is replaced with the masking data into the trained model; and an output process that searches each of the generated search target function feature data for search target function feature data that is similar to the query function feature data, and outputs information on the processing unit related to the searched search target function feature data. [Effects of the Invention]

[0011] According to the present invention, it is possible to assist in debugging source code by accurately extracting description portions of source code that have substantially similar processing contents. Configurations and effects other than those described above will become apparent from the following description of the embodiments. [Brief explanation of the drawings]

[0012] [Figure 1] 1 is a diagram illustrating an example of a configuration of a source code development support system according to an embodiment of the present invention. [Figure 2] FIG. 10 is a diagram illustrating an example of a learning function code. [Figure 3] FIG. 2 is a diagram illustrating an example of a hardware configuration of each information processing device in the source code development support system. [Figure 4] FIG. 2 is a flowchart illustrating an outline of processing performed in the source code development support system. [Figure 5] FIG. 10 is a flow diagram illustrating details of a model learning process. [Figure 6] FIG. 10 is a diagram illustrating an example of a masked learning function code. [Figure 7] 10A and 10B are diagrams illustrating a specific example of a generation process of a function code embedding model. [Figure 8] FIG. 10 is a flowchart illustrating details of a search target function code analysis process. [Figure 9] 10A and 10B are diagrams illustrating a specific example of output processing of a search target function code distributed expression vector. [Figure 10] FIG. 10 is a flowchart illustrating details of a similar function search process. [Figure 11] FIG. 10 is a diagram illustrating an example of a screen displayed on a user terminal in the source code modification assistance process. DETAILED DESCRIPTION OF THE INVENTION

[0013] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

[0014] FIG. 1 is a diagram showing an example of the configuration of a source code development support system 1 according to this embodiment. The source code development support system 1 includes a user terminal 10 managed by a user who develops source code, and a similar function search system 20 (search device) that searches for functions in the source code that have a defect (bug, etc.). The function search system 20 is connected to a wired or wireless communication network 5 such as the Internet, a LAN (Local Area Network), a WAN (Wide Area Network), or a dedicated line. Be more connected.

[0015] The similar function search system 20 first receives data (in this embodiment, vector data in which the source code description is distributed) of each processing unit (here, functions) that constitutes the source code, and then generates a trained model (hereinafter referred to as a function code embedding model) by machine learning that predicts and outputs the name of the function along with data on the description portion that characterizes the processing content of the function. Note that the language and format of the source code are not particularly limited.

[0016] Meanwhile, the similar function search system 20 stores source code that is being developed by a user (hereinafter referred to as search target source code). The similar function search system 20 also acquires a function (hereinafter referred to as query function code) that is known to have a defect in the search target source code or source code other than the search target source code. Note that the search target source code includes multiple functions.

[0017] The similar function search system 20 inputs the query function code into a function embedding model to output data (vector data) of the description part that characterizes the processing content of the query function code. Then, the similar function search system 20 compares this output vector data with the vector data of other functions in the source code to be searched, thereby searching for other functions in the source code to be searched that have a defect. Next, each function of the similar function search system 20 will be described in detail.

[0018] The similar function search system 20 includes functional units including a learning function code storage unit 21, a search target function code storage unit 22, an input unit 23, a function name masking processing unit 24, a model learning execution unit 25, a function code embedded model storage unit 26, a function code distributed representation vector generation unit 27, a search target function code distributed representation vector storage unit 28, a similar vector search unit 29, and an output unit 30.

[0019] The training function code storage unit 21 stores function data (hereinafter referred to as training function code) as training data for generating a function code embedding model. The training function code is, for example, the source code of a system developed in the past. The training function code is not limited to one developed by the user in the past, but may be one obtained from an external device, the Internet, etc.

[0020] 2 is a diagram showing an example of a learning function code. The learning function code 211 includes a function name 212 and a description of each process within the function. The description of each process includes a description 213 that characterizes the processing content of the function and other descriptions 214. Examples of descriptions 214 that do not characterize the processing content of the function include a description of processing for log output and a description related to exception handling.

[0021] 1, the search target function code storage unit 22 stores the search target source code. The search target source code is acquired from the user terminal 10, for example.

[0022] The input unit 23 receives a query function code 31 from the user terminal 10. The query function code 31 may be, for example, a function containing a defect (bug, etc.) that the user has discovered from a function in the source code to be searched, or may be a function discovered from source code other than the source code to be searched. The query function code 31 may be discovered based on a predetermined tool or the like that performs keyword search processing.

[0023] The function name masking processing unit 24 replaces the function name 212 in the source code to be searched with a predetermined masking code. The function name masking processing unit 24 also replaces the function name in the query function code 31 with the same masking code as above. The function name masking processing unit 24 also replaces the function name in the learning function code 211 with the same masking code as above.

[0024] The model learning execution unit 25 learns the relationship between the description of the processing in the masked learning function code 211 and the name of the function in the learning function code 211, and generates a function code embedding model that receives data of a function whose name is masked and outputs data (distributed representation vector) representing the characteristics of the processing in that function together with data representing the name of the function.

[0025] The function code embedding model storage unit 26 stores the function code embedding model generated by the model learning execution unit 25.

[0026] The function code distributed representation vector generation unit 27 generates a distributed representation vector for each function of the source code to be searched (hereinafter referred to as the search target function code distributed representation vector) by inputting the description data of each function of the source code to be searched, with the function name masked, into the function code embedding model.

[0027] In addition, the function code distributed representation vector generation unit 27 generates a distributed representation vector of the function of the query function code (hereinafter referred to as the query function code distributed representation vector) by inputting the description data of each function of the query function code, whose function name is masked, into the function code embedding model.

[0028] The search target function code distributed expression vector storage unit 28 stores the search target function code distributed expression vector generated by the function code distributed expression vector generation unit 27.

[0029] The similar vector search unit 29 searches for a function in the source code to be searched (hereinafter referred to as a similar function) that has a distributed representation vector similar to the query function code distributed representation vector by referring to the distributed representation vector of the function code to be searched.

[0030] The output unit 30 transmits information 32 of the similar functions searched for by the similar vector search unit 29 to the user terminal 10.

[0031] Next, Fig. 3 is a diagram showing an example of the hardware configuration of each information processing device (user terminal 10 and similar function search system 20) in the source code development support system 1. Each information processing device includes a control device 11 such as a CPU (Central Processing Unit), a main storage device 12 such as a RAM (Random Access Memory) or a ROM (Read Only Memory), and a HDD. An auxiliary storage device 13 such as a hard disk drive (D) or a solid state drive (SSD), an input device 14 such as a keyboard, a mouse, or a touch panel, an output device 15 such as a display or a touch panel, a network interface card (NIC), a wireless communication module, a USB The communication device 16 is configured with a Universal Serial Interface (Universal Serial Interface) module, a serial communication module, or the like.

[0032] The functions of the functional units of each information processing device in the source code development support system 1 described above are realized by the control device 11 reading out programs from the main storage device 12 or the auxiliary storage device 13. Each program can be recorded on a portable or fixed recording medium and distributed. These programs can be distributed in whole or in part. However, they may also be realized using virtual information processing resources provided using virtualization technology, process space separation technology, etc., such as virtual servers provided by a cloud system. Furthermore, all or part of these programs may be realized by services provided by the cloud system via, for example, an API (Application Programming Interface). Next, the processing performed in the source code development support system 1 will be described.

[0033] <Outline of source code modification support process> 4 is a flow diagram illustrating an outline of processing (source code modification support processing) performed in the source code development support system 1. The source code modification support processing is started, for example, when the similar function search system 20 receives a predetermined input from the user terminal 10.

[0034] The similar function search system 20 executes a model learning process s10 for generating a function code embedding model.

[0035] The similar function search system 20 executes a search target function code analysis process s20 to generate a search target function code distributed representation vector by inputting the search target source code with the function name masked into the function code embedding model generated in the model learning process s10.

[0036] Similarly, the similar function search system 20 generates a query function code distributed representation vector. The similar function search system 20 executes a similar function search process s30 to search for a function (similar function) having a distributed representation vector similar to the query function code distributed representation vector, based on the query function code distributed representation vector and each search target function code distributed representation vector generated in the search target function code analysis process s20. Each process will be described in detail below.

[0037] <Model learning process> FIG. 5 is a flow diagram illustrating the details of the model learning process s10. The function name masking processing unit 24 acquires the function code for learning from the function code storage unit for learning 21 (s11).

[0038] The function name masking processing unit 24 masks the acquired function code for learning (s12). Specifically, the function name masking processing unit 24 identifies the function name portion by performing syntax analysis of the function code for learning, and replaces the identified function name portion with a masking code.

[0039] FIG. 6 is a diagram showing an example of a masked learning function code 211. As shown in the figure, the function name in the learning function code 211 is masked by a masking code 215 ( <mask>) has been replaced.

[0040] 5, the model learning execution unit 25 generates a function code embedding model by using the masked function code for learning as learning data and the original function name in the function code for learning as correct answer data for the learning data (s13). The function code embedding model storage unit 26 stores the generated function code embedding model (s14).

[0041] FIG. 7 is a diagram illustrating a specific example of the process in s13 (processing for generating a function code embedding model). The model learning execution unit 25 identifies each description portion 702 (for example, each processing code, function, variable, symbol, and each word including the masking code) in the masked function code for learning 701, and converts each identified description portion 702 into the function code embedding model (currently being learned). Enter the address into rule 703.

[0042] The function code embedding model 703 is composed of a word embedding model 704 and a language model 705. The word embedding model 704 converts each input description part 702 into vector data 706, outputs it, and inputs each output vector data 706 to the language model 705. The vector data 706 is vector data consisting of multiple elements (vector data embedded using distributed representation).

[0043] The language model 705 is a neural network model that includes an input layer to which each vector data 706 is input, one or more intermediate layers 708 that extract features 707 that characterize the names of functions related to the training function code 701 from each vector data 706 input to the input layer, and an output layer 710 that outputs information 709 on the names of functions related to the training function code 701 based on the features 707 output from the final layer of the intermediate layer 708.

[0044] The output layer 710 may output a probability value for each name (prediction score of the function name), or may output a binary value (0 or 1).

[0045] The model learning execution unit 25 adjusts the hyperparameters in the language model 705 so that the function name information 709 (e.g., the name of the function with the highest probability value) output from the output layer 710 approaches the original function name 711 in the learning function code, which is the correct answer data for the training data.

[0046] The model configuration in the function code embedding model is not particularly limited. For example, a Transformer, which is a natural language model that includes the word embedding model 704 and the language model 705 and learns the relationship between each description part that configures each process of a function, may be used, or a combination of word2vec and a CNN (Convolution Neural Network) may be used. In this embodiment, a Transformer is used.

[0047] <Search target function code analysis process> Next, FIG. 8 is a flow diagram illustrating details of the search target function code analysis process s20. The function name masking processing unit 24 acquires the search target function code from the search target function code storage unit 22 (s21). The search target function code is acquired in advance from the user terminal 10, for example.

[0048] The function name masking processing unit 24 masks the acquired function code to be searched (s22). Specifically, the function name masking processing unit 24 performs syntax analysis of the function code to be searched to identify the part of the function name, and replaces the part of the identified function name with a masking code.

[0049] Then, the function code distributed expression vector generation unit 27 inputs the masked search target function code into the function code embedding model to output a search target function code distributed expression vector (s23).The function code distributed expression vector generation unit 27 stores the output search target function code distributed expression vector in the search target function code distributed expression vector storage unit 28 (s24).

[0050] FIG. 9 is a diagram for explaining a specific example of the process of s23 (output process of the search target function code distributed expression vector).

[0051] The function code distributed expression vector generation unit 27 generates the masked search target function code 90 Each description part (each word including a masking code) in 1 is identified, and each identified description part 902 is input to the function code embedding model 703.

[0052] Then, the word embedding model 704 in the function code embedding model 703 converts each input description portion 902 into vector data 906 and outputs it, and inputs the output vector data 906 to the language model 705.

[0053] When each vector data 906 is input, the language model 705 outputs, from the intermediate layer 708, a feature 907 (that is, a distributed representation vector of the search target function code) that characterizes the name of the function related to the search target function code 901.

[0054] The search target function code distributed representation vector is preferably data output from the final layer of the hidden layer 708, but may be data output from an intermediate layer of the hidden layer 708.

[0055] <Similar function search process> Next, FIG. 10 is a flow diagram illustrating the similar function search process s30 in detail. First, the user terminal 10 accepts designation or input of a query function code 31 from the user (s31). The user terminal 10 transmits the designated or input query function code 31 to the similar function search system 20. The input unit 23 of the similar function search system 20 acquires the query function code 31.

[0056] The function name masking processing unit 24 masks (s32) the acquired query function code 31. Specifically, the function name masking processing unit 24 replaces the function name portion in the acquired query function code 31 with a masking code in the same process as in s22.

[0057] Then, the function code distributed expression vector generation unit 27 inputs the masked function code to be searched into the function code embedding model in the same process as in s23, thereby outputting a function code distributed expression vector to be searched (s33).

[0058] The similar vector search unit 29 searches for the search target function code distributed expression vector that is most similar to the search target function code distributed expression vector output in s33 from among the search target function code distributed expression vectors for each function generated in the search target function code analysis process s20 (s34).

[0059] For example, the similarity vector search unit 29 calculates the similarity by calculating the angle (cosine similarity) between the search target function code distributed expression vector for each function and the search target function code distributed expression vector or the magnitude of the vector (Euclidean distance). Note that the method of calculating the difference in similarity described here is an example and is not particularly limited.

[0060] Then, the output unit 30 outputs information 32 of similar functions related to the search target function code distributed expression vector searched for in s34 (s35).

[0061] For example, the output unit 30 identifies the function name and function content (source code) of the function (similar function) related to the search target function code distributed expression vector searched in s34, and displays the identified function name and function content on the screen of the user terminal 10.

[0062] 11 is a diagram showing an example of a screen displayed on the user terminal 10 during the source code modification support process. This screen 1100 accepts input of search conditions, such as a package name 1111, a class name 1112, a method name 1113, and a keyword 1114, from the user. The source code modification support processing system includes a search field 1110 for searching the source code, a search target source code display field 1120 for displaying the source code to be searched, and a similar function list display field 1130 for displaying a list of similar functions that match the search conditions indicated in the search field 1110 and have been searched for by the source code modification support processing.

[0063] In the similar function list display field 1130, a similarity 1121 with respect to the query function, a package name 1122, a class name 1123, a method name 1124, and a code content 1125 are displayed for each similar function.

[0064] In this way, by combining both keyword search and search using a function code embedding model (similarity search), it is possible to accurately detect functions containing defects.

[0065] As described above, the similar function search system 20 of this embodiment generates search target function feature data (search target function code distributed representation vector) for each function, which is data representing the characteristics of the processing content of each function of the search target source code, by inputting data in which the name portion of each function of the search target source code has been replaced with masking code into the function code embedded model, and generates query function feature data (query function code distributed representation vector) which is data representing the characteristics of the processing content of the query function by inputting data in which the name portion of the query function has been replaced with masking data into the function code embedded model, searches for search target function code distributed representation vectors similar to the query function code distributed representation vector from each search target function code distributed representation vector, and outputs information on similar functions related to the search target function code distributed representation vector.

[0066] Function names generally reflect and condense the actual processing content of the function. Therefore, when data representing the characteristics of the processing content of each function of the search target source code and the query function (search target function code distributed representation vector, query function code distributed representation vector) is output using the function code embedding model described above based on data in which function names are masked, the search target function code distributed representation vector and the query function code distributed representation vector become data that accurately represent the characteristics of the actual processing content of each. Therefore, by performing a similarity search based on these vectors, it is possible to search for functions whose processing content is substantially similar to that of the query function.

[0067] In this way, the similar function search system 20 of this embodiment can assist in debugging source code by accurately extracting description portions of source code that have substantially similar processing content.

[0068] Furthermore, the function code embedding model of this embodiment outputs data representing the characteristics of the processing content in a function together with data representing the name of the function, and based on this function code embedding model, the similar function search system 20 outputs the search target function characteristic data together with data representing the name of each function, and also outputs the query function characteristic data together with data representing the name of that function.

[0069] In this way, by making the function code embedding model a model that outputs data representing the characteristics of the processing content in a function along with data representing the name of the function (making it a trained model that predicts the function name from the description of the processing within the function), it is possible to output data that accurately represents the characteristics of the processing content in the function.

[0070] Furthermore, the function code embedding model of this embodiment includes a plurality of intermediate layers that receive input data in which the name portion of a function is replaced with a masking code, and output data representing the characteristics of the processing content of the function based on the input data, and a function embedding model that generates a function based on the data representing the characteristics of the processing content. Based on such a function code embedding model, the similar function search system 20 outputs the search target function feature data from the final layer of the intermediate layers, and outputs the query function feature data from the final layer of the intermediate layers.

[0071] In this way, by outputting the search target function feature data and the query function feature data from the final layer of the intermediate layers of the function code embedding model, it is possible to output data that accurately represents the features of the processing content of the function.

[0072] In addition, the similar function search system 20 of this embodiment generates a function code embedding model by learning the relationship between the function name and data in which the function name portion has been replaced with a masking code, and stores the generated function code embedding model.

[0073] This makes it possible to use a function code embedding model that can output search target function feature data and query function feature data.

[0074] Furthermore, the function code embedding model of this embodiment is a Transformer model that learns the relationships between the description parts that make up the processing in a function.

[0075] This allows you to learn the contents of the source code efficiently and accurately.

[0076] The present invention is not limited to the above-described embodiments, and can be implemented using any components within the scope of the present invention. The above-described embodiments and modifications are merely examples, and the present invention is not limited to these contents as long as the characteristics of the invention are not impaired. Furthermore, although various embodiments and modifications have been described above, the present invention is not limited to these contents. Other aspects conceivable within the scope of the technical idea of ​​the present invention are also included within the scope of the present invention.

[0077] For example, part of the hardware provided in each device of this embodiment may be provided in another device.

[0078] Furthermore, each program of each device may be provided in another device, a program may consist of multiple programs, or multiple programs may be integrated into one program.

[0079] Furthermore, in this embodiment, the processing unit in the source code processed by the similar function search system 20 is a function, but it may also be a processing unit other than a function with at least that name (for example, a larger processing unit such as a class).

[0080] The function code embedding model may also be a model that has been fine-tuned based on an existing trained model. [Explanation of symbols]

[0081] 1 Source code development support system, 20 Similar function search system, 24 Function name masking processing unit, 25 Model learning execution unit, 27 Function code distributed representation vector generation unit, 29 Similar Vector Search Unit< / mask>

Claims

1. a storage device that stores a trained model that receives data of a processing unit in which a name portion assigned to the processing unit in a source code is replaced with predetermined masking data and outputs data representing the characteristics of the processing content of the processing unit; and a search target function characteristic data generation process that receives input of source code including a plurality of processing units, and inputs data of the processing units in which name portions assigned to each of the plurality of processing units in the input source code have been replaced with the masking data into the trained model, thereby generating search target function characteristic data, which is data representing the characteristics of the processing content of each processing unit of the input source code, for each of the plurality of processing units; a search target function feature data generation process that receives an input of a processing unit, and inputs data of the processing unit in which a name portion assigned to the input processing unit is replaced with the masking data into the trained model, thereby generating query function feature data that is data representing the features of processing content of the input processing unit; a control device that searches for search target function characteristic data similar to the query function characteristic data from each of the generated search target function characteristic data, and outputs information on processing units related to the search target function characteristic data that has been found. A search device comprising:

2. The storage device stores a trained model that receives input of data of a processing unit in which a name portion assigned to the processing unit in a source code is replaced with predetermined masking data, and outputs data representing characteristics of processing content in the processing unit together with data representing the name of the processing unit; The control device in the search target function characteristic data generation process, data of the processing units in which name portions assigned to each of the plurality of processing units in the input source code are replaced with the masking data is input to the trained model, thereby generating the search target function characteristic data for each of the plurality of processing units together with data representing the names of the processing units; In the search target function feature data generation process, data of the processing units in which name portions assigned to the processing units among the input processing units are replaced with the masking data is input to the trained model, thereby generating the query function feature data together with data representing the names of the processing units. The search device according to claim 1 .

3. the storage device stores a trained model having a plurality of intermediate layers that receive input of data of a processing unit in which a name portion assigned to the processing unit in a source code is replaced with predetermined masking data, and output data representing characteristics of processing content in the processing unit based on the input data, and an output layer that outputs data representing the name of the processing content based on the data representing the characteristics of the processing content; The control device In the search target function feature data generation process, data of processing units in which name portions assigned to the plurality of processing units in the input source code are replaced with the masking data is input to the trained model, whereby the search target function feature data is output from a final layer of the intermediate layers, and data representing the names of the processing units is output from the output layer; In the search target function feature data generation process, data of the processing units obtained by replacing name portions assigned to the processing units among the input processing units with the masking data is input to the trained model, whereby the query function feature data is output from a final layer of the intermediate layers, and data representing the names of the processing units is output from the output layer. The search device according to claim 2 .

4. The control device generates the trained model by learning a relationship between data of a processing unit obtained by replacing a name portion assigned to the processing unit from the processing unit in the source code with predetermined masking data and data representing the name of the processing unit, and stores the generated trained model in the storage device. The search device according to claim 3 .

5. The control device stores, as the trained model, a Transformer model that has learned the relationship between each description portion that constitutes the processing in the processing unit. The search device according to claim 4.

6. The information processing device A trained model is input in which data of a processing unit in which a name portion assigned to the processing unit in the source code is replaced with predetermined masking data, and which outputs data representing the characteristics of the processing content of the processing unit; a search target function characteristic data generation process that receives input of source code including a plurality of processing units, and inputs data of the processing units in which name portions assigned to each of the plurality of processing units in the input source code have been replaced with the masking data into the trained model, thereby generating search target function characteristic data, which is data representing the characteristics of the processing content of each processing unit of the input source code, for each of the plurality of processing units; a search target function feature data generation process that receives an input of a processing unit, and inputs data of the processing unit in which a name portion assigned to the input processing unit is replaced with the masking data into the trained model, thereby generating query function feature data that is data representing the features of processing content of the input processing unit; and (b) performing an output process of searching for search target function characteristic data similar to the query function characteristic data from each of the generated search target function characteristic data, and outputting information on processing units related to the search target function characteristic data found. How to search.

7. The information processing device includes: A trained model is stored in which data of a processing unit in which a name portion assigned to the processing unit in the source code is replaced with predetermined masking data is input, and data representing the characteristics of the processing content of the processing unit is output together with data representing the name of the processing unit; in the search target function characteristic data generation process, data of the processing units in which name portions assigned to each of the plurality of processing units in the input source code are replaced with the masking data is input to the trained model, thereby generating the search target function characteristic data for each of the plurality of processing units together with data representing the names of the processing units; In the search target function feature data generation process, data of the processing units in which name portions assigned to the processing units among the input processing units are replaced with the masking data is input to the trained model, thereby generating the query function feature data together with data representing the names of the processing units. The search method according to claim 6.

8. The information processing device includes: A plurality of intermediate layers receive input of data for a processing unit in which a name portion of the processing unit in the source code is replaced with predetermined masking data, and output data representing the characteristics of the processing content of the processing unit based on the input data; an output layer that outputs data representing the name of the processing content based on data representing the features; In the search target function feature data generation process, data of processing units in which name portions assigned to the plurality of processing units in the input source code are replaced with the masking data is input to the trained model, whereby the search target function feature data is output from a final layer of the intermediate layers, and data representing the names of the processing units is output from the output layer; In the search target function feature data generation process, data of the processing units obtained by replacing name portions assigned to the processing units among the input processing units with the masking data is input to the trained model, whereby the query function feature data is output from a final layer of the intermediate layers, and data representing the names of the processing units is output from the output layer. The search method according to claim 7.

9. The information processing device generates the trained model by learning a relationship between data of a processing unit obtained by replacing a name portion assigned to the processing unit from the processing unit in the source code with predetermined masking data and data representing the name of the processing unit, and stores the generated trained model in the storage device. The search method according to claim 8.

10. The information processing device stores, as the trained model, a Transformer model that has learned the relationship between each description portion that constitutes the processing in the processing unit. The search method according to claim 9.

Citation Information

Patent Citations

  • Program generation system

    JP1995311679A

  • Parallel processing development environments and related methods

    JP2013536535A

  • Similarity determination device, similarity determination method and similarity determination program

    JP2017010476A

  • Machine learning device for learning correlation between source code information and type of feature of source code information, and method for machine learning

    JP2020009190A

  • Data processing device, data processing method, program, and model

    JP2021089483A