Search

CN-122021657-A - Session processing method, electronic device, computer storage medium, and program product

CN122021657ACN 122021657 ACN122021657 ACN 122021657ACN-122021657-A

Abstract

The embodiment of the application provides a session processing method, electronic equipment, a computer storage medium and a program product, wherein the session processing method comprises the steps of obtaining query session data used for man-machine interaction and input by a user in a current session with artificial intelligence, and a session subject label of the query session data, obtaining historical session data matched with the query session data, wherein the historical session data at least comprises a corresponding session subject label, and generating reply session data responding to the query session data through a generation model based on the query session data, the session subject label and the session subject label of the query session data and the historical session data. By the embodiment of the application, the generated reply session data has more pertinence, logic and accuracy, thereby effectively meeting the actual dialogue requirement of the user and providing more reasonable and personalized dialogue interaction for the user.

Inventors

  • MA LU
  • LI SHUKUI
  • CHEN HAONAN

Assignees

  • 优视科技(中国)有限公司

Dates

Publication Date
20260512
Application Date
20251231

Claims (14)

  1. 1. A method of session handling, the method comprising: Acquiring inquiry session data for man-machine interaction, which are input by a user in a current session with artificial intelligence, and a session subject label of the inquiry session data; Obtaining historical session data matched with the query session data, wherein the historical session data at least comprises a corresponding session theme tag; Reply session data responsive to the query session data is generated by a generative model based on the query session data, session subject and session subject tags of the query session data, and the historical session data.
  2. 2. The method of claim 1, wherein the obtaining historical session data that matches the query session data comprises: determining the similarity of the query session data and the historical session data based on the session topic tag of the query session data and the session topic tag of the stored historical session data; based on the similarity, historical session data that matches the query session data is determined.
  3. 3. The method of claim 2, wherein the determining the similarity of the query session data to the historical session data based on the session topic tag of the query session data and the session topic tag of the stored historical session data comprises: Calculating the similarity between the session theme label of the query session data and the session theme label of each historical session in multiple historical sessions, wherein each historical session contains at least one historical session data; And determining the similarity between the query session data and at least one round of historical session according to the preset number of similarity before sequencing.
  4. 4. A method according to claim 2 or 3, wherein the determining similarity of the query session data to historical session data based on session topic tags of the query session data and session topic tags of stored historical session data comprises: determining candidate similarity of the query session data and the historical session data based on the session topic tag of the query session data and the session topic tag of the stored historical session data; Obtaining aging information corresponding to historical session data, wherein the aging information is used for indicating the time association degree of the historical session data and the query session data; determining weights corresponding to the historical session data respectively based on the aging information, and adjusting candidate similarity corresponding to the historical session data according to the weights; and determining the adjusted candidate similarity as the similarity of the query session data and the historical session data.
  5. 5. A method according to any of claims 1-3, wherein said obtaining query session data entered by a user in a current session with artificial intelligence for human-machine interaction, and session body tags and session topic tags of said query session data, comprises: acquiring query session data for man-machine interaction, which is input by a user in a current session with artificial intelligence; performing session body identification on the query session data to obtain a session body tag corresponding to the query session data, wherein the session body tag is used for indicating that a target object aimed by the query session data is the initiator of the query session data or an associated person of the initiator; and determining a session topic tag of the query session data based on content data of the query session data.
  6. 6. The method of claim 5, wherein, The session theme label of the query session data in the current session at least comprises a content summary label of the query session data and an entity label of the query session data including an entity.
  7. 7. The method of claim 1, wherein the obtaining query session data for human-machine interaction for user input in a current session with artificial intelligence, and a session body tag and a session topic tag of the query session data, comprises: acquiring query session data for man-machine interaction, which is input by a user in a current session with artificial intelligence; Generating a corresponding conversation subject label and a conversation subject label for the query conversation data through a first label generation model; The first label generation model is obtained by performing fine tuning training on a general generation type basic model and then performing direct preference optimization training.
  8. 8. The method of claim 7, wherein the first tag generation model is obtained by training: performing fine tuning training on the general generation type basic model by using a first session sample with a session subject label and a session subject label to obtain a stage model; And correcting the first session sample, and performing direct preference optimization training on the stage model based on the first session sample before correction and the first session sample after correction to obtain the first label generation model.
  9. 9. The method of claim 8, wherein the direct preference optimization training of the phase model based on the pre-modified first session sample and the modified first session sample comprises: Sampling temperature parameters and/or optimizing prompt words aiming at the stage model based on a first session sample before correction, generating a first reply sample based on the sampled temperature parameters and/or the optimized prompt words through a first sub-model, evaluating the reply quality of the first reply sample through a second sub-model, and constructing a plurality of first positive and negative sample pairs according to an evaluation result; Generating a second reply sample through a third sub-model based on the corrected first session sample, performing negative reasoning on the generation process of the second reply sample, and constructing a plurality of second positive and negative sample pairs according to the result of the negative reasoning; and performing direct preference optimization training on the stage model based on the first positive and negative sample pair and the second positive and negative sample pair.
  10. 10. The method of claim 1, wherein the generating reply session data responsive to the query session data by a generative model based on the query session data, session body tags and session topic tags of the query session data, and the historical session data comprises: Reply session data responsive to the query session data is generated by a generative model based on the query session data, session subject and session subject tags of the query session data, the historical session data, and a user profile tag of the user.
  11. 11. The method of claim 10, wherein the user portrait tag is generated by a second tag generation model; the second label generation model is obtained through training in the following way: Acquiring second session samples of a plurality of batches, and aiming at the second session sample of each batch, acquiring the second session sample of the batch with the highest information integrity based on the optimal candidate selection strategy; Performing negative reasoning on the second session samples of the batch with the highest information integrity, and obtaining a target session sample according to the result of the negative reasoning; And training the general generation type basic model by using the target session sample to obtain a second label generation model for generating the user portrait label.
  12. 12. An electronic device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus; the memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the method of any one of claims 1-11.
  13. 13. A computer storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of claims 1-11.
  14. 14. A computer program product comprising computer instructions that instruct a computing device to perform operations corresponding to the method of any one of claims 1-11.

Description

Session processing method, electronic device, computer storage medium, and program product Technical Field Embodiments of the present application relate to the field of computer technologies, and in particular, to a session processing method, an electronic device, a computer storage medium, and a program product. Background With the development of AI (ARTIFICIAL INTELLIGENCE ) technology, AI technology is gradually applied to various working and living scenes in various ways (such as AI assistant, AI platform, AI control, etc.), and AI services are provided for users. In these scenarios, a user performs a real-time dialogue with an AI through natural language (e.g., text, speech, etc.) to obtain information, perform tasks, or make auxiliary decisions, etc. However, in these AI dialogue scenes, the AI services are more based on its own history knowledge to serve the user, and in many cases, this way makes the AI services not able to well understand the actual intention of the user, and it is difficult to satisfy the actual dialogue requirement of the user, and it is not able to provide more reasonable and personalized dialogue interaction for the user. Disclosure of Invention Accordingly, embodiments of the present application provide a session processing scheme to at least partially solve the above-mentioned problems. According to a first aspect of the embodiment of the application, a session processing method is provided, which comprises the steps of obtaining query session data for man-machine interaction, and session subject labels of the query session data, which are input by a user in a current session with artificial intelligence, obtaining historical session data matched with the query session data, wherein the historical session data at least comprises corresponding session subject labels, and generating reply session data responding to the query session data through a generation model based on the query session data, the session subject labels and the session subject labels of the query session data, and the historical session data. In some optional embodiments, the obtaining the historical session data matched with the query session data comprises determining similarity between the query session data and the historical session data based on the session topic label of the query session data and the session topic label of the stored historical session data, and determining the historical session data matched with the query session data based on the similarity. In some optional embodiments, the determining the similarity between the query session data and the historical session data based on the session topic label of the query session data and the session topic label of the stored historical session data includes calculating the similarity between the session topic label of the query session data and the session topic label of each historical session in multiple historical sessions, wherein each historical session includes at least one historical session data, and determining the similarity between the query session data and at least one historical session according to a preset number of similarity in the prior order. In some optional embodiments, the determining the similarity between the query session data and the historical session data based on the session topic tag of the query session data and the session topic tag of the stored historical session data includes determining candidate similarity between the query session data and the historical session data based on the session topic tag of the query session data and the session topic tag of the stored historical session data, acquiring aging information corresponding to the historical session data, wherein the aging information is used for indicating the time association degree between the historical session data and the query session data, determining weights corresponding to the historical session data respectively based on the aging information, adjusting the candidate similarity corresponding to the historical session data according to the weights, and determining the adjusted candidate similarity as the similarity between the query session data and the historical session data. In some optional embodiments, each round of history session corresponding to the history session data includes history query session data and reply session data corresponding to the history session data, and the session topic label corresponding to the history session data at least includes a content summary label of the history query session data, a reply summary label of the reply session data corresponding to the history query session data, and an entity label including an entity in the history query session data. In some optional embodiments, the method for obtaining the query session data for human-computer interaction, which are input by the user in the current session with the artificial intelligence, and the session subject label of the query session data com