Patent attributes
A method and an apparatus for generating a model are provided. The method includes: acquiring a sample set including sample sentences and labeling knowledge corresponding thereto; and selecting a sample from the sample set, and performing following training steps: inputting a sample sentence into a first initial model to generate first prediction knowledge corresponding to the sample sentence; inputting the first prediction knowledge into a second initial model to generate a first prediction sentence corresponding to the first prediction knowledge; inputting labeling knowledge into the second initial model to generate a second prediction sentence corresponding to the labeling knowledge; inputting the second prediction sentence into the first initial model to generate a second prediction knowledge corresponding to the second prediction sentence; determining a first reward signal; and training, using a reinforcement learning method based on the first reward signal to obtain a first model.