A knowledge graph recommendation method and system based on latent factors

By performing bidirectional connections and information completion on the knowledge graph, combined with attention mechanisms and BPR LOSS training, the problem of insufficient information utilization in existing recommendation systems is solved, achieving higher robustness and accuracy.

CN115687658BActive Publication Date: 2025-12-02XIAMEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211479320.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2025-12-02
Estimated Expiration
2042-11-24

AI Technical Summary

Technical Problem

Existing knowledge graph-based recommendation systems struggle to fully utilize the potential interaction information between users and items, resulting in insufficient model robustness and accuracy.

Method used

By performing bidirectional connections on entities in the knowledge graph, supplementing latent relationships and head entities, updating entity vector representations using an attention mechanism based on latent aggregation relationships, and combining negative sampling from interactive data with BPR LOSS training models, information completion is achieved.

Benefits of technology

This improves the robustness and accuracy of the recommendation system, enabling each node to fully utilize complete information, including knowledge graphs and latent data, thereby enhancing the model's predictive capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115687658B_ABST
    Figure CN115687658B_ABST
Patent Text Reader

Abstract

This invention provides a knowledge graph recommendation method based on latent factors. By supplementing the knowledge graph with latent relation aggregates of tail entities and latent head entity aggregates, it enables a comprehensive representation of data that actually exists but is not included in the knowledge graph. After the information is supplemented, each node in the knowledge graph can fully utilize complete information, including both the data already in the knowledge graph and other potential data. A relation-based attention mechanism is used in the calculation of entity vector representations, allowing each entity to be assigned different attention weights to different relations, thus improving the accuracy of the model's predictions. By supplementing the user data with latent item aggregates, each user can utilize not only the data stored in the interaction data but also information about other items that the user may have interacted with, resulting in better robustness and accuracy for the entire recommendation system model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent recommendation, and in particular to a knowledge graph recommendation method and system based on latent factors. Background Technology

[0002] In real life, user interaction data is very sparse. For example, a user may have watched a very small percentage of the total number of movies in their lifetime. Therefore, knowledge graph data related to items can be used to solve the cold start problem of insufficient interaction data and the risk of overfitting in the model.

[0003] There are currently three main approaches to knowledge graph-based recommendation systems:

[0004] 1. Knowledge Representation-Based Methods: Knowledge representation methods mainly involve learning the vector representation of the entity for each triple and integrating the learned entity vectors into the recommendation system. These knowledge representation methods primarily include translation-based models.

[0005] 2. Path-based methods: Path-based recommendation models require manually designing meta-paths between two entities. Each pair of entities can include multiple meta-paths, each representing a potential recommendation path from one entity to another. Each meta-path is trained with different weights based on the model. A drawback of path-based recommendation is the need for manual design of meta-paths. In knowledge graphs, the paths between each pair of entities can be extremely complex and diverse, making manual design unsuitable for complex knowledge graphs.

[0006] 3. Graph Neural Network-Based Approaches: The first two methods struggle to capture high-order and topological information within knowledge graphs. Graph neural network-based approaches address these issues, making fuller use of the information within the knowledge graph. These approaches propagate information within the knowledge graph to obtain vectors for each entity. These entity vectors incorporate multi-hop information from the knowledge graph and are ultimately integrated into the recommendation system.

[0007] In the process of these graph neural networks representing nodes, only the explicit data already provided in the knowledge graph and the interaction data are used. That is, only explicit information is used during model training. However, each knowledge graph data or interaction data is only a part of the complete information. For example, each user may like other items, but this liked item data is not included in the interaction data. Similarly, each tail entity in the knowledge graph may have other aggregation relationships, and the corresponding head entity data is not included in the knowledge graph data. Traditional models do not provide methods for handling other potential data that is not included in the dataset. Summary of the Invention

[0008] The main objective of this invention is to overcome the aforementioned deficiencies in the prior art and propose a knowledge graph recommendation method based on latent factors. By supplementing the information of each entity and user sample data, each node in the knowledge graph can fully utilize complete information, including both the data in the knowledge graph and other potential data. Each user can not only utilize the data stored in the interaction data, but also the information of other items that the user may interact with, thereby giving the entire recommendation system model better robustness and accuracy.

[0009] The present invention adopts the following technical solution:

[0010] One embodiment of the present invention provides a knowledge graph recommendation method based on latent factors, including:

[0011] Add inverse relations corresponding to entity pairs in the knowledge graph to achieve bidirectional connections between entity pairs; for interactive data, negative sampling is performed on user sample data;

[0012] For tail entities in the knowledge graph, randomly initialized potential aggregation relations and corresponding randomly initialized potential aggregation head entities are added to form complete triplet data; potential item aggregates of user sample data are randomly initialized in the interaction data.

[0013] An attention mechanism based on latent aggregation relations is used to update the vector representation of the tail entity; the inner product of the tail entity and each corresponding latent aggregation relation is taken to obtain the attention score of the latent aggregation relation; then the average aggregation of the multiple head entities corresponding to each latent aggregation relation is performed to obtain the average aggregate of the head entities; the aggregate of the head entities and the attention scores of the corresponding latent aggregation relations are weighted and summed to obtain the updated entity vector representation of the tail entity.

[0014] The item vector representations and potential item aggregate vector representations in the interaction data are averaged and aggregated to obtain the aggregate vector representation representing the user.

[0015] Model training is performed using BPR LOSS; for the entity vector representation of each user's positive and negative samples, as well as the user's aggregate vector representation, a regularized BPR LOSS is calculated, and the model is trained using gradient descent based on this BPRLOSS value.

[0016] Another embodiment of the present invention provides a knowledge graph recommendation system based on latent factors, comprising:

[0017] Preprocessing unit: Adds inverse relations to entity pairs in the knowledge graph to achieve bidirectional connections between entity pairs; for interactive data, negative samples are performed on user sample data;

[0018] Construction Unit: For tail entities in the knowledge graph, supplement them with randomly initialized potential aggregation relations and corresponding randomly initialized potential aggregation head entities to form complete triplet data; in the interaction data, randomly initialize and construct potential item aggregates of user sample data;

[0019] Entity vector representation calculation unit: The vector representation of the tail entity is updated using an attention mechanism based on latent aggregation relations; the inner product of the tail entity and each corresponding latent aggregation relation is performed to obtain the attention score of the latent aggregation relation; then, the average aggregation of the multiple head entities corresponding to each latent aggregation relation is performed to obtain the average aggregate of the head entities; the aggregate of the head entities and the attention scores of the corresponding latent aggregation relations are weighted and summed to obtain the updated entity vector representation of the tail entity.

[0020] User aggregate vector representation calculation unit: It averages and aggregates the item vector representations and potential item aggregate vector representations in the interaction data to obtain the aggregate vector representation representing the user;

[0021] Model training unit: Model training is performed using BPR LOSS; For the entity vector representation of each user's positive and negative samples, as well as the aggregate vector representation of the user, a regularized BPR LOSS is calculated, and the model is trained using gradient descent based on this BPRLOSS value.

[0022] In another aspect, the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the knowledge graph recommendation method based on latent factors.

[0023] In another aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the knowledge graph recommendation method based on latent factors.

[0024] As can be seen from the above description of the present invention, compared with the prior art, the present invention has the following beneficial effects:

[0025] This invention provides a knowledge graph recommendation method based on latent factors. By supplementing the knowledge graph with latent relation aggregates of tail entities and latent head entity aggregates, it enables a comprehensive representation of data that actually exists but is not included in the knowledge graph. After the information is supplemented, each node in the knowledge graph can fully utilize complete information, including both the data already in the knowledge graph and other potential data. A relation-based attention mechanism is used in the calculation of entity vector representations, allowing each entity to assign different attention weights to different relations, rather than simply treating all relations indiscriminately, thus resulting in more accurate model predictions. By supplementing the user data with latent item aggregates, each user can utilize not only the data stored in the interaction data but also information about other items that the user potentially interacts with, giving the entire recommendation system model better robustness and accuracy. Attached Figure Description

[0026] Figure 1 A knowledge graph recommendation process framework diagram based on latent factors is provided in this embodiment of the invention;

[0027] Figure 2 A schematic diagram illustrating a specific example of supplementing potential aggregation factors to tail entities according to an embodiment of the present invention;

[0028] Figure 3 A schematic diagram illustrating a computational example of entity vector representation based on a relation-based attention mechanism provided in an embodiment of the present invention;

[0029] Figure 4 A schematic diagram illustrating a computational example of user aggregation vector representation based on potential aggregates provided in an embodiment of the present invention;

[0030] Figure 5 This invention provides an architecture diagram of a knowledge graph recommendation system based on latent factors.

[0031] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present invention;

[0032] Figure 7 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this invention.

[0033] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Detailed Implementation

[0034] This invention proposes a knowledge graph recommendation method based on latent factors. By supplementing the information of each entity and user sample data, each node in the knowledge graph can make full use of complete information, including both the data in the knowledge graph and other potential data. Each user can not only use the data stored in the interaction data, but also the information of other items that the user may interact with. As a result, the entire recommendation system model has better robustness and accuracy.

[0035] like Figure 1 The following is a framework diagram of a knowledge graph recommendation process based on latent factors provided in this embodiment of the invention: First, the knowledge graph undergoes preprocessing with bidirectional connectivity expansion. Then, a latent relation aggregate and a head entity aggregate are constructed, and entity vector representations are calculated. Simultaneously, interaction data undergoes negative sampling preprocessing. Next, a latent item aggregate is constructed, and user vector representations are calculated. Based on the entity vector representations and user vector representations, a BPR LOSS training model is calculated. Specifically, this includes:

[0036] S101: Add inverse relations corresponding to entity pairs in the knowledge graph to achieve bidirectional connections between entity pairs; for interactive data, negative sample data of users is performed.

[0037] In a knowledge graph, there might be a relationship between a pair of entities, meaning a unidirectional connection exists between them. The preprocessing stage adds an inverse relationship to this pair, making it a bidirectional connection. For interaction data, only items liked by each user are included, not items disliked or hated. Therefore, the preprocessing stage requires negative sampling, sampling items disliked by each user.

[0038] S102: For tail entities in the knowledge graph, supplement them with randomly initialized potential aggregation relations and corresponding randomly initialized potential aggregation head entities to form complete triplet data; randomly initialize and construct potential item aggregates of user sample data in the interaction data.

[0039] For each tail entity in the knowledge graph, a randomly initialized potential aggregate relation is added, representing the aggregate of all relations for that tail entity that are not included in the knowledge graph but actually exist. A corresponding randomly initialized potential aggregate head entity is also added. For example... Figure 2As shown, the box represents knowledge graph data. The knowledge graph includes the director and lead actor of movie A, but does not include the screenwriter of movie A. However, movie A does have a screenwriter, but it is not included in the knowledge graph data. Therefore, a potential aggregation relation can be constructed, which includes the screenwriter and other relationships that actually exist but are not included in the knowledge graph. At the same time, a potential aggregation head entity is added to form a complete triple data.

[0040] After processing the knowledge graph data to obtain the entity embeddings, we can then calculate the user embeddings in the interaction data. The interaction data displays items the user likes, but there are many other items the user likes that are not included in the interaction data. Therefore, we can randomly initialize and construct a potential item aggregate that represents a comprehensive representation of all items the user likes but are not included in the interaction data.

[0041] S103: The vector representation of the tail entity is updated using an attention mechanism based on potential aggregation relations; the inner product of the tail entity and each corresponding potential aggregation relation is taken to obtain the attention score of the potential aggregation relation; then the average aggregation of the multiple head entities corresponding to each potential aggregation relation is performed to obtain the average aggregate of the head entities; the aggregate of the head entities and the attention scores of the corresponding potential aggregation relations are weighted and summed to obtain the updated entity vector representation of the tail entity.

[0042] After supplementing each tail entity with two latent factors, a relation-based attention mechanism is needed to update the vector representation of that tail entity. First, the inner product of the tail entity and its corresponding relation is calculated to obtain the attention score for that relation. Then, the average aggregation of the head entities corresponding to each relation is performed to obtain the average aggregate of head entities. Finally, the aggregate of head entities and their corresponding relation scores are weighted and summed to obtain the updated vector representation of the tail entity. Figure 2As shown, the actor score is obtained by taking the inner product of the initial embedding of movie A and the "starred" relation, the director score is obtained by taking the inner product of the "directed" relation, and the potential entity score is obtained by taking the inner product of the "potential aggregation relation". Since actor A and actor B starred in movie A, the embeddings of these two actors are averaged and aggregated to obtain the actor aggregate, and so on to obtain the director aggregate. Since the potential entity is already an aggregate, no further aggregation is needed. The aggregate embedding of each head entity is multiplied by the corresponding relation score and summed to obtain the updated 1-hop embedding of movie A. This process can be repeated n times to obtain the n-hop embedding of movie A; a specific diagram is shown below. Figure 3 As shown.

[0043] S104: The item vector representations and potential item aggregate vector representations in the interaction data are averaged and aggregated to obtain the aggregate vector representation of the user;

[0044] For items liked by a user and included in the interaction data center, the corresponding processed embedding can be retrieved from the knowledge graph data. An average aggregation is then performed using the item embeddings included in the interaction data and the potential item aggregate embeddings to obtain the aggregated embedding representing the user. For example... Figure 4 As shown, it includes interaction data and knowledge graph data.

[0045] S105: Use BPR LOSS for model training; For the entity vector representation of each user's positive and negative samples, as well as the aggregate vector representation of the user, perform regularized BPR LOSS calculation, and use this BPRLOSS value to train the model using gradient descent.

[0046] For each user, there are positive and negative samples, i.e., items they like and items they dislike. The user's embedding and the corresponding positive and negative sample embeddings are extracted, and regularized BPR LOSS calculation is performed. The model is trained using gradient descent based on this LOSS value.

[0047] like Figure 5 Another embodiment of the present invention provides a knowledge graph recommendation system based on latent factors, comprising:

[0048] Preprocessing unit 501: Adds inverse relations corresponding to entity pairs in the knowledge graph to achieve bidirectional connections between entity pairs; for interactive data, negative samples are performed on user sample data;

[0049] Construction Unit 502: For the tail entities in the knowledge graph, supplement them with randomly initialized potential aggregation relations and corresponding randomly initialized potential aggregation head entities to form complete triplet data; randomly initialize and construct potential item aggregates of user sample data in the interaction data;

[0050] Entity vector representation calculation unit 503: It uses an attention mechanism based on latent aggregation relations to update the vector representation of the tail entity; it performs an inner product of the tail entity and each corresponding latent aggregation relation to obtain the attention score of the latent aggregation relation; it then performs average aggregation on the multiple head entities corresponding to each latent aggregation relation to obtain the average aggregate of the head entities; it then performs a weighted summation of the aggregate of the head entities and the attention scores of the corresponding latent aggregation relations to obtain the updated entity vector representation of the tail entity.

[0051] User aggregate vector expression calculation unit 504: It averages and aggregates the item vector expression and the potential item aggregate vector expression in the interaction data to obtain the aggregate vector expression representing the user;

[0052] Model training unit 505: Uses BPR LOSS for model training; For the entity vector representation of each user's positive and negative samples, as well as the aggregate vector representation of the user, performs regularized BPR LOSS calculation, and performs model gradient descent training based on this BPRLOSS value.

[0053] Figure 6 As shown, this embodiment of the invention provides an electronic device 600, including a memory 610, a processor 620, and a computer program 611 stored in the memory 620 and executable on the processor 620. When the processor 620 executes the computer program 611, it implements a knowledge graph recommendation method based on potential factors provided in this embodiment of the invention.

[0054] Since the electronic device described in this embodiment is the device used to implement the embodiments of the present invention, those skilled in the art can understand the specific implementation methods and various variations of the electronic device in this embodiment based on the methods described in the embodiments of the present invention. Therefore, how the electronic device implements the methods in the embodiments of the present invention will not be described in detail here. Any device used by those skilled in the art to implement the methods in the embodiments of the present invention is within the scope of protection of the present invention.

[0055] Please see Figure 7 , Figure 7 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this invention.

[0056] like Figure 7As shown, this embodiment provides a computer-readable storage medium 700, on which a computer program 711 is stored. When the computer program 711 is executed by a processor, it implements a knowledge graph recommendation method based on latent factors provided in this embodiment of the invention.

[0057] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0058] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0059] This invention provides a knowledge graph recommendation method based on latent factors. By supplementing the knowledge graph with latent relation aggregates of tail entities and latent head entity aggregates, it enables a comprehensive representation of data that actually exists but is not included in the knowledge graph. After the information is supplemented, each node in the knowledge graph can fully utilize complete information, including both the data already in the knowledge graph and other potential data. A relation-based attention mechanism is used in the calculation of entity vector representations, allowing each entity to assign different attention weights to different relations, rather than simply treating all relations indiscriminately, thus resulting in more accurate model predictions. By supplementing the user data with latent item aggregates, each user can utilize not only the data stored in the interaction data but also information about other items that the user potentially interacts with, giving the entire recommendation system model better robustness and accuracy.

[0060] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The above descriptions are merely specific embodiments of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

[0061] The above are merely specific embodiments of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial modifications made to the present invention using this concept shall be considered as infringing upon the protection scope of the present invention.

Claims

1. A knowledge graph recommendation method based on latent factors, characterized in that, include: Add inverse relations corresponding to entity pairs in the knowledge graph to achieve bidirectional connections between entity pairs; for interactive data, negative sampling is performed on user sample data; For tail entities in the knowledge graph, randomly initialized potential aggregation relations and corresponding randomly initialized potential aggregation head entities are added to form complete triplet data; potential item aggregates of user sample data are randomly initialized in the interaction data. An attention mechanism based on latent aggregation relations is used to update the vector representation of the tail entity; the inner product of the tail entity and each corresponding latent aggregation relation is taken to obtain the attention score of the latent aggregation relation. Then, the average aggregation of the head entities corresponding to each potential aggregation relation is performed to obtain the average aggregate of the head entities; the aggregate of the head entities and the attention scores of the corresponding potential aggregation relations are weighted and summed to obtain the updated entity vector representation of the tail entities. The item vector representations and potential item aggregate vector representations in the interaction data are averaged and aggregated to obtain the aggregate vector representation representing the user. Model training is performed using BPR LOSS; for the entity vector representation of each user's positive and negative samples, as well as the user's aggregate vector representation, a regularized BPR LOSS is calculated, and the model is trained using gradient descent based on this BPRLOSS value.

2. A knowledge graph recommendation system based on latent factors, characterized in that, include: Preprocessing unit: Adds inverse relations corresponding to entity pairs in the knowledge graph to achieve bidirectional connections between entity pairs; For interactive data, negative sampling is performed on the user's sample data; Construction Unit: For tail entities in the knowledge graph, supplement them with randomly initialized potential aggregation relations and corresponding randomly initialized potential aggregation head entities to form complete triplet data; in the interaction data, randomly initialize and construct potential item aggregates of user sample data; Entity vector representation computation unit: The vector representation of the tail entity is updated using an attention mechanism based on latent aggregation relations; the inner product of the tail entity and each corresponding latent aggregation relation is performed to obtain the attention score of the latent aggregation relation; Then, the average aggregation of the head entities corresponding to each potential aggregation relation is performed to obtain the average aggregate of the head entities; the aggregate of the head entities and the attention scores of the corresponding potential aggregation relations are weighted and summed to obtain the updated entity vector representation of the tail entities. User aggregate vector representation calculation unit: It averages and aggregates the item vector representations and potential item aggregate vector representations in the interaction data to obtain the aggregate vector representation representing the user; Model training unit: Model training is performed using BPR LOSS; For the entity vector representation of each user's positive and negative samples, as well as the aggregate vector representation of the user, a regularized BPR LOSS is calculated, and the model is trained using gradient descent based on this BPRLOSS value.

3. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method of claim 1.

4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in claim 1.

Citation Information

Patent Citations

  • Online shopping mall commodity recommendation method based on knowledge graph

    CN111507796A

  • Personalized recommendation method based on collaborative knowledge graph

    CN112149004A