Function point extraction and processing method and system
The automatic extraction model constructed by self-built knowledge base and Bert-BiLSTM-CRF algorithm solves the problem of missing function points in existing technologies, realizes efficient and accurate extraction and expansion of function points, and improves the efficiency and accuracy of automatic extraction.
Patent Information
- Application Number
- CN202310540554.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2043-05-15
AI Technical Summary
Both manual and automatic function point extraction methods in the existing technology have the problem of missing function points, and the automatic extraction method is limited by the model capabilities and cannot effectively expand and improve the efficiency of function point extraction.
By building a self-built knowledge base, using the KMP algorithm to extract function points, and combining the Bert-BiLSTM-CRF algorithm to build an automatic extraction model, optimizing model parameters, using a pre-trained machine learning model to perform string matching and classification of function points, and building a function point knowledge graph for expansion.
It improves the accuracy and efficiency of function point extraction, can more comprehensively extract function points not included in the knowledge base, reduces the time complexity of text matching, and realizes the rapid and effective automatic extraction and expansion of function points.
Smart Images

Figure CN116775954B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software analysis, and in particular to a function point extraction and processing method and system. Background Art
[0002] Function point analysis is a method used to measure software costs. Function points generally refer to the five types of function points used in the function point analysis method. Currently, they are typically extracted manually by experts. However, in recent years, some automated function point extraction technologies have emerged that can automatically extract function points from requirements analysis documents. However, for function points implicitly described in requirements analysis documents, both manual extraction by experts and existing automated extraction methods often miss function points. Furthermore, existing automated extraction methods also suffer from missing function points due to limitations in model capabilities. Furthermore, there is still considerable room for improvement in how to more effectively improve and expand the automated extraction of function points.
[0003] Therefore, it is necessary to provide a function point extraction processing method to solve the above problems. Summary of the Invention
[0004] The present invention aims to provide a method and system for function point extraction and processing to solve the problem of missing function points in both the existing manual extraction methods and the automatic extraction methods in the prior art, and to solve the technical problems of how to more effectively improve the automatic extraction of function points, expand function points, etc. The technical problems to be solved by the present invention are achieved through the following technical solutions.
[0005] The first aspect of the present invention proposes a function point extraction and processing method, comprising: collecting demand analysis texts, software design texts and system design texts available from public channels to obtain a data set, annotating the sample data in the data set with function points, and establishing a knowledge base; based on the established knowledge base, using the KMP algorithm, performing string matching between the function points in the knowledge base and the text to be processed to extract the function points contained in the text to be processed and determine the category labels of the function points; using a pre-built automatic extraction model to automatically extract function points from the text to be processed, inputting the text to be processed into the automatic extraction model, and outputting the function points contained in the text to be processed and the category to which each function point belongs; wherein, based on the Bert-BiLSTM-CRF algorithm, an automatic extraction model is constructed; in the process of constructing the automatic extraction model, the model parameters are optimized multiple times; the function points extracted based on the knowledge base and the function points extracted using the automatic extraction model are ranked, evaluated and calculated to screen the function points.
[0006] According to an optional implementation, the automatic extraction model is constructed based on the Bert-BiLSTM-CRF algorithm, including: constructing a Bert layer, a BiLSTM layer and a CRF layer to construct the automatic extraction model; determining the dimension of the word vector to be generated according to the length n of the sample data in the training set, specifically inputting the sample data with a length of n into the Bert layer to generate a first vector with a dimension of n*specific value, where the range of n is greater than 0 and less than or equal to 512, and the range of the specific value is greater than 700 and less than or equal to 800; inputting the first vector into the BiLSTM layer to establish a contextual connection between the n vectors to obtain sequence semantic information corresponding to the text to be processed; inputting the sequence semantic information obtained by the BiLSTM layer into the CRF layer to output the function points contained in the sample data and the function point category to which each function point belongs.
[0007] According to an optional implementation, a function point label set is established, and based on the function point label set, a specified proportion of sample data in the data set is annotated with function points to obtain a first data set, and the remaining sample data in the data set is used to generate pseudo labels to obtain a second data set. The function point label set includes the following function point labels: a first category label represented by ILF, a second category label represented by EIF, a third category label represented by EI, a fourth category label represented by EO, and a fifth category label represented by EQ.
[0008] According to an optional implementation, the demand analysis text in the data set is divided into a training set, a validation set and a test set according to a specific ratio; the initial training round and the retraining round are determined according to the number of the first data set and the number of the second data set; according to the determined initial training round, the automatic extraction model is trained using the training set to obtain a preliminary automatic extraction model; according to the determined retraining round, the preliminary automatic extraction model is additionally trained using the second data set.
[0009] According to an optional implementation method, the model parameters are optimized during multiple model validation processes, specifically including updating the initial training rounds and retraining rounds according to the changes in accuracy and loss values during the training process; the model parameters are optimized during the model testing process, specifically including updating the retraining rounds according to the changes in accuracy and loss values during the retraining process.
[0010] According to an optional implementation, the KMP algorithm is used to perform string matching on the function points in the knowledge base and the text to be processed to extract the function points contained in the text to be processed, including: determining the string length of the function points and the text sentences containing the function points in the knowledge base, representing them using a pattern string, and constructing a next array; determining the string length of the text to be processed and representing it using a text string; performing string matching on each pattern string in the knowledge base with the text string of the text to be processed one by one, determining the position where the match failed for determining the starting position of the next match; when the pattern string in the knowledge base successfully matches the text string of the text to be processed, extracting the corresponding function points in the text to be processed.
[0011] According to an optional implementation, the function points extracted based on the knowledge base and the function points extracted using the automatic extraction model are sorted and evaluated to screen the function points, including: using the credibility of the function points, performing vector conversion on the function points extracted based on the knowledge base and the function points extracted using the automatic extraction model, inputting a pre-trained machine learning model, and outputting a credibility evaluation value; sorting each function point according to the output credibility evaluation value to screen out function points whose credibility evaluation value is greater than a specified value.
[0012] According to an optional implementation method, knowledge extraction and knowledge relationship extraction are performed on the function points and category labels extracted based on the knowledge base, and the function points and their categories extracted using the automatic extraction model to form function point triplets to construct a function point knowledge graph; wherein, knowledge relationship extraction is performed based on the intrinsic connection between the function points representing different types and different operations in the text to be processed, and the following multiple relationships are obtained to represent the unidirectional or bidirectional edges between adjacent entity nodes in the function point knowledge graph: dependency relationship, inheritance relationship, aggregation relationship, action relationship, generalization relationship, synonym relationship, trigger relationship, parallel relationship, interaction relationship, and coexistence relationship.
[0013] According to an optional implementation manner, function point expansion is performed based on the constructed function point knowledge graph.
[0014] The second aspect of the present application provides a function point extraction processing system, which adopts the function point extraction processing method of the first aspect of the present application, and comprises: a building module, which collects demand analysis texts, software design texts and system design texts available through public channels to obtain a data set, labels sample data in the data set with function points, and builds a knowledge base; a first extraction module, which uses the KMP algorithm to perform string matching between function points in the knowledge base and a to-be-processed text according to the built knowledge base, so as to extract function points contained in the to-be-processed text and determine the category labels of the function points; and a second extraction module, which uses a pre-built automatic extraction model to perform automatic extraction of function points from the to-be-processed text, inputs the to-be-processed text into the automatic extraction model, and outputs function points contained in the to-be-processed text and categories to which the function points belong; wherein the automatic extraction model is built based on the Bert-BiLSTM-CRF algorithm; in the process of building the automatic extraction model, model parameters are optimized multiple times; and a screening module, which is configured to sort, evaluate and calculate function points extracted based on the knowledge base and function points extracted using the automatic extraction model, so as to screen function points.
[0015] The third aspect of the present application provides an electronic device, comprising: one or more processors; a storage device configured to store one or more programs; and when the one or more programs are executed by the one or more processors, the one or more processors implement the method of the first aspect of the present application.
[0016] The fourth aspect of the present application provides a computer readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method of the first aspect of the present application.
[0017] The embodiments of the present application have the following advantages:
[0018] Compared with the prior art, the present application can more accurately match and extract function points in a to-be-processed text by building a knowledge base, using the KMP algorithm to extract function points based on the built knowledge base, reducing the string matching time complexity to linear time complexity, effectively reducing the time complexity in the text matching process, thereby effectively improving the text matching efficiency, and improving the accuracy of function point extraction; by using the automatic extraction model built based on the Bert-BiLSTM-CRF algorithm to extract function points, the function points can be more comprehensively extracted, the automatic extraction process of the function points can be more quickly and effectively implemented, and function points not in the knowledge base can be effectively extracted.
[0019] By knowledge extraction and knowledge relationship extraction on the existing function point analysis text, a function point triple is formed to construct a function point knowledge graph, so that a more accurate function point knowledge graph containing function point triples can be obtained; when receiving a to-be-processed text, the contained function points are identified, it is determined whether the identified function points are search keywords to determine whether to perform the step of traversing the relationship path between the directed entity nodes in the function point knowledge graph, and in the process of traversing the function point knowledge graph, a knowledge graph node queue is established, and then according to the established knowledge graph node queue, function point expansion is performed, so that the automatic expansion process of the function points can be more quickly and effectively realized, and the problem of missing function points can be effectively avoided.
[0020] In addition, based on the BFS search algorithm, all reachable entity nodes are searched, and by determining and updating the parameters in real time, the entity nodes in the knowledge graph node queue are updated, so that a knowledge graph node queue with higher credibility can be obtained, and the method can be further optimized. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 is a flowchart of an example of the function point extraction processing method of the present application;
[0022] Figure 2 is a technical framework diagram of the function point extraction processing method of the present application;
[0023] Figure 3 is a schematic diagram of an example of establishing a function point label set in the function point extraction processing method of the present application;
[0024] Figure 4 is a schematic diagram of an example of using the KMP algorithm for function point extraction based on the self-built knowledge base in the function point extraction processing method of the present application;
[0025] Figure 5 is Figure 4 a schematic diagram of an example of string matching between the to-be-matched string (i.e. the text string of the requirement analysis text) and the template string in the knowledge base;
[0026] Figure 6 is a structural block diagram of using an automatic extraction model for function point extraction in the function point extraction processing method according to the present application;
[0027] Figure 7 is a principle schematic diagram of the automatic extraction model in the function point extraction processing method according to the present application;
[0028] Figure 8 is a curve schematic diagram of the accuracy of the training set in the preliminary training process (i.e. the training process corresponding to the preliminary training round) of the automatic extraction model in the function point extraction processing method according to the present application.
[0029] Figure 9 is a curve diagram showing the change of the loss value of the training set in the preliminary training process (i.e., the training process corresponding to the preliminary training round) of the automatic extraction model in the functional point extraction processing method according to the present application;
[0030] Figure 10 is a curve diagram showing the change of the accuracy of the training set in the additional training process (i.e., the training process corresponding to the retraining round) of the automatic extraction model in the functional point extraction processing method according to the present application;
[0031] Figure 11 is a curve diagram showing the change of the loss value of the training set in the additional training process (i.e., the training process corresponding to the retraining round) of the automatic extraction model in the functional point extraction processing method according to the present application;
[0032] Figure 12 is a curve diagram showing the change of the accuracy of the validation set in the additional training process (i.e., the training process corresponding to the retraining round) of the automatic extraction model in the functional point extraction processing method according to the present application;
[0033] Figure 13 is a schematic diagram of an example of constructing a functional point knowledge graph by extracting functional points using the functional point extraction processing method of the present application;
[0034] Figure 14 is a flowchart of an example of the steps of performing traversal Figure 13 of the relationship path between the directed entity nodes in the functional point knowledge graph;
[0035] Figure 15 is a flowchart of another example of the steps of performing traversal Figure 13 of the functional point knowledge graph
[0036] Figure 16 is a structural block diagram of the functional point extraction processing system of the present application;
[0037] Figure 17 is a structural schematic diagram of the electronic device embodiment according to the present application;
[0038] Figure 18 is a structural schematic diagram of the computer readable medium embodiment according to the present application. DETAILED DESCRIPTION
[0039] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0040] In view of the above problems, the present application provides a function point extraction processing method, which can more accurately match and extract the function points in the to-be-processed text by constructing a knowledge base and using the KMP algorithm based on the constructed knowledge base, can reduce the string matching time complexity to linear time complexity, can effectively reduce the time complexity in the text matching process, and can improve the accuracy of function point extraction. The present application can more comprehensively extract function points by using the automatic extraction model constructed based on the Bert-BiLSTM-CRF algorithm for function point extraction, can more quickly and effectively realize the automatic extraction process of function points, and can effectively extract function points that are not in the knowledge base.
[0041] Figure 1 is a step flow chart of an example of the function point extraction processing method of the present application.
[0042] The content of the present application will be described in detail below with reference to Figures 1 to 15
[0043] As shown in Figure 1 , in step S101, the demand analysis text, software design text and system design text available from public channels are collected to obtain a data set, and the sample data in the data set are labeled with function points to establish a knowledge base.
[0044] The demand analysis text, software design text and system design text (for example, about 900 articles) are obtained from public channels such as github, gitlab, blog and China Knowledge Network, and the existing known function points are obtained to obtain a data set.
[0045] Next, for example, using the Doccano labeling platform, the sample data (specifically including demand analysis text, software design text and system design text) in the data set are labeled with function points to establish a knowledge base (for details, see Figure 2 ), and a first data set is obtained for subsequent model training.
[0046] It should be noted that Doccano is a lightweight open source data labeling platform, and the automatic labeling function of the platform is used to label the sample data in the data set with function points.
[0047] In an embodiment, part of the sample data (for example, 1.12 million words of demand analysis text) in the data set is labeled with function points to obtain a first data set for subsequent model training.
[0048] The named entity recognition method is used for function point labeling. As Figure 3 As shown, a function point label set is established, which includes information such as the name, number, color, etc. of the category label, for example, the above information can be displayed on the visualization interface, and the above information can be created, modified, deleted, etc.
[0049] Specifically, the function point label set includes the following function point labels: a first type of label represented by ILF, a second type of label represented by EIF, a third type of label represented by EI, a fourth type of label represented by EO, and a fifth type of label represented by EQ. See Table 1 below for details.
[0050] Optionally, the requirement analysis text is classified according to the function point category and / or the scene parameter, and a function point label is established to establish a function point label set.
[0051] Table 1
[0052]
[0053] Table 1 shows the classification (category label), name, and meaning of each type of function point.
[0054] It should be noted that since the internal logic file and the external interface file do not have common characteristics, the two files are labeled as different category labels, and the category labels of the entities related to the internal logic file and the external interface file are represented by ILF and EIF, respectively.
[0055] It should be noted that the above function point labels can also have a sixth type of label and a seventh type of label, or only three types of labels or four types of labels, which can be adapted according to the actual application scene. The above is only an optional example for illustration and cannot be understood as a limitation of the present application.
[0056] The knowledge base is established using sample data labeled with category labels (i.e. requirement analysis text labeled with category labels). In other words, the knowledge base includes requirement analysis text labeled with category labels.
[0057] For example, the knowledge base includes function points, text segments containing function points, and text sentences containing function points.
[0058] Further, the number of labeled data (e.g. 1.12 million words of requirement analysis text) and the number of unlabeled data (e.g. 2.43 million words) are in a specified ratio (e.g. 112:243, 2:5, 1:2, etc.), and the unlabeled sample data in the data set (i.e. the remaining sample data in the data set) is used to generate pseudo labels to obtain a second data set for subsequent additional training of the model.
[0059] In a preferred embodiment, in order to ensure data quality, each text in the above data set only intercepts the demand analysis part (i.e., part of the text data), and needs to be preprocessed. The preprocessing includes: removing useless characters, using regular expressions to remove image links and web page links, etc.
[0060] Next, in step S102, based on the established knowledge base, the KMP algorithm is used to perform string matching between the function points in the knowledge base and the text to be processed, so as to extract the function points contained in the text to be processed and determine the category labels of the function points.
[0061] Use KMP algorithm to match function points in the knowledge base with the text to be processed, such as Figure 4 As shown, the specific steps include the following steps.
[0062] Step S401: Determine the string length of the function points and text sentences containing the function points in the knowledge base, express them using pattern strings, and construct a next array.
[0063] Specifically, for each function point in the knowledge base, a pattern string is used to represent each function point in the knowledge base, and a next array is created based on the pattern string. Each value in the next array represents the length of the same prefix and suffix in the substring before the current character. For example, the pattern string ab is used to represent the function point "order".
[0064] It should be noted that the same prefix and suffix are the same prefix and suffix, specifically including the substring consisting of the current character and all the characters before the current character. Specifically, for example, the substring ABCDAB, from left to right, has the same prefix and suffix AB, so the current value is 2. The substring ABCDABD does not have the same prefix and suffix, so the current value is 0. For another example, the substring ABCDA, from left to right, has the same prefix and suffix A, so the current value is 1.
[0065] Step S402: Determine the length of the character string of the text to be processed and express it using a text string.
[0066] Receive the text to be processed and extract the function points of the received text to be processed, wherein the text to be processed is, for example, a demand analysis text. Specifically determine the string length of the text to be processed and use the text string to represent the text to be processed, such as Figure 5 The text to be processed is a text string or a string to be matched. For example, abcmnfghab, deab, or xkab represents the text to be processed, "Product management includes listing, deleting, and modifying products." This matches the template string "...delete product" in the knowledge base.
[0067] In a specific implementation, for example, the text to be processed is deab (corresponding to "delete product").
[0068] Step S403: performing string matching on each pattern string in the knowledge base and the text string of the text to be processed one by one, and determining the position where the matching fails so as to determine the starting position for the next matching.
[0069] In a specific embodiment, for example, when the function point ab in the knowledge base is matched with the text to be processed deab for string matching, the character a in the function point is not matched successfully with the character d in the text to be processed, then the position where the match fails is determined to be a. During the next match, the position corresponding to the character a is the starting position of the next match. The character a is matched with the character e in the processing text. When the match is unsuccessful, the position corresponding to the character a is still the starting position of the next match.
[0070] Step S404: When the pattern string in the knowledge base successfully matches the text string of the text to be processed, the corresponding function points in the text to be processed are extracted.
[0071] Next, character a in the knowledge base is matched with character a in the text to be processed. When the match is successful, the next character b of character a is matched with the next character b of character a in the text to be processed. If the match is successful, the text to be processed contains the function point "commodity" corresponding to the character string ab, and the corresponding function point "commodity" in the text to be processed is extracted.
[0072] For the KMP algorithm's matching process, if the length of the text to be matched is n, the average length of function points in the knowledge base is m, the matching time complexity of a single function point is O(n+m), and the number of function points in the knowledge base is k, then the total search time complexity is O((n+m)*k). Compared to the O(n*m) search time complexity of existing methods for searching single function points, this algorithm can reduce the string matching time complexity to linear O(n+m), effectively reducing the time complexity of the text matching process and, in turn, the matching time.
[0073] Next, in step S103, a pre-built automatic extraction model is used to automatically extract function points from the text to be processed, the text to be processed is input into the automatic extraction model, and the function points contained in the text to be processed and the categories to which each function point belongs are output; wherein, the automatic extraction model is constructed based on the Bert-BiLSTM-CRF algorithm; in the process of constructing the automatic extraction model, the model parameters are optimized multiple times.
[0074] Based on the Bert-BiLSTM-CRF algorithm, the method for building an automatic extraction model is as follows.
[0075] First, the demand analysis text in the data set collected in step S101 is divided into a training set, a validation set, and a test set according to a specific ratio.
[0076] In an optional embodiment, the first data set in the data set is specifically divided into a training set, a validation set and a test set according to a ratio of 8:1:1 (i.e., a specific ratio), wherein the training set is used to train the automatic extraction model, the validation set is used to verify the automatic extraction model during the model training process, and the test set is used for overall testing after the model training is completed.
[0077] In addition, a second dataset is formed using unlabeled data in the dataset. The second dataset is used to generate pseudo labels after the automatic extraction model is trained using the training set, and retraining is performed using sample data with pseudo labels. Specifically, after the automatic extraction model is trained using the training set to obtain a preliminary automatic extraction model, the preliminary automatic extraction model is used, and pseudo labels are generated using the second dataset.
[0078] For the construction of the automatic extraction model, specifically construct the Bert layer, BiLSTM layer and CRF layer to construct the automatic extraction model, and use the trained automatic extraction model to automatically extract function points from the text to be processed, that is, input the text to be processed, and output the function points contained in the text to be processed and the category to which each function point belongs. For details, please refer to Figure 6 .
[0079] Use the training set to train the automatic extraction model, and determine the dimension of the word vector to be generated based on the length n of the sample data in the training set. Specifically, input the sample data of length n (such as demand analysis text) into the Bert layer to generate the first vector of dimension n*specific value. The range of n is greater than 0 and less than or equal to 512, and the range of the specific value is greater than 700 and less than or equal to 800, preferably 768.
[0080] Assuming that the length of the sample data (in this example, for example, the demand analysis text) is n, the input Bert layer will generate an n*512-dimensional word vector, that is, each word generates a 512-dimensional vector, and obtains the first vector corresponding to the sample data (in this example, for example, the demand analysis text).
[0081] It should be noted that the main purpose of the Bert layer is to generate word vectors for downstream tasks (specifically used as input for the BiLSTM layer). Using Bert as a pre-training model is obtained by training with massive data. The model itself has considerable complexity and an excellent training mechanism, so the generated word vectors have rich semantic information. For the training process of the automatic extraction model (also known as the Bert-BiLSTM-CRF model), the present invention proposes an effective semi-supervised model architecture that can effectively utilize the collected demand analysis data and save the human cost of data annotation.
[0082] Next, the first vector is input into the BiLSTM layer, which processes it to establish contextual connections between the n vectors and obtain sequential semantic information corresponding to the sample data (in this example, the requirements analysis text). The sequential semantic information obtained by the BiLSTM layer is then input into the CRF layer, which outputs the function points contained in the sample data (in this example, the requirements analysis text) and the function point category to which each function point belongs.
[0083] It should be noted that the Bert layer only establishes the temporal information of the sequence by integrating the word embedding of the position coding information, which is helpful for the parallel computing of large networks. However, the temporal information for establishing the contextual dependency of the sequence is relatively weak. Therefore, the automatic extraction model of the present invention is constructed using multiple layers, among which BiLSTM is a classic model for establishing temporal information of various texts, which can construct better contextual semantic information for the word vectors generated by the Bert layer, and the BiLSTM layer can simultaneously learn the semantic information on both sides of various texts.
[0084] For example, the n 512-dimensional (e.g., 768-dimensional) vectors output by the Bert layer are processed to establish contextual connections between the n vectors to supplement the information content of the BiLSTM layer in detail and output a second vector with the same dimension as the first vector.
[0085] It should be noted that for the BiLSTM layer, LSTM is a type of recurrent neural network, which mainly inputs text information and the implicit output of the previous basic unit into its basic unit in sequence. Its basic process and basic units are as follows: Figure 7As shown in the figure. The part in the black rectangle represents the basic neural unit of LSTM, and the dotted line represents the characteristics of the cycle. The input of the current neuron of LSTM comes from the memory output of the previous neuron, the hidden state output and the input of the current word in the sequence. The forget gate is mainly used to ignore unimportant information from the past sequence. The input gate mainly inputs the current word information, and the output gate is used to output the semantic information formed by the current neuron combining the current input word and memory information. The gate mechanism is also one of the reasons why LSTM performs well in the field of natural language processing. The calculation formulas of each gate are shown in (1), (2) and (3). The formula uses a batch calculation method. Assume that batch_size is n and there are h hidden units.
[0086] I t =sigmoid(X t W xi +H t-1 W hi +b i ) (1)
[0087] F t =sigmoid(X t W xf +H t-1 W hf +b f ) (2)
[0088] O t =sigmoid(X t W xo +H t-1 W ho +b o ) (3)
[0089] Among them, I t refers to the input gate at time t, where t refers to the tth time; X t refers to the input vector at time t; W xi Refers to the weight parameter; H t-1 refers to the hidden state at time t-1; W hi refers to the weight parameter; b i Refers to the bias parameter; F t refers to the forget gate at time t; W xf Refers to the weight parameter; W hf refers to the weight parameter; b f Refers to the bias parameter; O t refers to the output gate at time t; W xo Refers to the weight parameter; W ho refers to the weight parameter; b o Refers to the bias parameter. All weight parameters and bias parameters are different, so different gates are obtained.
[0090] The memory process of the current neuron needs to combine the input information of the current word and the hidden information of the past sequence, using two activation functions. First, the candidate memory is formed The past sequence information is then processed through the forget gate to obtain the important information. This information is then combined with the candidate memory to obtain the memory information of the current neuron, which is used as the input of the next neuron. This is shown in formulas (4) and (5), where ⊙ represents the product of the corresponding elements of the matrix.
[0091]
[0092]
[0093] in, is the candidate memory unit at time t, W xc 、W hc are all weight parameters, b c is the bias parameter. C t is the memory unit at time t, C t-1 is the memory unit at time t-1, F t is the forget gate at time t, I t is the input gate at time t.
[0094] The calculation formulas of activation functions sigmoid and tanh are shown in (6) and (7).
[0095]
[0096]
[0097] After the above calculations, the output of the hidden state is finally obtained, that is, the output of the entire neuron, as shown in formula (8).
[0098] H t =O t ⊙tanh(C t ) (8)
[0099] Among them, H t Refers to the output of the hidden state at time t; O t Refers to the output gate at time t; C t Refers to the memory unit at time t.
[0100] For the CRF layer, the CRF model is a relatively excellent machine learning method applied in the field of sequence labeling. Compared with LSTM, it mainly considers the relationship between category labels, can automatically learn the transition probability between category labels, jointly model the entire sequence, better capture the contextual relationship, and perform global optimization during prediction to obtain the optimal solution. For example, if the length of the input sequence is n and the total number of predefined labels is k, the prediction method of the CRF layer is to receive the output vector information (i.e., the second vector) of the BiLSTM layer, comprehensively consider the entire sequence, and obtain the optimal solution from k. n The best one is selected from the output paths to determine the function points of the entire sequence, that is, to output the function points contained and the category label of each function point.
[0101] During the training process of the automatic extraction model, a number of initial training rounds and a number of retraining rounds are determined based on the number of the first and second datasets. Based on the determined number of initial training rounds, the automatic extraction model is trained using the training dataset to obtain a preliminary automatic extraction model. Based on the determined number of retraining rounds, the preliminary automatic extraction model is additionally trained (i.e., retrained) using the second dataset.
[0102] Specifically, the number of preliminary training rounds and retraining rounds is determined based on the number of the first data set and the second data set.
[0103] According to the determined preliminary training rounds, the automatic extraction model is trained using the training set to obtain a preliminary automatic extraction model.
[0104] According to the determined retraining rounds, the preliminary automatic extraction model is additionally trained using the second dataset.
[0105] For the evaluation indicators of the training process, the model evaluation indicators of the present invention are evaluated using precision, recall and F1 value (F1-score), which need to consider the real entity and its prediction results, pseudo entity and its prediction results, as shown in Table 2.
[0106] Table 2
[0107]
[0108]
[0109] Table 2 shows the confusion matrix of predicted entities and true entities.
[0110] Where TP represents the number of entities that are actually real and predicted as real; FN represents the number of entities that are actually real but predicted as fake; FP represents the number of entities that are actually fake but predicted as real; and TN represents the number of entities that are actually fake but predicted as fake. The calculation formulas for precision, recall, and F1 are shown in (9), (10), and (11).
[0111]
[0112]
[0113]
[0114] For example, the Tensorboard visualization tool can be used to monitor the changes in the accuracy and loss of the training set, as well as the changes in the accuracy of the validation set, during the model training process and the additional training process of the automatic extraction model, so as to determine the initial training and retraining rounds of the model. Figures 8 to 12 As shown, the x-axis represents the number of training steps. The number of training steps divided by the number of sample data in the training set can be obtained as the training round. Figure 8 and Figure 9 The initial training rounds can be obtained using Figure 8 The initial training rounds determined are combined with Figures 9 to 12 More training rounds are required.
[0115] Without considering the semi-supervised case, only the training set divided by the first data set is used, and a larger epoch is set for the automatic extraction model. With global_step as the x-axis, the changes in the accuracy (i.e., training accuracy) and loss value (training loss value) of the model training process can be observed. Figure 8 It can be seen that after 14,000 steps, the curves of the accuracy and loss value of the model training tend to converge. Each epoch of the training set of the present invention has, for example, 856 steps (step_num), so the formula for calculating epoch is shown in (12):
[0116]
[0117] Considering semi-supervised training, the training set divided by the first dataset is set to 16 epochs based on the above inference. The preliminary automatic extraction model trained on the first dataset is used to predict the sample data in the second dataset. The amount of data in the second dataset is about twice that of the first dataset. A larger epoch is set. During the entire training process, the changes in the accuracy (Accuracy), loss value (Loss) of the model retraining and the accuracy (Accuracy) of the validation set are shown as follows: Figures 10 to 12The three graphs are divided into three parts by two dashed lines. The left part represents the preliminary training process with 16 epochs (epoch1), each epoch has 856 steps (step_num1). The middle part represents the retraining process, each epoch has 1763 steps (step_num2) until the model converges basically after the global_step is 70k. During the retraining process, the accuracy of the training data (specifically the second data set) and the accuracy of the validation set are improved to a certain extent, and the model loss is greatly reduced. Considering that the retraining data is only the sample data of the pseudo-label obtained by the prediction of the model and the knowledge base, the above three indicators can be improved to different degrees, which verifies the effectiveness of the semi-supervised training of the application. The epoch (epoch2) calculation process of retraining is shown in formula (13):
[0118]
[0119] By training the automatic extraction model using the training set divided by the first data set according to the determined preliminary training rounds to obtain a preliminary automatic extraction model, and performing additional training on the preliminary automatic extraction model using the second data set according to the determined retraining rounds, a more accurate automatic extraction model is obtained.
[0120] It should be noted that the above is only described as an optional example and cannot be understood as a limitation of the application.
[0121] Next, in step S104, the function points extracted based on the knowledge base and the function points extracted using the automatic extraction model are sorted and evaluated to filter the function points.
[0122] Specifically, the function points extracted based on the knowledge base and the function points extracted using the automatic extraction model are vector converted using the credibility of the function points, input into a pre-trained machine learning model, and output a credibility evaluation value. The machine learning model is, for example, a statistical language model.
[0123] According to the output credibility evaluation value, the function points are sorted to filter out the function points with a credibility evaluation value greater than a specified value. Thus, the credibility of each function is identified and filtered by the machine model.
[0124] It should be noted that in other embodiments, the machine learning model can also be an LSTM model. The machine learning model learns the rules of the function points through training. The credibility evaluation value is a negative number, the larger it is, the closer it is to 0, and the higher the credibility is. The smaller it is, the farther it is from 0, and the lower the credibility is.
[0125] For example, the credibility evaluation value of the "add goods" is -4.93, and the credibility evaluation value of the "sky-high goods" is -6.00. The evaluation value of the "add goods" is greater than that of the "sky-high goods", which means that the former is more like a function point, and the "add goods" should be ranked in front of the "sky-high goods" in the sorting, so as to filter out the function points with credibility evaluation values less than or equal to the specified value, that is, to screen out the function points with credibility evaluation values greater than the specified value.
[0126] In a specific embodiment, the scoring of the function points is performed by using the existing Kenlm tool (i.e., the tool existing on the Internet), and the scoring effectively evaluates the function points, with the focus on whether the input function points meet the function point characteristics, for example, whether "delete user" is more consistent with the function point characteristics than "understand user".
[0127] It should be noted that the Kenlm tool can quantify the function point characteristics of the phrases for scoring (e.g., calculating the credibility), and first trains the Kenlm. The training data set is all the function points (excluding the labels) contained in the knowledge base, that is, the labels do not need to be considered, and only all the function points need to be input. The Kenlm can learn the function point characteristics from all the input function points. After the Kenlm learns the function point characteristics, it scores all the extracted function points, and then outputs all the function points after sorting according to the scores, which can also be better displayed to the user.
[0128] In another example, the function point extraction processing method of the present application further includes the following steps: knowledge extraction and knowledge relationship extraction are performed on the function points and category labels extracted based on the knowledge base, and the function points and the categories to which the function points belong extracted using the automatic extraction model, to form function point triples to construct a function point knowledge graph; wherein the knowledge relationship extraction is performed according to the internal relationship between the function points representing different categories and different operations in the to-be-processed text, to obtain the following multiple relationships to represent the one-way or bidirectional edges between the entity nodes: dependency relationship, inheritance relationship, aggregation relationship, action relationship, generalization relationship, synonym relationship, trigger relationship, parallel relationship, interaction relationship, and coexistence relationship.
[0129] Then, according to the constructed function point knowledge graph, the function point extension is performed.
[0130] In a specific embodiment, the function point entity extraction is performed according to the function point categories, and specifically includes extracting a first type of entity, a second type of entity, a third type of entity, and a fourth type of entity, which are all function point entities.
[0131] For example, the hash tree is used to identify the entities in the function point text (including the function points extracted based on the knowledge base, the function points extracted using the automatic extraction model, and the existing function point text, etc.), and the first type of entity related to the internal logic file in the data function is extracted, which is the noun related to the internal logic file. For example, the tables and files in the database shown in Table 1, such as "commodity order table", "user information table", etc.
[0132] Next, the second type of entity related to the external logic file in the data function is extracted, which is the noun related to the external logic file. For example, the reference file to be stored in the data exchange.
[0133] Next, the third type of entity related to the external input in the transaction function is extracted, which is the verb related to the external input (i.e., related to the function point operation), and the class label of the entity related to the external input is represented using the EI table. For example, "add", "modify", "delete".
[0134] In addition, the third type of entity related to the external query in the transaction function is extracted, which is the verb related to the external query (i.e., related to the function point operation), and the class label of the entity related to the external query is represented using the EQ table. For example, "query", "get".
[0135] In addition, the third type of entity related to the external output in the transaction function is extracted, which is the verb related to the external output (i.e., related to the function point operation), and the class label of the entity related to the external output is represented using the EO table. For example, "recommend", "export", "statistics", "print", "generate".
[0136] It should be noted that in other embodiments, function point entity extraction can also be performed according to scene parameters. Function point entity extraction can also be performed only on existing function point analysis text, etc. The above is only an optional example for description, and cannot be understood as a limitation of the present application.
[0137] Specifically, the scene parameters are determined according to the applied field. For example, in the e-commerce field, the scene parameters related to the order, the scene parameters related to the commodity, and the scene parameters related to the user. More specifically, for example, order table, order number, payment, inventory, refund, commodity table, user table, etc. See Table 3 for details.
[0138] Table 3
[0139]
[0140]
[0141] Table 3 shows an example of the correspondence between the scene parameters and the entities.
[0142] In an optional embodiment, the extracted words corresponding to each type of entity are subjected to "entity disambiguation" (solving the problem of polysemy, etc.) by an entity recognition algorithm, i.e. the same or similar synonyms of the semantic of the word are identified, and the word and its synonyms are corresponded to (or mapped to) the same entity.
[0143] It should be noted that due to the difference in expression, different words may have the same semantics, such as "add" and "increase", and "add" and "increase" represent the same entity. For synonyms with the same semantics, see Table 4.
[0144] Table 4
[0145] Original entity Synonymous entities Add an order Place an order, place a purchase order, place an order, create a new order Add product Release products, put products on shelves, put products on shelves, release products Delete product Product removal, product removal Search Products Search products, search products, browse products, browse products
[0146] Table 4 shows an example of the relationship between each entity (each original entity) and its synonym entity.
[0147] Further, the combined entity is extracted to obtain the fourth type of entity, which is the combined entity of the verb and the noun. For example, the combined entity of the first type of entity and the third type of entity, the combined entity of the second type of entity and the third type of entity, etc. For example, "query goods", "add goods", "new order", "search goods", "goods search", "browse goods", "goods browse", "add user", "delete user", "modify user", "query user", etc.
[0148] Optionally, for the function point category, a name dictionary corresponding to each function point category is established (for example, using synonym, wherein the key in the name dictionary represents the synonym entity, and the value in the name dictionary represents the original entity), see Table 4.
[0149] Specifically, the name dictionary includes two columns of key column and value column, and the entity relationship has a corresponding relationship, wherein the synonym entity is in the key column, and the original entity is in the value column (the original entity corresponding to each synonym entity located in the same row of the key column, see Table 4). If the entity (i.e. the identified function point) has no synonym relationship, the entities located in the key column and the value column and belonging to the same row are all original entities. If the entity (i.e. the identified function point) has a synonym relationship, the entity located in the key column is a synonym entity, and the entity located in the value column and belonging to the same row as the synonym entity (located in the key column) is an original entity.
[0150] In a specific embodiment, the original entity is searched based on the synonymous entities in the above-mentioned name dictionary, and then expanded based on the original entity in the function point knowledge graph constructed subsequently.
[0151] It should be noted that the above description is merely provided as an optional example and should not be construed as a limitation to the present invention.
[0152] In this embodiment, knowledge relationship extraction is performed on function points extracted based on the knowledge base, function points extracted using an automatic extraction model, and existing function point texts to form function point triples to construct a function point knowledge graph. The function point triples include entity nodes corresponding to function point entities (i.e., function point entity nodes) and unidirectional or bidirectional relationships between adjacent entity nodes.
[0153] Specifically, for example, a regular matching method is used to extract knowledge relationships, and statistical analysis is performed on all extracted knowledge relationships. The number of relationship categories within a specified time period is calculated, and a specific number of relationship categories that are ranked first, such as the top ten, are selected.
[0154] In an optional embodiment, extraction rules are configured based on scenario parameters. Knowledge relationships are extracted based on the extraction rules for function points extracted from a knowledge base, function points extracted using an automatic extraction model, and the inherent connections between function points representing different types and operations, as well as between various operations and different function points, in existing function point texts. The following multiple relationships are obtained to represent edge relationships between two adjacent entity nodes in the function point knowledge graph. The edge relationships can be unidirectional or bidirectional. That is, different edge relationships are represented using relationship categories.
[0155] Specific relationship categories include dependency, inheritance, aggregation, action, generalization, synonymy, triggering, parallel, interaction, and coexistence. These relationships are represented by α, μ, φ, δ, ε, θ, ω, ζ, η, and λ, respectively. See Table 5 below for details.
[0156] Table 5
[0157]
[0158]
[0159] Table 5 shows various relationship categories, their meanings, and their symbols.
[0160] Next, based on the various entities extracted above, the extracted entities and the knowledge relationships between entities (including unidirectional and bidirectional relationships), function point triples are formed (entities corresponding to function points, relationships, and entities corresponding to function points, see Table 6 for details) to construct a function point knowledge graph, in which each entity corresponds to an entity node, namely, a function point entity node.
[0161] Table 6
[0162]
[0163]
[0164] Table 6 shows examples of triples with different edge relationships.
[0165] Specifically, the relationship graph in the constructed function point knowledge graph is composed of entity nodes (i.e., the function point entity nodes corresponding to the entities corresponding to the function points) and directed relationship edges. Figure 13 .
[0166] It should be noted that the function point knowledge graph is an instantiation representation of function points, which represents the intrinsic connection between different function point instances of a specific type of system (a system corresponding to different application fields).
[0167] In yet another example, when a text to be processed is received, function points contained therein are identified, and it is determined whether the identified function points are search keywords.
[0168] Preferably, before identifying the functional points contained in the text to be processed, the following search keywords are determined based on scenario parameters and usage frequency: query, add, product, payment, refund, modify, delete, browse, retrieve, create, user, order, place an order, publish, inventory, put on shelf, take off shelf, and manage. The determined keywords are used as search keywords for traversing each relationship path in the knowledge graph and as the starting point.
[0169] According to the usage frequency and scenario parameters, search keywords are screened from the various entities extracted to obtain a keyword set, which is used to perform keyword matching with the functional points in the text to be processed to determine whether the search keywords are contained.
[0170] The function points identified from the text to be processed are matched with each search keyword in the keyword set to determine whether the identified function point is a search keyword, so as to further determine the starting node of traversing the function point knowledge graph based on the search keyword.
[0171] For example, starting from the first position of the function point identified in the text to be processed, a text matching method is used to determine whether it is a search keyword. For example, if "add order" is input, first, all search keywords are matched (for example, the first "query", whose length is 2). Then, starting from the first character (or word) in "add order", a text with a length of 2 is selected to obtain "add", which is matched with the first keyword among all keywords, and each keyword is matched in this order. When the match is successful, the matched keyword is determined. When the match is not successful, it is determined that the identified function point is not a search keyword.
[0172] For example, "add" is not equal to "query," so it does not match the search keyword "query." Then, the second search keyword "add" is matched. At this point, the function point "add" in the input successfully matches the search keyword "add," confirming that the identified function point "add" is the search keyword. Using the above method, the identified function point "order" is further confirmed to be the search keyword. Therefore, it is determined that the identified function point contains the search keyword.
[0173] like Figure 13 As shown, the text to be processed is "add product" as an example for explanation.
[0174] When receiving "add product", determine whether "add product" contains keywords. The "add product" contains "add" and "product". Use the above text matching method to determine that the identified function point contains the search keywords "add" and "product". According to "add" and "product" (i.e., search keywords), determine the starting node of the traversal function point knowledge graph, such as using Figure 13 The starting point corresponding to "Add Product" in . From this starting point, start traversing the function point knowledge graph.
[0175] When the identified function point is a search keyword, the step of traversing the relationship path between directed entity nodes in the function point knowledge graph is executed. In the process of traversing the function point knowledge graph, all reachable entity nodes are searched based on the BFS search algorithm to establish a knowledge graph node queue. The establishment of the knowledge graph node queue includes: updating the entity nodes in the knowledge graph node queue.
[0176] Specifically, when the identified function point is a search keyword, the starting node for traversing the function point knowledge graph is determined according to the search keyword to start the step of traversing the relationship path between directed entity nodes in the function point knowledge graph.
[0177] When the identified function point is a search keyword, the step of traversing the relationship path between the directed entity nodes in the function point knowledge graph is performed, such as Figure 14 As shown, the specific steps include the following steps.
[0178] Step S1201: determining a function point entity node corresponding to the search keyword in the function point knowledge graph, and taking the determined function point entity node as a starting node.
[0179] Step S1202: repeatedly performing the step of traversing the relationship path from the starting node and containing the search keyword in the function point knowledge graph until all related relationship paths are traversed.
[0180] Specifically, starting from the starting node, the starting node, the adjacent entity node pointed to by the starting node, and the adjacent entity node pointed to by the adjacent entity node, until all reachable entity nodes are accessed, each entity node accessed is judged whether it can be added to the knowledge graph node queue to establish the knowledge graph node queue.
[0181] In an optional embodiment, when it is determined that the identified function point is not the search keyword, the function point is matched with all synonyms of the search keyword to determine again whether the function point is a synonym of each search keyword. When it is determined that the function point is a synonym of a certain search keyword, it is finally determined that the function point is a search keyword.
[0182] In still another example, when the text to be processed is received, the function points contained are identified, the starting node of the traversal is determined according to the identified function points, and the step of traversing the relationship path between the directed entity nodes in the function point knowledge graph is performed. Specifically, the step S1202 in the step of repeatedly performing the step of traversing the relationship path from the starting node and containing the search keyword in the function point knowledge graph until all related relationship paths are traversed. That is, the step S1202 in the step of Figure 14 Since the steps in this example are substantially the same as the step S1202 in Figure 14 , the same part is omitted.
[0183] It should be noted that the above is only described as an optional example and cannot be understood as a limitation of the present application.
[0184] In order to further optimize the function point amplification method of the present application, in the case that the number of paths passed from one function point to the rest of the function points is large, all function points with high credibility can also be obtained. From the credibility of each relationship path passed by the function points amplified from the starting function point and the application scenario, the function point amplification method is further optimized.
[0185] In still another example, based on the BFS search algorithm, the step of traversing the relationship path between the directed entity nodes in the function point knowledge graph is performed. As shown in Figure 15 , it specifically includes the following steps.
[0186] Step S1301: Search all reachable entity nodes based on the BFS search algorithm.
[0187] For determining all reachable entity nodes, each entity node in the function point knowledge graph corresponds to a trust threshold. The trust threshold is used to determine whether the visited entity node is a reachable entity node. The following expression (14) is used to calculate the cumulative weight value of each visited entity node, and the calculated cumulative weight value of each entity node is compared with the trust threshold of each entity node to determine whether each visited entity node is a reachable entity node, so as to establish a knowledge graph node queue:
[0188] PN n N1=w1·w2w3…w n-1 (14)
[0189] Among them, PN n N1 represents entity node N n The cumulative weight value; n represents the number of edge relationships, in this example, n is 10; w1 w2 w3…w n-1 Indicates that it starts from entity node N1 and reaches entity node N n The weight product of the n-1 paths experienced; w1 represents the weight of the first edge experienced starting from the entity node N1; w2 represents the weight of the second edge experienced starting from the entity node N1; w3 represents the weight of the third edge experienced starting from the entity node N1; w n-1 It represents the weight of the n-1th edge starting from the entity node N1, that is, the weight of the last edge.
[0190] It should be noted that the credible threshold is obtained, for example, through statistical analysis of historical data in various designated fields, or is set by experts.
[0191] Step S1302: Determine update parameters in real time to update entity nodes in the knowledge graph node queue.
[0192] Specifically, the cumulative weight value of each entity node in each relationship path is calculated, the cumulative weight value of each entity node is compared with a preset threshold (i.e., a credible threshold), and a relationship path with the largest cumulative weight value (i.e., the maximum relationship path) is determined, specifically including adding entity nodes whose calculated cumulative weight values are greater than or equal to the preset threshold to the knowledge graph node queue, deleting entity nodes whose values are less than the preset threshold, and adding entity nodes that are on the maximum relationship path and are not in the knowledge graph node queue to the knowledge graph node queue, so as to update the relevant entity nodes in the knowledge graph node queue in real time, thereby obtaining a knowledge graph node queue containing multiple entity nodes (i.e., containing a set of function points).
[0193] The accumulated weight value of each entity node is calculated using the above expression (14). For example, the starting node in each relationship path is assigned a weight value such as (0, 1], and the accumulated weight value of each entity node is the product of the weight values of the edge relationships of all relationship paths from the starting node to each entity node.
[0194] It should be noted that the accumulated weight value of a certain entity node represents the product of the weights of the relationship paths from the starting node to the certain entity node (e.g., the entity node "modify ILF"), and the accumulated weight value indicates the degree of trust of the function point represented by the certain entity node (e.g., the entity node "modify ILF"). The greater the accumulated weight value, the higher the degree of trust. When there are two relationship paths from the starting node to a certain entity node, there will be two accumulated weight values, and the relationship path with the maximum accumulated weight value is selected, i.e., the entity node on the maximum relationship path is selected, because the function point represented by the entity node on the maximum relationship path has a high degree of trust.
[0195] In an optional embodiment, the scenario parameter (i.e., the update parameter) is determined according to the text to be processed and the function points contained therein. Specifically, it is determined whether the scenario identifier is contained in the text to be processed, and when it is determined that the scenario identifier is contained in the text to be processed, the entity nodes in the knowledge graph node queue are updated.
[0196] For example, according to the scenario parameter (specifically, the parameter related to e-commerce, social media, game entertainment, etc., such as order, user account, etc.), the trust threshold of each entity node in the function point knowledge graph is updated in real time, and the value corresponding to the edge relationship corresponding to the scenario parameter (specifically, the scenario identifier) is determined in real time (i.e., the values corresponding to the edge relationships represented by α, μ, φ, δ, ε, θ, ω, ζ, η, λ, such as determined by expert guidance or determined according to the average value of historical data in a specified time period, etc.). Then, using the real-time updated trust threshold of each entity node, it is determined one by one whether the related entity nodes accessed are added to the knowledge graph node queue to establish the knowledge graph node queue.
[0197] It should be noted that in other embodiments, the number of all relationship paths related to the starting node to which the scenario parameter is applied (i.e., the update parameter) is determined in real time. The above is only described as an optional example and cannot be understood as a limitation of the present application.
[0198] In an optional embodiment, before executing the step of traversing the relationship path between directed entity nodes in the function point knowledge graph, the triple files corresponding to each triple in the function point knowledge graph are preprocessed to obtain a set of all entity nodes (for example, represented by nodes) and a category label corresponding to each entity category, and a name dictionary is constructed. For details, see Table 4.
[0199] By repeatedly traversing the relationship path starting from the starting point and containing the search keyword in the function point knowledge graph until all relevant relationship paths are traversed, the traversal step can be completed more efficiently and all relevant relationship paths can be obtained more quickly.
[0200] Next, function point expansion is performed based on the established knowledge graph node queue.
[0201] According to the updated knowledge graph node queue, a new set of function points is obtained, and the new set of function points is output to complete function point expansion.
[0202] Furthermore, the accompanying drawings are merely illustrative of the processes involved in the methods according to exemplary embodiments of the present invention and are not intended to be limiting. It should be understood that the processes illustrated in the accompanying drawings do not indicate or limit the temporal order of these processes. Furthermore, it should be understood that these processes can be executed synchronously or asynchronously, for example, in multiple modules.
[0203] Compared with the existing technology, the present invention uses a self-built knowledge base and a KMP algorithm to extract function points based on the self-built knowledge base, which can more accurately match and extract function points in the text to be processed, and can reduce the time complexity of string matching to linear time complexity, which can effectively reduce the time complexity in the text matching process, thereby effectively improving the text matching efficiency, and can also improve the accuracy of function point extraction; by using an automatic extraction model built based on the Bert-BiLSTM-CRF algorithm to extract function points, it can extract function points more comprehensively, can realize the automatic extraction process of function points more quickly and more effectively, and can effectively extract function points that are not in the knowledge base.
[0204] By performing knowledge extraction and knowledge relationship extraction on the existing function point analysis text, function point triples are formed to construct a function point knowledge graph, so that a more accurate function point knowledge graph containing function point triples can be obtained; when receiving the text to be processed, the function points contained therein are identified, and it is determined whether the identified function points are search keywords to determine whether to execute the step of traversing the relationship path between the directed entity nodes in the function point knowledge graph, and in the process of traversing the function point knowledge graph, a knowledge graph node queue is established, and then function points are amplified according to the established knowledge graph node queue, which can realize the automatic amplification process of function points more quickly and efficiently, and can effectively avoid the problem of missing function points.
[0205] In addition, based on the BFS search algorithm, all reachable entity nodes are searched, and the entity nodes in the knowledge graph node queue are updated by determining and updating parameters in real time, so that a knowledge graph node queue with higher credibility can be obtained, and the method can be further optimized.
[0206] The following is an embodiment of the system of the application, which can be used to execute the embodiment of the method of the application. For details not disclosed in the embodiment of the system of the application, please refer to the embodiment of the method of the application.
[0207] Figure 16 is a structural schematic diagram of an example of the function point extraction processing system according to the application.
[0208] With reference to Figure 16 , the second aspect of the present disclosure provides a function point extraction processing system 900, which adopts the function point extraction processing method of the first aspect of the application.
[0209] Specifically, the function point extraction processing system 900 comprises an establishing module 910, a first extraction module 920, a second extraction module 930 and a screening module 940.
[0210] The establishing module 910 is used to collect demand analysis texts, software design texts and system design texts available in public channels to obtain a data set, to perform function point labeling on sample data in the data set, and to establish a knowledge base.
[0211] The first extraction module 920 uses the KMP algorithm to perform string matching between function points in the knowledge base and the to-be-processed texts according to the established knowledge base, so as to extract function points contained in the to-be-processed texts and determine the category labels of the function points.
[0212] The second extraction module 930 is used to perform automatic extraction of function points on the to-be-processed texts using a pre-constructed automatic extraction model, to input the to-be-processed texts into the automatic extraction model, and to output function points contained in the to-be-processed texts and categories to which the function points belong; wherein the automatic extraction model is constructed based on the Bert-BiLSTM-CRF algorithm; in the process of constructing the automatic extraction model, model parameters are optimized multiple times.
[0213] The screening module 940 is used to sort, evaluate and calculate function points extracted based on the knowledge base and function points extracted using the automatic extraction model, so as to screen the function points.
[0214] In a specific embodiment, a function point label set is established, and according to the function point label set, a specified proportion of sample data in the data set is annotated with function points to obtain a first data set, and the remaining sample data in the data set is used to generate pseudo labels to obtain a second data set. The function point label set includes the following function point labels: a first category label represented by ILF, a second category label represented by EIF, a third category label represented by EI, a fourth category label represented by EO, and a fifth category label represented by EQ.
[0215] The demand analysis text in the data set is divided into a training set, a validation set and a test set according to a specific ratio; and the initial training round and the retraining round are determined according to the number of the first data set and the number of the second data set.
[0216] In an optional embodiment, the automatic extraction model is constructed based on the Bert-BiLSTM-CRF algorithm, including: constructing a Bert layer, a BiLSTM layer and a CRF layer to construct the automatic extraction model; determining the dimension of the word vector to be generated according to the length n of the sample data in the training set, specifically inputting the sample data of length n into the Bert layer to generate a first vector of dimension n*specific value, where the range of n is greater than 0 and less than or equal to 512, and the range of the specific value is greater than 700 and less than or equal to 800, preferably 768.
[0217] Next, the first vector is input into the BiLSTM layer to establish contextual connections between the n vectors and obtain sequence semantic information corresponding to the text to be processed.
[0218] Next, the sequence semantic information obtained by the BiLSTM layer is input into the CRF layer, which outputs the function points contained in the sample data and the function point category to which each function point belongs.
[0219] According to the determined initial training rounds, the automatic extraction model is trained using the training set to obtain a preliminary automatic extraction model; according to the determined retraining rounds, the preliminary automatic extraction model is additionally trained using the second data set.
[0220] Optimize model parameters during multiple model validations, including updating initial and retraining rounds based on changes in accuracy and loss during training.
[0221] Optimize model parameters during model testing, including updating the number of retraining rounds based on changes in accuracy and loss during retraining.
[0222] In an optional embodiment, the KMP algorithm is used to perform string matching between the text to be processed and the function points in the knowledge base to extract the function points contained in the text to be processed, including: determining the string length of the function points and the text sentences containing the function points in the knowledge base, using pattern strings to represent, and constructing a next array; determining the string length of the text to be processed, and using a text string to represent; performing string matching between each pattern string in the knowledge base and the text string of the text to be processed one by one, determining the matching failure position to determine the starting position for the next matching; when the pattern string in the knowledge base and the text string of the text to be processed are successfully matched, the corresponding function points in the text to be processed are extracted.
[0223] Then, the function points extracted based on the knowledge base and the function points extracted using the automatic extraction model are sorted and evaluated to filter the function points. Specifically, the function points extracted based on the knowledge base and the function points extracted using the automatic extraction model are vector converted using the credibility of the function points, input into a pre-trained machine learning model, and output a credibility evaluation value; the function points are sorted according to the output credibility evaluation value to filter the function points with a credibility evaluation value greater than a specified value.
[0224] The function points and category labels extracted based on the knowledge base and the function points and the categories to which they belong extracted using the automatic extraction model are knowledge extracted and knowledge relationship extracted to form function point triples to construct a function point knowledge graph; wherein the internal relationship between the function points representing different types and different operations in the text to be processed is extracted to obtain the following multiple relationships to represent the single or double edges between entity nodes: dependency relationship, inheritance relationship, aggregation relationship, action relationship, generalization relationship, synonym relationship, trigger relationship, parallel relationship, interaction relationship, coexistence relationship.
[0225] According to the constructed function point knowledge graph, the function point extension is performed.
[0226] It should be noted that, since the content of the function point extraction processing method in the system embodiment is substantially the same as that of the function point extraction processing method in the method embodiment, the description of the same part is omitted.
[0227] Compared with the prior art, the application can more accurately match the function points in the to-be-processed text by constructing a knowledge base and extracting function points based on the constructed knowledge base using the KMP algorithm, can reduce the string matching time complexity to linear time complexity, can effectively reduce the time complexity in the text matching process, and can effectively improve the text matching efficiency and the accuracy of function point extraction; by cooperating with the automatic extraction model constructed based on the Bert-BiLSTM-CRF algorithm to extract function points, the function points can be more comprehensively extracted, the automatic extraction process of the function points can be more quickly and effectively realized, and the function points that are not in the knowledge base can be effectively extracted.
[0228] By extracting function point knowledge and knowledge relationship from the existing function point analysis text, forming a function point triple to construct a function point knowledge graph, a more accurate function point knowledge graph containing function point triples can be obtained; when receiving a to-be-processed text, the contained function points are identified, it is determined whether the identified function points are search keywords to determine whether to perform the step of traversing the relationship path between the directed entity nodes in the function point knowledge graph, and in the process of traversing the function point knowledge graph, a knowledge graph node queue is established, and then according to the established knowledge graph node queue, the function point expansion is performed, the automatic expansion process of the function points can be more quickly and effectively realized, and the problem of missing function points can be effectively avoided.
[0229] In addition, based on the BFS search algorithm, all reachable entity nodes are searched, the entity nodes in the knowledge graph node queue are updated by determining and updating the parameters in real time, a knowledge graph node queue with higher reliability can be obtained, and the method can be further optimized.
[0230] Figure 17 is a structural schematic diagram of an electronic device embodiment according to the application.
[0231] As Figure 17 shown, the electronic device is in the form of a general computing device. The processor can be one or multiple and work cooperatively. The application also does not exclude distributed processing, that is, the processor can be dispersed in different entity devices. The electronic device of the application is not limited to a single entity, but can also be the sum of multiple entity devices.
[0232] The memory stores a computer executable program, usually machine readable code. The computer readable program can be executed by the processor to enable the electronic device to execute the method of the application or at least part of the steps in the method.
[0233] The memory includes a volatile memory, such as a random access memory unit (RAM) and / or a cache memory unit, and may also be a non-volatile memory, such as a read-only memory unit (ROM).
[0234] Optionally, in this embodiment, the electronic device further includes an I / O interface for exchanging data with an external device. The I / O interface may represent one or more of several types of bus structures, including a storage unit bus or storage unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus structures.
[0235] It should be understood that Figure 17 The electronic device shown is merely an example of the present invention. The electronic device of the present invention may also include elements or components not shown in the above examples. For example, some electronic devices also include display units such as screens, and some electronic devices also include human-computer interaction elements such as buttons and keyboards. As long as the electronic device can execute a computer-readable program stored in its memory to implement the method of the present invention or at least some of the steps of the method, it is considered an electronic device covered by the present invention.
[0236] Through the above description of the embodiments, it is easy for those skilled in the art to understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Figure 18 As shown, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of commands to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiment of the present invention.
[0237] The software product can be any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0238] The computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. The data signal propagated may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, device, or component. The program code contained on the readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0239] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0240] The computer-readable medium carries one or more programs (eg, computer-executable programs). When the one or more programs are executed by a device, the computer-readable medium implements the data interaction method of the present disclosure.
[0241] Those skilled in the art will appreciate that the modules described above can be distributed in the device according to the description of the embodiment, or can be modified accordingly to be used in one or more devices that are different from the embodiment. The modules of the above embodiment can be combined into one module or further divided into multiple submodules.
[0242] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of commands to enable a computing device (such as a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present invention.
[0243] The exemplary embodiments of this application are specifically illustrated and described herein. However, it is to be understood that the application is not limited to the details of the illustrated implementations; rather, this application is intended to cover any and all modifications and equivalents within the spirit and scope of the appended claims.
Claims
1. A function point extraction processing method, characterized in that: include: Collect demand analysis texts, software design texts, and system design texts available from public channels to obtain a data set, annotate the sample data in the data set with function points, and establish a knowledge base; Based on the established knowledge base, the KMP algorithm is used to perform string matching between the function points in the knowledge base and the text to be processed to extract the function points contained in the text to be processed and determine the category labels of the function points; Using a pre-built automatic extraction model, automatically extracting function points from a text to be processed, inputting the text to be processed into the automatic extraction model, and outputting the function points contained in the text to be processed and the categories to which each function point belongs; wherein the automatic extraction model is constructed based on the Bert-BiLSTM-CRF algorithm; and the process of constructing the automatic extraction model includes optimizing model parameters multiple times; The function points extracted based on the knowledge base and the function points extracted using the automatic extraction model are ranked and evaluated to screen the function points.
2. The function point extraction method according to claim 1, characterized in that: The automatic extraction model is constructed based on the Bert-BiLSTM-CRF algorithm, including: Constructing a Bert layer, a BiLSTM layer, and a CRF layer to construct the automatic extraction model; Determine the dimension of the word vector to be generated based on the length n of the sample data in the training set. Specifically, input the sample data of length n into the Bert layer to generate a first vector of dimension n*specific value, where n is greater than 0 and less than or equal to 512, and the specific value is greater than 700 and less than or equal to 800. Input the first vector into the BiLSTM layer for processing to establish contextual connections between the n vectors, thereby obtaining sequence semantic information corresponding to the text to be processed; The sequence semantic information obtained by the BiLSTM layer is input into the CRF layer, which outputs the function points contained in the sample data and the function point category to which each function point belongs.
3. The function point extraction processing method according to claim 1, characterized in that: Establish a function point label set, and annotate a specified proportion of sample data in the data set with function points based on the function point label set to obtain a first data set, and use the remaining sample data in the data set to generate pseudo labels to obtain a second data set, wherein the function point label set includes the following function point labels: The first type of label is represented by ILF, the second type of label is represented by EIF, the third type of label is represented by EI, the fourth type of label is represented by EO, and the fifth type of label is represented by EQ.
4. The function point extraction processing method according to claim 3, characterized in that: Divide the demand analysis text in the dataset into a training set, a validation set, and a test set according to a specific ratio; Determining a preliminary training round and a retraining round based on the number of the first data set and the number of the second data set; According to the determined preliminary training rounds, the automatic extraction model is trained using the training set to obtain a preliminary automatic extraction model; According to the determined retraining rounds, the preliminary automatic extraction model is additionally trained using the second dataset.
5. The function point extraction method according to claim 4, characterized in that: Optimize model parameters during multiple model validations, including updating initial and retraining rounds based on changes in accuracy and loss during training. Optimize model parameters during model testing, including updating the number of retraining rounds based on changes in accuracy and loss during retraining.
6. The function point extraction processing method according to claim 1, characterized in that: The KMP algorithm is used to perform string matching between the function points in the knowledge base and the text to be processed to extract the function points contained in the text to be processed, including: Determine the string length of function points and text sentences containing function points in the knowledge base, use pattern strings to represent them, and build the next array; Determine the string length of the text to be processed and express it using a text string; Perform string matching on each pattern string in the knowledge base with the text string of the text to be processed one by one, determine the position where the matching fails and use it to determine the starting position of the next matching; when the pattern string in the knowledge base successfully matches the text string of the text to be processed, extract the corresponding functional points in the text to be processed.
7. The function point extraction method according to claim 1, characterized in that: The ranking, evaluation and calculation of the function points extracted based on the knowledge base and the function points extracted using the automatic extraction model to screen the function points include: Using the credibility of function points, we convert function points extracted from the knowledge base and the automatic extraction model into vectors, input them into a pre-trained machine learning model, and output a credibility assessment value. The function points are sorted according to the outputted credibility evaluation values to filter out the function points whose credibility evaluation values are greater than a specified value.
8. The function point extraction method according to claim 1, characterized in that: Knowledge extraction and knowledge relationship extraction are performed on the function points and category labels extracted based on the knowledge base, as well as the function points and categories extracted using the automatic extraction model, to form function point triplets to construct a function point knowledge graph; among them, knowledge relationship extraction is performed based on the intrinsic connection between function points representing different types and different operations in the text to be processed, and the following multiple relationships are obtained to represent the unidirectional or bidirectional edges between adjacent entity nodes in the function point knowledge graph: dependency relationship, inheritance relationship, aggregation relationship, action relationship, generalization relationship, synonym relationship, trigger relationship, parallel relationship, interaction relationship, and coexistence relationship.
9. The function point extraction method according to claim 8, characterized in that: Function point expansion is performed based on the constructed function point knowledge graph.
10. A function point extraction and processing system, using the function point extraction and processing method according to any one of claims 1 to 9, characterized in that: include: Establish a module to collect demand analysis texts, software design texts, and system design texts available from public channels to obtain a data set, annotate the sample data in the data set with functional points, and establish a knowledge base; The first extraction module uses the KMP algorithm based on the established knowledge base to perform string matching between the function points in the knowledge base and the text to be processed, so as to extract the function points contained in the text to be processed and determine the category labels of the function points; The second extraction module uses a pre-built automatic extraction model to automatically extract function points from the text to be processed, inputs the text to be processed into the automatic extraction model, and outputs the function points contained in the text to be processed and the category to which each function point belongs; wherein the automatic extraction model is constructed based on the Bert-BiLSTM-CRF algorithm; and the process of constructing the automatic extraction model includes multiple optimization of model parameters; The screening module is used to perform ranking evaluation calculations on the function points extracted based on the knowledge base and the function points extracted using the automatic extraction model to screen the function points.
Citation Information
Patent Citations
Software defect prediction and quality analysis method and device, equipment and medium
CN114328277A
Specific target visual analysis method and system based on knowledge graph
CN116049381A