Deep reinforcement learning interactive recommendation system and method based on knowledge enhancement
By combining the knowledge graph and the user-item bipartite graph, using graph convolution and self-attention mechanism to enhance the item representation and user status, it solves the problems of user dynamic preference capture and data sparseness in the existing interactive recommendation system, and achieves More efficient recommendation accuracy and strategy optimization.
Patent Information
- Application Number
- CN202111420425.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-11-26
AI Technical Summary
It is difficult for existing interactive recommendation systems to effectively capture users' dynamic preferences and consider potential relationships between users, and methods based on deep reinforcement learning have problems with sparse user feedback and data.
Adopt an interactive recommendation system based on knowledge graph and user-item bipartite graph, enhance item representation through graph convolution network and graph attention network, combine with self-attention mechanism to capture user status, dynamically adjust recommendation strategy, and integrate semantic and structural information , improve recommendation accuracy.
It alleviates the problem of data sparseness, improves the accuracy and efficiency of the recommendation system, dynamically obtains a collection of candidate items that users are interested in, and optimizes recommendation strategy learning.
Smart Images

Figure CN114117220B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of recommendation technology, and in particular to a deep reinforcement learning interactive recommendation system and method based on knowledge enhancement. Background Art
[0002] With the rapid development of mobile applications such as TikTok, Pandora Radio, and Instagram Feeds, existing recommendation systems are under tremendous pressure to cope with the continuous emergence of new users, the changing interests of users, and the dynamic changes of the environment. However, traditional recommendation methods, such as content-based recommendation methods and matrix decomposition-based recommendation methods, assume that user interests are static and unchanging, and learn user preferences for items from historical interaction data between users and items. However, these methods often ignore the dynamic changes of user interests and the environment. In addition, most existing recommendation systems are designed to maximize the immediate (short-term) return of recommendations, that is, to get users to buy recommended items, while completely ignoring whether these recommended items will bring more profitable (long-term) returns in the future.
[0003] Unlike traditional recommendation, the interactive recommendation system is a multi-step decision-making process. In each step, the system recommends one (or a series of) items to the user in sequence. The user interacts with these items and provides corresponding feedback. The recommendation strategy is adjusted by receiving feedback in the iterative process. In recent years, due to the great potential of deep reinforcement learning in decision-making and long-term planning in dynamic environments, researchers have applied deep reinforcement learning models to interactive recommendation. The existing interactive recommendation methods based on reinforcement learning still have two limitations: (1) Most of the existing interactive recommendation methods use historical interaction records to learn strategies. However, due to the sparse user feedback and the huge action space, it is difficult to efficiently learn the optimal recommendation strategy; (2) The existing reinforcement learning-based methods represent the state / action of each individual user in isolation, and have not yet considered the potential relationship between different users. Based on this, the present invention proposes to use the semantic correlation and structural correlation of knowledge graphs and user-item bipartite graphs to alleviate the problem of data sparsity. At the same time, the neighborhood propagation mechanism of graph neural networks is used to recursively propagate neighborhood node information, enhance item representation, and autonomously learn the optimal recommendation strategy based on the evolution of user dynamic preferences using deep reinforcement learning methods, thereby improving the recommendation accuracy. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention provides a deep reinforcement learning interactive recommendation system and method based on knowledge enhancement, which utilizes the rich semantic information in the knowledge graph to enhance the project representation, and at the same time integrates the user-project bipartite graph to fully explore the potential relationships from the collective user behavior, thereby accurately capturing the dynamic preferences of users, and using deep reinforcement learning to autonomously learn the optimal recommendation strategy, thereby improving the recommendation accuracy.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] On the one hand, a deep reinforcement learning interactive recommendation system based on knowledge enhancement includes a data collection and cleaning module, an environment simulator construction module, a knowledge graph construction module, a graph convolution module, a user state representation module, a policy network module and a value network module.
[0007] The data collection and cleaning module is used to collect and clean the historical interaction records generated in the system, the historical interaction records include user information, interaction project information in the interaction records, and store the remaining data after the data cleaning operation; the user information is the user ID, and the interaction project information includes the project ID, the score of the interaction project and the time of the interaction;
[0008] The environment simulator building module builds an interactive recommendation simulator to simulate the online environment based on the historical interaction information between users and items, that is, simulates rewards based on the feedback of corresponding recommendations, and combines the sequential rewards with the original rewards as the final reward value;
[0009] The environment simulator construction module constructs an interactive recommendation simulator to simulate the online recommendation system environment based on the historical information of the interaction between the user and the project, that is, the original reward is based on the score of the corresponding user on the project, and the sequential reward is combined as the final reward value; the sequential reward is the number of continuous positive feedbacks c p and the number of continuous negative feedback c n The difference between the values of τ and τ, where the user's rating of the item in the interaction exceeds the threshold τ, which is called positive feedback, and vice versa, which is called negative feedback. The number of consecutive positive feedbacks in the interaction record is counted as c p and the number of continuous negative feedback c n ;
[0010] The knowledge graph construction module is used to construct a user-project bipartite graph based on historical interaction information between users and projects, and to construct a project-attribute knowledge graph based on the attribute information of the project, and to combine the user-project bipartite graph and the project-attribute knowledge graph into a unified graph;
[0011] The graph convolution module consists of two parts, namely the extraction of semantic features and the extraction and fusion of structural features. The extraction of semantic features uses the knowledge graph embedding method to parameterize entities and relationships into vector representations. The entities include users, projects, and the attribute information of projects, and the relationship parameters are the connections between users, projects, and the attribute information of projects. The extraction and fusion of structural features uses the neighborhood propagation mechanism of graph convolution to extract structural features, and combines the idea of graph attention network to aggregate neighbor node information into the target entity according to importance, thereby obtaining the embedded representation of the project.
[0012] The user state representation module captures the long-term semantics between items by adopting a self-attention mechanism and extracts the user's state embedding representation;
[0013] The policy network module takes the currently observed user state embedding representation as input, and outputs an action vector generated based on the current user state and a recommended item;
[0014] The value network module takes the current user state and the generated action vector as input and is responsible for evaluating the currently generated action vector, thereby adjusting the current recommendation method according to the evaluation result;
[0015] On the other hand, a knowledge-enhanced deep reinforcement learning interactive recommendation method is implemented based on the aforementioned knowledge-enhanced deep reinforcement learning interactive recommendation system, comprising the following steps:
[0016] Step 1: The data collection and cleaning module performs data cleaning operations on the generated historical interaction records, removes users whose number of interactions is less than the preset N times, retains the interaction record with the most recent timestamp for users who interact with the same item multiple times, obtains user-item interaction information, and sorts each user's interaction record in order according to the timestamp;
[0017] Step 2: Use the environment simulator module to build an environment simulator based on the offline data set according to the user-item interaction information obtained in step 1. The simulator combines the original reward and the sequential reward. The specific steps are as follows:
[0018] Step 2.1: Based on the user-item interaction information obtained in step 1, use the matrix decomposition method to train the embedding representation of users and items. The calculation formula is as follows:
[0019]
[0020] Among them, r ui represents the rating of user u on item i, p u represents the user’s embedding representation, q irepresents the embedding representation of the project, η is the regularization coefficient to prevent overfitting, p* represents the embedding representation of the optimal user, and q * represents the optimal item embedding representation learned, and K represents the set of user-item interactions;
[0021] Step 2.2: Based on the embedded representation of users and items in step 2.1, the predicted scores of each user for all items are obtained through the inner product, and the scores are normalized to the range of [-1, 1] as the original reward of the user;
[0022] Step 2.3: The user's rating of the project in the historical interaction record exceeding the threshold τ is called positive feedback, otherwise it is called negative feedback. The number of consecutive positive feedbacks in the interaction record is counted c p and the number of continuous negative feedback c n , whose sequential reward is expressed as the number of continuous positive feedbacks c p and the number of continuous negative feedback c n The difference between the sequential rewards and the original rewards is combined to obtain the final reward function, which is calculated as follows:
[0023] R(s t ,i t )=r i,j +λ(c p -c n )
[0024] Among them, s t Indicates the current state of the user at time t, i t represents the items recommended by the recommendation system at time t, r i,j represents the prediction score given by the simulator, c p and c n The number of consecutive positive and negative feedbacks in the interaction sequence, λ is the decay factor;
[0025] Step 3: Use the knowledge graph construction module to construct a user-item bipartite graph based on the user-item interaction information obtained in step 1; and construct an item-attribute knowledge graph based on the item attribute information. The specific steps are as follows:
[0026] Step 3.1, obtain the interaction information between users and items, and represent each user's interaction information as a triple (u, Interact, i), where u is the user's ID, Interact represents the interaction relationship between the user and the item, and i represents the item ID. The interaction information triples of each user in the historical interaction record are combined into a total combination, which is the user-item bipartite graph G1;
[0027] Step 3.2: For each item in the historical interaction record, use the Microsoft Satori public knowledge database to map the item name to an entity in the knowledge database, and extract all knowledge graph triples corresponding to the entity ID by matching the item name;
[0028] Step 3.3, the knowledge graph triples of each item in the historical interaction record are combined into a total combination, which is the knowledge graph G2 based on the historical interaction record;
[0029] Step 3.4, combine the user-item bipartite graph G1 and the knowledge graph G2 into a hybrid knowledge graph G.
[0030] Step 4: Use the graph convolution module to extract semantic features and extract and fuse structural features, and finally obtain enhanced item embedding representation. The specific steps are as follows:
[0031] Step 4.1: Given user u, simulate the interaction behavior of user u online, interact with the recommendation system n times, and obtain the historical interaction sequence o t ={i1, i2, ..., i n}, and according to the environment simulator in step 2, the original reward R of user u for each interaction with the item is obtained t ={r1, r2, ..., r n}, where i n represents the nth item of the interaction, r n represents the raw reward for the nth item in the interaction;
[0032] Step 4.2: Get the user's positive feedback. Filter the user's positive feedback according to the user's original reward in step 4.1 to get the current user status representation. If the length of the positive feedback sequence is less than n, select a random item to fill the sequence length to n.
[0033] Step 4.3: Based on the hybrid knowledge graph G obtained in step 3, the knowledge representation learning method is used to learn the embedded representations of entities and relationships in the hybrid knowledge graph, thereby obtaining the embedded representations of users and items;
[0034] Step 4.3.1: Embed entities and relations and randomly initialize them to e∈R d and e r ∈R k , where e is represented as an entity vector, R d Indicates that its dimensions are d, e r is the relationship vector, R k Indicates that its dimension is k;
[0035] Step 4.3.2: Use the TransR knowledge graph embedding method to vectorize the entities and relationships with triples (h, r, t) in the hybrid knowledge graph G. The embedding of entities and relationships satisfies:
[0036] W r e h +e r ≈W r e t
[0037] Among them, h represents the head entity, r represents the relationship, t represents the tail entity, and e represents the h Represented as the head entity vector, e t Represented as the tail entity vector, e r Represented as a relation vector, Wr is the projection matrix, W r e h and W r e t They are e h and e t The projection representation under the relation r space, and e h ∈R d , e t ∈R d , e r ∈R k and W r ∈R k×d ;
[0038] Step 4.3.3: For a given triple (h, r, t), the scoring function calculation formula is as follows:
[0039]
[0040] Among them, f r The lower the score in (h, t), the more likely it is that the triple (h, r, t) is true;
[0041] Step 4.4: Adopt the idea of graph convolutional neural network, recursively propagate the embedding representation of neighboring entities along the high-order connectivity, and adopt the idea of graph attention network. For each neighboring entity node, learn the different semantic capabilities of the target entity node, and use the attention mechanism to distinguish the importance of the relationship connecting the neighboring nodes, so as to aggregate the neighboring node information into the target entity according to the importance.
[0042] Step 4.4.1: For a given node h∈ε, after single-layer propagation, aggregate the feature information of the neighboring nodes of node h. The calculation formula is as follows:
[0043]
[0044] Among them, ε represents the set of entity nodes, eN(h) represents the vector representation obtained after aggregating adjacent nodes, and N(h) represents the set of neighboring entity nodes adjacent to entity node h. h_t represents the attention score, which is used to determine how much information is propagated from the adjacent entity node t to the node h under the relationship r. The attention score is calculated as follows:
[0045]
[0046] Where (h, r′, t′)∈N h , represents the triplet of nodes adjacent to a given entity h, W r′ The projection matrix representing the relationship r′ connected to the neighboring nodes of a given entity h, e t′ Represents the vector representation of the neighbor nodes of a given entity h, e r′ Represents the vector representation of the relationship r′ between the neighboring nodes of a given entity h; tanh is a nonlinear activation function, T represents the transpose operation, W r e h and W r e t They are e h and e t Projection representation in relational r space.
[0047] Step 4.4.2: Set the target entity node e h and neighbor entity nodes represent e N(h) Aggregation, the calculation formula is as follows:
[0048] e h =LeakyReLU(W(e N(h) +e h ))
[0049] The above formula is used as a single layer polymerization to obtain e h , by continuously superimposing and aggregating to calculate high-order connectivity information, the calculation formula is as follows:
[0050]
[0051] Finally, the entity representation after K-th layer aggregation is obtained, and the calculation formula is as follows:
[0052]
[0053] Among them, l represents the number of network layers, LeakyReLU is the activation function, represents the entity vector representation after aggregating neighbor nodes at the K layer, Represents the entity vector representation after aggregating neighbor nodes at layer l; multilayer perceptron learning parameter W K∈R d′×d ;
[0054] Step 4.4.3: After each entity is aggregated at K levels, the item clicked by the user is converted into in, represents the project embedding representation of project i obtained after K-layer aggregation at time t, i t (G) represents the project embedding representation of project i at time t after being enhanced by using the hybrid knowledge graph G;
[0055] Step 5: Use the user state representation module to capture the long-term semantics between items using the self-attention mechanism and extract the user's state S t (G), the specific steps are as follows:
[0056] Step 5.1: Given the user's historical interaction sequence o at time t t ={i1, i2, ..., i n}, if the sequence length is less than n, then repeatedly add a padding item to the left until the length is n;
[0057] Step 5.2: Based on the enhanced item embedding representation obtained in step 4.4.3, convert the historical interaction sequence into an item embedding matrix Where d represents the potential dimension, and n represents the number of all items in the item space;
[0058] Step 5.3: Construct a position embedding representation, learn the position information of the items in the current historical interaction record, and merge the position embedding with the item embedding representation. The calculation formula is as follows:
[0059]
[0060] Among them, n represents the length of the input sequence, M j The embedding representation vector representing the item, Represents the position value vector, W v Representative value weight matrix, s t represents the weighted sum of input item j and position, α ij Represents the influence weight of other projects on the current project j, calculated using the Softmax function, and the calculation formula is as follows:
[0061]
[0062] Among them, e ij It indicates the importance of the impact of item j in the input sequence on the current item i. It is obtained by using the scaled dot product attention mechanism on the key vector and the query vector. The calculation formula is as follows:
[0063]
[0064] in, is the scaling factor used to adjust QK T The range of values, that is, the value after the dot product of the key vector and the query vector, W Q , W K Represent the query weight matrix and key weight matrix respectively, is the position key vector representation, M j is the vector representation of item j, d represents the potential dimension, and k represents the key-value vector;
[0065] Step 5.4: The state obtained in step 5.3 is represented as s t Input into a two-layer fully connected neural network, the calculation formula is as follows:
[0066] h t =FFN(s t )=ReLU(s t W (1) +b (1) W (2) +b (2)
[0067] Among them, W (1) , b (1) and h t It is the feature representation obtained by two layers of fully connected neural network, FFN represents the fully connected neural network layer, and ReLU represents the activation function;
[0068] Finally, the current user status is obtained, s t (G) = h t , where s t (G) represents the user state representation enhanced by the hybrid knowledge graph G at time t, h t It is the feature representation obtained by two layers of fully connected neural network;
[0069] Step 6: Use the policy network module based on the user status s obtained in step 5.4 t (G) As input, the policy network module uses a deep neural network to approximate the current policy and generates action a at time t based on the current policy. t ;
[0070] Step 6.1: Represent the user status S t (G) Input into the deep neural network layer to obtain action a t ; The calculation formula is as follows:
[0071] a t =π α (s t(G)) = Tanh(ReLU(S t (G)W (3) +b (3) )W (4) +b (4) )
[0072] Among them, action is a continuous parameter vector, π θ It is represented as a policy function containing parameter θ, Tanh and ReLU are activation functions, W (3) , represents the weight matrix of training learning, b (3) and Represents the bias vector learned during training;
[0073] Step 6.2: Obtain a set of candidate items, use the semantic information in the hybrid knowledge graph to filter out items that are irrelevant to the user's preferences, and dynamically obtain a set of candidate items that the user is interested in;
[0074] Step 6.2.1: Obtain the user's historical interaction data and use it as a seed set After L hops from the seed entity, the set of neighbor nodes is obtained, which is expressed as:
[0075]
[0076] in represents the set of neighbor nodes obtained after L hops, It means that each time the head node h is selected from the neighbor node set of the previous layer;
[0077] Step 6.2.2: Aggregate the neighbors of all seed nodes in the current user state into a candidate set. The calculation formula is as follows:
[0078]
[0079] in, represents the set of neighbor nodes obtained after l hops at time t, ∪ is the union symbol, I is the entire set of items, and item is the last selected item;
[0080] Step 6.3: Use similarity measurement to calculate the similarity between the generated action and the items in the candidate set. The calculation formula is as follows:
[0081]
[0082] Among them, Candidate Set is the candidate project set, i represents the project in the candidate project set, and i t Indicates that at the current time t, the item with the highest similarity is obtained and recommended to the user;
[0083] Step 7: Use the value network module to evaluate the current strategy network generation strategy, adjust the strategy network module based on the evaluation results, and complete the deep reinforcement learning interactive recommendation. The specific steps are as follows:
[0084] Step 7.1: Represent the user status as s t (G) and the generated action a t Input into the value network to get the Q value, the calculation formula is as follows:
[0085]
[0086] Among them, Q π (s t (G), a t ) indicates that in the current state s t (G) Following strategy π, the cumulative expected reward value obtained is, represents the expected function, T represents the total number of interactions, γ j represents the value of the decay factor at the jth moment of interaction, γ∈[0,1], which is used to balance the immediate reward and future rewards. When γ=0, the agent only considers the current immediate reward; when γ=1, it will consider all future rewards; r t Indicates that at time t, the user receives the item recommended by the agent and gives feedback reward; if the user accepts, positive feedback is given; if the user refuses, negative feedback is given;
[0087] Step 7.2: According to the Q value obtained in step 5.1, based on the deterministic policy gradient theorem, use the sampling gradient strategy to adjust the current strategy. The calculation formula is as follows:
[0088]
[0089]
[0090] Where J(π θ ) is based on the current strategy π θ The expected value of all possible Q values, using a small batch strategy, m represents the size of the batch, s t (G) represents the user status at time t, a t represents the action vector at time t, Indicates action a t Find partial derivatives;
[0091] The beneficial effects of adopting the above technical solution are:
[0092] The present invention proposes a deep reinforcement learning interactive recommendation system and method based on knowledge enhancement. The present invention aims at the problem of sparse user feedback in the current interactive recommendation methods based on deep reinforcement learning. To this end, the present invention combines the rich semantic information in the knowledge graph, uses the graph convolutional network structure, recursively propagates the embedded representation of neighboring entities along the high-order connectivity, and adopts the idea of graph attention network. For each neighbor entity node, the semantic ability of the target entity node is different, and the attention mechanism is used to distinguish the importance of the relationship connecting the neighboring nodes, so as to aggregate the neighbor node information into the target entity according to different importance, enhance the embedded representation of the project, and thus alleviate the problem of data sparsity;
[0093] Secondly, existing studies have isolatedly represented the status / action of each individual user, and have not considered the potential relationship between different users. Based on this, the present invention considers integrating the user-item bipartite graph with the knowledge graph, which not only contains the attribute information of the project, but also fully mines the attribute-based collaboration signals between projects, thereby further improving the accuracy of recommendations;
[0094] In addition, interactive recommendation systems usually contain a large number of discrete candidate actions, which leads to high time complexity and low accuracy of reinforcement learning-based methods. Based on this, the present invention uses the semantic relevance and structural relevance of knowledge graphs and user-item bipartite graphs to filter out irrelevant items, thereby dynamically obtaining the candidate set of user interest and improving the accuracy of recommendations; BRIEF DESCRIPTION OF THE DRAWINGS
[0095] Figure 1 This is a block diagram of the architecture of a deep reinforcement learning interactive recommendation system based on knowledge enhancement of the present invention;
[0096] Figure 2 A schematic diagram of a triple knowledge graph structure according to an embodiment of the present invention;
[0097] Figure 3 This is a test diagram of the recommended effect of an embodiment of the present invention under different attenuation factors;
[0098] Figure 4 This is a test diagram of recommendation effects under different candidate set lengths according to an embodiment of the present invention;
[0099] Figure 5 This is a recommended performance test diagram of an embodiment of the present invention under ablation experiment; DETAILED DESCRIPTION
[0100] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0101] On the one hand, a knowledge-enhanced deep reinforcement learning interactive recommendation system, such as Figure 1 As shown, it includes a data collection and cleaning module, an environment simulator construction module, a knowledge graph construction module, a graph convolution module, a user state representation module, a policy network module and a value network module.
[0102] The data collection and cleaning module is used to collect and clean the historical interaction records generated in the system, the historical interaction records include user information, interaction project information in the interaction records, and store the remaining data after the data cleaning operation; the user information is the user ID, and the interaction project information includes the project ID, the score of the interaction project and the time of the interaction;
[0103] The environment simulator building module builds an interactive recommendation simulator to simulate the online environment based on the historical interaction information between users and items, that is, simulates rewards based on the feedback of corresponding recommendations, and combines the sequential rewards with the original rewards as the final reward value;
[0104] The environment simulator construction module constructs an interactive recommendation simulator to simulate the online recommendation system environment based on the historical information of the interaction between the user and the project, that is, the original reward is based on the score of the corresponding user on the project, and the sequential reward is combined as the final reward value; the sequential reward is the number of continuous positive feedbacks c p and the number of continuous negative feedback c n The difference between the values of τ and τ, where the user's rating of the item in the interaction exceeds the threshold τ, which is called positive feedback, and vice versa, which is called negative feedback. The number of consecutive positive feedbacks in the interaction record is counted as c p and the number of continuous negative feedback c n ;
[0105] The knowledge graph construction module is used to construct a user-project bipartite graph based on historical interaction information between users and projects, and to construct a project-attribute knowledge graph based on the attribute information of the project, and to combine the user-project bipartite graph and the project-attribute knowledge graph into a unified graph;
[0106] The graph convolution module includes two parts, namely the extraction of semantic features and the extraction and fusion of structural features. The extraction of semantic features uses the knowledge graph embedding method to parameterize entities and relationships into vector representations. The entities include users, projects, and the attribute information of projects. The relationship parameters are the connections between users, projects, and the attribute information of projects. For example, there is an interactive relationship between users and projects, and there is an ownership relationship between projects and project attributes. The extraction and fusion of structural features uses the neighborhood propagation mechanism of graph convolution to extract structural features, and combines the idea of graph attention network to aggregate neighbor node information into the target entity according to importance, thereby obtaining the embedded representation of the project.
[0107] The user state representation module captures the long-term semantics between items by adopting a self-attention mechanism and extracts the user's state embedding representation;
[0108] The policy network module takes the currently observed user state embedding representation as input, and outputs an action vector generated based on the current user state and a recommended item; wherein the action vector is a continuous parameter vector;
[0109] The value network module takes the current user state and the generated action vector as input and is responsible for evaluating the currently generated action vector, thereby adjusting the current recommendation method according to the evaluation result;
[0110] On the other hand, a knowledge-enhanced deep reinforcement learning interactive recommendation method is implemented based on the aforementioned knowledge-enhanced deep reinforcement learning interactive recommendation system, comprising the following steps:
[0111] Step 1: The data collection and cleaning module performs data cleaning operations on the generated historical interaction records, removes users with fewer than 200 interactions, retains the interaction record with the most recent timestamp for users who interact with the same item multiple times, obtains user-item interaction information, and sorts each user's interaction record in order according to the timestamp;
[0112] The experimental data in this embodiment collects interaction records of the MovieLens-1M dataset. The dataset contains 6040 users, 3952 projects, and 1000209 interactions. The format of the user interaction record is as follows: user ID, project ID, score, and timestamp of the interaction. First, perform data cleaning operations on the historical interaction records in the MovieLens-1M dataset to remove users and projects with less than 200 interactions. For multiple interactions between users and the same project, keep the interaction record with the most recent timestamp, and sort each user's interaction records in order according to the timestamp;
[0113] After data cleaning, the current historical interaction records contain 6040 users, 2347 projects, and 656461 interactions. Sorting the user sequence by time, the first 5 rows of a user's historical interaction record are shown in Table 1:
[0114] Table 1 User fixed sign-in data information
[0115] User ID Project ID score Timestamp 6039 58 4 956704056 6039 22 4 956704996 6039 1670 4 956715676 6039 79 3 956716016 6039 751 4 956716845
[0116] Step 2: Use the environment simulator module to build an environment simulator based on the offline data set according to the user-item interaction information obtained in step 1. The simulator combines the original reward and the sequential reward. The specific steps are as follows:
[0117] Step 2.1: Based on the user-item interaction information obtained in step 1, use the matrix decomposition method to train the embedding representation of users and items. The calculation formula is as follows:
[0118]
[0119] Among them, r ui represents the rating of user u on item i, p u represents the user’s embedding representation, q i represents the embedding representation of the project, η is the regularization coefficient to prevent overfitting, p* represents the embedding representation of the optimal user, and q * represents the optimal item embedding representation learned, and K represents the set of user-item interactions;
[0120] Step 2.2: Based on the embedded representation of users and items in step 2.1, the predicted scores of each user for all items are obtained through the inner product, and the scores are normalized to the range of [-1, 1] as the original reward of the user;
[0121] The data are shown in Table 2;
[0122]
[0123]
[0124] Step 2.3: The user's rating of the project in the historical interaction record exceeding the threshold τ is called positive feedback, otherwise it is called negative feedback. The number of consecutive positive feedbacks in the interaction record is counted c p and the number of continuous negative feedback c n , whose sequential reward is expressed as the number of continuous positive feedbacks c p and the number of continuous negative feedback c n The difference between the sequential rewards and the original rewards is combined to obtain the final reward function, which is calculated as follows:
[0125] R(s t ,i t )=r i,j +λ(c p -c n )
[0126] Among them, s t Indicates the current state of the user at time t, i t represents the items recommended by the recommendation system at time t, r i,j represents the prediction score given by the simulator, c p and c nThe number of consecutive positive and negative feedbacks in the interaction sequence, λ is the decay factor used to balance instinctive feedback and sequential feedback;
[0127] Step 3: Use the knowledge graph construction module to construct a user-item bipartite graph based on the user-item interaction information obtained in step 1; and construct an item-attribute knowledge graph based on the item attribute information, such as Figure 2 As shown, the specific steps are as follows:
[0128] Step 3.1, obtain the interaction information between users and items, and represent each user's interaction information as a triple (u, Interact, i), where u is the user's ID, Interact represents the interaction relationship between the user and the item, and i represents the item ID. The interaction information triples of each user in the historical interaction record are combined into a total combination, which is the user-item bipartite graph G1;
[0129] Step 3.2: For each item in the historical interaction record, use the Microsoft Satori public knowledge database to map the item name to an entity in the knowledge database, and extract all knowledge graph triples corresponding to the entity ID by matching the item name;
[0130] Step 3.3, combine the knowledge graph triples of each item in the historical interaction record into a total combination, which is the knowledge graph G2 based on the historical interaction record; it is expressed as G2 = {(h, r, t)|h, t∈ε, r∈R}.
[0131] Among them, h∈ε, r∈R, t∈ε, respectively represent the head entity, relation and tail entity, and ε and R represent the entity set and relation set. For example: one of the triples (Godfather, film.genre, Action) means that Godfather is a movie of the Action type;
[0132] Step 3.4: Link item i∈I with entity e∈ε in the knowledge graph, and use the item-entity alignment matrix to combine the user-item bipartite graph G1 and the knowledge graph G2 into a unified graph G, which is represented as G={(h, r, t)|h, t∈ε′, r∈R′}, where ε′=ε∪U train And R′=R∪{Interact}. The Interact relation indicates that user u interacts with item i.
[0133] Step 4: Use the graph convolution module to extract semantic features and extract and fuse structural features, and finally obtain enhanced item embedding representation. The specific steps are as follows:
[0134] Step 4.1: Given user u, simulate the interaction behavior of user u online, interact with the recommendation system n times, and obtain the historical interaction sequence o t ={i1, i2, ..., i n}, and according to the environment simulator in step 2, the original reward R of user u for each interaction with the item is obtained t ={r1, r2, ..., r n}, where i n represents the nth item of the interaction, r n represents the raw reward for the nth item in the interaction;
[0135] In this embodiment, a user u is given, and the interaction behavior of user u is simulated online. The user interacts with the recommendation system 10 times to obtain the user's historical interaction sequence {i 968 ,i 905 ,i 1085 ,i 842 ,i 1520 ,i 795 ,i 459 ,i 414 ,i 1648 ,i 1918}, the user's instinctive feedback for each interaction with the item is {0.621, 0.324, 0.559, 0.455, 0.255, 0.446, 0.802, 0.611, 0.779, -0.284}.
[0136] Step 4.2: Get the user's positive feedback. Because the state representation of the interactive recommendation system is abstracted from the items clicked by the user, usually, the positive feedback contains key information describing the user's preferences. According to the user's original reward in step 4.1, the user's positive feedback is filtered out. The sequence of its positive feedback is {i 968 ,i 1085 ,i 842 ,i 795 ,i 459 ,i 414 ,i 1648}, if the sequence length is less than 10, a random item is selected as padding to make the sequence length 10.
[0137] Step 4.3: Based on the hybrid knowledge graph G obtained in step 3, the knowledge representation learning method is used to learn the embedded representations of entities and relationships in the hybrid knowledge graph, thereby obtaining the embedded representations of users and items;
[0138] Step 4.3.1: Embed entities and relations and randomly initialize them to e∈R d and e r ∈R k , where e is represented as an entity vector, Rd Indicates that its dimensions are d, e r is the relationship vector, R k Indicates that its dimension is k;
[0139] Step 4.3.2: Use the TransR knowledge graph embedding method to vectorize the entities and relationships with triples (h, r, t) in the hybrid knowledge graph G. The embedding of entities and relationships satisfies:
[0140] W r e h +e r ≈W r e t
[0141] Among them, h represents the head entity, r represents the relationship, t represents the tail entity, and e represents the h Represented as the head entity vector, e t Represented as the tail entity vector, e r Represented as a relation vector, W r is the projection matrix, W r e h and W r e t They are e h and e t The projection representation under the relation r space, and e h ∈R d , e t ∈R d , e r ∈R k and W r ∈R k×d ;
[0142] Step 4.3.3: For a given triple (h, r, t), the scoring function calculation formula is as follows:
[0143]
[0144] Among them, f r The lower the score in (h, t), the more likely it is that the triple (h, r, t) is true;
[0145] Step 4.4: Adopt the idea of graph convolutional neural network, recursively propagate the embedding representation of neighboring entities along the high-order connectivity, and adopt the idea of graph attention network. For each neighboring entity node, learn the different semantic capabilities of the target entity node, and use the attention mechanism to distinguish the importance of the relationship connecting the neighboring nodes, so as to aggregate the neighboring node information into the target entity according to the importance.
[0146] Step 4.4.1: For a given node h∈ε, after single-layer propagation, aggregate the feature information of the neighboring nodes of node h. The calculation formula is as follows:
[0147]
[0148] Among them, ε represents the entity node set, e N(h) represents the vector representation obtained after aggregating adjacent nodes, and N(h) = {(h, r, t)|(h, r, t)∈G} represents the set of neighboring entity nodes adjacent to entity node h. h_t represents the attention score, which is used to determine how much information is propagated from the adjacent entity node t to the node h under the relationship r. The attention score is calculated as follows:
[0149]
[0150] Where (h, r′, t′)∈N h , represents the triplet of nodes adjacent to a given entity h, W r′ The projection matrix representing the relationship r′ connected to the neighboring nodes of a given entity h, e t′ Represents the vector representation of the neighbor nodes of a given entity h, e r′ Represents the vector representation of the relationship r′ between the neighboring nodes of a given entity h; tanh is a nonlinear activation function, T represents the transpose operation, W r e h and W r e t They are e h and e t Projection representation in relational r space.
[0151] Step 4.4.2: Set the target entity node e h and neighbor entity nodes represent e N(h) Aggregation, the calculation formula is as follows:
[0152] e h =LeakyReLU(W(e N(h) +e h ))
[0153] The above formula is used as a single layer polymerization to obtain e h In order to collect information transmitted from more distant neighbor nodes, high-order connectivity information is calculated by continuous superposition and aggregation. The calculation formula is as follows:
[0154]
[0155] Finally, the entity representation after K-th layer aggregation is obtained, and the calculation formula is as follows:
[0156]
[0157] Among them, l represents the number of network layers, LeakyReLU is the activation function, represents the entity vector representation after aggregating neighbor nodes at the K layer, Represents the entity vector representation after aggregating neighbor nodes at layer l; multilayer perceptron learning parameter W K ∈R d′×d ;
[0158] Step 4.4.3: After each entity is aggregated at K levels, the item clicked by the user is converted into in, represents the project embedding representation of project i obtained after K-layer aggregation at time t, i t (G) represents the project embedding representation of project i at time t after being enhanced by using the hybrid knowledge graph G;
[0159] In this embodiment, the sequence of positive feedback of user u is {i 968 ,i 1085 ,i 842 ,i 795 ,i 459 ,i 414 ,i 1648} is transformed into an embedding representation of the item, where the dimension is 50, that is:
[0160]
[0161] Step 5: Use the user state representation module to capture the long-term semantics between items using the self-attention mechanism and extract the user's state S t (G), the specific steps are as follows:
[0162] Step 5.1: Given the user's historical interaction sequence o at time t t ={i1, i2, ..., i n}, if the sequence length is less than n, then repeatedly add a padding item to the left until the length is n;
[0163] Step 5.2: Based on the enhanced item embedding representation obtained in step 4.4.3, convert the historical interaction sequence into an item embedding matrix Where d represents the potential dimension, and n represents the number of all items in the item space;
[0164] In this example, d = 50 represents the potential dimension, and n = 10 represents the number of interaction sequences;
[0165] Step 5.3: Construct a position embedding representation, learn the position information of the items in the current historical interaction record, and merge the position embedding with the item embedding representation. The calculation formula is as follows:
[0166]
[0167] Among them, n represents the length of the input sequence, M j The embedding representation vector representing the item, Represents the position value vector, W v Representative value weight matrix, s t represents the weighted sum of input item j and position, α ij Represents the influence weight of other projects on the current project j, calculated using the Softmax function, and the calculation formula is as follows:
[0168]
[0169] Among them, e ij It indicates the importance of the impact of item j in the input sequence on the current item i. It is obtained by using the scaled dot product attention mechanism on the key vector and the query vector. The calculation formula is as follows:
[0170]
[0171] in, is the scaling factor used to adjust QK T The range of values, that is, the value after the dot product of the key vector and the query vector, W Q , W K Represent the query weight matrix and key weight matrix respectively, is the position key vector representation, M j is the vector representation of item j, d represents the potential dimension, and k represents the key-value vector;
[0172] Step 5.4: The state obtained in step 5.3 is represented as s t Input into a two-layer fully connected neural network, the calculation formula is as follows:
[0173] h t =FFN(s t )=ReLU(s t W (1) +b (1) W (2) +b (2)
[0174] Among them, W (1) , b (1) and h tIt is the feature representation obtained by two layers of fully connected neural network, FFN represents the fully connected neural network layer, and ReLU represents the activation function;
[0175] Finally, the current user status is obtained, s t (G) = h t , where s t (G) represents the user state representation enhanced by the hybrid knowledge graph G at time t, h t is the feature representation obtained through two layers of fully connected neural network; that is
[0176] s t (G)=
[0177] [[0.357, 0.072, 0.009, 0.001, 0.299, -0.021, ..., 0.124, -0.009, -0.238, -0.095]] 1×50
[0178] Step 6: Use the policy network module based on the user status s obtained in step 5.4 t (G) As input, the policy network module uses a deep neural network to approximate the current policy and generates action a at time t based on the current policy. t ;
[0179] Step 6.1: Represent the user status S t (G) Input into the deep neural network layer, namely the ReLU layer and the Tanh layer, to obtain action a t ; The calculation formula is as follows:
[0180] a t =π θ (s t (G)) = Tanh(ReLU(S t (G)W (3) +b (3) )W (4) +b (4) )
[0181] Among them, action is a continuous parameter vector, π θ It is represented as a policy function containing parameter θ, Tanh and ReLU are activation functions, W (3) , represents the weight matrix of training learning, b (3) and Represents the bias vector learned during training; after 10 interactions, a t The characteristic expression is:
[0182] <h2 style=";text-align:left;direction:ltr">a1=[[0.071,-0.014,-0.052,-0.035,-0.205,...,0.047,0.011,0.190,0.021]]<h2 style=";text-align:left;direction:ltr"> 1×50 <h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">
[0183] <h2 style=";text-align:left;direction:ltr"> a2=[[0.063,-0.093,0.029,-0.008,-0.141,...,-0.111,0.087,0.217,-0.010]]<h2 style=";text-align:left;direction:ltr"> 1×50 <h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">
[0184] <h2 style=";text-align:left;direction:ltr"> a3=[[0.061,-0.033,0.033,-0.062,-0.136,...,-0.140,0.042,0.190,0.004]]<h2 style=";text-align:left;direction:ltr"> 1×50 <h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">
[0185] <h2 style=";text-align:left;direction:ltr"> a4=[[0.054,-0.140,0.015,-0.069,-0.252,...,0.006,0.096,0.233,0.022]]<h2 style=";text-align:left;direction:ltr"> 1×50 <h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">
[0186] <h2 style=";text-align:left;direction:ltr"> a5=[[0.021,-0.010,0.030,-0.149,-0.165,...,-0.062,0.072,0.110,-0.065]]<h2 style=";text-align:left;direction:ltr"> 1×50 <h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">
[0187] <h2 style=";text-align:left;direction:ltr"> a6=[[-0.074,-0.162,0.024,-0.084,-0.254,...,-0.068,0.122,0.235,0.463]]<h2 style=";text-align:left;direction:ltr"> 1×50 <h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">
[0188] <h2 style=";text-align:left;direction:ltr"> a7=[[0.042,-0.071,-0.041,-0.051,-0.242,...0.035,0.112,0.156,-0.045]]<h2 style=";text-align:left;direction:ltr"> 1×50 <h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">
[0189] <h2 style=";text-align:left;direction:ltr"> a8:<h2 style=";text-align:left;direction:ltr"> 1×50 <h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">
[0190] <h2 style=";text-align:left;direction:ltr"> a9=[[0.026,-0.012,0.043,-0.113,-0.197,...-0.056,0.093,0.185,-0.052]]<h2 style=";text-align:left;direction:ltr"> 1×50 <h2 style=";text-align:left;direction:ltr"> <h2 style=";text-align:left;direction:ltr">
[0191] Step 6.2: Obtain a set of candidate items, use the semantic information in the hybrid knowledge graph to filter out items that are irrelevant to the user's preferences, and dynamically obtain a set of candidate items that the user is interested in;
[0192] Step 6.2.1: Obtain the user's historical interaction data and use it as a seed set After L hops from the seed entity, the set of neighbor nodes is obtained, which is expressed as:
[0193]
[0194] in represents the set of neighbor nodes obtained after L hops, It means that each time the head node h is selected from the neighbor node set of the previous layer;
[0195] Step 6.2.2: Aggregate the neighbors of all seed nodes in the current user state into a candidate set. The calculation formula is as follows:
[0196]
[0197] in, represents the set of neighbor nodes obtained after l hops at time t, ∪ is the union symbol, I is the entire set of items, and item is the last selected item;
[0198] Step 6.3: Use similarity measurement to calculate the similarity between the generated action and the items in the candidate set. The calculation formula is as follows:
[0199]
[0200] Among them, Candidate Set is the candidate project set, i represents the project in the candidate project set, and i t It means that at the current time t, the item with the highest similarity is obtained and recommended to the user; taking the generated action a1 as an example, the similarity between it and the candidate set is calculated:
[0201] [-0.066, -1.333, -0.624, 0.384, -0.783, …, 0.474, 0.252, 1.303, 0.585]
[0202] The item with the greatest similarity is selected as the item currently recommended to the user. The item with the greatest similarity is calculated as: i 968 ;
[0203] Step 7: Use the value network module to evaluate the current strategy network generation strategy, adjust the strategy network module based on the evaluation results, and complete the deep reinforcement learning interactive recommendation. The specific steps are as follows:
[0204] Step 7.1: Represent the user status as s t (G) and the generated action a t Input into the value network to get the Q value, the calculation formula is as follows:
[0205]
[0206] Among them, Q π (s t (G), a t ) indicates that in the current state s t (G) Following strategy π, the cumulative expected reward value obtained is, represents the expected function, T represents the total number of interactions, γ j represents the value of the decay factor at the jth moment of interaction, γ∈[0,1], which is used to balance the immediate reward and future rewards. When γ=0, the agent only considers the current immediate reward; when γ=1, it will consider all future rewards; r t Indicates that at time t, the user receives the item recommended by the agent and gives feedback reward; if the user accepts, positive feedback is given; if the user refuses, negative feedback is given;
[0207] Step 7.2: According to the Q value obtained in step 5.1, based on the deterministic policy gradient theorem, use the sampling gradient strategy to adjust the current strategy. The calculation formula is as follows:
[0208]
[0209]
[0210] Where J(π θ ) is based on the current strategy π θ The expected value of all possible Q values, using a small batch strategy, m represents the size of the batch, s t (G) represents the user status at time t, a t represents the action vector at time t, Indicates action a t Find partial derivatives;
[0211] In the embodiment of the present invention, the effectiveness and feasibility of the proposed deep reinforcement learning interactive recommendation system based on knowledge enhancement are verified through experiments, and the performance of the system is verified through three experiments.
[0212] First, consider the impact of the decay factor parameter on the model. Traditional recommendation methods use a greedy strategy to optimize immediate rewards, while reinforcement learning considers long-term performance. The decay factor γ in the deep reinforcement learning model is one of the important parameters in reinforcement learning, which is used to weigh immediate rewards and future rewards. Figure 3 As shown in the figure, the accuracy changes when the decay factor γ is changed from 0.0 to 0.5 while keeping other optimal hyperparameters unchanged. When the decay factor is 0.35 in the dataset ML (1M), the performance reaches the peak, so considering future rewards can effectively improve the recommendation performance. At the same time, the performance gradually decreases after reaching the peak. Since the decay factor increases to a certain extent, it will also limit the exploration of reinforcement learning, resulting in a decrease in performance.
[0213] Secondly, consider the impact of the candidate set size on the model. Figure 4 As shown in Figure 2, the change of recommendation performance in the candidate set size of {400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000} designed for the dataset ML(1M). Figure 4 It can be seen that as the size of the candidate set increases, the performance gradually improves, and the performance reaches a peak when the candidate set size is 1200. At the same time, the performance gradually decreases after reaching the peak, because as the size of the candidate set increases, irrelevant items are introduced, thereby reducing the recommendation performance.
[0214] In addition, an ablation experiment is designed in this embodiment to verify the impact of each module on the recommendation performance. Figure 5 Four sets of experiments are designed as shown in the figure, where DDPG means removing the knowledge graph and the user-item bipartite graph from the model, DDPG+G1 means only including the user-item bipartite graph in the model, DDPG+G2 means only including the knowledge graph in the model, and DDPG+G means including the knowledge graph and the user-item bipartite graph in the model. Figure 5 It can be seen that the integration of user-item bipartite graph or knowledge graph can alleviate the problem of data sparsity to a certain extent and improve the accuracy of recommendation. On this basis, this study integrates user-item bipartite graph and knowledge graph to further improve the accuracy of recommendation.
[0215] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.
Claims
1. A deep reinforcement learning interactive recommendation system based on knowledge enhancement, characterized in that: It includes data collection and cleaning module, environment simulator building module, knowledge graph building module, graph convolution module, user state representation module, policy network module and value network module; The data collection and cleaning module is used to collect and clean the historical interaction records generated in the system, the historical interaction records include user information, interaction project information in the interaction records, and store the remaining data after the data cleaning operation; the user information is the user ID, and the interaction project information includes the project ID, the score of the interaction project and the time of the interaction; The environment simulator building module builds an interactive recommendation simulator to simulate the online environment based on the historical interaction information between users and items, that is, simulates rewards based on the feedback of corresponding recommendations, and combines the sequential rewards with the original rewards as the final reward value; The knowledge graph construction module is used to construct a user-project bipartite graph based on historical interaction information between users and projects, and to construct a project-attribute knowledge graph based on the attribute information of the project, and to combine the user-project bipartite graph and the project-attribute knowledge graph into a unified graph; The graph convolution module includes two parts, namely, the extraction of semantic features and the extraction and fusion of structural features. The extraction of semantic features uses the knowledge graph embedding method to parameterize entities and relationships into vector representations. The entities include users, projects, and their attribute information, and the relationship parameters are the connections between users, projects, and their attribute information. The extraction and fusion of structural features utilizes the neighborhood propagation mechanism of graph convolution to extract structural features, and combines the idea of graph attention network to aggregate neighbor node information into the target entity according to importance, thereby obtaining an embedded representation of the project. The user state representation module captures the long-term semantics between items by adopting a self-attention mechanism and extracts the user's state embedding representation; The policy network module takes the currently observed user state embedding representation as input, and outputs an action vector generated based on the current user state and a recommended item; The value network module takes the current user state and the generated action vector as input, and is responsible for evaluating the currently generated action vector, thereby adjusting the current recommendation method according to the evaluation result.
2. The deep reinforcement learning interactive recommendation system based on knowledge enhancement according to claim 1 is characterized in that: The environment simulator construction module constructs an interactive recommendation simulator to simulate the online recommendation system environment based on the historical information of the interaction between the user and the project, that is, the original reward is based on the score of the corresponding user on the project, and the sequential reward is combined as the final reward value; the sequential reward is the number of continuous positive feedbacks c p and the number of continuous negative feedback c n The difference between the values of τ and τ, where the user's rating of the item in the interaction exceeds the threshold τ, which is called positive feedback, and vice versa, which is called negative feedback. The number of consecutive positive feedbacks in the interaction record is counted as c p and the number of continuous negative feedback c n .
3. A deep reinforcement learning interactive recommendation method based on knowledge enhancement, implemented based on the deep reinforcement learning interactive recommendation system based on knowledge enhancement according to claim 1, characterized in that: The following steps are involved: Step 1: The data collection and cleaning module performs data cleaning operations on the generated historical interaction records, removes users whose number of interactions is less than the preset N times, retains the interaction record with the most recent timestamp for users who interact with the same item multiple times, obtains user-item interaction information, and sorts each user's interaction record in order according to the timestamp; Step 2: Using the environment simulator module, according to the user-item interaction information obtained in step 1, an environment simulator based on the offline data set is established. The simulator combines the original reward and the sequential reward. Step 3: Use the knowledge graph construction module to construct a user-item bipartite graph based on the user-item interaction information obtained in step 1; and construct an item-attribute knowledge graph based on the item attribute information; Step 4: Use the graph convolution module to extract semantic features and extract and fuse structural features, and finally obtain enhanced item embedding representation; Step 5: Use the user state representation module to capture the long-term semantics between items using the self-attention mechanism and extract the user's state S t (G); Step 6: Use the policy network module based on the user status s obtained in step 5.4 t (G) As input, the policy network module uses a deep neural network to approximate the current policy and generates action a at time t based on the current policy. t ; Step 7: Use the value network module to evaluate the strategy generated by the current policy network, adjust the policy network module based on the evaluation results, and complete the deep reinforcement learning interactive recommendation.
4. The interactive recommendation method based on deep reinforcement learning based on knowledge enhancement according to claim 3, characterized in that: The step 2 specifically includes the following steps: Step 2.1: Based on the user-item interaction information obtained in step 1, use the matrix decomposition method to train the embedding representation of users and items. The calculation formula is as follows: Among them, r ui represents the rating of user u on item i, p u represents the user’s embedding representation, q i represents the embedding representation of the project, η is the regularization coefficient to prevent overfitting, p* represents the embedding representation of the optimal user, and q * represents the optimal item embedding representation learned, and K represents the set of user-item interactions; Step 2.2: Based on the embedded representation of users and items in step 2.1, the predicted scores of each user for all items are obtained through the inner product, and the scores are normalized to the range of [-1, 1] as the original reward of the user; Step 2.3: The user's rating of the project in the historical interaction record exceeding the threshold τ is called positive feedback, otherwise it is called negative feedback. The number of consecutive positive feedbacks in the interaction record is counted c p and the number of continuous negative feedback c n , whose sequential reward is expressed as the number of continuous positive feedbacks c p and the number of continuous negative feedback c n The difference between the sequential rewards and the original rewards is combined to obtain the final reward function, which is calculated as follows: R(s t ,i t )=r i,j +λ(c p -c n ) Among them, s t Indicates the current state of the user at time t, i t represents the items recommended by the recommendation system at time t, r i,j represents the prediction score given by the simulator, c p and c n The number of consecutive positive and negative feedbacks in the interaction sequence, and λ is the decay factor.
5. The interactive recommendation method based on deep reinforcement learning based on knowledge enhancement according to claim 3, characterized in that: The step 3 specifically includes the following steps: Step 3.1, obtain the interaction information between users and items, and represent each user's interaction information as a triple (u, Interact, i), where u is the user's ID, Interact represents the interaction relationship between the user and the item, and i represents the item ID. The interaction information triples of each user in the historical interaction record are combined into a total combination, which is the user-item bipartite graph G1; Step 3.2: For each item in the historical interaction record, use the Microsoft Satori public knowledge database to map the item name to an entity in the knowledge database, and extract all knowledge graph triples corresponding to the entity ID by matching the item name; Step 3.3, the knowledge graph triples of each item in the historical interaction record are combined into a total combination, which is the knowledge graph G2 based on the historical interaction record; Step 3.4, combine the user-item bipartite graph G1 and the knowledge graph G2 into a hybrid knowledge graph G.
6. The interactive recommendation method based on knowledge enhancement and deep reinforcement learning according to claim 3, characterized in that: The step 4 specifically comprises the following steps: Step 4.1: Given user u, simulate the interaction behavior of user u online, interact with the recommendation system n times, and obtain the historical interaction sequence o t ={i1, i2, ..., i n }, and according to the environment simulator in step 2, the original reward R of user u for each interaction with the item is obtained t ={r1, r2, ..., r n }, where i n represents the nth item of the interaction, r n represents the raw reward for the nth item in the interaction; Step 4.2: Get the user's positive feedback. Filter the user's positive feedback according to the user's original reward in step 4.1 to get the current user status representation. If the length of the positive feedback sequence is less than n, select a random item to fill the sequence length to n. Step 4.3: Based on the hybrid knowledge graph G obtained in step 3, the knowledge representation learning method is used to learn the embedded representations of entities and relationships in the hybrid knowledge graph, thereby obtaining the embedded representations of users and items; Step 4.3.1: Embed entities and relations and randomly initialize them to e∈R d and e r ∈R k , where e is represented as an entity vector, R d Indicates that its dimensions are d, e r is the relationship vector, R k Indicates that its dimension is k; Step 4.3.2: Use the TransR knowledge graph embedding method to vectorize the entities and relationships with triples (h, r, t) in the hybrid knowledge graph G. The embedding of entities and relationships satisfies: W r have been h +e r ≈W r have been t Among them, h represents the head entity, r represents the relationship, t represents the tail entity, and e represents the h Represented as the head entity vector, e t Represented as the tail entity vector, e r Represented as a relation vector, W r is the projection matrix, W r e h and W r e t They are e h and e t The projection representation under the relation r space, and e h ∈R d , e t ∈R d , e r ∈R k and W r ∈R k×d ; Step 4.3.3: For a given triple (h, r, t), the scoring function calculation formula is as follows: Among them, f r The lower the score in (h, t), the greater the possibility that the triple (h, r, t) is true; Step 4.4: Adopt the idea of graph convolutional neural network, recursively propagate the embedding representation of neighboring entities along the high-order connectivity, and adopt the idea of graph attention network. For each neighboring entity node, learn the different semantic capabilities of the target entity node, and use the attention mechanism to distinguish the importance of the relationship connecting the neighboring nodes, so as to aggregate the neighboring node information into the target entity according to the importance. Step 4.4.1: For a given node h∈ε, after single-layer propagation, aggregate the feature information of the neighboring nodes of node h. The calculation formula is as follows: Among them, ε represents the entity node set, e N(h) represents the vector representation obtained after aggregating adjacent nodes, N(h) represents the set of neighboring entity nodes adjacent to entity node h; α h_t represents the attention score, which is used to determine how much information is propagated from the adjacent entity node t to the node h under the relationship r. The attention score is calculated as follows: Where (h, r′, t′)∈N h , represents the triplet of nodes adjacent to a given entity h, W r′ The projection matrix representing the relationship r′ connected to the neighboring nodes of a given entity h, e t′ Represents the vector representation of the neighbor nodes of a given entity h, e r′ Represents the vector representation of the relationship r′ between the neighboring nodes of a given entity h; tanh is a nonlinear activation function, T represents the transpose operation, W r e h and W r e t They are e h and e t Projection representation in relational r space; Step 4.4.2: Set the target entity node e h and neighbor entity nodes represent e N(h) Aggregation, the calculation formula is as follows: have been h =LeakyReLU(W(e N(h) +e h )) The above formula is used as a single layer polymerization to obtain e h , by continuously superimposing and aggregating to calculate high-order connectivity information, the calculation formula is as follows: Finally, the entity representation after K-th layer aggregation is obtained, and the calculation formula is as follows: Among them, l represents the number of network layers, LeakyReLU is the activation function, represents the entity vector representation after aggregating neighbor nodes at the K layer, Represents the entity vector representation after aggregating neighbor nodes at layer l; multilayer perceptron learning parameter W K ∈R d′×d ; Step 4.4.3: After each entity is aggregated at K levels, the item clicked by the user is converted into in, represents the project embedding representation of project i obtained after K-layer aggregation at time t, i t (G) represents the enhanced project embedding representation of project i at time t by utilizing the hybrid knowledge graph G.
7. The interactive recommendation method based on deep reinforcement learning based on knowledge enhancement according to claim 3, characterized in that: The step 5 specifically comprises the following steps: Step 5.1: Given the user's historical interaction sequence o at time t t ={i1, i2, ..., i n }, if the sequence length is less than n, then repeatedly add a padding item to the left until the length is n; Step 5.2: Based on the enhanced item embedding representation obtained in step 4.4.3, convert the historical interaction sequence into an item embedding matrix Where d represents the potential dimension, and n represents the number of all items in the item space; Step 5.3: Construct a position embedding representation, learn the position information of the items in the current historical interaction record, and merge the position embedding with the item embedding representation. The calculation formula is as follows: Among them, n represents the length of the input sequence, M j The embedding representation vector representing the item, Represents the position value vector, W v Representative value weight matrix, s t represents the weighted sum of the input item j and the position, α ij Represents the influence weight of other projects on the current project j, calculated using the Softmax function, and the calculation formula is as follows: Among them, e ij It indicates the importance of the impact of item j in the input sequence on the current item i. It is obtained by using the scaled dot product attention mechanism on the key vector and the query vector. The calculation formula is as follows: in, is the scaling factor used to adjust QK T The range of values, that is, the value after the dot product of the key vector and the query vector, W Q , W K Represent the query weight matrix and key weight matrix respectively, is the position key vector representation, M j is the vector representation of item j, d represents the potential dimension, and k represents the key-value vector; Step 5.4: The state obtained in step 5.3 is represented as s t Input into a two-layer fully connected neural network, the calculation formula is as follows: h t =FFN(s t )=ReLU(s t W (1) +b (1) )W (2) +b (2) in, b (1) and h t It is the feature representation obtained by two layers of fully connected neural network, FFN represents the fully connected neural network layer, and ReLU represents the activation function; Finally, the current user status is represented as s t (G) = h t , where s t (G) represents the user state representation enhanced by the hybrid knowledge graph G at time t, h t It is the feature representation obtained by two layers of fully connected neural network.
8. The interactive recommendation method based on deep reinforcement learning based on knowledge enhancement according to claim 3, characterized in that: The step 6 specifically comprises the following steps: Step 6.1: Represent the user status S t (G) Input into the deep neural network layer to obtain action a t ; The calculation formula is as follows: am t π α (sh t (G))Tanh(ReLU(S). t (G)W (3) +b (3) )W (4) +b (4) ) Among them, action is a continuous parameter vector, π θ It is represented as a policy function containing parameter θ, Tanh and ReLU are activation functions, represents the weight matrix learned during training, b(3) and Represents the bias vector learned during training; Step 6.2: Obtain a set of candidate items, use the semantic information in the hybrid knowledge graph to filter out items that are irrelevant to the user's preferences, and dynamically obtain a set of candidate items that the user is interested in; Step 6.2.1: Obtain the user's historical interaction data and use it as a seed set After L hops from the seed entity, the set of neighbor nodes is obtained, which is expressed as: in represents the set of neighbor nodes obtained after L hops, It means that each time the head node h is selected from the neighbor node set of the previous layer; Step 6.2.2: Aggregate the neighbors of all seed nodes in the current user state into a candidate set. The calculation formula is as follows: in, represents the set of neighbor nodes obtained after l hops at time t, ∪ is the union symbol, I is the entire set of items, and item is the last selected item; Step 6.3: Use similarity measurement to calculate the similarity between the generated action and the items in the candidate set. The calculation formula is as follows: Among them, Candidate Set is the candidate project set, i represents the project in the candidate project set, and i t It means that at the current time t, the item with the highest similarity is obtained and recommended to the user.
9. The interactive recommendation method based on deep reinforcement learning based on knowledge enhancement according to claim 3, characterized in that: The step 7 specifically includes the following steps: Step 7.1: Represent the user status as s t (G) and the generated action a t Input into the value network to get the Q value, the calculation formula is as follows: Among them, Q π (s t (G), a t ) indicates that in the current state s t (G) Following strategy π, the cumulative expected reward value obtained is, represents the expected function, T represents the total number of interactions, γ j represents the value of the decay factor at the jth moment of interaction, γ∈[0,1], which is used to balance the immediate reward and future rewards. When γ=0, the agent only considers the current immediate reward; when γ=1, it will consider all future rewards; r t Indicates that at time t, the user receives the item recommended by the agent and gives feedback reward; if the user accepts, positive feedback is given; if the user refuses, negative feedback is given; Step 7.2: According to the Q value obtained in step 5.1, based on the deterministic policy gradient theorem, use the sampling gradient strategy to adjust the current strategy. The calculation formula is as follows: Where J(π θ ) is based on the current strategy π θ The expected value of all possible Q values, using a small batch strategy, m represents the size of the batch, s t (G) represents the user status at time t, a t represents the action vector at time t, Indicates action a t Find the partial derivative.
Citation Information
Patent Citations
Method for carrying out personalized recommendation on commodities by fusing knowledge graph
CN112232925A
Hybrid recommendation algorithm based on local and global representation model joint learning
CN112733027A
Commodity information recommendation method and system, and storage medium
CN113222711A
Dialogue emotion recognition network model based on double knowledge interaction and multi-task learning, construction method, electronic equipment and storage medium
CN113535957A
Recommendation method and recommendation apparatus based on deep reinforcement learning, and non-transitory computer-readable recording medium
US20210027178A1
