Content recommendation method, apparatus, device, and storage medium

CN116127083BActive Publication Date: 2026-10-27MASHANG CONSUMER FINANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210789296.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-06
Publication Date
2026-10-27
Estimated Expiration
2042-07-06

AI Technical Summary

Technical Problem

但是,采用该方式,无法对未与用户交互过的数据进行准确的推荐

Benefits of technology

[0015]第四方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行如第一方面中任一项的内容推荐方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127083B_ABST
    Figure CN116127083B_ABST
Patent Text Reader

Abstract

The application provides a content recommendation method, device and equipment and a storage medium. The content recommendation method comprises: obtaining a collaborative knowledge graph; inputting the collaborative knowledge graph into a recommendation model for recommendation processing to obtain a target node; and recommending node information corresponding to the target node to a target user. The recommendation model comprises an embedding layer, an embedding propagation layer and a prediction layer. The embedding layer is configured to encode the collaborative knowledge graph to obtain a first encoding vector corresponding to each node of the collaborative knowledge graph and a second encoding vector corresponding to each edge of the collaborative knowledge graph. The embedding propagation layer is configured to process the first encoding vector and the second encoding vector to obtain a first vector corresponding to each node of the collaborative knowledge graph. The prediction layer is configured to perform prediction processing based on the first vector to obtain the target node. The application can improve the accuracy of recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a content recommendation method, apparatus, device, and storage medium. Background Technology

[0002] With the rapid development of the internet, online information has exploded. For example, in e-commerce, the number and variety of goods are vast, requiring users to spend a significant amount of time searching for the products they need. This problem of browsing large amounts of irrelevant information and products leads to a continuous loss of users.

[0003] Currently, a common approach to accurately extract user-interested data from massive datasets is to analyze user preferences based on their historical behavior and recommend potentially interesting data to overcome information overload. However, this method cannot accurately recommend data that the user has never interacted with. Summary of the Invention

[0004] This application provides a content recommendation method, apparatus, device, and storage medium to improve the accuracy of recommendations.

[0005] In a first aspect, embodiments of this application provide a content recommendation method, comprising: acquiring a collaborative knowledge graph, the collaborative knowledge graph including nodes of a target user; inputting the collaborative knowledge graph into a recommendation model for recommendation processing to obtain target nodes; recommending node information corresponding to the target nodes to the target user; wherein the recommendation model includes an embedding layer, an embedding propagation layer, and a prediction layer; the embedding layer is used to encode the collaborative knowledge graph to obtain a first encoding vector corresponding to each node of the collaborative knowledge graph and a second encoding vector corresponding to each edge of the collaborative knowledge graph; the embedding propagation layer is used to process the first encoding vector and the second encoding vector to obtain a first vector corresponding to each node of the collaborative knowledge graph, the first vector including the result of iterative aggregation and fusion of node information of the neighboring nodes of the corresponding node; the prediction layer is used to perform prediction processing based on the first vector to obtain target nodes, wherein the matching degree between the first vector corresponding to the target node and the first vector corresponding to the node of the target user is greater than or equal to a preset threshold.

[0006] Secondly, embodiments of this application provide a content recommendation device, including:

[0007] The acquisition module is used to acquire the collaborative knowledge graph, which includes nodes of the target user.

[0008] The processing module is used to input the collaborative knowledge graph into the recommendation model for recommendation processing to obtain the target node;

[0009] The recommendation module is used to recommend node information corresponding to a target node to the target user.

[0010] The recommendation model includes an embedding layer, an embedding propagation layer, and a prediction layer.

[0011] The embedding layer is used to encode the collaborative knowledge graph to obtain the first encoding vector corresponding to each node of the collaborative knowledge graph and the second encoding vector corresponding to each edge of the collaborative knowledge graph.

[0012] An embedded propagation layer is used to process the first and second encoding vectors to obtain the first vector corresponding to each node of the collaborative knowledge graph. The first vector includes the result of iterative aggregation and fusion of the node information of the corresponding node's neighboring nodes.

[0013] The prediction layer is used to perform prediction processing based on the first vector to obtain the target node. The matching degree between the first vector corresponding to the target node and the first vector corresponding to the target user's node is greater than or equal to a preset threshold.

[0014] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the content recommendation method as described in any of the first aspects.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the content recommendation method as described in any of the first aspects.

[0016] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when run on an electronic device, causes the electronic device to perform a content recommendation method as described in any of the first aspects.

[0017] As can be seen, in this embodiment, the collaborative knowledge graph is encoded through the embedding layer of the recommendation model to obtain a first encoding vector corresponding to each node of the collaborative knowledge graph and a second encoding vector corresponding to each edge of the collaborative knowledge graph. The first and second encoding vectors are processed through the embedding propagation layer to obtain a first vector corresponding to each node of the collaborative knowledge graph. The prediction layer performs prediction processing based on the first vector to obtain the target node, and then recommends accurate node information to the target user. Since the collaborative knowledge graph includes the relationship between nodes, when there is a node that has not been interacted with by the user, the relationship between the node and the node that has been interacted with by the user can be used to accurately recommend nodes that have not been interacted with by the user, thereby improving the recommendation accuracy of data that has not been interacted with by the user. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] Figure 1 A schematic diagram illustrating the application scenarios of the content recommendation method provided in this application;

[0020] Figure 2 A flowchart illustrating a content recommendation method provided in an embodiment of this application;

[0021] Figure 3 A schematic diagram illustrating the acquisition of a collaborative knowledge graph provided in an embodiment of this application;

[0022] Figure 4 A schematic diagram of a recommendation model provided in an embodiment of this application;

[0023] Figure 5 This is a schematic diagram of the structure of a content recommendation device provided in an embodiment of this application;

[0024] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0025] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0027] Currently, one method for recommending objects is based on Collaboration Filtering (CF). Specifically, it leverages collective intelligence to recommend objects based on all user interactions with objects. The problem that collaborative filtering aims to solve, expressed in data form, is how to fill in the unknown parts of a matrix. The classic algorithm for matrix filling is Singular Value Decomposition (SVD), but this method suffers from overfitting because the minimization process lacks regularization (only minimizing variance is considered). Another method for recommending objects is based on feature-based models, such as Factorization Machines (FM), Multiplication Factorization (MF), SVD, SVD++, and FISM. These models only utilize user-object interaction information (such as click-through rates), neglecting a large amount of user attribute information and other contextual information. This includes user information such as age, gender, and occupation; object attributes such as category, description, and image / text information; and other contextual information such as location, time, and weather. Therefore, the accuracy of the recommendations cannot be guaranteed, and interpretability is lacking.

[0028] In summary, knowledge graphs can effectively alleviate the data sparsity and cold-start problems in traditional collaborative filtering. Cold start refers to data that has not been interacted with by the user. Therefore, current methods often divide the knowledge graph network structure into separate paths or only utilize first-order neighbor information, resulting in the inability to establish connections between nodes that are not directly connected throughout the entire knowledge graph. Specifically, as a structured auxiliary information, knowledge graphs store relationships between user attributes and object attributes, containing rich semantics, thus improving the accuracy, diversity, and interpretability of recommended objects. A specific method involves merging the user-object corresponding knowledge graph and the knowledge graph between users or objects into a Collaborative Knowledge Graph (CKG). User preferences are then mined on the CKG based on historical user interaction records. To mine potential user interests on the CKG, implicit connections between nodes need to be established. Currently, methods for processing CKG fall into two categories: path-based methods and graph embedding-based methods. Among them, the path-based method decomposes CGK into multiple independent linear paths, and the graph embedding method obtains the direct neighbor information of users or objects. Neither of these methods can establish the implicit connections between nodes on CGK.

[0029] The aforementioned methods fail to capture the implicit relationships between nodes in the collaborative knowledge graph (CKG) and cannot accurately recommend objects. This application's embodiments integrate a collaborative filtering recommendation model with a collaborative knowledge graph, overcoming the drawback of independent user-object interaction records and enabling the acquisition of collaborative information based on object attributes. Furthermore, an attention mechanism is employed to recursively aggregate feature interaction information and linearly weighted information from neighboring nodes. This explicit encoding of node interactions in the CKG allows the recommendation model to capture the rich semantics of feature interactions between nodes within the collaborative knowledge graph.

[0030] For example, Figure 1 A schematic diagram illustrating the application scenarios of the content recommendation method provided in this application. For example... Figure 1 As shown, the application scenario may include: user terminal 10, user X enters the video page through user terminal 10, the video page recommends movies A to F to user X, wherein movies A, B and C may be movies that user X has previously interacted with but has not finished watching, and movies D to F may be newly added movies (cold start nodes), and movies that match user X are recommended to user X according to the content recommendation method of this application.

[0031] also, Figure 1 This is merely one exemplary application scenario. This application's embodiments can be applied to recommendation scenarios for various objects, such as music, POIs (Points of Interest), news, education, books, and products on shopping websites. For example, when purchasing goods on a shopping website or reading books on a reading website, these websites all need to recommend matching objects to the user.

[0032] It should be noted that the appendix Figure 1 This is merely a schematic diagram illustrating one application scenario provided by an embodiment of this application, and the embodiments of this application do not limit the specific application scenario. The content recommendation method provided by the embodiments of this application can be applied to a server, which can be a standalone server or a service cluster, etc.

[0033] The technical solution of this application will now be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0034] Figure 2 The following is a flowchart illustrating a content recommendation method provided in an embodiment of this application. The content recommendation method includes the following steps:

[0035] S201, Obtain the collaborative knowledge graph.

[0036] The collaborative knowledge graph includes nodes of the target user. This collaborative knowledge graph is pre-stored in a database. In this embodiment, the collaborative knowledge graph corresponding to the target user's nodes can be determined based on those nodes. The collaborative knowledge graph includes nodes and edges. Nodes include user nodes and object nodes. Edges between user nodes and object nodes represent object-oriented interaction information between the corresponding users, and edges between object nodes represent the relationships between the corresponding objects.

[0037] Specifically, knowledge graphs are an important branch of artificial intelligence technology. They are structured semantic knowledge bases used to describe concepts and their relationships in the physical world in symbolic form. Their basic building blocks are "node-relation-node" triples, and value pairs consisting of nodes and their associated attributes. Nodes are interconnected through relations, forming a network-like knowledge structure. As a highly readable form of external knowledge, knowledge graphs greatly enhance the interpretability of algorithms.

[0038] Reference Figure 3 This invention integrates the user-object knowledge graph G1 and the object knowledge graph G2 into a unified collaborative knowledge graph G. G1 is defined as {(l,Interact,m)|l∈L,m∈M}, where l represents a user node, L represents the set of user nodes, m represents an object node, M represents the set of object nodes, and Interact represents the interaction information between user l and object m. Figure 3 The user nodes are l1, l2, and l3. Object nodes are m1 to m7. Furthermore, G2 represents the relationships between objects on their attributes using triples of object node-relation-object node. G2 is defined as {(e1,r,e2)|h,t∈E,r∈R}, where e1 represents the head object node, e2 represents the tail object node, r is the relationship between two objects, and E is the set of object nodes. Figure 3 Object nodes e1 to e8 can be either the head object node e1 or the tail object node e2.

[0039] Furthermore, referring to Figure 3 Constructing a collaborative knowledge graph G involves integrating G1 and G2 into a single graph. The collaborative knowledge graph G is defined as G = {(h,r,t)|h,t∈E',r∈R'}, where E' = L∪E and R' = {Interact}∪R. The collaborative knowledge graph G constructed in this paper can be a combination of undirected and directed graphs, meaning R' has a positive direction and / or a negative direction, allowing each node in G to collect information from all its neighboring nodes. Figure 3 User nodes u1 to u3 and object nodes i1 to i9 in the collaborative knowledge graph G can be either h or t in the collaborative knowledge graph G.

[0040] In this embodiment, the collaborative knowledge graph corresponding to the target user includes the user node corresponding to the target user. (Refer to...) Figure 3 , Figure 3 Nodes u1, u2, and u3 are user nodes, and nodes i1 to i9 are object nodes. The target user node is represented by node u1. Furthermore, user nodes represent user information such as age, gender, and account details, while object nodes represent object information such as movie title, genre, runtime, release date, and lead actors.

[0041] Furthermore, user-oriented object-oriented interaction information can represent a user's historical interaction records with an object, such as the number of views, viewing time, and viewing duration. It can also represent a new user's preferences for that object. For example, when a new user registers on a video website, they may input their preferences for certain movies or movie genres. The server can then construct a connection between the new user and the corresponding movies based on this data, embedding it into a collaborative knowledge graph. This enables object recommendations for new users. The relationships between corresponding objects can also be categorized, such as two movies sharing the same genre, lead actors, director, or belonging to different parts of the same film.

[0042] Reference Figure 3 The edges between nodes include directed edges and undirected edges. Edges with arrows are directed edges, and edges without arrows are undirected edges.

[0043] In addition, collaborative knowledge graphs may also include: edges connecting user nodes, which represent the relationships between users, such as friend relationships, follow relationships, etc., without limitation.

[0044] In this embodiment of the application, the collaborative knowledge graph includes user-object interaction information and the relationships between objects, thus containing rich semantics, which can improve the accuracy of recommended objects.

[0045] S202, input the collaborative knowledge graph into the recommendation model for recommendation processing to obtain the target node.

[0046] In this context, the target user's node refers to the user node corresponding to the target user. Specifically, the recommendation model can determine the target object node based on the nodes in the input collaborative knowledge graph and the relationships between them. The target object node is selected as the target node. The object corresponding to the target object node is then the mined object that matches the user's interests.

[0047] In addition, refer to Figure 4The recommendation model includes an embedding layer 41, an embedding propagation layer 43, and a prediction layer 43. The embedding layer 41 is used to encode the collaborative knowledge graph to obtain a first encoding vector corresponding to each node of the collaborative knowledge graph and a second encoding vector corresponding to each edge of the collaborative knowledge graph. The embedding propagation layer 42 is used to process the first encoding vector and the second encoding vector to obtain a first vector corresponding to each node of the collaborative knowledge graph. The first vector includes the result of iterative aggregation and fusion of the node information of the corresponding node's neighbor nodes. The prediction layer 43 is used to perform prediction processing based on the first vector to obtain the target node. The matching degree between the first vector corresponding to the target node and the first vector corresponding to the target user's node is greater than or equal to a preset threshold.

[0048] Specifically, refer to Figure 4 The collaborative knowledge graph G is input into the embedding layer 41 of the recommendation model 40 for encoding, resulting in a first encoding vector X1 and a second encoding vector X2. Each node in the collaborative knowledge graph G has a corresponding first encoding vector, and each edge in the collaborative knowledge graph G has a corresponding second encoding vector.

[0049] The encoding method can be a translational distance model based on TransE (Translating Embedding) or its variants, such as TransR. TransR can take into account that the same node has different semantics on different relations, and realizes the consideration of the characteristic relation space when calculating the distance between two nodes.

[0050] Furthermore, the encoding of nodes and edges by the embedding layer can generate embedding vectors in a low-dimensional continuous space for each node and edge in the graph, while preserving the structural information of the collaborative knowledge graph as much as possible, thereby providing rich auxiliary information for the recommendation model.

[0051] In addition, refer to Figure 4 The method for determining the first vector corresponding to each node is the same. In determining the first vector corresponding to a node, the embedding propagation layer 42 is used to: use an attention mechanism to determine the second vector D2 corresponding to the node based on the first encoding vector X1 and the second encoding vector X2 corresponding to the node. The second vector D2 includes the node information of the node's neighboring nodes; iteratively aggregate the second vector D2 corresponding to the node and the first encoding vector X1 corresponding to the node to obtain multiple third vectors D3; each iteration of aggregation yields a third vector D3; the third vector D3 obtained in the first iteration of aggregation is based on the aggregation of the second vector D2 corresponding to the node and the first encoding vector X1 corresponding to the node; the third vector D3 obtained in subsequent iterations of aggregation is based on the aggregation of the third vector D3 obtained in the previous iteration and the second vector D2 corresponding to the node; and fuse the first encoding vector X1 corresponding to the node and multiple third vectors D3 to obtain the first vector corresponding to the node.

[0052] Furthermore, in the embedding layer 42, an attention mechanism is used to determine the second vector D2 corresponding to the node based on the first encoding vector X1 and the second encoding vector X2 corresponding to the node. This includes: determining the fourth vector D4 of the first neighbor node of the node based on the first encoding vector of the node's first neighbor node and the second encoding vector of the edge between the node and the first neighbor node using the attention mechanism, wherein the edge connecting the first neighbor node and the node is a unidirectional edge; determining the fifth vector D5 based on the first encoding vector of the second neighbor node of the node, wherein the edge connecting the second neighbor node and the node is an undirected edge; and fusing the fourth vector and the fifth vector to obtain the second vector.

[0053] The fourth vector D4 includes the association result between the node information of the corresponding node and the node information of the first neighbor node. The fifth vector D5 represents the association result between the node information of the corresponding node and the node information of the second neighbor node, as well as the association result between the node information of any two second neighbor nodes.

[0054] In this embodiment, the embedding layer 42 includes a linear data collector 421 and a bilinear data collector 422. The linear data collector 421 obtains a fourth vector D4, and the bilinear data collector 422 obtains a fifth vector D5.

[0055] For example, refer to Figure 3 For user node u1, the first neighbor nodes include object node i2 and object node i5, and the second neighbor nodes include object node i1, object node i3 and object node i4.

[0056] In the embodiments of this application, in the following examples, the corresponding node h can be Figure 3 Any one of user nodes u1 to u3 and object nodes i1 to i9 in the table.

[0057] In one optional embodiment, a first attention score between a node and its first neighbor is determined based on the first encoding vector of the node's first neighbor node and the second encoding vector of the edge between the node and the first neighbor node; a fourth vector is determined based on the first encoding vector of the first neighbor node and the first attention score.

[0058] The fourth vector is determined by the following formula:

[0059]

[0060] In the above formula, LC(h) represents the fourth vector D4. Let X1 represent the first encoding vector of one of the first neighbor nodes, π′(h, r, t) represent the first attention score, h represent the corresponding node, t represent one of the first neighbor nodes, r represent the edge between the corresponding node h and the first neighbor node t, and N(h) represent all the first neighbor nodes of the corresponding node h.

[0061] For example, refer to Figure 3 If the corresponding node h is user node u1, then the first neighbor nodes are object node i2 and object node i5, and the fourth vector corresponding to user node u1 is: Where r1 represents the edge between user node u1 and object node i2, and r2 represents the edge between user node u1 and object node i5. It is the first encoding vector of object node i2. It is the first encoding vector of object node i5.

[0062] In this embodiment, firstly, a linear collector 421 collects the linear summation information of all first neighbor nodes in the set N(h) of first neighbor nodes of node h. Here, π′(h, r, t) is the first attention score corresponding to the attention mechanism in the linear collector, a numerical scalar used to control the amount of information propagated from first neighbor node t to corresponding node h on edge r. The linear collector 421 injects the first-order connectivity information of corresponding node h into the representation of the fourth vector D4(LC(h)), and distinguishes the importance of each first neighbor node through the first attention score π′(h, r, t).

[0063] The first attention score is determined using the following formula:

[0064]

[0065] In the above formula, π′(h,r,t) represents the first attention score, and π(h,r,t) represents the second attention score. M r This represents the transformation matrix corresponding to edge r. e represents the first encoded vector of the corresponding node h. r This represents the second encoding vector of the corresponding edge.

[0066] In this embodiment, tanh is used as the nonlinear activation function, where M rThis is the transformation matrix of edge r generated in embedding layer 41. The magnitude of the second attention score π(h,r,t) depends on the distance between the corresponding node h and the first neighbor node t on edge r in embedding layer 41. If the corresponding node h and the first neighbor node t are close, then the first neighbor node t can propagate more information to the corresponding node h. Furthermore, the second attention score π(h,r,t) is normalized using softmax to obtain the corresponding first attention score π′(h,r,t).

[0067] For example, refer to Figure 3 For user node u1, the first attention score corresponding to object node i2 is: The first attention score for object node i5 is

[0068] In the embodiments of this application, when the propagation of information iterates to a higher order, the attention mechanism enables the recommendation model to focus more attention on some nodes, thereby reducing the impact of noise.

[0069] Furthermore, a node has multiple second neighbor nodes; the fifth vector is determined based on the first encoding vector of the node's second neighbor nodes, including: determining the fifth vector based on the first encoding vector of one second neighbor node, the first encoding vector of another second neighbor node, and the target number of combinations, where the target number of combinations is the number of combinations obtained by combining any two nodes among the multiple second neighbor nodes.

[0070] Specifically, the fifth vector is determined using the following formula:

[0071]

[0072] In the above formula, BC(h) represents the fifth vector. Let d(h) represent all the second neighbor nodes of the corresponding node h, and let d(h) represent the number of second neighbor nodes of the corresponding node h. Is The number of combinations of two nodes, t1 and t2, represent the number of combinations of two nodes. The two second neighbor nodes in the middle, This represents the first encoding vector of node t1. Let t1 represent the first encoding vector of node t2, and t1 < t2 means that the number of neighboring nodes of node t1 is less than the number of neighboring nodes of node t2.

[0073] For example, refer to Figure 3 If the corresponding node is user node u1, then the second neighbor nodes are object nodes i1, i3, and i4. The number of second neighbor nodes of user node u1 is 3. Therefore, the number of combinations is... The value is 3, and the reciprocal is one-third. Among these, object node i1 has 2 neighboring nodes, object node i3 has 3 neighboring nodes, and object node i4 has 4 neighboring nodes. Therefore, the fifth vector corresponding to user node u1 is calculated as follows:

[0074]

[0075] in, This represents the first encoded vector of object node i1. This represents the first encoded vector of object node i3. This represents the first encoded vector of object node i4.

[0076] Specifically, a bilinear collector 422 is used to collect the set of second neighbor nodes containing the corresponding node h. The feature interaction information between each pair of nodes. Taking the reciprocal indicates that the result of the interaction between each pair of nodes is assigned the same and fixed system. ⊙ represents the element-wise inner product of the two first encoding vectors. Through this inner product operation, strong signals shared by the second neighbor nodes t1 and t2 on a certain feature are highlighted, while weak signals are weakened. The bilinear collector utilizes the element-wise inner product between nodes to update the representation of the corresponding node h with the second-order feature interactions between the corresponding node h and its second neighbor nodes, as well as between any two second neighbor nodes, thus enriching the semantic representation of the corresponding node h.

[0077] Furthermore, the second vector is determined using the following formula:

[0078]

[0079] In the above formula, Let represent the second vector, LC(h) represent the fourth vector, BC(h) represent the fifth vector, and α be a hyperparameter. The value of α ranges from [0,1] and is used to control the information ratio between the bilinear and linear data acquisition systems.

[0080] In this embodiment, obtaining the second vector of all nodes in the collaborative knowledge graph G is performed synchronously, while obtaining the second vector of the corresponding node h... At the same time, all other nodes also obtain their own second vector.

[0081] In the embodiments of this application, the aggregation methods used for the second vector corresponding to the iterative aggregation node and the first encoded vector corresponding to the node include: addition aggregation method or merging aggregation method.

[0082] In one alternative embodiment, reference is made to Figure 4Iteratively aggregating the second vector D2 and the first encoding vector X1 of the corresponding node, multiple third vectors D3 of different orders are obtained. Specifically, the embedding propagation layer 42 aggregates the first encoding vector X1 represented by the corresponding node h itself. and the representation vector (second vector D2) obtained from its neighbors during the information collection process. The node h aggregates the representations of information at each order, denoted as the third vector. Its definition is: in, This represents the nth-order neighbor information of the corresponding node h, where n is an integer greater than or equal to 1. Furthermore, in this embodiment, f() represents an aggregator used to aggregate vectors ( (First encoding vector or third vector) and second vector

[0083] The aggregator f() uses either an additive aggregator or a merging aggregator, as follows: The third vector is determined in the following way:

[0084]

[0085] In the above formula, f(n) is the summing aggregator, f(n) is the t-th third vector, and W (n) and b (n) This refers to the parameters used when generating the nth third vector. When n equals 1, This represents the first encoded vector; when n is greater than 1, Let represent the (n-1)th third vector, and ReLU represent the nonlinear activation function.

[0086] In this embodiment of the application, the summation aggregator takes a vector. sum vector The sum is then subjected to a linear transformation. It is a trainable weight matrix, d′ is the defined dimension of the vector after linear transformation, and b (n) It is a bias term

[0087] In one possible implementation, the third vector is determined in the following manner:

[0088]

[0089] In the above formula, f(n) is the merging aggregator, f(n) is the t-th third vector, and W (n) and b (n) This refers to the parameters used when generating the nth third vector. When n equals 1, This represents the first encoded vector; when n is greater than 1, Let represent the (n-1)th third vector, and ReLU represent the nonlinear activation function.

[0090] Specifically, the merge aggregator uses the merge symbol "||" to... and After merging, a linear transformation is applied. It is a weight matrix.

[0091] For example, in this embodiment of the application, when n is 3, the first third vector is This is the first encoded vector. The second vector is the third vector. The third third vector is

[0092] Reference Figure 4 Then the first encoded vector X1 is finally fused. and multiple third vectors D3 The first vector D1 is obtained

[0093] The specific formula for obtaining the first vector D1 through fusion is as follows:

[0094] The prediction layer determines the matching degree by multiplying the transpose of the first vector corresponding to the target user's node and the first vector corresponding to the target node.

[0095] Specifically, the matching degree between the first vector corresponding to the target node and the first vector corresponding to the target user's node is determined by the following formula:

[0096]

[0097] in, This represents the matching degree between the target user node u and the object node i. This represents the first vector corresponding to the target user node. Let be the transpose of the first vector corresponding to the node of the target user. This represents the first vector corresponding to object node i.

[0098] For example, refer to Figure 3 If the target user node u is user node u1, then Then the object node In this embodiment of the application, the determined matching degree includes the similarity between user node u1 and each object node in the collaborative knowledge graph G.

[0099] Furthermore, the collaborative knowledge graph can include cold-start object nodes. By determining the recommendation model, the matching degree between cold-start object nodes and target user nodes can be determined, thereby enabling the recommendation of cold-start objects to users. Here, cold-start object nodes are those that have not been recommended to any user in the historical phase and have not interacted with any user.

[0100] In the embodiments of this application, it is possible to determine the probability value of a user interacting with a corresponding object.

[0101] S203, Recommend node information corresponding to the target node to the target user.

[0102] In this embodiment of the application, a matching threshold, such as 90%, can be preset.

[0103] The specific implementation process of this step is described in S203, and will not be limited here.

[0104] In this embodiment, the training process of the recommendation model is also included. Specifically, the dataset that can be used is MovieLens-1M (a movie dataset), which contains 1 million interaction records between 6040 users and 3883 movie objects. Each user has historical interactions with at least 20 movies. In addition to user-movie object interaction data, it is also necessary to collect relevant information about movie objects to construct a knowledge graph of movie objects. Since MovieLens-1M contains movie types, after obtaining the director and actor information of 3745 movies, the final detailed training data includes: user-movie object interaction data (users: 6040; movies: 3883; interactions: 100209) and object knowledge graph (nodes: 13593; relationships: 3 types; node-relationship-node triples: 25462).

[0105] The acquired data is then labeled: if a user has interacted with a movie, it is labeled as 1; otherwise, it is labeled as 0. In this embodiment, for each user, 80% of all interaction records labeled as 1 are selected for the training set, and the remaining 20% ​​are used as positive samples in the test set. For each positive interaction record in the training set, one negative interaction record is randomly selected to form a complete training sample set. During testing, for each user, the positive samples of that user in the training set are removed from the complete object set, and a predicted rating for that user is given for all remaining objects.

[0106] Furthermore, the loss function used during training includes the following three parts, as shown in the following formula:

[0107] L = L KG +LCF +λ||Θ|| 2

[0108] In the above formula, L KG This is the loss function corresponding to the embedding layer of the recommendation model, defined as: L KG =∑ (h,r,t,t′)∈ z-lnσ(g(h, r, t′)-g(h, r, t)), (h,r,t') is a spurious triple constructed by randomly replacing the tail object in the real triple; σ is a non-linear activation function. This embedding layer models objects and relationships in the dimension of triples, directly injecting information from connected nodes t into the corresponding node h, thereby improving the representational power of the recommendation model. LCF is the cooperative signal loss, which uses BPR loss (a loss function). BPR loss assumes that observed user-object interactions should be assigned a higher score than unobserved interactions, and its definition is as follows:

[0109]

[0110] In the above formula, Ω={(u,i,j)|(u,i)∈I + ,(u,j)∈I -} represents the training set, I + A positive sample representing an interaction between user u and object i; I - σ(·) represents negative samples sampled without interaction; σ(·) is a non-linear activation function.

[0111] also, This is the set of model parameters. Here, E is the embedding vector of all nodes and edges (e.g., the first encoding vector of a node and the second encoding vector of an edge); Mr is the transformation matrix on a specific edge r; W(n) and b(n) represent the generation... At this point, the aggregator performs a linear transformation, corresponding to the weight matrix and bias terms. λ is the L2 regularization parameter to prevent overfitting.

[0112] Furthermore, in this embodiment, the number of hidden layers in the recommendation model is set to 3, with dimensions of 128, 64, and 32 respectively. The embedding dimension of nodes and edges in the collaborative knowledge graph is 128, and the hyperparameter α is set to 0.6. The recommendation model is trained in batches, with a batch size of 4096 for the collaborative filtering part and 8092 for the collaborative knowledge graph embedding part. The initial learning rate is 0.001, the L2 regularization parameter is set to 1E-5, the maximum number of iterations is set to 100, and an early stopping strategy is used during training. The training process stops when there is no improvement in 10 consecutive iterations.

[0113] In this embodiment, the Adam optimizer is used to adaptively adjust the learning rate and update and adjust each parameter in the model parameter set Θ.

[0114] The server can push the node information corresponding to the identified target node to the user's corresponding user terminal, and display the node information on the user terminal to achieve accurate recommendation of node information.

[0115] In this embodiment of the application, by combining the recommendation model of the collaborative knowledge graph, accurate node information is recommended to the target user. Since the collaborative knowledge graph includes objects and the relationships between objects, when there are cold-start objects, the relationship between the cold-start objects and existing objects can be used to accurately recommend cold-start objects to the user.

[0116] In summary, the embodiments of this application overcome the problem of being unable to establish implicit connections between nodes in the entire collaborative knowledge graph. Using the embodiments of this application improves the accuracy of recommended objects, and the precision, recall, and normalized loss cumulative gain all exceed those of current mainstream recommendation algorithms. Specifically, the embodiments of this application can integrate collaborative filtering recommendation methods and collaborative knowledge graphs to design an end-to-end collaborative knowledge graph recommendation model. This recommendation model overcomes the drawback of independent user-object interaction records and can acquire collaborative signals based on object attributes. Furthermore, based on the attention mechanism, a bilinear collector is designed and combined with a linear collector to recursively aggregate the feature interaction information and linear weighted information of neighboring nodes. This explicit encoding of node interaction relationships in the collaborative knowledge graph enables the recommendation model to capture the rich semantics based on the feature interactions between nodes in the collaborative knowledge graph. The bilinear collector can acquire feature interaction information between nodes during the information acquisition stage, enriching node representations. The attention mechanism propagates the node representations along the collaborative knowledge graph through a recursive embedding propagation algorithm, capturing the implicit connections between nodes in the collaborative knowledge graph. During the experiment, when the recommendation list length was 20, the precision, recall, and cumulative gain of normalized depreciation were 29.4%, 24.9%, and 67.4%, respectively, which exceeded the current mainstream recommendation algorithms that integrate knowledge graphs. The experiment proves that the content recommendation method provided in this application can effectively improve the accuracy of the recommendation results.

[0117] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0118] Figure 5This is a schematic diagram of a content recommendation device provided according to an embodiment of this application. This application provides a content recommendation device that can be integrated into electronic devices such as servers. Figure 5 As shown, the content recommendation device 50 includes: an acquisition module 51, a processing module 52, and a recommendation module 53. Wherein:

[0119] Module 51 is used to acquire the collaborative knowledge graph, which includes the target user's nodes;

[0120] Processing module 52 is used to input the collaborative knowledge graph into the recommendation model for recommendation processing to obtain the target node;

[0121] Recommendation module 53 is used to recommend node information corresponding to the target node to the target user;

[0122] The recommendation model includes an embedding layer, an embedding propagation layer, and a prediction layer.

[0123] The embedding layer is used to encode the collaborative knowledge graph to obtain the first encoding vector corresponding to each node of the collaborative knowledge graph and the second encoding vector corresponding to each edge of the collaborative knowledge graph.

[0124] An embedded propagation layer is used to process the first and second encoding vectors to obtain the first vector corresponding to each node of the collaborative knowledge graph. The first vector includes the result of iterative aggregation and fusion of the node information of the corresponding node's neighboring nodes.

[0125] The prediction layer is used to perform prediction processing based on the first vector to obtain the target node. The matching degree between the first vector corresponding to the target node and the first vector corresponding to the target user's node is greater than or equal to a preset threshold.

[0126] In one possible implementation, the method for determining the first vector corresponding to each node is the same. Specifically, in determining the first vector corresponding to a node, the processing module 52 is used to: determine the second vector corresponding to the node based on the first and second encoding vectors of the node using an attention mechanism, based on the embedding propagation layer; the second vector includes node information of the node's neighboring nodes; iteratively aggregate the second vector corresponding to the node and the first encoding vector corresponding to the node to obtain multiple third vectors; each iteration of aggregation yields one third vector; the third vector obtained from the first iteration is based on the aggregation of the second vector corresponding to the node and the first encoding vector corresponding to the node; the third vector obtained from subsequent iterations is based on the aggregation of the third vector obtained from the previous iteration and the second vector corresponding to the node; and fuse the first encoding vector corresponding to the node and multiple third vectors to obtain the first vector corresponding to the node.

[0127] In one possible implementation, when the processing module 52 determines the second vector corresponding to a node based on the first and second encoding vectors corresponding to the node using the attention mechanism, it specifically performs the following steps: based on the first encoding vector of the node's first neighbor node and the second encoding vector of the edge between the node and the first neighbor node, it uses the attention mechanism to determine the fourth vector of the node's first neighbor node, where the edge connecting the first neighbor node and the node is a unidirectional edge; it determines the fifth vector based on the first encoding vector of the node's second neighbor node, where the edge connecting the second neighbor node and the node is an undirected edge; and it fuses the fourth and fifth vectors to obtain the second vector.

[0128] In one possible implementation, when the processing module 52 determines the fourth vector of the first neighbor node of a node using the attention mechanism, it is specifically used to: determine the first attention score between the node and the first neighbor node based on the first encoding vector of the first neighbor node and the second encoding vector of the edge between the node and the first neighbor node; and determine the fourth vector based on the first encoding vector and the first attention score of the first neighbor node.

[0129] In one possible implementation, a node has multiple second neighbor nodes; when the processing module 52 determines the fifth vector based on the first encoding vector of the node's second neighbor nodes, it specifically determines the fifth vector based on the first encoding vector of one second neighbor node, the first encoding vector of another second neighbor node, and the target number of combinations, where the target number of combinations is the number of combinations obtained by combining any two nodes among the multiple second neighbor nodes.

[0130] In one possible implementation, the aggregation method used for the second vector corresponding to the iterative aggregation node and the first encoded vector corresponding to the node includes: summation aggregation method or merging aggregation method.

[0131] In one possible implementation, the prediction layer determines the matching degree by multiplying the transpose of the first vector corresponding to the target user's node and the first vector corresponding to the target node.

[0132] The apparatus provided in this application embodiment can be used to perform... Figure 2 The methods in the illustrated embodiments are similar in principle and technical effect, and will not be described again here.

[0133] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, a processing module can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as program code in the device's memory, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.

[0134] For example, these modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). As another example, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a System-On-a-Chip (SOC).

[0135] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).

[0136] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device may include: a processor 61, a memory 62, a communication interface 63, and a system bus 64. The memory 62 and the communication interface 63 are connected to the processor 61 via the system bus 64 and communicate with each other. The memory 62 is used to store instructions, the communication interface 63 is used to communicate with other devices, and the processor 61 is used to call the instructions in the memory to execute the scheme of the recommended method embodiment described above.

[0137] Should Figure 6 The system bus 64 mentioned can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This system bus 64 can be divided into address bus, data bus, control bus, etc. For ease of representation, it is represented by only one thick line in the diagram, but this does not indicate that there is only one bus or one type of bus.

[0138] Communication interface 63 is used to enable communication between the database access device and other devices (such as clients, read-write databases, and read-only databases).

[0139] The memory 62 may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.

[0140] Processor 61 can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0141] This application also provides a computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the content recommendation method as described in any of the above method embodiments.

[0142] This application also provides a chip for executing instructions, which is used to perform the content recommendation method as described in any of the above method embodiments.

[0143] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the content recommendation method as described in any of the above method embodiments.

[0144] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates an "or" relationship between the preceding and following related objects; in formulas, the character " / " indicates a "division" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0145] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application. In the embodiments of this application, the order of the above-mentioned process numbers does not imply the order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A content recommendation method, characterized in that, include: Obtain a collaborative knowledge graph, which includes target user nodes and object nodes; The collaborative knowledge graph is input into the recommendation model for recommendation processing. The matching degree between each object node and the target user node is calculated, and object nodes with a matching degree greater than a preset threshold are selected as target nodes. Recommend node information corresponding to the target node to the target user; The recommendation model includes an embedding layer, an embedding propagation layer, and a prediction layer. The embedding layer is used to encode the collaborative knowledge graph to obtain a first encoding vector corresponding to each node of the collaborative knowledge graph and a second encoding vector corresponding to each edge of the collaborative knowledge graph. In determining the first vector corresponding to a node, the embedding propagation layer is used for: An attention mechanism is used to determine the second vector corresponding to the node based on the first encoding vector and the second encoding vector corresponding to the node. The second vector includes node information of the node's neighboring nodes. The second vector corresponding to the node and the first encoded vector corresponding to the node are iteratively aggregated to obtain multiple third vectors; each iteration of aggregation yields one third vector; the third vector obtained in the first iteration is based on the aggregation of the second vector corresponding to the node and the first encoded vector corresponding to the node; the third vector obtained in subsequent iterations is based on the aggregation of the third vector obtained in the previous iteration and the second vector corresponding to the node. The first encoded vector corresponding to the node and the plurality of third vectors are fused to obtain the first vector corresponding to the node; The prediction layer is used to perform prediction processing based on the first vector to obtain the target node. The matching degree between the first vector corresponding to the target node and the first vector corresponding to the target user's node is greater than or equal to a preset threshold. The matching degree is the product of the transpose of the first vector corresponding to the target user's node and the first vector corresponding to the target node.

2. The content recommendation method according to claim 1, characterized in that, The method for determining the first vector corresponding to each node is the same.

3. The content recommendation method according to claim 2, characterized in that, The step of using an attention mechanism to determine the second vector corresponding to the node based on the first and second encoding vectors corresponding to the node includes: Based on the first encoding vector of the first neighbor node of the node and the second encoding vector of the edge between the node and the first neighbor node, the fourth vector of the first neighbor node of the node is determined by the attention mechanism, and the connection edge between the first neighbor node and the node is a one-way edge; The fifth vector is determined based on the first encoding vector of the second neighbor node of the node, and the connection edge between the second neighbor node and the node is an undirected edge. The fourth vector and the fifth vector are fused to obtain the second vector.

4. The content recommendation method according to claim 3, characterized in that, The step of determining the fourth vector of the first neighbor node of the node using the attention mechanism includes: A first attention score between the node and its first neighbor node is determined based on the first encoding vector of the node's first neighbor node and the second encoding vector of the edge between the node and its first neighbor node. The fourth vector is determined based on the first encoding vector of the first neighbor node and the first attention score.

5. The content recommendation method according to claim 3, characterized in that, The node has multiple second neighbor nodes; determining the fifth vector based on the first encoding vector of the node's second neighbor nodes includes: The fifth vector is determined based on the first encoding vector of one second neighbor node, the first encoding vector of another second neighbor node, and the target number of combinations, wherein the target number of combinations is the number of combinations obtained by combining any two nodes among multiple second neighbor nodes.

6. The content recommendation method according to any one of claims 2-5, characterized in that, The aggregation methods used to iteratively aggregate the second vector corresponding to the node and the first encoded vector corresponding to the node include: summation aggregation or merging aggregation.

7. A content recommendation device, characterized in that, include: The acquisition module is used to acquire a collaborative knowledge graph, which includes target user nodes and object nodes. The processing module is used to input the collaborative knowledge graph into the recommendation model for recommendation processing, calculate the matching degree between each object node and the target user node, and filter object nodes with a matching degree greater than a preset threshold as target nodes. The recommendation module is used to recommend node information corresponding to the target node to the target user; The recommendation model includes an embedding layer, an embedding propagation layer, and a prediction layer. The embedding layer is used to encode the collaborative knowledge graph to obtain a first encoding vector corresponding to each node of the collaborative knowledge graph and a second encoding vector corresponding to each edge of the collaborative knowledge graph. In determining the first vector corresponding to a node, the embedding propagation layer is used for: An attention mechanism is used to determine the second vector corresponding to the node based on the first encoding vector and the second encoding vector corresponding to the node. The second vector includes node information of the node's neighboring nodes. The second vector corresponding to the node and the first encoded vector corresponding to the node are iteratively aggregated to obtain multiple third vectors; each iteration of aggregation yields one third vector; the third vector obtained in the first iteration is based on the aggregation of the second vector corresponding to the node and the first encoded vector corresponding to the node; the third vector obtained in subsequent iterations is based on the aggregation of the third vector obtained in the previous iteration and the second vector corresponding to the node. The first encoded vector corresponding to the node and the plurality of third vectors are fused to obtain the first vector corresponding to the node; The prediction layer is used to perform prediction processing based on the first vector to obtain the target node. The matching degree between the first vector corresponding to the target node and the first vector corresponding to the target user's node is greater than or equal to a preset threshold. The matching degree is the product of the transpose of the first vector corresponding to the target user's node and the first vector corresponding to the target node.

8. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the content recommendation method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on an electronic device, causes the electronic device to perform the content recommendation method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Building field document recommendation system and method based on knowledge graph attention network

    CN114064936A