Video media platform conversation recommendation method based on knowledge perception prompt fine tuning
By adopting a fine-tuning method based on knowledge-aware prompts in the dialogue recommendation of video media platform, the problems of information uniformity and module coordination are solved, the recommendation performance and the generation effect of natural language replies are improved, and data sparseness and cold start problems are alleviated.
Patent Information
- Application Number
- CN202411950147.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The existing video media platform dialogue recommendation methods have problems in information uniformity and module coordination, resulting in low recommendation performance and poor natural language reply generation effect.
Using a method based on knowledge-aware prompt fine-tuning, aligning the semantic space of historical dialogues and historical entities by comparing the learning method, a unified prompt template is generated, and joint training of dialogue tasks and recommendation tasks is carried out in the pre-trained language model, and recommendation performance is improved by designing appropriate prompt vectors.
The efficiency of input information utilization in the dialogue recommendation method is optimized, which alleviates the problems of data sparseness and cold start, and improves the performance of dialogue recommendations and the generation effect of natural language replies.
Smart Images

Figure CN119739893A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of recommendation systems, and in particular to a video media platform dialogue recommendation method based on knowledge-aware prompt fine-tuning. Background Art
[0002] With the popularization of the Internet and the continuous growth of the number of Internet users, Internet video media platforms have developed rapidly, the market size has continued to expand, and they have gradually become an important part of my country's digital economy. The video media platform industry chain mainly includes content production, platform services, and user consumption. Among them, users are both consumers of content and users of the platform. How to meet their needs and preferences is one of the key issues in video production and platform operation. Therefore, recommendation systems have gradually been widely used in video media platforms.
[0003] A recommendation system is an intelligent system that helps users obtain items or information of interest by understanding their interests and preferences. Currently, static recommendation systems based on historical user interaction data have problems with cold start and human-computer interaction because of historical data noise and ignoring factors such as user online behavior. Conversational recommendation applies real-time interactive conversational methods to recommendation systems, focusing on users' online conversation data, guiding and capturing users' real-time interests and preferences, and recommending items to users in a timely manner in the form of natural language responses.
[0004] A video media platform conversation recommendation consists of a recommendation module and a conversation module. The two modules are highly coupled, highly correlated at the information level, and mutually coordinated in task implementation. Therefore, in order to improve the performance of video media platform conversation recommendation, it becomes a key issue to explore how to use a unified model or method to implement recommendation tasks and conversation tasks to promote the collaboration between the two modules. The present invention proposes a video media platform conversation recommendation method based on knowledge-aware prompt fine-tuning, which unifies the input information of the conversation module and the recommendation module, and integrates the two modules into a joint training framework, thereby improving the performance of video media platform conversation recommendation by designing appropriate prompt vectors. Summary of the invention
[0005] In order to overcome the problems of information uniformity and module coordination in the current video media platform dialogue recommendation method, which leads to low recommendation performance and poor natural language response generation effect, the present invention proposes a video media platform dialogue recommendation method based on knowledge-aware prompt fine-tuning to improve the performance of video media platform dialogue recommendation.
[0006] The technical solution adopted by the present invention to solve its technical problem is:
[0007] A method for video media platform dialogue recommendation based on knowledge-aware prompt fine-tuning. First, the semantic space of historical dialogues and historical entities is aligned using a contrastive learning method to generate a unified prompt template. Enhanced similar user representation is added to the prompt template design to alleviate data sparsity and cold start problems. Then, the prompt vector and historical dialogue vector are input into a pre-trained language model and jointly trained under dialogue tasks and recommendation tasks. Finally, the predicted reply sentences and recommended items are generated respectively by fine-tuning the pre-trained language model to obtain the current natural language response of the video media platform.
[0008] Further, the method comprises the following steps:
[0009] Step 1: A video media platform recommends video items that may be of interest to users through dialogue with them; the user set is represented by A = {a1, a2, ... a N}, the video item set is represented as I = {i1,i2,…i M}, the video-related entity set is represented as Video Media Knowledge Graph By entity collection The set of relationships between entities Composition: The historical dialogue set between the platform and the user before the tth round is expressed as where s j represents the jth round of dialogue between the platform and the user, and the tth round of dialogue s t As the current reply tag; the historical entity set is represented by E = {E1, E2, ... E j}, where E j ={e j1 ,e j2 ,…,e jH}, E j represents the entity set that appears in the jth round of dialogue, e ji Represents the i-th entity that appears in the j-th round of dialogue;
[0010] Step 2: Each s in the historical conversation set C j The sentences are connected into a long sentence s in the order of the conversation time, and the video names appearing in the conversation are replaced with item masks; the long sentence s is encoded into a word embedding matrix S using the XLM-RoBERTa model, and then the embedding representation of the historical conversation is obtained through residual connection and self-attention neural network.
[0011]
[0012] in W SA and b are learnable parameter matrices and vectors;
[0013] Step 3: Based on video media knowledge graph The entities in the historical conversation are connected, and then the R-GCN model is used to encode the entities and their relationships to obtain the representation of the entity node in the (l+1)th layer of the R-GCN model.
[0014]
[0015] in represents the neighbor entity node of e under the relationship r, and W (l) is the learnable parameter matrix, Z e,r is the regularization coefficient; with the accumulation of entity nodes in the historical dialogue, an entity embedding matrix is obtained, and then the embedding representation r of the historical entity is obtained through residual connection and self-attention neural network E ;
[0016] Step 4: Represent the dialogue obtained in the same dialogue as r C and entity representation r E Set it as a positive example, otherwise set it as a negative example, and calculate the contrastive learning loss function
[0017]
[0018] Pre-training is performed, where h + and h - are the positive and negative samples for h, sim(h1,h2) represents the cosine similarity, and τ is the temperature hyperparameter;
[0019] Step 5: Use the historical entity representation obtained after pre-training as the user representation u, and then obtain the matrix U of all user representations in the training set; use the k-nearest neighbor search algorithm to retrieve the k user representations U′=[u1′,…,u′ k ]; each u in the similar user set U′ i ′ is replaced with a randomly selected user representation with probability ρ
[0020]
[0021] Where Aug() represents the random replacement function;
[0022] Step 6: Calculate the representation obtained by fusing the similar user representation with the target user representation
[0023]
[0024] Where x is a learnable parameter, Sigmoid(x) is the weight of similar user representation; traverse each u in the similar user set U′ i′, and the enhanced similar user representation matrix is obtained by this method
[0025] Step 7: Randomly initialize the soft label hint vector ST = [st1,…,st k ]; Combine user representation based on video media knowledge graph, enhanced similar user representation and soft labeling to obtain prompt template
[0026]
[0027] Where k1, k2 and k3 are the lengths of user representation, similar user representation and soft label respectively;
[0028] Step 8: Input the prompt template into a feedforward neural network to obtain the prompt vector And combined with the historical dialogue C and the reply label R, the input vector of the pre-trained language model PLM is obtained
[0029]
[0030] Step 9: The prompt vector and historical dialogue C is input into PLM to generate predicted responses;
[0031] Step 10: Calculate the loss of the dialogue task
[0032]
[0033] Where N is the batch size for training, m i is the length of the target reply of the i-th sentence, Pr(w) represents the calculation of the Softmax score, Θ prompt represents the trainable parameters in the hint encoder, Θ PLM Represents the trainable parameters in PLM;
[0034] Step 11: PLM input vector T PLM And the special tag of the recommendation task is input into PLM, and the output vector of PLM corresponding to the special tag is obtained
[0035] Step 12: Calculate the loss of the recommendation task
[0036]
[0037] Where N is the batch size for training, M is the total number of items, and y i,j represents the binary true label (0 or 1) of item j in round i, Indicates the predicted probability of item j in round i calculated by the Softmax function;
[0038] Step 13: Calculate the joint loss function
[0039]
[0040] Where λ1 and λ2 are the weights of the training loss for the dialogue task and recommendation task respectively;
[0041] Step 14: Repeat steps 6 to 13. When the Loss is less than the specified minimum loss value, the calculation ends.
[0042] Step 15: The prompt vector And historical dialogue C is input into PLM to generate predicted reply sentences, and PLM is input into vector T PLM The special mark input PLM of the recommendation task is used to obtain the recommended item, and the item mask in the predicted reply sentence is replaced with the video name of the recommended item to obtain the current natural language response recommended by the video media platform dialogue.
[0043] Preferably, in step 1, the video-related entities include actors, directors, themes and styles, etc.
[0044] The technical concept of the present invention is: in the video media platform dialogue recommendation, the preferences of users with sparse interactions are fully explored, and a joint training method based on prompt fine-tuning is used to promote the collaboration of dialogue and recommendation subtasks, thereby improving the performance of dialogue recommendation.
[0045] The beneficial effects of the present invention are: optimizing the problems of low input information utilization efficiency and semantic misalignment of output content in the dialogue recommendation method; and alleviating the data sparsity and cold start problems in the dialogue recommendation of the video media platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flowchart of a method for recommending conversations for video media platforms based on fine-tuning of knowledge-aware prompts; DETAILED DESCRIPTION
[0047] The present invention will be further described below in conjunction with the accompanying drawings.
[0048] Reference Figure 1 , a video media platform dialogue recommendation method based on knowledge-aware cue fine-tuning, comprising the following steps:
[0049] Step 1: A video media platform recommends video items that may be of interest to users through dialogue with them; the user set is represented by A = {a1, a2, ... a N}, the video item set is represented as I = {i1,i2,…i M}, the set of video-related entities such as actors, directors, themes, and styles is represented as Video Media Knowledge Graph By entity collection The set of relationships between entities Composition: The historical dialogue set between the platform and the user before the tth round is expressed as where s j represents the jth round of dialogue between the platform and the user, and the tth round of dialogue s t As the current reply tag; the historical entity set is represented by E = {E1, E2, ... E j}, where E j ={e j1 ,e j2 ,…,e jH}, E j represents the entity set that appears in the jth round of dialogue, e ji Represents the i-th entity that appears in the j-th round of dialogue;
[0050] Step 2: Each s in the historical conversation set C j The sentences are connected into a long sentence s in the order of the conversation time, and the video names appearing in the conversation are replaced with item masks; the long sentence s is encoded into a word embedding matrix S using the XLM-RoBERTa model, and then the embedding representation of the historical conversation is obtained through residual connection and self-attention neural network.
[0051]
[0052] in W SA and b are learnable parameter matrices and vectors;
[0053] Step 3: Based on video media knowledge graph The entities in the historical conversation are connected, and then the R-GCN model is used to encode the entities and their relationships to obtain the representation of the entity node in the (l+1)th layer of the R-GCN model.
[0054]
[0055] in represents the neighbor entity node of e under the relationship r, and W (l) is the learnable parameter matrix, Z e,r is the regularization coefficient; with the accumulation of entity nodes in the historical dialogue, an entity embedding matrix is obtained, and then the embedding representation r of the historical entity is obtained through residual connection and self-attention neural network E ;
[0056] Step 4: Represent the dialogue obtained in the same dialogue as r C and entity representation r E Set it as a positive example, otherwise set it as a negative example, and calculate the contrastive learning loss function
[0057]
[0058] Pre-training is performed, where h + and h - are the positive and negative samples for h, sim(h1,h2) represents the cosine similarity, and τ is the temperature hyperparameter;
[0059] Step 5: Use the historical entity representation obtained after pre-training as the user representation u, and then obtain the matrix U of all user representations in the training set; use the k-nearest neighbor search algorithm to retrieve the k user representations U′=[u1′,…,u′ k ]; each u in the similar user set U′ i ′ is replaced with a randomly selected user representation with probability ρ
[0060]
[0061] Where Aug() represents the random replacement function;
[0062] Step 6: Calculate the representation obtained by fusing the similar user representation with the target user representation
[0063]
[0064] Where x is a learnable parameter, Sigmoid(x) is the weight of similar user representation; traverse each u in the similar user set U′ i ′, and the enhanced similar user representation matrix is obtained by this method
[0065] Step 7: Randomly initialize the soft label hint vector ST = [st1,…,st k ]; Combine user representation based on video media knowledge graph, enhanced similar user representation and soft labeling to obtain prompt template
[0066]
[0067] Where k1, k2 and k3 are the lengths of user representation, similar user representation and soft label respectively;
[0068] Step 8: Input the prompt template into a feedforward neural network to obtain the prompt vector And combined with the historical dialogue C and the reply label R, the input vector of the pre-trained language model PLM is obtained
[0069]
[0070] Step 9: The prompt vector and historical dialogue C is input into PLM to generate predicted responses;
[0071] Step 10: Calculate the loss of the dialogue task
[0072]
[0073] Where N is the batch size for training, m i is the length of the target reply of the i-th sentence, Pr(w) represents the calculation of the Softmax score, Θ prompt represents the trainable parameters in the hint encoder, Θ PLM Represents the trainable parameters in PLM;
[0074] Step 11: PLM input vector T PLM Input the PLM with the special tag of the recommendation task, and obtain the output vector x of the PLM corresponding to the special tag;
[0075] Step 12: Calculate the loss of the recommendation task
[0076]
[0077] Where N is the batch size for training, M is the total number of items, and y i,j represents the binary true label (0 or 1) of item j in round i, Indicates the predicted probability of item j in round i calculated by the Softmax function;
[0078] Step 13: Calculate the joint loss function
[0079]
[0080] Where λ1 and λ2 are the weights of the training loss for the dialogue task and recommendation task respectively;
[0081] Step 14: Repeat steps 6 to 13. When the Loss is less than the specified minimum loss value, the calculation ends.
[0082] Step 15: The prompt vector And historical dialogue C is input into PLM to generate predicted reply sentences, and PLM is input into vector T PLM The special mark input PLM of the recommendation task is used to obtain the recommended item, and the item mask in the predicted reply sentence is replaced with the video name of the recommended item to obtain the current natural language response recommended by the video media platform dialogue.
[0083] In this embodiment, for historical conversations on the video media platform, entities related to the video media in the conversations are extracted, the historical conversations and historical entities are encoded, and prompt vectors and PLM input vectors are gradually obtained; reply sentences and recommended items are predicted and generated through PLM, and finally the current natural language response of the video media platform is obtained.
[0084] The contents described in the embodiments of this specification are merely an enumeration of the implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this embodiment, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.
Claims
1. A video media platform dialogue recommendation method based on knowledge-aware prompt fine-tuning, characterized in that: Firstly, the semantic space of historical conversations and historical entities is aligned using contrastive learning method to generate a unified prompt template. In the prompt template design, enhanced similar user representation is added to alleviate data sparsity and cold start problems. Then, the prompt vector and historical conversation vector are input into the pre-trained language model and jointly trained under conversation and recommendation tasks. Finally, the predicted reply sentences and recommended items are generated respectively by fine-tuning the pre-trained language model to obtain the current natural language response of the video media platform.
2. A video media platform dialogue recommendation method based on knowledge-aware prompt fine-tuning as claimed in claim 1, characterized in that: The method comprises the following steps: Step 1: A video media platform recommends video items that may be of interest to users through dialogue with them; the user set is represented by A = {a1, a2, ... a N }, the video item set is represented as I = {i1,i2,…i M }, the video-related entity set is represented as Video Media Knowledge Graph By entity collection The set of relationships between entities Composition: The historical dialogue set between the platform and the user before the tth round is expressed as where s j represents the jth round of dialogue between the platform and the user, and the tth round of dialogue s t As the current reply tag; the historical entity set is represented by E = {E1, E2, ... E j }, where E j ={e j1 ,e j2 ,…,e jH }, E j represents the entity set that appears in the jth round of dialogue, e ji Represents the i-th entity that appears in the j-th round of dialogue; Step 2: Each s in the historical conversation set C j The sentences are connected into a long sentence s in the order of the conversation time, and the video names appearing in the conversation are replaced with item masks; the long sentence s is encoded into a word embedding matrix S using the XLM-RoBERTa model, and then the embedding representation of the historical conversation is obtained through residual connection and self-attention neural network. in W SA and b are learnable parameter matrices and vectors; Step 3: Based on video media knowledge graph The entities in the historical conversation are connected, and then the R-GCN model is used to encode the entities and their relationships to obtain the representation of the entity node in the (l+1)th layer of the R-GCN model. in represents the neighbor entity node of e under the relationship r, and W (l) is the learnable parameter matrix, Z e,r is the regularization coefficient; with the accumulation of entity nodes in the historical dialogue, an entity embedding matrix is obtained, and then the embedding representation r of the historical entity is obtained through residual connection and self-attention neural network E ; Step 4: Represent the dialogue obtained in the same dialogue as r C and entity representation r E Set it as a positive example, otherwise set it as a negative example, and calculate the contrastive learning loss function Pre-training is performed, where h + and h - are the positive and negative samples for h, sim(h1,h2) represents the cosine similarity, and τ is the temperature hyperparameter; Step 5: Use the historical entity representation obtained after pre-training as the user representation u, and then obtain the matrix U of all user representations in the training set; use the k-nearest neighbor search algorithm to retrieve the k user representations U′=[u1′,…,u′ k ]; each u in the similar user set U′ i ′ is replaced with a randomly selected user representation with probability ρ Where Aug() represents the random replacement function; Step 6: Calculate the representation obtained by fusing the similar user representation with the target user representation Where x is a learnable parameter, Sigmoid(x) is the weight of similar user representation; traverse each u in the similar user set U′ i ′, and the enhanced similar user representation matrix is obtained by this method Step 7: Randomly initialize the soft label hint vector ST = [st1,…,st k ]; Combine user representation based on video media knowledge graph, enhanced similar user representation and soft labeling to obtain prompt template Where k1, k2 and k3 are the lengths of user representation, similar user representation and soft label respectively; Step 8: Input the prompt template into a feedforward neural network to obtain the prompt vector And combined with the historical dialogue C and the reply label R, the input vector of the pre-trained language model PLM is obtained Step 9: The prompt vector and historical dialogue C is input into PLM to generate predicted responses; Step 10: Calculate the loss of the dialogue task Where N is the batch size for training, m i is the length of the target reply of the i-th sentence, Pr(w) represents the calculation of the Softmax score, Θ prompt represents the trainable parameters in the hint encoder, Θ PLM Represents the trainable parameters in PLM; Step 11: Input PLM into vector T PLM And the special tag of the recommendation task is input into PLM, and the output vector of PLM corresponding to the special tag is obtained Step 12: Calculate the loss of the recommendation task Where N is the batch size for training, M is the total number of items, and y i,j represents the binary true label (0 or 1) of item j in round i, Indicates the predicted probability of item j in round i calculated by the Softmax function; Step 13: Calculate the joint loss function Where λ1 and λ2 are the weights of the training loss for the dialogue task and recommendation task respectively; Step 14: Repeat steps 6 to 13. When the Loss is less than the specified minimum loss value, the calculation ends. Step 15: The prompt vector And historical dialogue C is input into PLM to generate predicted reply sentences, and PLM is input into vector T PLM The special mark input PLM of the recommendation task is used to obtain the recommended item, and the item mask in the predicted reply sentence is replaced with the video name of the recommended item to obtain the current natural language response recommended by the video media platform dialogue.
3. A video media platform dialogue recommendation method based on knowledge-aware prompt fine-tuning as claimed in claim 2, characterized in that: In the step 1, the video-related entities include actors, directors, themes and styles.
Citation Information
Patent Citations
Conversation recommendation system based on prompt learning method
CN115525744A
Dialogue recommendation method and system based on multi-granularity emotion
CN115630145A
Language Learning System Adapted to Personalize Language Learning to Individual Users
US20140170613A1
Personality-Based Conversational Agents and Pragmatic Model, and Related Interfaces and Commercial Models
US20200395008A1