An explainable open source project recommendation method based on node intimacy

By building an open source project recommendation method based on node intimacy in the open source community, the information overload problem is solved, the efficient matching between developers and projects is achieved, the quality and efficiency of software development are improved, and accurate recommendation results are provided.

CN118365221BActive Publication Date: 2024-11-12SUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410791233.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-11-12
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

In the open source community, due to information overload, it is difficult to quickly and accurately screen out suitable developers and software projects, making it difficult to gain attention for competitive open source projects, which may hibernate or die, affecting the quality and efficiency of software development.

Method used

Adopting an interpretability open source project recommendation method based on node intimacy, by collecting GitHub developer behavior data, constructing open source project association network and adjacency matrix, computing node intimacy and interpretability indicators, and constructing using multi-dimensional matrix embedding and hidden vector model. Recommended model, recommended correlation between developers and projects.

Benefits of technology

It improves the efficient matching between developers and open source projects, improves the quality and efficiency of software development, provides more accurate and reliable recommendation results, simplifies complex network relationships, and improves the efficiency and accuracy of recommendation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118365221B_ABST
    Figure CN118365221B_ABST
Patent Text Reader

Abstract

The present invention discloses an explainable open source project recommendation method based on node intimacy, comprising the following steps: (1) collecting and storing the behavior data of developers on the GitHub platform; (2) constructing an open source project association network; (3) constructing node intimacy and explainability indicators; (4) embedding each node in the graph into a multidimensional matrix; using the node embedding matrix to calculate the expected weights between nodes in G; (5) constructing and training an open source project recommendation model to obtain the weights between target node pairs; (6) using the specific weights between target node pairs to determine whether there are links between open source projects; and according to the explainable recommendation results of the open source projects, determining the top N developers from all open source projects on the platform as recommendation results. The present invention can provide users with more accurate, reliable and personalized open source project recommendation services by constructing a node intimacy indicator and designing a recommendation algorithm based on the indicator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of open source community ecosystem maintenance and open source project recommendation, and in particular to an explainable open source project recommendation method based on node intimacy. Background Art

[0002] Although open source technology has significant value in improving software development efficiency and promoting economic development, with the rapid growth of software demand, software products and developers in the software community, the increasingly prominent "information overload" problem in open source projects makes it extremely difficult to quickly and accurately screen out suitable developers or software projects from a large amount of heterogeneous information and establish associations between them. In the open source software community, the development, improvement and maintenance of software projects mainly rely on distributed collaboration among developers around the world. However, many competitive open source projects often find it difficult to gain the attention and feedback of other developers in a short period of time, and are forced to fall into dormancy or even die. Therefore, in order to improve the quality and efficiency of software development, building a recommendation system for open source projects, realizing the association matching between developers and software projects, and recommending open source projects in similar technical fields has become an important scientific issue to promote the development of software development research. Summary of the invention

[0003] Purpose of the invention: The purpose of the present invention is to construct an explainable open source project recommendation method based on node intimacy, which is committed to solving the problem of information overload in the open source community and promoting efficient association and matching between developers and open source projects, thereby improving the quality and efficiency of overall software development.

[0004] Technical solution: The present invention provides an explainable open source project recommendation method based on node intimacy, comprising the following steps:

[0005] (1) Collect and store the behavior data of developers on the GitHub platform;

[0006] (2) Construct the open source project association network G and adjacency matrix W;

[0007] (3) Construct node intimacy and explainability indicators; including the following steps:

[0008] (31) Open source project node intimacy representation;

[0009] (32) Construct interpretability indicators;

[0010] (33) Construct a new interpretability adjacency matrix based on interpretability indicators;

[0011] (4) Based on embedding each node in G into a multidimensional matrix; using the node embedding matrix to calculate the expected weights between nodes in G;

[0012] (5) Build and train an open source project recommendation model to obtain the weights between target node pairs;

[0013] (6) Use the specific weights between the target node pairs to determine whether there are links between open source projects; based on the explainable recommendation results of the open source projects, determine the top N developers from all open source projects on the platform as the recommendation results, where N is a positive integer.

[0014] Furthermore, step (1) is as follows: using the GH Archive framework to crawl the log behavior data of all developers from the GitHub platform, and classifying the collected data into data streams with different characteristic indicators by combining business scenarios and open source metrics provided by CHAOSS; importing the summarized data streams into the list database ClickHouse, and using SQL to query the required data in the database.

[0015] Furthermore, step (2) includes the following steps:

[0016] (21) Use the Topic data of open source projects stored in ClickHouse to filter out the basic technical fields and feature sequences to which the projects belong;

[0017] (22) Use the Levenshtein Distance to process the feature sequences in the Topic data and calculate the Levenshtein distance between feature sequences of different items. The Levenshtein distance is a measure of the similarity between two sequences, and the calculation formula is:

[0018] ;

[0019] in, Represents the edit distance between the first i characters in string a and the j characters in string b;

[0020] (23) Taking open source projects as nodes, the existence of edges between nodes indicates that the topics between the two projects have the same characteristics. The weight represents the edit distance between the two projects. Finally, the open source project association network is constructed. and the adjacency matrix W.

[0021] Furthermore, step (31) is as follows: define two nodes in the network according to the network topology and local information and The intimacy is:

[0022] ;

[0023] in, and Respectively represent nodes and The neighbor set of and The intersection of represents the number of common neighbors, and The union of represents the neighbor set of node and .

[0024] Furthermore, step (32) is as follows: the correlation of the target node pair is measured using the node degree centrality and node intimacy, and the formula is as follows:

[0025] ;

[0026] ;

[0027] in, is the degree of node z, represents the number of nodes of G; represents the closeness between nodes i and z, represents the closeness between nodes z and j, and Represent the neighbor sets of nodes i and j respectively. This indicator can better integrate node importance and neighborhood characteristics, and has stronger explainability for feature changes of open source projects.

[0028] Furthermore, step (33) is as follows: Based on the interpretability index, a new interpretability adjacency matrix is ​​constructed ; The values ​​at different positions of the matrix represent the interpretability values ​​between the target node pairs; the matrix The value of is defined as:

[0029] ;

[0030] in, It is the threshold preset by the algorithm. When the interpretability variable between nodes exceeds the preset threshold, the nodes are assumed to meet the interpretability. Is a node and The explanatory variable values ​​between Represents the correlation between nodes i and j.

[0031] Furthermore, step (4) is as follows: First, Each node in is embedded as a multi-dimensional matrix; that is:

[0032] ;

[0033] in, represent Different nodes in represents the first position of node i in the embedding matrix elements; m and n represent the number of rows and columns of the matrix M, that is, m is the number of hidden features, and n is the amount of information of the hidden features;

[0034] Then, the node embedding matrix is ​​used to calculate Expected weights between midpoints:

[0035] ;

[0036] Among them, F is the Fibonacci paradigm; is the multi-dimensional embedding of node i.

[0037] Furthermore, step (5) includes the following steps:

[0038] (51) After obtaining the embedded representation and expected weight of the node, the interpretable variables are integrated into the latent factor model (LFM) to obtain the final error function:

[0039] ;

[0040] ;

[0041] Among them, R represents the set of node pairs with connected edges. and is the interpretability regularization coefficient, which is used to control the balance between interpretability and accuracy and suppress overfitting; represents the initial weights of nodes i and j; is the multi-dimensional embedding of node i; F is the Fibonacci form; Represents the interpretable variables of nodes i and j. By introducing the interpretable matrix, when the interpretability between node pairs is stronger, the third term of the error function tends to 0, and the weaker the interpretability, the larger the value.

[0042] (52) The error function is trained and the training is stopped when the preset condition is reached. Finally, the embedded representations of different nodes in are obtained and used to calculate the missing values ​​in the original adjacency matrix W:

[0043] ;

[0044] in, For target link { i,j}, For Node i The final multi-dimensional node embedding, For Node j The final multi-dimensional node embedding, F is the Fibonacci form.

[0045] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: by constructing an open source project association network based on the edit distance, it can accurately reflect the association and dependency between projects, which is helpful to recommend projects related to the target project and improve the quality of recommendation; by using the topological information of the network to construct intimacy indicators and interpretability indicators, it can more comprehensively measure the intimacy between nodes and the interpretability of recommendations, which is helpful to provide more accurate and reliable recommendation results; by embedding the nodes in the open source association network into a multidimensional matrix, it can simplify complex network relationships into an easy-to-process data structure, and use the LFM model to construct an error function for training; it is helpful to improve the efficiency and accuracy of the recommendation system. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a flow chart of the present invention;

[0047] Figure 2 Topic information graph of the open source project of the present invention;

[0048] Figure 3 (a) is the open source association network of the present invention, and (b) is the multi-dimensional embedding of the nodes of the present invention;

[0049] Figure 4 is the node intimacy of the present invention;

[0050] Figure 5 The R-relation dataset of the present invention is used as a validation set to compare the time consumption of 11 algorithms. DETAILED DESCRIPTION

[0051] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.

[0052] like Figure 1 As shown, an embodiment of the present invention provides an explainable open source project recommendation method based on node intimacy, comprising the following steps:

[0053] (1) Collect and store the behavior data of developers on the GitHub platform; specifically: use the GH Archive framework to crawl the log behavior data of all developers on the GitHub platform, and classify the collected data into data streams with different characteristic indicators by combining business scenarios and open source metrics provided by CHAOSS; import the summarized data streams into the list database ClickHouse, and use SQL to query the required data in the database.

[0054] (2) Constructing the open source project association network G and adjacency matrix W; including the following steps:

[0055] (21) Using the Topic data of open source projects stored in ClickHouse, filter out the basic technical fields and feature sequences to which the project belongs; such as typescript (e.g. Figure 2 as shown).

[0056] (22) Use the Levenshtein Distance to process the feature sequences in the Topic data and calculate the Levenshtein distance between feature sequences of different items. The Levenshtein distance is a measure of the similarity between two sequences. It refers to the calculation of the word group<L1,L2> The minimum number of single-character editing operations required to convert L1 to L2 is calculated as:

[0057] ;

[0058] in, Represents the edit distance between the first i characters in string a and the j characters in string b;

[0059] (23) Figure 3 As shown in the figure, open source projects are used as nodes. If there is an edge between nodes, it means that the topics between the two projects have the same characteristics. The weight represents the edit distance between the two projects. Finally, the open source project association network is constructed based on this. and the adjacency matrix W.

[0060] (3) Construct node intimacy and explainability indicators; including the following steps:

[0061] (31) Open source project node intimacy representation; e.g. Figure 4 As shown, the details are as follows: According to the topological structure and local information of the network, the intimacy between two nodes and in the network is defined as:

[0062] ;

[0063] in, and Respectively represent nodes and The neighbor set of and The intersection of represents the number of common neighbors, and The union of represents the neighbor set of node and .

[0064] (32) Construct an interpretable index; specifically, use the degree centrality of the node and the closeness of the node to measure the correlation of the target node pair, and the formula is as follows:

[0065] ;

[0066] ;

[0067] in, is the degree of node z, represents the number of nodes of G; represents the closeness between nodes i and z, represents the closeness between nodes z and j, and Represent the neighbor sets of nodes i and j respectively. This indicator can better integrate node importance and neighborhood characteristics, and has stronger explainability for feature changes of open source projects.

[0068] (33) Construct a new interpretability adjacency matrix based on the interpretability index; specifically, Based on the interpretability index, a new interpretability adjacency matrix is ​​constructed ; The values ​​at different positions of the matrix represent the interpretability values ​​between the target node pairs; the matrix The value of is defined as:

[0069] ;

[0070] in, It is the threshold preset by the algorithm. When the interpretability variable between nodes exceeds the preset threshold, the nodes are assumed to meet the interpretability. Is a node and The explanatory variable values ​​between Represents the correlation between nodes i and j.

[0071] (4) Based on embedding each node in G into a multidimensional matrix, the expected weights between nodes in G are calculated using the node embedding matrix. The details are as follows: First, Each node in is embedded as a multi-dimensional matrix; that is:

[0072] ;

[0073] in, represent Different nodes in represents the first position of node i in the embedding matrix elements; m and n represent the number of rows and columns of the matrix M, that is, m is the number of hidden features, and n is the amount of information of the hidden features;

[0074] Then, the node embedding matrix is ​​used to calculate Expected weights between midpoints:

[0075] ;

[0076] Among them, F is the Fibonacci paradigm; is the multi-dimensional embedding of node i.

[0077] (5) Build and train an open source project recommendation model to obtain the weights between target node pairs; this includes the following steps:

[0078] (51) After obtaining the embedded representation and expected weight of the node, the interpretable variables are integrated into the latent factor model (LFM) to obtain the final error function:

[0079] ;

[0080] ;

[0081] Among them, R represents the set of node pairs with connected edges. and is the interpretability regularization coefficient, which is used to control the balance between interpretability and accuracy and suppress overfitting; represents the initial weights of nodes i and j; is the multi-dimensional embedding of node i; F is the Fibonacci form; Represents the interpretable variables of nodes i and j. By introducing the interpretable matrix, when the interpretability between node pairs is stronger, the third term of the error function tends to 0, and the weaker the interpretability, the larger the value.

[0082] (52) The error function is trained and the training is stopped when the preset condition is reached. Finally, the embedded representations of different nodes in are obtained and used to calculate the missing values ​​in the original adjacency matrix W:

[0083] ;

[0084] in, For target link { i,j}, For Node i The final multi-dimensional node embedding, For Node j The final multi-dimensional node embedding, F is the Fibonacci form.

[0085] (6) Use the specific weights between the target node pairs to determine whether there are links between open source projects; based on the explainable recommendation results of the open source projects, determine the top N developers from all open source projects on the platform as the recommendation results, where N is a positive integer.

[0086] The specific tests are as follows:

[0087] S1: Obtain the data required for the experiment

[0088] The original data was obtained, and then the top 100 projects were selected as experimental data based on activity, and two open source association networks were constructed, namely Repo_topic and Repo_relation. In the Repo_topic data set, each node represents an open source project, and the edges between the nodes indicate that the same Topic features exist in the Topics of the two projects, and the weight indicates the number of the same Topic features; in the Repo_relation data set, each node represents an open source project, the edges indicate that a developer has contributed to both projects, and the weight indicates the intimacy between the projects. In order to improve the fairness of this invention, two public data sets, USAir and NetScience, are also selected in the present invention, where USAir is the US air route network. The node represents the airport. If there is a flight between the two airports, there will be an edge between the corresponding two nodes, and the weight of the edge indicates the frequency of the flight; NetScience is a scientist co-authorship network. Scientists are represented by nodes in the network. The existence of edges between nodes indicates that there is a cooperative relationship between the two scientists, and the weight of the edge represents the number of scientists' collaborations; the results are shown in Table 1.

[0089] Table 1 Statistical information of experimental datasets

[0090]

[0091] Comparison scheme: The present invention selects the common heuristic algorithms CN, AA and RA, CRCN, CRAA and CRRA containing community information, and the prediction methods Node2Vec, Attri2Vec, GCN and GraphSAGE based on the graph network model.

[0092] Evaluation indicators: The indicators for measuring the accuracy of link prediction algorithms mainly include AUC, Precision, and RankingScore. Among them, AUC is the most widely used indicator because it measures the overall accuracy of the algorithm. Precision only considers whether the main nodes are accurately predicted. Ranking Score focuses on the ranking quality of the recommendation results. Therefore, considering the advantages and disadvantages of the three indicators, AUC is selected as the indicator of link prediction accuracy. During the experiment, a certain proportion of the existing edges in the network are randomly selected as the test set, and the remaining edges are used as the training set. This process is repeated 10 times independently. The larger the AUC value, the better the prediction effect of the algorithm.

[0093] Parameter setting: The parameters of the model are set as m = 10, n = 10, α = 0.001, β = 0.0001, λ = 0.0001.

[0094] Experimental results: Based on steps 3 to 6, and with fixed comparison evaluation indicators and parameter settings, the AUC values ​​of the method proposed in the present invention and the comparison on four sets of data are evaluated as shown in Table 2.

[0095] Table 2 Prediction accuracy of eleven schemes

[0096]

[0097] According to the experimental results, the present invention has achieved the highest prediction accuracy in the three data sets of USAir, NetScience and Repo_relation, and is only slightly inferior to RA in the Repo_topic data set. The overall experimental results show that the scheme proposed by the present invention is obviously feasible and has high recommendation accuracy.

[0098] S3: The time consumption advantage of the present invention is if Figure 5 As shown, in order to further verify the advantage of the solution of the present invention in terms of time consumption, the R-relation dataset is used as a validation set to compare the time consumption of 11 algorithms.

Claims

1. An explainable open source project recommendation method based on node intimacy, characterized in that: The following steps are involved: (1) Collect and store the behavior data of developers on the GitHub platform; (2) Construct the open source project association network G and adjacency matrix W; (3) Construct node intimacy and explainability indicators; including the following steps: (31) Open source project node intimacy representation; specifically as follows: define two nodes in the network based on the network topology and local information and The intimacy is: ; in, and Respectively represent nodes and The neighbor set of and The intersection of represents the number of common neighbors, and The union of represents the neighbor set of nodes and ; (32) Construct an interpretable index; specifically, use the degree centrality of the node and the closeness of the node to measure the correlation of the target node pair, and the formula is as follows: ; ; in, is the degree of node z, represents the number of nodes of G; represents the closeness between nodes i and z, represents the closeness between nodes z and j, and Represent the neighbor sets of nodes i and j respectively; (33) Construct a new interpretability adjacency matrix based on the interpretability index; specifically, Based on the interpretability index, a new interpretability adjacency matrix is ​​constructed ; The values ​​at different positions of the matrix represent the interpretability values ​​between the target node pairs; the matrix The explanatory variable value of Defined as: ; in, It is the threshold preset by the algorithm. When the interpretability variable between nodes exceeds the preset threshold, the nodes are assumed to meet the interpretability. Is a node and The explanatory variable values ​​between Indicates the correlation between nodes i and j; (4) Based on embedding each node in G into a multidimensional matrix, the expected weights between nodes in G are calculated using the node embedding matrix. The details are as follows: First, Each node in is embedded as a multi-dimensional matrix; that is: ; in, represent Different nodes in represents the first position of node i in the embedding matrix elements; m and n represent the number of rows and columns of the matrix M, that is, m is the number of hidden features, and n is the amount of information of the hidden features; Then, the node embedding matrix is ​​used to calculate Expected weights between midpoints: ; Among them, F is the Fibonacci paradigm; is the multi-dimensional embedding of node i; (5) Build and train an open source project recommendation model to obtain the weights between target node pairs; this includes the following steps: (51) After obtaining the embedded representation and expected weight of the node, the interpretable variables are integrated into the latent factor model (LFM) to obtain the final error function: ; ; Among them, R represents the set of node pairs with connected edges. and is the interpretability regularization coefficient, which is used to control the balance between interpretability and accuracy and suppress overfitting; represents the initial weights of nodes i and j; is the multi-dimensional embedding of node i; F is the Fibonacci form; represents the interpretable variables of nodes i and j; (52) The error function is trained and the training is stopped when the preset condition is reached. Finally, the embedded representations of different nodes in are obtained and used to calculate the missing values ​​in the original adjacency matrix W: ; in, For target link { i,j }, For Node i The final multi-dimensional node embedding, For Node j The final multi-dimensional node embedding, F is the Fibonacci paradigm; (6) Use the specific weights between the target node pairs to determine whether there are links between open source projects; based on the explainable recommendation results of the open source projects, determine the top N developers from all open source projects on the platform as the recommendation results, where N is a positive integer.

2. According to claim 1, the explainable open source project recommendation method based on node intimacy is characterized in that: Step (1) is as follows: Use the GH Archive framework to crawl the log behavior data of all developers from the GitHub platform, and classify the collected data into data streams with different characteristic indicators by combining business scenarios and open source metrics provided by CHAOSS; Import the summarized data stream into the list database ClickHouse, and use SQL to query the required data in the database.

3. The explainable open source project recommendation method based on node intimacy according to claim 1 is characterized in that: Step (2) includes the following steps: (21) Use the Topic data of open source projects stored in ClickHouse to filter out the basic technical fields and feature sequences to which the projects belong; (22) Use the Levenshtein Distance to process the feature sequences in the Topic data and calculate the Levenshtein distance between feature sequences of different items. The Levenshtein distance is a measure of the similarity between two sequences, and the calculation formula is: ; in, Represents the edit distance between the first i characters in string a and the j characters in string b; (23) Taking open source projects as nodes, the existence of edges between nodes indicates that the topics between the two projects have the same characteristics. The weight represents the edit distance between the two projects. Finally, the open source project association network is constructed. and the adjacency matrix W.