CN-122021567-A - Model training method, text modification method and composition color-rendering model training method
Abstract
The embodiment of the specification provides a model training method, a text modification method and a composition color-rendering model training method, wherein the model training method comprises the steps of obtaining a sample text, identifying a prediction statement to be modified from the sample text by means of a language model, marking the prediction statement to be modified, training the language model based on the prediction statement to be modified and the label statement to be modified and the prediction statement to be modified, and the prediction statement to be modified and the label modification reason, obtaining a statement identification model, modifying the label statement to be modified based on the label modification reason by means of the statement identification model, generating a prediction statement to be modified, training the statement identification model based on the prediction statement to be modified and the label modification statement, and obtaining the statement modification model. The pertinence and the efficiency of modifying sentences in the text can be improved.
Inventors
- LIU HUAZHENG
- GAO YIFEI
- CHEN LEI
- Weng Qiujie
- LIU JINGMING
Assignees
- 北京猿力未来科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260130
Claims (16)
- 1. A method of model training, comprising: obtaining a sample text, wherein the sample text comprises a label to-be-modified sentence, and the label to-be-modified sentence is marked with a label modification reason and a label modification sentence; Identifying a statement to be modified from the sample text by using a language model, and marking a prediction modification reason; training the language model based on the statement to be modified and the statement to be modified, as well as the predicted modification reason and the tag modification reason, to obtain a statement identification model; Modifying the statement to be modified of the tag based on the tag modification reason by using the statement identification model to generate a prediction modification statement; And training the sentence identification model based on the prediction modification sentence and the label modification sentence to obtain a sentence modification model.
- 2. The method of claim 1, wherein modifying the tag statement to be modified based on the tag modification cause using the statement identification model to generate a predictive modification statement comprises: and modifying the label to-be-modified sentence based on the label modification reason by using the sentence identification model and taking the sample text as a context to generate a prediction modification sentence.
- 3. The method of claim 1, wherein the training the language model based on the predicted statement to be modified and the labeled statement to be modified, and the predicted modification cause and the labeled modification cause, to obtain a statement identification model, comprises: determining a first loss value based on the statement to be modified and the statement to be modified; determining a second loss value based on the predicted modification cause and the tag modification cause; and based on the first loss value and the second loss value, carrying out back propagation update on the parameters of the language model to obtain a sentence recognition model.
- 4. The method of claim 1, wherein the training the sentence recognition model based on the predictive modification sentence and the tag modification sentence to obtain a sentence modification model comprises: Determining a third penalty value based on the predictive modification statement and the tag modification statement; and based on the third loss value, carrying out back propagation update on the parameters of the sentence identification model to obtain a sentence modification model.
- 5. The method of any one of claims 1-4, wherein the tag modification statement is labeled with a tag modification effect; Modifying the sentence to be modified of the tag based on the tag modification reason by using the sentence identification model, and generating a prediction modification sentence, including: modifying the statement to be modified of the tag based on the tag modification reason by using the statement identification model to generate a prediction modification statement and a prediction modification effect; training the sentence identification model based on the prediction modification sentence and the label modification sentence to obtain a sentence modification model, including: Training the sentence identification model based on the prediction modification sentence and the label modification sentence, and the prediction modification effect and the label modification effect to obtain a sentence modification model.
- 6. The method of claim 5, wherein modifying the tagged statement to be modified based on the tag modification cause using the statement identification model to generate a predictive modification statement and a predictive modification effect comprises: and modifying the sentence to be modified of the label based on the label modification reason by using the sentence identification model and taking the sample text as a context, so as to generate a prediction modification sentence and a prediction modification effect.
- 7. The method of claim 6, wherein the training the sentence recognition model based on the predictive modification sentence and the tag modification sentence, and the predictive modification effect and the tag modification effect to obtain a sentence modification model comprises: Determining a third penalty value based on the predictive modification statement and the tag modification statement; determining a fourth loss value based on the predicted modification effect and the tag modification effect; and based on the third loss value and the fourth loss value, carrying out back propagation update on the parameters of the statement identification model to obtain a statement modification model.
- 8. A text modification method, comprising: Acquiring an initial text sent by a front end; identifying a sentence to be modified from the initial text by using a sentence modification model, marking a modification reason, and modifying the sentence to be modified based on the modification reason to generate a modified sentence, wherein the sentence modification model is trained by the method of any one of claims 1 to 7; And feeding the statement to be modified, the modification reason and the modification statement back to the front end.
- 9. The method of claim 8, wherein the identifying, using a sentence modification model, a sentence to be modified from the initial text, and labeling a modification reason, modifying the sentence to be modified based on the modification reason, and generating a modification sentence, comprises: identifying a sentence to be modified from the initial text by using a sentence modification model, marking a modification reason, modifying the sentence to be modified based on the modification reason, and generating a modification sentence and a modification effect corresponding to the modification sentence; the feeding back the statement to be modified, the modification reason and the modification statement to the front end includes: And feeding the statement to be modified, the modification reason, the modification statement and the modification effect back to the front end.
- 10. A composition color rendering model training method is characterized by comprising the following steps: Acquiring a sample composition, wherein the sample composition comprises a label statement to be moistened, and the label statement to be moistened is marked with a label moistened reason and a label moistened statement; identifying and predicting sentences to be moistened from the sample composition by using a language model, and marking the predicted moistened reason; Training the language model based on the statement to be moistened and the statement to be moistened of the label, as well as the predicted moistened reason and the label moistened reason to obtain a statement identification model; utilizing the statement identification model to moisten the statement to be moistened of the label based on the label moisten reason to generate a predicted moisten statement; and training the sentence recognition model based on the prediction color rendering sentence and the label color rendering sentence to obtain a sentence color rendering model.
- 11. The method of claim 10, wherein the label-rendering statement is labeled with a label-rendering effect; Utilizing the sentence identification model to moisten the label to-be-moistened sentence based on the label moisten reason to generate a predicted moisten sentence, comprising: Utilizing the statement identification model to moisten the statement to be moistened of the label based on the label moisten reason, and generating a predicted moisten statement and a predicted moisten effect; The training of the sentence recognition model based on the prediction color rendering sentence and the label color rendering sentence to obtain a sentence color rendering model comprises the following steps: And training the sentence recognition model based on the predicted moisturizing sentence and the label moisturizing sentence, and the predicted moisturizing effect and the label moisturizing effect to obtain a sentence moisturizing model.
- 12. A composition color rendering method, comprising: acquiring an initial composition sent by a front end; Identifying a sentence to be moistened from the initial composition by using a sentence moisten model, marking moisten reasons, and moistening the sentence to be moistened based on the moisten reasons to generate an moistened sentence, wherein the sentence moisten model is obtained by training the method of claim 10 or 11; and feeding back the statement to be moistened, the moistened reason and the moistened statement to the front end.
- 13. The method of claim 12, wherein the identifying, using a statement rendering model, a statement to be rendered from the initial composition, and labeling a rendering reason, rendering the statement to be rendered based on the rendering reason, and generating a rendering statement comprises: Identifying a statement to be moistened from the initial composition by using a statement moisten model, marking moisten reasons, and moistening the statement to be moistened based on the moisten reasons to generate moisten statements and moisten effects corresponding to the moisten statements; The feedback of the statement to be moistened, the moistened reason and the moistened statement to the front end comprises: and feeding back the statement to be moistened, the moistened reason, the moistened statement and the moistened effect to the front end.
- 14. A computing device, comprising: A memory and a processor; The memory is adapted to store a computer program/instruction, the processor being adapted to execute the computer program/instruction, which when executed by the processor, implements the steps of the method of any of claims 1 to 13.
- 15. A computer-readable storage medium, characterized in that it stores a computer program/instruction which, when executed by a processor, implements the steps of the method of any one of claims 1 to 13.
- 16. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method of any of claims 1 to 13.
Description
Model training method, text modification method and composition color-rendering model training method Technical Field The embodiment of the specification relates to the technical field of artificial intelligence, in particular to a model training method, a text modification method and a composition color-rendering model training method. Background With the increase of the amount of text data, the field of color rendering of text data of users is increasing, such as scenes of academic paper writing, student writing coaching and the like. Traditional mode to the text data is mainly artifical moisturizing, and artifical moisturizing is to select the sentence that needs to carry out the moisturizing in the manual mode from user text data, carries out the targeted moisturizing again. The pertinence of manual color rendering is strong, the efficiency is low, and the quick color rendering of massive text data can not be realized. The more advanced method for moisturizing the text data is mainly used for full-text moisturizing the text data through a large language model, but the moisturizing method is too much for modifying original text data of a user, so that the user is difficult to identify the core of the expression problem of the user, and the writing skill cannot be effectively learned through moisturizing feedback. In summary, the prior art cannot realize efficient and accurate (highly targeted) rendering of text data. Disclosure of Invention In view of this, the present description embodiments provide a model training method. One or more embodiments of the present specification relate to a text modification method, a composition rendering model training method, a composition rendering method, a computing device, a computer-readable storage medium, and a computer program product, which solve the technical drawbacks of the prior art. According to a first aspect of embodiments of the present specification, there is provided a model training method, including: Obtaining a sample text, wherein the sample text comprises a label to-be-modified sentence, and the label to-be-modified sentence is marked with a label modification reason and a label modification sentence; Identifying a statement to be modified from the sample text by using a language model, and marking a prediction modification reason; training the language model based on the statement to be modified and the statement to be modified of the label, as well as the predicted modification reason and the label modification reason to obtain a statement identification model; modifying the label to-be-modified sentence based on the label modification reason by utilizing the sentence identification model to generate a prediction modification sentence; Based on the prediction modification statement and the label modification statement, training the statement identification model to obtain the statement modification model. According to a second aspect of embodiments of the present specification, there is provided a text modification method, comprising: Acquiring an initial text sent by a front end; identifying a sentence to be modified from the initial text by using a sentence modification model, marking a modification reason, and modifying the sentence to be modified based on the modification reason to generate a modification sentence, wherein the sentence modification model is obtained by training through the model training method; and feeding the statement to be modified, the modification reason and the modification statement back to the front end. According to a third aspect of embodiments of the present disclosure, there is provided a composition rendering model training method, including: Acquiring a sample composition, wherein the sample composition comprises a label statement to be moistened, and the label statement to be moistened is marked with a label moistened reason and a label moistened statement; Identifying and predicting sentences to be moistened from the sample composition by using a language model, and marking the predicted moistened reason; Training the language model based on the statement to be rendered and the statement to be rendered of the label, and the predicted rendering reason and the label rendering reason to obtain a statement identification model; utilizing a statement identification model to moisten the statement to be moistened of the label based on the label moisten reason, and generating a prediction moisten statement; Based on the prediction color rendering sentence and the label color rendering sentence, training the sentence recognition model to obtain the sentence color rendering model. According to a fourth aspect of embodiments of the present disclosure, there is provided a composition rendering method, including: acquiring an initial composition sent by a front end; Identifying a sentence to be moistened from an initial composition by using a sentence moisten model, marking the moisten reason, and moistening the sentenc