Training methods for business data models

By building a data filtering model to screen data sets with high compliance and business relevance, and training a text generation model, we solve the compliance and business relevance issues in the output of large language models, and ensure the accuracy, compliance and relevance of the output text.

CN120372298BActive Publication Date: 2025-09-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510857961.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-09-26
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

Large language models may produce harmful or inappropriate outputs during use, leading to compliance and business relevance issues, especially posing security risks in medical consultation and information dissemination.

Method used

By obtaining security data sets and business data sets, a data filtering model is built to judge the compliance and business relevance of the input data, a fine-tuning data set is screened out, and the first text generation model is trained based on it to ensure that the output text is compliant and relevant to the business while ensuring accuracy.

Benefits of technology

It ensures the accuracy of output text while ensuring its compliance and business relevance, reduces the risk of non-compliant output, and improves the security and applicability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372298B_ABST
    Figure CN120372298B_ABST
Patent Text Reader

Abstract

The present application discloses a method for training a business data model, which relates to the field of data compliance technology. The method includes first obtaining a security data set and a business data set, and obtaining a data filtering model based on the security data set and the business data set, wherein the data filtering model is used to obtain the judgment score of the input data. The business data set is then input into the data filtering model to obtain the judgment score of each business data in the business data set, and based on the judgment score, a fine-tuning data set is obtained. Finally, a first text generation model is trained based on the fine-tuning data set to obtain a business data model. By adopting this technical solution, the compliance of the model during use can be guaranteed, so that the text output by the model is compliant and relevant to the business while ensuring accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data compliance technology, and in particular to a method for training a business data model. Background Art

[0002] With the rapid development of artificial intelligence (AI), large language models have achieved remarkable results in natural language processing. Pre-trained on large amounts of text data, these models possess powerful language understanding and generation capabilities, enabling widespread application in a variety of fields, including intelligent question answering, code generation, text creation, and mathematical problem solving.

[0003] However, while large language models offer convenience, they also raise a series of security issues. Large language models that are not effectively aligned can produce harmful or inappropriate outputs, such as incorrect or dangerous advice in medical consultations and the spread of false information, bias, and discriminatory content in information dissemination. These security issues not only lead to the output of erroneous information but can also create serious risks to public opinion and lead to non-compliance.

[0004] Therefore, there is an urgent need for a training method for business data models that can ensure the compliance of the model during use, so that the text output by the model is compliant and relevant to the business while ensuring accuracy. Summary of the Invention

[0005] This application provides a training method for a business data model, which can ensure the compliance of the model during use, so that the text output by the model is compliant and relevant to the business while ensuring accuracy.

[0006] This application provides a training method for a business data model, including:

[0007] A security data set and a business data set are obtained, and a data filtering model is obtained based on the security data set and the business data set; the compliance of the data in the security data set satisfies a first preset condition; the compliance of the data in the business data set is unknown; the data filtering model is used to obtain a judgment score of the input data; the judgment score is used to characterize the compliance and business relevance of the input data to the data filtering model; the first preset condition is that the compliance value of the data is greater than a security threshold;

[0008] Inputting the business data set into the data filtering model to obtain a judgment score of each business data in the business data set, and obtaining a fine-tuning data set based on the judgment score;

[0009] A first text generation model is trained based on the fine-tuning dataset to obtain a business data model.

[0010] This application provides a business data model method for text compliance, including:

[0011] Obtain the text to be input, input the text to be input into the business data model, and output a text result; wherein the compliance of the text result meets a first preset condition; the business relevance of the text result meets a second preset condition; the first preset condition is that the numerical value of the compliance of the text result is greater than a security threshold; the second preset condition is that the correlation degree of the business relevance of the text result is greater than a correlation threshold.

[0012] This application also provides a training device for a business data model, including:

[0013] A first acquisition module is configured to acquire a security data set and a business data set, and to obtain a data filtering model based on the security data set and the business data set; the compliance of the data in the security data set satisfies a first preset condition; the compliance of the data in the business data set is unknown; the data filtering model is configured to acquire a judgment score of the input data; the judgment score is configured to characterize the compliance and business relevance of the input data to the data filtering model; the first preset condition is that the data compliance value is greater than a security threshold;

[0014] A first determination module is configured to input the business data set into the data filtering model, obtain a judgment score of each business data in the business data set, and obtain a fine-tuning data set based on the judgment score;

[0015] The second determination module is used to train a first text generation model based on the fine-tuning dataset to obtain a business data model.

[0016] This application also provides a business data model device for text compliance, including:

[0017] The second acquisition module is used to obtain the text to be input, input the text to be input into the business data model, and output a text result; wherein the compliance of the text result meets the first preset condition; the business relevance of the text result meets the second preset condition; the first preset condition is that the numerical value of the compliance of the text result is greater than the security threshold; the second preset condition is that the correlation degree of the business relevance of the text result is greater than the correlation degree threshold.

[0018] The present application also provides an electronic device, comprising: a memory for storing a computer program; a processor for implementing the steps of any of the above-mentioned business data model training methods when executing the computer program, or for implementing the steps of any of the above-mentioned business data model methods applied to text compliance when executing the computer program.

[0019] The present application also provides a computer-readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-mentioned business data model training methods or the steps of any of the above-mentioned business data model methods applied to text compliance.

[0020] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned business data model training methods or the steps of any of the above-mentioned business data model methods applied to text compliance.

[0021] Through this application, a security dataset and a business dataset are first obtained. Based on the security dataset and the business dataset, a data filtering model is obtained. This data filtering model is used to obtain the evaluation score of the input data. The business dataset is then input into the data filtering model to obtain the evaluation score of each business data in the business dataset. Based on the evaluation score, a fine-tuning dataset is obtained. Finally, a first text generation model is trained based on the fine-tuning dataset to obtain a business data model. The adoption of this technical solution can ensure the compliance of the model during use, thereby ensuring that the text output by the model is compliant and relevant to the business while ensuring accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0023] Figure 1 This is a flow chart of a method for training a business data model provided by an embodiment of the present disclosure;

[0024] Figure 2 This is a flow chart of a method for training a business data model provided by an embodiment of the present disclosure;

[0025] Figure 3 This is a flowchart of a business data model method for text compliance provided by an embodiment of the present disclosure;

[0026] Figure 4 This is a schematic diagram of the structure of a training device for a business data model provided by an embodiment of the present disclosure;

[0027] Figure 5 It is a structural diagram of a business data model device applied to text compliance provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0029] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0030] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0031] Figure 1 This is a flow chart of a method for training a business data model provided by an embodiment of the present disclosure, which can be executed by an electronic device. The electronic device can be exemplarily understood as a device such as a mobile phone, tablet computer, laptop computer, desktop computer, smart TV, etc. Figure 1 As shown, the method provided in this embodiment includes the following steps:

[0032] S101. Obtain a security data set and a business data set, and obtain a data filtering model based on the security data set and the business data set; the compliance of the data in the security data set meets a first preset condition; the compliance of the data in the business data set is unknown; the data filtering model is used to obtain a judgment score of the input data; the judgment score is used to characterize the compliance and business relevance of the input data of the data filtering model.

[0033] In one example, a secure data set is obtained from a pre-set secure database, and the compliance of the data in the secure data set satisfies a first pre-set condition. The first pre-set condition may be that the data compliance value is greater than a security threshold, such as 99.9. A larger compliance value indicates more compliant data. In this embodiment, all data sets in the pre-set secure database are compliant data.

[0034] In this embodiment, for a clearer explanation, the security data set can be recorded as , where M represents the number of security datasets, and They represent the input text and output text of the data i in the security dataset respectively. The subscript safe indicates that these security datasets are securely aligned and do not contain harmful information. The security dataset can be derived from industry-recognized security data. This security dataset not only guarantees the security of all data, but also ensures the richness of the corpus in the security field.

[0035] In an example, for a clearer explanation, the business data set can be recorded as , where N represents the number of business data sets, and They represent the input text and output text of the data i in the business data set. The security of each piece of data is unknown, that is, the business data set contains both high-quality safe data and unsafe dangerous data.

[0036] In one example, input data is fed into a data filtering model, which then outputs a corresponding evaluation score based on the data filtering model. This evaluation score can be a percentage. This evaluation score comprehensively represents the compliance and business relevance of the input data. A higher score indicates that the compliance and business relevance of the input data meet the requirements.

[0037] S102: Input the business data set into the data filtering model to obtain the evaluation score of each business data in the business data set, and obtain the fine-tuning data set based on the evaluation score.

[0038] In one example, the data filtering model can be On the one hand, we need to achieve the best fit on D, that is, to ensure compliance, and on the other hand, we also need to achieve the best fit on D, that is, to ensure business relevance. After obtaining the data filtering model, the business dataset D is input into the data filtering model, and then the evaluation scores of each business data in the business dataset D are obtained. Based on the evaluation scores, a fine-tuning dataset is obtained.

[0039] Specifically, the business data set is input into the data filtering model to obtain the evaluation score of each business data in the business data set, and based on the evaluation score, a fine-tuning data set is obtained, including:

[0040] Input the business data set into the data filtering model, evaluate the business data set based on the data filtering model, and obtain an evaluation score;

[0041] Sort the evaluation scores from high to low to obtain the sorting results;

[0042] A preset number of values ​​in front of the sorting result is obtained, and the business data corresponding to the preset number of values ​​in front is determined as the fine-tuning data set.

[0043] In one example, the preset number can be the top K percent. The evaluation scores are first sorted in descending order to obtain a sorted result. The top K percent of the business data in the sorted result is then selected to determine the fine-tuning dataset. For example, if the top K percent of the business data in the sorted result is business data A, business data B, and business data C, then business data A, business data B, and business data C are determined as the fine-tuning dataset.

[0044] S103: Train a first text generation model based on the fine-tuning dataset to obtain a business data model.

[0045] In one example, the first text generation model is a neural network model. After obtaining the fine-tuning dataset, the first text generation model is trained using the fine-tuning dataset to obtain a business data model.

[0046] The disclosed embodiments provide a method for training a business data model. The method first obtains a security data set and a business data set, and based on the security data set and the business data set, obtains a data filtering model, which is used to obtain the judgment score of the input data. The business data set is then input into the data filtering model to obtain the judgment score of each business data in the business data set, and based on the judgment score, a fine-tuning data set is obtained. Finally, a first text generation model is trained based on the fine-tuning data set to obtain a business data model. The adoption of this technical solution can ensure the compliance of the model during use, thereby ensuring that the text output by the model is compliant and relevant to the business while ensuring accuracy.

[0047] Figure 2 This is a flow chart of a method for training a business data model provided by an embodiment of the present disclosure, which can be executed by an electronic device. The electronic device can be exemplarily understood as a device such as a mobile phone, tablet computer, laptop computer, desktop computer, smart TV, etc. Figure 2 As shown, the method provided in this embodiment includes the following steps:

[0048] S201. Obtain a security dataset and a business dataset, and obtain an auxiliary model; wherein the auxiliary model is a model trained based on other security datasets.

[0049] In one example, the auxiliary model is not obtained after training from the initial randomized parameter state, but is a model trained based on other security datasets. Specifically, the auxiliary model can be ,in, is the length-normalized negative log-likelihood function. are the parameters of the auxiliary model, are the parameters to be learned of the data filtering model, is the weight coefficient calculated by the data filter for data i. N represents the number of business data sets. and They respectively represent the input text and output text of the data of quantity i in the business dataset. is the loss function.

[0050] S202: Obtain a data filtering model based on the security data set, the business data set, the auxiliary model, and the first text generation model.

[0051] In one example, the compliance of data in a security data set satisfies a first preset condition; the compliance of data in a business data set is unknown; a data filtering model is used to obtain a judgment score of input data; and the judgment score is used to characterize the compliance and business relevance of the input data of the data filtering model.

[0052] In one example, the method further includes:

[0053] A second text generation model is obtained, and the second text generation model is trained based on a preset alignment algorithm to obtain a first text generation model.

[0054] In one example, the second text generation model is a neural network model. The preset alignment algorithms may be supervised fine-tuning training, human feedback reinforcement learning, and direct preference optimization, among others. Among them, supervised fine-tuning training may be based on a pre-trained model, and further adjusts the model parameters through supervised learning to adapt it to a specific task. Human feedback reinforcement learning may be a technology that combines reinforcement learning and human feedback to train language models to better align with human preferences and values. The core idea is to guide model optimization through human feedback so that it generates outputs that are more in line with human expectations. Direct preference optimization is an algorithm for aligning language models with human preferences. It is an alternative to reinforcement learning from human feedback reinforcement learning. It optimizes model outputs in a more direct way to make them more in line with human preferences, while avoiding the complexity and instability of traditional human feedback reinforcement learning.

[0055] In one example, the second text generation model is trained using a preset alignment algorithm, and then the first text generation model is obtained.

[0056] In one example, a data filtering model is obtained based on a security dataset, a business dataset, an auxiliary model, and a first text generation model, including:

[0057] Training a first text generation model based on the security dataset to obtain a first average loss value;

[0058] Generate a combined model based on the auxiliary model and the first text generation model;

[0059] Training the combined model based on the business data set to obtain a second average loss value;

[0060] A data filtering model is obtained according to the first average loss value and the second average loss value.

[0061] In one example, the first average loss value may be , where M represents the number of security datasets, and They represent the input text and output text of the number i of data in the security dataset respectively. The subscript safe indicates that these security datasets are safely aligned and do not contain harmful information. is the loss function. The model when the combined model takes the minimum value is called . are the parameters to be learned of the data filtering model.

[0062] In one example, the combined model could be:

[0063] ;

[0064] in, is the parameter to be learned of the data filtering model, N represents the number of business data sets, and They respectively represent the input text and output text of the data of quantity i in the business dataset. is the loss function. is the weight coefficient calculated by the data filter for data i. Generate a model for the first text, For auxiliary model.

[0065] In one example, the second average loss value is:

[0066] ;

[0067] in, is the parameter to be learned of the data filtering model, N represents the number of business data sets, and They respectively represent the input text and output text of the data of quantity i in the business dataset. is the loss function. is the weight coefficient calculated by the data filter for data i. Generate a model for the first text, For auxiliary model.

[0068] The advantage of this setting is that it can speed up the iteration and improve the efficiency of model training.

[0069] In one example, obtaining a data filtering model based on the first average loss value and the second average loss value includes:

[0070] Obtain a first weight coefficient of the first average loss value and a second weight coefficient of the second average loss value;

[0071] Determining first weight information according to the first average loss value and the first weight coefficient;

[0072] Determining second weight information according to the second average loss value and the second weight coefficient; wherein a first sum of the first weight coefficient and the second weight coefficient is 1;

[0073] A data filtering model is obtained according to the first weight information and the second weight information.

[0074] In one example, the first weight coefficient is , the second weight coefficient is .in, It can be gradually reduced in each iteration step, which means that in the early stage of training, the main goal is to solve the original problem The accuracy then gradually decreases , mainly based on the loss of security data to update the model parameters to ensure security. The k-th step can be gradually updated according to the following strategy :

[0075] ;

[0076] in, for The minimum value of for The maximum value of , Z is the total number of iteration steps. Determines the intensity of the penalty. Increasing γ prioritizes fine-tuning loss optimization, while decreasing γ prioritizes safety loss optimization. In fact, the model and data filter obtained by each γ solution are Pareto optimal solutions to the original problem.

[0077] The advantage of this setting is that it transforms the double-layer minimization problem into a single-layer minimization problem, reducing the difficulty of data processing and thus improving the efficiency of data calculation.

[0078] In one example, the iterative process of the first text generation model is as follows:

[0079] ;

[0080] in, Generate the first text model for the k+1th iteration, For the first text generation model of the k-th iteration, the step size hyperparameter is , the second weight coefficient is , the first weight coefficient is . is the loss function, and They represent the input text and output text of the number i of data in the security dataset respectively. The subscript safe indicates that these security datasets are safely aligned and do not contain harmful information. is the loss function. is the weight coefficient calculated by the data filter for data i. is the k-th step parameter to be learned in the data filtering model, and They respectively represent the input text and output text of the data of quantity i in the business dataset.

[0081] In one example, the iterative process of the data filtering model is as follows:

[0082] ;

[0083] in, is the k+1th step to be learned parameter of the data filtering model, is the k-th step to be learned parameter of the data filtering model, and the step length hyperparameter is , is the loss function. Generate the model for the first text of the k-th iteration, and They respectively represent the input text and output text of the data of quantity i in the business dataset. is the k-th step auxiliary model. is the weight coefficient calculated by the data filter for data i. is the k-th step parameter to be learned in the data filtering model, and They respectively represent the input text and output text of the data of quantity i in the business dataset.

[0084] In one example, the iteration process of the auxiliary model is as follows:

[0085] ;

[0086] in, is the auxiliary model for the k+1th iteration, is the auxiliary model for the k-th iteration, and the step size hyperparameter is , is the weight coefficient calculated by the data filter for data i. is the k-th step parameter to be learned in the data filtering model, and They respectively represent the input text and output text of the data of quantity i in the business dataset. is the loss function.

[0087] In one example, determining first weight information according to the first average loss value and the first weight coefficient includes:

[0088] A product value of the first average loss value and the first weight coefficient is calculated to obtain first weight information.

[0089] In one example, determining the second weight information according to the second average loss value and the second weight coefficient includes:

[0090] The product value of the second average loss value and the second weight coefficient is calculated to obtain second weight information.

[0091] In one example, obtaining a data filtering model based on the first weight information and the second weight information includes:

[0092] A second sum of the first weight information and the second weight information is calculated, and a minimum value of the second sum is determined as a data filtering model.

[0093] In one example, the data filtering model may be the following formula:

[0094] ;

[0095] Among them, the first weight coefficient is , the second weight coefficient is , M represents the number of the security dataset, and They represent the input text and output text of the number i of data in the security dataset respectively. The subscript safe indicates that these security datasets are safely aligned and do not contain harmful information. is the loss function. are the parameters to be learned of the data filtering model. is the parameter to be learned of the data filtering model, N represents the number of business data sets, and They respectively represent the input text and output text of the data of quantity i in the business dataset. is the loss function. is the weight coefficient calculated by the data filter for data i. Generate a model for the first text, For auxiliary model.

[0096] Among them, the parameters and parameters of the data filter It changes independently and can be easily updated iteratively through gradient descent and , the following update strategy can be solved:

[0097] ;

[0098] in, is the step size of the gradient update.

[0099] ;

[0100] in, is the step size of gradient update. In each iteration, From the security dataset Medium sampling, Sample from the business dataset D.

[0101] S203: Input the business data set into the data filtering model to obtain the evaluation score of each business data in the business data set, and obtain the fine-tuning data set according to the evaluation score.

[0102] For example, in the healthcare sector, a secure dataset might include professional medical literature, audited medical Q&A data, and so on, while a fine-tuning dataset might be patient consultation records from a specific medical institution. In the financial sector, a secure dataset might include compliant financial information or regulatory documents, while a fine-tuning dataset might be customer consultation and transaction data within a financial institution.

[0103] S204: Train a first text generation model based on the fine-tuning dataset to obtain a business data model.

[0104] In an example, this step can refer to the content of step S103 and will not be repeated here.

[0105] The disclosed embodiments provide a method for training a business data model. The method includes obtaining a security dataset and a business dataset, and obtaining an auxiliary model. Based on the security dataset, the business dataset, the auxiliary model, and a first text generation model, a data filtering model is obtained. This technical solution employs a multi-objective optimization approach to construct a data filtering problem. On the one hand, the method focuses on and optimizes the model's fit on the security dataset, while on the other hand, the method optimizes the loss focused on the fine-tuning dataset. By interactively and iteratively updating data filters and model parameters, the complexity of model training is reduced, and the model's balance between security loss and fine-tuning loss is flexibly controlled.

[0106] Figure 3 This is a flow chart of a business data model method for text compliance provided by an embodiment of the present disclosure. The method can be executed by an electronic device. The electronic device can be exemplarily understood as a device such as a mobile phone, tablet computer, laptop computer, desktop computer, smart TV, etc. Figure 3 As shown, the method provided in this embodiment includes the following steps:

[0107] S301. Obtain text to be input, input the text to be input into a business data model, and output a text result; wherein the compliance of the text result meets a first preset condition; and the business relevance of the text result meets a second preset condition.

[0108] In one example, the first preset condition may be that the compliance value of the text result is greater than a safety threshold, and the safety threshold may be 99.9. The larger the compliance value of the data, the more compliant the corresponding text result.

[0109] In one example, the second preset condition is that the business relevance of the text result is greater than a relevance threshold. The relevance threshold may be 80. A larger business relevance value indicates a greater relevance of the text result to the predefined business. In this embodiment, the process for calculating the business relevance can be the process for calculating similarity, which is not further described here.

[0110] In one example, the business data model is obtained by training a first text generation model based on a fine-tuning dataset; and the fine-tuning dataset is obtained by inputting the business dataset into a data filtering model.

[0111] The disclosed embodiments provide a business data model method for text compliance, comprising: obtaining text to be input, inputting the text to be input into a business data model, and outputting a text result. This technical solution ensures that the model, after fine-tuning, can better comply with security guidelines.

[0112] Figure 4 This is a structural diagram of a training device for a business data model provided by an embodiment of the present disclosure. The training device for the business data model can be understood as the above-mentioned electronic device or a part of the functional modules in the above-mentioned electronic device. Figure 4 As shown, the training device 40 of the business data model includes:

[0113] The first acquisition module 401 is used to acquire a security data set and a business data set, and obtain a data filtering model based on the security data set and the business data set; the compliance of the data in the security data set meets a first preset condition; the compliance of the data in the business data set is unknown; the data filtering model is used to obtain a judgment score of the input data; the judgment score is used to represent the compliance and business relevance of the input data of the data filtering model; the first preset condition is that the data compliance value is greater than a security threshold;

[0114] The first determination module 402 is used to input the business data set into the data filtering model, obtain the evaluation score of each business data in the business data set, and obtain the fine-tuning data set based on the evaluation score;

[0115] The second determination module 403 is configured to train the first text generation model based on the fine-tuning dataset to obtain a business data model.

[0116] In one example, the training device 40 further includes:

[0117] The third acquisition module 404 is used to acquire a second text generation model and train the second text generation model based on a preset alignment algorithm to obtain a first text generation model.

[0118] In one example, the first acquisition module 401 is specifically configured to acquire an auxiliary model; wherein the auxiliary model is a model trained based on other security datasets;

[0119] A data filtering model is obtained based on the security data set, the business data set, the auxiliary model and the first text generation model.

[0120] In one example, the first acquisition module 401 is specifically configured to:

[0121] Training a first text generation model based on the security dataset to obtain a first average loss value;

[0122] Generate a combined model based on the auxiliary model and the first text generation model;

[0123] Training the combined model based on the business data set to obtain a second average loss value;

[0124] A data filtering model is obtained according to the first average loss value and the second average loss value.

[0125] In one example, the first acquisition module 401 is specifically configured to:

[0126] Obtain a first weight coefficient of the first average loss value and a second weight coefficient of the second average loss value;

[0127] Determining first weight information according to the first average loss value and the first weight coefficient;

[0128] Determining second weight information according to the second average loss value and the second weight coefficient; wherein a first sum of the first weight coefficient and the second weight coefficient is 1;

[0129] A data filtering model is obtained according to the first weight information and the second weight information.

[0130] In one example, the first acquisition module 401 is specifically configured to:

[0131] A product value of the first average loss value and the first weight coefficient is calculated to obtain first weight information.

[0132] In one example, the first acquisition module 401 is specifically configured to:

[0133] The product value of the second average loss value and the second weight coefficient is calculated to obtain second weight information.

[0134] In one example, the first acquisition module 401 is specifically configured to calculate a second sum of the first weight information and the second weight information, and determine a minimum value of the second sum as the data filtering model.

[0135] In one example, the first determination module 402 is configured to: input the business data set into the data filtering model, and evaluate the business data set based on the data filtering model to obtain an evaluation score;

[0136] Sort the evaluation scores from high to low to obtain the sorting results;

[0137] A preset number of values ​​in front of the sorting result is obtained, and the business data corresponding to the preset number of values ​​in front is determined as the fine-tuning data set.

[0138] For the description of the features in the embodiment corresponding to a training device for a business data model, please refer to the relevant description of the embodiment corresponding to a training method for a business data model, and no further details will be given here.

[0139] Figure 5 This is a structural diagram of a business data model device for text compliance provided by an embodiment of the present disclosure. The business data model device for text compliance can be understood as the above-mentioned electronic device or a part of the functional modules in the above-mentioned electronic device. Figure 5 As shown, the business data model device 50 applied to text compliance includes:

[0140] The second acquisition module 501 is used to obtain the text to be input, input the text to be input into the business data model, and output the text result; wherein the compliance of the text result meets the first preset condition; the business relevance of the text result meets the second preset condition; the first preset condition is that the numerical value of the compliance of the text result is greater than the security threshold; the second preset condition is that the correlation degree of the business relevance of the text result is greater than the correlation threshold.

[0141] In one example, the business data model is obtained by training a first text generation model based on a fine-tuning dataset; and the fine-tuning dataset is obtained by inputting the business dataset into a data filtering model.

[0142] For the description of the features in the embodiment corresponding to a business data model device applied to text compliance, please refer to the relevant description of the embodiment corresponding to a business data model method applied to text compliance, which will not be repeated here.

[0143] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned business data model training method embodiments.

[0144] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned business data model method embodiments applied to text compliance.

[0145] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned business data model training method embodiments when running.

[0146] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned business data model method embodiments for text compliance when running.

[0147] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0148] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned business data model training method embodiments are implemented.

[0149] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned business data model training method embodiments.

[0150] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned business data model method embodiments for text compliance.

[0151] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned business data model method embodiments applied to text compliance.

[0152] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0153] The above is a detailed introduction to a training method for a business data model provided by this application. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

Claims

1. A training method for a business data model, characterized in that: include: Obtaining a security dataset and a business dataset, and obtaining an auxiliary model; wherein the security dataset is compliant financial data or compliant medical data; the data type of the security dataset is text; the compliance of the data in the security dataset meets a first preset condition; the first preset condition is that the value of the data compliance is greater than a security threshold; the business dataset is financial data or medical data; the data type of the business dataset is text; and the compliance of the data in the business dataset is unknown; The auxiliary model is a model trained based on other security datasets; the auxiliary model is determined by a length-normalized negative log-likelihood function and a weight coefficient of data i in the business dataset; wherein the length-normalized negative log-likelihood function is determined based on the input text and output text of data i in the business dataset; the input of the auxiliary model is the input text of data i in the business dataset; the output of the auxiliary model is the output text of data i in the business dataset; the auxiliary model is used to accelerate the speed of model iteration; A data filtering model is obtained based on the security data set, the business data set, the auxiliary model, and the first text generation model; the data filtering model is used to obtain a judgment score of the input data; the judgment score is used to characterize the compliance and business relevance of the input data of the data filtering model; Inputting the business data set into the data filtering model to obtain a judgment score of each business data in the business data set, and obtaining a fine-tuning data set based on the judgment score; The first text generation model is trained based on the fine-tuning dataset to obtain a business data model.

2. The method according to claim 1, characterized in that The method further comprises: A second text generation model is obtained, and the second text generation model is trained based on a preset alignment algorithm to obtain a first text generation model.

3. The method according to claim 1, characterized in that The step of obtaining the data filtering model based on the security dataset, the business dataset, the auxiliary model, and the first text generation model includes: Training the first text generation model based on the security dataset to obtain a first average loss value; generating a combined model based on the auxiliary model and the first text generation model; Training the combined model based on the business data set to obtain a second average loss value; The data filtering model is obtained according to the first average loss value and the second average loss value.

4. The method according to claim 3, characterized in that The step of obtaining the data filtering model according to the first average loss value and the second average loss value includes: Obtaining a first weight coefficient of the first average loss value and a second weight coefficient of the second average loss value; Determining first weight information according to the first average loss value and the first weight coefficient; Determining second weight information according to the second average loss value and the second weight coefficient; wherein a first sum of the first weight coefficient and the second weight coefficient is 1; The data filtering model is obtained according to the first weight information and the second weight information.

5. The method according to claim 4, characterized in that The determining first weight information according to the first average loss value and the first weight coefficient includes: The product value of the first average loss value and the first weight coefficient is calculated to obtain the first weight information.

6. The method according to claim 4, characterized in that The determining of second weight information according to the second average loss value and the second weight coefficient includes: The product value of the second average loss value and the second weight coefficient is calculated to obtain second weight information.

7. The method according to claim 4, characterized in that The step of obtaining the data filtering model according to the first weight information and the second weight information includes: A second sum of the first weight information and the second weight information is calculated, and a minimum value of the second sum is determined as the data filtering model.

8. The method according to claim 1, characterized in that The step of inputting the business data set into the data filtering model, obtaining a judgment score of each business data in the business data set, and obtaining a fine-tuning data set according to the judgment score includes: Inputting the business data set into the data filtering model, and judging the business data set based on the data filtering model to obtain a judgment score; Sort the evaluation scores from high to low to obtain the sorting results; A preset number of values ​​before the sorting result is obtained, and business data corresponding to the preset number of values ​​before the sorting result is determined as the fine-tuning data set.

9. A business data model method applied to text compliance, characterized in that: include: Obtaining text to be input, inputting the text to be input into the business data model, and outputting a text result; wherein the compliance of the text result satisfies a first preset condition; the business relevance of the text result satisfies a second preset condition; and the first preset condition is that the compliance value of the text result is greater than a safety threshold; The second preset condition is that the relevance of the business relevance of the text result is greater than a relevance threshold.

10. The method according to claim 9, characterized in that The business data model is obtained by training a first text generation model based on a fine-tuning dataset; and the fine-tuning dataset is obtained by inputting the business dataset into a data filtering model.

11. A training device for a business data model, characterized in that: include: A first acquisition module is configured to acquire a security data set and a business data set, and to acquire an auxiliary model; wherein the security data set is compliant financial data or compliant medical data; the data type of the security data set is text; the compliance of the data in the security data set satisfies a first preset condition; the first preset condition is that the value of the data compliance is greater than a security threshold; the business data set is financial data or medical data; the data type of the business data set is text; and the compliance of the data in the business data set is unknown; The auxiliary model is a model trained based on other security datasets; the auxiliary model is determined by a length-normalized negative log-likelihood function and a weight coefficient of data i in the business dataset; wherein the length-normalized negative log-likelihood function is determined based on the input text and output text of data i in the business dataset; the input of the auxiliary model is the input text of data i in the business dataset; the output of the auxiliary model is the output text of data i in the business dataset; the auxiliary model is used to accelerate the speed of model iteration; A data filtering model is obtained based on the security data set, the business data set, the auxiliary model, and the first text generation model; the data filtering model is used to obtain a judgment score of the input data; the judgment score is used to characterize the compliance and business relevance of the input data of the data filtering model; A first determination module is configured to input the business data set into the data filtering model, obtain a judgment score of each business data in the business data set, and obtain a fine-tuning data set based on the judgment score; The second determination module is used to train the first text generation model based on the fine-tuning dataset to obtain a business data model.

12. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method according to any one of claims 1 to 8 or the steps of the method according to any one of claims 9 to 10 when executing the computer program.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 8 or the steps of the method according to any one of claims 9 to 10 when executed by a processor.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 or the steps of the method according to any one of claims 9 to 10 are implemented.

Citation Information

Patent Citations

  • Text recognition model training method and related device

    CN117216257A

  • Large language model training method and device and related equipment

    CN117390450A