Search

CN-121328743-B - Multi-granularity role-aware personalized question-answer pair dynamic generation method and device

CN121328743BCN 121328743 BCN121328743 BCN 121328743BCN-121328743-B

Abstract

The invention discloses a personalized question-answer pair dynamic generation method and device for multi-granularity role perception, which relate to the technical field of artificial intelligence and comprise the steps of obtaining a long-term portrait vector and an instant context original vector of a user, calculating a role agility factor for quantifying the deviation degree of intention, and constructing an instant role vector; the method comprises the steps of obtaining candidate question-answer pairs, obtaining final fitness score, presetting a fitness threshold, comparing the final fitness score with the fitness threshold, collecting user interaction feedback signals, and conducting closed-loop correction on long-term portrait vectors. The method and the device construct the instant role by dynamically fusing the long-term image and the instant context of the user, perform double matching in the independent role space and the content space, improve the evaluation accuracy, dynamically generate new question-answer pairs when no suitable candidate exists, and perform closed-loop correction on the long-term image by utilizing user feedback so as to enable the image to continuously evolve, thereby remarkably improving the accuracy and user experience of personalized recommendation.

Inventors

  • CHEN YING
  • GAO LICHAO
  • YE FANGBIN
  • HUANG YOUJUN
  • JIANG HONGBO

Assignees

  • 厦门身份宝网络科技有限公司

Dates

Publication Date
20260512
Application Date
20251215

Claims (7)

  1. 1. A method for dynamically generating personalized question-answer pairs for multi-granularity role perception is characterized by comprising the following specific steps: S1, acquiring a long-term portrait vector and an instant context original vector of a user, projecting the instant context original vector to a common role space by utilizing a pre-trained projection matrix to obtain a context role vector, calculating a role agility factor for quantifying the deviation degree of intention based on the distance between the long-term portrait vector and the context role vector, and carrying out dynamic weighted fusion on the long-term portrait vector and the context role vector according to the role agility factor to construct the instant role vector; S2, acquiring candidate question-answer pairs, vectorizing the candidate question-answer pairs by using a role embedding model and a content embedding model respectively to obtain question-answer diagonal vectors and question-answer pair content vectors, calculating granularity matching degrees of the question-answer diagonal vectors and instant role vectors in a common role space, calculating content relevance of the question-answer pairs content vectors and instant context original vectors in the content space, weighting the granularity matching degrees and the content relevance by combining preset granularity weights and content weights to obtain final adaptation degree scores, and arranging the final adaptation degree scores corresponding to all the candidate question-answers in a descending order; S3, presetting an adaptation degree threshold value, comparing a final adaptation degree score with the adaptation degree threshold value, and selecting a candidate question-answer pair with the highest score to recommend when the final adaptation degree score is higher than the adaptation degree threshold value; S4, collecting user interaction feedback signals, and carrying out closed-loop correction on the long-term image vector by utilizing the interaction feedback signals and the instant character vector; The method for obtaining the long-term portrait vector and the instant context original vector of the user and constructing the instant role vector in S1 specifically comprises the following steps: S11, collecting global long-term portrait data of a user, including historical browsing records and historical question-answer interaction data of the user, and constructing long-term portrait vectors which are located in a predefined common role space; S12, acquiring instant context data, wherein the instant context data comprises query text input by a user currently and page content browsed currently, and the instant context data is constructed into an instant context original vector through a content encoder, and the instant context original vector is positioned in a content space; S13, performing linear transformation on the instant context original vector by using a pre-trained projection matrix, mapping the instant context original vector from a content space to a common role space to obtain a context role vector, and performing dynamic weighted fusion on the long-term portrait vector and the context role vector according to the role agility factor to construct the instant role vector.
  2. 2. The method for dynamically generating personalized question-answer pairs for multi-granularity character perception according to claim 1, wherein S1 further comprises: S14, calculating the distance between the long-term portrait vector and the context role vector in a common role space, and calculating by using an activation function to obtain a role agility factor; s15, linear interpolation is carried out on the long-term portrait vector and the context character vector by using the character agility factor as a dynamic mixing coefficient so as to construct an instantaneous character vector, wherein the calculation formula is as follows: Wherein, the In order to be a transient character vector, In order for the coefficients of dynamic mixing to be chosen, Is a vector for long-term image, Is a contextual role vector.
  3. 3. The method for dynamically generating personalized question-answer pairs for multi-granularity character perception according to claim 1, wherein S2 comprises: s21, searching candidate question-answer pairs from a knowledge base based on the instant context original vector; s22, generating a question-answer diagonal color vector by using the character embedding model, wherein the question-answer diagonal color vector is positioned in a common character space; s23, generating a question-answer pair content vector by using the content embedding model, wherein the question-answer pair content vector is located in a content space.
  4. 4. A method for dynamically generating personalized question-answer pairs for multi-granularity character perception according to claim 3, wherein S2 further comprises: S24, calculating the distance between the question-answering diagonal vector and the instant character vector in the common character space, and normalizing to obtain granularity matching degree; S25, calculating the relevance of the questions and answers to the content vector and the instant context original vector by using a cosine similarity function in the content space to obtain the content relevance; And S26, carrying out weighted summation on the granularity matching degree and the content correlation to obtain a final adaptation degree score.
  5. 5. The method for dynamically generating the personalized question-answer pairs for multi-granularity character perception according to claim 1, wherein the dynamic generation flow comprises: s31, when a trigger signal of a dynamic generation flow is received, affine transformation is carried out on the instant role vector and the instant context original vector, projection is carried out, and the projection is combined into a generator condition space, so that a generation control vector is constructed; s32, inputting the generated control vector and the instant context text corresponding to the instant context original vector into a pre-trained generation model together; s33, generating a question-answer pair dynamically generated by the generation model under the constraint of generating the control vector.
  6. 6. The method for dynamically generating personalized question-answer pairs for multi-granularity character perception according to claim 1, wherein S4 comprises: s41, monitoring interaction behaviors of a user on candidate question-answer pairs or dynamically generated question-answer pairs in real time, and quantifying the interaction behaviors into interaction feedback signals; S42, in the common role space, according to the preset long-term portrait learning rate, the interactive feedback signals and the instant role vectors are utilized to update the long-term portrait vector at the previous moment on line, and the updated long-term portrait vector is obtained.
  7. 7. A multi-granularity character-aware personalized question-answer pair dynamic generation apparatus for performing a multi-granularity character-aware personalized question-answer pair dynamic generation method according to any one of claims 1 to 6, comprising: The instant role construction unit is used for acquiring a long-term portrait vector and an instant context original vector of a user, projecting the instant context original vector to a common role space by utilizing a pre-trained projection matrix to obtain a context role vector, calculating a role agility factor based on the distance between the long-term portrait vector and the context role vector, and carrying out dynamic weighted fusion on the long-term portrait vector and the context role vector according to the role agility factor so as to construct the instant role vector; the adaptation degree evaluation unit is used for obtaining candidate question-answer pairs, respectively using a role embedding model and a content embedding model to vectorize the candidate question-answer pairs to obtain question-answer diagonal vectors and question-answer pair content vectors, calculating the granularity matching degree of the question-answer pair role vectors and the instant role vectors in a common role space, calculating the content relevance of the question-answer pair content vectors and the instant context original vectors in the content space, and weighting the granularity matching degree and the content relevance by combining preset granularity weights and content weights to obtain a final adaptation degree score; The question-answer decision unit is used for presetting an adaptation degree threshold value, comparing a final adaptation degree score with the adaptation degree threshold value, selecting a candidate question-answer pair with the highest score to recommend when the final adaptation degree score is higher than the adaptation degree threshold value, and triggering a dynamic generation process when the final adaptation degree score is not higher than the adaptation degree threshold value, wherein the question-answer decision unit triggers the dynamic generation process and comprises the following steps: the generating control vector construction module is used for carrying out affine transformation on the instantaneous role vector and the instant context original vector when receiving a trigger signal of the dynamic generating process, projecting and combining the instantaneous role vector and the instant context original vector into a generator condition space so as to construct a generating control vector; The question-answer pair generation module is used for inputting the generated control vector and the instant context text into the pre-trained generation model together so as to generate a dynamically generated question-answer pair by the generation model under the constraint of the generated control vector; And the portrait correction unit is used for collecting the user interaction feedback signal and carrying out closed-loop correction on the long-term portrait vector by utilizing the interaction feedback signal and the instant character vector.

Description

Multi-granularity role-aware personalized question-answer pair dynamic generation method and device Technical Field The invention relates to the technical field of artificial intelligence, in particular to a method and a device for dynamically generating personalized question-answer pairs by multi-granularity role awareness. Background Personalized recommendation systems, especially in the field of questions and answers, are an application of artificial intelligence technology aimed at providing relevant information by analyzing user data. The principle is that a long-term user portrait is constructed by using the historical behavior data of the user, and the matched question-answer content is searched and recommended from a knowledge base by combining the current instant query or context content of the user so as to improve the information acquisition efficiency of the user. In order to ensure the accuracy of recommendation, the system needs to comprehensively judge the long-term preference and the instant intention of the user, but in practical application, the instant intention of the user is influenced by external factors such as the current task, the browsing environment and the like, so that the instant intention is easy to deviate or conflict with the long-term portrait, for example, the knowledge level of the user can be changed temporarily. In the prior art, matching calculation is generally performed by acquiring the images and the context data, and recommendation is performed according to the calculation result. In practice, however, there is a large noise in the data used for matching, and some data that has little effect on the current real needs of the user. If matching and recommendation are directly carried out according to the data, for example, a static long-term portrait cannot reflect instant intent change, the situation that recommendation results are inaccurate is easy to occur, for example, content which does not accord with the current cognitive granularity of a user or is irrelevant to the context is recommended, and further, the great hidden trouble of poor user experience and low satisfaction degree exists. Disclosure of Invention The invention aims to provide a method and a device for dynamically generating personalized question-answer pairs by multi-granularity role perception, which solve the problems in the background technology. In order to solve the technical problems, the invention provides a multi-granularity character-aware personalized question-answer pair dynamic generation method, which comprises the following specific steps: S1, acquiring a long-term portrait vector and an instant context original vector of a user, projecting the instant context original vector to a common role space by utilizing a pre-trained projection matrix to obtain a context role vector, calculating a role agility factor for quantifying the deviation degree of intention based on the distance between the long-term portrait vector and the context role vector, and carrying out dynamic weighted fusion on the long-term portrait vector and the context role vector according to the role agility factor to construct the instant role vector; S2, acquiring candidate question-answer pairs, vectorizing the candidate question-answer pairs by using a role embedding model and a content embedding model respectively to obtain question-answer diagonal vectors and question-answer pair content vectors, calculating granularity matching degrees of the question-answer diagonal vectors and instant role vectors in a common role space, calculating content relevance of the question-answer pairs content vectors and instant context original vectors in the content space, weighting the granularity matching degrees and the content relevance by combining preset granularity weights and content weights to obtain final adaptation degree scores, and arranging the final adaptation degree scores corresponding to all the candidate question-answers in a descending order; S3, presetting an adaptation degree threshold value, comparing a final adaptation degree score with the adaptation degree threshold value, and selecting a candidate question-answer pair with the highest score to recommend when the final adaptation degree score is higher than the adaptation degree threshold value; and S4, collecting user interaction feedback signals, and carrying out closed-loop correction on the long-term image vector by utilizing the interaction feedback signals and the instant character vector. Preferably, the step S1 of obtaining the long-term portrait vector and the instant context original vector of the user and constructing the instant role vector specifically includes: S11, collecting global long-term portrait data of a user, including historical browsing records and historical question-answer interaction data of the user, and constructing long-term portrait vectors which are located in a predefined common role space; S12, acquiring instant contex