Open source software long-term contributor loss prediction method and system based on multi-dimensional features

By building a long-term contributor status transfer and loss prediction model based on multi-dimensional characteristics in the open source software community, using GitHub API and decision tree model, the complexity and real-time problems of long-term contributor loss prediction in the open source community are solved, and the problem of long-term contributor loss is realized. Accurate prediction of long-term contributor attrition and assurance of community sustainability.

CN118606831AActive Publication Date: 2024-09-06BEIHANG UNIV

Patent Information

Application Number
CN202410948912.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-09-06
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively predict the loss of long-term contributors in open source software communities, which threatens the sustainability of the community. The model has high complexity, large data requirements, and lacks real-time prediction capabilities.

Method used

Based on the long-term contributor status transfer model and churn prediction model based on multi-dimensional features, contributor data is obtained through GitHub API, contribution, collaboration, sentiment analysis, interest transfer and affiliation features are extracted, and a decision tree model is constructed for real-time prediction.

Benefits of technology

It achieves real-time and effective prediction of the loss of long-term contributors in the open source community, improves prediction accuracy, makes up for the shortcomings of existing technology, and supports the community to intervene in advance to retain long-term contributors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606831A
    Figure CN118606831A
Patent Text Reader

Abstract

The invention discloses a multi-dimensional feature-based open source software long-term contributor loss prediction method and system, and belongs to the field of information processing technologies and software engineering technologies, and the system comprises a data layer, a feature layer, a model layer and a monitoring layer; by constructing a long-term contributor state transition model, extracting multi-dimensional features of long-term contributors of the open source software and constructing a long-term contributor loss prediction model of the open source software, the long-term contributor loss of the open source community is effectively predicted in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of information processing technology and software engineering technology, and relates to open source software project development prediction technology, and in particular to a method and system for predicting the loss status of long-term contributors in an open source software community based on multidimensional features. Background Art

[0002] Since the late 1980s, open source software has been driving innovation and creating a large number of outstanding products, such as the Linux kernel, Android, and TensorFlow. However, the development model of open source software is community-driven, and these communities are loosely organized. This loose organization often leads to a high turnover rate of contributors, which brings sustainable development risks to the open source software community. In particular, the loss of long-term contributors will have a serious impact on the sustainability of open source software projects. Because long-term contributors not only contribute a lot of code, but also participate for a long time, they have a deep understanding of the technical core and details of the project. In addition, long-term contributors are usually actively involved in various activities, such as code review and mentoring newcomers. Cultivating these long-term contributors often requires years of effort from the community.

[0003] In order to prevent the loss of long-term contributors in the open source community and maintain its normal development, it is necessary to establish a state transition model for the development cycle of contributors in the open source community to understand the possibility of transition between states that may occur before the contributors lose state. It is further necessary to build a prediction model for the loss of long-term contributors to predict the long-term contributors before the loss state, so as to help the community intervene in advance and retain the loss of these long-term contributors. The existing technology has done a lot of work on the state transition model of core contributors and the prediction model of newcomers becoming long-term contributors, including methods based on social network / collaboration network analysis to identify key contributors, using machine learning technology to predict the possibility of contributors becoming long-term contributors, and analyzing project code base activities to understand the behavior patterns of contributors. However, the above-mentioned existing technologies have problems such as high model complexity, large data requirements, and lack of real-time prediction capabilities, making it difficult to be widely used and promoted in actual open source communities. Summary of the invention

[0004] In order to overcome the shortcomings of the prior art, the present invention provides a method and system for predicting the loss status of long-term contributors in an open source software community based on multi-dimensional features. By designing a state transition model of long-term contributors and a long-term contributor loss prediction model, real-time and effective prediction of the loss of long-term contributors in the open source community is supported.

[0005] In order to support real-time and effective prediction of long-term contributor loss, the present invention first constructs a long-term contributor state transition model based on the activity history of long-term contributors in the open source community, and describes the state changes before the loss of long-term contributors.

[0006] The present invention divides the contributors in the open source community into ordinary contributors, long-term contributors, non-coding long-term contributors, and lost long-term contributors. The present invention is based on the constructed long-term contributor status transition model, and obtains the contributor status by collecting relevant data and processing and calculating it. The following defines the status of the contributor and the transition between the statuses. These terms focus on a specific open source community; Contributors refer to developers who have contributed code at least once to an open source software community (code base), including: ordinary contributors, long-term contributors, non-coding long-term contributors, and lost long-term contributors. These four types of contributors are not intersecting but can be converted; Long-term contributors refer to contributors who have contributed code to an open source software community for at least one year and have demonstrated high productivity during this period, that is, their historical code contributions rank in the top 10% of all contributors to the open source project.

[0007] A non-coding long-term contributor is a contributor who used to be a long-term contributor but does not contribute code or no longer contributes code, but may show interest in the project in other ways, such as answering questions and participating in discussions. The present invention stipulates that if the time interval from the current time to the time of the last code submission of the long-term contributor exceeds her / his historical maximum coding interval (i.e., the maximum time difference between two consecutive historical code submissions observed at the current time), it indicates that the long-term contributor does not contribute code or no longer contributes code, and is converted to a non-coding long-term contributor.

[0008] Lost long-term contributors refer to contributors who used to be long-term contributors or non-coding long-term contributors, but now not only no longer make code contributions for a period of time, but also no longer participate in any other activities in the open source software community, that is, contributors who have left the project. The present invention stipulates that if the time interval from the current time to the last activity (including code submission, pull request, comment, report issue) of the long-term contributor / non-coding long-term contributor exceeds its historical maximum activity interval (that is, the maximum value of the time difference between two consecutive historical activities observed at the current time), then the contributor has left the project.

[0009] Ordinary contributors are contributors who are not long-term contributors, non-coding long-term contributors, or churned long-term contributors.

[0010] Based on the above terms, the present invention provides a long-term contributor loss prediction technology, which can be further used to solve the problem that the sustainability of the open source community is difficult to maintain due to the loss of long-term contributors.

[0011] The technical solution of the present invention: A method for predicting the loss status of long-term contributors in an open source software community is provided. Based on the log data of the open source software community, a prediction model for the loss of long-term contributors in the open source software community is constructed to achieve real-time and effective prediction of the loss of long-term contributors in the open source community. The method comprises the following steps: 1) Identify long-term contributors to the open source software community based on historical submission data in the community; including: Long-term contributors are defined as contributors whose last code submission to the project is more than one year apart from their first code submission, and whose total number of submissions ranks in the top 10% of all contributors to the project. We have built a long-term contributor status transition model, which includes the following states: contributor status, long-term contributor status, non-coding long-term contributor status, and lost long-term contributor status. Contributors are converted to long-term contributors after their number of submissions reaches the top 10% and they have been in the community for more than one year. Long-term contributors who do not submit code for the maximum submission interval are converted to non-coding long-term contributors. Long-term contributors / non-coding long-term contributors who do not perform any activity for the maximum activity interval are converted to lost long-term contributors.

[0012] Through the GitHub API, all submission records of open source software community projects are obtained, including code submission time and code submission author information; Sort the commit records by timestamp to determine the time of each contributor's first and most recent commit; By calculating the difference between the first submission time and the last submission time of each contributor and the number of submissions of the contributor, we can identify the long-term contributors of the open source software community. 2) Extract the data of long-term contributors through GitHub API, including the long-term contributors' issues (number of issues), pull requests, submission comments, issue comments, pull request comments, branches (i.e. number of forks, on GitHub, contributors can copy a repository through forks), number of likes and personal information.

[0013] 3) Extract effective structured information from data features, including the monthly contribution, collaboration, sentiment analysis features, interest transfer features and affiliation of long-term contributors; 4) Build a long-term contributor churn prediction model; including: The long-term contributor churn prediction model includes a data interface module, a core enhancer module, an objective function module and an indicator module for evaluating model performance. The data interface module is used to store and manage data. It is responsible for extracting data from the file system and performing preliminary processing and cleaning for use by subsequent modules. Its function is to extract, clean and store data, provide data support for model training and prediction, and ensure data integrity and consistency by storing the processed data in data frames. The core enhancer module is the core part of the model and is responsible for training and prediction. It includes the implementation of the decision tree model and provides training and prediction interfaces. This module supports a variety of objective functions and evaluation indicators. Its function is to use training data to build a decision tree model and use the trained model to predict new data. We set some key parameters for the core enhancer. Specifically, it uses grid search, traversal of multiple learning rates, and multiple tuning to obtain the optimal parameters. The objective function module defines the objective function of the prediction model, which is used to guide the optimization process of the model. Our objective function As shown below:

[0014] in represents the cross entropy function; is the complexity of the Kth decision tree; n is the number of samples, representing the number of monthly data samples of all long-term contributors. In our model, we collected a total of 221,525 monthly activity samples of long-term contributors. Represents the real labeled data, and its value is 0 or 1. The value of is obtained based on the long-term contributor state transition model defined in this invention. When the submission interval of a long-term contributor exceeds the historical maximum submission interval, the long-term contributor will be transformed into a non-coding long-term contributor. Non-coding long-term contributors are likely to be transformed into lost long-term contributors. Therefore, what we predict here is the timing of long-term contributors transforming into non-coding long-term contributors. If the data of a long-term contributor in a certain month If it is 0, it means that the long-term contributor will not be lost after 3 / 6 / 9 months, that is, he will still be a long-term contributor after 3 / 6 / 9 months. Otherwise, he will be lost, which means that the long-term contributor will enter the non-coding long-term contributor status after 3 / 6 / 9 months. Represents the result of the K-th decision tree inference, and the calculation formula is as follows:

[0015] The input of the ith sample is a 17-dimensional feature vector, which specifically includes the contribution of a long-term contributor in a certain month (number of submissions, number of issues, number of pull requests, number of submission comments, number of issue comments, number of pull request comments, and the total number of historical submissions), collaboration (degree centrality, cluster centrality, betweenness centrality, proximity centrality, and eigenvalue centrality of the long-term contributor in the collaboration network that month), sentiment analysis features (the number of positive and negative comments of the long-term contributor in that month), interest transfer features (the number of branches (forks) and likes (stars) of the long-term contributor in that month) and affiliation features (the email suffix of the long-term contributor determines whether the long-term contributor is affiliated with a company or organization, if yes, it is 1, otherwise it is 0). L is the cross entropy function in our model. Represents the complexity of the K-th decision tree, and its value is the sum of the number of leaf nodes and the square of the leaf weight of the K-th tree. Its role is to guide the optimization process of the model and ensure that the model learns in the right direction, where the learning rate controls the speed of convergence of the model weight. The indicator module for evaluating model performance is used to evaluate the performance of the model. It provides a variety of evaluation indicators to measure the prediction effect of the model, such as accuracy, precision, recall, F1 score, etc. Its role is to evaluate and measure the performance of the model and help select the optimal model. The data interface module is responsible for providing data to the core enhancer module for model training and prediction. The core enhancer module uses the data provided by the data interface module to train the model and optimizes it according to the objective function defined by the objective function module. The objective function module guides the optimization process of the core enhancer module to ensure the learning direction of the model. After the training is completed, the core enhancer module passes the prediction results of the model to the indicator module for evaluating model performance. The indicator module for evaluating model performance calculates the evaluation indicators based on the prediction results and feeds back the performance of the model.

[0016] The input of the long-term contributor churn prediction model is five-dimensional features, including: the contribution of long-term contributors in a certain month, collaboration, sentiment analysis features, interest transfer features and affiliation. The model output is the prediction result: whether the long-term contributor will be converted to a non-coding long-term contributor after a period of time (3 / 6 / 9 months). If yes, the output is 1, otherwise the output is 0.

[0017] Model training: We first selected the top 100 open source software communities with the most likes and performed the following screening: a) Projects with no programming language, as these projects are usually not related to software development. For example, the project paper-we-love / papers-we-love is a collection of papers.

[0018] b) Projects that only use GitHub as a mirror, for example, torvalds / linux uses Bugzilla as the issue tracking system instead of GitHub's own issue tracking system.

[0019] c) Projects forked from other projects.

[0020] 47 open source software communities were obtained. We used the five-dimensional feature data of long-term contributors in these 47 open source communities from the creation of the community to October 2023 every month as the training data set. We randomly used the long-term contributor data of 80% of the projects in the training data set as the training set and the long-term contributor data of 20% of the projects as the test set. We used GridSearchCV in the scikit-learn library (GridSearchCV refers to grid search, which is a hyperparameter optimization method that traverses predefined hyperparameter combinations through exhaustive search. For each parameter combination, the grid search trains the model and evaluates it, and finally selects the best performing parameter combination) to perform five-fold cross-validation on the training set, and used Area Under Curve (AUC, defined as the area under the ROC curve and the coordinate axis, collectively referred to as AUC below) as the evaluation indicator of the long-term contributor churn prediction model to determine the optimal parameters (including the number of iterations and learning rate) of the long-term contributor churn prediction model, traverse all model parameters, determine the model with the highest AUC on the test set, and obtain the trained long-term contributor churn prediction model. Since the magnitude of monthly data of different long-term contributors varies greatly (for example, some long-term contributors have more than 1,000 issues per month, while some long-term contributors have 0 issues per month), and many of the data are not normally distributed, we use the MinMaxScaler function to normalize all monthly data.

[0021] 5) Predict the loss of long-term contributors in the open source software community; Since different time spans will have different influencing factors and prediction requirements, we use three models to predict the churn of long-term contributors after 3 / 6 / 9 months. The input of the model is the contribution, collaboration, sentiment analysis features, interest transfer features and affiliation data of the long-term contributors of the current project in the current month, and the output is whether the long-term contributors of the current project will churn after 3 / 6 / 9 months. (The output result is 0 or 1, if it is 0, it means there will be no churn after 3 / 6 / 9 months, and 1 means there will be churn). Through the three models we trained, we can get the churn of each long-term contributor of the current project after 3 / 6 / 9 months.

[0022] Through the above steps, it is possible to predict the loss status of long-term contributors in the open source software community.

[0023] Utilizing the above-mentioned method for predicting the loss status of long-term contributors in the open source software community, the specific implementation of the present invention also realizes a real-time and effective prediction system for the loss of long-term contributors in the open source community, including: a data layer, a feature layer, a model layer and a monitoring layer.

[0024] The data layer is used to obtain the monthly submission number, issue number, pull request number, comment number, comment content, like number, branch number, and user information data of all long-term contributors of the top 100 repositories with the most likes and the current system application repository.

[0025] The feature layer obtains data from the data layer and obtains the features of structured information, including contribution, collaboration, sentiment analysis features, interest transfer features, and affiliation.

[0026] The model layer is used to train the long-term contributor churn prediction model and obtain the trained long-term contributor churn prediction model after 3 / 6 / 9 months.

[0027] The monitoring layer is used to infer the churn of long-term contributors in the current open source software community after 3 / 6 / 9 months through the trained long-term contributor churn prediction model, obtain the churned long-term contributors after 3 / 6 / 9 months, and send emails and GitHub notification information to the repository manager through GitHub Action to obtain the list of churned long-term contributors (long-term contributors with high churn risk).

[0028] Compared with the prior art, the beneficial technical effects of the present invention are: The technology provided by the present invention can support real-time prediction of the loss of long-term contributors in the open source community. Through the technical solution of the present invention and the embodiments provided below, the loss of long-term contributors in the open source community after 3 / 6 / 9 months can be accurately predicted. The AUC of the long-term contributor loss prediction algorithm constructed by the present invention on the test data set reached 0.7555 / 0.7417 / 0.7416 respectively.

[0029] By utilizing the technical solution and the provided embodiments of the present invention, it is possible to realize real-time prediction of the loss of long-term contributors to the open source community, thus filling the gap in the technology for predicting the loss of long-term contributors to the open source community. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is an overall flow chart of a method for predicting the churn status of long-term contributors in an open source software community provided by an embodiment of the present invention.

[0031] Figure 2 It is a structural block diagram of a system implemented in an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The present invention will be further described below by way of embodiments in conjunction with the accompanying drawings, but the scope of the present invention is not limited in any way.

[0033] The present invention provides a method and system for predicting the loss status of long-term contributors in an open source software community. By designing and constructing a state transition model of long-term contributors, the state changes before the loss of long-term contributors are characterized; and then a long-term contributor loss prediction model is constructed to support real-time and effective prediction of the loss of long-term contributors in the open source community. It can be further used to solve the sustainability problem of the open source community caused by the loss of long-term contributors. By predicting the loss of long-term contributors in the open source community, the open source community manager can intervene in advance or retain these long-term contributors to help the open source community develop stably.

[0034] The present invention is implemented using GitHub API, GitHub Action and XGBoost, specifically including: GitHub API is a set of interfaces that allow users to interact with resources on the GitHub platform. These resources include repositories, branches, commits, issues, pull requests, etc. GitHub API uses HTTP protocol for communication and mainly adopts REST architecture style, providing rich endpoints for users to operate various resources.

[0035] GitHub Actions is a continuous integration and continuous deployment service provided by GitHub that allows contributors to automate the software development process on GitHub. By configuring predefined workflows, you can perform custom tasks such as building, testing, and deploying when events such as code submissions and pull requests are triggered, thereby automating the software development and release process, improving team collaboration efficiency, and ensuring code quality and reliability.

[0036] XGBoost (eXtreme Gradient Boosting) is an efficient machine learning algorithm based on decision tree ensemble, designed to solve classification and regression problems. By iteratively training multiple weak classifiers, each round fits the residuals of the previous round of models, and finally obtains a powerful integrated model. XGBoost uses the gradient boosting method to optimize the model by minimizing the loss function. Regularization terms are introduced in each iteration to prevent overfitting. At the same time, feature importance evaluation provides interpretability of the model. Therefore, it performs well on various data sets and is one of the highly respected algorithms for prediction in the field of software engineering today.

[0037] When the present invention is implemented, a method and system / tool ​​for predicting the loss of long-term contributors in an open source community is provided. By extracting features from the data of long-term contributors in open source projects on GitHub and training a long-term contributor loss prediction model, the applied community is regularly monitored, and the long-term contributors who are about to be lost are notified to the community manager. Specifically, the method of the present invention includes 5 steps: long-term contributor discovery, data extraction, feature engineering, model construction, and regular monitoring.

[0038] A. Discovery of long-term contributors. Based on the code-related information in the open source software community, long-term contributors are identified to obtain the long-term contributors of the corresponding open source software community. The implementation method is: Compared with the loss of ordinary contributors, the departure of long-term contributors has a more profound impact on the sustainability of open source software projects. Long-term contributors not only contribute important code, but also maintain long-term participation, have a deep understanding of the scope of the project, and actively participate in various activities such as code review and mentoring newcomers. Cultivating such long-term contributors usually requires years of effort and investment from the community. Therefore, we first need to identify long-term contributors in open source software projects. The present invention focuses on open source projects hosted on the GitHub platform. GitHub is the most popular hosting platform for open source and private software projects in the world. We obtained the time and author information of each submission in the warehouse through the GitHub API, and calculated that the last code submission time and the first code submission time in the open source software project were more than 1 year, and the number of submissions (number of times) accounted for the top 10% of the warehouse. The author is the long-term contributor of the corresponding open source software community. The technical difficulty of this step is that the number of submissions in some open source software communities is large, the acquisition speed is slow, and the data is lost when interrupted due to network factors. In response to the above challenges, we control the amount of data obtained each time through the paging parameters provided by the GitHub API, and obtain all submission information of the warehouse concurrently through the thread pool. When the number of pages of acquired data reaches a certain integer multiple, we persist the acquired data to reduce the problem of data loss due to network interruptions.

[0039] B. Data extraction. Collect activity data of all long-term contributors on GitHub. This is done by: This step is responsible for obtaining the activity data of the long-term contributors found in step A on GitHub. Through the GitHub API, we obtain the monthly submissions of all long-term contributors in the open source software community, including: issues, pull requests, submission comments, issue comments, pull request comments, branches, likes data and personal information. This step can be completed in parallel on the server. The challenge of this step is that the amount of comment data in some repositories is huge, and it is difficult to obtain complete data when obtaining comment information only through the GitHub API paging parameters (a page has a maximum of 100 data items, and a maximum of 300 pages can be obtained). In response to the above challenges, when obtaining all the comment data of the repository, we first obtain the start date information of the repository through the GitHub API. Then, by controlling the paging parameters and start time parameters of the GitHub API, and in ascending order of time, obtain all the comment data in batches with different start times. When persisting the data, we record the start time of the current batch of comments.

[0040] C. Feature engineering. Extract the features of long-term contributors, including multiple features in five dimensions, as input to the long-term contributor churn prediction model. The implementation method is: In order to identify whether long-term contributors will convert to non-coding long-term contributors, we extracted 17 features from five dimensions. We proposed these features based on assumptions about factors that may affect contributor churn, and also took into account the availability of data. We performed feature engineering from the extracted data from five dimensions (extracting effective structured information from the data obtained in step B). Including: C1. Contribution: The contribution dimension includes the following seven features: the number of submissions, the number of issues, the number of pull requests, the number of submission comments, the number of issue comments, the number of pull request comments, and the total number of historical submissions of long-term contributors each month. This dimension reflects the contribution of long-term contributors to the open source community in that month; C2. Collaboration: git log is a command in the Git version control system that is used to view the submission history of the repository. This command displays all submission records, including the submission information, author, date, and submission hash value of each submission. We use git log to obtain the author and file information of the submissions of the open source software community every month. Then we build a collaboration network for the open source software community. Taking contributors as nodes, if there is an intersection in the files submitted by the contributors, we connect an undirected edge between the contributors. Use the networkx library in Python to extract five features in the collaboration network each month, including degree centrality, cluster centrality, betweenness centrality, closeness centrality, and eigenvalue centrality, as collaboration features; C3. Sentiment analysis: The ROBERT model is used to perform sentiment analysis on the comments submitted by long-term contributors every month, the comments on issues, and the comments on pull requests. The output is positive, neutral, or negative. We use the ROBERT model to obtain the sentiment attributes of each comment on the comments made by long-term contributors every month. Then, the number of positive comments and negative comments made by each long-term contributor each month are counted separately. Finally, the two features of the number of positive comments and the number of negative comments made by long-term contributors are used as the features of the sentiment analysis dimension; C4. Interest transfer: Since long-term contributors branch or like other open source software communities, it often means that long-term contributors have an interest in other open source software communities. Therefore, the number of branches (forks) and likes (stars) of long-term contributors in the month are used as features to assess whether the interests of long-term contributors have shifted; C5. Affiliation: The affiliation feature of long-term contributors is determined by the email suffix of the long-term contributor to determine whether the long-term contributor is affiliated with a company or organization.

[0041] In the C3 step, when obtaining the sentiment characteristics of long-term contributors in the community, most previous methods used SentiStrength or SentiStrength-SE. However, the ROBERT we use can better utilize the performance of the GPU to achieve more efficient computing, and the misjudgment rate of negative comments will be reduced. ROBERT (Robustly Optimized BERTPretraining Approach) is a method to optimize the BERT model. By extending the training time, increasing the amount of data, removing the next sentence prediction task, adjusting hyperparameters, and using dynamic masking strategies, the generalization ability and accuracy of the model are improved. Its underlying principle is based on the Transformer architecture and self-attention mechanism, which can efficiently capture global contextual information in the sequence. In the sentiment analysis task, the optimization of ROBERT enables it to more accurately understand and analyze the sentiment tendency in the text, thereby providing more accurate sentiment classification results.

[0042] D. Model construction. Build and train a long-term contributor prediction model to obtain trained long-term contributor prediction models of different time granularities. The implementation method is: The model includes a data interface module, a core enhancer module, an objective function module, and an indicator module for evaluating model performance. The data interface module is used to store and manage data. It is responsible for extracting data from the file system and performing preliminary processing and cleaning for use by subsequent modules. It is used to extract, clean, and store data, provide data support for model training and prediction, and ensure data integrity and consistency by storing the processed data in a data frame. The core enhancer module is the core part of the model and is responsible for training and prediction. It includes the implementation of the decision tree model and provides an interface for training and prediction. This module supports a variety of objective functions and evaluation indicators. It is used to build a decision tree model using training data and use the trained model to predict new data. We set some key parameters of the core enhancer as follows: For the model predicting the long-term contributor churn after 3 months, the learning rate is 0.05 and the number of decision trees is 80. For the model predicting the long-term contributor churn after 6 months, the learning rate is 0.02 and the number of decision trees is 100. For the model predicting the long-term contributor churn after 9 months, the learning rate is 0.05 and the number of decision trees is 70. The above parameters are obtained through grid search, traversing the learning rate of 0.01, 0.05, 0.1, 0.4, 0.5, 0.6, and tuning the best parameters of 10, 20, 30, 40, 50, 60, 70, 80, 90, 100. The objective function module defines the objective function of the model, which is used to guide the optimization process of the model. Our objective function is as follows:

[0043] Where n is the number of samples, representing the number of monthly data samples of all long-term contributors. In our model, we collected a total of 221,525 monthly activity samples of long-term contributors. Represents the real labeled data, and its value is 0 or 1. According to the long-term contributor state transition model we defined, when the submission interval of a long-term contributor exceeds the historical maximum submission interval, the long-term contributor will become a non-coding long-term contributor. Non-coding long-term contributors are likely to become lost long-term contributors, so what we predict here is the timing of long-term contributors becoming non-coding long-term contributors. If the data of a long-term contributor in a certain month If it is 0, it means that the long-term contributor will not be lost after 3 / 6 / 9 months, that is, he will still be a long-term contributor after 3 / 6 / 9 months. Otherwise, he will be lost, which means that the long-term contributor will enter the non-coding long-term contributor status after 3 / 6 / 9 months. Represents the result of the K-th decision tree inference, and the calculation formula is as follows:

[0044] The input of the ith sample is a 17-dimensional feature vector, which specifically includes the contribution of a long-term contributor in a certain month (number of submissions, number of issues, number of pull requests, number of submission comments, number of issue comments, number of pull request comments, and the total number of historical submissions), collaboration (degree centrality, cluster centrality, betweenness centrality, proximity centrality, and eigenvalue centrality of the long-term contributor in the collaboration network that month), sentiment analysis features (the number of positive and negative comments of the long-term contributor in that month), interest transfer features (the number of branches (forks) and likes (stars) of the long-term contributor in that month) and affiliation features (the email suffix of the long-term contributor determines whether the long-term contributor is affiliated with a company or organization, if yes, it is 1, otherwise it is 0). L is the cross entropy function in our model. Represents the complexity of the K-th decision tree. Its role is to guide the optimization process of the model and ensure that the model learns in the right direction, where the learning rate controls the speed at which the model weights converge. The indicator module for evaluating model performance is used to evaluate the performance of the model. It provides a variety of evaluation indicators to measure the prediction effect of the model, such as accuracy, precision, recall, F1 score, etc. Its role is to evaluate and measure the performance of the model and help select the optimal model. The data interface module is responsible for providing data to the core enhancer module for model training and prediction. The core enhancer module uses the data provided by the data interface module to train the model and optimizes it according to the objective function defined by the objective function module. The objective function module guides the optimization process of the core enhancer module to ensure the learning direction of the model. After the training is completed, the core enhancer module passes the prediction results of the model to the indicator module for evaluating model performance. The indicator module for evaluating model performance calculates the evaluation indicators based on the prediction results and provides feedback on the performance of the model.

[0045] The input of the long-term contributor churn prediction model is five-dimensional features, including: the contribution of long-term contributors in a certain month, collaboration, sentiment analysis features, interest transfer features and affiliation. The model output is the prediction result: whether the long-term contributor will be converted to a non-coding long-term contributor after a period of time (3 / 6 / 9 months). If so, the output is 1, otherwise the output is 0. This step requires building our long-term contributor prediction model. We use the GitHub API to obtain the data of all long-term contributors in the 100 most popular open source software communities as our training data. These repositories have a long duration, a large number of long-term contributors and are sufficiently representative. The following screening was performed to obtain 47 open source software communities. Including: Empty projects for programming languages, as these projects are usually not related to software development. For example, the project paper-we-love / papers-we-love is a collection of papers.

[0046] Projects that only use GitHub as a mirror, for example, torvalds / linux uses Bugzilla as the issue tracker instead of GitHub's own issue tracker.

[0047] Projects forked from other projects.

[0048] We use the five-dimensional feature data of the long-term contributors in these 47 open source communities from the creation of the community to October 2023 every month as the training data set. We randomly use the long-term contributor data of 80% of the projects in the training data set as the training set, and the long-term contributor data of 20% of the projects as the test set. We use the GridSearchCV in the scikit-learn library (GridSearchCV refers to grid search, which is a hyperparameter optimization method that traverses predefined hyperparameter combinations through an exhaustive search method. For each parameter combination, the grid search will train the model and evaluate it, and finally select the best performing parameter combination) to perform five-fold cross-validation on the training set, using AUC as the evaluation indicator of the long-term contributor churn prediction model, determine the optimal parameters of the long-term contributor churn prediction model (including the number of iterations and learning rate), and obtain the trained long-term contributor churn prediction model. Since the magnitude of the monthly data of different long-term contributors varies greatly, and many of them are not normally distributed, we use the MinMaxScaler function to normalize all monthly data. Then, we trained three models using the XGBoost model to predict whether long-term contributors will churn after 3, 6, and 9 months. For the XGBoost model, we divided the data set (training set and test set) and performed data preprocessing (including normalization using MinMaxScaler), then adjusted the parameters through grid search, set the evaluation function (AUC), and then called the xgboost.fit method in sklearn to train the model. The uniqueness of our model lies in the use of representative and diverse data sets to ensure that the model's prediction results have a wide range of applicability. At the same time, we introduced innovative five-dimensional features to train the model to enhance the accuracy of the model. Finally, we provided multi-stage and more fine-grained prediction results to facilitate project managers to adopt different intervention measures.

[0049] E. Regular monitoring. The implementation method is: Finally, we need to promptly feed back our prediction results to managers of the open source community. Through GitHubAction, the prediction model is triggered every day to make predictions, obtain information about long-term contributors of the current open source software project, perform data extraction and feature engineering, and then use the trained model to infer the loss of long-term contributors after 3, 6, and 9 months. For long-term contributors who are about to lose, the designated manager is notified via email or GitHub.

[0050] As a preferred solution, the results of historical extraction in step B are cached on the server, and only the data of the latest month is extracted on a regular basis every month, which reduces repeated data extraction and greatly saves time.

[0051] As a preferred solution, the implementation method of step D is to cache the characteristic data of long-term contributors in the 100 most popular warehouses on the server, and extract only the data of the latest month every month. This reduces repeated data extraction and greatly saves time.

[0052] The tool design provided by the present invention can support real-time prediction of the loss of long-term contributors in the open source community. The technical solution and the embodiments provided by the present invention can accurately predict the loss of long-term contributors in the open source community after 3 / 6 / 9 months. The AUC of the long-term contributor loss prediction algorithm constructed by the present invention on the test data set reached 0.7555 / 0.7417 / 0.7416 respectively.

[0053] like Figure 2 As shown, when the present invention is implemented, the above-mentioned method for predicting the loss status of long-term contributors in the open source software community is used to implement a real-time and effective prediction system for the loss of long-term contributors in the open source community, including: a data layer, a feature layer, a model layer and a monitoring layer.

[0054] The data layer is used to obtain the commits, issues, pull requests, comments, likes, branches, and user information data of the top 100 repositories with the most likes and all long-term contributors of the current system application repository.

[0055] The feature layer obtains data from the data layer and obtains the features of structured information, including contribution, collaboration, sentiment analysis features, interest transfer features, and affiliation.

[0056] The model layer is used to train the model and obtain the prediction model for the churn of long-term contributors after 3 / 6 / 9 months.

[0057] The monitoring layer is used to infer the churn of long-term contributors in the current repository after 3 / 6 / 9 months through training models, and to send emails and GitHub notifications to the repository manager through GitHub Action to list long-term contributors with high churn risk.

[0058] Figure 1 The figure shows the process of the method for predicting the loss status of long-term contributors in the open source software community. The specific implementation includes the following processes: A. Long-term contributors found In order to accurately identify long-term contributors in the open source project community, we have adopted a comprehensive analysis and identification process. Long-term contributors are defined as those whose last submission to the project is more than one year away from their first submission and whose total number of submissions ranks in the top 10% of all contributors to the project.

[0059] First, we obtain all the commit records of the project through the GitHub API. The GitHub API provides a rich interface that can obtain detailed information about each commit in the repository, including timestamps and author information. In order to deal with the problem of a large number of commit records and slow acquisition speed, we innovatively proposed a combination of paging acquisition and concurrent requests, user token pool use and periodic persistence strategy. Specifically, we took the following measures: Paginated retrieval: The number of data entries returned by the GitHub API is limited by default. We use pagination parameters (such as per_page and page) to retrieve all submission records page by page.

[0060] Concurrent requests: To speed up the data acquisition process, we use the thread pool concurrent request API. In the specific implementation, we can use Python's concurrent.futures.ThreadPoolExecutor to manage multiple concurrent requests.

[0061] User Token Pool: The GitHub API has a limit on the request frequency for each user. We have built a user token pool and switched between different tokens to increase the request frequency and avoid being throttled.

[0062] In order to reduce the problem of data loss caused by network interruption, we set a periodic persistence strategy in the process of acquiring data. When the number of pages of acquired data reaches a certain integer multiple (the default is 200), we will persist the acquired data to the local file system so that we can continue to acquire data from the last interruption point when a network problem occurs.

[0063] After obtaining all the commit records, we sort them by timestamp to determine the time of each contributor's first and most recent commit. The specific steps are as follows: Timestamp sorting: Sort each submission record in ascending order by timestamp.

[0064] First and last commit time: Traverse the sorted records and record the first and last commit time of each contributor.

[0065] Next, we count the total number of submissions of each long-term contributor and filter out qualified long-term contributors by setting a threshold. The specific steps are as follows: Total submission statistics: Traverse all submission records and count the number of submissions for each contributor.

[0066] Threshold screening: The top 10% of contributors in terms of number of submissions are selected as long-term contributors.

[0067] In order to ensure the portability and consistency of the analysis process, we encapsulate the above analysis process into an automated script and deploy it using containerization technologies such as Docker. The specific implementation is as follows: Automation scripts: Use Python to write data acquisition and analysis scripts, use the requests library to interact with the GitHub API, and use the pandas library for data processing and analysis.

[0068] Containerized deployment: Use Docker to package the script and required environment into a container image to ensure consistent operation in different environments.

[0069] This process has low requirements for hardware resources and can be executed on ordinary servers, such as servers using Intel E5-2670CPU. By properly designing the data acquisition and processing process, the identification of long-term contributors to large-scale open source projects can be completed in a relatively short period of time. Through the above technical means, we can effectively identify long-term contributors in open source projects and provide important support for the sustainable development of the projects.

[0070] B. Data Extraction We use a server with 16 CPU cores and 64GB memory to perform this parallel task. First, we divide the list of long-term contributors into 16 groups, each of which is responsible for processing the data of a long-term contributor. We choose to use the Python programming language and combine it with multi-threading technology to implement parallel tasks. Specifically, we can use concurrent.futures.ThreadPoolExecutor to manage the thread pool and implement parallel processing. Each thread is responsible for obtaining the GitHub activity data of a long-term contributor. To obtain data on GitHub, you need to use the GitHub API. Through the GitHub API, we can obtain various data, including but not limited to: User information: Get the user's personal information, such as user name, email address, avatar, etc.

[0071] Repository information: Get basic information about the repository, such as name, description, language, etc. Submission information: Get detailed information about the submission, including submitter, submission time, submission information, etc.

[0072] Issues and Pull Requests: Get details on issues and pull requests in your repository, including title, description, status, comments, and more.

[0073] Likes and branch information: Get information about user likes and branch repositories.

[0074] Comment information: Get detailed information about commit comments, issue comments, and pull request comments in the repository, including time, content, author, etc.

[0075] Compared with existing methods, we significantly speed up data acquisition and processing through multi-threaded parallel processing. Our comprehensive extraction of multiple data types is more comprehensive and in-depth than traditional methods. At the same time, we solved the problem of GitHub API paging limitation, especially for comment data, using since parameters and sort parameters to control the start time of batch comments, which is a more innovative paging processing method. In addition, we proposed the implementation of rate limit and retry logic. When acquiring data, we paid attention to the rate limit of GitHub API and implemented appropriate rate limit and retry logic as needed to ensure the effectiveness and continuity of data acquisition. This strategy to prevent API flow limiting is an important and innovative technical point for large-scale data extraction tasks. Specifically, for each long-term contributor mentioned in the step, we can obtain their activity data in the specified repository through GitHub API, including monthly submissions, issues, pull requests, submission comments, issue comments, pull request comments, branches, likes and other information. For example, for submission information, we can use the commits endpoint of GitHub API to obtain submission data in the specified repository. By setting appropriate query parameters (per_page is 100, and the author parameter specifies the author of the commit), we can get the commit records of the specified contributor in each month. Similarly, we can use other endpoints to get other types of data, such as issues, pull requests, etc. For comment data, we need to additionally set the since parameter and sort parameter to control the starting time of the batch of comments to solve the paging limitation problem encountered when the GitHub API is used to obtain data. When writing code, we need to use the corresponding API endpoint and query parameters to construct HTTP requests, and parse the returned JSON data to extract the required information. When obtaining data, we need to pay attention to the rate limit of the GitHub API, and implement appropriate rate limit and retry logic as needed to ensure that we can effectively obtain data without restrictions. In the running stage, we expect the execution time of the entire task to be about 2 to 3 hours, depending on the response speed of the GitHub API and the server performance.

[0076] C. Feature Engineering In order to study whether long-term contributors will convert to non-coding long-term contributors, we extracted 17 features from five dimensions. We proposed these features based on assumptions about factors that may affect contributor churn, and also considered the availability of data. Compared with existing methods, we innovatively proposed five-dimensional features (including 17 features) for the construction of subsequent prediction models. Among them, we innovatively constructed and analyzed the collaboration network: using git log to obtain the commit author and file information, constructing the collaboration network, and extracting multiple centrality features through the networkx library. This approach of using social network analysis methods to quantify collaboration features is relatively innovative in the analysis of open source community contributor behavior. In addition, when obtaining sentiment analysis features, we used the ROBERT model to perform sentiment analysis on the comments of long-term contributors and used the sentiment analysis results as features. It is an innovative attempt to quantify the emotional state of contributors through a sentiment analysis model and use it as a feature. Finally, we use the email suffix of the long-term contributor to determine whether he belongs to a company or organization, and use regular expressions to parse the email suffix, and match the user's affiliation through the email suffix regular expression. This approach of determining affiliation through email suffix analysis is innovative in feature engineering design because it attempts to infer the professional background of long-term contributors through external information. We perform feature engineering on the extracted data from five dimensions, including: C1. Contribution: Write a script to extract the monthly number of commits, issues, pull requests, commit comments, issue comments, and pull request comments of long-term contributors in step B. Use a server with 16 cores and 64GB of memory to perform this task.

[0077] C2. Collaboration: We use git log to obtain the author and file information submitted by the open source software community every month. Then we build a collaboration network for the open source software community. With contributors as nodes, if there is an intersection in the files submitted by the contributors, we connect an undirected edge between the contributors. Through the networkx library, we extract the degree centrality, cluster centrality, betweenness centrality, proximity centrality, and eigenvalue centrality in the collaboration network every month as collaboration features. The configuration is the same as above.

[0078] C3. Sentiment Analysis: Perform sentiment analysis on the commit comments, issue comments, and pull request comments of long-term contributors every month through the ROBERT model, and output positive, neutral, or negative. The number of positive and negative comments of long-term contributors is used as the feature of sentiment analysis. A GPU server (such as NVIDIA Tesla P100 or higher) with at least 16GB of memory is required. The expected running time is about 1 hour, depending on the number of comments in the community.

[0079] C4. Interest transfer: Write a script to extract the branches and likes of the long-term contributors in the month in the statistical step B. The configuration is the same as C1.

[0080] C5. Affiliation: The long-term contributor's email suffix is ​​used to determine whether the long-term contributor is affiliated with a company or organization as the affiliation feature of the long-term contributor. The specific encoding is achieved by parsing the email suffix through regular expressions. The configuration is the same as C1.

[0081] D. Model building This step requires building our prediction model. Compared with existing methods, our data acquisition and screening is more systematic: we obtain data on long-term contributors in the 100 most popular open source software communities through the GitHub API, and perform systematic data screening based on a series of criteria (such as programming language, use of the issue tracking system, and whether it is a forked project). This systematic data acquisition and screening method ensures the representativeness and quality of the data. In addition, our innovative feature engineering and model construction: combining a variety of innovative features (such as collaborative network features, sentiment analysis features, interest transfer features, and affiliation features) and advanced machine learning methods ensure the high accuracy and wide applicability of the prediction model. The specific implementation method is as follows: 1. Data Acquisition and Preprocessing We use the GitHub API to obtain data on all long-term contributors in the 100 most popular open source software communities as training data. The criteria for selecting these repositories are the top 100 projects ranked by the number of likes, because these projects have high visibility and representativeness and have great value for continued development.

[0082] Perform data screening and cleaning to exclude the following items: a) Projects with no programming language, as these projects are usually not related to software development. For example, the project paper-we-love / papers-we-love is a collection of papers.

[0083] b) Projects that only use GitHub as a mirror, for example, torvalds / linux uses Bugzilla as the issue tracking system instead of GitHub's own issue tracking system.

[0084] c) Projects forked from other projects.

[0085] Based on the above criteria, 47 projects were selected. For each project, we observed and collected data from its start time to October 2023 to ensure that the entire duration of each project was covered.

[0086] Monthly activity data including commits, issues, pull requests (PRs), and comments are collected through the GitHub API and Git logs.

[0087] 2. Definition and data collection of long-term contributors We identified 3,827 long-term contributors, and collected monthly data for these contributors during the observation period, totaling 255,894 data points.

[0088] 3. Feature extraction Extract five-dimensional features for training models. These five-dimensional features include: Contribution degree; collaboration degree; sentiment analysis dimension; interest transfer dimension; affiliation dimension.

[0089] 4. Model Training We train three sub-models through the XGBoost model on a server with 16 cores and 64GB memory to predict whether long-term contributors will churn after 3 months, 6 months, and 9 months. The model includes a data interface module, a core booster module, an objective function module, and an indicator module for evaluating model performance. The data interface module is used to store and manage data. It is responsible for extracting data from the file system and performing preliminary processing and cleaning for use by subsequent modules. It is used to extract, clean, and store data to provide data support for model training and prediction, and to ensure data integrity and consistency by storing the processed data in a data frame. The core booster module is the core part of the model and is responsible for training and prediction. It includes the implementation of the decision tree model and provides an interface for training and prediction. This module supports a variety of objective functions and evaluation indicators. It uses training data to build a decision tree model and uses the trained model to predict new data. We set some key parameters of the core booster as follows: For the model predicting the churn of long-term contributors after 3 months, the learning rate is 0.05 and the number of decision trees is 80. For the model predicting long-term contributor churn after 6 months, the learning rate is 0.02 and the number of decision trees is 100. For the model predicting long-term contributor churn after 9 months, the learning rate is 0.05 and the number of decision trees is 70. The above parameters are obtained through grid search, traversing the learning rates of 0.01, 0.05, 0.1, 0.4, 0.5, 0.6, and 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 to tune the best parameters. The objective function module defines the objective function of the model, which is used to guide the optimization process of the model. Our objective function is as follows:

[0090] Where n is the number of samples, representing the number of monthly data samples of all long-term contributors. In our model, we collected a total of 221,525 monthly activity samples of long-term contributors. Represents the real labeled data, and its value is 0 or 1. According to the long-term contributor state transition model we defined, when the submission interval of a long-term contributor exceeds the historical maximum submission interval, the long-term contributor will become a non-coding long-term contributor. Non-coding long-term contributors are likely to become lost long-term contributors, so what we predict here is the timing of long-term contributors becoming non-coding long-term contributors. If the data of a long-term contributor in a certain month If it is 0, it means that the long-term contributor will not be lost after 3 / 6 / 9 months, that is, he will still be a long-term contributor after 3 / 6 / 9 months. Otherwise, he will be lost, which means that the long-term contributor will enter the non-coding long-term contributor status after 3 / 6 / 9 months. Represents the result of the K-th decision tree inference, and the calculation formula is as follows:

[0091] The input of the ith sample is a 17-dimensional feature vector, which specifically includes the contribution of a long-term contributor in a certain month (number of submissions, number of issues, number of pull requests, number of submission comments, number of issue comments, number of pull request comments, and the total number of historical submissions), collaboration (degree centrality, cluster centrality, betweenness centrality, proximity centrality, and eigenvalue centrality of the long-term contributor in the collaboration network that month), sentiment analysis features (the number of positive and negative comments of the long-term contributor in that month), interest transfer features (the number of branches (forks) and likes (stars) of the long-term contributor in that month) and affiliation features (the email suffix of the long-term contributor determines whether the long-term contributor is affiliated with a company or organization, if yes, it is 1, otherwise it is 0). L is the cross entropy function in our model. Represents the complexity of the K-th decision tree. Its role is to guide the optimization process of the model and ensure that the model learns in the right direction, where the learning rate controls the speed at which the model weights converge. The indicator module for evaluating model performance is used to evaluate the performance of the model. It provides a variety of evaluation indicators to measure the prediction effect of the model, such as accuracy, precision, recall, F1 score, etc. Its role is to evaluate and measure the performance of the model and help select the optimal model. The data interface module is responsible for providing data to the core enhancer module for model training and prediction. The core enhancer module uses the data provided by the data interface module to train the model and optimizes it according to the objective function defined by the objective function module. The objective function module guides the optimization process of the core enhancer module to ensure the learning direction of the model. After the training is completed, the core enhancer module passes the prediction results of the model to the indicator module for evaluating model performance. The indicator module for evaluating model performance calculates the evaluation indicators based on the prediction results and provides feedback on the performance of the model.

[0092] The input of the long-term contributor churn prediction model is five-dimensional features, including: the contribution of long-term contributors in a certain month, collaboration, sentiment analysis features, interest transfer features and affiliation. The model output is the prediction result: whether the long-term contributor will be converted to a non-coding long-term contributor after a period of time (3 / 6 / 9 months). If yes, the output is 1, otherwise the output is 0. This step requires the construction of our long-term contributor prediction model. We use the GitHub API to obtain the data of all long-term contributors in the 100 most popular open source software communities as our training data. These repositories have a long duration, a large number of long-term contributors and are sufficiently representative. After screening, 47 open source software communities were obtained. We use the long-term contributor data (commits, issues, pull requests, ...) in these 47 open source communities as the training data set. We randomly use the long-term contributor data of 80% of the projects in the training data set as the training set and the long-term contributor data of 20% of the projects as the test set. We used GridSearchCV in the scikit-learn library to perform five-fold cross-validation on the training set, using AUC as the evaluation indicator of the long-term contributor churn prediction model to determine the optimal parameters (including the number of iterations and learning rate) of the long-term contributor churn prediction model. Since the magnitude of the monthly data of different long-term contributors varies greatly, and many of the data are not normally distributed, we use the MinMaxScaler function to normalize all monthly data. Then, we trained three models using the XGBoost model to predict whether long-term contributors will churn after 3, 6, and 9 months. The uniqueness of our model lies in the fact that we use a representative and diverse dataset to ensure that the prediction results of the model are widely applicable. At the same time, we introduce innovative five-dimensional features to train the model to enhance the accuracy of the model. Finally, we provide multi-stage and more fine-grained prediction results to facilitate project managers to adopt different intervention measures.

[0093] 5. Multi-stage prediction results We use the model built in step 4 to infer the long-term developer data in the current open source software community obtained in step 3 (and call the predict interface of the XGBoost model in the sklearn library) to obtain the multi-stage and fine-grained (including 3, 6, and 9 months later) prediction results for each long-term contributor in the open source software community (the output result is 0 or 1, if it is 1, it means that it will be transformed into a non-coding long-term contributor after 3 / 6 / 9 months, and if it is 0, it means that it will not), so that project managers can adopt different intervention measures. For example, for the 3-month prediction results, timely measures can be taken to retain contributors who may be lost; for the 6-month and 9-month prediction results, long-term strategic planning can be carried out.

[0094] Through the above steps, we built a long-term contributor churn prediction system based on GitHub data, using diverse and representative datasets and innovative features to ensure that the model has high prediction accuracy and wide applicability.

[0095] E. Regular monitoring Finally, we need to promptly feed back our prediction results to the managers of the open source community. Through GitHubAction, this tool is triggered on a daily basis. The specific method is to create a .github / workflows directory in the GitHub repository and create a YAML file in this directory to define the automated process. Define the GitHub Action workflow that is triggered on a daily basis and use cron syntax to set up scheduled tasks. Execute steps A, B, C, and D, and then use the model trained and built in step D to infer long-term contributors who may be lost after March / June / September. Use the email sending function of GitHubActions or the GitHub API to send notifications to designated managers.

[0096] It should be noted that the purpose of publishing the embodiments is to help further understand the present invention, but those skilled in the art can understand that various substitutions and modifications are possible without departing from the scope of the present invention and the appended claims. Therefore, the present invention should not be limited to the contents disclosed in the embodiments, and the scope of protection claimed by the present invention shall be subject to the scope defined in the claims.

Claims

1. A method for predicting the churn of long-term contributors of open source software based on multi-dimensional features, characterized in that: Construct a long-term contributor status transfer model to predict the loss of long-term contributors by extracting the multi-dimensional features of long-term open source software contributors and constructing a long-term open source software contributor loss prediction model; The steps include: 1) Based on the open source software log data, define the long-term contributors of the open source software repository and build a long-term contributor status transition model; the constructed long-term contributor status transition model includes multiple states of contributors and the transfer methods of each state; 2) Perform data collection and extraction in parallel on the server to obtain long-term contributors to the open source software repository and obtain activity data of all long-term contributors; including controlling the amount of data obtained each time through paging parameters and persisting the obtained data; 3) Obtain effective structured information from the data obtained in step 2) as the characteristics of long-term contributors, including multiple characteristics of five dimensions as the input of the long-term contributor churn prediction model; the five dimensions include: contribution dimension, collaboration dimension, sentiment analysis dimension, interest transfer dimension and affiliation dimension; 4) Build and train a prediction model for the churn of long-term contributors of open source software to obtain trained long-term contributor prediction models of different time granularities; The open source software long-term contributor churn prediction model includes a data interface module, a core enhancer module, an objective function module and an indicator module for evaluating model performance; the data interface module is used to store, process and manage long-term contributor data; the core enhancer module includes a decision tree model and supports multiple objective functions and evaluation indicators, uses training data to build a decision tree model and uses the trained model to predict the predicted data, and provides an interface for training and predicting the constructed long-term contributor churn prediction model; 5) Use the trained prediction models for long-term contributors at different time granularities to predict churn on real-time data, and you can get the churn of long-term contributors at different time granularities; Through the above steps, the prediction of long-term contributor loss of open source software based on multi-dimensional features is achieved.

2. The method for predicting the loss of long-term contributors of open source software based on multi-dimensional features as claimed in claim 1, characterized in that: In step 1), the long-term contributors of the open source software repository refer to the authors whose last code submission time and first code submission time in the open source software project are more than 1 year apart and whose number of code submissions accounts for the top 10% of the repository; when identifying long-term contributors, first obtain the time and author information of each submission in the open source software repository through the GitHub API, control the amount of data obtained each time through the paging parameters of the GitHub API, and concurrently obtain all submission information of the open source software repository through the thread pool; when the number of pages of obtained data reaches a set integer multiple, the obtained data is persisted; and then the long-term contributors of the open source software repository are obtained by calculation.

3. The method for predicting the loss of long-term contributors of open source software based on multi-dimensional features as claimed in claim 1, characterized in that: In the long-term contributor state transfer model constructed in step 1), a contributor refers to a developer who has contributed code at least once in an open source software community or code base; Contributor statuses include: ordinary contributor, long-term contributor, non-coding long-term contributor and lost long-term contributor; among them: non-coding long-term contributor refers to a contributor who was once a long-term contributor but now does not contribute code or no longer contributes code, but may show interest in the project in other ways; lost long-term contributor refers to a contributor who was once a long-term contributor or non-coding long-term contributor, but now not only does not contribute code for a period of time, but also no longer participates in any other activities in the open source software community, that is, a contributor who has left the project; ordinary contributor refers to a contributor who is neither a long-term contributor, a non-coding long-term contributor, nor a lost long-term contributor; when the time interval from the current time to the last code submission time of the long-term contributor exceeds its historical maximum coding interval, that is, the maximum time difference between two consecutive historical code submissions observed at the current time, the long-term contributor does not contribute code or no longer contributes code, and is converted to a non-coding long-term contributor.

4. The method for predicting the loss of long-term contributors of open source software based on multi-dimensional features as claimed in claim 1, characterized in that: Step 2) Extract data to obtain the activity data of all long-term contributors, including: the number of issues submitted, pull requests, submission comments, issue comments, pull request comments, branches, likes, and personal information of all long-term contributors in the open source software repository every month.

5. The method for predicting the loss of long-term contributors of open source software based on multi-dimensional features as claimed in claim 4, characterized in that: In step 3), the characteristics of the contribution dimension include: the number of commits, issues, pull requests, commit comments, issue comments, pull request comments, and the total number of historical commits per month for long-term contributors; The characteristics of the collaboration dimension include: degree centrality, cluster centrality, betweenness centrality, proximity centrality, and eigenvalue centrality in the collaboration network each month; the collaboration network for building an open source software repository is based on contributors as nodes; when there is an intersection between the files submitted by contributors, an undirected edge is connected between the contributors; The characteristics of the sentiment analysis dimension include: the number of positive comments and negative comments by long-term contributors; the characteristics of the sentiment analysis dimension are sentiment analysis of the submission comments, issue comments, and pull request comments of long-term contributors every month through the sentiment model, and the sentiment of the long-term contributor comments obtained includes positive comments, neutral comments, or negative comments; The characteristics of the interest transfer dimension include: the number of branches of long-term contributors in the month, the number of likes of long-term contributors in the month; The affiliation dimension features include: the email suffix of the long-term contributor, which is used to determine whether the long-term contributor is affiliated with a company organization.

6. The method for predicting the churn of long-term contributors of open source software based on multi-dimensional features as claimed in claim 5, characterized in that: Step 4) Specifically, the five-dimensional features extracted from the data of all long-term contributors in multiple open source software repositories are obtained through the GitHub API as training data; the decision tree model specifically uses the XGBoost model to train models of different time granularities. The model is trained through the five-dimensional features, and the objective function uses the cross entropy loss function to predict whether long-term contributors will be lost after different time periods, thereby obtaining prediction results of multiple stages at different time granularities; Objective function of the prediction model It is expressed as: in, is the cross entropy function; is the complexity of the K-th decision tree; n is the number of samples, representing the number of monthly data samples of all long-term contributors; represents the real annotation; Represents the result of the K-th decision tree inference, expressed as: in, is the i-th sample of the input, i.e., the multidimensional feature vector of the long-term contributor; is the inference result of the K-1th decision tree.

7. The method for predicting the churn of long-term contributors of open source software based on multi-dimensional features as claimed in claim 1, characterized in that: In step 2), we use concurrent.futures.ThreadPoolExecutor in Python to manage the thread pool. Each thread is responsible for obtaining the GitHub activity data of a long-term contributor to achieve parallel processing. For comment data, additional since and sort parameters are set to control the starting time for obtaining batches of comments, thereby resolving the paging limitations encountered when obtaining data from the GitHub API. When writing code, use the corresponding API endpoint and query parameters to construct HTTP requests, and parse the returned JSON data to extract the required information.

8. The method for predicting the churn of long-term contributors of open source software based on multi-dimensional features as claimed in claim 1, characterized in that: In step 4), we use the grid search GridSearchCV in the scikit-learn library to optimize hyperparameters. We use an exhaustive search method to traverse predefined hyperparameter combinations. We train the model for each parameter combination and evaluate the model.

9. A system for predicting the loss of long-term contributors of open source software based on multi-dimensional features using the method of claim 1, characterized in that: include: Data layer, feature layer, model layer and monitoring layer; The data layer is used to obtain the commits, issues, pull requests, comments, likes, branches, and user information data of all long-term contributors of the repositories with the highest number of likes and the current system application repository; The feature layer obtains data from the data layer and obtains the features of structured information, including contribution, collaboration, sentiment analysis features, interest transfer features, and affiliation; The model layer is used to train the long-term contributor churn prediction model and obtain the trained long-term contributor churn prediction model after 3 / 6 / 9 months; The monitoring layer is used to infer the churn of long-term contributors in the current source software repository after 3, 6, and 9 months through the trained long-term contributor churn prediction model, and obtain the churned long-term contributors after the corresponding month.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method for predicting the churn of long-term contributors of open source software based on multi-dimensional features as described in claim 1.

Citation Information

Patent Citations

  • Method and system predicting user loss

    CN106529714A

  • Open source project development prediction method and device based on developer collaborative network

    CN115934165A

  • Text-based sentiment classification method and system and electronic equipment

    CN116775877A

  • Cloud computer customer loss early warning method and system in cloud computing industry

    CN117788043A

  • Optimized decision tree based models

    US20150379426A1

Cited By

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

    CN119902745A