An intelligent recommendation method based on a knowledge graph
By combining graph neural networks and multi-path attention mechanisms with user preference features, the accuracy and efficiency issues of knowledge graph recommendation systems in scenarios with sparse user interactions are solved, achieving efficient personalized recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAVAL AVIATION UNIV
- Filing Date
- 2024-08-13
- Publication Date
- 2026-05-15
AI Technical Summary
Existing knowledge graph recommendation systems perform poorly in scenarios with sparse user and item interactions, and traditional models are complex and computationally intensive, failing to fully explore users' potential preferences and knowledge graph structures.
A graph neural network is used to aggregate the information of the neighbor nodes of entities. A multi-path knowledge propagation attention mechanism and a user preference attention mechanism are introduced. Through graph neural network and knowledge graph embedding learning, the influence weight of the central entity on user preferences is controlled to predict the probability of the user clicking on the entity.
It improves the accuracy and efficiency of the recommendation system, and can deeply mine the historical interaction information and knowledge graph structure of users and items, thereby enhancing the performance of personalized recommendations.
Smart Images

Figure CN118820603B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an intelligent recommendation method based on knowledge graphs, belonging to the field of artificial intelligence technology. Background Technology
[0002] Recommender systems play a crucial role in alleviating information overload, which is ubiquitous in internet applications such as e-commerce platforms (Amazon, Taobao) and social networks (Facebook, Twitter). Typical recommender systems analyze users' historical behavioral data to identify user preferences and provide personalized recommendations. Collaborative filtering is one of the most classic recommender algorithms and has achieved great success in many scenarios. Collaborative filtering predicts a user's likely future behavior based on historical interactions between users and items. While efficient, collaborative filtering performs poorly in scenarios where user-item interactions are sparse.
[0003] A knowledge graph is a large-scale semantic network that represents entities and their relationships in the objective world in the form of a graph. Currently, popular general-purpose knowledge graphs include Freebase, Wikidata, and YAGO4, and knowledge graphs have also found industry applications in fields such as healthcare, academia, and finance. Because knowledge graphs contain massive amounts of knowledge entries, they contribute to the diversity and interpretability of recommendation results; therefore, researchers have proposed various knowledge graph recommendation systems. Traditional knowledge graph recommendation systems mainly rely on embedding-based and path-based methods. The former, through representation learning of the knowledge graph, can supplement the semantic information between existing data, making the semantic description richer and facilitating the discovery of user preferences. However, it does not consider the connections between information in the knowledge graph, resulting in weak interpretability of the recommendation system. The latter connects entities based on relationships and generates paths, allowing users to discover potential items related to entities through these paths, thus obtaining more accurate user preferences. However, it suffers from problems such as model complexity, optimization difficulties, and high computational costs. To improve recommendation performance, H. Wang et al. proposed the RippleNet model in their paper "RippleNet: Propagating User Preferences on the Knowledge Graph for Recommender Systems," which integrates the two methods mentioned above and fully utilizes entity information and semantic relationships in the knowledge graph. However, the RippleNet model focuses more on the interaction information between users and items during propagation, rather than fully exploring the structure of the entire knowledge graph. X. Wang et al. proposed the KGAT model in their paper "Knowledge Graph Attention Network for Recommendation," which combines a user-item bipartite graph, knowledge graph, and graph neural network to refine the representation of users, items, and entities. However, this type of model is highly complex, and user preference information is weakened when updating model parameters. In their paper "Exploring Multi-Dimension User-Item Interactions With Attentional Knowledge Graph Neural Networks for Recommendation," Z. Wang et al. proposed the MI-KGNN model, which introduces a dual attention mechanism based on users and neighbors to jointly control the propagation of information from neighboring nodes to the central node. While this model considers the impact of user factors on knowledge dissemination, it fails to fully utilize historical interaction information between users and projects to deeply explore users' potential preferences. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the existing technology and propose an intelligent recommendation method based on knowledge graphs. Based on the aggregation features of entities and the user's preference features, the predicted probability of a user clicking on an entity can be obtained, thereby realizing entity recommendation.
[0005] This invention provides an intelligent recommendation method based on knowledge graphs, characterized by the following steps:
[0006] Step 1) Use graph neural networks to aggregate the neighbor node information of each entity in order to mine the structural information of the knowledge graph as the basis for intelligent recommendation;
[0007] Step 2) Based on the graph neural network, a knowledge propagation attention mechanism based on multiple paths is introduced to aggregate the feature information of adjacent entities. On this basis, an attention mechanism oriented towards user preferences is introduced to control the influence weight of the central entity on user preferences according to the historical interaction between users and items, thereby representing the user's preference features.
[0008] Step 3) Based on the aggregation features of entities and the user's preference features, obtain the predicted probability of the user clicking on an entity to achieve entity recommendation.
[0009] Preferably, step 1) has the following specific steps:
[0010] Given a user set U = {u1, u2, ..., u...} m}, the item set I = {i1,i2,…,i n User-Project Part Two Diagram G ui Defined as:
[0011] G ui ={(u,y ui ,i)|u∈U,i∈I,y ui ∈Y};
[0012] Where y ui This indicates the historical interaction between the user and the project, specifically whether the user u's historical query information includes project i. If y ui =1, then user u's historical query information includes item i; if y ui =0, then user u's historical query information does not include item i;
[0013] For a knowledge graph KG = {(h,r,t)|h,t∈E,r∈R}, where the entity set E contains the item set I, i.e. The design goal of a knowledge graph recommendation system is to: given a user-item bipartite graph G ui With a knowledge graph (KG), the predicted probabilities of entities in the knowledge graph (KG) are fed back to the user.
[0014] For each triple in the knowledge graph, first initialize the embeddings of the head and tail entities as follows: Relationship embedding initialization Then, the TransR model is used to perform knowledge graph embedding learning, and its loss function is:
[0015]
[0016] in,[·] + =max{0,·}, where T and T′ represent the sets of positive and negative triplet samples, respectively, and γ1 (γ1>0) is a boundary hyperparameter;
[0017] For an entity h in a knowledge graph, let N(h) be the set of its neighbors. Information from the set N(h) can enrich the information of the central entity h in the knowledge graph. The calculation method for the propagation of information from neighboring entities N(h) to entity h is as follows:
[0018]
[0019] Where h represents the embedding of the central entity h, and t represents the embedding of the neighboring entity t of the central entity h. (l) Let P = {p} represent the embedding of the neighboring entity t at level l, and let P = {p} represent the embedding of the set of relationship paths between entities h and t, where p is represented as:
[0020] p=r1⊙e2⊙r3⊙… (3)
[0021] Where r1, e2, r3… represent the relationships and entity embeddings contained in the relationship path between entities h and t;
[0022] The function π(h,P,t) represents the knowledge propagation attention mechanism. For the central entity, it controls the weight of information propagation based on the information propagation contributions of neighboring entities, as specifically represented below:
[0023]
[0024] Where g(P,t) represents the information propagated from neighboring entities to the central entity, and its inner product with the embedding of the central entity h represents the weight that controls the information propagation based on the information propagation contribution of neighboring entities, where g(P,t) is:
[0025]
[0026]
[0027] in, b1 is the weight vector, and b1 is the bias.
[0028] In the process of knowledge dissemination, further enhance the interaction between the central entity and its neighboring entities:
[0029]
[0030] in, This indicates the propagation of knowledge from neighboring entities to the central entity h. All of these are trainable parameters.
[0031] Preferably, step 2) specifically involves the following steps:
[0032] Methods for calculating the degree of influence of the central entity on user preferences:
[0033]
[0034] Among them, I u The function represents the set of items that have historical interactions with user u. The influence weight of the central entity on user preferences can be controlled based on the historical interactions between users and projects, as well as the knowledge propagation from neighboring entities to the central entity, as shown below:
[0035]
[0036] in, b1 is the weight vector, and b2 is the bias.
[0037] According to equation (8), the user embedding u is compared with the vector. Perform aggregation:
[0038]
[0039] in These are trainable parameters;
[0040] Based on equations (7) and (10), multiple embedding representations of the central entity h are obtained. and multiple embedded representations of user u Concatenate the multiple embedding representations of the central entity h and user u into a single vector:
[0041]
[0042] Preferably, the specific steps of step 3) are as follows:
[0043] For e u and e h The inner product is calculated to obtain the predicted probability of the knowledge graph entity being fed back to the user.
[0044]
[0045] Optimize the model using Bayesian personalized ranking:
[0046]
[0047] Among them, Y + Represents user u and entity h + There is historical interaction, Y - Represents user u and entity h - There is no historical interaction, and σ(·) is the sigmoid function;
[0048] The overall loss function of the model consists of equations (1) and (13), as follows:
[0049]
[0050] in, Let E and R represent the model parameter set, where E and R represent the embedding representations of entities and relations in the maritime vessel activity knowledge graph KG, respectively, and λ1 and λ2 are regularization parameters.
[0051] Finally, the objective function L is calculated through backpropagation. total The gradient relative to the model parameter set Θ is then updated using the gradient descent algorithm. After the model is trained, the predicted probability of the user clicking on the knowledge graph entity is calculated according to Equation (12). The entities are ranked according to the probability and used as a list of recommended items to be recommended to the user.
[0052] This invention obtains the predicted probability of a user clicking on an entity based on the aggregation characteristics of the entity and the user's preference characteristics, thereby realizing entity recommendation. Attached Figure Description
[0053] Figure 1 This is a flowchart of the knowledge graph intelligent recommendation system provided by the present invention;
[0054] Figure 2 The figure shows the comparison results of the proposed model and the baseline model in the top-N recommendation experiment on the Movielens-1M dataset;
[0055] Figure 3 The figure shows the results of a comparative experiment between the proposed model and the baseline model on the Book-Crossing dataset for top-N recommendation.
[0056] Figure 4 The figure shows the ablation experiment results of the proposed model and the baseline model on the Movielens-1M dataset for top-N recommendation.
[0057] Figure 5The figure shows the ablation experiment results of the proposed model and the baseline model on the Book-Crossing dataset for top-N recommendation. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0059] This embodiment of an intelligent recommendation method based on knowledge graphs includes the following steps:
[0060] Step 1) Use graph neural networks to aggregate the neighbor node information of each entity in order to mine the structural information of the knowledge graph as the basis for intelligent recommendation;
[0061] Step 2) Based on the graph neural network, a knowledge propagation attention mechanism based on multiple paths is introduced to aggregate the feature information of adjacent entities. On this basis, an attention mechanism oriented towards user preferences is introduced to control the influence weight of the central entity on user preferences according to the historical interaction between users and items, thereby representing the user's preference features.
[0062] Step 3) Based on the aggregation features of entities and the user's preference features, obtain the predicted probability of the user clicking on an entity to achieve entity recommendation.
[0063] Step 1) uses a graph neural network to aggregate the neighbor node information of each entity. The specific steps are as follows:
[0064] Given a user set U = {u1, u2, ..., u...} m}, the item set I = {i1,i2,…,i n User-Project Part Two Diagram G ui Defined as:
[0065] G ui ={(u,y ui ,i)|u∈U,i∈I,y ui ∈Y};
[0066] Where y ui This indicates the historical interaction between the user and the project, specifically whether the user u's historical query information includes project i. If y ui =1, then user u's historical query information includes item i; if y ui =0, then user u's historical query information does not include item i;
[0067] For a knowledge graph KG = {(h,r,t)|h,t∈E,r∈R}, where the entity set E contains the item set I, i.e. The design goal of a knowledge graph recommendation system is to: given a user-item bipartite graph G ui With a knowledge graph (KG), the predicted probabilities of entities in the knowledge graph (KG) are fed back to the user.
[0068] For each triple in the knowledge graph, first initialize the embeddings of the head and tail entities as follows: Relationship embedding initialization Then, the TransR model is used to perform knowledge graph embedding learning, and its loss function is:
[0069]
[0070] in,[·] + =max{0,·}, where T and T′ represent the sets of positive and negative triplet samples, respectively, and γ1 (γ1>0) is a boundary hyperparameter;
[0071] However, knowledge graph embeddings only focus on individual knowledge triples and fail to capture higher-order similarities between entities. Furthermore, different users have varying degrees of preference for different entities, which cannot be represented by knowledge graph embedding models. To address this, we propose an attention mechanism based on knowledge aggregation and user preferences. The embedded representations of users and entities learned through this mechanism can predict the probability of entities responding to users.
[0072] For an entity h in a knowledge graph, considering its rich associations with other entities, we define the set of neighboring entities of entity h as N(h). Therefore, information from the entity set N(h) propagating to the central entity h can enrich its information in the knowledge graph. However, directly aggregating the feature information of neighboring entities cannot determine the information propagation contribution of each neighboring entity node. Therefore, we propose a multi-path-based knowledge propagation attention mechanism to aggregate the feature information of neighboring entities:
[0073]
[0074] Where h represents the embedding of the central entity h, and t represents the embedding of the neighboring entity t of the central entity h. (l) Let P = {p} represent the embedding of the neighboring entity t at level l, and let P = {p} represent the embedding of the set of relationship paths between entities h and t, where p can be represented as:
[0075] p=r1⊙e2⊙r3⊙… (3)
[0076] Where r1, e2, r3… represent the relationships and entity embeddings contained in the relationship path between entities h and t.
[0077] The function π(h,P,t) corresponds to the knowledge propagation attention mechanism mentioned above. For the central entity, the weight of information propagation can be controlled based on the information propagation contribution of neighboring entities. Specifically, it is represented as follows:
[0078]
[0079] Where g(P,t) represents the information propagated from neighboring entities to the central entity, and its inner product with the central entity h represents the weight for controlling information propagation based on the information propagation contribution of neighboring entities. g(P,t) is:
[0080]
[0081]
[0082] in, b1 is the weight vector, and b1 is the bias.
[0083] According to equation (3), knowledge transfer from neighboring entities to the central entity is completed. Furthermore, during the knowledge transfer process, we further enhance the interaction between the central entity and its neighboring entities:
[0084]
[0085] in, This indicates the propagation of knowledge from neighboring entities to the central entity h. All of these are trainable parameters.
[0086] Step 2 specifically includes the following steps:
[0087] Historical interactions between users and projects reveal potential user interests; however, knowledge propagation from neighboring entities to the central entity fails to capture the extent of the central entity's influence on user preferences. Therefore, a user preference-oriented attention mechanism is developed.
[0088]
[0089] Among them, I u The function represents the set of items that have historical interactions with user u. The influence weight of the central entity on user preferences can be controlled based on historical interactions between users and projects, as well as knowledge propagation from neighboring entities to the central entity. Specifically, it is represented as follows:
[0090]
[0091] in, b1 is the weight vector, and b2 is the bias.
[0092] Based on equation (8), the degree of influence of the central entity on user preferences is obtained by considering the knowledge propagation from neighboring entities to the central entity. Furthermore, we combine the user embedding u with the vector... Perform aggregation:
[0093]
[0094] in These are trainable parameters.
[0095] Based on equations (7) and (10), we obtain multiple embedding representations of the central entity h. and multiple embedded representations of user u Next, we concatenate the multiple embedding representations of the central entity h and user u into a single vector:
[0096]
[0097] The specific steps for step 3) are as follows:
[0098] For e u and e h The inner product is calculated to obtain the predicted probability of the knowledge graph entity being fed back to the user.
[0099]
[0100] Optimize the model using Bayesian personalized ranking:
[0101]
[0102] Among them, Y + Represents user u and entity h + There is historical interaction, Y - Represents user u and entity h - There is no historical interaction, and σ(·) is the sigmoid function.
[0103] The overall loss function of the model consists of equations (1) and (13), as follows:
[0104]
[0105] in, Let E and R represent the model parameter set, where E and R represent the embedding representations of entities and relations in the maritime vessel activity knowledge graph KG, respectively, and λ1 and λ2 are regularization parameters used to prevent overfitting.
[0106] Finally, the objective function L is calculated through backpropagation. total The gradient relative to the model parameter set Θ is then used to update the model parameter set Θ using the gradient descent algorithm. After the model training is completed, the predicted probability of the user clicking on the knowledge graph entity is calculated according to Equation (12), and the entities are ranked according to the probability to form a list of recommended items to be recommended to the user.
[0107] Example 2
[0108] To evaluate the effectiveness of Example 1, experiments were conducted using the datasets Movielens-1M and Book-Crossing. Specific data are as follows:
[0109] Movielens-1M: This dataset comes from records on the Movielens website and describes user ratings for various movies;
[0110] Book-Crossing: Includes ratings from 0 to 10 from the Book-Crossing community, as well as user and book attribute information.
[0111] The statistical data of the above dataset are shown in Table 1.
[0112] Table 1: Statistical data for the Movielens-1M and Book-Crossing datasets
[0113]
[0114] The proposed model was compared with existing models, RippleNet, KGAT, and MI-KGNN, on the general datasets Movielens-1M and Book-Crossing for top-N recommendation and click-through rate (CTR) prediction experiments. The evaluation metrics for the top-N recommendation experiments were Precision@N, Recall@N, and F1-score@N, where N = {1, 2, 5, 10, 20, 50}; the evaluation metric for the CTR prediction experiments was AUC (Area Under Curve).
[0115] Table 2: Comparison of CTR prediction results between the proposed model and the baseline model on the Movielens-1M and Book-Crossing datasets.
[0116]
[0117] Depend on Figure 2 , 3As shown in Table 2, the model proposed in Example 1 demonstrates the greatest performance improvement compared to the RippleNet model. For the Movielens-1M and Book-Crossing datasets, our model's AUC is improved by 15.9% and 15.5%, respectively. The RippleNet model focuses more on the interaction information between users and items during knowledge propagation, rather than fully exploring the structure of the entire knowledge graph. Because it cannot effectively connect different entities, it struggles to deeply mine users' potential preferences, resulting in poor performance in personalized recommendations. While the KGAT model shows some performance improvement compared to RippleNet, our model still outperforms it. For the Movielens-1M and Book-Crossing datasets, our model's AUC is improved by 9.6% and 9.0%, respectively. The KGAT model integrates the user-item bipartite graph and the knowledge graph, and uses a graph neural network to process the embedded representations of users, items, and entities. These models can comprehensively process historical user-item interaction information and knowledge graph structural information, but their high complexity weakens user preference information when updating model parameters, resulting in weaker personalized recommendation performance compared to our model. The MI-KGNN model is the best performing among the baseline models, but it still lags behind our model. For the Movielens-1M and Book-Crossing datasets, our model improves AUC by 3.4% and 4.7%, respectively. The MI-KGNN model introduces a dual attention mechanism based on users and neighbors, jointly controlling the propagation of information from neighbor nodes to the central node. While this model considers the impact of user factors on knowledge propagation, it fails to fully utilize historical interaction information between users and items to deeply mine users' potential preferences.
[0118] The model in Example 1 achieves state-of-the-art performance on both the Movielens-1M and Book-Crossing datasets. This is attributed to the introduction of a multi-path-based knowledge propagation attention mechanism, which aggregates feature information from adjacent entities. Building upon this, a user preference-oriented attention mechanism is introduced. This mechanism controls the influence weight of the central entity on user preferences based on historical interactions between users and items, thereby representing user preference features. This model overcomes the shortcomings of existing models, deeply mining historical user-item interaction information and the structural information of the knowledge graph. These are then used as user preference features and entity aggregation features, respectively, for personalized recommendations.
[0119] Furthermore, to focus on the contributions of attention mechanisms oriented towards knowledge dissemination and attention mechanisms oriented towards user preferences to the proposed model, the following ablation experiments were conducted:
[0120] (1) without knowledge propagation: Equations (2) and (7) are not executed, and the feature information of adjacent entities is not aggregated to the central entity. Only the original central entity embedding h is used, and the degree of influence e of the central entity on user preferences is calculated according to equations (8) and (10). u Ultimately through h and e u Obtain the predicted probability
[0121] (2) without user preference: Equations (8) and (10) are not executed, the influence of the central entity on user preference is not calculated, and the aggregation characteristics of the central entity are only calculated according to equations (2) and (7). Finally passed Obtain the predicted probability with h
[0122] Table 3: Ablation experiment results of the proposed model and the baseline model on the Movielens-1M and Book-Crossing datasets for CTR prediction.
[0123]
[0124] The results of the ablation experiment are as follows Figure 4 , 5 As shown in Table 3, when the model does not consider knowledge propagation, its performance decreases to varying degrees on both the Movielens-1M and Book-Crossing datasets, with AUC decreasing by 4.9% and 3.1%, respectively. Similarly, when the model does not consider user preferences, its performance decreases to varying degrees on both datasets, with AUC decreasing by 7.9% and 3.2%, respectively. The reason for the deterioration in recommendation performance when the model does not consider user preferences is that it only considers the direct interaction between users and items, making it difficult to uncover users' hidden preferences for item features. The reason for the deterioration in recommendation performance when the model does not consider knowledge propagation is that it only considers the direct attributes of items in the knowledge graph, and hidden features are not fully explored. Ablation experiments show that both the knowledge propagation-oriented attention mechanism and the user preference-oriented attention mechanism have significant effects on improving model performance. This further proves that these two attention mechanisms can deeply mine the structural information of the knowledge graph and the historical interaction information between users and items, and work together for efficient personalized recommendations.
Claims
1. A knowledge graph-based intelligent recommendation method, characterized in that... Includes the following steps: Step 1) Employ a graph neural network to aggregate the neighbor node information of each entity to mine the structural information of the knowledge graph, serving as the foundation for intelligent recommendation; Step 2) Introduce... A knowledge propagation attention mechanism based on multiple paths is used to aggregate the feature information of adjacent entities. On this basis, an attention mechanism oriented towards user preferences is introduced. According to the historical interaction between users and items, the influence weight of the central entity on user preferences is controlled, thereby representing the user's preference features. Step 3) Based on the aggregated features of entities and the user's preference features, the predicted probability of the user clicking on the entity is obtained to realize entity recommendation. The specific steps of step 1) are as follows: Given a set of users Project Collection User-Project Part Two Diagram Defined as: ; in This indicates the historical interactions between users and projects, i.e., users Does the historical query information include the project? ,like Then the user Historical query information includes projects ;like Then the user Historical query information does not include projects ; For knowledge graphs ,in, Entity Collection Includes a collection of projects ,Right now The design goal of a knowledge graph recommendation system is to: given a user-item bipartite graph... With knowledge graph Output knowledge graph The predicted probability of the entity in the data is fed back to the user. For each triple in the knowledge graph, first initialize the embeddings of the head and tail entities as follows: , Relationship embedding is initialized as Then, the TransR model is used to perform knowledge graph embedding learning, and its loss function is: (1) in, , and These represent the sets of positive and negative triplet samples, respectively. It is a boundary hyperparameter. ; For entities in a knowledge graph Set up entities The set of neighboring entities is Entity set Information is transmitted from the central entity. It can enrich its information in the knowledge graph, neighboring entities To entity Calculation methods for transmitting information: (2) in, Representing the central entity Embedded, Representing the central entity Neighboring entities Embedded, Representing neighboring entities In the Layer embedding, Representing entities and entity Relationship path set The embedding, its Represented as: (3) in, Representing entities and entity The relationships and entity embeddings contained in the relationship path; function For the knowledge dissemination attention mechanism, for the central entity, the weight of information dissemination is controlled according to the information dissemination contribution of neighboring entities, as specifically represented as follows: (4) in, This represents information propagated from neighboring entities to the central entity, and its relationship with the central entity. Taking the inner product of the embeddings represents the weighting of information propagation based on the contribution of neighboring entities to information propagation, where... for: (5) (6) in, For weight vectors, For bias; In the process of knowledge dissemination, further enhance the interaction between the central entity and its neighboring entities: (7) in, This indicates that neighboring entities are moving towards the central entity. knowledge dissemination, All of these are trainable parameters; The specific steps of step 2) are as follows: Methods for calculating the degree of influence of the central entity on user preferences: (8) in, Indicates to users A collection of items with historical interactions, functions Based on the historical interactions between users and projects, and the knowledge propagation from neighboring entities to the central entity, the influence weight of the central entity on user preferences is controlled, as shown below: (9) in, For weight vectors, For bias; According to equation (8), embed the user with vector Perform aggregation: (10) in , These are trainable parameters; Based on equations (7) and (10), the central entity is obtained. Multiple embedding representations and users Multiple embedding representations , will the central entity and users Multiple embeddings are concatenated into a single vector: (11); The specific steps of step 3) are as follows: right and The inner product is calculated to obtain the predicted probability of the knowledge graph entity being fed back to the user. : (12) Optimize the model using Bayesian personalized ranking: (13) in, Indicates user With entity There is historical interaction. Indicates user With entity There is no historical interaction. It is the sigmoid function; The overall loss function of the model consists of equations (1) and (13), as follows: (14) in, Represents the model parameter set, , These represent the knowledge graphs of maritime vessel activities. Embedded representation of entities and relations in Chinese and For regularization parameters; Finally, the objective function is calculated through backpropagation. Relative to the model parameter set The gradient is calculated, and then the model parameter set is updated using the gradient descent algorithm. After the model is trained, the predicted probability of the user clicking on the knowledge graph entity is calculated according to Equation (12), and the entities are ranked according to the probability to serve as a list of recommended items to the user.