Text auditing model training method and device, equipment and medium
By training the text audit model, using preset strategies and sample text text review, the problem of time-consuming and labor-consuming human audit in the existing technology is solved, and automated audit is realized, which improves efficiency and accuracy.
Patent Information
- Application Number
- CN202411115584.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-06
AI Technical Summary
In the existing technology, the text review process requires manual operation, which is time-consuming and labor-intensive, making it difficult to achieve automated review, resulting in low efficiency and accuracy.
By training the text audit model, using preset candidate audit strategies and sample text, combining activation functions and weight sets, the candidate audit strategies are processed, the audit results are output, and the weight set is updated according to the truth value, and iterative training is performed until the iteration threshold is reached. Form an efficient text review model.
It realizes the automation of text review, improves audit efficiency and accuracy, reduces human intervention, and improves the accuracy of model training.
Smart Images

Figure CN119088834A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of text review technology, and in particular to a training method, device, equipment and medium for a text review model. Background Art
[0002] The texts that need to be published now usually need to go through the process of collecting materials, writing texts, reviewing texts and publishing texts. Each step requires manual operation, which is time-consuming and labor-intensive. Therefore, it is very important to realize automatic review of texts and improve the efficiency and accuracy of text review. Summary of the invention
[0003] The present invention provides a text review model training method, device, equipment and medium to improve the accuracy of model training, realize subsequent automated review of text based on the trained text review model, and improve text review efficiency and accuracy.
[0004] According to one aspect of the present invention, a method for training a text review model is provided, comprising:
[0005] Inputting the preset candidate audit strategies and sample texts into a pre-built text audit model, the text audit model processes the candidate audit strategies and the sample texts according to a preset activation function set and a preset weight set, and outputs the audit results corresponding to each candidate audit strategy;
[0006] Determining a current model loss value of the text audit model according to the audit result and the corresponding text audit true value;
[0007] Updating the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set;
[0008] The text audit model including the updated preset weight set is iteratively trained until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text audit model.
[0009] According to another aspect of the present invention, there is provided a training device for a text review model, comprising:
[0010] A model output result determination module, used for inputting preset candidate audit strategies and sample texts into a pre-built text audit model, wherein the text audit model processes the candidate audit strategies and the sample texts according to a preset activation function set and a preset weight set, and outputs the audit results corresponding to each candidate audit strategy;
[0011] A model loss value determination module, used to determine the current model loss value of the text audit model according to the audit result and the corresponding text audit true value;
[0012] A weight updating module, used to update the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set;
[0013] The model training module is used to iteratively train the text review model including the updated preset weight set until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text review model.
[0014] According to another aspect of the present invention, there is provided an electronic device, comprising:
[0015] one or more processors;
[0016] A memory for storing one or more programs;
[0017] When one or more programs are executed by one or more processors, the one or more processors can execute any one of the text review model training methods provided by the embodiments of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions, and the computer instructions are used to implement any text review model training method provided by the embodiments of the present invention when executed by a processor.
[0019] The embodiment of the present invention provides a training scheme for a text audit model, which inputs preset candidate audit strategies and sample texts into a pre-built text audit model. The text audit model processes the candidate audit strategies and sample texts according to a preset activation function set and a preset weight set, and outputs the audit results corresponding to each candidate audit strategy; determines the current model loss value of the text audit model according to the audit results and the corresponding text audit true value; updates the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set; iteratively trains the text audit model including the updated preset weight set until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text audit model. The above scheme improves the accuracy of training the text audit model by updating the weight coefficients in the preset weight set according to the current model loss value to iteratively train the updated text audit model, thereby realizing the subsequent automated audit of the text based on the trained text audit model, and improving the efficiency and accuracy of text audit.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a training method for a text review model provided in Embodiment 1 of the present invention;
[0023] Figure 2A is a flow chart of a text review model training method provided in Embodiment 2 of the present invention;
[0024] Figure 2B This is an architectural diagram of a text review model provided in Embodiment 2 of the present invention;
[0025] Figure 3 It is a structural schematic diagram of a training device for a text review model provided in Embodiment 3 of the present invention;
[0026] Figure 4 It is a structural schematic diagram of an electronic device for implementing a training method for a text review model provided in a fourth embodiment of the present invention. DETAILED DESCRIPTION
[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0028] Embodiment 1
[0029] Figure 1 It is a flowchart of a text review model training method provided in Example 1 of the present invention. This embodiment is applicable to the situation of training a text review model. The method can be executed by a training device for a text review model. The device can be implemented in software and / or hardware and can be configured in an electronic device that carries the training function of the text review model.
[0030] See also Figure 1 The training method of the text review model shown includes:
[0031] S110. Input the preset candidate audit strategies and sample texts into a pre-built text audit model. The text audit model processes the candidate audit strategies and sample texts according to a preset activation function set and a preset weight set, and outputs the audit results corresponding to each candidate audit strategy.
[0032] Among them, the candidate audit strategy refers to the pre-set text audit standard. The sample text refers to the text used to train the text audit model. The embodiment of the present invention does not impose any restrictions on the type of sample text, which can be set by technicians based on experience or needs. Exemplarily, the type of sample text can be a popular science text type. It should be noted that the candidate audit strategy can be set according to the type of sample text.
[0033] It should be noted that the candidate audit strategies and sample texts in the input text audit model in the embodiment of the present invention are all encoded vectors, that is, the candidate audit strategies and sample texts can be encoded in advance, and the encoded candidate audit strategies and sample texts are input into the text audit model; or, the text audit model preprocesses the input candidate audit strategies and sample texts, that is, encodes them, and determines the audit results based on the encoded candidate audit strategies and sample texts. In summary, the candidate audit strategies and sample texts involved in the subsequent training process of the text audit model are all encoded candidate audit strategies and sample texts.
[0034] For example, if the sample text is a sample medical popular science text, the candidate review strategies may include: reviewing the time information, medical data, personal sensitive data and data sources in the sample text to ensure the accuracy of the information, the reliability of the data, the protection of sensitive data and the clarity of the source; reviewing the drug names, labels, promotional content and drug information in the sample text to ensure the accuracy and reliability of the above data; reviewing the content in the sample text to ensure that the content is compliant and accurate and avoids sensitive topics; reviewing the copy provided in the sample text to ensure that the copy does not contain absolute words, efficacy assertions, non-compliant content, etc.
[0035] Among them, the text audit model can be used to audit the text and determine whether the text is up to standard (i.e., whether it meets the publishing standard). The activation function set refers to a set containing multiple activation functions. Exemplarily, the activation function in the activation function set can be a nonlinear activation function. The advantage of using a nonlinear activation function is that the text audit model can capture more text information and audit policy information.
[0036] The preset weight set refers to a set including multiple weight coefficients. The audit result refers to the result determined by auditing the sample text based on the candidate audit strategy.
[0037] In an optional embodiment, the activation function set includes a policy activation function group, a text activation function group, and a text policy activation function group; the preset weight set includes a text policy weight subset and an audit result weight subset.
[0038] Among them, the policy activation function group refers to a combination of activation functions used to process candidate audit policies. The text activation function group refers to a combination of activation functions used to process sample texts. The text policy activation function group refers to a combination of activation functions used to process vectors determined based on sample texts and candidate audit policies.
[0039] The text strategy weight subset is used to store the weight coefficients corresponding to the text vector and the strategy vector respectively. The audit result weight subset refers to the set of weight coefficients used to determine the audit result vector.
[0040] It can be understood that in the embodiments of the present invention, by introducing a policy activation function group, a text activation function group and a text policy activation function group, the diversity of activation functions is improved and the comprehensiveness of information extraction is improved; at the same time, in the embodiments of the present invention, by introducing a text policy weight subset and an audit result weight subset, the accuracy of the final audit result is improved.
[0041] In an optional embodiment, the candidate text strategy activation functions in the text strategy activation function group are determined based on the following method: for any candidate text strategy activation function, a reference strategy activation function corresponding to the candidate text strategy activation function is determined from each candidate strategy activation function, and a reference text activation function corresponding to the candidate text strategy activation function is determined from each candidate text activation function; based on the reference strategy activation function and the reference text activation function, a reference text strategy weight group is determined from a text strategy weight subset; based on each weight coefficient in the reference text strategy weight group, a weighted sum of the reference strategy activation function and the reference text activation function is performed to obtain the candidate text strategy activation function.
[0042] Among them, the reference strategy activation function refers to a candidate strategy activation function used to determine a candidate text strategy activation function; correspondingly, the reference text strategy activation function refers to a candidate text activation function that cooperates with the reference strategy activation function to jointly determine a candidate text strategy activation function.
[0043] The reference text strategy weight group includes a weight coefficient corresponding to the reference strategy activation function and a weight coefficient corresponding to the reference text strategy activation function. Exemplarily, the embodiment of the present invention does not impose any restrictions on the size of the two weight coefficients in the reference text strategy weight group, which can be set by a technician based on experience, and it is only necessary to ensure that the sum of the two weight coefficients in a reference text strategy weight group is 1.
[0044] It should be noted that the text strategy weight subset includes multiple candidate text strategy weight groups, and the corresponding reference text strategy weight group is selected from the candidate text strategy weight group according to the reference strategy activation function and the reference text activation function. Among them, the candidate text strategy weight group refers to a combination of weight coefficients associated with the text strategy vector that are pre-set. A candidate text strategy weight group includes two weight coefficients.
[0045] Exemplarily, based on the reference text strategy weight group, a first weight coefficient corresponding to the reference strategy activation function and a second weight coefficient corresponding to the reference text strategy activation function are determined respectively, the reference strategy activation function is weighted (i.e., multiplied) based on the first weight coefficient, and the reference text activation function is weighted (i.e., multiplied) based on the second weight coefficient, and the above two weighted values are added to obtain the candidate text strategy activation function.
[0046] It can be understood that by jointly determining the candidate text policy activation function based on the reference policy activation function, the reference text activation function, and the reference text policy weight group, the accuracy of the determined candidate text policy activation function is improved.
[0047] In an embodiment of the present invention, the number of candidate policy activation functions in the policy activation function group can be set by a technician based on experience or needs; or, it can be set according to the number of candidate audit policies. Furthermore, the number of candidate text activation functions in the text activation function group is the same as the number of candidate policy activation functions in the policy activation function group. Among them, the candidate policy activation function refers to a pre-set nonlinear activation function that can be used to process the candidate audit policy. The candidate text activation function refers to a pre-set nonlinear activation function for processing text.
[0048] For example, if the number of candidate audit policies is 5, the number of candidate policy activation functions in the policy activation function group is 5, and the number of candidate text activation functions in the text activation function group is 5.
[0049] It should be noted that the candidate policy activation functions in the policy activation function group are different, the candidate text policy activation functions in the text activation function group are different, and the candidate policy activation functions are different from the candidate text policy activation functions.
[0050] S120. Determine the current model loss value of the text audit model based on the audit results and the corresponding text audit true value.
[0051] The text review truth value refers to the actual result value of reviewing the sample text according to the candidate review strategy. It should be noted that one candidate review strategy corresponds to one text review truth value, and the text review truth value can be manually annotated.
[0052] Exemplarily, for any candidate audit strategy, according to the audit result corresponding to the candidate audit strategy and the text audit truth value corresponding to the candidate audit strategy, the partial loss value corresponding to the candidate audit strategy is determined; based on the partial loss value, the current model loss value is determined. The current model loss value refers to the model loss size of the text audit model after the current training.
[0053] Exemplarily, the partial loss value may be determined by the following formula:
[0054] L(y i ',y i )=-(y i lm i '-(1-y i )ln(1-y i '));
[0055] Among them, L(y i ',y i ) represents the partial loss value; y i Indicates the text review truth value corresponding to the i-th candidate review strategy, which can be 0 or 1; y i ' represents the audit result corresponding to the i-th candidate audit strategy, which can be 0 or 1.
[0056] Furthermore, the partial loss values corresponding to each candidate audit strategy are added together to obtain the current model loss value.
[0057] S130. Update the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set.
[0058] In an optional embodiment, the weight coefficients in the preset weight set are updated according to the current model loss value to obtain an updated preset weight set, including: determining the current updated weight subset from each subset of the preset weight set, and determining the current updated weight coefficient from the current updated weight subset; respectively deriving the current updated weight coefficient and the current model loss value to obtain a weight derivative value and a loss derivative value, and updating the current updated weight coefficient according to the current updated weight coefficient, the weight derivative value and the loss derivative value; updating other weight coefficients in the current updated weight subset according to the updated current updated weight coefficient, the current model loss value and the preset weight and value; after updating each subset in the preset weight set, an updated preset weight set is obtained.
[0059] Among them, the current update weight subset refers to the subset of weight coefficients that currently need to be updated. The current update weight coefficient refers to the weight coefficient that needs to be updated at the current moment. The weight derivative value refers to the value obtained by deriving the current update weight coefficient. The loss derivative value refers to the value obtained by deriving the current model loss value. The preset weight sum value refers to the sum of the weight coefficients in the current update weight subset. Exemplarily, the preset weight sum value can be 1. Other weight coefficients refer to the weight coefficients in the current update weight subset other than the current update weight coefficient.
[0060] It should be noted that when there is one unupdated weight coefficient in the current update weight subset, the unupdated weight coefficient can be updated according to the updated weight coefficient and the preset weight sum value.
[0061] Exemplarily, the current update weight coefficient in the current update weight subset may be updated by the following formula:
[0062]
[0063] Among them, c' represents the current updated weight coefficient after update; c represents the current updated weight coefficient; α represents the learning rate, which can be 0.01; Represents the loss derivative value; L(y) represents the current model loss value; Represents the weighted derivative value.
[0064] It can be understood that by taking derivation, the weight coefficient is updated based on the current model loss value, which improves the accuracy of the weight coefficient update and makes the updated weight coefficient more adaptable to the text review model.
[0065] S140, iteratively train the text review model including the updated preset weight set until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text review model.
[0066] Specifically, based on the above steps, the text review model including the updated preset weight set is iteratively trained until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text review model.
[0067] The embodiment of the present invention does not impose any limitation on the size of the preset iteration threshold, which can be set by a technician based on experience or repeatedly determined through a large number of experiments.
[0068] The embodiment of the present invention provides a training scheme for a text audit model, which inputs preset candidate audit strategies and sample texts into a pre-built text audit model. The text audit model processes the candidate audit strategies and sample texts according to a preset activation function set and a preset weight set, and outputs the audit results corresponding to each candidate audit strategy; determines the current model loss value of the text audit model according to the audit results and the corresponding text audit true value; updates the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set; iteratively trains the text audit model including the updated preset weight set until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text audit model. The above scheme improves the accuracy of training the text audit model by updating the weight coefficients in the preset weight set according to the current model loss value to iteratively train the updated text audit model, thereby realizing the subsequent automated audit of the text based on the trained text audit model, and improving the efficiency and accuracy of text audit.
[0069] On the basis of the above technical solution, an embodiment of the present invention also provides a method for text review based on a trained text review model, including: inputting the text to be reviewed and the corresponding text review strategy into the trained text review model, and outputting the review results corresponding to each text review strategy; based on the review results, determining whether the text to be reviewed meets the standards.
[0070] The text to be reviewed refers to the text that needs to be reviewed. The embodiment of the present invention does not impose any limitation on the type of the text to be reviewed, which may be a popular science text. The text review strategy refers to the review strategy corresponding to the text to be reviewed. It should be noted that the type of the text to be reviewed may be the same as the type of the sample text, and the text review strategy may be the same as the candidate review strategy.
[0071] Exemplarily, if there is a failure in the audit results, it is determined that the text to be audited does not meet the standards; if the audit results are all passed, it is determined that the text to be audited meets the standards.
[0072] For example, if there is a failure in the audit result, feedback on the modification of the text to be audited will be given based on the text audit strategy corresponding to the failure.
[0073] It can be understood that the text to be reviewed is reviewed through the text review model to determine whether the text to be reviewed meets the standards, thereby realizing automated review of the text based on the trained text review model and improving the efficiency and accuracy of text review.
[0074] Embodiment 2
[0075] Figure 2AIt is a flow chart of a training method for a text audit model provided in Example 2 of the present invention. Based on the above embodiments, this embodiment further refines the operation of "processing candidate audit strategies and sample texts according to a preset activation function set and a preset weight set, and outputting audit results corresponding to each candidate audit strategy" into "determining a current policy activation function from each candidate policy activation function in the policy activation function group, and determining a current text activation function corresponding to the current activation function from each candidate text activation function in the text activation function group; processing each candidate audit strategy according to the current policy activation function to obtain a current policy vector, and processing the sample text according to the current text activation function to obtain a current text vector; when each candidate policy activation function has processed the candidate audit strategy and each candidate text activation function has processed the sample text, generating a text strategy vector set including at least one set of current strategy vectors and current text vectors; determining an audit result vector according to the text strategy vector set, the text strategy activation function group and the preset weight set, and outputting audit results corresponding to each candidate audit strategy according to the audit result vector" to improve the mechanism for determining the audit result. It should be noted that for the parts not described in detail in the embodiment of the present invention, reference may be made to the descriptions of other embodiments.
[0076] See also Figure 2A The training method of the text review model shown includes:
[0077] S210. Input the preset candidate audit strategy and sample text into a pre-built text audit model. The text audit model determines the current policy activation function from the candidate policy activation functions in the policy activation function group, and determines the current text activation function corresponding to the current activation function from the candidate text activation functions in the text activation function group.
[0078] The current policy activation function refers to the candidate policy activation function used to process the candidate audit policy at the current moment. The current text activation function refers to the candidate text activation function used to process the sample text at the current moment.
[0079] S220. Process each candidate audit strategy according to the current strategy activation function to obtain a current strategy vector, and process the sample text according to the current text activation function to obtain a current text vector.
[0080] The current strategy vector refers to the vector obtained after the current strategy activation function processes each candidate audit strategy, and the current text vector refers to the vector obtained after the current text activation function processes the sample text.
[0081] S230. When each candidate strategy activation function has processed the candidate audit strategy and each candidate text activation function has processed the sample text, a text strategy vector set including at least one set of current strategy vectors and current text vectors is generated.
[0082] The text strategy vector set refers to a set used to store multiple sets of current strategy vectors and current text vectors. It should be noted that one current strategy vector and one current text vector form one set.
[0083] S240. Determine an audit result vector based on a text strategy vector set, a text strategy activation function group and a preset weight set, and output the audit results corresponding to each candidate audit strategy based on the audit result vector.
[0084] The audit result vector refers to a vector used to represent the audit result. Exemplarily, the audit result vector is decoded to obtain the audit result.
[0085] In an optional embodiment, an audit result vector is determined based on a text strategy vector set, a text strategy activation function group and a preset weight set, including: determining a corresponding current text strategy weight group from a text strategy weight subset according to any group of current strategy vectors and current text vectors in the text strategy vector set; performing weighted summation of the current strategy vectors and current text vectors in the group according to each weight coefficient in the current text strategy weight group to obtain a current text audit vector corresponding to the group; determining a corresponding current text strategy activation function from a text strategy activation function group, and processing the current text audit vector corresponding to the group according to the current text strategy activation function to obtain a current audit result vector of the group; generating an audit result vector set including current audit result vectors corresponding to the current strategy vectors and current text vectors in each group; and determining the audit result vector based on the audit result vector set and the audit result weight subset.
[0086] Among them, the current text strategy weight group includes weight coefficients corresponding to the current strategy vector and the current text vector respectively. The current text strategy weight group includes two weight coefficients, namely the weight coefficient of the current strategy vector and the weight coefficient of the current text vector. The current text audit vector refers to a vector determined based on the current strategy vector and the current text vector. It should be noted that a set of current strategy vectors and current text vectors corresponds to a current audit result vector.
[0087] The current text strategy activation function refers to the candidate text strategy activation function used to process the current text audit vector at the current moment. The current audit result vector refers to the vector obtained by processing the current text audit vector based on the current text activation function. The audit result vector set refers to the set used to store multiple current audit vectors.
[0088] Exemplarily, according to any text strategy group in the text strategy vector set, determine the current text strategy weight group corresponding to the text strategy group from the text strategy weight subset; determine the first weight coefficient corresponding to the current strategy vector in the text strategy group and the second weight coefficient corresponding to the current text vector from the current text strategy weight group; weight the current strategy vector based on the first weight coefficient (i.e., multiply), weight the current text vector based on the second weight coefficient (i.e., multiply), add the two weighted values, and obtain the current text audit vector corresponding to the text strategy group; determine the corresponding current text strategy activation function from each candidate text strategy activation function in the text strategy activation function group, and process the current text audit vector corresponding to the text strategy group according to the current text strategy activation function to obtain the current audit result vector of the text strategy group; generate an audit result vector set including the current audit result vectors corresponding to each text strategy group; determine the audit result vector based on the audit result vector set and the audit result weight subset.
[0089] The text strategy group includes a current strategy vector and a current text vector. The text strategy vector set includes multiple text strategy groups.
[0090] Exemplarily, the current text review vector can be determined by the following formula:
[0091]
[0092] Among them, φ(x) represents the current text review vector; represents the weight coefficient corresponding to the i-th current strategy vector; x i represents the i-th current strategy vector; represents the weight coefficient corresponding to the i-th current text vector; x i 'Represents the current text vector.
[0093] It can be understood that by determining the current audit result vector based on the current text policy weight group and the current text policy activation function, the accuracy of the determined current audit result vector is improved.
[0094] In an optional embodiment, the audit result vector is determined based on the audit result vector set and the audit result weight subset, including: weighted summing up each current audit result vector in the audit result vector set according to each weight coefficient in the audit result weight subset to obtain the audit result vector.
[0095] Exemplarily, the weight coefficients corresponding to each current audit result vector are determined respectively, each weight coefficient is multiplied by the corresponding current audit result vector respectively, and the multiplied values are added to obtain the audit result vector.
[0096] Exemplarily, the audit result vector can be determined by the following formula:
[0097]
[0098] Among them, φ(x)” represents the audit result vector; c i represents the weight coefficient of the i-th current audit result vector; φ(x)' represents the i-th current audit result vector; n represents the number of current audit result vectors. It should be noted that the number of weight coefficients in the audit result weight subset is the same as the number of current audit result vectors.
[0099] It can be understood that by performing weighted summation on the current audit result vector to determine the audit result vector, the accuracy of the determined audit result vector is improved.
[0100] S250. Determine the current model loss value of the text audit model based on the audit results and the corresponding text audit true value.
[0101] S260. Update the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set.
[0102] S270, iteratively train the text review model including the updated preset weight set until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text review model.
[0103] The embodiment of the present invention provides a training scheme for a text audit model, which processes candidate audit strategies and sample texts according to a preset activation function set and a preset weight set, and outputs the audit result operation corresponding to each candidate audit strategy, which is refined into determining a current policy activation function from each candidate policy activation function in a policy activation function group, and determining a current text activation function corresponding to the current activation function from each candidate text activation function in a text activation function group; processing each candidate audit strategy according to the current policy activation function to obtain a current policy vector, and processing the sample text according to the current text activation function to obtain a current text vector; when each candidate policy activation function has processed the candidate audit strategy, and each candidate text activation function has processed the sample text, generating a text strategy vector set including at least one set of current strategy vectors and current text vectors; determining an audit result vector according to the text strategy vector set, the text strategy activation function group and the preset weight set, and outputting the audit result corresponding to each candidate audit strategy according to the audit result vector, thereby improving the mechanism for determining the audit result. The above scheme determines the strategy vector and the text vector by using different candidate strategy activation functions and candidate text activation functions, thereby improving the comprehensiveness of the vector information in the determined text strategy vector set.
[0104] Based on the above technical solution, the embodiment of the present invention provides a training method for a text review model, see Figure 2B Architectural diagram of the text audit model shown.
[0105] For example, Figure 2B Medium o,1 Represents the candidate audit strategies after encoding, x 0,2 represents the encoded sample text, A, B, C and D represent the candidate policy activation functions in the policy activation function group, A', B', C' and D' represent the candidate text activation functions in the text activation function group, x 1,1 、x 1,2 、x 1,3 and x 1,4 All represent text review vectors, A”, B”, C” and D” represent the candidate text strategy activation functions in the text strategy activation function group, and x 2,1 Represents the audit result vector.
[0106] For example, x 0,1 and x 0,2 After passing through five nonlinear activation functions, they are combined with the corresponding values. 0,1 The first candidate strategy activation function A for x 0,1 The vector obtained after processing (i.e. the current strategy vector) is multiplied by the corresponding weight coefficient and then added to x 0,2The first candidate strategy activation function A' for x 0,2 The vector obtained after processing (i.e. the current text vector) is multiplied by the corresponding weight coefficient and then added to obtain x 1,1 ;x 0,1 The second candidate strategy activation function B for x 0,1 The vector obtained after processing is multiplied by the corresponding weight coefficient and then 0,2 The second candidate text activation function B' for x 0,2 After the processed vector is multiplied by the corresponding weight coefficient, the sum is obtained to obtain x 1,2 ;x 0,1 The third candidate strategy activation function C for x 0,1 The vector obtained after processing is multiplied by the corresponding weight coefficient and then 0,2 The third candidate text activation function C' for x 0,2 After the processed vector is multiplied by the corresponding weight coefficient, the sum is obtained to obtain x 1,3 ;x 0,1 The fourth candidate strategy activation function D for x 0,1 The vector obtained after processing is multiplied by the corresponding weight coefficient and then 0,2 The fourth candidate text activation function D' for x 0,2 After the processed vector is multiplied by the corresponding weight coefficient, the sum is obtained to obtain x 1,4 .
[0107] Furthermore, the text review vector set {x 1,1 ,x 1,2 ,x 1,3 ,x 1,4 Each text review vector in} is passed through a candidate text strategy activation function and multiplied by the corresponding weight coefficient, and finally added to obtain x 2,1 .
[0108] In the embodiment of the present invention, the above-mentioned trained text review model can also be imported into a robot to obtain an intelligent review robot.
[0109] Embodiment 3
[0110] Figure 3 It is a structural diagram of a training device for a text review model provided in Embodiment 3 of the present invention. This embodiment is applicable to the case of training a text review model, and the method can be executed by a training device for a text review model, which can be implemented in software and / or hardware, and can be configured in an electronic device that carries the training function of the text review model.
[0111] like Figure 3As shown, the device includes: a model output result determination module 310, a model loss value determination module 320, a weight update module 330 and a model training module 340. Among them,
[0112] The model output result determination module 310 is used to input the preset candidate audit strategy and the sample text into a pre-built text audit model, and the text audit model processes the candidate audit strategy and the sample text according to a preset activation function set and a preset weight set, and outputs the audit result corresponding to each candidate audit strategy;
[0113] A model loss value determination module 320, for determining a current model loss value of the text audit model according to the audit result and the corresponding text audit true value;
[0114] A weight updating module 330 is used to update the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set;
[0115] The model training module 340 is used to iteratively train the text audit model including the updated preset weight set until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text audit model.
[0116] The embodiment of the present invention provides a training scheme for a text audit model, which inputs preset candidate audit strategies and sample texts into a pre-built text audit model. The text audit model processes the candidate audit strategies and sample texts according to a preset activation function set and a preset weight set, and outputs the audit results corresponding to each candidate audit strategy; determines the current model loss value of the text audit model according to the audit results and the corresponding text audit true value; updates the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set; iteratively trains the text audit model including the updated preset weight set until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text audit model. The above scheme improves the accuracy of training the text audit model by updating the weight coefficients in the preset weight set according to the current model loss value to iteratively train the updated text audit model, thereby realizing the subsequent automated audit of the text based on the trained text audit model, and improving the efficiency and accuracy of text audit.
[0117] Optionally, the activation function set includes a policy activation function group, a text activation function group and a text policy activation function group; the preset weight set includes a text policy weight subset and an audit result weight subset.
[0118] Optionally, the model output result determination module 310 includes:
[0119] a current activation function determining unit, configured to determine a current policy activation function from each candidate policy activation function in the policy activation function group, and to determine a current text activation function corresponding to the current activation function from each candidate text activation function in the text activation function group;
[0120] A current vector determination unit, configured to process each of the candidate audit policies according to the current policy activation function to obtain a current policy vector, and to process the sample text according to the current text activation function to obtain a current text vector;
[0121] A vector set determination unit, configured to generate a text strategy vector set including at least one set of the current strategy vector and the current text vector when each of the candidate strategy activation functions has processed the candidate audit strategy and each of the candidate text activation functions has processed the sample text;
[0122] The audit result determination unit is used to determine the audit result vector according to the text strategy vector set, the text strategy activation function group and the preset weight set, and output the audit result corresponding to each candidate audit strategy according to the audit result vector.
[0123] Optionally, the audit result determination unit includes:
[0124] a current weight group determination subunit, configured to determine a corresponding current text strategy weight group from the text strategy weight subset according to any group of the current strategy vector and the current text vector in the text strategy vector set;
[0125] An audit vector determination subunit, used for performing weighted summation of the current strategy vector and the current text vector in the group according to each weight coefficient in the current text strategy weight group, to obtain a current text audit vector corresponding to the group;
[0126] A result vector determination subunit, used for determining a corresponding current text strategy activation function from the text strategy activation function group, and processing the current text audit vector corresponding to the group according to the current text strategy activation function to obtain a current audit result vector of the group;
[0127] A result vector set determination subunit, used to generate an audit result vector set including the current audit result vectors corresponding to the current strategy vector and the current text vector in each group;
[0128] The audit result vector determination subunit is used to determine the audit result vector according to the audit result vector set and the audit result weight subset.
[0129] Optionally, the audit result vector determination subunit is specifically used to:
[0130] The current audit result vectors in the audit result vector set are weighted and summed according to the weight coefficients in the audit result weight subset to obtain an audit result vector.
[0131] Optionally, the candidate text strategy activation functions in the text strategy activation function group are determined based on the following means:
[0132] A reference activation function determination module is used to determine, for any candidate text strategy activation function, a reference strategy activation function corresponding to the candidate text strategy activation function from each of the candidate strategy activation functions, and to determine a reference text activation function corresponding to the candidate text strategy activation function from each of the candidate text activation functions;
[0133] A reference weight group determination module, used to determine a reference text strategy weight group from the text strategy weight subset according to the reference strategy activation function and the reference text activation function;
[0134] The candidate activation function determination module is used to perform weighted summation of the reference strategy activation function and the reference text activation function according to each weight coefficient in the reference text strategy weight group to obtain the candidate text strategy activation function.
[0135] Optionally, the weight updating module 330 includes:
[0136] An update weight coefficient determination unit, configured to determine a current update weight subset from each subset of the preset weight set, and determine a current update weight coefficient from the current update weight subset;
[0137] A weight coefficient updating unit, used to respectively derive the current updated weight coefficient and the current model loss value to obtain a weight derivative value and a loss derivative value, and update the current updated weight coefficient according to the current updated weight coefficient, the weight derivative value and the loss derivative value;
[0138] A weight subset updating unit, configured to update other weight coefficients in the current update weight subset according to the updated current update weight coefficient, the current model loss value and the preset weight sum value;
[0139] The preset weight set updating unit is used to obtain an updated preset weight set after each subset in the preset weight set has been updated.
[0140] The text review model training device provided in the embodiment of the present invention can execute the text review model training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the training methods of each text review model.
[0141] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of candidate review strategies and sample texts involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0142] Embodiment 4
[0143] Figure 4 It is a structural diagram of an electronic device for implementing a training method for a text audit model provided by Embodiment 4 of the present invention. Electronic device 410 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0144] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0145] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0146] Processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. Processor 411 performs the various methods and processes described above, such as the training method of the text review model.
[0147] In some embodiments, the training method of the text audit model can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the training method of the text audit model described above can be performed. Alternatively, in other embodiments, the processor 411 can be configured to execute the training method of the text audit model by any other appropriate means (for example, by means of firmware).
[0148] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0149] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0150] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0151] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0152] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0153] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0154] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0155] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A training method for a text review model, characterized in that: include: Inputting the preset candidate audit strategies and sample texts into a pre-built text audit model, the text audit model processes the candidate audit strategies and the sample texts according to a preset activation function set and a preset weight set, and outputs the audit results corresponding to each candidate audit strategy; Determining a current model loss value of the text audit model according to the audit result and the corresponding text audit true value; Updating the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set; The text audit model including the updated preset weight set is iteratively trained until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text audit model.
2. The method according to claim 1, characterized in that The activation function set includes a policy activation function group, a text activation function group and a text policy activation function group; the preset weight set includes a text policy weight subset and an audit result weight subset.
3. The method according to claim 2, characterized in that The processing of the candidate audit strategies and the sample text according to the preset activation function set and the preset weight set, and outputting the audit results corresponding to each of the candidate audit strategies, includes: Determine a current policy activation function from each candidate policy activation function in the policy activation function group, and determine a current text activation function corresponding to the current activation function from each candidate text activation function in the text activation function group; Processing each of the candidate audit policies according to the current policy activation function to obtain a current policy vector, and processing the sample text according to the current text activation function to obtain a current text vector; When each of the candidate policy activation functions has processed the candidate audit policy, and each of the candidate text activation functions has processed the sample text, generating a text policy vector set including at least one set of the current policy vector and the current text vector; According to the text strategy vector set, the text strategy activation function group and the preset weight set, an audit result vector is determined, and according to the audit result vector, the audit result corresponding to each of the candidate audit strategies is output.
4. The method according to claim 3, characterized in that The step of determining the audit result vector according to the text strategy vector set, the text strategy activation function group and the preset weight set includes: Determine a corresponding current text strategy weight group from the text strategy weight subset according to any group of the current strategy vector and the current text vector in the text strategy vector set; Performing weighted summation of the current strategy vector and the current text vector in the group according to each weight coefficient in the current text strategy weight group, to obtain a current text review vector corresponding to the group; Determine a corresponding current text strategy activation function from the text strategy activation function group, and process the current text audit vector corresponding to the group according to the current text strategy activation function to obtain a current audit result vector of the group; Generate an audit result vector set including the current audit result vector corresponding to the current strategy vector and the current text vector in each group; The audit result vector is determined according to the audit result vector set and the audit result weight subset.
5. The method according to claim 4, characterized in that The step of determining the audit result vector according to the audit result vector set and the audit result weight subset includes: The current audit result vectors in the audit result vector set are weighted and summed according to the weight coefficients in the audit result weight subset to obtain an audit result vector.
6. The method according to claim 5, characterized in that The candidate text strategy activation functions in the text strategy activation function group are determined based on the following method: For any candidate text strategy activation function, determine a reference strategy activation function corresponding to the candidate text strategy activation function from each of the candidate strategy activation functions, and determine a reference text activation function corresponding to the candidate text strategy activation function from each of the candidate text activation functions; Determining a reference text strategy weight group from the text strategy weight subset according to the reference strategy activation function and the reference text activation function; According to each weight coefficient in the reference text strategy weight group, the reference strategy activation function and the reference text activation function are weightedly summed to obtain the candidate text strategy activation function.
7. The method according to any one of claims 1 to 6, characterized in that The step of updating the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set includes: Determine a current update weight subset from each subset of the preset weight set, and determine a current update weight coefficient from the current update weight subset; The current updated weight coefficient and the current model loss value are respectively derived to obtain a weight derivative value and a loss derivative value, and the current updated weight coefficient is updated according to the current updated weight coefficient, the weight derivative value and the loss derivative value; According to the updated current update weight coefficient, the current model loss value and the preset weight sum value, other weight coefficients in the current update weight subset are updated; After each subset in the preset weight set is updated, an updated preset weight set is obtained.
8. A training device for a text review model, characterized in that: include: A model output result determination module, used for inputting preset candidate audit strategies and sample texts into a pre-built text audit model, wherein the text audit model processes the candidate audit strategies and the sample texts according to a preset activation function set and a preset weight set, and outputs the audit results corresponding to each candidate audit strategy; A model loss value determination module, used to determine the current model loss value of the text audit model according to the audit result and the corresponding text audit true value; A weight updating module, used to update the weight coefficients in the preset weight set according to the current model loss value to obtain an updated preset weight set; The model training module is used to iteratively train the text review model including the updated preset weight set until the number of iterative training reaches a preset iteration threshold, thereby obtaining a trained text review model.
9. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement a training method for a text review model as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a training method for a text review model as described in any one of claims 1 to 7 is implemented.
