Risk prediction method and device, electronic equipment and storage medium

By obtaining sample business text and risk categories in financial risk prediction, performing text mean calculation and feature aggregation, the problem of low risk prediction accuracy caused by small sample training data is solved, and more accurate risk prediction is achieved.

CN119719370APending Publication Date: 2025-03-28PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411769530.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the field of financial risk prediction, due to the small probability of abnormal events in financial business, the sample data required for model training is insufficient, resulting in low accuracy of risk prediction.

Method used

A risk prediction method is proposed, by obtaining sample business text and sample risk categories, calculating the text mean value to obtain sample text features, and sending them to the risk prediction end for feature aggregation, updating the target text features, thereby improving the accuracy of risk prediction.

Benefits of technology

Through this method, the dependence between the sample and the risk category can be fully learned in the small sample training data, the accuracy of risk prediction can be improved, and the problem of low risk prediction accuracy caused by insufficient sample size is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719370A_ABST
    Figure CN119719370A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a risk prediction method and device, electronic equipment and a storage medium, and belongs to the technical field of artificial intelligence. The method comprises the steps of obtaining a sample business text and a sample risk category of the sample business text, performing text mean value calculation on the sample business text according to the sample risk category to obtain a sample text feature, and sending the sample text feature and the sample risk category to a risk prediction end, and obtaining a reference text feature sent by the risk prediction end and a reference risk category of the reference text feature, wherein the reference text feature and the reference risk category are obtained by performing feature aggregation on the sample text feature by the risk prediction end according to the sample risk category. And updating the sample text feature according to the reference text feature and the reference risk category to obtain a target text feature. And performing risk prediction on the preset target business text through the target text feature to obtain the current risk category of the target business text, so that the accuracy of risk prediction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, is applicable to the field of financial technology, and particularly relates to a risk prediction method and device, electronic equipment and storage medium. Background Art

[0002] Intelligent prediction is to use artificial intelligence technology to analyze large amounts of data to identify complex patterns from the data and produce accurate prediction results. For example, in the field of financial risk prediction, model training usually requires a large amount of financial business data. Since the probability of abnormal financial business events such as suspicious transactions is small, the financial business end generates less financial business data, and the sample data required for model training is insufficient, resulting in low accuracy of risk prediction. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to propose a risk prediction method and device, an electronic device and a storage medium, aiming to improve the accuracy of risk prediction.

[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a risk prediction method, the method comprising:

[0005] Obtaining a sample business text and a sample risk category of the sample business text;

[0006] Calculating the text mean of the sample business text according to the sample risk category to obtain sample text features;

[0007] Sending the sample text features and the sample risk category to a risk prediction terminal;

[0008] Acquire the reference text features and the reference risk categories of the reference text features sent by the risk prediction end; wherein the reference text features and the reference risk categories are obtained by the risk prediction end performing feature aggregation on the sample text features according to the sample risk categories;

[0009] The sample text feature is updated according to the reference text feature and the reference risk category to obtain a target text feature;

[0010] The risk of a preset target business text is predicted by using the target text features to obtain a current risk category of the target business text.

[0011] In some embodiments, updating the sample text feature according to the reference text feature and the reference risk category to obtain the target text feature includes:

[0012] Updating the sample text features according to the reference text features to obtain candidate text features;

[0013] Perform risk prediction on the sample business text according to the candidate text features and the reference risk category to obtain a predicted risk category;

[0014] Calculate the loss according to the sample risk category and the predicted risk category to obtain target loss data;

[0015] The candidate text features are updated according to the target loss data to obtain the target text features.

[0016] In some embodiments, performing risk prediction on the sample business text according to the candidate text features and the reference risk category to obtain the predicted risk category includes:

[0017] Performing vectorization processing on the sample business text to obtain a business feature vector;

[0018] Calculating the distance between the business feature vector and the candidate text feature to obtain a text feature distance;

[0019] The reference risk category with the smallest text feature distance is selected as the predicted risk category.

[0020] In some embodiments, the vectorization processing of the sample business text to obtain the business feature vector includes:

[0021] Performing text segmentation on the sample business text to obtain sample words;

[0022] Extracting features of the sample words to obtain semantic features of the words;

[0023] Performing feature splicing on the semantic features of the words to obtain text semantic features;

[0024] Feature encoding is performed on the text semantic features to obtain the business feature vector.

[0025] In some embodiments, the obtaining of a sample business text and a sample risk category of the sample business text includes:

[0026] Obtaining an original business text and an original risk category of the original business text;

[0027] Performing category selection on the original risk category to obtain a selected risk category;

[0028] Selecting data from the original business text according to the selected risk category to obtain the sample business text;

[0029] The selected risk category is used as a sample risk category of the sample business text.

[0030] In some embodiments, the step of performing risk prediction on a preset target business text by using the target text feature to obtain a current risk category of the target business text includes:

[0031] Extracting features from the target business text to obtain target business features;

[0032] Perform risk level assessment according to the target business characteristics to obtain a business risk level;

[0033] Screening the target business text according to the business risk level to obtain a benchmark business text;

[0034] The risk of the benchmark business text is predicted by using the target text features to obtain the current risk category of the target business text.

[0035] In some embodiments, performing risk level assessment according to the target business characteristics to obtain the business risk level includes:

[0036] Performing a first risk level assessment according to the target business characteristics to obtain a first risk level;

[0037] Performing a second risk level assessment according to the target business characteristics to obtain a second risk level;

[0038] Calculate the difference between the first risk level and the second risk level to obtain a risk level deviation;

[0039] The business risk level is determined according to the risk level deviation, the first risk level, and the second risk level.

[0040] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a risk prediction device, the device comprising:

[0041] An acquisition module, used to acquire a sample business text and a sample risk category of the sample business text;

[0042] A calculation module, used for performing text mean calculation on the sample business text according to the sample risk category to obtain sample text features;

[0043] A sending module, used to send the sample text features and the sample risk category to a risk prediction terminal;

[0044] A receiving module, used for acquiring the reference text features and the reference risk categories of the reference text features sent by the risk prediction end; wherein the reference text features and the reference risk categories are obtained by the risk prediction end performing feature aggregation on the sample text features according to the sample risk categories;

[0045] An updating module, used for updating the sample text feature according to the reference text feature and the reference risk category to obtain a target text feature;

[0046] The risk prediction module is used to perform risk prediction on a preset target business text according to the target text features to obtain a current risk category of the target business text.

[0047] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0048] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0049] The risk prediction method, risk prediction device, electronic device and computer-readable storage medium proposed in the embodiment of the present application obtain sample business text and sample risk category of the sample business text to perform risk prediction based on the sample business text and sample risk category. The small sample training data contains a large number of risk categories, but there are a small number of samples in each risk category. In order to fully learn the dependency between the sample and the risk category, the sample business text is subjected to text mean calculation according to the sample risk category to capture the text features related to the sample risk category and obtain the sample text features. In order to solve the problem of insufficient sample size, the sample text features and the sample risk category are sent to the risk prediction end, and the risk prediction end performs feature aggregation on the sample text features according to the sample risk category to enhance the features of the sample text features of the same sample risk category, so as to achieve a comprehensive and sufficient feature expression of the text features under each risk category, and obtain the reference text features and reference risk category. The reference text features and the reference risk category of the reference text features sent by the risk prediction end are obtained, and the sample text features are updated according to the reference text features and the reference risk category to optimize the sample text features, obtain more accurate text features, and obtain the target text features. By using the target text features to predict the risk of the preset target business text, we can accurately capture the correlation between the target business text and the target text features, and then obtain the current risk category of the target business text, solving the problem of low risk prediction accuracy caused by insufficient training samples and improving the accuracy of risk prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a flow chart of the risk prediction method provided in an embodiment of the present application;

[0051] Figure 2 yes Figure 1 Flow chart of step S110 in FIG.

[0052] Figure 3 yes Figure 1 Flow chart of step S150 in FIG.

[0053] Figure 4 yes Figure 3 Flow chart of step S320 in FIG.

[0054] Figure 5 yes Figure 4 Flow chart of step S410 in FIG.

[0055] Figure 6 yes Figure 1 Flow chart of step S160 in FIG.

[0056] Figure 7 yes Figure 6 Flow chart of step S620 in FIG.

[0057] Figure 8 is a schematic diagram of the structure of a risk prediction device provided in an embodiment of the present application;

[0058] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0059] 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.

[0060] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0062] Intelligent prediction is to use artificial intelligence technology to analyze large amounts of data to identify complex patterns from the data and produce accurate prediction results. For example, in the field of financial risk prediction, model training usually requires a large amount of financial business data. Since the probability of abnormal financial business events such as suspicious transactions is small, the financial business end generates less financial business data, and the sample data required for model training is insufficient, resulting in low accuracy of risk prediction.

[0063] Based on this, the embodiments of the present application provide a risk prediction method, a risk prediction device, an electronic device and a computer-readable storage medium, aiming to improve the accuracy of risk prediction.

[0064] The risk prediction method, risk prediction device, electronic device and computer-readable storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the risk prediction method in the embodiments of the present application is described.

[0065] The risk prediction method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The risk prediction method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the risk prediction method, etc., but is not limited to the above forms.

[0066] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0067] Figure 1 It is an optional flow chart of the risk prediction method provided in an embodiment of the present application. The risk prediction method is applied to a client and may include but is not limited to steps S110 to S160.

[0068] Step S110, obtaining sample business texts and sample risk categories of the sample business texts;

[0069] Step S120, calculating the text mean of the sample business text according to the sample risk category to obtain the sample text feature;

[0070] Step S130, sending the sample text features and sample risk categories to the risk prediction end;

[0071] Step S140, obtaining the reference text features and the reference risk categories of the reference text features sent by the risk prediction end; wherein the reference text features and the reference risk categories are obtained by the risk prediction end performing feature aggregation on the sample text features according to the sample risk categories;

[0072] Step S150, updating the sample text features according to the reference text features and the reference risk categories to obtain target text features;

[0073] Step S160 , predicting the risk of a preset target business text based on the target text features, and obtaining the current risk category of the target business text.

[0074] In steps S110 to S160 shown in the embodiment of the present application, by calculating the text mean of the sample business text according to the sample risk category, the text features related to the sample risk category can be obtained. In order to solve the problem of low risk prediction accuracy caused by insufficient sample size, the risk prediction end aggregates the sample text features according to the sample risk category to enhance the features of the sample text under the sample risk category. The sample text features are updated according to the aggregated text features to obtain the target text features, which ensures the accuracy of the local text features of the client, so that the target business text can be predicted through the target text features, thereby improving the accuracy of risk prediction.

[0075] See also Figure 2 In some embodiments, step S110 may include but is not limited to steps S210 to S240:

[0076] Step S210, obtaining the original business text and the original risk category of the original business text;

[0077] Step S220, selecting the original risk category to obtain a selected risk category;

[0078] Step S230, selecting data from the original business text according to the selected risk category to obtain a sample business text;

[0079] Step S240: Use the selected risk category as a sample risk category of the sample business text.

[0080] In step S210 of some embodiments, the client generates business text data in the process of executing the business task. The client can also call the text generation interface to input business parameters and generate business text data according to preset generation rules and text generation templates. The client can be an internal database, file management system or business management system of the enterprise. Business parameters include business scenario type, business attribute field, field value range of business attribute field, etc. In order to improve the accuracy and reliability of risk prediction, the business text data is divided into a training set and a test set, and the model is trained according to the training set, and the model performance is evaluated according to the test set.

[0081] The original business text and the original risk category of the original business text are obtained from the training set. The original business text is a text related to a specific business task or process, and the original risk category is used to indicate the risk category of the text content of the original business text. For example, in the credit business, the original business text is the loan data text of the borrower who applies for a credit loan. The original business text includes historical loan records, historical repayment records, current loan amount, repayment period, financial status, etc. The original risk category is the credit risk category, which can be default risk, credit rating downgrade risk, on-balance sheet risk or off-balance sheet risk. In the financial transaction business, the original business text is the financial transaction text, and the original business text includes product name, product specification parameters, product quantity, product price, product delivery time, etc. The original risk category is the transaction risk category, and the original risk category includes product quality risk, product delivery risk or product price risk.

[0082] In step S220 of some embodiments, in a small sample scenario, the training set contains a large number of original risk categories, each of which has a small amount of original business text. If such a training set is used to train the risk prediction model, the model will not be able to fully learn the text semantic features under each risk category, making it impossible for the model to accurately capture the overall distribution of the original business text and the differences between the original risk categories, resulting in low accuracy in risk prediction. In order to improve the accuracy of risk prediction, it is necessary to screen the training set. Too many risk categories will result in smaller differences in business text features between risk categories, so the number of risk categories needs to be reduced. Specifically, C original risk categories are randomly selected from the training set to obtain C selected risk categories to reduce the number of original risk categories.

[0083] In step S230 of some embodiments, each original business text has an original risk category that matches it, and the original business text that matches the selected risk category can be obtained according to the selected risk category to obtain a sample business text. Specifically, each selected risk category has a small amount of original business text, and K original business texts are randomly selected from the training set for each selected risk category, so that each selected risk category has K sample business texts, and how to distinguish C risk categories is learned from C*K sample business texts to balance the number of business texts under each risk category, so that the difference between text feature distribution and risk categories can be fully learned.

[0084] In step S240 of some embodiments, the business text and the risk category usually exist in the form of a sample pair. In order to obtain the risk category of the sample business text, the selected risk category is used as the sample risk category of the sample business text.

[0085] Through the above steps S210 to S240, the business texts under each selected risk category can be evenly distributed, so that the business text features under the selected risk category are fully learned, thereby improving the accuracy of risk prediction.

[0086] In step S120 of some embodiments, the number of business texts under each risk category is small. In order to support small sample learning tasks, the sample business texts are subjected to text mean calculation according to the sample risk category, and multiple sample business texts with the same sample risk category are represented as mean vectors to obtain sample text features. Sample text features are common text features of sample risk categories. The overall text feature distribution of sample risk categories can be obtained by mean calculation, rather than over-relying on the details of a single sample business text, thereby improving the accuracy of risk prediction.

[0087] Specifically, feature extraction is performed on the sample business text to obtain a text feature vector. The vector mean is calculated for the text feature vectors with the same sample risk category to capture the text semantics related to the risk category and obtain the sample text feature. Assume that the client stores 4 sample business texts. The text feature vectors of these 4 sample business texts are x1, x2, x3 and x4, and the sample risk categories of x1, x2, x3 and x4 are y1, y2, y2 and y1, respectively. The sample risk category of x1 and x4 is y1. The mean of x1 and x4 is calculated, and the sample text feature of y1 is (x1+x4) / 2. The sample risk category of x2 and x3 is y2. The mean of x2 and x3 is calculated, and the sample text feature of y2 is (x2+x3) / 2.

[0088] The process of feature extraction for sample business text is as follows:

[0089] Perform word segmentation on the sample business text to obtain sample business terms. Perform convolution processing on the sample business terms through the first convolution layer to obtain a first convolution feature. Perform convolution processing on the sample business terms through the second convolution layer to obtain a second convolution feature. The convolution kernel sizes of the first convolution layer and the second convolution layer are different. For example, the convolution kernel size of the first convolution layer can be 2*2, and the convolution kernel size of the second convolution layer can be 4*4. Perform maximum pooling processing on the first convolution feature to obtain a first pooling feature. Perform maximum pooling processing on the second convolution feature to obtain a second pooling feature. Concatenate the first pooling feature and the second pooling feature to obtain a concatenated pooling feature. Perform feature mapping on the concatenated pooling feature through the fully connected layer to obtain a business term feature of the sample business terms. Perform feature concatenation on the business term features of all sample business terms to obtain a concatenated term feature. In the risk prediction process, the sample business text will contain time series data. For example, in credit risk prediction, the historical repayment text contains the time and amount of each repayment by the borrower, which is time series data. In order to capture the feature representation that changes over time in the time series data and establish long-term and short-term dependencies, the concatenated word features are extracted through the long short-term memory network to obtain the reference text features. The concatenated word features and the reference text features are fused to obtain the fused text features. The fused text features are input into the transformer model to extract the deep text semantics. The transformer model includes a first transformer encoding layer and a second transformer encoding layer. The fused text features are encoded by the first transformer encoding layer to obtain the initial encoding features. The initial encoding features are encoded by the second transformer encoding layer to obtain the text feature vector.

[0090] In step S130 of some embodiments, each client participating in risk prediction generates sample text features and sample risk categories according to steps S110 to S120, and sends the sample text features and sample risk categories to the risk prediction end, which performs feature enhancement based on the sample text features and sample risk categories of each client to obtain a more comprehensive feature representation. The risk prediction end is a server end, which is mainly used to perform complex data calculations on business text features from the client and provide data calculation results to the client.

[0091] In step S140 of some embodiments, the risk prediction end receives sample text features and sample risk categories from various clients, compares the sample risk categories, and calculates the mean of the sample text features with the same sample risk category to aggregate the sample text features of different clients for the same sample risk category, thereby obtaining more accurate text features related to the risk category, obtaining reference text features, and using the sample risk category as the reference risk category of the reference text features.

[0092] It should be noted that, in the process of calculating the mean, the sample text features of the same sample risk category sent by all clients can be added to obtain the feature sum, and the feature sum is divided by the number of clients to obtain the reference text features.

[0093] For example, the text data sent by client u1 to the risk prediction end are (us11, ys1) and (us12, ys2). Both us11 and us12 are sample text features, ys1 is the sample risk category of us11, and ys2 is the sample risk category of us12. The text data sent by client u2 to the risk prediction end are (us21, ys1) and (us22, ys2). Both us21 and us22 are sample text features, ys1 is the sample risk category of us21, and ys2 is the sample risk category of us22. The reference text features can be expressed as (us11+us21) / 2 and (us12+us22) / 2. The reference risk category of (us11+us21) / 2 is ys1, and the reference risk category of (us12+us22) / 2 is ys2.

[0094] See also Figure 3 In some embodiments, step S150 may include but is not limited to steps S310 to S340:

[0095] Step S310, updating the sample text features according to the reference text features to obtain candidate text features;

[0096] Step S320, performing risk prediction on the sample business text according to the candidate text features and the reference risk category to obtain a predicted risk category;

[0097] Step S330, performing loss calculation according to the sample risk category and the predicted risk category to obtain target loss data;

[0098] Step S340, updating the candidate text features according to the target loss data to obtain the target text features.

[0099] In step S310 of some embodiments, the sample text features are obtained based on the sample business texts of a single client. The number of texts of a single client is limited, so that the business text features of a single client are insufficient to represent the overall text features of the sample risk category. In order to obtain a more accurate text feature representation, the sample text features are updated to reference text features to obtain candidate text features.

[0100] In step S320 of some embodiments, in order to improve the accuracy of risk prediction, the candidate text features and reference risk categories optimized locally by the client are used to perform risk prediction on the sample business text, and a suitable reference risk category is screened for the sample business text to obtain a predicted risk category.

[0101] In step S330 of some embodiments, the sample risk category is taken as the true value, the predicted risk category is taken as the predicted value, and the loss calculation is performed on the sample risk category and the predicted risk category based on the cross entropy loss function to obtain the target loss data. The target loss data is used to evaluate the accuracy of risk prediction.

[0102] In step S340 of some embodiments, if the target loss data is greater than or equal to the preset loss threshold, it means that the current predicted risk category is inaccurate and the local candidate text features of the client need to be updated. Then, the candidate text features and the sample risk category are sent to the risk prediction end, and the intermediate text features and the intermediate risk category of the intermediate text features sent by the risk prediction end are obtained. The intermediate text features and the intermediate risk category are obtained by the risk prediction end by performing feature aggregation on the candidate text features according to the sample risk category with reference to step S140. The candidate text features are updated according to the intermediate text features and the intermediate risk category until the target loss data is less than the preset loss threshold or the difference between the intermediate text features of multiple consecutive feature aggregations is less than or equal to the preset error threshold, and the target text features are obtained.

[0103] Through the above steps S310 to S340, the local text features of the client can be optimized, which solves the problem of insufficient expression of text features in small sample scenarios, thereby improving the accuracy of risk prediction.

[0104] See also Figure 4 In some embodiments, step S320 may include but is not limited to steps S410 to S430:

[0105] Step S410, vectorizing the sample business text to obtain a business feature vector;

[0106] Step S420, calculating the distance between the business feature vector and the candidate text feature to obtain the text feature distance;

[0107] Step S430: Select the reference risk category with the smallest text feature distance as the predicted risk category.

[0108] In step S410 of some embodiments, the sample business text can be vectorized using a sentence-level pre-trained model such as BERT, GPT, etc., and the entire text can be converted into a vector to obtain a business feature vector. The sample business text can also be vectorized using a word embedding model such as word2vec, glove, etc. to capture the semantic information and contextual relationship of the word, obtain a word feature vector, and concatenate the individual word feature vectors to obtain a business feature vector. The text feature vector obtained by feature extraction of the sample business text in step S120 can also be used as a business feature vector. The business feature vector reflects the deep meaning and contextual relationship of the text content of the sample business text, and can be used to understand and assess the risk of the sample business text. For example, in financial risk prediction, the business feature vector can be a business type, changes in financial status, market sentiment, etc.

[0109] In step S420 of some embodiments, the distance between the business feature vector and the candidate text feature is calculated using indicators such as Euclidean distance and Mahalanobis distance to obtain the text feature distance. The larger the text feature distance, the smaller the similarity between the business feature vector and the candidate text feature.

[0110] In step S430 of some embodiments, in order to obtain an accurate risk category, a reference risk category with the smallest text feature distance is selected to select a risk category that is semantically closest to the candidate text feature to obtain a predicted risk category.

[0111] In the above steps S410 to S430, risk categories are assigned to text features through the semantic similarity between text features, without the need to use a large number of business text samples for model training. This solves the problem of low risk prediction accuracy caused by insufficient sample data, and at the same time improves the efficiency of risk prediction so that real-time risk prediction can be performed using local text features on the client.

[0112] See also Figure 5 In some embodiments, step S410 may include but is not limited to steps S510 to S540:

[0113] Step S510, performing text segmentation on the sample business text to obtain sample words;

[0114] Step S520, extracting features from sample words to obtain semantic features of the words;

[0115] Step S530, performing feature concatenation on the semantic features of the words to obtain text semantic features;

[0116] Step S540: perform feature encoding on the text semantic features to obtain a business feature vector.

[0117] In step S510 of some embodiments, in order to improve the text quality of the sample business text, the sample business text is preprocessed, and irrelevant characters such as special symbols and numbers in the sample business text can be deleted, or the sample business text can be converted into a unified encoding format such as UTF-8. If the sample business text needs to be case-sensitive, the sample business text can be converted to lowercase. After the sample business text is preprocessed, the sample business text is segmented by a word segmentation tool or a custom dictionary, and the sample business text is divided into words to obtain sample words.

[0118] In step S520 of some embodiments, the semantics of the sample words are extracted through a word embedding model to obtain word semantic features. The word embedding model can be a bag-of-words model, a word2vec model, a glove model, etc. The word semantic features are the semantic information carried by the sample words, including the meaning and emotional color of the sample words. For example, in the field of financial risk prediction, word semantic features can reflect the financial status of an enterprise, such as loss, liquidation, etc.

[0119] In step S530 of some embodiments, in order to obtain a comprehensive feature expression of the sample business text, feature concatenation is performed on word semantic features to obtain text semantic features.

[0120] In step S540 of some embodiments, the text semantic features are feature encoded by an encoder to extract deep text semantics and obtain the contextual relationship between word semantic features to obtain a business feature vector. The encoder can be a convolutional neural network, a recurrent neural network, a transformer model, a BERT model, etc.

[0121] Through the above steps S510 to S540, the text semantics of the sample business text can be accurately understood, and the text feature representation related to the sample risk category can be captured, so as to accurately distinguish different risk categories based on the text feature representation.

[0122] See also Figure 6 In some embodiments, step S160 may include but is not limited to steps S610 to S640:

[0123] Step S610, extracting features from the target business text to obtain target business features;

[0124] Step S620, performing risk level assessment according to target business characteristics to obtain a business risk level;

[0125] Step S630, screening the target business text according to the business risk level to obtain a benchmark business text;

[0126] Step S640: predict the risk of the benchmark business text based on the target text features to obtain the current risk category of the target business text.

[0127] In step S610 of some embodiments, referring to step S410 and step S510 to step S540, feature extraction is performed on the target business text to capture the text semantics of the target business text and obtain the target business features.

[0128] In step S620 of some embodiments, the client receives multiple target business texts at the same time. Different target business texts have different risk severity. In order to improve the efficiency of risk category prediction for target business texts, it is necessary to perform risk level assessment on the target business texts so that high-risk target business texts can be given priority for risk category prediction. In order to determine the risk prediction order of the target business texts, the risk level assessment model is used to assess the target business features to obtain the business risk level. The risk level assessment model can adopt a random forest, a boosted tree model, etc. Business risk levels include low risk, medium risk, or high risk. The risk severity of low risk, medium risk, or high risk increases in sequence.

[0129] In step S630 of some embodiments, the target business texts are sorted from high to low according to the business risk level to obtain a text sorting result. The target business texts are sequentially acquired according to the text sorting result to obtain a benchmark business text. Alternatively, the first K target business texts are selected according to the text sorting result, and the selected target business texts are used as benchmark business texts, where K is an integer greater than 0.

[0130] In step S640 of some embodiments, the benchmark business text may be vectorized with reference to step S410, step S510 to step S540 to obtain the benchmark business feature. The distance between the target text feature and the benchmark business feature is calculated based on indicators such as Euclidean distance and Mahalanobis distance. The greater the distance, the smaller the similarity between the target text feature and the benchmark business feature. The sample risk category of the target text feature with the smallest distance is selected as the current risk category of the target business text.

[0131] Through the above steps S610 to S640, risk prediction can be performed on high-risk business documents in priority, thereby improving the efficiency of risk prediction.

[0132] See also Figure 7 In some embodiments, step S620 may include but is not limited to steps S710 to S740:

[0133] Step S710, performing a first risk level assessment according to the target business characteristics to obtain a first risk level;

[0134] Step S720, performing a second risk level assessment according to the target business characteristics to obtain a second risk level;

[0135] Step S730, calculating the difference between the first risk level and the second risk level to obtain a risk level deviation;

[0136] Step S740, determining the business risk level according to the risk level deviation, the first risk level and the second risk level.

[0137] In step S710 of some embodiments, in order to improve the accuracy of risk level prediction and compensate for the prediction error caused by a single model, the embodiment of the present application uses multiple models to predict the risk level. The risk level assessment model includes a first sub-model and a second sub-model. The first sub-model and the second sub-model are different network models. The first sub-model can use a random forest, and the second sub-model can use a transformer model. The first sub-model includes a first decision tree and a second decision tree. The first decision tree is used to predict the first risk level of the target business feature to obtain a first risk probability, a second risk probability and a third risk probability. The first risk probability is the probability that the target business feature belongs to a high risk category, the second risk probability is the probability that the target business feature belongs to a medium risk category, and the third risk probability is the probability that the target business feature belongs to a low risk category. The second decision tree is used to predict the first risk level of the target business feature to obtain a fourth risk probability, a fifth risk probability and a sixth risk probability. The fourth risk probability is the probability that the target business feature belongs to a high risk category, the fifth risk probability is the probability that the target business feature belongs to a medium risk category, and the sixth risk probability is the probability that the target business feature belongs to a low risk category. The first risk probability and the fourth risk probability are added to obtain the first probability. The second risk probability and the fifth risk probability are added to obtain the second probability. The third risk probability and the sixth risk probability are added to obtain the third probability. Compare the first probability, the second probability and the third probability. If the first probability is the largest, high risk is taken as the first risk level, and the first probability is taken as the first candidate risk probability of the first risk level; if the second probability is the largest, medium risk is taken as the first risk level, and the second probability is taken as the first candidate risk probability of the first risk level; if the third probability is the largest, low risk is taken as the first risk level, and the third probability is taken as the first candidate risk probability of the first risk level.

[0138] In step S720 of some embodiments, the second risk level of the target business feature is evaluated by the second sub-model to obtain the seventh risk probability, the eighth risk probability and the ninth risk probability, wherein the seventh risk probability is the probability that the target business feature belongs to the high risk category, the eighth risk probability is the probability that the target business feature belongs to the medium risk category, and the ninth risk probability is the probability that the target business feature belongs to the low risk category. The seventh risk probability, the eighth risk probability and the ninth risk probability are compared. If the seventh risk probability is the largest, high risk is taken as the second risk level, and the seventh risk probability is taken as the second candidate risk probability of the second risk level; if the eighth risk probability is the largest, medium risk is taken as the second risk level, and the eighth risk probability is taken as the second candidate risk probability of the second risk level; if the ninth risk probability is the largest, low risk is taken as the second risk level, and the ninth risk probability is taken as the second candidate risk probability of the second risk level.

[0139] In step S730 of some embodiments, a mark value is set for a high risk category, a medium risk category, and a low risk category, and the mark values ​​of the high risk category, the medium risk category, and the low risk category are all non-negative numbers, and the mark values ​​of the high risk category, the medium risk category, and the low risk category decrease in sequence. The absolute value of the difference between the mark values ​​of the first risk level and the second risk level is obtained to obtain the level type deviation.

[0140] The first risk level has a first candidate risk probability, and the second risk level has a second candidate risk probability. The absolute value of the difference between the first candidate risk probability and the second candidate risk probability is obtained to obtain the risk probability deviation. The level type deviation and the risk probability deviation are added to obtain the risk level deviation. The risk level deviation can be used to measure the difference in prediction performance between the first sub-model and the second sub-model.

[0141] In step S740 of some embodiments, if the risk level deviation is less than or equal to the preset deviation threshold, it means that the prediction difference between the first sub-model and the second sub-model is small, and the first risk level and the second risk level are randomly screened to obtain the business risk level. If the risk level deviation is greater than the preset deviation threshold, it means that the prediction difference between the first sub-model and the second sub-model is large, and the first candidate risk probability and the second candidate risk probability are compared. If the first candidate risk probability is greater than or equal to the second candidate risk probability, the first risk level is used as the business risk level; if the first candidate risk probability is less than the second candidate risk probability, the second risk level is used as the business risk level. The preset deviation threshold can be set according to the actual situation, for example, it can be the absolute value of the difference between the high risk category and the low risk category mark value.

[0142] Through the above steps S710 to S740, the risk level of the business text can be accurately predicted, and the risk prediction order of the text data can be determined based on the risk level, so that the risk prediction of the text with a higher risk level can be carried out in time, thereby improving the efficiency of risk prediction.

[0143] See also Figure 8 The embodiment of the present application also provides a risk prediction device, which can implement the above-mentioned risk prediction method, and the risk prediction device includes:

[0144] An acquisition module 810 is used to acquire a sample business text and a sample risk category of the sample business text;

[0145] A calculation module 820 is used to calculate the text mean of the sample business text according to the sample risk category to obtain the sample text feature;

[0146] A sending module 830, used to send sample text features and sample risk categories to a risk prediction terminal;

[0147] The receiving module 840 is used to obtain the reference text features and the reference risk categories of the reference text features sent by the risk prediction end; wherein the reference text features and the reference risk categories are obtained by the risk prediction end performing feature aggregation on the sample text features according to the sample risk categories;

[0148] An updating module 850 is used to update the sample text features according to the reference text features and the reference risk categories to obtain target text features;

[0149] The risk prediction module 860 is used to perform risk prediction on a preset target business text according to the target text features to obtain the current risk category of the target business text.

[0150] The specific implementation of the risk prediction device is basically the same as the specific implementation of the above-mentioned risk prediction method, and will not be repeated here.

[0151] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above risk prediction method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.

[0152] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0153] The processor 910 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0154] The memory 920 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 920 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 920, and the processor 910 calls and executes the risk prediction method of the embodiment of this application;

[0155] Input / output interface 930, used to implement information input and output;

[0156] Communication interface 940, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0157] bus 950 , which transmits information between the various components of the device (e.g., processor 910 , memory 920 , input / output interface 930 , and communication interface 940 );

[0158] The processor 910 , the memory 920 , the input / output interface 930 , and the communication interface 940 are connected to each other in communication within the device via a bus 950 .

[0159] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned risk prediction method is implemented.

[0160] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0161] The risk prediction method, risk prediction device, electronic device, and computer storage medium provided in the embodiments of the present application can obtain text features related to the sample risk category by calculating the text mean of the sample business text according to the sample risk category. In order to solve the problem of low risk prediction accuracy caused by insufficient sample size, the risk prediction end aggregates the sample text features according to the sample risk category to enhance the features of the sample text under the sample risk category. The sample text features are updated according to the aggregated text features to obtain the target text features, which ensures the accuracy of the local text features of the client, so that the target business text can be predicted through the target text features, thereby improving the accuracy of risk prediction.

[0162] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0163] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0164] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0165] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0166] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0167] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0168] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0169] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0170] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0171] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0172] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A risk prediction method, characterized in that: The method comprises: Obtaining a sample business text and a sample risk category of the sample business text; Calculating the text mean of the sample business text according to the sample risk category to obtain sample text features; Sending the sample text features and the sample risk category to a risk prediction terminal; Acquire the reference text features and the reference risk categories of the reference text features sent by the risk prediction end; wherein the reference text features and the reference risk categories are obtained by the risk prediction end performing feature aggregation on the sample text features according to the sample risk categories; The sample text feature is updated according to the reference text feature and the reference risk category to obtain a target text feature; The risk of a preset target business text is predicted by using the target text features to obtain a current risk category of the target business text.

2. The method according to claim 1, characterized in that The updating of the sample text feature according to the reference text feature and the reference risk category to obtain the target text feature includes: Updating the sample text features according to the reference text features to obtain candidate text features; Perform risk prediction on the sample business text according to the candidate text features and the reference risk category to obtain a predicted risk category; Calculate the loss according to the sample risk category and the predicted risk category to obtain target loss data; The candidate text features are updated according to the target loss data to obtain the target text features.

3. The method according to claim 2, characterized in that The step of performing risk prediction on the sample business text according to the candidate text features and the reference risk category to obtain a predicted risk category includes: Performing vectorization processing on the sample business text to obtain a business feature vector; Calculating the distance between the business feature vector and the candidate text feature to obtain a text feature distance; The reference risk category with the smallest text feature distance is selected as the predicted risk category.

4. The method according to claim 3, characterized in that The vectorization processing of the sample business text to obtain a business feature vector includes: Performing text segmentation on the sample business text to obtain sample words; Extracting features of the sample words to obtain semantic features of the words; Performing feature splicing on the semantic features of the words to obtain text semantic features; Feature encoding is performed on the text semantic features to obtain the business feature vector.

5. The method according to claim 1, characterized in that The obtaining of the sample business text and the sample risk category of the sample business text includes: Obtaining an original business text and an original risk category of the original business text; Performing category selection on the original risk category to obtain a selected risk category; Selecting data from the original business text according to the selected risk category to obtain the sample business text; The selected risk category is used as a sample risk category of the sample business text.

6. The method according to any one of claims 1 to 5, characterized in that: The step of performing risk prediction on a preset target business text by using the target text feature to obtain a current risk category of the target business text includes: Extracting features from the target business text to obtain target business features; Perform risk level assessment according to the target business characteristics to obtain a business risk level; Screening the target business text according to the business risk level to obtain a benchmark business text; The risk of the benchmark business text is predicted by using the target text features to obtain the current risk category of the target business text.

7. The method according to claim 6, characterized in that The risk level assessment is performed according to the target business characteristics to obtain the business risk level, including: Performing a first risk level assessment according to the target business characteristics to obtain a first risk level; Performing a second risk level assessment according to the target business characteristics to obtain a second risk level; Calculate the difference between the first risk level and the second risk level to obtain a risk level deviation; The business risk level is determined according to the risk level deviation, the first risk level, and the second risk level.

8. A risk prediction device, characterized in that: The device comprises: An acquisition module, used to acquire a sample business text and a sample risk category of the sample business text; A calculation module, used for performing text mean calculation on the sample business text according to the sample risk category to obtain sample text features; A sending module, used to send the sample text features and the sample risk category to a risk prediction terminal; A receiving module, used for acquiring the reference text features and the reference risk categories of the reference text features sent by the risk prediction end; wherein the reference text features and the reference risk categories are obtained by the risk prediction end performing feature aggregation on the sample text features according to the sample risk categories; An updating module, used for updating the sample text feature according to the reference text feature and the reference risk category to obtain a target text feature; The risk prediction module is used to perform risk prediction on a preset target business text according to the target text features to obtain a current risk category of the target business text.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.