Training method of business data model
By building a data filtering model to filter and fine-tune the data set, and training the business data model, the compliance problem of large language models during use is solved, and the compliance and business relevance of the output text are achieved.
Patent Information
- Application Number
- CN202510857961.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-25
AI Technical Summary
Large language models may produce harmful or inappropriate output during use, leading to compliance issues, especially in medical consultation and information dissemination.
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, filter out data with high compliance and business relevance for fine-tuning, train the first text generation model, and form a business data model.
Ensure that the text output by the model is compliant and business-related while ensuring accuracy, solving the compliance problem of large language models during use.
Smart Images

Figure CN120372298A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data compliance technology, and in particular to a training method for a business data model. Background Art
[0002] With the rapid development of artificial intelligence technology, large language models have achieved remarkable results in the field of natural language processing. These models have powerful language understanding and generation capabilities through pre-training on large-scale text data, and can be widely used in many fields such as intelligent question answering, code generation, text creation, and mathematical problem solving.
[0003] However, while large language models bring convenience, they also raise a series of security issues. Large language models that have not been effectively aligned may produce harmful or inappropriate outputs, such as giving wrong or dangerous advice in medical consultation scenarios, spreading false information, biased and discriminatory content in information dissemination, etc. These security issues will not only output wrong information, but may also cause serious social opinion risks, leading to non-compliance.
[0004] Therefore, there is an urgent need for a training method for a business data model 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] The present 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] The present application provides a training method for a business data model, including: 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 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; the first preset condition is that the value of the compliance of the data is greater than a security threshold; 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 according to the judgment score; A first text generation model is trained based on the fine-tuning dataset to obtain a business data model.
[0007] This application provides a business data model method applied to text compliance, including: 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 value of the compliance of the text result is greater than a security threshold; the second preset condition is that the association degree of the business relevance of the text result is greater than an association degree threshold.
[0008] This application also provides a training device for a business data model, including: A first acquisition module, configured 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 characterize the compliance and business relevance of the input data of the data filtering model; the first preset condition is that the value of the compliance of the data is greater than a security threshold; A first determination module, configured to input the business data set into the data filtering model, obtain the judgment scores of each business data in the business data set, and obtain a fine-tuning data set according to the judgment scores; A second determination module, configured to train a first text generation model based on the fine-tuning data set to obtain a business data model.
[0009] This application also provides a business data model device applied to text compliance, including: A second acquisition module, configured to acquire 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 value of the compliance of the text result is greater than a security threshold; the second preset condition is that the association degree of the business relevance of the text result is greater than an association degree threshold.
[0010] This application also provides an electronic device, including: 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.
[0011] The present application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned training methods of the business data model or the steps of any of the above-mentioned business data model methods applied to text compliance are implemented.
[0012] The present application also provides a computer program product including a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned training methods of the business data model or the steps of any of the above-mentioned business data model methods applied to text compliance are implemented.
[0013] Through the present application, a security data set and a business data set are first obtained, and based on the security data set and the business data set, a data filtering model is obtained, which is used to obtain a judgment score of input data. Then, the business data set is input into the data filtering model to obtain the judgment scores of each business data in the business data set, and based on the judgment scores, 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 ensured, so that the text output by the model is compliant and business-related while ensuring the accuracy. Description of the Drawings
[0014] To more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0015] Figure 1 is a flowchart of a method for training a business data model provided by an embodiment of the present disclosure; Figure 2 is a flowchart of a method for training a business data model provided by an embodiment of the present disclosure; Figure 3 is a flowchart of a business data model method applied to text compliance provided by an embodiment of the present disclosure; Figure 4 is a structural diagram of a device for training a business data model provided by an embodiment of the present disclosure; Figure 5 is a structural diagram of a business data model device applied to text compliance provided by an embodiment of the present disclosure. Detailed Embodiments
[0016] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0017] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and not to describe a specific order or sequence.
[0018] In order to enable those skilled in the art of this technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0019] Figure 1 is a flowchart of a method for training a business data model provided by an embodiment of the present disclosure. This method can be executed by an electronic device. The electronic device can be exemplarily understood as devices such as mobile phones, tablet computers, laptop computers, desktop computers, smart TVs, etc. As Figure 1 shown, the method provided in this embodiment includes the following steps: S101. Obtain a security data set and a business data set, and based on the security data set and the business data set, obtain a data filtering model; 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 for the input data; the judgment score is used to characterize the compliance and business relevance of the input data of the data filtering model.
[0020] In one example, the security data set is obtained from a preset security database, and the compliance of the data in the security data set meets the first preset condition. Among them, the first preset condition may be that the value of the compliance of the data is greater than a security threshold, and the security threshold may be 99.9. The larger the value of the compliance of the data, the more compliant the corresponding data is. In this embodiment, the data sets in the preset security database are all compliant data.
[0021] In this embodiment, for the sake of clear illustration, the security data set can be denoted as , where M represents the quantity of the security data set, and The input text and output text of the data with quantity i in the security dataset are respectively represented. The subscript "safe" indicates that these security datasets are securely aligned and there is no harmful information. The security dataset can be from industry-recognized secure data, which ensures both the security of all data and the richness of the corpus in the security field.
[0022] In one example, for the sake of clear illustration, the business dataset can be denoted as , where N represents the quantity of the business dataset, and respectively represent the input text and output text of the data with quantity i in the business dataset. The security of each piece of data is unknown, that is, the business dataset contains both high-quality secure data and insecure dangerous data.
[0023] In one example, the input data is input into the data filtering model, and then the judgment score corresponding to the input data is output based on the data filtering model. The judgment score can be on a percentile scale. The judgment score is used to comprehensively represent the compliance and business relevance of the input data. The higher the score value of the judgment score, the more the compliance and business relevance of the input data meet the requirements.
[0024] S102: Input the business dataset into the data filtering model, obtain the judgment scores of each business data in the business dataset, and obtain the fine-tuning dataset according to the judgment scores.
[0025] In one example, on the one hand, the data filtering model can achieve the best fitting effect on , that is, ensure compliance, and on the other hand, also achieve the best fitting effect on D, that is, ensure business relevance. After obtaining the data filtering model, input the business dataset D into the data filtering model, then obtain the judgment scores of each business data in the business dataset D, and obtain the fine-tuning dataset according to the judgment scores.
[0026] Specifically, input the business dataset into the data filtering model, obtain the judgment scores of each business data in the business dataset, and obtain the fine-tuning dataset according to the judgment scores, including: Input the business dataset into the data filtering model, judge the business dataset based on the data filtering model, and obtain the judgment scores; Sort the judgment scores in descending order to obtain the sorting result; Obtain the preset number of values in front of the sorting result, and determine the business data corresponding to the preset number of values in front as the fine-tuning dataset.
[0027] In one example, the preset number of values can be the top K percent. First, sort the judgment scores in descending order to obtain a sorting result, and then select the top K percent of the business data in the sorting result to be determined as the fine-tuning data set. For example, if the top K percent of the business data in the sorting result are 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 data set.
[0028] S103. Train a first text generation model based on the fine-tuning data set to obtain a business data model.
[0029] In one example, the first text generation model is a neural network model. After obtaining the fine-tuning data set, train the first text generation model with the fine-tuning data set to obtain a business data model.
[0030] A method for training a business data model provided by an embodiment of the present disclosure 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, where the data filtering model is used to obtain judgment scores of input data. Then, input the business data set into the data filtering model to obtain judgment scores of each business data in the business data set, and based on the judgment scores, obtain a fine-tuning data set. Finally, train a first text generation model 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 ensured, and thus the text output by the model is compliant and business-related while ensuring accuracy.
[0031] Figure 2 is a schematic flowchart of a method for training a business data model provided by an embodiment of the present disclosure, and this method can be executed by an electronic device. The electronic device can be exemplarily understood as devices such as mobile phones, tablet computers, laptop computers, desktop computers, smart TVs, etc. As Figure 2 shown, the method provided in this embodiment includes the following steps: S201. Obtain a security data set and a business data set, and obtain an auxiliary model; wherein, the auxiliary model is a model trained based on other security data sets.
[0032] In one example, the auxiliary model is not obtained by training from an initial randomized parameter state, but is a model trained based on other security data sets. Specifically, the auxiliary model can be , where is the length-normalized negative log-likelihood function. is the parameter of the auxiliary model, is the parameter 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 the business data set. and respectively represent the input text and the output text of the data with quantity i in the service dataset. is the loss function.
[0033] S202. Obtain a data filtering model based on the security dataset, the service dataset, the auxiliary model, and the first text generation model.
[0034] In one example, the compliance of the data in the security dataset meets the first preset condition; the compliance of the data in the service dataset is unknown; the data filtering model is used to obtain a judgment score for the input data; the judgment score is used to characterize the compliance and service relevance of the input data of the data filtering model.
[0035] In one example, the method further includes: Obtain a second text generation model, and train the second text generation model based on a preset alignment algorithm to obtain the first text generation model.
[0036] In one example, the second text generation model is a neural network model. The preset alignment algorithm can be supervised fine-tuning training, human feedback reinforcement learning, direct preference optimization, etc. Among them, supervised fine-tuning training can be based on a pre-trained model, and further adjust the model parameters through supervised learning to make it adapt to a specific task. Human feedback reinforcement learning can be a technology that combines reinforcement learning and human feedback, used to train a language model to better align with human preferences and values. The core idea is to guide the model optimization through human feedback to make it generate outputs that better meet human expectations. Direct preference optimization is an algorithm used to align a language model with human preferences. It is an alternative to human feedback reinforcement learning in reinforcement learning, and optimizes the model output in a more direct way to make it more in line with human preferences, while avoiding the complexity and instability of traditional human feedback reinforcement learning.
[0037] In one example, train the second text generation model through a preset alignment algorithm, and then obtain the first text generation model.
[0038] In one example, obtaining a data filtering model based on the security dataset, the service dataset, the auxiliary model, and the first text generation model includes: Train the first text generation model based on the security dataset to obtain a first average loss value; Generate a combined model based on the auxiliary model and the first text generation model; Train the combined model based on the service dataset to obtain a second average loss value; Obtain the data filtering model according to the first average loss value and the second average loss value.
[0039] In one example, the first average loss value can be , where M represents the number of the secure data sets, and respectively represent the input text and the output text of the data with quantity i in the secure data set. The subscript safe indicates that these secure data sets are securely aligned and there is no harmful information. is the loss function. The model when the combined model takes the minimum value is called . is the parameter to be learned of the data filtering model.
[0040] In one example, the combined model can be: ; where is the parameter to be learned of the data filtering model, N represents the number of the business data sets, and respectively represent the input text and the output text of the data with quantity i in the business data set. is the loss function. is the weight coefficient calculated by the data filter for data i. is the first text generation model, is the auxiliary model.
[0041] In one example, the second average loss value is: ; where is the parameter to be learned of the data filtering model, N represents the number of the business data sets, and respectively represent the input text and the output text of the data with quantity i in the business data set. is the loss function. is the weight coefficient calculated by the data filter for data i. is the first text generation model, is the auxiliary model.
[0042] The advantage of such a setting is that it can accelerate the iteration speed and improve the efficiency of model training.
[0043] In one example, according to the first average loss value and the second average loss value, the data filtering model is obtained, including: Obtain the first weight coefficient of the first average loss value and the second weight coefficient of the second average loss value; Determine the first weight information according to the first average loss value and the first weight coefficient; Determine the second weight information according to the second average loss value and the second weight coefficient; wherein, the first sum value of the first weight coefficient and the second weight coefficient is 1; Obtain a data filtering model according to the first weight information and the second weight information.
[0044] In one example, the first weight coefficient is , and the second weight coefficient is . Among them, can be gradually reduced in each iteration step, which means that in the initial stage of training, the accuracy of in the original problem is mainly solved, and then is gradually reduced. The model parameters are mainly updated based on the loss on the safe data to ensure security. The at the k-th step can be gradually updated according to the following strategy: ; Among them, is the minimum value of, is the maximum value of, and Z is the total number of iteration steps. In the formula, determines the intensity of the penalty. Increasing γ will pay more attention to the optimization of the fine-tuning loss, and decreasing γ will pay more attention to the optimization of the safety loss. In fact, the models and data filters obtained by solving each γ are all Pareto optimal solutions of the original problem.
[0045] The advantage of such a setting is to transform the double-layer minimization problem into a single-layer minimization problem, reduce the difficulty of data processing, and thus improve the efficiency of data calculation.
[0046] In one example, the iteration process of the first text generation model is as follows: ; Among them, is the first text generation model at the (k + 1)-th step iteration, is the first text generation model at the k-th step iteration, the step size hyperparameter is , the second weight coefficient is , and the first weight coefficient is . is the loss function, and respectively represent the input text and output text of the data with quantity i in the safe data set. The subscript safe indicates that these safe data sets are safely aligned and there is no harmful information. is the loss function. is the weight coefficient calculated by the data filter for data i. Among them, is the parameter to be learned at the k-th step of the data filtering model, and respectively represent the input text and the output text of the data with quantity i in the service dataset.
[0047] In one example, the iterative process of the data filtering model is as follows: ; where is the parameter to be learned at the (k + 1)-th step of the data filtering model, is the parameter to be learned at the k-th step of the data filtering model, and the step size hyperparameter is , is the loss function. is the first text generation model at the k-th iteration, and respectively represent the input text and the output text of the data with quantity i in the service dataset. is the auxiliary model at the k-th step. is the weight coefficient calculated by the data filter for data i. Where is the parameter to be learned at the k-th step of the data filtering model, and respectively represent the input text and the output text of the data with quantity i in the service dataset.
[0048] In one example, the iterative process of the auxiliary model is as follows: ; where is the auxiliary model at the (k + 1)-th iteration, is the auxiliary model at the k-th iteration, and the step size hyperparameter is , is the weight coefficient calculated by the data filter for data i. Where is the parameter to be learned at the k-th step of the data filtering model, and respectively represent the input text and the output text of the data with quantity i in the service dataset. is the loss function.
[0049] In one example, according to the first average loss value and the first weight coefficient, the first weight information is determined, including: Calculate the product value of the first average loss value and the first weight coefficient to obtain the first weight information.
[0050] In one example, according to the second average loss value and the second weight coefficient, the second weight information is determined, including: Calculate the product value of the second average loss value and the second weight coefficient to obtain the second weight information.
[0051] In one example, a data filtering model is obtained according to first weight information and second weight information, including: Calculating a second sum value of the first weight information and the second weight information, and determining the minimum value of the second sum value as the data filtering model.
[0052] In one example, the data filtering model can be the following formula: ; where the first weight coefficient is , the second weight coefficient is , M represents the number of the security data sets, and respectively represent the input text and the output text of the data with the number i in the security data set. The subscript safe indicates that these security data sets are securely aligned and there is no harmful information. is the loss function. is the parameter to be learned of the data filtering model. is the parameter to be learned of the data filtering model, N represents the number of the business data sets, and respectively represent the input text and the output text of the data with the number i in the business data set. is the loss function. is the weight coefficient calculated by the data filter for the data i. is the first text generation model, is the auxiliary model.
[0053] where the parameter and the parameter of the data filter vary independently and can be conveniently updated iteratively by the gradient descent method and , and the following update strategy can be solved: ; where is the step size of gradient update.
[0054] ; where is the step size of gradient update. Wherein, in each iteration process is sampled from the security data set , is sampled from the business data set D.
[0055] S203. Input the business data set into the data filtering model, obtain the evaluation scores of each business data in the business data set, and obtain a fine-tuning data set according to the evaluation scores.
[0056] In one example, in the medical field, the security dataset may include professional medical literature, reviewed medical Q&A data, etc., and the fine-tuning dataset may be the patient consultation records of a specific medical institution. In the financial field, the security dataset may be compliant financial information or regulatory documents, etc., and the fine-tuning dataset may be the customer consultation and transaction data within a financial institution.
[0057] S204. Train the first text generation model based on the fine-tuning dataset to obtain a business data model.
[0058] In one example, the content of this step can refer to the content of step S103 and will not be elaborated here.
[0059] The embodiments of the present disclosure 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 the first text generation model, a data filtering model is obtained. With this technical solution, a multi-objective optimization method is used to construct a data filtering problem. On the one hand, it focuses on and optimizes the fitting degree of the model on the security dataset, and on the other hand, it optimizes the loss on the fine-tuning dataset. By interactively iteratively updating the data filter and model parameters, the complexity of model training is reduced, and the balance between the security loss and the fine-tuning loss of the model is flexibly controlled.
[0060] Figure 3 It is a schematic flowchart of a method for a business data model applied to text compliance provided by the embodiments of the present disclosure. This method can be executed by an electronic device. The electronic device can be exemplarily understood as devices such as mobile phones, tablet computers, laptop computers, desktop computers, smart TVs, etc. As Figure 3 shown, the method provided in this embodiment includes the following steps: S301. 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.
[0061] In one example, the first preset condition may be that the value of the compliance of the text result is greater than the security threshold, and the security threshold may be 99.9. The larger the value of the compliance of the data, the more compliant the corresponding text result is.
[0062] In one example, the second preset condition is that the correlation degree of the business relevance of the text result is greater than the correlation degree threshold. Among them, the correlation degree threshold may be 80. The larger the value of the correlation degree of the business relevance, the more relevant the text result is to the preset business. In this embodiment, the calculation process of the correlation degree of the business relevance can be the calculation process of similarity and will not be elaborated here.
[0063] In one example, the business data model is obtained after training a first text generation model based on a fine-tuning data set; the fine-tuning data set is obtained by inputting a business data set into a data filtering model.
[0064] Embodiments of the present disclosure provide a business data model method applied to text compliance. The method includes: obtaining the text to be input, inputting the text to be input into the business data model, and outputting a text result. By adopting this technical solution, it can be ensured that the model can better follow the security guidelines after fine-tuning.
[0065] Figure 4 It is a schematic 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 partial functional module in the above-mentioned electronic device. As Figure 4 shown, the training device 40 for the business data model includes: A first acquisition module 401, configured 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 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 of the data filtering model; the first preset condition is that the numerical value of the compliance of the data is greater than a security threshold; A first determination module 402, configured to input the business data set into the data filtering model, obtain the judgment scores of each business data in the business data set, and obtain a fine-tuning data set according to the judgment scores; A second determination module 403, configured to train a first text generation model based on the fine-tuning data set to obtain a business data model.
[0066] In one example, the training device 40 further includes: A third acquisition module 404, configured 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.
[0067] In one example, the first acquisition module 401 is specifically configured to acquire an auxiliary model; where the auxiliary model is a model trained based on other security data sets; Based on the security data set, the business data set, the auxiliary model, and the first text generation model, obtain a data filtering model.
[0068] In one example, the first acquisition module 401 is specifically configured to: Train a first text generation model based on the security data set to obtain a first average loss value; Generate a combined model based on an auxiliary model and a first text generation model; Train the combined model based on a business data set to obtain a second average loss value; Obtain a data filtering model according to the first average loss value and the second average loss value.
[0069] In one example, the first acquisition module 401 is specifically configured to: Obtain a first weight coefficient of the first average loss value and a second weight coefficient of the second average loss value; Determine first weight information according to the first average loss value and the first weight coefficient; Determine second weight information according to the second average loss value and the second weight coefficient; wherein, the first sum value of the first weight coefficient and the second weight coefficient is 1; Obtain a data filtering model according to the first weight information and the second weight information.
[0070] In one example, the first acquisition module 401 is specifically configured to: Calculate the product value of the first average loss value and the first weight coefficient to obtain first weight information.
[0071] In one example, the first acquisition module 401 is specifically configured to: Calculate the product value of the second average loss value and the second weight coefficient to obtain second weight information.
[0072] In one example, the first acquisition module 401 is specifically configured to: Calculate the second sum value of the first weight information and the second weight information, and determine the minimum value of the second sum value as the data filtering model.
[0073] In one example, the first determination module 402 is configured to: Input the business data set into the data filtering model, judge the business data set based on the data filtering model to obtain a judgment score; Sort the judgment scores in descending order to obtain a sorting result; Obtain the preset number of values in front of the sorting result, and determine the business data corresponding to the preset number of values in front as the fine-tuning data set.
[0074] For the description of the features in the corresponding embodiments of a training device for a business data model, reference can be made to the relevant descriptions in the corresponding embodiments of a training method for a business data model, which will not be elaborated here one by one.
[0075] Figure 5 It is a schematic structural diagram of a business data model device applied to text compliance provided by an embodiment of the present disclosure. The business data model device applied to text compliance can be understood as the above-mentioned electronic device or some functional modules in the above-mentioned electronic device. AsFigure 5 As shown in Figure 5 , the business data model device 50 applied to text compliance includes: A second acquisition module 501, configured to acquire 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 value of the compliance of the text result is greater than a security threshold; the second preset condition is that the association degree of the business relevance of the text result is greater than an association degree threshold.
[0076] In one example, the business data model is obtained by training a first text generation model based on a fine-tuning data set; the fine-tuning data set is obtained by inputting a business data set into a data filtering model.
[0077] For the description of the features in the corresponding embodiment of a business data model device applied to text compliance, reference may be made to the relevant description in the corresponding embodiment of a business data model method applied to text compliance, which will not be elaborated here one by one.
[0078] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above-described embodiments of the training method of the business data model.
[0079] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above-described embodiments of the business data model method applied to text compliance.
[0080] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above-described embodiments of the training method of the business data model when running.
[0081] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above-described embodiments of the business data model method applied to text compliance when running.
[0082] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.
[0083] An embodiment of the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in the embodiment of any of the above-mentioned training methods for business data models.
[0084] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in the embodiment of any of the above-mentioned training methods for business data models.
[0085] An embodiment of the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in the embodiment of any of the above-mentioned business data model methods applied to text compliance.
[0086] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in the embodiment of any of the above-mentioned business data model methods applied to text compliance.
[0087] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0088] The above has introduced in detail a training method for a business data model provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A training method for a business data model, characterized in that, Including: Obtain a security data set and a business data set, and based on the security data set and the business data set, obtain a data filtering model; 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 for the input data; The judgment score is used to characterize the compliance and business relevance of the input data of the data filtering model; The first preset condition is that the numerical value of the compliance of the data is greater than a security threshold; Input the business data set into the data filtering model to obtain the judgment scores of each piece of business data in the business data set, and based on the judgment scores, obtain a fine-tuning data set; Train a first text generation model based on the fine-tuning data set to obtain a business data model.
2. The method according to claim 1, wherein The method further includes: Obtain 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.
3. The method according to claim 1, wherein The obtaining the data filtering model based on the security data set and the business data set includes: Obtain an auxiliary model; wherein, the auxiliary model is a model trained based on other security data sets; Based on the security data set, the business data set, the auxiliary model, and the first text generation model, obtain the data filtering model.
4. The method according to claim 3, characterized in that, The obtaining the data filtering model based on the security data set, the business data set, the auxiliary model, and the first text generation model includes: Train the first text generation model based on the security data set to obtain a first average loss value; Based on the auxiliary model and the first text generation model, generate a combined model; Train the combined model based on the business data set to obtain a second average loss value; Based on the first average loss value and the second average loss value, obtain the data filtering model.
5. The method according to claim 4, wherein The obtaining the data filtering model based on the first average loss value and the second average loss value includes: Obtain a first weight coefficient of the first average loss value and a second weight coefficient of the second average loss value; Based on the first average loss value and the first weight coefficient, determine first weight information; Based on the second average loss value and the second weight coefficient, determine second weight information; wherein, the sum of the first and second weight coefficients is 1; Based on the first weight information and the second weight information, obtain the data filtering model.
6. The method according to claim 5, characterized in that The determining the first weight information based on the first average loss value and the first weight coefficient includes: Calculate the product value of the first average loss value and the first weight coefficient to obtain the first weight information.
7. The method according to claim 5, wherein The determining the second weight information based on the second average loss value and the second weight coefficient includes: Calculate the product value of the second average loss value and the second weight coefficient to obtain second weight information.
8. The method according to claim 5, wherein The obtaining the data filtering model based on the first weight information and the second weight information includes: Calculate the second sum value of the first weight information and the second weight information, and determine the minimum value of the second sum value as the data filtering model.
9. The method according to claim 1, characterized in that, Inputting the service data set into the data filtering model, obtaining the evaluation scores of each piece of service data in the service data set, and obtaining a fine-tuning data set according to the evaluation scores, including: Input the service data set into the data filtering model, evaluate the service data set based on the data filtering model, and obtain evaluation scores; Sort the evaluation scores in descending order to obtain a sorting result; Obtain the preset number of values at the front of the sorting result, and determine the service data corresponding to the preset number of values at the front as the fine-tuning data set.
10. A business data model method applied to text compliance, characterized in that, Including: Obtain the text to be input, input the text to be input into the service data model, and output a text result; wherein, the compliance of the text result meets a first preset condition; the service relevance of the text result meets a second preset condition; the first preset condition is that the value of the compliance of the text result is greater than a safety threshold; The second preset condition is that the correlation degree of the service relevance of the text result is greater than a correlation degree threshold.
11. The method according to claim 10, wherein The service data model is obtained by training a first text generation model based on the fine-tuning data set; the fine-tuning data set is obtained by inputting the service data set into the data filtering model.
12. A training device for a service data model, characterized in that, Including: A first acquisition module, configured to acquire a security data set and a service data set, and obtain a data filtering model based on the security data set and the service data set; the compliance of the data in the security data set meets a first preset condition; The compliance of the data in the service data set is unknown; The data filtering model is used to obtain the evaluation score of the input data; The evaluation score is used to characterize the compliance and service relevance of the input data of the data filtering model; The first preset condition is that the value of the compliance of the data is greater than a safety threshold; A first determination module, configured to input the service data set into the data filtering model, obtain the evaluation scores of each piece of service data in the service data set, and obtain a fine-tuning data set according to the evaluation scores; A second determination module, configured to train a first text generation model based on the fine-tuning data set to obtain a service data model.
13. An electronic device, characterized in that, Including: A memory, configured to store a computer program; A processor, configured to implement the steps of the method according to any one of claims 1 to 9 or the steps of the method according to any one of claims 10 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the method according to any one of claims 1 to 9 or the steps of the method according to any one of claims 10 to 11 when executed by a processor.
15. A computer program product, comprising a computer program, characterized in that, The computer program implements the steps of the method according to any one of claims 1 to 9 or the steps of the method according to any one of claims 10 to 11 when executed by a processor.
Citation Information
Patent Citations
Text recognition model training method and related device
CN117216257A
Large language model training method and device and related equipment
CN117390450A
Chinese grammar error correction method based on detection and pinyin joint enhancement
CN119203998A
Large language model alignment optimization method based on small data volume fine tuning and storage medium
CN119293245A
Processing method and device of model fine tuning data set, electronic equipment and readable medium
CN119939242A