A recommendation method based on neighbor entity representation integrating user and item
The method of expanding user embedding representation and GCN network aggregation project neighbor entity through the TransR model, combined with the attention mechanism, solves the data sparseness and cold start problems, and achieves more accurate user interest mining and recommendation performance improvement.
Patent Information
- Application Number
- CN202210461853.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-04-28
AI Technical Summary
The existing recommended methods based on matrix decomposition or deep learning networks have problems with data sparseness and cold start, and most recommended methods based on knowledge graphs cannot accurately fit user interests in feature embedding representations, resulting in suboptimal representation of the model.
The neighbor entity representation recommendation method of fusion user-project is adopted, entity propagation is performed through TransR model, and the user embedding representation is expanded, and the neighbor entity is aggregated by GCN network, and the relative relationship between the user and the project is combined with the attention mechanism, and an internal integral score function is constructed for recommendation.
It realizes fine-grained recommendations, avoids sparse data and cold start problems, improves recommendation performance, and significantly improves the accuracy of user interest mining and recommendation accuracy.
Smart Images

Figure CN114880559B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data processing, and in particular to a method for recommending neighbor entity representations that integrates users and items. Background Art
[0002] With the continuous development of big data technology, recommendation algorithms play a vital role in helping users quickly and accurately retrieve information of interest from massive amounts of data. Steffen et al. pioneered recommendation experiments using matrix factorization (BPR) and factorization machines with libFM (LibFM). MF leverages user-item interactions to learn vector representations; LibFM uses a Bayesian ranking model based on the recommendation prediction component. These algorithms combine these three mathematical algorithms with recommendation, demonstrating the model's performance and feasibility. He et al. proposed a novel neural factorization machine (NFM) model for sparse predictive analytics (NFM), which decomposes user history and items into user-item interaction pairs and uses neural networks to predict click-through rates. Cheng et al. combined traditional wide linear channels with deep nonlinear channels to create a wide and deep learning for recommender systems (Wide & Deep) recommendation model, which possesses both memory and generalization capabilities. The model was validated in a real-world application scenario on Google Play.
[0003] However, the aforementioned recommendation methods based on matrix factorization or deep learning networks all suffer from data sparsity and cold start problems. Recommendation methods that use knowledge graphs as auxiliary information can effectively avoid these problems. Therefore, research on path, embedding, and hybrid recommendation algorithms based on knowledge graphs has attracted widespread attention. Yu et al. proposed a personalized entity recommendation (PER) approach based on heterogeneous information networks. This approach extracts meta-path features from heterogeneous information networks to represent the connectivity between users and items. Recommendation results can be searched along the meta-path from the original items, making the recommendations semantically interpretable. Ma et al. constructed a jointly optimized explainable recommendation model (RuleRec), which mines association rules between items based on path propagation. Zhang et al. proposed a collaborative knowledge base embedding for recommender systems (CKE), which integrates collaborative filtering methods in knowledge graphs to extract structural knowledge, textual knowledge, and visual knowledge to enrich user representations. Wang et al. designed the sentiment-embedded Signed Heterogeneous Information Network (SHINE) model and the Deep Knowledge-Aware Network for News Recommendation (DKN) model. SHINE extracts latent user representations from heterogeneous networks to uncover hidden user interests. DKN uses a multi-channel word-entity alignment convolutional neural network (KCNN) to combine entity and word embeddings to expand user representations. The RippleNet model, propagating user preferences on the knowledge graph for recommender systems, in hybrid recommendation models, expands the entity set by aggregating neighboring entities propagated across the graph by historical user entities, overlaying them to form a distribution of user preferences relative to candidate items.The knowledge-aware graph neural networks with labelsmoothness regularization for recommender systems (KGNN-LS) model combines GNNs with knowledge graphs to propose a label propagation algorithm, exploring relationships between users and items and mining users' fine-grained interests. The knowledge graph attention network for recommendation (KGAT) model connects a user bipartite graph with a knowledge graph, aggregates user and item embeddings separately through a graph convolutional network (GCN), and mines relationships between users and items. The reinforced negative sampling over knowledge graph for recommendation (KGPolicy) model, for the first time, integrates a negative sampling model with a knowledge graph, leveraging the knowledge graph to mine negative samples. The recommendation module achieves significant improvements in recommendation performance using only matrix factorization.
[0004] Although the above-mentioned knowledge graph-based recommendation methods can, to a certain extent, solve the data sparsity and cold start problems of traditional collaborative filtering and deep learning-based recommendation methods, most of them use mining paths and single user or item representation methods. The feature embedding representation cannot accurately fit user interests, which will lead to suboptimal representation of the model. Summary of the Invention
[0005] To address the above problems, the present invention proposes a user-item fusion neighbor entity representation recommendation method, which targets both user and candidate item representations and explores the relationships between entities, thereby tapping into users' deeper interests.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A method for recommending neighbor entity representation by integrating user and item, characterized by comprising the following steps:
[0008] S1: Get the data set to be processed and give the corresponding knowledge graph;
[0009] S2: Mapping users u Interactive History Project
[0010] S201: User uThe interaction history items in the dataset are mapped to user entities in the knowledge graph through the entity mapping file, which serves as the initial extended source entity;
[0011] S3: Mapping Items v
[0012] S301: Map the user's candidate items in the dataset to candidate item entities in the knowledge graph, and v Entities as aggregate objects;
[0013] S4: The user entity mapped to the knowledge graph in S201 is propagated in the knowledge graph through the TransR model to obtain the user u Embedded representation of
[0014] S5: Use the GCN network to aggregate candidate items mapped to the knowledge graph in S301 v Neighbor entities around the entity to get candidate items v Embedded representation of
[0015] S6: The user will be obtained u Embedding representation and candidate items v The embedding of represents the candidate score obtained by inner product operation;
[0016] S7: Recommend candidate projects based on their scores.
[0017] The beneficial effects of the present invention are:
[0018] The proposed method uses the GCN method to aggregate item embedding representations, uses the entity propagation method to expand user embedding representations, and focuses on the relative relationship between users and items through the attention mechanism, so as to achieve the purpose of amplifying user interests and reducing item noise, thereby realizing fine-grained recommendations and avoiding data sparsity and cold start problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Recommending models for the representation of aggregated neighbor entities; DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0021] 1. Recommendation method for aggregation of neighbor entities
[0022] The present invention expands the user feature space by propagating user history entities and aggregating graph entities with candidate entities, thereby realizing user interest mining while preventing data sparsity and cold start problems.
[0023] Entity propagation is to map user historical items into entities in the knowledge graph, propagate them in the knowledge graph using the distance translation model TransR, and expand the user's embedding representation; entity aggregation is to use the GCN network to aggregate neighboring entities around the candidate item entity in the knowledge graph and expand the item embedding representation. Method model such as Figure 1 shown.
[0024] from Figure 1 It can be seen that entity communication is based on user u The interaction history items are taken as input, mapped to the knowledge graph through the entity mapping file, and used as the initial extended source entity. The source entity is regarded as the head entity of the triple, and the propagation method is to use the TransR model to propagate to the tail entity using the relationship. At the same time, the acquisition of attention weight is equivalent to the importance score of the tail entity relative to the current user. The weight is weighted on the tail entity to obtain the representation of the user propagation entity set, and iterative propagation is carried out. k The entity representation of each layer is accumulated to obtain u Entity aggregation is the embedding representation of items. v Mapped to knowledge graph entities and v Considered as an aggregated object, the sampling distance from the project entity is k Each layer of entities uses GCN to aggregate from the outermost layer to the inner layer. k This process then generates an item embedding. The aggregation process also requires calculating the importance weights of items and users and applying these weights to each aggregated object. Finally, a scoring function is constructed by inner-producting the user and item embeddings. The score represents the user u's interest in the candidate item. All interest values are ranked to achieve recommendation prediction.
[0025] The representation recommendation method of aggregating neighbor entities includes three core parts: user embedding representation, candidate item embedding representation and recommendation prediction.
[0026] (1) User Embedding Representation
[0027] Given a knowledge graph G Interacting with the User Matrix Y ,Will Y Zhongzheng Sample G The source entity in and perform entity propagation. Y With the user's k The sub-entity propagation set representations are shown in formulas (1) and (2) respectively.
[0028] (1)
[0029] (2)
[0030] in, Represents the number of transmissions, when hour, ε Represents the original extended source entity, It can be regarded as an initialized user click history item, which is used to expand the entity set in the graph.
[0031] In fact, since the extended entity set will be k The increase is exponential, so this model adopts the method of limiting the sampling neighbors, and the sampling size is no longer a physical e All surrounding neighbors N(e) Instead, we sample neighborhood entities from high to low importance of items to users to obtain a propagation entity set that is biased towards user interests. The sampling neighborhood of each layer is defined as S(e) ,but S(e) The entity set and triple representation of are shown in formulas (3) to (4).
[0032] (3)
[0033] (4)
[0034] in, h 、 r 、 t Represents the head entity, relationship, and tail entity of the triple, respectively, and the maximum number of hops H The initial value of is set to 2.
[0035] The attention mechanism is to focus on the importance of each entity to the user. t The assigned attention weight is calculated as shown in Equation (5).
[0036] (5)
[0037] in, R i and H i Respectively express the relationship r i and head entity h i The embedding vector of W i Representing relational space R Items measured v Similarity values with user history entities. Since project entities may have different similarities when measured with different relationships, the relationship embedding matrix needs to be considered in calculating the weights. W i After that, for the first expansion set Entity vector representation of The first-layer propagation representation of the user is obtained by weighting, as shown in formula (6).
[0038] (6)
[0039] in, T i Represents the tail entity t i The embedding after TransR mapping has the same R Same dimensions. Vector U 1 for u About the project v The first-order feature representation of U 1 Continue to spread one layer to get users u The second-order feature representation of U 2 , repeat this process to obtain , for each Extended Weighted Feature Representation U 1 , U 2 ,... U H , accumulating each layer of feature representation to obtain the user embedding representation, as shown in formula (7).
[0040] (7)
[0041] Each layer of feature representation contains the features of the previous layer, so U H It contains all the features of the previous transmission, but in order to prevent the loss of information during the transmission process, the final method is to accumulate each layer. U i calculate u Embedded representation of u v .
[0042] (2) Candidate item embedding representation
[0043] The candidate v Mapped to the knowledge graph as an aggregated object E ( v ), by aggregating neighbor entity information within a certain distance, to mine potential high-order, high-quality user preferences. Obtain candidate project propagation entities E ( v )around k The jump entity set is shown in formula (8).
[0044] (8)
[0045] in,N(h) Represents a candidate entity E ( v )Need to aggregate the neighborhood entities, similar to the user history entity propagation, in order to prevent the number of neighborhood entities from growing too fast, limit the sampling neighborhood (see formula 3), E ( v ) is represented as The attention weight calculation in the aggregation process is shown in formula (9).
[0046] (9)
[0047] in, u and r are the vector representations of users and relationships respectively. After allocating attention weights to the sampled neighborhoods, the neighborhood representation of each layer is shown in Equation (10).
[0048] (10)
[0049] in, r v , e express E ( v ) and surrounding entities e relationship, is the normalized user relationship weight, and the calculation formula of this weight is shown in formula (11).
[0050] (11)
[0051] When the project v Each layer of neighboring entities around is represented, forming a topological neighborhood structure as a whole.
[0052] Because the candidate v After mapping to the graph E(v) , E(v) As the central aggregated entity, use the Sum method to E(v) and its surrounding entities are aggregated from outside to inside into a single vector through the GCN aggregation method to represent E ( v )Collected k The present invention mainly uses the GCN aggregation method based on Sum, and finally E(v) The surrounding neighborhood entity information is aggregated into a single vector, and the calculation method is shown in Equation (12).
[0053] (12)
[0054] in, W 、b denote weights and biases respectively, σ is the ReLU activation function, S ( v ) is the aggregate entity set of candidate items. E(v) aggregated by the Sum method is expressed as the embedding representation vector of the final candidate item v u .
[0055] (3) Recommendation prediction
[0056] After entity propagation, the user embedding representation is obtained u v , after entity aggregation, the candidate item embedding representation is obtained v u , the recommendation score is calculated based on the inner product function. The score function is shown in formula (13).
[0057] (13)
[0058] The training process of the model obtained above is shown in Table 1. Among them, the user history items are propagated in the graph to form user embedding u v (See Formula (3) to Formula (7)), the candidate items are aggregated in the graph to form the item embedding v u (See Equations (8) to (12)). To improve computational efficiency, a graph negative sampling strategy is used during training to obtain the negative sampling distribution of the data. Losses are continuously optimized through methods such as gradient descent to train a high-quality score function. The model loss function is shown in Equation (14).
[0059] (14)
[0060] in, is the cross entropy loss, N is the negative sampling distribution, N u is a user u The number of negative samples, N and N u Obeying uniform distribution, Regularization term to prevent overfitting.
[0061]
[0062]
[0063] Example:
[0064] In order to further verify the effectiveness of the method proposed in this paper, experiments were carried out on three datasets: MovieLens-20M, Book-Crossing and Last.FM.
[0065] (1) Dataset and experimental environment
[0066] The basic statistics of the three datasets in the experiment are shown in Table 2.
[0067]
[0068] MovieLens-20M contains approximately 1 million ratings with scores between 1 and 5. Book-Crossing contains 172,576 interactions within its community. Last.FM contains 42,346 interactions between 1,872 users and 3,846 other users. Because the experiment requires converting interaction ratings into implicit representations, the rating threshold for MovieLens-20M is set to 4; due to data sparseness, no threshold is set for Book-Crossing and Last.FM. The thresholded dataset forms a user interaction matrix, where entries marked with 1 represent positive ratings from the user, and 0 represents negative ratings.
[0069] This experiment was conducted on a Linux system using Python and the TensorFlow framework. All datasets were divided into training, evaluation, and test sets with a ratio of 6:2:2. Each experiment was repeated three times, with 20 training rounds per run. Average performance was calculated. Table 3 shows some key experimental parameter settings.
[0070]
[0071] The entity propagation part sets the entity update method of the graph ( Item_Update_Mode ) is the cumulative transformation, and the entity embedding weight ( KGE_Weight ) is set to the default value of 0.01; the embedding dimension of TransR ( Dim_Rip ) must be aggregated with the embedding dimension of the GCN ( Dim ) to prevent the dimension mismatch problem between user embedding and item embedding; each ripple set size ( N_Memory ) is initially set to 32; the maximum distance an entity can travel ( N_Hop ) is set to 2. The default value of the GCN aggregator setting is the Neighbor aggregation method. In addition, the maximum distance of the item aggregation ( N_Iter ), regularized loss weight ( L2_ Weight ), learning rate ( LR ) are the best values tested on different datasets.
[0072] (2) Simulation experiments and results
[0073] To verify the performance of the proposed method, the area under the curve (AUC) and accuracy (ACC) are used to evaluate the model performance. The AUC is calculated as shown in Equation (15).
[0074] (15)
[0075] in, Indicates the i The serial number of the project, M and N are the number of positive and negative samples respectively.
[0076] The ACC calculation is shown in formula (16):
[0077] (16)
[0078] in, TP For a real example, FP For a false positive example, TN For a true counterexample, FN For a false counterexample, TP + FP + TN + FN Indicates the number of all samples.
[0079] To verify the effectiveness of our method, we conducted comparative experiments with 10 models including LibFM, Wide&Deep, and PER. The results are shown in Table 4.
[0080]
[0081] As can be seen from Table 4, the model of the present invention has significantly improved recommendation performance compared with other recommendation models in the table. The average performance of various models is better in the movie dataset than in the book and music datasets because the data of MovieLens-20M is denser and the user feature space representation is more complete. LibFM and Wide&Deep are based on neural networks and deep learning methods respectively, and perform well on the three datasets. However, in actual scenarios, the performance of such models will rapidly decrease due to data sparsity and cold start problems. CKE is a collaborative knowledge base recommendation method that uses knowledge graphs to expand user features. Compared with traditional collaborative methods such as LibFM, Wide&Deep, its performance is greatly improved. SHINE and CKE are similar in principle and both achieve recommendation probability prediction by expanding the feature space. Compared with the model in this paper, SHINE and CKE only expand the user embedding representation and do not pay attention to the importance of the relationship between users and items. The accuracy is reduced by about 7% to 13%. DKN performs the worst among the three datasets. Because the main task of DKN is to extract high-quality original features, its performance will be significantly improved in the news dataset. The comprehensive indicators of the RippleNet model outperform those of the embedding-based models SHINE, CKE, DKN, and the path-based model PER, because RippleNet is a hybrid model that combines the advantages of both embedding and path recommendation methods. KGAT uses GCN to simultaneously explore the representation of users and items, but the model training quality is poor, with AUC and ACC decreasing by approximately 2%. KGNN-LS applies GNN to recommendations. Its unique graph embedding method can explore the interactions of each item, and its performance on various datasets remains high. KGPolicy implemented a negative sampling strategy in the knowledge graph for the first time, and its accuracy in MovieLens-20M exceeded that of this model, demonstrating the importance of negative signals in improving recommendation performance. Compared to all other models, our model's AUC and ACC values improve by 0.4% to 17.1% and -0.7% to 20.9% on MovieLens-20M; by 0.8% to 13.9% and 0.6% to 9.6% on Book-Crossing; and by 1.4% to 15.5% and 1.1% to 13.4% on Last-FM. In contrast, our model utilizes an attention mechanism when acquiring both user and item embeddings, expanding the feature space of users and items and fully exploring user interests. Experimental data demonstrates significant improvements in recommendation performance, demonstrating the feasibility of our model.
[0082] In order to demonstrate the impact of the Sum aggregation method and various GCN aggregation methods used in this model on the model, experiments were conducted using Sum, Neighbor, Concat, and Avg methods. The experimental results are shown in Table 5.
[0083]
[0084] Method-Sum, Method-Neighbor, Method-Concat, and Method-Avg are four methods for setting the aggregated node entities in the GCN aggregator. Experimental results show that the model using Sum aggregation performs best across all datasets. This is because, compared to Neighbor aggregation, Sum incorporates not only neighborhood features but also the characteristics of the entity itself, preventing information loss. Compared to Avg and Concat aggregation, Sum's focused computational characteristics indirectly capture users' personalized preferences and the semantic characteristics of the knowledge graph, making it more conducive to recommendation.
[0085]
[0086] MovieLens-1M and MovieLens-20M are both movie datasets. MovieLens-1M contains 6,036 items and 753,772 interactions across 2,045 items; MovieLens-20M contains 13,501,622 interactions across 138,159 users and 16,954 items, clearly showing that the data in MovieLens-20M is denser. Comparing the metrics of the models on the two datasets, it is clear that the AUC values of our model decrease by 0.040 and 0.038, respectively, as the data size decreases. This decrease is smaller than that of the other two models, demonstrating that knowledge graph-based recommendation models can better address data sparsity. Compared to recommendation models such as collaborative filtering, factorization machines, and deep networks, our model can leverage the additional entity recommendation candidates provided by the knowledge graph during a cold start, thus avoiding the issue of empty recommendations for new users due to cold starts.
[0087] In addition, the experiments explored the impact of the placement of the aggregation and propagation modules on the model. Using the propagation module for item embeddings and the aggregation module for user embeddings showed similar results, with the proposed model performing better.
[0088] In summary, the proposed recommendation method for fused user-item neighbor entity representations combines entity propagation and aggregation to obtain embedded representations of users and candidate items. Its attention mechanism selectively and biasedly aggregates information about neighboring entities in the graph, targeting user-item relationships, thereby exploring deeper user interests. Furthermore, this model employs a negative sampling strategy to filter out noisy data, providing high-quality negative signals for model training. This model has been shown to significantly improve performance compared to traditional models.
[0089] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the foregoing embodiments. The foregoing embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for recommending neighbor entity representations by integrating user and item features: The following steps are involved: S1: Get the data set to be processed and give the corresponding knowledge graph; S2: Mapping users u Interactive History Project S201: User u The interaction history items in the dataset are mapped to user entities in the knowledge graph through the entity mapping file, which serves as the initial extended source entity; S3: Mapping Items v S301: Map the user's candidate items in the dataset to candidate item entities in the knowledge graph, and v Entities as aggregate objects; S4: The user entity mapped to the knowledge graph in S201 is propagated in the knowledge graph through the TransR model to obtain the user u Embedded representation of S5: Use the GCN network to aggregate candidate items mapped to the knowledge graph in S301 v Neighbor entities around the entity to get candidate items v Embedded representation of S6: The user will be obtained u Embedding representation and candidate items v The embedding of represents the candidate score obtained by inner product operation; S7: Recommend candidate projects based on their scores; The step of obtaining the embedded representation of the user in S4 includes: S401: For a given knowledge graph G, map the user to the knowledge graph G. u The mutual history items are represented as user interaction matrix Y ,Will Y The positive samples in are used as source entities in G, where the user interaction matrix Y The expression: (1) S402: The source entity described in S401 is propagated to the entity, and the user u No. k The secondary entity propagation set is expressed as: (2) in, Represents the number of transmissions, when hour, ε Represents the original extended source entity, Click on the history item for the initialized user; S403: Define the sampling domain of each layer in the knowledge graph G as S(e) ,but S(e) The entity set and triple representation of are shown in formulas (3) to (4): (3) (4) in, h 、 r 、 t Represents the head entity, relationship, and tail entity of the triple, respectively, and the maximum number of hops H The initial value of is set to 2; S404: For each triplet, the tail entity t Assign attention weights, and the calculation formula for the assigned attention weights is: (5) in, R i and H i Respectively express the relationship r i and head entity h i Embedding vector of W i Representing relational space R Items measured v Similarity value with the user's history entity; S405: Based on the obtained W i , the entity vector of the entity propagation set for the first propagation Weighted, we get the first-layer propagation representation of the user, namely: (6) in, T i Represents the tail entity t i Embedded vector after TransR mapping U 1 for u About the project v The first-order feature representation of S406: Use what you get U 1 Continue to spread to the next layer to obtain users u The second-order feature representation of U 2 , repeat S405, and finally obtain Extensions H The feature representation after U 1 , U 2 ,... U H ; S407: Accumulate the feature representation of each layer to obtain the user u Embedded representation of u v ,Right now: (7)。 2. The method for recommending neighbor entity representations based on user-item fusion according to claim 1, characterized in that: The steps of S5 to obtain the embedded representation of the item include: S501: For a given knowledge graph G, candidate items v Mapped into G as an aggregate object is represented as E ( v ); S502: Obtain candidate project propagation entity E ( v )around k Jump entity set, that is: (8) in, N(h) Indicates the neighborhood entities that need to be aggregated; S503: Based on formula (3), the sampling neighborhood is restricted. E ( v ) is represented as ; S504: Allocate attention weights to each layer of sampling neighborhood entities. The attention weight calculation formula is: (9) in, u and r Vector representations of users and relationships respectively; S505: After allocating attention weights to the sampled neighborhood, each layer of neighborhood entities in the knowledge graph G is represented as: (10) in, r v , e express E ( v ) and surrounding entities e relationship, is the normalized user relationship weight, which is calculated as: (11) S506: Use the Sum method to E(v) and surrounding entities e Through the GCN aggregation method, it is aggregated from outside to inside into a single vector to represent E ( v )Collected k The calculation formula for hopping neighborhood information and aggregation is: (12) in, W 、 b denote weights and biases respectively, σ is the ReLU activation function, S ( v ) is the aggregate entity set of candidate items; S507: After aggregation E ( v ) is represented as the final embedding representation of the candidate item v u .
3. The method for recommending neighbor entity representations based on user-item fusion according to claim 1, characterized in that: The formula for calculating the candidate score of S6 is: (13)。