Demand risk prediction method and device, computer equipment and storage medium
By extracting and integrating the multi-grained text feature matrix of financial software demand text and entering the risk prediction model, the problem of low risk prediction accuracy in the existing technology is solved, and higher risk prediction accuracy is achieved.
Patent Information
- Application Number
- CN202410737720.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2025-05-13
AI Technical Summary
The risk prediction accuracy of software requirements in the prior art is low, and risk information in financial software requirements cannot be effectively identified.
By obtaining the financial software demand text, extracting the fine and coarse grain size text feature matrix, and fusing it into a fused text feature matrix, the trained risk prediction model is input to output the risk prediction results.
It improves the accuracy of risk prediction of financial software demand texts and can more effectively identify and predict risk information in software demand.
Smart Images

Figure CN119990382A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a demand risk prediction method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] Currently, financial services can be conducted online. With the development of computer technology, the financial service processing system established earlier is no longer suitable for the current new computer architecture and user needs. Therefore, the financial service processing system needs to be transformed and upgraded. During the transformation and upgrading process, it is necessary to determine the software requirements of financial services. In order to ensure the stability and security of the financial service processing system, it is necessary to identify the risks of software requirements. At present, the risk identification of software requirements is usually done by manually reading text. However, risk prediction and identification by manually reading software requirement text is highly subjective and cannot accurately judge the risk information in software requirements.
[0003] Therefore, the current risk prediction methods for software requirements have the defect of low prediction accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a demand risk prediction method, device, computer equipment, computer-readable storage medium and computer program product that can improve prediction accuracy in response to the above technical problems.
[0005] In a first aspect, the present application provides a demand risk prediction method, the method comprising:
[0006] Obtain the financial software demand text to be predicted;
[0007] Extracting a corresponding fine-grained text feature matrix and a coarse-grained text feature matrix according to the financial software requirement text;
[0008] Obtaining a fused text feature matrix according to the fine-grained text feature matrix and the coarse-grained text feature matrix;
[0009] The fused text feature matrix is input into a trained risk prediction model, and the risk prediction model outputs a risk prediction result corresponding to the financial software requirement text according to the fused text feature matrix.
[0010] In one embodiment, extracting the corresponding fine-grained text feature matrix and coarse-grained text feature matrix according to the financial software requirement text includes:
[0011] Extracting a fine-grained text feature matrix carrying first weight information corresponding to the financial software requirement text according to a first feature extraction algorithm;
[0012] Extracting a coarse-grained text feature matrix carrying second weight information corresponding to the financial software requirement text according to a second feature extraction algorithm;
[0013] The first weight information and the second weight information are calculated based on a preset key requirement text.
[0014] In one embodiment, extracting the fine-grained text feature matrix carrying the first weight information corresponding to the financial software requirement text according to the first feature extraction algorithm includes:
[0015] Extracting a first text feature matrix corresponding to the financial software requirement text according to a first feature extraction algorithm;
[0016] Performing dimensionality reduction on the first text feature matrix by principal component analysis to obtain a first text feature matrix after dimensionality reduction;
[0017] According to the bidirectional attention mechanism, a target text feature corresponding to the preset key requirement text in the first text feature matrix after dimensionality reduction is obtained, and a first weight is added to the target text feature;
[0018] A fine-grained text feature matrix carrying first weight information is obtained based on the first text feature matrix after dimensionality reduction and the target text features after adding the first weight.
[0019] In one embodiment, extracting the coarse-grained text feature matrix carrying the second weight information corresponding to the financial software requirement text according to the second feature extraction algorithm includes:
[0020] Extracting a second text feature matrix corresponding to the financial software requirement text according to a second feature extraction algorithm;
[0021] Acquire a preset key demand text, and perform spatial mapping on the preset key demand text according to the dimension corresponding to the second text feature matrix to obtain a corresponding key text feature matrix;
[0022] Obtaining a second weight matrix according to a dot product calculation result of the second text feature matrix and the key text feature matrix;
[0023] A coarse-grained text feature matrix carrying second weight information is generated according to the second text feature matrix and the second weight matrix.
[0024] In one embodiment, obtaining a fused text feature matrix according to the fine-grained text feature matrix and the coarse-grained text feature matrix includes:
[0025] By means of a gated recurrent unit, the fine-grained text feature matrix and the coarse-grained text feature matrix are linearly transformed to obtain a transformed fine-grained text feature matrix and a transformed coarse-grained text feature matrix;
[0026] According to the first weight information and the second weight information, mapping the transformed fine-grained text feature matrix and the coarse-grained text feature matrix to obtain corresponding mapping values;
[0027] According to the mapping values, the fine-grained text feature matrix and the coarse-grained text feature matrix are weightedly fused to obtain the fused text feature matrix.
[0028] In one embodiment, the method further comprises:
[0029] Obtaining a risk prediction model to be trained, a fused text feature matrix sample, and a real risk prediction result corresponding to the fused text feature matrix sample;
[0030] Inputting the fused text feature matrix sample into the risk prediction model, and the risk prediction model outputting the corresponding risk prediction result sample according to the fused text feature matrix sample;
[0031] The true risk prediction result and the risk prediction result sample are input into a preset cross entropy loss function, and the model parameters of the risk prediction model are adjusted according to the function value of the preset cross entropy loss function until the preset training end condition is met, thereby obtaining a trained risk prediction model.
[0032] In one embodiment, before extracting the coarse-grained text feature matrix carrying the second weight information corresponding to the financial software requirement text according to the second feature extraction algorithm, the method further includes:
[0033] Filling each word in the financial software requirement text with data according to a preset word length to obtain a filled financial software requirement text;
[0034] According to the second feature extraction algorithm, a coarse-grained text feature matrix carrying second weight information corresponding to the filled financial software requirement text is extracted.
[0035] In one embodiment, the step of obtaining the financial software demand text to be predicted includes:
[0036] Obtain original financial software requirement text;
[0037] Performing word segmentation on the original financial software requirement text to obtain a word segmentation result;
[0038] The financial software demand text to be predicted is obtained according to the word segmentation result.
[0039] In a second aspect, the present application provides a demand risk prediction device, the device comprising:
[0040] An acquisition module, used to acquire the financial software demand text to be predicted;
[0041] An extraction module, used to extract the corresponding fine-grained text feature matrix and coarse-grained text feature matrix according to the financial software requirement text;
[0042] A fusion module, used for obtaining a fused text feature matrix according to the fine-grained text feature matrix and the coarse-grained text feature matrix;
[0043] The prediction module is used to input the fused text feature matrix into a trained risk prediction model, and the risk prediction model outputs a risk prediction result corresponding to the financial software requirement text according to the fused text feature matrix.
[0044] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0045] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0046] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0047] The above-mentioned demand risk prediction method, device, computer equipment, storage medium and computer program product extract fine-grained text feature matrix and coarse-grained text feature matrix from the financial software demand text respectively, fuse multiple granularity text feature matrices to obtain a fused text feature matrix, and the risk prediction model performs risk prediction based on the above fused text feature matrix, and outputs the risk prediction result corresponding to the financial software demand text. Compared with the traditional manual risk prediction of financial software demand text, this solution improves the accuracy of risk prediction of financial software demand text by extracting multiple granularity text features from the financial software demand text and performing risk prediction on the fused multiple granularity text features based on the risk prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 A schematic diagram of a flow chart of a demand risk prediction method in one embodiment;
[0050] Figure 2 A schematic diagram of a flow chart of a demand risk prediction method in another embodiment;
[0051] Figure 3 is a structural block diagram of a demand risk prediction device in an embodiment;
[0052] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] In one embodiment, Figure 1 As shown, a demand risk prediction method is provided. This embodiment uses the method applied to a server as an example for illustration. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server, including the following steps S202 to S208. Among them:
[0055] Step S202, obtaining the financial software demand text to be predicted.
[0056] Among them, the financial software demand text to be predicted can be a demand text obtained by performing demand analysis on the software in the financial business processing system when the financial business processing system is upgraded. Before the upgrade project is put into production, the server needs to predict the risk level of the transformation and upgrade, and give targeted reminders to high-risk software requirements during the test process. The server can obtain the financial software demand text to be predicted. The above financial software demand text includes multiple words. The server can analyze the financial software demand text and predict the software requirements that pose risks to the stability and security of the financial business processing system, so that these risky software requirements can be promptly reminded and rectified to ensure the stability and security of the financial business processing system.
[0057] The server may pre-process the original financial software demand text to obtain the financial software demand text to be predicted that can be used for risk prediction.
[0058] In one embodiment, obtaining the financial software requirement text to be predicted includes: obtaining the original financial software requirement text; segmenting the original financial software requirement text to obtain a segmentation result; and obtaining the financial software requirement text to be predicted according to the segmentation result.
[0059] In this embodiment, the server can obtain the original financial software demand text from the database, and the preprocessing includes word segmentation processing, and in some embodiments, it can also include preprocessing such as data cleaning and selection. The original financial software demand text includes multiple words, and the server can perform word segmentation on the original financial software demand text to obtain a word segmentation result, so that the server can obtain the financial software demand text to be predicted according to the word segmentation result.
[0060] Specifically, the database can be a Pandas database. The Pandas library is a powerful data processing library in Python that provides efficient data analysis methods and data structures. Since the risk prediction model needs to be trained using the financial software requirement text, the server can read the original financial software requirement text from the Pandas database, or read the training data D (x1,y) And the test data U (x2,y) . Among them, x1 and x2 represent different financial software demand texts in the above files, and y represents the file identifier. The server can also perform data cleaning and other processing on the original financial software demand text obtained above. And perform word segmentation on the cleaned data. For example, the server performs Chinese word segmentation on the original financial software demand text through the jieba library, so that the original financial software demand text is converted into a format that can be processed by deep learning, and the above financial software demand text to be predicted is obtained.
[0061] Step S204: extracting the corresponding fine-grained text feature matrix and coarse-grained text feature matrix according to the financial software requirement text.
[0062] The server can extract features of various granularity scales from the above-mentioned financial software demand text to be predicted, thereby utilizing the complementarity of text data of different granularity to mine the complementary characteristics of local features and global features, thereby improving the accuracy of risk prediction for the financial software demand text.
[0063] The server can extract the text feature matrices of fine-grained scale and coarse-grained scale in the financial software requirement text respectively. For example, the server can extract the corresponding fine-grained text feature matrix and coarse-grained text feature matrix based on the above financial software requirement text. For feature matrices of different granularity scales, the server can use different algorithms for extraction, including a first feature extraction algorithm and a second feature extraction algorithm. The first feature extraction algorithm can be used to extract a fine-grained text feature matrix, and the second feature extraction algorithm can be used to extract a coarse-grained text feature matrix. The first feature extraction algorithm can extract local features at the word level, and the second feature extraction algorithm can capture semantic global features at the sentence level. The server extracts text feature matrices of different granularity scales to better explore the complementary characteristics of local features and global features.
[0064] The fine-grained text feature matrix and the coarse-grained text feature matrix may both contain multiple rows and columns of text data, such as a matrix formed by features corresponding to multiple rows and columns of words, etc. The words may be words in the financial software requirement text.
[0065] Step S206, obtaining a fused text feature matrix according to the fine-grained text feature matrix and the coarse-grained text feature matrix.
[0066] After the server extracts the above-mentioned fine-grained text feature matrix and the coarse-grained text feature matrix, it can fuse the text feature matrices to obtain a fused text feature matrix. For example, the server can obtain a fused text feature matrix based on the above-mentioned fine-grained text feature matrix and the coarse-grained text feature matrix. The server can achieve the fusion of the fine-grained text feature matrix and the coarse-grained text feature matrix by weighted fusion. For example, the server learns the weights of the text feature matrices of each granularity scale through GRU (Gated Recurrent Uni, gated recurrent unit), and performs weighted fusion of the coarse-grained text feature matrix and the fine-grained text feature matrix according to the weights, so that the server dynamically adjusts the weights according to the different features of the input text, realizes the adaptive fusion of text features, and improves the flexibility and adaptability of text feature fusion.
[0067] Step S208, inputting the fused text feature matrix into the trained risk prediction model, and the risk prediction model outputs the risk prediction result corresponding to the financial software requirement text according to the fused text feature matrix.
[0068] Among them, the server can pre-train the risk prediction model to be trained, for example, by using the above training data and test data for training. The above fused text feature matrix can be used to input the trained risk prediction model. For example, the server inputs the above fused text feature matrix into the trained risk prediction model, and the risk prediction model predicts the risk of the financial software demand text according to the fused text feature matrix, and outputs the corresponding risk prediction results. Thus, the server can determine the items, words and other data with risks in the above financial software demand text to be predicted according to the above risk prediction results. Among them, the risk prediction of the fused text feature matrix by the above risk prediction model can be a random forest classification process. When the model predicts a high-risk text feature, a high-risk label can be added to it. When it predicts a low-risk text feature, the model adds a low-risk label to the low-risk text feature, so that the server can determine the labels of the words and items corresponding to each text feature in the financial software demand text according to the labels of each text feature in the output risk prediction result, and then determine the financial software demand text with high risk.
[0069] Among them, after the server determines the high-risk software requirement text in the financial software requirement text, it can output corresponding prompt information, so that the corresponding requirement formulation personnel can modify the software requirement text based on the prompt information.
[0070] In the above-mentioned demand risk prediction method, after respectively extracting a fine-grained text feature matrix and a coarse-grained text feature matrix from the financial software demand text, the text feature matrices of multiple granularities are fused to obtain a fused text feature matrix, and the risk prediction model performs risk prediction based on the fused text feature matrix, and outputs the risk prediction result corresponding to the financial software demand text. Compared with the traditional manual risk prediction of the financial software demand text, this solution improves the accuracy of risk prediction of the financial software demand text by extracting text features of multiple granularities from the financial software demand text and performing risk prediction on the fused text features of multiple granularities based on the risk prediction model.
[0071] In one embodiment, based on the financial software requirement text, the corresponding fine-grained text feature matrix and coarse-grained text feature matrix are extracted, including: according to a first feature extraction algorithm, extracting the fine-grained text feature matrix carrying first weight information corresponding to the financial software requirement text; according to a second feature extraction algorithm, extracting the coarse-grained text feature matrix carrying second weight information corresponding to the financial software requirement text; wherein the first weight information and the second weight information are calculated based on the preset key requirement text.
[0072] In this embodiment, the text feature matrix of each granularity carries corresponding weight information, and the weight information indicates the importance of each text feature in the text feature matrix, wherein the greater the weight of the text feature, the higher the risk of the text feature. The server can extract the text feature matrix of the corresponding granularity through the corresponding feature extraction algorithm, and determine the weight of the text feature corresponding to each word based on the comparison between each word in the financial software requirement text and the preset key requirement text.
[0073] For example, the server may obtain a preset key requirement text, wherein the high-risk requirement text may be words in the software requirements that have been pre-collected by experts and determined to be high-risk to the financial software system. The server may determine the weights of the text features corresponding to each text in the financial software requirement text based on the preset key requirement text, wherein for the first feature extraction algorithm and the second feature extraction algorithm, the weight determination process based on the preset key requirement text may be different, and the feature extraction algorithm may include the first feature extraction algorithm and the second feature extraction algorithm, so there is first weight information corresponding to the first feature extraction algorithm, and second weight information corresponding to the second feature extraction algorithm. The server may extract a fine-grained text feature matrix carrying the first weight information corresponding to the financial software requirement text according to the first feature extraction algorithm. The server may also extract a coarse-grained text feature matrix carrying the second weight information corresponding to the financial software requirement text according to the second feature extraction algorithm.
[0074] The server may further process the segmented financial software requirement text before extracting the coarse-grained text feature matrix to meet the processing requirements of the second feature extraction algorithm.
[0075] In one embodiment, before extracting the coarse-grained text feature matrix carrying the second weight information corresponding to the financial software requirement text according to the second feature extraction algorithm, it also includes: filling data for each word in the financial software requirement text according to a preset word length to obtain the filled financial software requirement text; and extracting the coarse-grained text feature matrix carrying the second weight information corresponding to the filled financial software requirement text according to the second feature extraction algorithm.
[0076] In this embodiment, the server may perform word segmentation on the above-mentioned financial software demand text in advance to obtain corresponding word segmentation results. The server may fill each word in the above-mentioned word segmentation result with the same length, such as a preset word length. The server may perform data filling on each word in the financial software demand text according to the above-mentioned preset word length to obtain the filled financial software demand text. The financial software demand text is converted into a format that can be processed by the second feature extraction algorithm, so that the server can extract the coarse-grained text feature matrix carrying the second weight information corresponding to the filled financial software demand text according to the second feature extraction algorithm.
[0077] Specifically, for extracting a coarse-grained text feature matrix, the server can index and transform the word segmentation results of the financial software demand text, and pad each word in the financial software demand text with the same length through padding, so that the text is converted into a format that can be processed by the second feature extraction algorithm. Among them, the second feature extraction algorithm can be a bidirectional GRU algorithm, and the server can use the above-mentioned padded financial software text to train the risk prediction model. Therefore, the server can also form training data and test data based on the above-mentioned padded financial software text. The dictionary size of the word segmentation result of the above-mentioned financial software demand text can be S, and the length of each word after padding is p. Then the server can generate training data through the above-mentioned padded financial software demand text. and test data . Among them, d1 represents the padded financial software text in the training data, and d2 represents the padded financial software text in the test data.
[0078] The server may perform a feature extraction process based on a second feature extraction algorithm on the filled financial software requirement text, thereby obtaining a coarse-grained text feature matrix carrying second weight information corresponding to the financial software requirement text.
[0079] Through the above embodiments, the server can extract text feature matrices of different granularities based on different feature extraction algorithms, and can index and transform the financial software requirement text so that the financial software requirement text meets the processing requirements of the second feature extraction algorithm. The server performs risk prediction on the financial software requirement text by combining the text feature matrices of the above multiple granularities, thereby improving the accuracy of risk prediction.
[0080] In one embodiment, according to a first feature extraction algorithm, a fine-grained text feature matrix carrying first weight information corresponding to the financial software requirement text is extracted, including: according to the first feature extraction algorithm, the first text feature matrix corresponding to the financial software requirement text is extracted; the first text feature matrix is reduced in dimension by principal component analysis to obtain the first text feature matrix after dimension reduction; according to a bidirectional attention mechanism, the target text features corresponding to the preset key requirement text in the first text feature matrix after dimension reduction are obtained, and the first weight is added to the target text features; according to the first text feature matrix after dimension reduction and the target text features after adding the first weight, a fine-grained text feature matrix carrying the first weight information is obtained.
[0081] In this embodiment, the server can extract the fine-grained text feature matrix corresponding to the financial software requirement text through the first feature extraction algorithm. The fine-grained text feature matrix carries the corresponding first weight information. The server can extract the first text feature matrix corresponding to the financial software requirement text according to the above-mentioned first feature extraction algorithm. The first text feature matrix includes text features corresponding to multiple words in the financial software requirement text after word segmentation. The server can reduce the dimension of the above-mentioned first text feature matrix through PCA (principal components analysis) to obtain the first text feature matrix after dimension reduction. The server reduces the dimension of the first text feature matrix so that the first text feature matrix is converted into a format that can be processed by the risk prediction model.
[0082] The first text feature matrix after dimensionality reduction includes multiple text features, and the server can add weights to these text features. For example, the server can obtain the target text features corresponding to the preset key demand text in the first text feature matrix after dimensionality reduction according to the two-way attention mechanism, and add the first weight to the target text features. Among them, the target text features represent the text features in the first text feature matrix that match the preset key words in the preset key demand text. The size of the above-mentioned first weight can be determined according to the preset weight of the preset key words it matches. Among them, each preset key word in the preset key demand text can be a demand text that has a great impact on the financial business processing system, that is, a demand text that requires important attention. The server can obtain a fine-grained text feature matrix carrying the first weight information based on the first text feature matrix after dimensionality reduction and the target text features after adding the first weight.
[0083] Specifically, after the server performs word segmentation on the financial software demand text, a financial software demand text containing multiple rows and columns of words can be obtained. The server can establish a dictionary for each column of data, which is recorded as dictionary T n , where T nThe number of words contained in can be t n . n is a natural number. The first feature extraction algorithm can be a TF-IDF (termfrequency–inverse document frequency) algorithm. TF-IDF is a text feature extraction method that can extract local features at the word level to measure the importance of each word to the text. The server extracts text features in the financial software requirement text through TF-IDF to obtain a first text feature matrix. The first text feature matrix can be specifically expressed as:
[0084] .
[0085] in, Represents the text features corresponding to the nth column in the financial software demand text after word segmentation. The server can use the fine-grained text feature matrix to train the risk prediction model, and the server can also generate corresponding training data and test data. The above d1 represents the financial software text in the training data, and d2 represents the financial software text in the test data. The server reduces the dimension of the above first text feature matrix to d*2 dimensions, that is, to two-dimensional data through principal component analysis. The above preset key demand text can be an important experience keyword sorted out by a two-way expert. The server matches each text feature in the above first text feature matrix with the preset key demand text through a two-way expert attention mechanism, so that the server obtains the weight parameter λ of each text feature matching each keyword according to the weight of each keyword in the preset key demand text, that is, the above first weight. Thus, the server can increase the importance of the above text features. The server can obtain a fine-grained text feature matrix based on the first text feature matrix processed by weight addition. Among them, the server can also use the fine-grained text feature matrix to train the risk prediction model, and the server can generate corresponding training data and test data based on the first text feature matrix. Among them, the training data can be expressed as , the test data can be expressed as .
[0086] Through this embodiment, the server can extract the text feature matrix corresponding to the financial software requirement text through the TF-IDF algorithm, and determine the weight information of each text feature through the attention mechanism, so as to extract the key features in large-scale software requirement text, which helps to better understand the software requirement content and thus improve the accuracy of risk prediction for financial software requirement text.
[0087] In one embodiment, according to a second feature extraction algorithm, a coarse-grained text feature matrix carrying second weight information corresponding to the financial software requirement text is extracted, including: according to the second feature extraction algorithm, the second text feature matrix corresponding to the financial software requirement text is extracted; the preset key requirement text is obtained, and according to the dimension corresponding to the second text feature matrix, the preset key requirement text is spatially mapped to obtain the corresponding key text feature matrix; according to the dot product calculation result of the second text feature matrix and the key text feature matrix, a second weight matrix is obtained; according to the second text feature matrix and the second weight matrix, a coarse-grained text feature matrix carrying the second weight information is generated.
[0088] In this embodiment, the server can extract the coarse-grained text feature matrix corresponding to the financial software demand text through the second feature extraction algorithm. The coarse-grained text feature matrix carries the corresponding second weight information. The server can extract the second text feature matrix corresponding to the financial software demand text according to the above second feature extraction algorithm. The second text feature matrix includes text features corresponding to multiple words in the financial software demand text after word segmentation. In addition, the server can perform index conversion on the financial software demand text after word segmentation, and then perform feature extraction.
[0089] The second text feature matrix after dimensionality reduction includes multiple text features, and the server can add weights to these text features. For example, the server can obtain the preset key demand text, and according to the dimension corresponding to the second text feature matrix, spatially map the preset key demand text to obtain the corresponding key text feature matrix. The server can obtain the second weight matrix by performing dot product calculation on the second text feature matrix and the key text feature matrix. Among them, the second weight matrix includes weight parameters corresponding to each text feature in the second text feature matrix. Thus, the server can generate a coarse-grained text feature matrix carrying the second weight information based on the above-mentioned second text feature matrix and the second weight matrix. Among them, the server can merge the second weight matrix with the second text feature matrix so that the weight parameters corresponding to each text feature in the second weight matrix match the corresponding text features in the second text feature matrix, thereby obtaining a coarse-grained text feature matrix carrying the second weight information.
[0090] Specifically, the second feature extraction algorithm can be a bidirectional GRU algorithm, and the server can use the bidirectional GRU algorithm to extract features. For example, the server extracts features from the segmented financial software requirement text based on the bidirectional GRU algorithm to obtain a corresponding second text feature matrix, where the feature dimension of the second text feature matrix is d*2, i.e., two-dimensional, and the number of times the a-th row of text in the matrix is num a , then the matrix dimension of the second text feature matrix is expressed as (numa , d*2). The server can pre-acquire expert experience vocabulary, that is, the above-mentioned preset key demand text, wherein the preset key demand text contains an expert vocabulary library, and the number of vocabulary libraries can be e. The server uses word embedding technology to put each word in the preset key demand text into the mapping space, thereby obtaining the corresponding key text feature matrix, and the matrix dimension of the matrix can be (e, d*2).
[0091] The server can determine the second weight matrix through the expert attention mechanism, that is, calculate the expert attention weight (second weight matrix) according to the above expert word mapping features (key text feature matrix) and the output of the bidirectional GRU algorithm (second text feature matrix). For example, the server can perform a dot product calculation on the matrix of the above expert word mapping features and the matrix of the output of the bidirectional GRU algorithm to obtain the above second weight matrix. The matrix dimension of the second weight matrix can be (num a , e). The server can perform linear dimensionality reduction on the second weight matrix, and then perform softmax (normalization) calculation to normalize the weight parameters in the second weight matrix to obtain the corresponding attention matrix (second weight matrix). The matrix dimension of the matrix can be expressed as (num a , 1).
[0092] After the server determines the second weight matrix and the second text feature matrix, it can apply each weight parameter in the second weight matrix to each text feature in the second text feature matrix by the attention weight method, thereby adjusting the degree of attention of the risk prediction model to different words. For example, the server combines each weight parameter in the second weight matrix to each corresponding text feature in the second text feature matrix to form a final text feature representation, that is, the coarse-grained text feature matrix.
[0093] The server can also use the coarse-grained text feature matrix to train the risk prediction model, and the server can generate corresponding training data and test data based on the second text feature matrix and the second weight matrix. The training data can be expressed as , the test data can be expressed as .
[0094] Through this embodiment, the server can extract the text feature matrix corresponding to the financial software requirement text through the bidirectional GRU algorithm, and determine the weight information of each text feature through vocabulary mapping, so as to better capture the semantic globality at the sentence level, help to better understand the software requirement content, and thus improve the accuracy of risk prediction for the financial software requirement text.
[0095] In one embodiment, a fused text feature matrix is obtained based on a fine-grained text feature matrix and a coarse-grained text feature matrix, including: linearly transforming the fine-grained text feature matrix and the coarse-grained text feature matrix through a gated recurrent unit to obtain a transformed fine-grained text feature matrix and a transformed coarse-grained text feature matrix; mapping the transformed fine-grained text feature matrix and the coarse-grained text feature matrix according to first weight information and second weight information to obtain corresponding mapping values; and weightedly fusing the fine-grained text feature matrix and the coarse-grained text feature matrix according to the mapping values to obtain a fused text feature matrix.
[0096] In this embodiment, the server may fuse the above-mentioned fine-grained text feature matrix and the coarse-grained text feature matrix. The server may linearly transform the fine-grained text feature matrix and the coarse-grained text feature matrix through the above-mentioned GRU (Gated Recurrent Unit) to obtain the transformed fine-grained text feature matrix and the transformed coarse-grained text feature matrix. The server may also map the above-mentioned transformed fine-grained text feature matrix and the transformed coarse-grained text feature matrix to obtain corresponding mapping values.
[0097] For example, the above-mentioned fine-grained text feature matrix corresponds to the first weight information, and the above-mentioned coarse-grained text feature matrix corresponds to the second weight information. The server can map the transformed fine-grained text feature matrix and the transformed coarse-grained text feature matrix according to the first weight information and the second weight information to obtain corresponding mapping values. Among them, the numerical range of the above-mentioned mapping value is between 0 and 1. Therefore, the server can perform weighted fusion on the fine-grained text feature matrix and the coarse-grained text feature matrix based on the above-mentioned mapping value to obtain a fused text feature matrix. For example, the server obtains a first added term according to the product between the mapping value and the fine-grained text feature matrix, and then multiplies the difference between the mapping value and one with the coarse-grained text feature matrix to obtain a second added term. The server obtains the fused text feature matrix according to the sum of the first added term and the second added term.
[0098] Specifically, the server learns the first weight information of the fine-grained text feature matrix and the second weight information of the coarse-grained text feature matrix through GRU. Among them, GRU includes a linear layer and a sigmoid activation function. The server linearly transforms the input fine-grained text feature matrix carrying the first weight information and the coarse-grained text feature matrix carrying the second weight information through GRU, and maps the result of the linear transformation to a value between 0 and 1 as a mapping value gate. Thereby, the server performs weighted fusion of features with smaller values and features with larger values according to the learned weights to obtain the above-mentioned fused text feature matrix. Among them, the size of the value can be determined according to the mapping value and the difference between the above-mentioned mapping value and one.
[0099] The server can also use the fused text feature matrix to train the risk prediction model, and the server can generate corresponding training data and test data based on the fusion results of the fine-grained text feature matrix and the coarse-grained text feature matrix. The fusion process can be expressed as:
[0100] .
[0101] Among them, for actual prediction, the fusion process is similar to the above process and will not be repeated here. represents the training data, Represents the test data. For the above fused text features, it can be expressed as . Where d represents the text data during actual prediction.
[0102] Through this embodiment, the server can learn the weights of each text feature matrix through GRU, and fuse the fine-grained and coarse-grained text feature matrices through weighted fusion, so that the server can dynamically adjust the weights according to the different features of the input text, realize the adaptive fusion of text features, and improve the flexibility and adaptability of text feature fusion. In addition, the server performs risk prediction based on the fused text feature matrix, which can improve the accuracy of risk prediction for financial software demand text.
[0103] In one embodiment, it also includes: obtaining the risk prediction model to be trained, the fused text feature matrix samples and the real risk prediction results corresponding to the fused text feature matrix samples; inputting the fused text feature matrix samples into the risk prediction model, and the risk prediction model outputs the corresponding risk prediction result samples according to the fused text feature matrix samples; inputting the real risk prediction results and the risk prediction result samples into a preset cross entropy loss function, and adjusting the model parameters of the risk prediction model according to the function value of the preset cross entropy loss function until the preset training end conditions are met, thereby obtaining a trained risk prediction model.
[0104] In this embodiment, the server can pre-train the risk prediction model to be trained. The server can obtain a fused text feature matrix sample, and obtain the real risk prediction result corresponding to the fused text feature matrix sample. Among them, the real risk prediction result can be a risk prediction result predetermined by an expert based on the fused text feature matrix sample. The server can input the above-mentioned fused text feature matrix sample into the risk prediction model, and the risk prediction model outputs the corresponding risk prediction result sample based on the fused text feature matrix sample.
[0105] Among them, the server can train the risk prediction model through the cross entropy loss function. For example, the server can input the above-mentioned real risk prediction results and risk prediction result samples into the preset cross entropy loss function, and adjust the model parameters of the risk prediction model according to the function value of the preset cross entropy loss function until the preset training end condition is met, thereby obtaining a trained risk prediction model. Among them, the preset training end condition includes but is not limited to that within the preset training times, the function value of the above-mentioned cross entropy loss function is less than the preset threshold; or the above-mentioned training times reach the preset training times.
[0106] Specifically, the risk prediction model can be a bidirectional GRU model, which includes a random forest classifier. The fused text feature matrix sample can be the training data , the above real risk prediction result can be Risk test The server creates a random forest classifier in a bidirectional GRU model using the training data It is trained and a cross entropy loss function is designed as the loss function of the above risk prediction model. The server uses the classification result of the random forest classifier as the prediction value , that is, the above risk prediction result sample, the server can send the real risk prediction result Risk train As the target value, calculate Risk train and When the value of the cross entropy loss does not meet the preset training end condition, the server adjusts the model parameters of the risk prediction model through back propagation.
[0107] For example, during the training process, the server updates the parameters of the bidirectional GRU model through the back propagation algorithm to minimize the function value of the cross entropy loss function, so that the risk prediction result samples output by the bidirectional GRU model through the random forest classifier are closer to the actual risk prediction results. When the preset training end conditions are met, the trained risk prediction model is obtained. After the training is completed, the server can use the test data The predictive ability of the risk prediction model is tested, and if the data results of the test data do not meet the actual risk prediction results, the risk prediction model is retrained.
[0108] Through this embodiment, the server can use a random forest classifier and a cross-entropy loss function to train a risk prediction model, combine machine learning with a two-way expert attention mechanism, and through back propagation, only need to iteratively optimize the characteristics of the two-way expert attention mechanism to form an integrated software requirement risk prediction system, thereby improving the accuracy of risk prediction for financial software requirements.
[0109] In an exemplary embodiment, Figure 2 As shown, Figure 2 This is a flow chart of a demand risk prediction method in another embodiment. In this embodiment, the server generates training data and test data corresponding to the financial software demand text, and uses the training data and test data to train the risk prediction model. The processing steps of the financial software demand text in the actual prediction can be similar to the processing steps of the training process.
[0110] The server can use the Pandas library to read a file containing training data D (x1,y) And the test data U (x2,y) These files contain information about the requirements items in the software requirements specification.
[0111] The server cleans and selects the above data. For example, the server selects attribute columns that are useful after bidirectional expert judgment from the training data and test data, which are recorded as training data D (d1,n) And the test data U (d2,n) , where n represents the number of words in the selected text. And the server can filter out data with high and low risk labels. train and Risk test Among them, Risk train is the actual risk prediction result corresponding to the above training data; Risk test is the actual risk prediction result corresponding to the above test data.
[0112] The server can also use the jieba library to pre-process the financial software requirement text and perform Chinese word segmentation on each text in order to convert the text into a format that can be processed by deep learning.
[0113] The server can perform fine-grained text reprocessing and feature extraction to form a fine-grained text feature matrix. The server can create a dictionary for each column of attributes in the financial software requirement text. TF-IDF is used to extract text features from text data. The TF-IDF matrix (first text feature matrix) is thus established, and the server reduces the dimension to d*2 through principal component analysis (PCA).
[0114] The server can sort out important experience keywords (preset key demand text) through bidirectional experts, and use the bidirectional expert attention mechanism in the TF-IDF feature to increase their importance. The feature matrix after the fine-grained expert attention mechanism is recorded as training data: , the test data can be expressed as .
[0115] The server can also perform coarse-grained text reprocessing and feature extraction to form a coarse-grained text feature matrix. For example, the server indexes the word segmentation results of the financial software requirement text and uses padding to fill the data to the same length so that the text can be converted into a format that can be processed by the bidirectional GRU. The dictionary size is S and the length after padding is p. That is, the training data and test data .
[0116] The server can perform feature extraction on the training data and test data. For example, the server uses a bidirectional GRU model for the text features after word segmentation. The feature dimension of the data is d*2, and the number of words in the a-th row is num. a , then the matrix dimension of the second text feature matrix is expressed as (num a , d*2).
[0117] The server can perform expert experience vocabulary mapping. For example, the server uses word embedding technology to put expert experience words into the mapping space, and the number of expert vocabulary libraries can be e. The matrix dimension is (e, d*2).
[0118] When calculating the expert attention mechanism, the server calculates the expert attention weight (the second weight matrix) based on the expert word mapping features and the output of the bidirectional GRU. For example, the server calculates the weight by performing a dot product calculation on the expert word mapping features and the output of the bidirectional GRU. The matrix dimension is (num a , e), the server performs linear dimensionality reduction on the weight matrix, and then normalizes the weights through softmax calculation. The matrix dimension of the attention matrix can be expressed as (num a , 1).
[0119] The server can also apply the calculated expert attention weights to the output of the bidirectional GRU (the second text feature matrix) to adjust the model's attention to different words. For example, the server recombines the output of the bidirectional GRU according to the attention weights to generate the final text feature representation (coarse-grained text feature matrix) and outputs it as a training set. and test data .
[0120] The server can also perform adaptive coarse-grained and fine-grained feature fusion through the gate control unit. For example, the server takes the coarse-grained and fine-grained feature matrices calculated by expert attention as input; it is expressed as:
[0121] .
[0122] Then, the server learns the weights of the two features through the gating unit, where the gating unit includes a linear layer and a Sigmoid activation function, which is used to map the linear transformation output of the input feature to a value between 0 and 1 to obtain the above mapping value, which can be recorded as gate. The server performs weighted fusion of the features with smaller values and the features with larger values based on the learned weights to obtain the final fused features (fused text feature matrix), which is specifically expressed as:
[0123] .
[0124] The server can also create a random forest classifier and use the training data When the model training is completed, the server can use the trained model to test the data. Make risk predictions to test whether the risk prediction model meets the requirements.
[0125] Among them, the server uses the cross entropy loss function as the loss function of the risk prediction model, and the server uses the classification result of the random forest as the prediction value (Risk prediction result sample), the true label Risk train As the target value, the cross entropy loss between the two is then calculated. During the training process, the back propagation algorithm is used to update the parameters of the bidirectional GRU model to minimize the loss function value. By minimizing the loss function, the server continuously adjusts the feature representation of the bidirectional GRU to make the classification result of the random forest closer to the true label, and finally obtains a trained risk prediction model.
[0126] Through the above embodiments, the server extracts text features of multiple granularities from the financial software requirement text, and performs risk prediction on the fused text features of multiple granularities based on the risk prediction model, thereby improving the accuracy of risk prediction for the financial software requirement text. In addition, the server forms a comprehensive software requirement risk prediction system by combining machine learning methods with a two-way expert attention mechanism. The prediction results of the random forest are evaluated using a cross-entropy loss function, and the features of the two-way expert attention mechanism are optimized by back propagation, thereby improving the accuracy of risk prediction.
[0127] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0128] Based on the same inventive concept, the embodiment of the present application also provides a demand risk prediction device for implementing the above-mentioned demand risk prediction method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more demand risk prediction device embodiments provided below can refer to the above-mentioned limitations on the demand risk prediction method, and will not be repeated here.
[0129] In an exemplary embodiment, Figure 3 As shown, a demand risk prediction device is provided, including: an acquisition module 500, an extraction module 502, a fusion module 504 and a prediction module 506, wherein:
[0130] The acquisition module 500 is used to acquire the financial software demand text to be predicted.
[0131] The extraction module 502 is used to extract the corresponding fine-grained text feature matrix and the coarse-grained text feature matrix according to the financial software requirement text.
[0132] The fusion module 504 is used to obtain a fused text feature matrix according to the fine-grained text feature matrix and the coarse-grained text feature matrix.
[0133] The prediction module 506 is used to input the fused text feature matrix into the trained risk prediction model, and the risk prediction model outputs the risk prediction result corresponding to the financial software requirement text according to the fused text feature matrix.
[0134] In one embodiment, the above-mentioned extraction module 502 is used to extract a fine-grained text feature matrix carrying first weight information corresponding to the financial software requirement text according to a first feature extraction algorithm; and to extract a coarse-grained text feature matrix carrying second weight information corresponding to the financial software requirement text according to a second feature extraction algorithm; wherein the first weight information and the second weight information are calculated based on a preset key requirement text.
[0135] In one embodiment, the extraction module 502 is used to extract a first text feature matrix corresponding to the financial software requirement text according to a first feature extraction algorithm; reduce the dimension of the first text feature matrix by principal component analysis to obtain a first text feature matrix after dimension reduction; obtain target text features corresponding to preset key requirement texts in the first text feature matrix after dimension reduction according to a bidirectional attention mechanism, and add a first weight to the target text features; obtain a fine-grained text feature matrix carrying the first weight information according to the first text feature matrix after dimension reduction and the target text features after adding the first weight.
[0136] In one embodiment, the extraction module 502 is used to extract the second text feature matrix corresponding to the financial software requirement text according to the second feature extraction algorithm; obtain the preset key requirement text, and spatially map the preset key requirement text according to the dimension corresponding to the second text feature matrix to obtain the corresponding key text feature matrix; obtain the second weight matrix according to the dot product calculation result of the second text feature matrix and the key text feature matrix; and generate a coarse-grained text feature matrix carrying the second weight information according to the second text feature matrix and the second weight matrix.
[0137] In one embodiment, the above-mentioned fusion module 504 is used to perform linear transformation on the fine-grained text feature matrix and the coarse-grained text feature matrix through a gated recurrent unit to obtain a transformed fine-grained text feature matrix and a transformed coarse-grained text feature matrix; map the transformed fine-grained text feature matrix and the coarse-grained text feature matrix according to the first weight information and the second weight information to obtain corresponding mapping values; and perform weighted fusion on the fine-grained text feature matrix and the coarse-grained text feature matrix according to the mapping values to obtain a fused text feature matrix.
[0138] In one embodiment, the above-mentioned device also includes: a training module, which is used to obtain the risk prediction model to be trained, the fused text feature matrix samples and the real risk prediction results corresponding to the fused text feature matrix samples; input the fused text feature matrix samples into the risk prediction model, and the risk prediction model outputs the corresponding risk prediction result samples according to the fused text feature matrix samples; input the real risk prediction results and the risk prediction result samples into a preset cross entropy loss function, and adjust the model parameters of the risk prediction model according to the function value of the preset cross entropy loss function until the preset training end conditions are met, so as to obtain a trained risk prediction model.
[0139] In one embodiment, the above-mentioned device also includes: a filling module, which is used to fill data for each word in the financial software requirement text according to a preset word length to obtain a filled financial software requirement text; according to a second feature extraction algorithm, extract a coarse-grained text feature matrix carrying second weight information corresponding to the filled financial software requirement text.
[0140] In one embodiment, the acquisition module 500 is used to acquire the original financial software requirement text; segment the original financial software requirement text to obtain a segmentation result; and obtain the financial software requirement text to be predicted based on the segmentation result.
[0141] Each module in the above-mentioned demand risk prediction device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0142] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store financial software demand text data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a demand risk prediction method is implemented.
[0143] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0144] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned demand risk prediction method when executing the computer program.
[0145] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned demand risk prediction method is implemented.
[0146] In one embodiment, when the computer program is executed by a processor, it also implements the above-mentioned demand risk prediction method.
[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0148] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0149] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0150] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A demand risk prediction method, characterized in that: The method comprises: Obtain the financial software demand text to be predicted; Extracting a corresponding fine-grained text feature matrix and a coarse-grained text feature matrix according to the financial software requirement text; Obtaining a fused text feature matrix according to the fine-grained text feature matrix and the coarse-grained text feature matrix; The fused text feature matrix is input into a trained risk prediction model, and the risk prediction model outputs a risk prediction result corresponding to the financial software requirement text according to the fused text feature matrix.
2. The method according to claim 1, characterized in that The step of extracting a corresponding fine-grained text feature matrix and a coarse-grained text feature matrix according to the financial software requirement text includes: Extracting a fine-grained text feature matrix carrying first weight information corresponding to the financial software requirement text according to a first feature extraction algorithm; Extracting a coarse-grained text feature matrix carrying second weight information corresponding to the financial software requirement text according to a second feature extraction algorithm; The first weight information and the second weight information are calculated based on a preset key requirement text.
3. The method according to claim 2, characterized in that The step of extracting a fine-grained text feature matrix carrying first weight information corresponding to the financial software requirement text according to the first feature extraction algorithm includes: Extracting a first text feature matrix corresponding to the financial software requirement text according to a first feature extraction algorithm; Performing dimensionality reduction on the first text feature matrix by principal component analysis to obtain a first text feature matrix after dimensionality reduction; According to the bidirectional attention mechanism, a target text feature corresponding to the preset key requirement text in the first text feature matrix after dimensionality reduction is obtained, and a first weight is added to the target text feature; A fine-grained text feature matrix carrying first weight information is obtained based on the first text feature matrix after dimensionality reduction and the target text features after adding the first weight.
4. The method according to claim 2, characterized in that: The step of extracting a coarse-grained text feature matrix carrying second weight information corresponding to the financial software requirement text according to the second feature extraction algorithm includes: Extracting a second text feature matrix corresponding to the financial software requirement text according to a second feature extraction algorithm; Acquire a preset key demand text, and perform spatial mapping on the preset key demand text according to the dimension corresponding to the second text feature matrix to obtain a corresponding key text feature matrix; Obtaining a second weight matrix according to a dot product calculation result of the second text feature matrix and the key text feature matrix; A coarse-grained text feature matrix carrying second weight information is generated according to the second text feature matrix and the second weight matrix.
5. The method according to claim 2, characterized in that: The step of obtaining a fused text feature matrix according to the fine-grained text feature matrix and the coarse-grained text feature matrix includes: By means of a gated recurrent unit, the fine-grained text feature matrix and the coarse-grained text feature matrix are linearly transformed to obtain a transformed fine-grained text feature matrix and a transformed coarse-grained text feature matrix; According to the first weight information and the second weight information, mapping the transformed fine-grained text feature matrix and the coarse-grained text feature matrix to obtain corresponding mapping values; According to the mapping values, the fine-grained text feature matrix and the coarse-grained text feature matrix are weightedly fused to obtain the fused text feature matrix.
6. The method according to claim 1, characterized in that The method further comprises: Obtaining a risk prediction model to be trained, a fused text feature matrix sample, and a real risk prediction result corresponding to the fused text feature matrix sample; Inputting the fused text feature matrix sample into the risk prediction model, and the risk prediction model outputting the corresponding risk prediction result sample according to the fused text feature matrix sample; The true risk prediction result and the risk prediction result sample are input into a preset cross entropy loss function, and the model parameters of the risk prediction model are adjusted according to the function value of the preset cross entropy loss function until the preset training end condition is met, thereby obtaining a trained risk prediction model.
7. The method according to claim 2, characterized in that Before extracting the coarse-grained text feature matrix carrying the second weight information corresponding to the financial software requirement text according to the second feature extraction algorithm, the method further includes: Filling each word in the financial software requirement text with data according to a preset word length to obtain a filled financial software requirement text; According to the second feature extraction algorithm, a coarse-grained text feature matrix carrying second weight information corresponding to the filled financial software requirement text is extracted.
8. The method according to any one of claims 1 to 7, characterized in that: The step of obtaining the financial software demand text to be predicted includes: Obtain original financial software requirement text; Performing word segmentation on the original financial software requirement text to obtain a word segmentation result; The financial software demand text to be predicted is obtained according to the word segmentation result.
9. A demand risk prediction device, characterized in that: The device comprises: An acquisition module, used to acquire the financial software demand text to be predicted; An extraction module, used to extract the corresponding fine-grained text feature matrix and coarse-grained text feature matrix according to the financial software requirement text; A fusion module, used for obtaining a fused text feature matrix according to the fine-grained text feature matrix and the coarse-grained text feature matrix; The prediction module is used to input the fused text feature matrix into a trained risk prediction model, and the risk prediction model outputs a risk prediction result corresponding to the financial software requirement text according to the fused text feature matrix.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.