Effective defect report detection method and device, electronic equipment and storage medium
By extracting and integrating the structured and unstructured features of defect reports and using detection and classification models, the problem of low detection efficiency and accuracy of defect reports in the prior art is solved, and more efficient and accurate defect report classification is achieved.
Patent Information
- Application Number
- CN202411465721.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-21
AI Technical Summary
The prior art fails to fully utilize the unstructured information in defect reports in effective defect reports detection, resulting in low classification accuracy and efficiency, and the misclassification problem of repeated defect reports has not been effectively solved.
Feature fusion is performed by extracting structured and unstructured features in defect reports, and using duplicate defect reports detection models and automatic classification models, detect and classify defect reports, redefine and label valid and invalid reports.
It improves the efficiency and accuracy of effective defect report detection, reduces the impact of repeated defect reports on classification results, and ensures the full utilization of each information and the accuracy of subsequent classification.
Smart Images

Figure CN119415428A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent defect detection in software engineering, and in particular relates to an effective defect report detection method, device, electronic equipment and storage medium. Background Art
[0002] A defect report is a document that records detailed information about defects in software products. It has structured specifications that facilitate testers to carry out software activities based on defect reports (such as predicting the severity of defects, assigning corresponding defect solvers, and locating and repairing software defects). When users or testers encounter defects, they write defect reports and upload them to the defect tracking system. Defect reports can cover all basic information about defects, help conduct detailed defect analysis, help developers find the correct direction and method for program debugging, and help avoid the same defects in future versions. The content of software defect reports can be divided into descriptive text and execution information, where the descriptive text includes title, description, and comments. Other feature fields belong to execution information, such as priority, product, status, version, reporter, reporting time, etc. This information plays a big role in the classification of defect reports.
[0003] When system maintenance personnel receive software defect reports, they must first verify the validity of the defect reports, that is, eliminate invalid defect reports, and then assign valid defect reports to relevant developers for repair. Existing research on valid defect report identification extracts manual features or uses text information in titles, descriptions, and some comments to characterize defect reports, but does not fully utilize the unstructured information in defect reports, resulting in low accuracy in the classification of valid defect reports, which in turn leads to low efficiency in the classification of valid defect reports.
[0004] There is a problem of misclassification of some duplicate defect reports in the definition and marking rules of valid defect reports. Their definition of valid and invalid reports is based on the resolution field of each report. The resolution of a defect report can be "DUPLICATE" (i.e., other defects that are the same as those reported in historical reports), "Invalid" (i.e., defects that are not software defects), "WORKSFORME" (i.e., defects that cannot be reproduced), "INCOMPLETE" (i.e., defects that lack necessary information), "FIXED" (i.e., successfully fixed), or "WONTFIX" (i.e., real defects that have not been fixed). Based on this information, defect reports that are resolved as fixed or unfixed are considered valid defect reports, and defect reports that are resolved as duplicates, invalid, working forms, or incomplete are considered invalid defect reports. However, marking defect reports with the resolution field of "DUPLICATE" in defect reports as invalid does not take into account that some of the duplicate defect reports describe the same valid defects as the valid reports. This makes the classification of valid defect reports not always achieve good results. Summary of the invention
[0005] The present invention provides an effective defect report detection method, device, electronic equipment and storage medium, which can improve the efficiency and accuracy of effective defect report detection.
[0006] The valid reports and invalid reports are redefined and marked as follows: the report with the resolution field of "FIXED" or "WONTFIX" in the defect report is regarded as a valid defect report, and the defect report with the resolution field of "INVALID", "WORKSFORME" or "INCOMPLETE" is regarded as an invalid defect report. For duplicate defect reports, that is, defect reports with the resolution field of "DUPLICATE", the duplicate reports that are duplicated with valid reports are marked as valid, and the duplicate reports that are duplicated with invalid reports are marked as invalid.
[0007] To achieve the above object, the present invention provides an effective defect report detection method, comprising:
[0008] Obtaining a defect report, and extracting structured features and unstructured features from the defect report;
[0009] Fusing the structured features and the unstructured features to obtain fused features, inputting the fused features into a duplicate defect report detection model, and using the duplicate defect report detection model to detect whether the defect report is a duplicate defect report;
[0010] If the defect report is a duplicate defect report, then the defect report is an invalid report;
[0011] If the defect report is a non-duplicate defect report, the fused feature is input into an automatic defect report classification model, and the defect report is classified using the automatic defect report classification model to obtain a classification result of whether the defect report is a valid report or an invalid report.
[0012] Optionally, extracting structured features and unstructured features from the defect report includes:
[0013] Identify the structured information field name in the defect report, and extract the information under the field name to obtain the structured information;
[0014] Querying the information description text and the comment text in the defect report, and performing text standardization operation on the information description text and the comment text to obtain the unstructured information;
[0015] Regular expressions are used to extract structured features from the structured information, and unstructured features are extracted after text processing of the unstructured information.
[0016] Optionally, the extracting structured features from the structured information using regular expressions includes:
[0017] A feature extraction rule is written using a regular expression writing rule according to the field name of the structured information, and the structured feature is extracted using the feature extraction rule.
[0018] Optionally, the fusing the structured features and the unstructured features to obtain fused features includes:
[0019] The structured features are structured embedded using one-hot encoding to obtain a structured feature vector;
[0020] The unstructured features are converted into feature vectors using a preset text vector model to obtain unstructured feature vectors;
[0021] The structured feature vector and the unstructured feature vector are concatenated to obtain the fused feature.
[0022] Optionally, the detecting whether the defect report is a duplicate defect report by using a duplicate defect report detection model includes:
[0023] Using the heterogeneous information network in the duplicate defect report detection model to embed the fusion features into nodes, obtaining embedded information;
[0024] Using the bidirectional LSTM network in the duplicate defect report detection model to learn text semantic features in the embedded information;
[0025] The similarity between the defect report and defect reports in a preset defect report set is calculated according to the text semantic features, and whether the defect report is a duplicate defect report is detected according to the similarity.
[0026] Optionally, the defect report automatic classification model includes a multi-head attention network layer, a feedforward neural network layer, a pooling layer and a fully connected layer.
[0027] Optionally, the classifying the defect report by using an automatic defect report classification model includes:
[0028] The received fusion features are processed using a multi-head attention network layer to obtain a fused linear projection;
[0029] Using a feed-forward neural network layer to perform activation processing and normalization processing on the fused linear projection to obtain a fused output;
[0030] Performing pooling processing on the fused output using a pooling layer to obtain a fused pooled output;
[0031] A classification probability of the fusion pooling output is calculated using a fully connected layer, and a defect report classification result of the defect report is determined according to the classification probability.
[0032] In order to solve the above problems, the present invention further provides an effective defect report detection device, the device comprising:
[0033] A feature extraction module, used to obtain a defect report and extract structured features and unstructured features from the defect report;
[0034] A duplicate defect report detection module, used for fusing the structured features and the unstructured features to obtain fused features, inputting the fused features into a duplicate defect report detection model, and using the duplicate defect report detection model to detect whether the defect report is a duplicate defect report;
[0035] The defect report classification module is used to classify the defect report as an invalid report if the defect report is a duplicate defect report; if the defect report is a non-duplicate defect report, the fused feature is input into the defect report automatic classification model, and the defect report is classified using the defect report automatic classification model to obtain a classification result of whether the defect report is a valid report or an invalid report.
[0036] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0037] at least one processor; and,
[0038] a memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the effective defect report detection method described above.
[0040] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned effective defect report detection method.
[0041] The present invention can ensure the integrity of the acquired defect report information by extracting the structured features and unstructured features in the defect report, thereby ensuring that every information in the defect report is fully utilized, thereby ensuring the accuracy of subsequent defect report classification. In addition, the structured features and the unstructured features are feature fused to obtain fused features, and then a duplicate defect report detection model is used to detect whether the defect report is a duplicate defect report. Duplicate defect reports are detected first, which can reduce the impact of duplicate defect reports on the effectiveness classification of defect reports. In addition, the defect report automatic classification model is used to classify the defect report, which can also ensure the classification efficiency of effective defect reports. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of a flow chart of an effective defect report detection method provided by an embodiment of the present invention;
[0043] Figure 2 A specific implementation flow chart of an embodiment of an effective defect report detection method provided by an embodiment of the present invention;
[0044] Figure 3 A functional module diagram of an effective defect report detection device provided by an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of the structure of an electronic device for implementing the effective defect report detection method provided by an embodiment of the present invention.
[0046] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0048] The embodiment of the present application provides an effective defect report detection method. The execution subject of the effective defect report detection method includes but is not limited to at least one of the electronic devices such as the server, the terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the effective defect report detection method can be executed by software or hardware installed on the terminal device or the server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0049] Referring to Table 1, there is a description of the structured features and unstructured features of the effective defect report detection method provided by an embodiment of the present invention.
[0050]
[0051]
[0052] Reference Figure 1 FIG. 1 is a flow chart of an effective defect report detection method provided by an embodiment of the present invention. In this embodiment, the effective defect report detection method includes:
[0053] S1. Obtain a defect report, and extract structured features and unstructured features from the defect report.
[0054] In the embodiment of the present invention, the defect report is a document that records detailed information about defects in a software product. The defect report has structured specifications and can facilitate testers to carry out software activities based on the defect report.
[0055] As an embodiment of the present invention, the extracting structured features and unstructured features from the defect report includes:
[0056] Identify the structured information field name in the defect report, and extract the information under the field name to obtain the structured information;
[0057] Querying the information description text and the comment text in the defect report, and performing text standardization operation on the information description text and the comment text to obtain the unstructured information;
[0058] Regular expressions are used to extract structured features from the structured information, and unstructured features are extracted after text processing of the unstructured information.
[0059] In an embodiment of the present invention, the structured information refers to information in a specific format in a defect report, which has specific field names. For example, the structured information includes but is not limited to BID (bug_id), DID (dup_id), PRO (product), COM (component), VER (version), SEV (severity), PRI (priority), REP (repoter) and ATT (attachment).
[0060] In the embodiment of the present invention, the unstructured information refers to the title text, summary text, and comment text in each defect report.
[0061] In the embodiment of the present invention, the regular expression refers to a tool that can use a specially written character string to perform text matching, and can extract required data or information from complex text.
[0062] Furthermore, the extracting structured features from the structured information using regular expressions includes:
[0063] A feature extraction rule is written using a regular expression writing rule according to the field name of the structured information, and the structured feature is extracted using the feature extraction rule.
[0064] S2. Fusing the structured features and the unstructured features to obtain fused features, inputting the fused features into a duplicate defect report detection model, and using the duplicate defect report detection model to detect whether the defect report is a duplicate defect report.
[0065] As an embodiment of the present invention, the step of fusing the structured feature and the unstructured feature to obtain a fused feature includes:
[0066] The structured features are structured embedded using one-hot encoding to obtain a structured feature vector;
[0067] The unstructured features are converted into feature vectors using a preset text vector model to obtain unstructured feature vectors;
[0068] The structured feature vector and the unstructured feature vector are concatenated to obtain the fused feature.
[0069] Specifically, the detecting whether the defect report is a duplicate defect report by using a duplicate defect report detection model includes:
[0070] Using the heterogeneous information network in the duplicate defect report detection model to embed the fusion features into nodes, obtaining embedded information;
[0071] Using the bidirectional LSTM network in the duplicate defect report detection model to learn text semantic features in the embedded information;
[0072] The similarity between the defect report and defect reports in a preset defect report set is calculated according to the text semantic features, and whether the defect report is a duplicate defect report is detected according to the similarity.
[0073] Specifically, if the similarity with any defect report in the preset defect report set is greater than the preset similarity threshold, the defect report is considered to be a duplicate defect report; if the similarity with all defect reports in the preset defect report set is not greater than the preset similarity threshold, the defect report is considered not to be a duplicate defect report.
[0074] In the embodiment of the present invention, the heterogeneous information network refers to a network composed of different types of nodes and relationships. In a heterogeneous information network, nodes and relationships may have different types and attributes.
[0075] In the embodiment of the present invention, the bidirectional LSTM network refers to a variant of a recurrent neural network, which can effectively capture semantic features in a text sequence.
[0076] In the embodiment of the present invention, the preset defect report set may be historical defect reports or other defect reports to be detected.
[0077] S3. If the defect report is a duplicate defect report, the defect report is an invalid report.
[0078] S4. If the defect report is a non-duplicate defect report, the fused feature is input into an automatic defect report classification model, and the defect report is classified using the automatic defect report classification model to obtain a classification result of whether the defect report is a valid report or an invalid report.
[0079] As an embodiment of the present invention, the automatic defect report classification model includes a multi-head attention network layer, a feedforward neural network layer, a pooling layer and a fully connected layer.
[0080] In the embodiment of the present invention, the automatic defect report classification model refers to a neural network model that can classify defect reports into valid defect reports and invalid defect reports.
[0081] As an embodiment of the present invention, the classifying the defect report by using the defect report automatic classification model includes:
[0082] The received fusion features are processed using a multi-head attention network layer to obtain a fused linear projection;
[0083] Using a feed-forward neural network layer to perform activation processing and normalization processing on the fused linear projection to obtain a fused output;
[0084] Performing pooling processing on the fused output using a pooling layer to obtain a fused pooled output;
[0085] A classification probability of the fusion pooling output is calculated using a fully connected layer, and a defect report classification result of the defect report is determined according to the classification probability.
[0086] Exemplarily, the calculation of the fusion feature using the multi-head attention network layer adopts the following steps:
[0087] Input indicates S i is projected into the Q, K, and V vectors through three individuals and the learned linear projection as follows:
[0088] Q=S i W Q ,K=S i W K ,V=S i W V
[0089] in, d e is the dimension of each vector. The output of the self-attention network is calculated as:
[0090]
[0091] Based on this, we can get the output of the multi-head self-attention network by repeating the calculation h times, and get different linear projections. h is the number of attention heads, and the dimensions of Q, K, and V are represented as d q ,d k and d v , where the dimensions of Q, K, and V are all equal to d e / h. Therefore, the output of the multi-head self-attention network O M The calculation is as follows:
[0092] O M =MultiHead(Q,K,V)=Concat(head 1 ,…,head h )W O
[0093] Concat is a connection operation that connects each self-attention head. j (1≤j≤h), projection head j The calculation formula is as follows:
[0094]
[0095] The multi-head self-attention network is residually connected and then layer normalized, where the output of the normalized layer is O N It can be expressed as:
[0096] O N =LayerNorm(inputs+O M )
[0097] Furthermore, the fused linear projection is activated and normalized using a feedforward neural network layer, as shown in the following steps:
[0098] The output value O of the feedforward neural network layer F The calculation method is as follows:
[0099] O F =ReLU(O N W 1 )W 2 +b 2
[0100] Among them, b 2 is a constant, the parameter matrix Finally, a normalization layer is used to calculate the outputs:
[0101] outputs = LayerNorm(O F +O F )
[0102] In the embodiment of the present invention, the pooling operation in the pooling layer adopts global average pooling, and the steps of the pooling operation are as follows:
[0103] Global average pooling is used for calculation. For the output z i =[z 1 ,z 2 ,…,z n ], the calculation formula is as follows:
[0104]
[0105] Among them, G is the vector after global average pooling.
[0106] Exemplarily, the classification probability of the fusion pooling output is calculated using a fully connected layer, using the following steps:
[0107] The vector obtained by concatenating the global average pooling layer is G = [g 1 ,g 2 ,...,g k ];
[0108] According to the vector after the global average pooling, the linear classifier and the Sigmoid activation function in the fully connected layer are used to perform classification prediction, wherein the classification prediction can be calculated using the following formula:
[0109]
[0110] Among them, y predict is the classification prediction result, w i is the weight vector and b is the bias parameter.
[0111] The embodiment of the present invention can ensure the integrity of the acquired defect report information by extracting the structured features and unstructured features in the defect report, thereby ensuring that each information in the defect report is fully utilized, thereby ensuring the accuracy of subsequent defect report classification. In addition, the structured features and the unstructured features are fused to obtain fused features, and then a duplicate defect report detection model is used to detect whether the defect report is a duplicate defect report, wherein duplicate defect reports are detected first, which can reduce the impact of duplicate defect reports on the effectiveness classification of defect reports. In addition, the defect report automatic classification model is used to classify the defect report, which can also ensure the classification efficiency of effective defect reports.
[0112] As shown in Table 2, the experimental results of the effective defect report detection method in the present invention - BugVal are compared with the CNN-based method in the prior art.
[0113] Table 2
[0114]
[0115] The above table shows the comparison of the experimental results of the effective bug report detection method of the present invention - BugVal and the CNN_based method. On the Eclipse dataset, the method of the present invention improved the benchmark by 8.8% and 8.9% in AUC and F1_score, respectively. On the Mozilla dataset, the method of the present invention improved by 10.9% and 7.1% in AUC and F1_score, respectively. On the Netbeans dataset, the method of the present invention improved by 24.0% and 13.9% in AUC and F1_score, respectively. On average, in the five projects, the method of the present invention achieved 96.3% and 94.1% in AUC and F1_score, respectively. Compared with the baseline, AUC, F1, and F1 increased by 14.1% and 9.9%, respectively. This shows that the method of the present invention has a high performance in predicting accurate method names and can correctly detect effective bug reports.
[0116] As shown in Table 3, this is the impact of structured features on the Eclipses dataset on the performance of BugVal, an effective defect report detection method in the present invention.
[0117] Table 3
[0118] AUC% Accuracy% Precision% Recall% F1_score % TFVBRD 95.1 91.1 93.2 95.7 94.4 w\o-PRO 93.9 90.3 92.7 94.2 92.9 w\o-COM 93.7 90.4 92.4 94.6 93.1 w\o-VER 94.9 91.0 93.1 95.3 94.2 w\o-SEV 95.0 90.5 93.0 95.7 94.3 w\o-PRI 95.0 90.9 92.9 94.2 94.0 w\o-REP 94.0 90.3 92.6 94.5 93.0 w\o-ATT 93.6 89.9 91.5 94.2 92.6 <![CDATA[BugVal stru ]]> 66.9 53.6 75.6 65.1 61.4 <![CDATA[BugVal text ]]> 92.7 88.3 92.3 93.2 92.4
[0119] The above table shows that w\o-PRO means removing the PRO structural feature and using the other six structural features combined with text features to represent the bug report (the same applies to w\o-COM, w\o-VER, w\o-SEV, w\o-PRI, w\o-REP and w\o-ATT). stru Indicates that only structural features are used to represent the bug report, BugVal text Indicates that only unstructured features, i.e. text, are used to represent the bug report. Experimental results show that the overall performance of the model will decrease to varying degrees after removing a single structured feature. Among them, the model performance after removing the REP feature, i.e. w\o-REP, decreases the most, with AUC, Recall, and F1_score decreasing by 1.1%, 1.2%, and 1.4%, respectively. When all structured features are removed and only text features are used, BugVal text The performance of the model is worse than that of any model without a single structural feature. Compared with the original BugVal model, BugVal text The AUC, Accuracy, and Recall decreased by 2.4%, 2.8%, and 2.0%, respectively. This shows that structured information is complementary to the text description in the report. Each of the seven structured features, PRO, COM, VER, SEV, PRI, REP, and ATT, is very important for enriching the information representation of the bug report. When all structured features are combined with unstructured text features, the bug report can be better characterized, making the model more effective. In the comparative experiment using structured features alone and unstructured text features alone, the experimental results show that using text features alone (BugVal text ) will be less effective, but using only all structural features without using text features (BugVal stru ) has the worst effect, with AUC and Recall decreasing by 28.2% and 30.6% respectively. This shows that using only structured features cannot characterize defect reports well.
[0120] As shown in Table 4, this is the impact of the duplicate defect report pre-classification module on the performance of BugVal, an effective defect report detection method in the present invention, on the Eclipses dataset.
[0121] Table 4
[0122] AUC% Accuracy% Precision% Recall% F1_score % BugVal 95.1 91.1 93.2 95.7 94.4 w\o-DBRP 88.7 85.4 81.1 93.2 90.5
[0123] The above table shows that w\o-DBRP removes the duplicate defect report pre-classification module, and marks the duplicate defect report with the resolution field "DUPLICATE" as an invalid report according to the previous labeling method of valid and invalid defect reports. Then the defect report representation obtained by combining the structured and unstructured features in the first stage is directly used as the input of TransformerEncode, and deep feature learning is performed in the second stage to predict the validity of the report. The experimental results show that the performance of the w\o-DBRP model has declined compared to the original BugVal, with a decrease of 6.4%, 5.7%, 12.1% and 3.9% in AUC, Accuracy, Precision, and F1_score respectively. This shows that it is important to mark and classify whether the duplicate defect report is a valid report. If all duplicate defect reports are marked as invalid reports, the deep learning model may be misled by incorrect feedback when learning defect report features, resulting in a decrease in model effect.
[0124] like Figure 2 As shown, it is a specific implementation flow chart of an embodiment of an effective defect report detection method provided by an embodiment of the present invention.
[0125] like Figure 3 , is a functional module diagram of an effective defect report detection device provided by an embodiment of the present invention.
[0126] The effective defect report detection device 100 of the present invention can be installed in an electronic device. According to the implemented functions, the effective defect report detection device 100 can include a feature extraction module 101, a duplicate defect report detection module 102 and a defect report classification module 103.
[0127] The module described in the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and is stored in a memory of the electronic device.
[0128] In this embodiment, the functions of each module / unit are as follows:
[0129] The feature extraction module 101 is used to obtain a defect report and extract structured features and unstructured features from the defect report.
[0130] In the embodiment of the present invention, the defect report is a document that records detailed information about defects in a software product. The defect report has structured specifications and can facilitate testers to carry out software activities based on the defect report.
[0131] As an embodiment of the present invention, the extracting structured features and unstructured features from the defect report includes:
[0132] Identify the structured information field name in the defect report, and extract the information under the field name to obtain the structured information;
[0133] Querying the information description text and the comment text in the defect report, and performing text standardization operation on the information description text and the comment text to obtain the unstructured information;
[0134] Regular expressions are used to extract structured features from the structured information, and unstructured features are extracted after text processing of the unstructured information.
[0135] In an embodiment of the present invention, the structured information refers to information in a specific format in a defect report, which has specific field names. For example, the structured information includes but is not limited to BID (bug_id), DID (dup_id), PRO (product), COM (component), VER (version), SEV (severity), PRI (priority), REP (repoter) and ATT (attachment).
[0136] In the embodiment of the present invention, the unstructured information refers to the title text, summary text, and comment text in each defect report.
[0137] In the embodiment of the present invention, the regular expression refers to a tool that can use a specially written character string to perform text matching, and can extract required data or information from complex text.
[0138] Furthermore, the extracting structured features from the structured information using regular expressions includes:
[0139] A feature extraction rule is written using a regular expression writing rule according to the field name of the structured information, and the structured feature is extracted using the feature extraction rule.
[0140] The duplicate defect report detection module 102 is used to perform feature fusion on the structured features and the unstructured features to obtain fused features, input the fused features into a duplicate defect report detection model, and use the duplicate defect report detection model to detect whether the defect report is a duplicate defect report.
[0141] As an embodiment of the present invention, the step of fusing the structured feature and the unstructured feature to obtain a fused feature includes:
[0142] The structured features are structured embedded using one-hot encoding to obtain a structured feature vector;
[0143] The unstructured features are converted into feature vectors using a preset text vector model to obtain unstructured feature vectors;
[0144] The structured feature vector and the unstructured feature vector are concatenated to obtain the fused feature.
[0145] Specifically, the detecting whether the defect report is a duplicate defect report by using a duplicate defect report detection model includes:
[0146] Using the heterogeneous information network in the duplicate defect report detection model to embed the fusion features into nodes, obtaining embedded information;
[0147] Using the bidirectional LSTM network in the duplicate defect report detection model to learn text semantic features in the embedded information;
[0148] The similarity between the defect report and defect reports in a preset defect report set is calculated according to the text semantic features, and whether the defect report is a duplicate defect report is detected according to the similarity.
[0149] Specifically, if the similarity with any defect report in the preset defect report set is greater than the preset similarity threshold, the defect report is considered to be a duplicate defect report; if the similarity with all defect reports in the preset defect report set is not greater than the preset similarity threshold, the defect report is considered not to be a duplicate defect report.
[0150] In the embodiment of the present invention, the heterogeneous information network refers to a network composed of different types of nodes and relationships. In a heterogeneous information network, nodes and relationships may have different types and attributes.
[0151] In the embodiment of the present invention, the bidirectional LSTM network refers to a variant of a recurrent neural network, which can effectively capture semantic features in a text sequence.
[0152] In the embodiment of the present invention, the preset defect report set may be historical defect reports or other defect reports to be detected.
[0153] The defect report classification module 103 is used to, if the defect report is a duplicate defect report, then the defect report is an invalid report; if the defect report is a non-duplicate defect report, then the fusion feature is input into the defect report automatic classification model, and the defect report is classified using the defect report automatic classification model to obtain a classification result of whether the defect report is a valid report or an invalid report.
[0154] If the defect report is a duplicate defect report, the defect report is an invalid report.
[0155] As an embodiment of the present invention, the automatic defect report classification model includes a multi-head attention network layer, a feedforward neural network layer, a pooling layer and a fully connected layer.
[0156] In the embodiment of the present invention, the automatic defect report classification model refers to a neural network model that can classify defect reports into valid reports and invalid reports.
[0157] As an embodiment of the present invention, the classifying the defect report by using the defect report automatic classification model includes:
[0158] The received fusion features are processed using a multi-head attention network layer to obtain a fused linear projection;
[0159] Using a feed-forward neural network layer to perform activation processing and normalization processing on the fused linear projection to obtain a fused output;
[0160] Performing pooling processing on the fused output using a pooling layer to obtain a fused pooled output;
[0161] A classification probability of the fusion pooling output is calculated using a fully connected layer, and a defect report classification result of the defect report is determined according to the classification probability.
[0162] Exemplarily, the calculation of the fusion feature using the multi-head attention network layer adopts the following steps:
[0163] Input indicates S i is projected into the Q, K, and V vectors through three individuals and the learned linear projection as follows:
[0164] Q=S i W Q ,K=S i W K ,V=S i W V
[0165] in, d e is the dimension of each vector. The output of the self-attention network is calculated as:
[0166]
[0167] Based on this, we can get the output of the multi-head self-attention network by repeating the calculation h times, and get different linear projections. h is the number of attention heads, and the dimensions of Q, K, and V are represented as d q ,d k and d v, where the dimensions of Q, K, and V are all equal to d e / h. Therefore, the output of the multi-head self-attention network O M The calculation is as follows:
[0168] O M =MultiHead(Q,K,V)=Concat(head 1 ,…,head h )W O
[0169] Concat is a connection operation that connects each self-attention head. j (1≤j≤h), projection head j The calculation formula is as follows:
[0170]
[0171] The multi-head self-attention network is residually connected and then layer normalized, where the output of the normalized layer is O N It can be expressed as:
[0172] O N =LayerNorm(inputs+O M )
[0173] Furthermore, the fused linear projection is activated and normalized using a feedforward neural network layer, as shown in the following steps:
[0174] The output value O of the feedforward neural network layer F The calculation method is as follows:
[0175] O F =ReLU(O N W 1 )W 2 +b 2
[0176] Among them, b 2 is a constant, the parameter matrix Finally, a normalization layer is used to calculate the outputs:
[0177] outputs = LayerNorm(O N +O F )
[0178] In the embodiment of the present invention, the pooling operation in the pooling layer adopts global average pooling, and the steps of the pooling operation are as follows:
[0179] Global average pooling is used for calculation. For the output zi =[z 1 ,z 2 ,…,z n ], the calculation formula is as follows:
[0180]
[0181] Among them, G is the vector after global average pooling.
[0182] Exemplarily, the classification probability of the fusion pooling output is calculated using a fully connected layer, using the following steps:
[0183] The vector obtained by concatenating the global average pooling layer is G = [g 1 ,g 2 ,...,g k ];
[0184] According to the vector after the global average pooling, the linear classifier and the Sigmoid activation function in the fully connected layer are used to perform classification prediction, wherein the classification prediction can be calculated using the following formula:
[0185]
[0186] Among them, y predict is the classification prediction result, w i is the weight vector and b is the bias parameter.
[0187] like Figure 4 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing an effective defect report detection method provided by an embodiment of the present invention.
[0188] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an effective defect reporting detection method program.
[0189] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a valid defect report detection method program, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0190] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of an effective defect report detection method program, etc., but also can be used to temporarily store data that has been output or is to be output.
[0191] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0192] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0193] Figure 4 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 4 The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0194] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0195] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0196] The memory 11 in the electronic device stores an effective defect report detection method program which is a combination of multiple instructions. When running in the processor 10, the following can be achieved:
[0197] Obtaining a defect report, and extracting structured features and unstructured features from the defect report;
[0198] Fusing the structured features and the unstructured features to obtain fused features, inputting the fused features into a duplicate defect report detection model, and using the duplicate defect report detection model to detect whether the defect report is a duplicate defect report;
[0199] If the defect report is a duplicate defect report, then the defect report is an invalid report;
[0200] If the defect report is a non-duplicate defect report, the fused feature is input into an automatic defect report classification model, and the defect report is classified using the automatic defect report classification model to obtain a classification result of whether the defect report is a valid report or an invalid report.
[0201] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0202] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0203] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0204] Obtaining a defect report, and extracting structured features and unstructured features from the defect report;
[0205] Fusing the structured features and the unstructured features to obtain fused features, inputting the fused features into a duplicate defect report detection model, and using the duplicate defect report detection model to detect whether the defect report is a duplicate defect report;
[0206] If the defect report is a duplicate defect report, then the defect report is an invalid report;
[0207] If the defect report is a non-duplicate defect report, the fused feature is input into an automatic defect report classification model, and the defect report is classified using the automatic defect report classification model to obtain a classification result of whether the defect report is a valid report or an invalid report.
[0208] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0209] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0210] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0211] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0212] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0213] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0214] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0215] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0216] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. An effective defect report detection method, characterized in that: The method comprises: Obtaining a defect report, and extracting structured features and unstructured features from the defect report; Fusing the structured features and the unstructured features to obtain fused features, and inputting the fused features into a duplicate defect report detection model, and using the duplicate defect report detection model to detect whether the defect report is a duplicate defect report; If the defect report is a duplicate defect report, then the defect report is an invalid report; If the defect report is a non-duplicate defect report, the fused feature is input into an automatic defect report classification model, and the defect report is classified using the automatic defect report classification model to obtain a classification result of whether the defect report is a valid report or an invalid report.
2. The effective defect report detection method according to claim 1, characterized in that: The extracting of the structured features and the unstructured features from the defect report includes: identifying the name of the structured information field in the defect report, and extracting the information under the field name to obtain the structured information; Querying the information description text and the comment text in the defect report, and performing text standardization operation on the information description text and the comment text to obtain the unstructured information; Regular expressions are used to extract structured features from the structured information, and unstructured features are extracted after text processing of the unstructured information.
3. The effective defect report detection method according to claim 2, characterized in that: The extracting structured features from the structured information using regular expressions includes: A feature extraction rule is written using a regular expression writing rule according to the field name of the structured information, and the structured feature is extracted using the feature extraction rule.
4. The effective defect report detection method according to claim 1, characterized in that: The step of fusing the structured features and the unstructured features to obtain fused features includes: The structured features are structured embedded using one-hot encoding to obtain a structured feature vector; The unstructured features are converted into feature vectors using a preset text vector model to obtain unstructured feature vectors; The structured feature vector and the unstructured feature vector are concatenated to obtain the fused feature.
5. The effective defect report detection method according to claim 1, characterized in that: The detecting whether the defect report is a duplicate defect report by using a duplicate defect report detection model includes: Using the heterogeneous information network in the duplicate defect report detection model, the fusion feature is embedded into nodes to obtain embedded information; Using the bidirectional LSTM network in the duplicate defect report detection model to learn the text semantic features in the embedded information; The similarity between the defect report and defect reports in a preset defect report set is calculated according to the text semantic features, and whether the defect report is a duplicate defect report is detected according to the similarity.
6. The effective defect report detection method according to any one of claims 1 to 5, characterized in that: The defect report automatic classification model includes a multi-head attention network layer, a feedforward neural network layer, a pooling layer and a fully connected layer.
7. The effective defect report detection method according to claim 6, characterized in that: The classifying the defect report by using the defect report automatic classification model includes: The received fusion features are processed using a multi-head attention network layer to obtain a fused linear projection; Using a feed-forward neural network layer to perform activation processing and normalization processing on the fused linear projection to obtain a fused output; Performing pooling processing on the fused output using a pooling layer to obtain a fused pooled output; A classification probability of the fusion pooling output is calculated using a fully connected layer, and a defect report classification result of the defect report is determined according to the classification probability.
8. An effective defect report detection device, characterized in that: The device can implement the effective defect report detection method according to any one of claims 1 to 7, and the device includes: A feature extraction module, used to obtain a defect report and extract structured features and unstructured features from the defect report; A duplicate defect report detection module, used for fusing the structured features and the unstructured features to obtain fused features, inputting the fused features into a duplicate defect report detection model, and using the duplicate defect report detection model to detect whether the defect report is a duplicate defect report; The defect report classification module is used to classify the defect report as an invalid report if the defect report is a duplicate defect report; if the defect report is a non-duplicate defect report, the fused feature is input into the defect report automatic classification model, and the defect report is classified using the defect report automatic classification model to obtain a classification result of whether the defect report is a valid report or an invalid report.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the effective defect report detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the effective defect report detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Automatic classification method of defect reports based on semantic model
CN108804558A
Repeated defect report detection method based on heterogeneous information network
CN111737107A
Software defect positioning method based on similarity integration
CN112000802A
Personalized paper recommendation method and system based on heterogeneous graph dynamic information compensation
CN114610989A
Text retrieval method based on self-adaptive triple update
CN116415007A