Text classification model training method, text classification method and storage medium
Through the closed-loop training method of the text classification model, the problem of low efficiency in manual identification of risk text in the prior art is solved, and the risk text recognition and classification of various clue channels is realized, and the risk control effect and efficiency are improved.
Patent Information
- Application Number
- CN202310659091.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-05
- Publication Date
- 2024-12-06
AI Technical Summary
In the prior art, the poor effect of identifying risk types from texts from various clue channels by manually browsing records is affected, and the risk control effect is also time-consuming and labor-intensive. The missing risk text is difficult to cover all clues to be predicted. channel.
A text classification model training method is adopted to train the text classification model through the initial training sample set, classify the predicted text, update the initial training sample set, and correct the results after retraining the model, form a closed-loop training process, and gradually improve it. The accuracy of the text classification model and the processing efficiency of risk control personnel.
It improves the recognition and classification effect of risk text, reduces the identification cost, is applicable to various clue channels, enhances risk resistance, and improves the text processing efficiency of risk control personnel.
Smart Images

Figure CN119088953A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a training method for a text classification model, a text classification method, a computer-readable storage medium, and an electronic device. Background Art
[0002] With the development of computer and Internet technology, higher requirements are placed on risk management of systems in various application scenarios. Being able to specifically identify risky texts and stop losses in a timely manner has become one of the tasks that cannot be underestimated in risk management.
[0003] The relevant technology requires manual regular browsing of records to identify risk types from texts of various clue channels. However, it has the disadvantage of poor recognition and classification of risk texts, which affects the risk management effect to a certain extent.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a training method for a text classification model, a text classification method, a computer-readable storage medium and an electronic device, thereby improving the recognition and classification effects of risk texts at least to a certain extent.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a method for training a text classification model is provided, comprising: training the text classification model according to an initial training sample set, classifying text to be predicted using the trained text classification model to determine risk text from the text to be predicted and updating it to the initial training sample set; retraining the text classification model based on the updated initial training sample set, classifying the text to be predicted using the retrained text classification model to obtain a risk classification result; in response to a correction operation on the risk classification result, feeding back the corrected risk classification result to the updated initial training sample set to train the retrained text classification model to obtain a trained text classification model.
[0008] In an exemplary embodiment of the present disclosure, the text classification model includes a first sub-model and a second sub-model, and the training of the text classification model according to the initial training sample set includes:
[0009] The first sub-model is trained using the initial training sample set; the output result of the first sub-model is the target initial training sample corresponding to the risk text result, which is determined as the training sample of the second sub-model and model training is performed; wherein the second sub-model is used to classify the risk scenario to which the training sample belongs.
[0010] In an exemplary embodiment of the present disclosure, the step of using a trained text classification model to classify the text to be predicted to determine risky texts from the text to be predicted and updating them to the initial training sample set includes:
[0011] The trained text classification model is used to classify the text to be predicted to obtain the probability that the text to be predicted corresponds to different risk scenarios; in response to the probability that the target text to be predicted corresponds to the target risk scenario satisfying the set confidence condition, the target text to be predicted is determined as the risk text; the risk text and the risk scenario corresponding to the risk text are added to the initial training sample set.
[0012] In an exemplary embodiment of the present disclosure, the risk classification result includes the risk scenario corresponding to the text to be predicted and the confidence probability that the text to be predicted belongs to the risk scenario;
[0013] In response to the correction operation on the risk classification result, the corrected risk classification result is fed back to the updated initial training sample to train the retrained text classification model to obtain the trained text classification model, including: looping the following process until the risk classification result of the text to be predicted meets the model training stop condition, and determining the candidate text classification model finally obtained as the trained text classification model: based on the confidence probability, screening part of the text to be predicted from the text to be predicted; feeding back the corrected risk classification result corresponding to the part of the text to be predicted to the updated initial training sample to train the retrained text classification model to obtain the candidate text classification model; and using the candidate text classification model to classify the text to be predicted to obtain the risk classification result.
[0014] In an exemplary embodiment of the present disclosure, the method of filtering part of the text to be predicted from the text to be predicted based on the confidence probability includes: sorting the text to be predicted in descending order according to the confidence probability; obtaining a target number of the text to be predicted that are at the front positions from the sorting result to obtain the part of the text to be predicted.
[0015] In an exemplary embodiment of the present disclosure, the risk classification result of the text to be predicted satisfies the model training stopping condition, including: obtaining the number of texts with correct risk classification results in the part of the text to be predicted obtained by screening the text to be predicted; in response to the number of texts exceeding a first quantity threshold, determining that the risk classification result of the text to be predicted satisfies the model training stopping condition.
[0016] In an exemplary embodiment of the present disclosure, in response to the correction operation on the risk classification result, the corrected risk classification result is fed back to the updated initial training sample set to train the retrained text classification model to obtain the trained text classification model, including: adding the corrected risk classification result to the risk clue library; in response to the risk clue library satisfying the model training start condition, the corrected risk classification result in the risk clue library that has not participated in the model training is fed back to the updated initial training sample set to iteratively train the retrained text classification model to obtain the trained text classification model.
[0017] In an exemplary embodiment of the present disclosure, before training the text classification model according to the initial training sample set, it also includes: obtaining a first sample set in the clue channel to be predicted by using keyword retrieval; obtaining text that meets text screening conditions from the clue channel to be predicted to obtain a second sample set; and data labeling the samples in the first sample set and the second sample set to obtain the initial training sample set, wherein the data labeling includes risk scenarios corresponding to the labeled samples.
[0018] According to one aspect of the present disclosure, a text classification method is provided, comprising: inputting a text to be predicted into a trained text classification model to determine risk text from the text to be predicted and updating it to an initial training sample set, wherein the trained text classification model is obtained by training a text classification model based on the initial training sample set; classifying the text to be predicted using the retrained text classification model to obtain a risk classification result, wherein the retrained text classification model is obtained by retraining the text classification model based on an updated initial training sample set; and in response to a correction operation on the risk classification result, determining the corrected risk classification result as a target text classification result.
[0019] In an exemplary embodiment of the present disclosure, the correction operation on the risk classification result is performed based on a preset risk definition library, and in response to the correction operation on the risk classification result, the corrected risk classification result is determined as the target text classification result, including: in response to the correction operation on the risk classification result based on the preset risk definition library, the target text classification result is added to the risk clue library; and the corrected risk classification results in the risk clue library that have not participated in model training are updated to the initial training sample set for iterative training of the retrained text classification model.
[0020] In an exemplary embodiment of the present disclosure, the risk clue library includes risk links and risk categories corresponding to different risk scenarios. After the modified risk classification result is determined as the target text classification result in response to the modification operation on the risk classification result, it also includes: according to the risk scenario corresponding to the text to be predicted in the target text classification result, determining the target risk link and target risk category corresponding to the target text classification result according to the risk clue library.
[0021] In an exemplary embodiment of the present disclosure, the method further includes: in response to an editing operation on the risk definition library or the risk clue library, providing a corresponding editing result.
[0022] According to one aspect of the present disclosure, a training device for a text classification model is provided, the device comprising: a first training module, used to train the text classification model according to an initial training sample set, and use the trained text classification model to classify the text to be predicted so as to determine the risk text from the text to be predicted and update it to the initial training sample set; a second training module, used to retrain the text classification model based on the updated initial training sample set, and use the retrained text classification model to classify the text to be predicted to obtain a risk classification result; a correction processing module, used to respond to the correction operation on the risk classification result, feed back the corrected risk classification result to the updated initial training sample set to train the retrained text classification model, and obtain a trained text classification model.
[0023] According to one aspect of the present disclosure, a text classification device is provided, comprising: a first classification module, used to input a text to be predicted into a trained text classification model to determine risk text from the text to be predicted and update it to an initial training sample set, wherein the trained text classification model is obtained by training a text classification model based on the initial training sample set; a second classification module, used to classify the text to be predicted using a retrained text classification model to obtain a risk classification result, wherein the retrained text classification model is obtained by retraining the text classification model based on an updated initial training sample set; and a correction processing module, used to determine the corrected risk classification result as a target text classification result in response to a correction operation on the risk classification result.
[0024] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any one of the above methods is implemented.
[0025] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned methods by executing the executable instructions.
[0026] The training method of the text classification model in the exemplary embodiment of the present disclosure, on the one hand, adopts the text classification model trained based on the initial training sample to classify the text to be predicted, updates the risk text in the text to be predicted to the initial training sample set according to the prediction result, increases the number of training samples in the model training process, and feeds back the corrected risk classification result to the updated initial training sample set, further enriches the number of training samples, and trains the text classification model by expanding the training samples in the model training process, which is beneficial to improve the training accuracy of the text classification model; on the other hand, since the text to be predicted is predicted by the retrained text classification model, a clear risk classification result can be output, and the text to be predicted with the risk classification result marked can be quickly corrected by the risk control personnel, which improves the text processing efficiency of the risk control personnel, thereby improving the recognition efficiency of the risk text and reducing the recognition cost; on the other hand, this solution can be applied to any clue channel, and is universal for various clue channels with a wide variety of risk types. The trained text classification model can be used to identify risk texts in various clue channels, which is beneficial to timely discover risk clues to improve risk resistance.
[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0029] Figure 1 A schematic diagram showing the stages involved in a text classification scheme according to an embodiment of the present disclosure;
[0030] Figure 2 A flowchart of a method for training a text classification model according to an exemplary embodiment of the present disclosure is shown;
[0031] Figure 3 A flowchart of obtaining an initial training sample set according to an exemplary embodiment of the present disclosure is shown;
[0032] Figure 4 A schematic diagram of a prediction phase of a text classification model according to an exemplary embodiment of the present disclosure is shown;
[0033] Figure 5 A structural diagram of a text classification model according to an exemplary embodiment of the present disclosure is shown;
[0034] Figure 6 A flow chart showing an implementation method of enriching the number of samples in an initial training sample set according to an exemplary embodiment of the present disclosure;
[0035] Figure 7 A flowchart showing a method for simultaneously expanding the number of samples in an initial sample set and implementing iterative model training according to an exemplary embodiment of the present disclosure is shown;
[0036] Figure 8 A schematic diagram of an application scenario involved in a training method for a text classification model according to an exemplary embodiment of the present disclosure is shown;
[0037] Fig. 9 A flowchart of a text classification method according to an exemplary embodiment of the present disclosure is shown;
[0038] Fig.10 A schematic diagram of a visualization interface according to an exemplary embodiment of the present disclosure is shown;
[0039] Fig.11 A structural diagram of a training device for a text classification model according to an exemplary embodiment of the present disclosure is shown;
[0040] Fig.12 A structural diagram of a text classification device according to an exemplary embodiment of the present disclosure is shown;
[0041] Fig.13A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown.
[0042] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0043] The exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and the concepts of the exemplary embodiments will be fully conveyed to those skilled in the art. The same reference numerals in the figures represent the same or similar structures, and thus their detailed description will be omitted.
[0044] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known structures, methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0045] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or these functional entities or parts of functional entities may be implemented in one or more software hardened modules, or these functional entities may be implemented in different networks and / or processor devices and / or microcontroller devices.
[0046] Figure 1 A schematic diagram showing the stages involved in the text classification scheme of an embodiment of the present disclosure is shown. Figure 1 , the text classification scheme of the embodiment of the present disclosure may include a model training phase and a model application phase.
[0047] In the model training phase, the text classification model can be trained using training samples until the model training stop condition is met to obtain a trained model. In the model application phase, the trained model can be used to classify the text to be predicted to generate risk classification results.
[0048] Among them, in order to further expand the number of training samples, the embodiment of the present disclosure first uses the trained text classification model to classify the text to be predicted, so as to determine the risk text from the text to be predicted and add it to the training samples, and use the training samples to retrain the text classification model, and add the corrected results of the risk classification results to the training samples again to iteratively train the text classification model, forming a closed loop of result correction, model training and classification prediction, so that while the training samples are expanded to a sufficient scale, the text classification model meets the training stop conditions, such as the prediction accuracy reaches the target threshold.
[0049] In addition, after the trained model is used to classify the new text to be predicted, the risk classification result of the newly obtained text to be predicted can also continue to be used as a training sample to participate in the subsequent iterative training of the model.
[0050] In related technologies, risk control personnel can extract risk types, risk links and corresponding specific scenarios by reading risk clue texts, and then generate professional risk definitions. Risk control personnel can use the defined risk definitions to specifically discover risk profit and loss scenarios and stop losses. In related technologies, the method of identifying risk texts based on text classification mainly relies on the risk control personnel to regularly browse and record the channels for clues to be predicted. Channels for clues to be predicted include employee forums, corporate case platforms or applications.
[0051] However, in the text classification methods of related technologies, the amount of manual text browsing is limited, the method of obtaining risk text is inefficient and cannot cover all clue channels to be predicted. Due to the large number of clue scenarios, manual identification is time-consuming and laborious, and there are missed risk texts, that is, the identification and classification of risk texts for each prediction clue channel is inefficient.
[0052] For example, taking the employee forum as an example, the risk control personnel's browsing history of the text depends on clicking on the post to read and record it in the document. In the test, the rate of manually browsing the risk clue text and extracting risk records is about 50-60 per hour, of which more than 90% of the text is invalid text, that is, the text segment does not contain any risk clues. At the same time, there are at least thirty known risk scenarios, and it is impossible to accurately locate the risk scenario to which the risk text belongs.
[0053] Based on this, in an exemplary embodiment of the present disclosure, a training method for a text classification model is first provided, such as Figure 2 A flowchart of a text classification model training method according to an exemplary embodiment of the present disclosure is shown. Figure 2 As shown, the training method of the text classification model of the embodiment of the present disclosure may include steps S210 to S230:
[0054] In step 210: a text classification model is trained according to the initial training sample set, and the trained text classification model is used to classify the text to be predicted, so as to determine the risk text from the text to be predicted and update it to the initial training sample set.
[0055] In an exemplary embodiment of the present disclosure, the initial training sample set is obtained by collating the text data related to the risk type, risk link and risk scenario of each clue channel. The clue channel refers to the target object of risk control management and the source of the text for text classification processing, such as employee forums, corporate case platforms or applications, etc., without special restrictions. Risk text refers to text with obvious risk probability in the text to be predicted. Among them, the text classification model can be a deep neural network model, such as C-LSTM (Long Short Term Memory), RCNN (Regions with CNN features) or Bert model, etc., without special restrictions.
[0056] In an exemplary embodiment, before training the text classification model according to the initial training sample set, the initial training sample set is first obtained. Obtaining the initial training sample set may include steps S310 to S330:
[0057] Step S310: Acquire a first sample set in the clue channel to be predicted by using a keyword search method.
[0058] A keyword dictionary can be obtained according to the risk type, risk link and risk scenario of each clue channel to be predicted, so that the keyword dictionary covers all risk types, risk links and risk scenarios. It is worth noting that since the present disclosure uses machines instead of people to enrich training samples during the model training process, the keyword dictionary obtained only needs to include a small number of keywords while covering all risk types, risk links and risk scenarios, thereby reducing the cost of arranging the keyword dictionary.
[0059] Furthermore, a text search is performed on each clue channel to be predicted based on the keywords to obtain a first sample set, wherein the text search method is, for example, Boolean search, phrase search, fuzzy search, etc., and no special requirements are made for this.
[0060] Step S320: obtaining texts satisfying the text screening condition from the clue channel to be predicted to obtain a second sample set.
[0061] The text screening conditions can be set according to actual search requirements, for example, the text can be set to contain information with a large amount of information such as a telephone number, a waybill number, or an identification of a department, or can be screened according to the length of the text, such as sorting the texts from the longest to the shortest length, and then screening out some of the longest texts. The present disclosure can filter the texts from the clue channel to be predicted according to the text screening conditions to obtain the second sample set.
[0062] It is worth noting that in order to avoid excessive cost in acquiring the initial sample set, the number of samples in the initial sample set can also be controlled within a target number range. For example, the target number range can be completed within the allowed working time.
[0063] Step S330: perform data annotation on samples in the first sample set and the second sample set to obtain an initial training sample set, wherein the data annotation includes risk scenarios corresponding to the annotated samples.
[0064] After obtaining the first sample set and the second sample set, data annotation may be performed on the samples in the first sample set and the second sample set, that is, the risk type (risk scenario) corresponding to each sample may be annotated to generate an initial training sample set based on the annotated samples.
[0065] The disclosed embodiment combines texts containing keywords and texts containing a large amount of information to generate an initial training sample set, thereby enriching the coverage of the samples and facilitating the expressiveness of the trained model in various risk scenarios.
[0066] In an exemplary embodiment, in order to increase the number of initial training sample sets, the trained text classification model is first used to classify the text to be predicted, so as to determine the risky text from the text to be predicted and update it to the initial training sample set.
[0067] Specifically, if Figure 4 FIG. 2 shows a schematic diagram of the prediction stage of a text classification model according to an exemplary embodiment of the present disclosure. Figure 4 As shown, in the prediction process of the deep learning text classification model, the text classification model actually outputs the probability that the text belongs to each category first, and then selects the category corresponding to the maximum probability as the classification result of the text. Based on this, the embodiment of the present disclosure uses the intermediate results (the probability of belonging to each category) to determine the risk text from the text to be predicted.
[0068] For example, if the probability that the text classification model outputs that the text to be predicted A belongs to risk scenario 1 is much greater than the probability that the text to be predicted A belongs to other risk scenarios, the text to be predicted A is added to the initial training sample set as a risk text. If the probability that the text to be predicted A belongs to risk scenario 1 is 99%, and the probability of belonging to other risk scenarios is only 1%, it means that the text classification model has a high confidence in outputting the correct classification result of the text to be predicted A, and the text to be predicted A is determined to be a risk text and added to the initial training sample set.
[0069] By using the intermediate results of the text classification model to filter out risky texts from the text to be predicted and updating them to the initial training sample set, the number of samples in the initial training sample set can be increased. For example, taking the employee forum as a clue channel, the number of initial training sample sets can be expanded from hundreds to thousands.
[0070] In step S220: the text classification model is retrained based on the updated initial training sample set, and the text to be predicted is classified using the retrained text classification model to obtain a risk classification result.
[0071] In an exemplary embodiment of the present disclosure, the risk classification result includes the text to be predicted, the risk scenario corresponding to the text to be predicted, and the confidence probability that the text to be predicted belongs to the risk scenario. After the risk text is updated to the initial training sample set, the text classification model is retrained using the updated initial training sample set, and the retrained text classification model is used to classify the text to be predicted to obtain the risk classification result.
[0072] Since this process uses the expanded initial training sample set to train the model, the correct classification probability of the retrained text classification model can be improved to a certain extent.
[0073] In step S230: in response to the correction operation on the risk classification result, the corrected risk classification result is fed back to the updated initial training sample set to train the retrained text classification model to obtain a trained text classification model.
[0074] In an exemplary embodiment of the present disclosure, after the risk classification result of each text to be predicted is obtained, the risk classification result can be fed back to the risk control personnel. Since the risk control personnel correct the risk classification result, a corrected risk classification result is obtained.
[0075] In some possible embodiments, if the risk classification result of the text to be predicted is correct, the risk classification result is directly used as the revised risk classification result.
[0076] In some possible embodiments, if the risk classification result shows that the text to be predicted is not a risky text, the risk scenario of the text to be predicted may be left blank.
[0077] The corrected risk classification result can be determined as the final prediction result of the text to be predicted, that is, the risk scenario to which the text to be predicted belongs can be determined. The embodiment of the present disclosure also adds the corrected risk classification result to the updated initial training sample set, that is, the text to be predicted with the risk scenario clarified after correction by the risk control personnel is fed back to the updated initial training sample set again, thereby expanding the number of initial sample sets for iterative training of the text classification model to obtain a trained text classification model.
[0078] Since the risk classification results are output by the retrained text classification model, the risk classification results have clearly defined the risk scenarios of the text to be predicted. Risk control personnel can quickly learn about the risk scenarios of the text to be predicted during the correction process, which improves the correction efficiency of risk control personnel. For example, for risk classification results that are correctly classified, risk control personnel do not need to do anything.
[0079] Through the training method of the text classification model of the embodiment of the present disclosure, the predicted text is classified by using the text classification model trained based on the initial training sample, and the risk text in the text to be predicted is updated to the initial training sample set according to the prediction result, the number of training samples is increased during the model training process, and the corrected risk classification result is fed back to the updated initial training sample set to further enrich the number of training samples. By expanding the training samples during the model training process to train the text classification model, it is beneficial to improve the training accuracy of the text classification model; because the text to be predicted is predicted by the retrained text classification model, a clear risk classification result can be output, and the text to be predicted with the risk classification result marked can be quickly corrected by the risk control personnel, thereby improving the text processing efficiency of the risk control personnel, thereby improving the recognition efficiency of the risk text and reducing the recognition cost; in addition, this solution can be applied to any clue channel, and is universal for various clue channels with a wide variety of risk types. The trained text classification model can be used to identify risk texts in various clue channels, which is beneficial to timely discover risk clues to improve risk resistance.
[0080] In an exemplary embodiment, since the proportion of valid risk texts in the texts to be predicted obtained from the clue channel to be predicted may be low, in order to improve the classification accuracy of the trained text classification model, the training samples may be filtered first to determine the risk samples.
[0081] like Figure 5 FIG. 4 shows a structural diagram of a text classification model according to an exemplary embodiment of the present disclosure. Figure 5 As shown, the text classification model may include a first sub-model and a second sub-model. Based on the output result of the first sub-model, the training samples input to the second sub-model are screened from the initial training sample set. Specifically:
[0082] Using the initial training sample set to train the first sub-model;
[0083] The output result of the first sub-model is the target initial training sample corresponding to the risk text result, which is determined as the training sample of the second sub-model and model training is performed.
[0084] Among them, the first sub-model can perform binary classification tasks for the binary classification model, and the second sub-model performs multi-classification tasks (used to classify the risk scenarios to which the training samples belong). The first sub-model outputs the result of whether the training sample is a risk text or not, and then uses the training sample with the binary classification result of "yes" as the input of the second sub-model to train the second sub-model and output the risk scenario to which the training sample with the binary classification result of "yes" belongs.
[0085] The disclosed embodiment filters the training samples input to the second sub-model through the output results of the first sub-model, thereby increasing the proportion of training samples input to the second sub-model that are valid risk texts, improving the training effect of the second sub-model, and outputting accurate risk scenarios for the text.
[0086] In an exemplary embodiment, a method for enriching the number of samples in the initial training sample set is provided. Figure 6 As shown, using the trained text classification model to classify the text to be predicted to determine the risk text from the text to be predicted and updating the initial training sample set may include steps S610 to S630:
[0087] Step S610: using the trained text classification model to classify the text to be predicted, and obtaining the probability that the text to be predicted corresponds to different risk scenarios.
[0088] Step S620: In response to the probability that the target text to be predicted corresponds to the target risk scenario satisfying a set confidence condition, the target text to be predicted is determined as a risk text.
[0089] When the trained text classification model is used to classify the text to be predicted, the probability of the text to be predicted corresponding to different risk scenarios can be obtained, and the risk text can be determined from the text to be predicted based on the probability. Among them, the set confidence condition can be that the probability of the target text to be predicted corresponding to the target risk scenario is greater than a set probability threshold, or the probability of the target text to be predicted corresponding to the target risk scenario is higher than the probability of other texts to be predicted corresponding to the target risk scenario. The difference is higher than a set probability difference threshold, etc.
[0090] Step S630: Add the risk text and the risk scenario corresponding to the risk text to the initial training sample set.
[0091] The risk texts determined in the text to be predicted and the risk scenarios corresponding to the risk texts are added to the initial training sample set to expand the number of samples in the initial training sample set.
[0092] In an exemplary embodiment, a method for simultaneously expanding the number of samples in the initial sample set and implementing iterative model training is also provided. Figure 7 As shown, in response to the correction operation on the risk classification result, the corrected risk classification result is fed back to the updated initial training sample to retrain the retrained text classification model, and obtaining the trained text classification model may include the following steps:
[0093] Step S710: Filtering part of the text to be predicted from the text to be predicted according to the confidence probability in the risk classification result.
[0094] The texts to be predicted may be sorted in descending order according to the confidence probability, so as to obtain a target number of texts to be predicted that are at the top of the sorting results, and obtain part of the texts to be predicted. For example, the top 200 texts to be predicted in the sorting results are obtained.
[0095] Since the higher the ranking position, the more likely it is to be correctly classified by the text classification model, after the obtained part of the text to be predicted is fed back to the risk control personnel, the correction efficiency of the risk control personnel can be improved, and the processing and classification efficiency can be improved.
[0096] Step S720: Feedback the revised risk classification results corresponding to the selected part of the to-be-predicted texts to the updated initial training samples, so as to continue iterative training of the text classification model to obtain a candidate text classification model.
[0097] The retrained text classification model is retrained using the updated initial training samples to obtain a candidate text classification model.
[0098] Step S730: using the candidate text classification model to classify the text to be predicted to obtain a risk classification result.
[0099] The candidate text classification model retrained in step S720 is used to predict the text to be predicted, and the risk classification result of the text to be predicted is re-output.
[0100] Step S740: Determine whether the risk classification result meets the model training stop condition.
[0101] In a possible embodiment, the number of texts with correct risk classification results in the partial texts to be predicted obtained by screening the texts to be predicted can be obtained, and in response to the number of texts exceeding the first quantity threshold, it is determined that the risk classification results of the texts to be predicted meet the model training stop condition. For example, if the partial texts to be predicted obtained by screening are 200, of which the number of texts with correct risk classification results is 198, it is determined that the risk classification results meet the model training stop condition. Of course, the model training stop condition can be set according to the actual training needs, and the embodiments of the present disclosure do not make special limitations on this.
[0102] Step S750: If the risk classification result does not meet the model training stop condition, execute step S710.
[0103] When the obtained risk classification result does not meet the model training stop condition, part of the text to be predicted can be re-screened from the text to be predicted according to the confidence probability in the risk classification result obtained in this round, and steps S720 to S740 are continued, which will not be repeated here.
[0104] Step S760: The risk classification result satisfies the model training stopping condition, and the candidate text classification model finally obtained by training is used as the trained text classification model.
[0105] After repeatedly executing steps S710 to S760 for several times to implement the closed-loop process of result correction, model training and text classification, the number of initial training sample sets reaches a sufficient scale, the trained text classification model reaches the convergence condition, and mutual assistance is formed between model training and augmented samples. During model training, the corrected risk classification results are added to the initial training sample set through the output risk classification results, thereby augmenting the initial training sample set; accordingly, the augmented initial training sample set can be used to train the text classification model. As the scale of training samples increases, the accuracy of model training is further improved.
[0106] In some possible embodiments, when the text to be predicted is classified again by the iteratively trained text classification model, since part of the text to be predicted has been used as training samples to train the model, when this part of the text is input into the trained model as the text to be predicted, the model will output the correct risk classification result. Therefore, the trained model can only output the text to be predicted in this part of the text that has not participated in the model training, so as to feed back the risk classification result of the output result to the risk control personnel for correction, thereby reducing the correction workload of the risk control personnel and increasing the number of training samples, and more samples that have not participated in the model training can be updated to the initial training set for model iterative training.
[0107] In an exemplary embodiment, the risk clue library aggregates and saves the determined risk texts and corresponding risk scenarios. The texts to be predicted and their risk scenarios that have fallen into the risk clue library will not change with the iterative training process of the text classification model, but the new texts to be predicted generated by each channel of the clues to be predicted will be identified by the text classification model after iterative training. Based on this, the embodiment of the present disclosure provides an implementation method for iterative training of a text classification model, including:
[0108] Add the revised risk classification results to the risk clue library;
[0109] In response to the risk clue library satisfying the model training start conditions, the revised risk classification results in the risk clue library that have not participated in the model training are fed back to the updated initial training sample set to iteratively train the retrained text classification model to obtain a trained text classification model.
[0110] In actual implementation, after the text classification model completes each iterative training, the risk classification results of the predicted text will be revised by the risk control personnel, and the revised risk classification results will be added to the risk clue library for subsequent iterative training of the text classification model.
[0111] Among them, the model training start condition can be that when the risk clue library is periodically detected, there are new risk classification results in the risk clue library, or the number of risk texts in the risk clue library that have not participated in the model iteration training is greater than the set threshold, then the revised risk classification results in the risk clue library that have not participated in the model training are fed back to the updated initial training sample set to iteratively train the text classification model. The detection cycle can be set according to actual needs, such as 9 o'clock every day, and the embodiments of the present disclosure do not impose special restrictions on this.
[0112] By detecting whether the risk clue library meets the conditions for starting model training, the iterative training of the model can be limited to the required time period. Correspondingly, the risk control personnel's correction work on the risk classification results output by the model is also limited to the required time period, thereby making use of fragmented time for risk control personnel to complete the correction work.
[0113] It should be noted that the updating of the initial training sample set and the training of the text classification model in the training process of the text classification model of the embodiment of the present disclosure can be performed offline. For example, the annotation of the samples in the initial training sample set and the revised risk classification results can be transmitted through offline documents, and the risk classification results output by the text classification model are also transmitted through offline documents. The risk control personnel can correct the risk classification results by viewing the risk clue library online. Of course, the above process can also be performed online, which can be selected according to the actual training needs.
[0114] In an exemplary embodiment, the risk scenario corresponding to the risk text may be changed in response to a risk control personnel's modification operation on the risk classification result of the risk text in the risk clue library.
[0115] like Figure 8 A schematic diagram of an application scenario involved in the training method of a text classification model in an embodiment of the present disclosure is shown. Figure 8 The training process of the text classification model of the embodiment of the present disclosure is explained.
[0116] First, the data to be predicted of each channel of clues to be predicted is collected, including employee forums, corporate case platforms or applications, etc. Among them, the data to be predicted of each channel of clues to be predicted can be accessed to the system database through the same access method to avoid missing any clue channels.
[0117] Secondly, the collected data to be predicted can be cleaned. The data cleaning method can be a conventional data cleaning method, and no special requirements are made for this.
[0118] Next, an initial training sample set is obtained, and the text classification model is trained using the initial training sample set. The trained text classification model is used to classify the text to be predicted, so as to determine the risk text from the text to be predicted and update it to the initial training sample set. The text classification model is retrained based on the updated initial training sample set, and the text classification model is used to classify the text to be predicted using the retrained text classification model to obtain a risk classification result.
[0119] Furthermore, the risk classification results are fed back to the risk control personnel, such as through a visual interface, and the risk control personnel perform correction operations based on the preset risk definition library; accordingly, in response to the correction operation of the risk classification results, the corrected risk classification results are fed back to the updated initial training sample set to iteratively train the text classification model until the risk classification results of the text to be predicted meet the model training stop condition, and a trained text classification model is obtained. The corrected risk classification results are added to the risk clue library for iterative training of the text classification model.
[0120] Finally, if there is new text to be predicted in the clue channel to be predicted, the trained text classification model is used to classify the new text to be predicted.
[0121] Through the training method of the text classification model of the embodiment of the present disclosure, the text to be predicted of each clue channel to be predicted is collected and accessed in a unified manner, which can improve the efficiency of obtaining the text to be predicted, avoid missing risk texts, and improve the text recognition and classification efficiency of the model while improving the accuracy of text classification by assisting each other between sample amplification and model training. Since the text to be predicted is predicted by the retrained text classification model, a clear risk classification result can be output, and the text to be predicted with the risk classification result marked can be quickly corrected by the risk control personnel, thereby improving the text processing efficiency of the risk control personnel, thereby improving the recognition efficiency of the risk text and reducing the recognition cost.
[0122] In an exemplary embodiment of the present disclosure, a text classification method is also provided. Fig. 9 A flowchart of a text classification method according to an exemplary embodiment of the present disclosure is shown. Fig. 9 The text classification method of the embodiment of the present disclosure may include the following steps:
[0123] Step S910: inputting the text to be predicted into the trained text classification model to determine the risk text from the text to be predicted and update it to the initial training sample set, wherein the trained text classification model is obtained by training the text classification model according to the initial training sample set;
[0124] Step S920: using the retrained text classification model to classify the text to be predicted to obtain a risk classification result, wherein the retrained text classification model is obtained by retraining the text classification model according to the updated initial training sample set;
[0125] Step S930: In response to the modification operation on the risk classification result, the modified risk classification result is determined as the target text classification result.
[0126] Through the text classification method of the exemplary embodiment of the present disclosure, the text to be predicted is input into the trained text classification model, and the risk text is obtained from the prediction result and added to the initial training sample set for iterative training of the text classification model, so that the number of model training samples is increased in the text classification process; the text to be predicted is classified by using the retrained text classification model to obtain the risk classification result; since the risk classification result has clearly defined the risk scenario corresponding to the text to be predicted, the risk control personnel can quickly make corrections to improve the correction efficiency, thereby improving the efficiency of text classification; and since the target text classification result is corrected by the risk control personnel based on the model output result, the accuracy of text classification is further improved, which is beneficial to timely identify risk texts and take stop-loss measures in a timely manner to a certain extent.
[0127] In an exemplary embodiment, the risk classification result is modified based on a preset risk definition library, which includes and stores known risk types, risk links, and risk scenarios, etc. The risk classification result modified based on the preset risk definition library determines the final classification result of the text to be predicted.
[0128] Based on this, in response to the correction operation of the risk classification results based on the preset risk definition library, the target text classification results can be added to the risk clue library, and the corrected risk classification results in the risk clue library that have not participated in the model training can be updated to the initial training sample set for iterative training of the retrained text classification model.
[0129] In an exemplary embodiment, a preset risk definition library includes risk links and risk categories corresponding to different risk scenarios, that is, the correspondence between risk types, risk links and risk scenarios. In response to a correction operation on the risk classification result, the corrected risk classification result is determined as the target text classification result. It is also possible to determine the target risk link and target risk category corresponding to the target text classification result according to the preset risk definition library based on the risk scenario corresponding to the text to be predicted in the target text classification result.
[0130] In actual implementation, the target text classification result output by the text classification model is the risk scenario corresponding to the text to be predicted. Since the preset risk definition library already stores the correspondence between pre-configured risk types, risk links and risk scenarios, the target risk link and target risk category of the text to be predicted can be obtained by querying the preset risk definition library.
[0131] In an exemplary embodiment, if Fig.10 As shown, a visual interface is also provided for displaying and editing the preset risk definition library and risk clue library. Based on this, corresponding editing processing results can be provided in response to the editing processing operation of the risk definition library or the risk clue library, such as display, adding or editing operations.
[0132] Continue to see Fig.10 As shown, the risk scenario corresponding to the risk text can be modified in response to the risk control personnel's correction operation on the risk scenario corresponding to the risk text in the risk clue library.
[0133] In an exemplary embodiment, the clues in the risk clue library can also be output in the form of a report, such as statistical risk text data by month, risk type dimension, and statistical quantity by region, etc., which are not listed here one by one.
[0134] It should be noted that since the detailed description of each embodiment of the text classification method of the exemplary embodiment of the present disclosure is the same as that of the invention embodiment of the training method of the above-mentioned text classification model, it will not be repeated here.
[0135] In an exemplary embodiment of the present disclosure, a training device 1100 for a text classification model is also provided. Fig.11 , the training device 1100 of the text classification model includes:
[0136] The first training module 1110 is used to train a text classification model according to an initial training sample set, and classify the text to be predicted using the trained text classification model to determine the risk text from the text to be predicted and update it to the initial training sample set;
[0137] The second training module 1120 is used to retrain the text classification model based on the updated initial training sample set, and classify the text to be predicted using the retrained text classification model to obtain a risk classification result;
[0138] The correction processing module 1130 is used to respond to the correction operation on the risk classification result and feed back the corrected risk classification result to the updated initial training sample set to train the retrained text classification model to obtain a trained text classification model.
[0139] In an exemplary embodiment of the present disclosure, the text classification model includes a first sub-model and a second sub-model, and the first training module 1110 may include:
[0140] A first training unit, used for training a first sub-model using an initial training sample set;
[0141] The second training unit is used to determine the target initial training sample corresponding to the risk text result, which is the output result of the first sub-model, as the training sample of the second sub-model and perform model training;
[0142] The second sub-model is used to classify the risk scenarios to which the training samples belong.
[0143] In an exemplary embodiment of the present disclosure, the first training module 1110 may further include:
[0144] The screening unit is used to classify the text to be predicted using the trained text classification model to obtain the confidence probability of the text to be predicted corresponding to different risk scenarios; in response to the confidence probability of the target text to be predicted corresponding to the target risk scenario satisfying the set confidence condition, the target text to be predicted is determined as a risk text; and the risk text and the risk scenario corresponding to the risk text are added to the initial training sample set.
[0145] In an exemplary embodiment of the present disclosure, the risk classification result includes the risk scenario corresponding to the text to be predicted and the confidence probability that the text to be predicted belongs to the risk scenario;
[0146] The correction processing module 1130 may be configured to: loop through the following processes until the risk classification result of the text to be predicted meets the model training stop condition, and determine the candidate text classification model finally obtained as the trained text classification model:
[0147] Based on the confidence probability, some of the texts to be predicted are screened from the texts to be predicted; the revised risk classification results corresponding to the some of the texts to be predicted are fed back to the updated initial training samples to retrain the retrained text classification model to obtain a candidate text classification model; and the candidate text classification model is used to classify the texts to be predicted to obtain a risk classification result.
[0148] In an exemplary embodiment of the present disclosure, the correction processing module 1130 is configured to: sort the texts to be predicted in descending order according to the confidence probability; obtain a target number of texts to be predicted that are at the front from the sorting result to obtain part of the texts to be predicted.
[0149] In an exemplary embodiment of the present disclosure, the risk classification result of the text to be predicted satisfies the model training stopping condition, including: obtaining the number of texts with correct risk classification results in the part of the text to be predicted obtained by screening the text to be predicted; in response to the number of texts exceeding a first quantity threshold, determining that the risk classification result of the text to be predicted satisfies the model training stopping condition.
[0150] In an exemplary embodiment of the present disclosure, the correction processing module 1130 is also configured to: add the corrected risk classification results to the risk clue library; in response to the risk clue library satisfying the model training start conditions, feed back the corrected risk classification results in the risk clue library that have not participated in the model training to the updated initial training sample set to iteratively train the retrained text classification model to obtain a trained text classification model.
[0151] In an exemplary embodiment of the present disclosure, the training device 1100 for the text classification model further includes:
[0152] The sample collection module is used to obtain a first sample set by keyword retrieval in the clue channel to be predicted; obtain texts that meet the text screening conditions from the clue channel to be predicted to obtain a second sample set; and perform data annotation on the samples in the first sample set and the second sample set to obtain an initial training sample set, wherein the data annotation includes the risk scenarios corresponding to the annotated samples.
[0153] Since the functional modules of the training device for a text classification model of the exemplary embodiment of the present disclosure are the same as those in the inventive embodiment of the training method for a text classification model described above, they will not be described in detail here.
[0154] In an exemplary embodiment of the present disclosure, a text classification device 1200 is also provided. Fig.12 As shown, the text classification device 1200 may include:
[0155] The first classification module 1210 is used to input the text to be predicted into the trained text classification model to determine the risk text from the text to be predicted and update it to the initial training sample set, wherein the trained text classification model is obtained by training the text classification model according to the initial training sample set;
[0156] The second classification module 1220 is used to classify the text to be predicted by using the retrained text classification model to obtain a risk classification result, where the retrained text classification model is obtained by retraining the text classification model based on the updated initial training sample set;
[0157] The correction processing module 1230 is used to determine the corrected risk classification result as the target text classification result in response to the correction operation on the risk classification result.
[0158] In an exemplary embodiment of the present disclosure, the correction operation on the risk classification result is performed based on a preset risk definition library, and the correction processing module 1230 is configured as follows: in response to the correction operation on the risk classification result based on the preset risk definition library, the target text classification result is added to the risk clue library; the corrected risk classification results in the risk clue library that have not participated in the model training are updated to the initial training sample set for iterative training of the retrained text classification model.
[0159] In an exemplary embodiment of the present disclosure, a preset risk definition library includes risk links and risk categories corresponding to different risk scenarios, and the text classification device 1200 also includes: a determination module, which is used to determine the target risk link and target risk category corresponding to the target text classification result according to the preset risk definition library based on the risk scenario corresponding to the text to be predicted in the target text classification result.
[0160] In an exemplary embodiment of the present disclosure, the text classification device 1200 further includes: a response processing module, which is used to provide a corresponding editing processing result in response to an editing processing operation on the risk definition library or the risk clue library.
[0161] Since the functional modules of the text classification device of the exemplary embodiment of the present disclosure are the same as those in the above-mentioned text classification method of the invention embodiment, they will not be described in detail here.
[0162] It should be noted that although several modules or units of the system exception handling device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0163] In addition, in the exemplary embodiment of the present disclosure, a computer storage medium capable of implementing the above method is also provided. A program product capable of implementing the above method of this specification is stored thereon. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.
[0164] The exemplary embodiments of the present disclosure also provide a program product for implementing the above method, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0165] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0166] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0167] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0168] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0169] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module", or "system".
[0170] Refer to the following Fig.13 1300 according to this embodiment of the present disclosure is described. Fig.13 The electronic device 1300 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0171] like Fig.13 As shown, the electronic device 1300 is in the form of a general computing device. The components of the electronic device 1300 may include, but are not limited to: at least one processing unit 1310, at least one storage unit 1320, a bus 1330 connecting different system components (including the storage unit 1320 and the processing unit 1310), and a display unit 1340.
[0172] The storage unit stores program codes, which can be executed by the processing unit 1310, so that the processing unit 1310 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0173] The storage unit 1320 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 13201 and / or a cache storage unit 13202 , and may further include a read-only storage unit (ROM) 13203 .
[0174] The storage unit 1320 may also include a program / utility 13204 having a set (at least one) of program modules 13205, such program modules 13205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0175] Bus 1330 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0176] The electronic device 1300 may also communicate with one or more external devices 1400 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1300, and / or communicate with any device that enables the electronic device 1300 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1350. Furthermore, the electronic device 1300 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1360. As shown, the network adapter 1360 communicates with other modules of the electronic device 1300 via a bus 1330. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0177] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0178] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0179] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A training method for a text classification model, characterized in that: include: Training a text classification model according to the initial training sample set, and using the trained text classification model to classify the text to be predicted, so as to determine the risk text from the text to be predicted and update it to the initial training sample set; Retraining the text classification model based on the updated initial training sample set, and classifying the text to be predicted using the retrained text classification model to obtain a risk classification result; In response to the modification operation on the risk classification result, the modified risk classification result is fed back to the updated initial training sample set to train the retrained text classification model to obtain a trained text classification model.
2. The method according to claim 1, characterized in that The text classification model includes a first sub-model and a second sub-model, and training the text classification model according to the initial training sample set includes: Training the first sub-model using the initial training sample set; The output result of the first sub-model is the target initial training sample corresponding to the risk text result, which is determined as the training sample of the second sub-model and performs model training; The second sub-model is used to classify the risk scenarios to which the training samples belong.
3. The method according to claim 2, characterized in that The method of using the trained text classification model to classify the text to be predicted to determine the risk text from the text to be predicted and update it to the initial training sample set includes: Using the trained text classification model to classify the text to be predicted, and obtaining confidence probabilities of the text to be predicted corresponding to different risk scenarios; In response to the confidence probability that the target text to be predicted corresponds to the target risk scenario satisfying a set confidence condition, determining the target text to be predicted as the risk text; The risk text and the risk scenario corresponding to the risk text are added to the initial training sample set.
4. The method according to claim 1, characterized in that: The risk classification result includes the risk scenario corresponding to the text to be predicted and the confidence probability that the text to be predicted belongs to the risk scenario; In response to the correction operation on the risk classification result, the corrected risk classification result is fed back to the updated initial training sample to train the retrained text classification model to obtain a trained text classification model, including: The following process is executed in a loop until the risk classification result of the text to be predicted meets the model training stop condition, and the candidate text classification model finally obtained is determined as the trained text classification model: Based on the confidence probability, filtering part of the text to be predicted from the text to be predicted; Feeding back the revised risk classification results corresponding to the part of the text to be predicted to the updated initial training samples to train the retrained text classification model to obtain a candidate text classification model; The candidate text classification model is used to classify the text to be predicted to obtain a risk classification result.
5. The method according to claim 4, characterized in that The filtering of part of the text to be predicted from the text to be predicted based on the confidence probability includes: Sorting the texts to be predicted in descending order according to the confidence probabilities; A target number of the texts to be predicted that are at the front positions are obtained from the sorting result to obtain the part of the texts to be predicted.
6. The method according to claim 4, characterized in that The risk classification result of the text to be predicted satisfies the model training stop condition, including: Obtaining the number of texts with correct risk classification results among the part of the texts to be predicted obtained by screening the texts to be predicted; In response to the text quantity exceeding a first quantity threshold, it is determined that the risk classification result of the to-be-predicted text satisfies the model training stop condition.
7. The method according to claim 1, characterized in that In response to the correction operation on the risk classification result, the corrected risk classification result is fed back to the updated initial training sample set to train the retrained text classification model to obtain a trained text classification model, including: Adding the revised risk classification result to the risk clue library; In response to the risk clue library satisfying the model training start condition, the revised risk classification results in the risk clue library that have not participated in the model training are fed back to the updated initial training sample set to iteratively train the retrained text classification model to obtain the trained text classification model.
8. The method according to any one of claims 1 to 7, characterized in that Before training the text classification model according to the initial training sample set, the method further includes: A first sample set is obtained by using a keyword search method in the clue channel to be predicted; Acquire texts satisfying the text screening condition from the clue channel to be predicted to obtain a second sample set; Data annotation is performed on samples in the first sample set and the second sample set to obtain the initial training sample set, wherein the data annotation includes risk scenarios corresponding to the annotated samples.
9. A text classification method, characterized in that: include: Inputting the text to be predicted into a trained text classification model to determine the risk text from the text to be predicted and update it to an initial training sample set, wherein the trained text classification model is obtained by training the text classification model according to the initial training sample set; Using a retrained text classification model to classify the text to be predicted to obtain a risk classification result, wherein the retrained text classification model is obtained by retraining the text classification model according to the updated initial training sample set; In response to a modification operation on the risk classification result, the modified risk classification result is determined as a target text classification result.
10. The method according to claim 9, characterized in that The modification operation on the risk classification result is performed based on a preset risk definition library, and in response to the modification operation on the risk classification result, the modified risk classification result is determined as the target text classification result, including: In response to a modification operation on the risk classification result based on the preset risk definition library, adding the target text classification result to a risk clue library; The revised risk classification results in the risk clue library that have not participated in model training are updated to the initial training sample set for iterative training of the retrained text classification model.
11. The method according to claim 10, characterized in that The preset risk definition library includes risk links and risk categories corresponding to different risk scenarios. After the modified risk classification result is determined as the target text classification result in response to the modification operation on the risk classification result, the method further includes: According to the risk scenario corresponding to the text to be predicted in the target text classification result, the target risk link and target risk category corresponding to the target text classification result are determined according to the preset risk definition library.
12. The method according to claim 10, characterized in that The method further comprises: In response to an editing operation on the risk definition library or the risk clue library, a corresponding editing result is provided.
13. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 12 when executed by a processor.
Citation Information
Patent Citations
Text processing method and equipment
CN113392331A
Method and device for establishing classification model
CN114328936A
Cited By
Security check method and device
CN120705314A
