Issues association prediction and association type classification method in open source project
By adopting a two-stage method in GitHub, using binary classifiers of explicit and implicit linking features and multi-classifiers of deep semantic features to identify and classify issues, the inefficient management of issues in GitHub is solved. Problem, improving the recommendation accuracy of associated issues.
Patent Information
- Application Number
- CN202411030726.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2025-01-03
AI Technical Summary
In GitHub, it is difficult for the prior art to effectively identify and manage the correlation between issues in large open source projects, especially in the absence of structured methods and data imbalances, resulting in inefficiency in development and complex information processing.
A two-stage method is adopted. First, the binary classifier is trained to predict the correlation between issues by extracting explicit and implicitly linked features, and then the multi-classifier is trained to identify the association type through deep semantic features and interactive graph features to improve the association. Recommended accuracy of issues.
Improves the efficiency and accuracy of issue management, enables a deeper understanding of the correlation between issues, saves computing resources, and is better than existing methods in identifying problem links and type prediction.
Smart Images

Figure CN119249291A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of open source systems, and in particular to a method for predicting associations and classifying association types of issues in an open source project. Background Art
[0002] GitHub has become an indispensable tool in many successful open source collaboration projects. In this ecosystem, the issue management system plays a key role as a central hub where developers can report bugs, request feature enhancements, review project tasks, and more. The issue association system not only facilitates communication between contributors, but also helps to prioritize project development and track task progress. Effective issue management is essential for projects to stay well-organized and ensure that issues are resolved in a timely manner, thereby significantly improving the efficiency of software project development. However, when dealing with large GitHub projects, effectively managing issues brings a series of challenges. For example, a project such as numpy has accumulated more than 10,000 issues, of which nearly 2,000 issues are still unresolved. Issue handlers are often faced with a high workload and need to manually screen each issue, making it more complicated to resolve issues in a timely manner. In addition, issues come from a wide range of sources and may involve a variety of types, including bug fixes, feature enhancement requests, etc., which often results in multiple commits that may involve the same issue or interdependent issues. Identifying the correlation between issues is essential to simplify the management process. This may include grouping related issues so that they can be handled together, identifying connections to previously resolved issues to avoid duplication of work, or assigning issues to people who have experience with similar issues. These measures not only improve the efficiency of issue handling, but also provide a reference for handling related issues. Despite the importance of issue management, GitHub currently lacks sufficient tools to effectively identify the connections between these issues, which is a significant functional shortcoming.
[0003] Therefore, the challenge of identifying connections between issues in GitHub has attracted widespread attention from researchers. For example, related studies have used information retrieval techniques (such as TF-IDF) and deep learning methods (such as word and document embedding) to recommend semantically related issues. However, their methods mainly focus on the similarity of issue texts, usually only confirming the existence of issues without exploring different types of connections in depth. Therefore, a deeper understanding of different types of connections, rather than just their existence, is crucial to obtain more comprehensive information about the issue handling process. In this regard, there are also related methods that have applied deep learning to predict the association of different types of issues, however, their research mainly focuses on issue management within the JIRA system, which is significantly different from GitHub in terms of issue association management. JIRA provides advanced features that allow users to define and manage multiple issue link types. In contrast, GitHub's issue link mechanism is relatively basic. Although GitHub allows describing connections by referencing other issues or using labels in comments and Pull Requests, it lacks a structured approach to specify different types of associations like JIRA. Although GitHub introduced the feature of marking certain issues as "duplicate", it does not support extracting link types directly from issue metadata. Therefore, there are significant differences between JIRA and GitHub in the types of issue associations and their data structures, which affect the accessibility and usability of issue data between the two. This difference has also become a challenge for predicting the types of issue associations in GitHub based on deep learning methods. In addition, there is a significant imbalance in the issue link data within GitHub. There are two main problems. The first is that there is a significant difference between issues with and without marked links. Nearly 90% of the issues in GitHub projects lack marked links. The second is that there is an imbalance in the types of associations between issues. Existing methods and research have found that more than half of the marked links are between issues and the Pull Requests of the bugs they fix. The above challenges highlight the shortcomings of current methods and the urgent need for new methods to effectively identify the connections between issues in GitHub. Summary of the invention
[0004] The present invention provides a method for predicting the association of issues and classifying their association types in an open source project, so as to make up for the deficiencies of the existing methods for predicting the association of issues and classifying their association types, improve the accuracy of recommending associated issues, help developers discover the associations between issues to improve the efficiency of development, and deeply explore the features between associated issues.
[0005] An embodiment of the present invention provides a method for predicting association of issues and classifying association types in an open source project, comprising the following steps:
[0006] S1, issue association prediction stage: used to predict whether there is an association between an issue pair consisting of two issues. First, different data sources related to the issue are collected, and explicit and implicit links between issues and pull request commit message links are extracted. Explicit links are links represented by labels after developers submit issues, implicit links are obtained from the analysis of issue processing history and related information, and links in commit messages are matched from message texts. Then, three different categories of features are extracted to evaluate the correlation between issues. The extracted features are used to train a binary classifier to predict whether there is a link between any two given issues.
[0007] S2, issues association type classification stage: used to further predict the association type of the issue pairs predicted to be associated in the issues association prediction stage. The goal of the current stage is mainly to identify issues without clear links in the issues association prediction stage. By adopting a multi-classifier method, deep semantic features and interaction graph features are extracted to train multi-classifiers for issues with clearly defined link types.
[0008] Optionally, in one embodiment of the present invention, the issues association prediction stage specifically includes the following steps:
[0009] S1.1, first collect raw data from the open source project, including all issues in the project, all comments on the issue, the timeline and detailed HTML page of the event that occurred in the issue, and all commits data of the project. All collected data is stored in JSON files, and each file is named according to the issue number;
[0010] S1.2, extract all potential links between issues, which come from two main sources: the processing flow data of issues and the detailed HTML page of issues; first, traverse all "cross-reference" events recorded in each issue identification timeline to extract "implicit links", then analyze the text content of the issues, use regular expressions to identify the issue number, and then classify the type of links. According to the semantic patterns in the relevant methods, the type of each link is determined by matching the regular expression in the text around the link position. For links whose types cannot be determined, they are classified as "unclear"; through the extraction and matching steps, all implicit links are obtained; if the current issue is a PR, all commits related to the PR will be analyzed in this step, and regular expression rules will be used to detect links and determine the target issue referenced in each commit message. Then, the project's issue file is checked to verify whether the referenced number is related to the actual issue in the project. If not, it will be ignored and the PR commit The link in the message is called "pr_commit_links"; finally, the link is extracted from the "Development" module in the right column of the issue's HTML detail page. The extracted link is manually added and maintained by the developer during the development process, and is called an "explicit link", indicating that the linked issue is a fix for the current issue. Although the explicit link is also recorded in the connection event of the issue timeline, direct parsing from the connection event will not display the link to the current linked issue; all identified links are marked with<s_number,t_number,link_type> Stored in a file, where s_number and t_number represent the numbers of the source issue and the target issue, link_type represents the type of link, and all extracted links are used as positive samples of the training data set;
[0011] S1.3, construct the positive and negative samples required for training the binary classifier. The positive samples are constructed from the established link pairs, directly using the links extracted in step S1.2, while for the negative samples, it is necessary to ensure that the pairs are truly unrelated; using the closed issues, first form pairs from the closed issues, excluding pairs with a creation interval of less than 30 days and more than one year, thereby reducing the possibility of incorrect links; in order to determine the ratio of positive samples to negative samples, analyze the ratio of related issues and non-related issues in actual projects; first calculate the total number of issues NumIssues and the number of links NumLinks identified in the link extraction stage, and then calculate the average number of links AverL = NumLinks / NumIssues. This average number value represents the average number of links for each issue since the start of the project; considering that the start time of the project can be traced back to a period of time, the average number of links in the preset time period is calculated, recorded as AverI, and the data of the preset time period is used. The positive sample ratio is set to PSRate = AverL / AverI, and the negative sample ratio is set to NSRate = 1-PSRate;
[0012] S1.4, then extract features between issue pairs. In the issue association prediction stage, the goal is to effectively identify all potential other related issues related to the issue currently being processed; the input features used to train the classifier are designed to comprehensively measure the relationship between issue pairs, and three types of features are determined: social features, textual features, and temporal features, covering different dimensions of issue relationships;
[0013] S1.5, finally, the binary classifier is trained. The machine learning algorithm XGBoost is used as the main classifier. The loss function is adjusted by modifying the loss weight of each category. When the binary classifier is fully trained, it is used to predict the potential connection between pairs of issues. This process includes extracting issues from the project, pairing the extracted issues with the target issues, and then extracting all relevant features from each pair of issues. The extracted features are used as input to the trained classifier to predict whether there is a connection between the issues. If a link is predicted, the issue pair is sent to the issues association type classification stage to determine the type of link.
[0014] Optionally, in one embodiment of the present invention, the issues association type classification stage specifically includes the following steps:
[0015] S2.1, first perform feature extraction, and enhance the feature set by combining text semantics Text Semantic features and interaction graph features; Text Semantic features use natural language processing technology to deeply analyze issue content, reveal potential meanings and relationships, and determine whether the text in two issues discuss similar problems, solutions or contexts. Interaction Graph features describe the relationship between issues based on interactions in the project ecosystem; Text Semantic features use pre-trained BERT to vectorize the text of the issue title and description, and extract semantic features that have been proven effective in various downstream tasks. Prior to this, the text content was first preprocessed in a standard way, including converting the text to uniform case and removing stop words. All links and digital references that may indicate issue numbers in the text were eliminated in advance to prevent data leakage during model training; When all issue pairs in the project are modeled as interaction graphs, Graph2vec is used to extract features from these graph structures. Each pair of issues is represented as a multidimensional vector, where Graph2vec is an unsupervised neural embedding framework to learn distributed representations of graphs of any size, suitable for various downstream tasks, including graph classification and clustering;
[0016] S2.2, finally, multi-classifier training is performed, using the structural features extracted in the issues association prediction stage and the Text Semantic features and Interaction Graph features extracted in the issues association type classification stage to train multi-classifiers; these three types of features are combined into a one-dimensional vector and input into the input layer of the neural network model for training, which produces a multi-classification output through a hidden layer; SMOTE is used to increase the number of samples of the minority class, and random undersampling is applied to reduce the samples of the majority class, thereby achieving a more balanced dataset.
[0017] The method for predicting associations and classifying association types of issues in an open source project in an embodiment of the present invention, the management of issues in GitHub is crucial for coordinating development work and tracking progress in a project, and determining the connections between issues is crucial for improving the efficiency of resolving issues and ensuring effective project management. In order to strengthen the identification of issue connections and their types, the present invention proposes a new two-stage combined method. In the first stage, a lightweight binary classifier is used to quickly determine whether there is a link between issues. If a link is detected, a multivariate classifier is further used in the second stage to predict the specific type of the link. This method saves computing resources and provides accurate results through rapid filtering and further classification. Through a large number of experiments, the results show that the two-stage method of the present invention is superior to existing methods in predicting the existence of problem connections and reliably identifying connection types, which is of great significance for improving project issues management.
[0018] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0020] Figure 1 A flowchart of a method for predicting associations and classifying association types of issues in an open source project according to an embodiment of the present invention;
[0021] Figure 2 It is the detailed information of the structured features extracted in the present invention for issue association prediction;
[0022] Figure 3 It is an example of graph structure modeling extracted in the present invention for classifying issues association types. DETAILED DESCRIPTION
[0023] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0024] Figure 1 The present invention provides a flowchart of a method for predicting associations and classifying association types of issues in an open source project according to an embodiment of the present invention.
[0025] like Figure 1 As shown, the present invention proposes a method for issue association prediction and association type classification in open source projects, which mainly includes two stages: issue association prediction and issue association type classification. The goal of the first stage is to quickly evaluate whether there is a connection between two issues through a relatively lightweight method, and the goal of the second stage is to further identify the link type between the issue pairs predicted to be linked in the first stage by training the classification model.
[0026] S1, the issue association prediction stage, the goal is to predict whether there is an association between an issue pair consisting of two issues. First, different data sources related to the issue (in GitHub, Pull Request is also recorded as an issue, hereinafter referred to as PR) are collected, such as issue processing event data and detailed information of HTML pages, and then the explicit and implicit links between issues and the commit message link of Pull Request are extracted respectively. Explicit links are links represented by labels used by developers after submitting issues. Implicit links can be obtained from the analysis of issue processing history and other related information, while links in commit messages need to be matched from the message text; next, three different categories of features are extracted to evaluate the correlation between issues. These features are used to train binary classifiers to predict whether there is a link between any two given issues.
[0027] S2, issues association prediction stage: used to further predict the association types of issue pairs predicted to be associated in the issues association prediction stage, such as "duplicate" and "reference". The goal of this stage is mainly to identify issues without clear links in the first stage. In order to effectively predict these link types, a multi-classifier method is adopted to train multiple classifiers for issues with clearly defined link types by extracting deeper semantic features and interaction graph features.
[0028] The prediction objects in the issue association prediction stage are concentrated on open issues. This is because when developers explicitly mention these issue associations through links when submitting or during the development process, this is equivalent to clearly defining the associations between issues. In this case, there is no need to determine whether the associations exist because these associations have been explicitly provided. Therefore, for those issues without explicit associations, the goal of the second stage of the technical solution is to further effectively predict these association types. Specifically, a multi-classifier method is used to first extract deeper semantic features and interaction graph features, and then use issues with defined association types in historical data for training to obtain multi-classifiers for association type prediction between issues of unknown association types.
[0029] Figure 1 This is the overall framework of the invention. The specific process of the issues association prediction stage is as follows:
[0030] S1.1, first use GitHub API to collect raw data from open source projects, including all issues in the project (in GitHub, Pull Request is regarded as an issue), all Comments of the issue (referred to as C), the timeline of events that occurred in the issue (referred to as T) and detailed HTML page (referred to as H), and all Commits data of the project (referred to as M); Comment represents the discussion among developers around the issue, timeline records the process flow of issue handling, and commit is the code change made by developers to the project; all collected data are stored in JSON files, and each file is named according to the issue number.
[0031] S1.2, after collecting the original issues data, continue to build a training dataset, that is, extract all potential links ((Links)) between issues to train the classifier; these links come from two main data sources: the processing flow data of issues (i.e. T) and the detailed HTML page of issues (i.e. H). By analyzing these data to extract all possible links between issues, first traverse all "cross-reference" events recorded in each issue identification timeline to extract "implicit links", then analyze the text content of the issues, use regular expressions to identify the issue number, and then classify the type of links. According to the semantic patterns in the relevant methods, the type of each link is determined by matching the regular expression in the text around the link position. For links whose types cannot be determined, they are classified as "unclear". Through these extraction and matching steps, all implicit links are obtained and some of their types are determined; if the current issue is a PR, all commits related to the PR will be analyzed in this step, and regular expression rules will be used to detect links and determine the target issue referenced in each commit message. Then, the project's issue file will be checked to verify whether the referenced number is related to the actual issue in the project. If not, it will be ignored, because the current focus of the present invention is to discover related issues in the same project. The links in the PR commit message are called "pr_commit_links"; finally, links are extracted from the "Development" module in the right column of the issue's HTML details page. These links are manually added and maintained by developers during the development process; these are called "explicit links", indicating that the linked issue is a fix for the current issue. Although this type of link is also recorded in the connection event of the issue timeline, direct parsing from the connection event will not display the link to the current linked issue; all the links identified above are marked with<s_number,t_number,link_type> Stored in a file, where s_number, t_number represent the source issue and target issue numbers, link_type represents the type of link, and all extracted links are used as positive samples of the training data set. Unlike some related methods, the present invention avoids using simple regular expressions (e.g., #number) to directly match the issue numbers in the title and description, because this method may mistakenly interpret the digital text as the issue number, resulting in inaccurate matching and affecting data quality.
[0032] S1.2.1, first extract text-based "implicit links", that is, link types that link other issues to the current issue through text content (such as titles, descriptions, or comments). The extraction of such links is completed by traversing each issue and identifying all "cross-reference" events recorded in the timeline, and then analyzing the text content of the current issue and using a regular expression to identify the issue number; then the present invention also classifies the types of links in order to construct a model training data set in the second phase of the invention. According to the semantic patterns in the relevant methods, the type of each link is determined by matching the regular expression in the text around the link location. For links whose types cannot be determined, they are classified as "unclear". Through these extraction and matching steps, all implicit links are obtained, and some of their types are determined. These links are<s_number,t_number,link_type> The format is recorded and saved in a file, where s_number and t_number represent the numbers of the source issue and target issue respectively, and link_type represents the type of link.
[0033] S1.2.2, then extract the link of the commit message based on PR. If the current issue is PR, analyze all commits related to PR, and then use regular expression rules to detect links and determine the target issue referenced in each commit message. Then, check the project's issue file to verify whether the referenced number is related to the actual issue in the project; if not, ignore it, because the current focus of the present invention is to find related issues in the same project. The links in the PR commit message are called "pr_commit_links", and these identified links are stored in a file<s_number,t_number> Where s_number and t_number represent the numbers of the source issue and the target issue respectively.
[0034] S1.2.3, finally extract the links from the "Development" module in the right column of the issue's HTML detail page. These links are manually added and maintained by developers during the development process and are called "explicit links". They indicate that the linked issue is a fix for the current issue. Although this type of link is also recorded in the link event of the issue timeline, it is impossible to directly parse the linked issue from this type of event, so it needs to be extracted from the HTML page. All identified links are also marked with<s_number,t_number,link_type> Stored in a file where link_type is uniformly set to "fixed".
[0035] Specifically, firstly, the text-based "implicit links" are extracted. The present invention first traverses each issue I t ∈I, identify all “cross-reference” events recorded in the timeline T, which are link types I that link other issues to the current issue through textual content (such as title, description or comments) t These text-based connections are called "implicit links" (I links ), through these "cross-reference" events to determine which I t ∈I and the problem I being analyzed t Linked and then analyzed I t The text content of the issue is extracted and a regular expression is used to identify the issue number. Next, the invention also classifies the types of links so that the model training data can be processed in the second stage of the invention. According to the semantic pattern in the relevant method, the type of each link is determined by matching the regular expression in the text around the link position, specifically focusing on the 30 characters before and after the link (all matching rules are case-insensitive to maximize accuracy). For links whose types cannot be determined, they are classified as "unclear". Through these extraction and matching steps, all implicit links are obtained and some of their types are determined; these files are in<s_number,t_number,link_type> The format is recorded and saved in a file, where s_number and t_number represent I s and I t The link number, and link_type records the type of link.
[0036] At the same time, if the current issue is a PR, all commits related to the PR will be analyzed in this step, and regular expression rules will be used to detect links and determine the target issue referenced in each commit message. Then, the project's issue file will be checked to verify whether the referenced number is related to the actual issue in the project. If not, it will be ignored. Since the current focus of the present invention is to find related issues in the same project, the links in the PR commitmessage are called "pr_commit_links" (C links ), and stores these identified links in a file<s_number,t_number> In which s_number and t_number represent I s and I t Number.
[0037] Finally, we extract links from the "Development" module in the right column of the issue's HTML detail page. These links are manually added and maintained by developers during the development process. These are called "explicit links" (E links ), indicating that the linked issue is a fix for the current issue. Although this type of link is also recorded in the connection event of the issue timeline, direct parsing from the connection event does not display the link to the current linked issue. All identified links are marked with<s_number,t_number,link_type> Stored in a file where link_type is uniformly set to "fixed".
[0038] All the three types of links extracted from the original data of issues are used as positive samples of the training dataset. links , I links , C links ) can all serve as positive samples of the training dataset, and distinguishing these three types of links is crucial for the second stage of the invention to identify the link type (e.g., "duplicate" or "reference").
[0039] S1.3, construct the positive and negative samples required for training the binary classifier. The positive samples are directly constructed from the three types of links determined in the previous step, directly using the links extracted in the previous step. For negative samples, it is necessary to ensure that the pairs are truly unrelated, and the ratio of positive samples to negative samples must be appropriate. In order to generate reliable negative samples, the present invention uses closed issues because they are unlikely to be linked again in future project development. First, pairs are formed from these closed issues, excluding pairs with a creation interval of less than 30 days (which may be linked) and more than one year (to reduce the inclusion of irrelevant samples). This reduces the possibility of incorrect links; in order to determine the ratio of positive samples to negative samples, the ratio of related issues to non-related issues in the actual project is analyzed in this step; first, the total number of issues (NumIssues) and the number of links identified in the link extraction stage (NumLinks) are calculated, and then the average number of links (AverL = NumLinks / NumIssues) is calculated. This value represents the average number of links for each issue since the start of the project; considering that the start time of the project can be traced back to a period of time, the average number of links in the recent period is also calculated, recorded as AverI. This period of time may be the last month or the last year. In the present invention, we use the data of the last month (actually a parameter that can be flexibly adjusted), and then set the positive sample ratio to PSRate = AverL / AverI, and the negative sample ratio to NSRate = 1-PSRate.
[0040] S1.4, then extract the structured features between the issue pairs. In the first stage of the present invention, the goal is to effectively identify all potential other related issues related to the issue currently being processed. Given the need to evaluate the correlation on a large number of issues, it is crucial to consider the training time of the model and the use of computing resources. Therefore, the feature engineering strategy at this stage prioritizes quality data rather than quantity. Therefore, no neural network model is used at this stage. Although it can autonomously learn features from unstructured data, it requires a lot of training time and computing resources. The input features used to train the classifier are designed to comprehensively measure the connection between the issue pairs. With reference to external literature and related methods, and combined with our own insights, 23 carefully designed features are identified at this stage, which are divided into three categories: Social features, Textual features, and Temporal features. Figure 2 The detailed information of all structured features extracted in this stage is shown, and these categories cover different dimensions of issue connections.
[0041] S1.5, finally, the binary classifier is trained. Selecting a suitable classifier model is crucial to obtaining accurate classification results. In this step, the machine learning algorithm XGBoost is used as the main classifier because it has good robustness in processing unbalanced data sets and is very common in practical application scenarios. In the problem scenario solved by the present invention, positive samples and negative samples are in an unbalanced ratio to better reflect the actual distribution of issue links. In order to solve the challenge of imbalanced category ratios, the present invention adjusts the loss function by modifying the loss weight of each category. Specifically, categories with fewer samples are assigned a larger weight to balance the impact of each category on the model learning process. For example, if the ratio of positive samples to negative samples is 1:9, the loss weights of incorrectly predicted positive samples and negative samples will be set to 9:1 respectively. This weight depends on the specific ratio of positive samples to negative samples in each open source project. When the binary classifier is fully trained, it will be used to predict potential connections between pairs of issues. This process includes extracting issues from the project, pairing them with target issues, and then extracting all relevant features from each pair of issues. These features can be used as input to the trained classifier, which can predict whether there is a connection between issues. If a link is predicted, the issues pair is sent to the second stage to determine the type of link.
[0042] Furthermore, the specific process of the issues association type classification stage is as follows:
[0043] S2.1, first extract the features of the issue pair dataset. The goal of this step is to determine the type of connection between issue pairs. Since it only relies on the structural features of the first stage (i.e., social features, textual features, and temporal features), it often fails to capture the subtle differences between different types of links. This is because although these features can effectively identify potential links, they do not fully analyze the context or nature of these links; social features may indicate shared participants across issues, but do not reveal the details of their interactions. Similarly, textual features can highlight common topics or keywords, but cannot clarify the functional or dependent associations of these topics; to solve this problem, this stage enhances the feature set by combining text semantic features and interaction graph features.
[0044] The extraction of Text Semantic features uses natural language processing technology to deeply analyze the content of the issue and reveal the underlying meanings and relationships. This makes it possible to determine whether the text in two issues discusses similar problems, solutions or contexts, which are crucial for identifying link types such as "duplicate"; the InteractionGraph feature describes the relationship between issues based on the interactions in the project ecosystem, which is crucial for identifying complex links such as "reference"; the Text Semantic feature uses pre-trained BERT to vectorize the text of the issue title and description, and extract semantic features that have been proven effective in various downstream tasks. Prior to this, the text content was preprocessed in a standard way, including converting the text to uniform case and removing stop words. Importantly, all links and digital references that may indicate issue numbers in the text were eliminated in advance to prevent data leakage during model training; in order to better capture the type of link between the two issues, the interaction between the two issues is modeled to create an interaction graph to extract the Interaction Graph feature; Figure 3 This section describes an example of a graph structure that shows the interactive graph structure modeled for issues #92822 and #147623 of the "numpy / numpy" project. This example will be used in detail to explain the entire modeling process. Figure 3 As shown in the figure, the construction of the interaction graph includes four types of entities: issue, commit, file and developer. Developer creates issue and commit. Issue may be associated with multiple commits, and commit may modify multiple files. The modeling method is to first connect the two issues with an edge, then create an edge between each issue and its creator (developer), then identify all commits related to each issue and connect these commits to their respective issues. Each commit is also connected to its creator (developer) and the file it modifies. After all issue pairs in the project are modeled as interaction graphs, Graph2vec can be used to extract features from these graph structures. Each pair of issues is represented as a multi-dimensional vector, where Graph2vec is an unsupervised neural embedding framework that can learn distributed representations of graphs of any size. These embeddings are suitable for various downstream tasks, including graph classification and clustering.
[0045] S2.2, finally, multiple classifiers are trained. In the second stage of the present invention, the structural features extracted in the first stage and the Text Semantic features and Interaction Graph features extracted in the second stage are used to train multiple classifiers; these three types of features are combined into a one-dimensional vector and input into the input layer of the neural network model for training, and this process generates a multi-classification output through a hidden layer; however, during training, since there is a significant imbalance between the types of marked links, in order to solve this problem, the present invention uses SMOTE to increase the number of samples of the minority class, and applies random under-sampling to reduce the samples of the majority class, thereby achieving a more balanced data set.
[0046] S2.1, first extract the features of the issue pairs. The goal of this stage is to determine the type of connection between the issue pairs. Since it only relies on the structural features of the first stage (i.e., social features, textual features, and temporal features), it often fails to capture the subtle differences of different types of links. This is because although these features can effectively identify potential links, they do not fully analyze the context or nature of these links. Social features may indicate shared participants across issues, but do not reveal the details of the connection between them. Similarly, textual features can highlight common topics or keywords, but cannot clarify the functional or dependent associations of these topics. To solve this problem, this stage enhances the feature set by merging text semantic features and interaction graph features.
[0047] S2.1.1, the Text Semantic feature uses advanced natural language processing techniques to deeply analyze the issue content and reveal the underlying meanings and relationships. This makes it possible to capture whether the text in two issues discusses similar problems, solutions, or contexts, which are crucial for identifying link types like "duplicate"; the TextSemantic feature uses pre-trained BERT to vectorize the text of the issue title and description, and extract semantic features that have been proven effective in various downstream tasks. Prior to this, the text content was preprocessed in a standard way, including converting the text to uniform case and removing stop words. Importantly, all links and numerical references that may indicate issue numbers in the text were also eliminated in advance to prevent data leakage during model training.
[0048] S2.1.2, Interaction Graph feature models the relationship between issues based on the interactions in the project ecosystem, which is crucial for identifying complex links such as "reference". In order to better capture the type of link between two issues, the interaction between the two issues is modeled to create an interaction graph, thereby extracting the Interaction Graph feature. Figure 3 This section describes an example of a graph structure that shows the interactive graph structure modeled for issues #92822 and #147623 of the "numpy / numpy" project. This example will be used in detail to explain the entire modeling process. Figure 3 As shown in the figure, the interaction graph includes four types of entities: issue, commit, file, and developer. Developers create issues and commits. Issues may be associated with multiple commits, and commits may modify multiple files. The modeling method is to first connect the two issues with an edge, then create an edge between each issue and its creator (developer), then identify all commits related to each issue and connect these commits to their respective issues. Each commit is also connected to its creator (developer) and the file it modifies. Once all pairs of issues in the project are modeled as interaction graphs, Graph2vec can be used to extract features from these graph structures. Each pair of issues is represented as a multidimensional vector, where Graph2vec is an unsupervised neural embedding framework that can learn distributed representations of graphs of any size. These embeddings are suitable for a variety of downstream tasks, including graph classification and clustering.
[0049] S2.2, finally, multiple classifiers are trained. In the second stage of the present invention, the structural features extracted in the first stage, as well as the Text Semantic features and the Interaction Graph features are used to train the multiple classifiers; these three types of features are combined into a one-dimensional vector and input into the input layer of the neural network model for training, and the process generates a multi-classification output through a hidden layer; however, during training, there is a significant imbalance between the types of labeled links, so in order to solve this problem, the present invention uses SMOTE to increase the number of samples of the minority class, and applies random undersampling to reduce the samples of the majority class, thereby achieving a more balanced data set.
[0050] According to the embodiment of the present invention, the method for predicting the association of issues and classifying the association types in open source projects includes: the method for predicting the association of issues and classifying the association types in open source projects. In the issues association prediction stage, data is collected from the historical data of the open source project to construct a sample set, and structured features are extracted for training a binary classification prediction model; in the issues association type classification stage, graph features are constructed and extracted from the collected data and a multi-classification model is trained in combination with text features to predict the specific association types of the pairs of issues predicted to be associated in the previous module. The present invention divides the prediction of the association relationship between issues into two stages: association prediction and association type classification. The prediction of associated issues and the classification of association relationships are achieved by mining the deep semantic features and graph structure features between issues in combination with structured features, so as to improve the accuracy of the recommendation of associated issues.
[0051] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0052] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "N" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0053] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
Claims
1. A method for predicting associations and classifying association types of issues in open source projects, characterized in that: S1, issue association prediction stage: used to predict whether there is an association between an issue pair consisting of two issues. First, different data sources related to the issue are collected, and explicit and implicit links between issues and PullRequest commit message links are extracted respectively. Explicit links are links represented by labels after developers submit issues, implicit links are obtained from the analysis of issue processing history and related information, and links in commit messages are matched from message texts. Then, three different categories of features are extracted to evaluate the correlation between issues. The extracted features are used to train a binary classifier to predict whether there is a link between any two given issues. S2, issues association type classification stage: used to further predict the association type of the issue pairs predicted to be associated in the issues association prediction stage. The goal of the current stage is mainly to identify issues without clear links in the issues association prediction stage. By adopting a multi-classifier method, deep semantic features and interaction graph features are extracted to train multi-classifiers for issues with clearly defined link types.
2. The method according to claim 1, characterized in that: The issue association prediction stage specifically includes the following steps: S1.1, first collect raw data from the open source project, including all issues in the project, all comments on the issue, the timeline and detailed HTML page of the event that occurred in the issue, and all commits data of the project. All collected data is stored in JSON files, and each file is named according to the issue number; S1.2, extract all potential links between issues, which come from two main sources: the processing flow data of issues and the detailed HTML page of issues; first, traverse all "cross-reference" events recorded in each issue identification timeline to extract "implicit links", then analyze the text content of the issues, use regular expressions to identify the issue number, and then classify the type of links. According to the semantic patterns in the relevant methods, the type of each link is determined by matching the regular expression in the text around the link position. For links whose types cannot be determined, they are classified as "unclear"; through the extraction and matching steps, all implicit links are obtained; if the current issue is a PR, all commits related to the PR will be analyzed in this step, and regular expression rules will be used to detect links and determine the target issue referenced in each commit message. Then, the project's issue file is checked to verify whether the referenced number is related to the actual issue in the project. If not, it will be ignored and the PR commit The link in the message is called "pr_commit_links"; finally, the link is extracted from the "Development" module in the right column of the issue's HTML detail page. The extracted link is manually added and maintained by the developer during the development process, and is called an "explicit link", indicating that the linked issue is a fix for the current issue. Although the explicit link is also recorded in the connection event of the issue timeline, direct parsing from the connection event will not display the link to the current linked issue; all identified links are marked with<s_number,t_number,link_type> Stored in a file, where s_number and t_number represent the numbers of the source issue and the target issue, link_type represents the type of link, and all extracted links are used as positive samples of the training data set; S1.3, construct the positive and negative samples required for training the binary classifier. The positive samples are constructed from the established link pairs, directly using the links extracted in step S1.2, while for the negative samples, it is necessary to ensure that the pairs are truly unrelated; using the closed issues, first form pairs from the closed issues, excluding pairs with a creation interval of less than 30 days and more than one year, thereby reducing the possibility of incorrect links; in order to determine the ratio of positive samples to negative samples, analyze the ratio of related issues and non-related issues in the actual project; first calculate the total number of issues NumIssues and the number of links NumLinks identified in the link extraction stage, and then calculate the average number of links AverL = NumLinks / NumIssues. This average number value represents the average number of links for each issue since the start of the project; considering that the start time of the project can be traced back to a period of time, the average number of links in the preset time period is calculated, recorded as AverI, and the data of the preset time period is used. The positive sample ratio is set to PSRate = AverL / AverI, and the negative sample ratio is set to NSRate = 1-PSRate; S1.4, then extract features between issue pairs. In the issue association prediction stage, the goal is to effectively identify all potential other related issues related to the issue currently being processed; the input features used to train the classifier are designed to comprehensively measure the relationship between issue pairs, and three types of features are determined: social features, textual features, and temporal features, covering different dimensions of issue relationships; S1.5, finally, the binary classifier is trained. The machine learning algorithm XGBoost is used as the main classifier. The loss function is adjusted by modifying the loss weight of each category. When the binary classifier is fully trained, it is used to predict the potential connection between pairs of issues. This process includes extracting issues from the project, pairing the extracted issues with the target issues, and then extracting all relevant features from each pair of issues. The extracted features are used as input to the trained classifier to predict whether there is a connection between the issues. If a link is predicted, the issue pair is sent to the issues association type classification stage to determine the type of link.
3. The method according to claim 1, characterized in that The issue association type classification stage specifically includes the following steps: S2.1, first perform feature extraction, and enhance the feature set by combining text semantics Text Semantic features and interaction graph features; Text Semantic features use natural language processing technology to deeply analyze issue content, reveal potential meanings and relationships, and determine whether the text in two issues discuss similar problems, solutions or contexts. Interaction Graph features describe the relationship between issues based on interactions in the project ecosystem; Text Semantic features use pre-trained BERT to vectorize the text of the issue title and description, and extract semantic features that have been proven effective in various downstream tasks. Prior to this, the text content was first preprocessed in a standard way, including converting the text to uniform case and removing stop words. All links and digital references that may indicate issue numbers in the text were eliminated in advance to prevent data leakage during model training; When all issue pairs in the project are modeled as interaction graphs, Graph2vec is used to extract features from these graph structures. Each pair of issues is represented as a multidimensional vector, where Graph2vec is an unsupervised neural embedding framework to learn distributed representations of graphs of any size, suitable for various downstream tasks, including graph classification and clustering; S2.2, finally, the multi-classifier is trained using the structural features extracted in the issues association prediction stage and the Text Semantic features and Interaction Graph features extracted in the issues association type classification stage; These three types of features are combined into a one-dimensional vector and fed into the input layer of the neural network model for training, which passes through a hidden layer to produce a multi-classification output; SMOTE is used to increase the number of samples of the minority class, and random undersampling is applied to reduce the samples of the majority class, thereby achieving a more balanced dataset.
Citation Information
Patent Citations
Entity linking method based on prompt scoring
CN117272107A
Information processing apparatus, information processing method, and non-transitory computer readable medium
US20240104629A1
Cited By
Creference type analysis method and system based on joint multi-task learning
CN120929984A
