Code core contributor quantity prediction method for open source software project

By combining the semantic features and historical information of open source projects, a prediction model including fully connected and convolutional layers is constructed, which solves the problem of low prediction accuracy in the existing technology, achieves accurate prediction of the number of core contributors to open source software projects, and improves efficiency. Forecast accuracy and decision-making efficiency.

CN118643935APending Publication Date: 2024-09-13ZHEJIANG UNIV OF TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410698624.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

When predicting the number of core contributors to open source software projects, existing technologies rely on single-dimensional historical data and ignore the semantic characteristics and other important information of the project, resulting in low prediction accuracy.

Method used

Using a method that combines open source project semantic features and project historical information, by extracting and preprocessing project semantic information and submission records, a prediction model including input layer, hidden layer, fully connected layer and convolutional layer is constructed, using the LDA topic model Automatically discover text features and accurately predict the number of core contributors.

Benefits of technology

It improves prediction accuracy, takes into account semantic dimension information such as project research topic, development language and project scale, reduces human bias, provides a more accurate prediction of the number of core contributors, and helps project managers make more effective decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643935A
    Figure CN118643935A
Patent Text Reader

Abstract

The invention belongs to the field of software engineering and machine learning, and discloses an open source software project-oriented code core contributor quantity prediction method, which comprises the following steps of: extracting project semantic information and a project commit record; performing preprocessing operation on the project semantic information and the project commit record; obtaining a training matrix by using the preprocessed item semantic information and item commit records; constructing and training a prediction model according to the training matrix; and predicting an open source software project to be processed by using the trained prediction model. According to the method, the semantic features of the open source project and the historical information of the project are combined to accurately predict the number change of future core contributors of the project. The method is helpful to provide important reference for project managers and decision makers, and the important reference is used as reference and suggestion for future development directions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of software engineering and machine learning, and in particular relates to a method for predicting the number of core code contributors for an open source software project. Background Art

[0002] In the practice of open source software project development, different developers collaborate with each other and promote the continuous development and improvement of open source software by submitting code to the software repository. Among many developers, core contributors are considered to be the leading group in the development process of software projects, and play a leading role in the development planning, quality assessment, and overall collaboration of software projects. It is generally believed that for a certain project, the minimum subset of developers who contribute more than 80% of the submission records can be considered as the core contributors of the project. In the development process of open source projects, the change in the number of (code) core contributors can be used as an important evaluation indicator of the operation and maintenance status of open source projects. Project maintainers can make targeted adjustments to the project based on the expected changes in the number of core contributors to ensure the stable development of the project. Therefore, the prediction of changes in the number of core contributors of open source projects is crucial for the evaluation and governance of open source software.

[0003] The current prediction method for the number of core contributors is mainly based on historical data statistics. By analyzing historical project data, such as code submission records, problem solving status, email discussion activities and other information, the number of future core contributors is predicted. However, this type of method considers a single dimension and ignores the semantic dimension information of open source projects such as research topics, development languages, and project scale, resulting in low prediction accuracy. Therefore, there is an urgent need for an accurate prediction method for the number of core contributors for open source software projects. Summary of the invention

[0004] The purpose of the present invention is to provide a method for predicting the number of core contributors of code for open source software projects, combining the semantic features of open source projects and project historical information to accurately predict the changes in the number of core contributors of the project in the future. The present invention helps to provide important references for project managers and decision makers as a reference and suggestion for future development directions.

[0005] To achieve the above object, the technical solution adopted by the present invention is:

[0006] A method for predicting the number of core code contributors for an open source software project, the method comprising:

[0007] Step 1: Extract project semantic information and project commit records;

[0008] Step 2: Preprocess the project semantic information and project commit records;

[0009] Step 3: Use the project semantic information and project commit records after the preprocessing operation to obtain a training matrix, wherein the content of the training matrix includes: project star number, project description, project label, number of project observers, number of forks, whether there is Wikipedia, project code language, number of branches, number of contributors, latest submission time, submission time interval and number of core contributors as feature vectors, and the number of core contributors as the target vector;

[0010] Step 4: construct and train a prediction model based on the training matrix, wherein the prediction model includes an input layer, a first hidden layer, a fully connected layer, a convolutional layer, a second hidden layer and an output layer, and the output of the output layer is a prediction result of the number of core contributors;

[0011] Step 5: Use the trained prediction model to make predictions for the open source software projects to be processed.

[0012] Several optional methods are also provided below, but they are not intended to be additional limitations on the above-mentioned overall solution, but are merely further supplements or preferences. Under the premise that there are no technical or logical contradictions, each optional method can be combined with the above-mentioned overall solution separately, and multiple optional methods can also be combined.

[0013] Preferably, the step 1, extracting project semantic information and project commit records, includes:

[0014] Step 1-1: Use Github API to obtain open source software projects on the GitHub open source software platform, and set the filtering condition to star value greater than the filtering threshold to obtain the initial project path list;

[0015] Step 1-2, traverse the initial project path list, and use Github API to extract the project semantic information of the corresponding open source software project according to the initial project path. The project semantic information includes: project name, project star number, project description, project tag, number of project observers, number of forks, whether there is Wikipedia, project code language, number of branches, number of contributors and latest submission time;

[0016] While extracting the semantic information of the project, clone the filtered open source software projects to the local computer;

[0017] After the open source software project is cloned, all submission records of the open source software project are extracted. The submission record includes the submission record hash value, submission date, submission author, and submission information. The submission information contains the submission author's description of this submission and the modified files submitted this time. The project name in the project semantic information and the submission record hash value, submission date, submission author, and modified files submitted this time in the submission record are stored as json objects in the local commit.json file. The json objects stored in the local commit.json file are project commit records;

[0018] The project name, project star count, project description, project tags, number of project observers, number of forks, whether there is a Wikipedia, project code language, number of branches, number of contributors, and latest commit time in the project semantic information are stored as json objects in the local project.json file. The json objects stored in the local project.json file are the project semantic information;

[0019] Delete the locally cloned open source software project and the traversal is complete.

[0020] Preferably, the step 2, performing preprocessing operations on the project semantic information and the project commit record, includes:

[0021] Step 2-1, traverse the local project.json file and the local commit.json file, and remove abnormal json objects;

[0022] Step 2-2, traverse the local project.json file and perform normalization processing, wherein the normalization processing is performed on the number of project stars, number of project observers, number of forks, number of branches, and number of contributors in the json object;

[0023] Step 2-3: traverse the local project.json file to perform format conversion processing, wherein the format conversion processing converts the values ​​of the project description, project label, and project code language in the json object into feature vectors.

[0024] Preferably, the format conversion process converts the values ​​of the project description, project label and project code language in the JSON object into vector features, including:

[0025] Get the value of the project description in the json object, preprocess the value of the project description to get a word array; traverse the word array, use each word as the input of the trained LDA topic model to get the distribution probability of the word under each topic, compare the distribution probabilities of all words in the word array, select the highest probability under each topic as the project description feature vector, and change the value of the project description in the json object to the project description feature vector;

[0026] Get the value of the project label in the json object, traverse the value of the project label, use each label in the value of the project label as the input of the trained LDA topic model, obtain the distribution probability of the label under each topic, compare the distribution probabilities of all labels under the project label, select the highest probability under each topic as the project label feature vector, and change the value of the project label in the json object to the project label feature vector;

[0027] Get the value of the project code language in the json object. When the project uses the corresponding code language, set the corresponding position to 1. By default, all bits are 0. Get the code language feature vector and change the value of the project code language in the json object to the code language feature vector.

[0028] Preferably, the process of confirming the number of core contributors is as follows:

[0029] First, calculate the contribution ratio of the contributor's submission author. The calculation formula is as follows:

[0030]

[0031] In the formula, coreContributor(commitAuthor) represents the contribution ratio of the commit author, commitDate i represents the modification time of the i-th modified file set with the same name as the project modified by the submitting author and before the current time point. Date is the current time point, changeFiles∈commitAuthor represents the number of modified files corresponding to the submitting author, projectName i Indicates the name of the modified project corresponding to the i-th modified file set with the same name as the project modified by the submitting author and before the current time point, projectName commitAuthor Indicates the name of the project modified by the submitter, changeFiles indicates the number of modified files, Indicates the number of files modified by the submitting author whose project name is the same as the submitting author and whose modification time is before the current time point. Displays the total number of modified files with the same project name as the submitting author and before the current time point;

[0032] Secondly, a minimum subset of the submitting authors whose total contribution ratio is greater than a ratio threshold is obtained, and the contributors in the minimum subset of the submitting authors are taken as core contributors, and the length of the minimum subset of the submitting authors is taken as the number of core contributors.

[0033] Preferably, the first hidden layer of the prediction model contains 16 neurons, using ReLU as the activation function, the fully connected layer contains 16 neurons, using ReLU as the activation function, the convolutional layer contains 16 filters, each filter size is 2, using ReLU as the activation function, and the second hidden layer contains 16 neurons, using ReLU as the activation function.

[0034] The method for predicting the number of core code contributors for an open source software project provided by the present invention has the following beneficial effects compared with the prior art:

[0035] (1) Combining the semantic features of open source projects with project historical information, the proposed method not only relies on historical data but also considers semantic dimension information such as the project's research topic, development language, and project scale, thereby overcoming the limitation of existing technologies that only rely on single-dimensional data and improving prediction accuracy.

[0036] (2) Design prediction models that contain fully connected layers and convolutional layers. These hierarchical structures can better capture complex patterns in the data.

[0037] (3) Using labeled datasets to train LDA topic models can automatically discover potential topics in the data without human intervention. This automated processing capability can reduce human bias and improve the objectivity and consistency of text features.

[0038] (4) By providing accurate forecasts of the number of core contributors, project managers can better plan and manage project resources, make more effective decisions, and improve the success rate and sustainability of projects. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A flowchart of a method for predicting the number of core code contributors for an open source software project according to the present invention;

[0040] Figure 2 Schematic diagram of the structure of the prediction model of the present invention. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0043] In order to overcome the defects of the prior art, this embodiment provides a method for predicting the number of core code contributors for open source software projects. Figure 1 The method specifically comprises the following steps:

[0044] Step 1: Extract project semantic information and project commit records.

[0045] Step 1-1, use Github API (for example:

[0046] https: / / api.github.com / search / repositor?q=stars:>1000) to obtain high-quality open source software projects on the GitHub open source software platform, set the filter condition to a star value greater than 1000 (the filter threshold can be adjusted according to actual needs), and obtain the initial project path list. The format of the initial project path in the initial project path list is: username / repository.

[0047] Step 1-2: traverse the initial project path list and use the Github API (for example: https: / / api.github.com / repos / {username} / {repository}) to extract the project semantic information of the corresponding project according to the initial project path. The project semantic information includes: project name, project star number, project description, project tags, number of project observers, number of forks, whether there is a Wikipedia, project code language, number of branches, number of contributors and latest submission time.

[0048] While extracting project semantic information, use the git clone command to clone high-quality open source software projects with a star value greater than 1000 to the local computer.

[0049] After cloning the high-quality open source software project, use the git log command to obtain all the commit records of the project. The commit records include: commit record hash value, commit date, commit author (i.e. contributor), and commit information. The commit information contains the commit author's description of this commit and the modified files submitted this time. The project name in the project semantic information, the commit record hash value in the commit record, the commit date, the commit author, and the modified files submitted this time are stored as json objects in the local commit.json file.

[0050] The project semantic information including project name, project star number, project description, project tags, number of project observers, number of forks, whether there is a Wikipedia, project code language, number of branches, number of contributors, and latest commit time is stored as a json object in the local project.json file.

[0051] Delete the locally cloned high-quality open source software projects and complete the traversal in one go.

[0052] It should be noted that the keys of a json object in the local commit.json file include the project name (projectName), the hash value of the commit record (commitID), the commit date (commitDate), the commit author (author), and the modified file submitted this time (filePaths). The format of a json object in the commit.json file is as follows:

[0053] {

[0054] "projectName":"mkleehammer / pyodbc",

[0055] "commitID":"e16769bdb105bdc526f6cf4cd55eb04e17be0f39",

[0056] "commitDate":"2023-04-14 08:10:45",

[0057] "author":"Michael Kleehammer<michael@kleehammer.com> ",

[0058] "filePaths":[

[0059] "tests3 / pgtests.py",

[0060] "tests3 / sqlservertests.py" ]

[0062] }.

[0063] It should be noted that the keys of a json object in the local project.json file include the project name (projectName), project star number (star), project description (message), project tags (topics), number of project watchers (watcher), number of forks (fork), whether there is a Wikipedia (wiki), project code language (language), number of branches (branch), number of contributors (contributor), and latest commit date (newCommitDate).

[0064] This embodiment stores project semantic information and project commit records in a json file to facilitate subsequent data processing.

[0065] Step 2: Preprocess the stored project semantic information and project commit record data, including: removing abnormal items; normalization; and input format conversion.

[0066] Step 2-1: Traverse the local project.json file and the local commit.json file to remove abnormal projects.

[0067] Delete the json object whose key is the project code language (language) and whose value is empty in the local project.json file; at the same time, delete the json object whose project name (projectName) in the local commit.json file is the same as the project name (projectName) value of the json object deleted in the local project.json file.

[0068] Step 2-2, traverse the local project.json file for normalization:

[0069] The number of project stars, number of project observers, number of forks, number of branches, and number of contributors in the local project.json file are normalized using formula (1);

[0070]

[0071] Taking the project star number as an example, where S p It represents the normalized value of the project star number, P now Indicates the number of stars of a json object, P min Indicates the minimum number of project stars among all JSON objects in the local project.json file, P maxIndicates the maximum number of project stars in all JSON objects in the local project.json file.

[0072] It should be noted that the number of project observers, forks, branches, and contributors can also be normalized using formula (1), by changing the number of project stars to the number of project observers, forks, branches, and contributors.

[0073] Step 2-3, input format conversion: The project description, project label, and project code language in the local project.json file need to be converted into input format. In the input format conversion, the trained LDA topic model will be used. The LDA topic model training process is usually as follows:

[0074] (1) Prepare the dataset: manually collect labeled datasets with labels in the form of English nouns, such as computer.

[0075] (2) Build a vocabulary: Create a vocabulary that contains all the words that appear in the dataset. It should be noted that the vocabulary is in txt file format, with one word per line.

[0076] (3) Determine the number of topics: Before training the LDA topic model, determine the number of topics (in this embodiment, the number of topics is 10);

[0077] (4) Training the LDA topic model: Take the vocabulary and the number of topics as model input and train the LDA topic model.

[0078] The model training finally obtains the trained LDA topic model. Using the trained LDA topic model, the input is the label, and the output is the distribution probability of the label on each topic (such as Theme1...Theme6). The label format is an English word, for example: water. The output format is shown in Table 1:

[0079] Table 1 Example of LDA topic model output format

[0080] Theme1 Theme2 Theme3 Theme4 Theme5 Theme6 0.3 0.6 0.7 0.1 0.9 0.4

[0081] Step 2-3-1, the process of converting the input format of the project description is as follows: traverse the project.json file, obtain the value of the project description in the json object, preprocess the value of the project description to obtain a word array, where the preprocessing includes word segmentation, removal of stop words, and word form restoration; traverse the word array, use each word as the input of the trained LDA topic model to obtain the distribution probability of the word under each topic, compare the distribution probabilities of all words under the word array, select the highest probability under each topic as the project description feature vector, and change the value of the project description in the json object to the project description feature vector.

[0082] Among them, word segmentation means dividing the value (string) of the project description into individual words; removing stop words means removing words that do not carry specific semantics from the words obtained by word segmentation, such as: this, is, etc. (they can be removed based on a manually screened stop word library); lemma restoration means converting a word into its basic form (i.e., root or stem form), for example: running is restored to run.

[0083] For example, if the word array obtained after preprocessing the project description is [build, docker], the probability of the two words in the topic distribution after traversal is shown in Table 2:

[0084] Table 2 Project label processing examples

[0085] Tag Theme1 Theme2 Theme3 Theme4 Theme5 Theme6 build 0.3 0.6 0.7 0.1 0.9 0.4 docker 0.1 0.7 0.6 0.2 0.8 0.1

[0086] Then the item description feature vector of the item label is [0.3, 0.7, 0.7, 0.2, 0.9, 0.4].

[0087] Step 2-3-2, the process of converting the input format of the project label is as follows: get the value of the project label in the json object, traverse the value of the project label, use each label in the value of the project label as the input of the trained LDA topic model to obtain the distribution probability of the label under each topic, compare the distribution probabilities of all labels under the project label, select the highest probability under each topic as the project label feature vector, and change the value of the project label in the json object to the project label feature vector.

[0088] For example, if the item label value in a json object is [kernel, windows], after traversal, the probability of the two labels in the topic distribution is shown in Table 3:

[0089] Table 3 Project label processing examples

[0090] Tag Theme1 Theme2 Theme3 Theme4 Theme5 Theme6 kernel 0.3 0.6 0.7 0.1 0.9 0.4 windows 0.1 0.7 0.6 0.2 0.8 0.1

[0091] Then the project label feature vector of the project label is [0.3, 0.7, 0.7, 0.2, 0.9, 0.4]. It should be noted that when the value of the project description or project label of the json object is empty, the project description feature vector or the project label feature vector is all 0, for example: [0, 0, 0, 0, 0, 0].

[0092] Step 2-3-3, the process of converting the input format of the project code language is as follows: obtain the value of the project code language in the json object, traverse the value of the project code language, obtain the code language feature vector, and change the value of the project code language in the json object to the code language feature vector.

[0093] In this embodiment, the code language feature vector is a 20-dimensional vector. The format of the code language feature vector and the code languages ​​corresponding to each bit are: [Python, C, C++, Java, C#, JavaScript, Go, Visual Basic, SQL, Fortran, Delphi / Object Pascal, Assembly language, Ruby, Swift, Scratch, MATLAB, PHP, Kotlin, Rust, R]. When the project uses the corresponding code language, the corresponding position is 1, and all bits are 0 by default. The order of the code languages ​​represented by each bit in the code language feature vector is sorted according to the usage rate of the code language. Here, Python is the most used code language.

[0094] Step 3: Use the project semantic information and project commit records preprocessed in step 2 to traverse, process, and combine to obtain a training matrix.

[0095] Among them, at a certain time point after the project is created, the minimum subset of submitting authors whose total number of modified files before that time point exceeds 80% of the total number of modified files by all submitting authors of the project before that time point (the percentage threshold can be adjusted according to actual conditions) is the core contributor. The formula for calculating the contribution percentage of submitting authors is as follows:

[0096]

[0097] In the formula, coreContributor(commitAuthor) indicates the contribution ratio of the commit author, changeFiles indicates the number of modified files, Date indicates the current time, projectName indicates the project name, commitDate indicates the commit time, and A C and A 总They represent the number of modified files and the number of all modified files by the submitting author in the same project before the current time point. For example, the contribution percentage of the submitting author is calculated as: A: 20%, B: 30%, C: 40%, D: 5%, E: 5%. The smallest subset of submitting authors includes contributors C, B, and A (because the total contribution percentage of the three submitting authors is greater than 80%, and it is the smallest set). Therefore, the core contributors are C, B, and A, and the number of core contributors is 3.

[0098] When generating the training matrix, traverse the local commit.json file, group by project name, store json objects with the same project name in the group, and sort by submission date in ascending order under the same group. Traverse each group, get the name of the current group project, calculate the submission time interval by subtracting the submission dates in two adjacent json objects (newer submission time - older submission time), and calculate the number of core contributors at the newer submission time. The time interval unit is day.

[0099] Traverse the local project.json file, find the json object with the same name as the current group, and use the project star count, project description, project tag, number of project observers, number of forks, whether there is Wikipedia, project code language, number of branches, number of contributors, latest commit time and the above time interval, and number of core contributors in this json object of the local project.json file as feature attribute data in the form of an array. Among them, when traversing the local project.json file, the latest commit time in the local project.json file will be modified to the older commit time of the two adjacent json objects in the local commit.json file as the latest commit time in the feature attribute data.

[0100] Assuming there are N groups, and each group has M json objects, then there are N*(M-1) feature attribute data in the N groups. Therefore, after traversing all groups, all feature attribute data will be obtained, and all feature attribute data will be constructed into a training matrix of N*(M-1)×12.

[0101] Before obtaining the characteristic attribute data, traverse the commit.json file to obtain the time interval and the number of core contributors, and then traverse the project.json file to obtain the project star number, project description, project tag, number of project observers, number of forks, whether there is a Wikipedia, project code language, number of branches, number of contributors, and the latest submission time. The latest submission time will be modified.

[0102] The final training matrix includes: project star count, project description, project tag, number of project observers, number of forks, whether there is a Wikipedia, project code language, number of branches, number of contributors, latest submission time and the above time interval, number of core contributors as feature vectors, and number of core contributors as target vector.

[0103] Step 4: Build and train the prediction model based on the training matrix.

[0104] Step 4-1: Build a prediction model: Figure 2 As shown, the prediction model of this embodiment includes an input layer, a first hidden layer, a fully connected layer, a convolutional layer, a second hidden layer and an output layer. The input is the input data, the first hidden layer contains 16 neurons, and ReLU is used as the activation function, the fully connected layer contains 16 neurons, and ReLU is used as the activation function, the convolutional layer contains 16 filters, each filter size is 2, and ReLU is used as the activation function, the second hidden layer contains 16 neurons, and ReLU is used as the activation function, and the output is the prediction result of the number of core contributors.

[0105] In this embodiment, adding a fully connected layer and a convolutional layer can enable the neural network to better learn the feature information in the input information and improve the expression and generalization capabilities of the prediction model.

[0106] Step 4-2, training data model: use the feature vector part in the training matrix to train the prediction model, update the prediction model parameters through the back propagation algorithm, make the prediction result of the model close to the target vector in the training matrix, select the mean square error (MSE) as the loss function, and use the stochastic gradient descent method to optimize the prediction model.

[0107] Step 5: Use the trained prediction model to make predictions for the open source software projects to be processed.

[0108] When making predictions, it is required that the open source software project to be processed is public, exists, and the project code language is not empty. The prediction time unit is day. The prediction time can be defined by the administrator of the new project, project participants, and other people who are concerned about the development of the new project to determine the number of core code contributors after a few days of prediction.

[0109] Step 5-1. Extract the project semantic information through Github API according to the path of the open source software project to be processed, and use steps 2-2 and 2-3 in step 2 to pre-process the extracted project semantic information to obtain the number of stars, project description, project tags, number of project observers, number of forks, whether there is Wikipedia, project code language, number of branches, number of contributors, and latest submission time of the pre-processed project.

[0110] Step 5-2: The preprocessed project star count, project description, project tag, number of project observers, number of forks, whether there is a Wikipedia, project code language, number of branches, number of contributors, latest submission time, and predicted time are used as input data in the form of an array;

[0111] It should be noted that if the data value that needs to be normalized in the above-mentioned project semantic information exceeds the maximum value P of the training data max , the truncation method is adopted, that is, it is truncated to the maximum year in the training data.

[0112] Step 5-3: Input the input data into the prediction model to obtain the prediction result of the number of core contributors.

[0113] The forecast result refers to the output result obtained after inputting the input data into the forecast model, and the output result is the number of core contributors. In addition, since project information is constantly changing, the forecast results of the same project at different time points and under the same assumption time may not be the same.

[0114] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0115] The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A method for predicting the number of core code contributors for an open source software project, characterized in that: The method for predicting the number of core code contributors for an open source software project includes: Step 1: Extract project semantic information and project commit records; Step 2: Preprocess the project semantic information and project commit records; Step 3: Use the project semantic information and project commit records after the preprocessing operation to obtain a training matrix, wherein the content of the training matrix includes: project star number, project description, project label, number of project observers, number of forks, whether there is Wikipedia, project code language, number of branches, number of contributors, latest submission time, submission time interval and number of core contributors as feature vectors, and the number of core contributors as the target vector; Step 4: construct and train a prediction model based on the training matrix, wherein the prediction model includes an input layer, a first hidden layer, a fully connected layer, a convolutional layer, a second hidden layer and an output layer, and the output of the output layer is a prediction result of the number of core contributors; Step 5: Use the trained prediction model to make predictions for the open source software projects to be processed.

2. The method for predicting the number of core code contributors for an open source software project according to claim 1, characterized in that: The step 1, extracting project semantic information and project commit records, includes: Step 1-1: Use Github API to obtain open source software projects on the GitHub open source software platform, and set the filtering condition to star value greater than the filtering threshold to obtain the initial project path list; Step 1-2, traverse the initial project path list, and use Github API to extract the project semantic information of the corresponding open source software project according to the initial project path. The project semantic information includes: project name, project star number, project description, project tag, number of project observers, number of forks, whether there is Wikipedia, project code language, number of branches, number of contributors and latest submission time; While extracting the semantic information of the project, clone the filtered open source software projects to the local computer; After the open source software project is cloned, all submission records of the open source software project are extracted. The submission record includes the submission record hash value, submission date, submission author, and submission information. The submission information contains the submission author's description of this submission and the modified files submitted this time. The project name in the project semantic information and the submission record hash value, submission date, submission author, and modified files submitted this time in the submission record are stored as json objects in the local commit.json file. The json objects stored in the local commit.json file are project commit records; The project name, project star count, project description, project tags, number of project observers, number of forks, whether there is a Wikipedia, project code language, number of branches, number of contributors, and latest commit time in the project semantic information are stored as json objects in the local project.json file. The json objects stored in the local project.json file are the project semantic information; Delete the locally cloned open source software project and the traversal is complete.

3. The method for predicting the number of core code contributors for an open source software project according to claim 2, characterized in that: The step 2, preprocessing the project semantic information and project commit records, includes: Step 2-1, traverse the local project.json file and the local commit.json file, and remove abnormal json objects; Step 2-2, traverse the local project.json file and perform normalization processing, wherein the normalization processing is performed on the number of project stars, number of project observers, number of forks, number of branches, and number of contributors in the json object; Step 2-3: traverse the local project.json file to perform format conversion processing, wherein the format conversion processing converts the values ​​of the project description, project label, and project code language in the json object into feature vectors.

4. The method for predicting the number of core code contributors for an open source software project according to claim 3, characterized in that: The format conversion process converts the values ​​of the project description, project label and project code language in the JSON object into vector features, including: Get the value of the project description in the json object, preprocess the value of the project description to get a word array; traverse the word array, use each word as the input of the trained LDA topic model to get the distribution probability of the word under each topic, compare the distribution probabilities of all words in the word array, select the highest probability under each topic as the project description feature vector, and change the value of the project description in the json object to the project description feature vector; Get the value of the project label in the json object, traverse the value of the project label, use each label in the value of the project label as the input of the trained LDA topic model, obtain the distribution probability of the label under each topic, compare the distribution probabilities of all labels under the project label, select the highest probability under each topic as the project label feature vector, and change the value of the project label in the json object to the project label feature vector; Get the value of the project code language in the json object. When the project uses the corresponding code language, set the corresponding position to 1. By default, all bits are 0. Get the code language feature vector and change the value of the project code language in the json object to the code language feature vector.

5. The method for predicting the number of core code contributors for an open source software project according to claim 1, characterized in that: The confirmation process of the number of core contributors is as follows: First, calculate the contribution ratio of the contributor's submission author. The calculation formula is as follows: In the formula, coreContributor(commitAuthor) represents the contribution ratio of the commit author, commitDate i represents the modification time of the i-th modified file set with the same name as the project modified by the submitting author and before the current time point. Date is the current time point, changeFiles∈commitAuthor represents the number of modified files corresponding to the submitting author, projectName i Indicates the name of the modified project corresponding to the i-th modified file set with the same name as the project modified by the submitting author and before the current time point, projectName commitAuthor Indicates the name of the project modified by the submitter, changeFiles indicates the number of modified files, Indicates the number of files modified by the submitting author whose project name is the same as the submitting author and whose modification time is before the current time point. Displays the total number of modified files with the same project name as the submitting author and before the current time point; Secondly, a minimum subset of the submitting authors whose total contribution ratio is greater than a ratio threshold is obtained, and the contributors in the minimum subset of the submitting authors are taken as core contributors, and the length of the minimum subset of the submitting authors is taken as the number of core contributors.

6. The method for predicting the number of core code contributors for an open source software project according to claim 1, characterized in that: The first hidden layer of the prediction model contains 16 neurons and uses ReLU as the activation function. The fully connected layer contains 16 neurons and uses ReLU as the activation function. The convolutional layer contains 16 filters, each filter size is 2, and uses ReLU as the activation function. The second hidden layer contains 16 neurons and uses ReLU as the activation function.

Citation Information

Cited By

  • Open source community-oriented collaborative knowledge outdated detection method, device and equipment

    CN119556977A

  • Open source software project pull request prediction method based on deep learning model

    CN119902745A