CN-121996742-A - Reply content generation method and device, electronic equipment and storage medium
Abstract
The application relates to the technical field of computers and provides a method, a device, electronic equipment and a storage medium for generating reply content, wherein the method comprises the steps of obtaining session content, wherein the session content at least comprises questioning contents to be replied; the method comprises the steps of utilizing at least one intention identification mode in an intention classification model and a matching condition set to identify intention categories of questioning contents to be replied in combination with session contents, wherein the intention categories comprise existing intention categories and newly added intention categories, the intention classification model is used for identifying the existing intention categories, the matching condition set comprises matching conditions corresponding to the newly added intention categories, and calling a category reply generation model corresponding to the existing intention categories or the newly added intention categories to generate reply contents of the questioning contents to be replied. The application can quickly provide question-answering service related to the new intention category without retraining the intention classification model after the new intention category is added.
Inventors
- ZHU XIUHONG
Assignees
- 腾讯科技(深圳)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241106
Claims (16)
- 1. A method of generating reply content, comprising: acquiring session content, wherein the session content at least comprises questioning contents to be replied; Identifying the intention category of the questioning content to be replied by combining the session content in at least one intention identification mode of an intention classification model and a matching condition set, wherein the intention category comprises an existing intention category and a newly added intention category; When the intention classification model is used for identifying the intention category of the questioning contents to be replied in combination with the session contents, the existing intention category output by the intention classification model is obtained; When the intention category of the questioning content to be replied is identified by combining the session content with the matching condition set, determining the newly added intention category of the questioning content to be replied based on the instruction category, the instruction theme and the intention field to which the questioning content to be replied belongs; And calling a class reply generation model corresponding to the existing intention class or the newly added intention class to generate reply content of the questioning content to be replied.
- 2. The method of claim 1, wherein the determining the new intent category of the to-be-returned question content based on the instruction category, the instruction subject, and the intent domain to which the to-be-returned question content belongs comprises: based on the session content, identifying the instruction category, the instruction theme and the intention field to which the questioning content to be replied belongs; matching the instruction category, the instruction theme and the intention field to which the questioning content to be replied belongs with the matching conditions corresponding to each newly added intention category in the matching condition set to obtain a matching result; If the matching result indicates that a target matching condition matched with the instruction category, the instruction theme and the intention field to which the questioning content to be replied belongs exists, the new intention category corresponding to the target matching condition is used as the new intention category of the questioning content to be replied.
- 3. The method of claim 2, wherein the identifying, based on the session content, the instruction category, the instruction topic, and the intention field to which the question content to be replied belongs, comprises: The instruction classification model classifies the instruction types of the questioning contents to be replied according to the session contents, and outputs the instruction types of the questioning contents to be replied; the instruction topic classification model classifies instruction topics of the questioning contents to be replied according to the session contents, and outputs instruction topics to which the questioning contents to be replied belong; And classifying the intention field of the questioning contents to be replied according to the session contents by using an intention field classification model, and outputting the intention field of the questioning contents to be replied.
- 4. A method according to claim 3, characterized in that the method further comprises: Acquiring a plurality of pieces of sample session content, wherein each piece of sample session content comprises sample questioning content; For each piece of sample session content, classifying instruction categories of sample questioning contents in the sample session content by a first large language model according to instruction category prompt texts, outputting sample instruction categories of the sample questioning contents in the sample session content, wherein the instruction category prompt texts are used for indicating the first large language model in a plurality of instruction categories, and outputting the instruction categories of the sample questioning contents in the sample session content; constructing a first training sample set according to the plurality of sample session contents and sample instruction categories of sample question contents in the sample session contents; And training the instruction category classification model through the first training sample set.
- 5. The method of claim 4, wherein after the obtaining the plurality of sample session contents, the method further comprises: For each sample session content, classifying instruction topics of sample questioning contents in the sample session content by the first large language model according to instruction topic prompt texts, outputting sample instruction topics of the sample questioning contents in the sample session content, wherein the instruction topic prompt texts are used for indicating the first large language model in a plurality of instruction topics, and outputting instruction topics of the sample questioning contents in the sample session content; constructing a second training sample set according to the plurality of sample session contents and sample instruction topics to which sample questioning contents in the sample session contents belong; and training the instruction topic classification model through the second training sample set.
- 6. The method of claim 4 or 5, wherein after the obtaining the plurality of sample session contents, the method further comprises: For each piece of sample conversation content, classifying the intention field of sample questioning content in the sample conversation content according to intention field prompt texts by the first large language model, outputting the sample intention field of the sample questioning content in the sample conversation content, wherein the intention field prompt texts are used for indicating that the first large language model is in a plurality of intention fields, and outputting a sample conversation building third training sample set; training the intention field classification model through the third training sample set.
- 7. The method of claim 2, wherein the identifying, based on the session content, the instruction category, the instruction topic, and the intention field to which the question content to be replied belongs, comprises: And processing the session content by the second large language model according to the classification prompt text, and outputting the instruction category, the instruction subject and the intention field to which the to-be-replied question belongs, wherein the classification prompt text is used for indicating the second large language model to classify the instruction category of the to-be-replied question in a plurality of instruction categories, classify the instruction subject of the to-be-replied question in a plurality of instruction subjects and classify the intention field of the to-be-replied question in a plurality of intention fields.
- 8. The method of any one of claims 2 to 5 and 7, wherein the matching condition corresponding to one of the newly added intent categories includes an instruction category sub-condition, an instruction subject sub-condition, and an intent domain sub-condition, the matching result including a sub-matching result for each of the matching conditions in the set of matching conditions; Matching the instruction category, the instruction theme and the intention field to which the question content to be replied belongs with the matching conditions corresponding to each newly added intention category in the matching condition set to obtain a matching result, wherein the matching result comprises the following steps: the following processing is performed for each matching condition in the matching condition set: Performing satisfaction verification on the instruction category to which the questioning content to be replied belongs and the instruction category sub-conditions in the matching condition to obtain an instruction category verification result; performing satisfaction verification on the instruction subject to which the questioning content to be replied belongs and the instruction subject sub-conditions in the matching condition to obtain an instruction subject verification result; Performing satisfaction verification on the intention field to which the questioning content to be replied belongs and intention field sub-conditions in the matching conditions to obtain an intention field verification result; And determining a sub-matching result aiming at the matching condition according to the instruction category verification result, the instruction subject verification result and the intention field verification result.
- 9. The method of claim 8, wherein the matching condition for one of the additional intent categories further comprises a keyword sub-condition; before determining the sub-matching result for the matching condition according to the instruction category verification result, the instruction subject verification result and the intention field verification result, the method further comprises: Aiming at each matching condition in the matching condition set, performing satisfaction verification results on the segmentation in the questioning contents to be replied and the keyword sub-conditions in the matching conditions to obtain keyword verification results; the determining a sub-matching result for the matching condition according to the instruction category verification result, the instruction subject verification result and the intention field verification result comprises the following steps: And determining sub-matching results aiming at the matching conditions according to the instruction category verification result, the instruction subject verification result, the intention field verification result and the keyword verification result.
- 10. The method according to any one of claims 1 to 5 and 7, wherein the identifying the intention category of the question to be replied to in connection with the session content by means of at least one intention identification means of an intention classification model and a set of matching conditions comprises: Carrying out intention classification on the questioning contents to be replied according to the session contents by utilizing the intention classification model to obtain an intention classification result; If the intention classification result indicates that the intention category of the to-be-replied question content is not identified in the existing intention categories, the matching condition set is utilized to combine the instruction category, the instruction subject and the intention field to which the to-be-replied question content belongs, and the newly added intention category identification is carried out on the to-be-replied question content, so that the intention category of the to-be-replied question content is obtained.
- 11. The method according to any one of claims 1 to 5 and 7, wherein the identifying the intention category of the question to be replied to in connection with the session content by means of at least one intention identification means of an intention classification model and a set of matching conditions comprises: Utilizing the matching condition set, and combining the instruction category, the instruction theme and the intention field to which the questioning contents to be replied belong, and carrying out new intention category identification on the questioning contents to be replied to obtain a new intention identification result; And if the new intention recognition result indicates that the intention category of the questioning content to be replied is not the new intention category, classifying the intention category of the questioning content to be replied by utilizing the intention classification model according to the session content to obtain the intention category of the questioning content to be replied.
- 12. The method according to any one of claims 1 to 5 and 7, wherein the method further comprises, prior to identifying the intention category of the question to be replied to in connection with the session content, using at least one means of intention recognition in the intention classification model and the set of matching conditions: acquiring a classification indication label; Determining a priority recognition mode in the intention recognition modes by using an intention classification model and a matching condition set according to the classification indication label, wherein if at least one newly added intention category is determined to be a sub-category of the existing intention category according to the classification indication label, the priority recognition mode is a mode of carrying out intention recognition by using the intention classification model; the identifying the intention category of the questioning content to be replied by combining the session content in at least one intention identifying mode in the intention classifying model and the matching condition set comprises the following steps: and preferentially identifying the intention category of the questioning content to be replied according to the preferential identification mode and combining the session content.
- 13. A reply content generation apparatus, comprising: The acquisition module is used for acquiring session content which at least comprises questioning contents to be replied; The device comprises an identification module, an intention classification module and a matching condition set, wherein the identification module is used for identifying the intention category of the questioning content to be replied by combining the session content by utilizing at least one intention identification mode in the intention classification model and the matching condition set, the intention classification module is used for identifying the existing intention category, the matching condition set comprises matching conditions corresponding to the newly added intention category, each intention category is provided with a unique corresponding category reply generation model, when the intention classification model is used for identifying the intention category of the questioning content to be replied by combining the session content, the existing intention category output by the intention classification model is obtained, and when the intention category of the questioning content to be replied is identified by combining the session content by utilizing the matching condition set, the newly added intention category of the questioning content to be replied is determined based on the instruction category, the instruction subject and the intention field to which the questioning content to be replied belongs; and the reply generation module is used for calling a class reply generation model corresponding to the existing intention class or the newly added intention class to generate reply content of the to-be-replied question content.
- 14. An electronic device, comprising: A processor; A memory having stored thereon computer instructions which, when executed by the processor, implement the method of any of claims 1 to 12.
- 15. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the method of any one of claims 1 to 12.
- 16. A computer program product comprising computer instructions which, when executed by a processor, implement the method of any one of claims 1 to 12.
Description
Reply content generation method and device, electronic equipment and storage medium Technical Field The present application relates to the field of computer technologies, and in particular, to a method and apparatus for generating reply content, an electronic device, and a storage medium. Background An intention classification model and a class reply generation model corresponding to a plurality of intention classes are deployed on a question and answer platform, after the question content of the user is received, the intention classification is carried out on the question content of the user through the intention classification model, the intention class to which the question content belongs is determined, then the question content is routed to the class reply generation model corresponding to the intention class to which the question content belongs, and the reply content of the question content is generated by the corresponding class reply generation model. In practical applications, as the user needs change or the functions of the question-answering platform are richer, new intention categories may be added, and a category reply generation model applicable to the new intention categories may be deployed. Correspondingly, in order to ensure that the intention classification model classifies questioning contents belonging to the newly added intention category, updating training is required to be carried out on the intention classification model. In the related art, since the intention classification model needs to be retrained after the intention class is newly added, the intention classification model needs to be retrained for a long time, and a long time needs to be waited for to provide a question-answer service for question contents related to the new intention class. Disclosure of Invention In view of the above, the embodiments of the present application provide a method, an apparatus, an electronic device, and a storage medium for generating reply content, so as to solve the problem that in the related art, under the condition of a new added intention category, it is necessary to wait for a long time to provide a question-answer service for the question content of the new added intention category due to the need of retraining the intention classification model. The embodiment of the application provides a method for generating reply content, which comprises the steps of obtaining session content, wherein the session content at least comprises to-be-replied questioning content, utilizing at least one intention identification mode in an intention classification model and a matching condition set to identify an intention category of the to-be-replied questioning content in combination with the session content, wherein the intention category comprises an existing intention category and a newly added intention category, the intention classification model is used for identifying the existing intention category, the matching condition set comprises a matching condition corresponding to the newly added intention category, each intention category has a unique corresponding category reply generation model, when the intention classification model is utilized to identify the intention category of the to-be-replied questioning content in combination with the session content, obtaining the existing intention category output by the intention classification model, when the intention category of the to-be-replied questioning content is identified in combination with the session content, determining a new added intention category of the to-be-replied questioning content based on an instruction category, an instruction subject and an intention field to which the to-be-replied questioning content belongs, and calling the intention category corresponding to the newly added intention category to be-replied questioning content, and generating the to-replying questioning content. The embodiment of the application provides a device for generating reply content, which comprises an acquisition module, an identification module and a generation module, wherein the acquisition module is used for acquiring session content, the session content at least comprises to-be-replied questioning content, the identification module is used for utilizing at least one intention identification mode in an intention classification model and a matching condition set to identify the intention class of the to-be-replied questioning content in combination with the session content, the intention class comprises an existing intention class and a newly added intention class, the intention classification model is used for identifying the existing intention class, the matching condition set comprises a matching condition corresponding to the newly added intention class, each intention class has a unique corresponding class reply generation model, the existing intention class output by the intention classification model is obtained when the intention clas