Knowledge graph-based content recommendation method, system and equipment and storage medium
By using the content recommendation method based on the knowledge map, the use of goods and user behavior data to generate knowledge map and heterogeneous information network, solve the problem of poor effects when the existing recommendation methods are in data sparse and cold start, and realize more accurate and personalized. Recommended effect.
Patent Information
- Application Number
- CN202411285026.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-28
AI Technical Summary
The existing recommended methods have poor recommendation effects when facing data sparsity, cold start problems, and insufficient utilization of domain knowledge.
Adopt the content recommendation method based on the knowledge map, by obtaining the classification, attributes, brand information and relationships of the product, generate the knowledge map, and combine user behavior data to build a heterogeneous information network, obtain the model embedded vector through graphic convolution and embedded model, and train training to train to train to train to train to train to train to train to train to train to train to train. Recommended models and real -time optimization to improve the recommendation effect.
Effectively improve the accuracy and personalization of content recommendation, solve the problem of cold start and data sparse, and provide users with a better experience.
Smart Images

Figure CN119377471A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of content recommendation, and in particular to a content recommendation method, system, device and storage medium based on a knowledge graph. Background Art
[0002] With the development of information technology and the popularization of the Internet, recommendation systems have been widely used in various industries. Existing recommendation methods mainly rely on users' historical behavior data, usually using collaborative filtering, content-based recommendation and other methods. However, these methods often show poor recommendation effects when faced with data sparsity, cold start problems and insufficient use of domain knowledge. Summary of the invention
[0003] In order to address the deficiencies in the prior art, the present application provides a content recommendation method, system, device and storage medium based on a knowledge graph, which are used to solve the technical problem that the existing recommendation methods exhibit poor recommendation effects when faced with data sparsity, cold start problems and insufficient utilization of domain knowledge.
[0004] In view of this, the first aspect of the present application provides a content recommendation method based on a knowledge graph, comprising: Acquiring first data and user behavior data; Generate a knowledge graph based on the first data; Obtaining a model embedding vector according to the user behavior data and the knowledge graph; Using the model embedding vector for training to obtain a recommendation model; collecting the first data and the user behavior data in real time, and continuously optimizing the recommendation model according to the first data and the user behavior data collected in real time; Generating recommendation results for users according to the recommendation model; in, The first data includes commodity classification, commodity attributes, commodity brand information and the relationship between commodities; the relationship between commodities includes the appearance of commodities, functional similarity relationship and functional substitution relationship of commodities.
[0005] Furthermore, obtaining a model embedding vector according to the user behavior data and the knowledge graph includes: Constructing a heterogeneous information network based on the user behavior data and the knowledge graph; Obtaining a first embedding vector corresponding to each node in the heterogeneous information network through a graph convolution operation; The knowledge graph is operated by an embedding model to obtain a knowledge graph embedding vector; The first embedding vector and the knowledge graph embedding vector are fused to obtain the model embedding vector.
[0006] Furthermore, constructing a heterogeneous information network based on the user behavior data and the knowledge graph includes: Extracting entities related to the user behavior data and relationships related to the user behavior data from the knowledge graph; Preprocessing the extracted entities and relations; The heterogeneous information network is constructed by taking the entities as nodes and the relationships as edges.
[0007] Furthermore, the preprocessing of the extracted entities and relationships includes removing redundant information and eliminating noise data.
[0008] Furthermore, obtaining a first embedding vector corresponding to each node in the heterogeneous information network through a graph convolution operation includes: Initializing an initial embedding vector for each of the nodes; According to the initial embedding vector, the first embedding vector of each node is obtained by aggregating neighbor embedding vectors.
[0009] Furthermore, obtaining a first embedding vector of each node by aggregating neighbor embedding vectors according to the initial embedding vector includes: Determine a set of neighbor nodes of each node; For each node, initial embedding vectors of its neighboring nodes are aggregated to obtain the first embedding vector of each node.
[0010] Furthermore, the fusing of the first embedding vector and the knowledge graph embedding vector to obtain a model embedding vector includes: using an attention mechanism to connect the first embedding vector and the knowledge graph embedding vector corresponding to the first embedding vector through a weighted fusion method to obtain the model embedding vector.
[0011] Furthermore, the real-time collection of the first data and the user behavior data, and continuous optimization of the recommendation model according to the real-time collected first data and the user behavior data, include: According to the first data and the user behavior data collected in real time, evaluating the recommendation effect of the recommendation model using an evaluation index to obtain an evaluation result; The recommendation model is optimized according to the evaluation result.
[0012] The second aspect of the present application provides a content recommendation system based on a knowledge graph, comprising: An acquisition unit, used to acquire first data and user behavior data; A graph unit, used for generating a knowledge graph according to the first data; A vector unit, used to obtain a model embedding vector according to the user behavior data and the knowledge graph; A training unit, used for training using the model embedding vector to obtain a recommendation model; an optimization unit, configured to collect the first data and the user behavior data in real time, and continuously optimize the recommendation model according to the first data and the user behavior data collected in real time; and a recommendation unit, which is used to generate recommendation results for users according to the recommendation model.
[0013] A third aspect of the present application provides a content recommendation device based on a knowledge graph, the device comprising a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the content recommendation method based on the knowledge graph as described in any one of the first aspects above according to the instructions in the program code.
[0014] In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the content recommendation method based on the knowledge graph described in any one of the first aspects is implemented.
[0015] The knowledge graph-based content recommendation method, system, device and storage medium provided in the present application can effectively utilize existing information and obtain a knowledge graph based on the existing information. When faced with cold start or data sparsity problems, content recommendation can be performed based on the obtained knowledge graph, thereby improving the accuracy and personalization of content recommended to users. At the same time, the recommendation model can be continuously updated and optimized to provide users with a better experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0017] Figure 1 It is a flowchart of a content recommendation method based on knowledge graph provided in an embodiment of the present application; Figure 2It is a content recommendation system based on knowledge graph provided for the embodiment of the present application; Figure 3 A content recommendation device based on a knowledge graph is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0019] For easier understanding, see Figure 1 , the present application provides a content recommendation method based on knowledge graph, including: S100: Acquire first data and user behavior data.
[0020] It should be noted that in the embodiments of the present application, the first data and user behavior data can be collected from multiple data sources. The first data can be obtained by collecting the existing classification of goods, the attributes of goods, the brand information of goods, and the relationship between goods, and the relationship between goods includes the functional similarity relationship of goods and the functional substitution relationship of goods; the user behavior data includes the user's browsing history, click history, purchase history, product ratings, preference settings and project information, etc. In the cold start training stage or when the data is sparse, the user behavior data can be simulated according to certain rules.
[0021] S200. Generate a knowledge graph based on the first data.
[0022] A knowledge graph is a graph structure that contains entities (such as products, companies, users, etc.) and their relationships. To generate this graph, semantic analysis and entity recognition are first performed based on the first data to extract meaningful entities and relationships. Then, these entities and relationships are drawn into a graph through entity linking and relationship reasoning techniques. The generation of a knowledge graph can be achieved by using existing graph database tools (such as Neo4j) or custom graph storage solutions.
[0023] S300: Obtain a model embedding vector based on the user behavior data and the knowledge graph.
[0024] Specifically, step S300 obtains a model embedding vector according to the user behavior data and the knowledge graph, including: S310: construct a heterogeneous information network based on the user behavior data and the knowledge graph.
[0025] In some embodiments, step S310 constructs a heterogeneous information network based on the user behavior data and the knowledge graph, including: S311, extracting entities related to user behavior data and relationships related to user behavior data from the knowledge graph; S312, preprocessing the extracted entities and relations; S313. Use entities as nodes and relationships as edges to construct a heterogeneous information network.
[0026] After the knowledge graph is generated, the model embedding vector is obtained based on the user behavior data and the knowledge graph. Specifically, the recommendation method of the present application first constructs a heterogeneous information network (HIN) based on the user behavior data and the knowledge graph. The heterogeneous information network is a graph model containing multiple types of nodes and multiple types of edges, which can better represent complex relationships in the real world. The nodes in the heterogeneous information network represent entities, and the edges represent the relationships between them. In the recommendation method of the present application, nodes can represent users, projects, etc., and edges can represent users' ratings of projects, browsing behaviors, or relationships between entities.
[0027] Before building a heterogeneous information network, entities and relationships related to user behavior data are extracted from the knowledge graph and preprocessed. In order to facilitate the construction of a heterogeneous information network and obtain more accurate data information, the preprocessing of the extracted entities and relationships includes removing redundant information and eliminating noise data.
[0028] S320, obtaining a first embedding vector corresponding to each node in the heterogeneous information network through a graph convolution operation; After completing the construction of the heterogeneous information network, the heterogeneous information network in this application is operated through the star graph convolutional network (Star-GCN) to obtain the first embedding vector of each node. Specifically, the star graph convolutional network is a convolutional neural network designed specifically for heterogeneous graph structures. Its core idea is to use the star neighborhood to perform convolution operations on nodes in the local structure of the graph. Through this process, the complex relationship between the node and its neighbors can be captured.
[0029] In some embodiments, step S320 obtains a first embedding vector corresponding to each node in the heterogeneous information network through a graph convolution operation, including: S321, initializing an initial embedding vector for each node; S322: According to the initial embedding vector, obtain a first embedding vector for each node by aggregating neighbor embedding vectors.
[0030] Specifically, to obtain the first embedding vector corresponding to a node in a heterogeneous information network, it is first necessary to initialize an initial embedding vector for each node; then, determine the set of neighbor nodes of each node, and aggregate the initial embedding vectors of its neighbor nodes for each node to obtain the first embedding vector of each node.
[0031] In some embodiments, the above aggregation process is completed through a learnable weight matrix W and a nonlinear activation function σ, and an attention mechanism is used to assign weights to the information of neighbor nodes so that the recommendation method of the present application can focus on more important information.
[0032]
[0033] in, is the node i in The initial embedding vector of the layer; N(i) is the set of neighbors of node i; is the attention coefficient, which indicates the importance of node j to node i; It is The weight matrix of the layer, is the initial embedding vector of node j at layer l.
[0034] S330, operating the knowledge graph through an embedding model to obtain a knowledge graph embedding vector; In order to further improve the expressiveness of the model, the recommended method of this application also uses an embedding model to generate a knowledge graph embedding vector. Specifically, an embedding model such as TransE, KG2E, ConvE or RotatE can be used to operate the knowledge graph to obtain a knowledge graph embedding vector.
[0035] S340: Fuse the first embedding vector and the knowledge graph embedding vector to obtain a model embedding vector.
[0036] Specifically, the attention mechanism is used to connect the first embedding vectors with their knowledge graph embedding vectors through a weighted fusion method.
[0037] The formula can be expressed as:
[0038] in represents the attention coefficient from node j to node i, a is the parameter vector in the attention mechanism, W is the weight matrix, || represents the vector connection operation, and k represents any node in the set of neighbor nodes of node i, including node i itself. In graph convolutional networks, neighbor nodes refer to nodes that are directly connected to the target node i.
[0039] S400: Utilize the model embedding vector for training to obtain a recommendation model.
[0040] After obtaining the model embedding vectors, the recommendation method of this application uses these vectors to train the recommendation model. During the training process, deep learning-based recommendation algorithms such as matrix decomposition, deep neural network (DNN), etc. can be used, and the model can be optimized by using loss functions such as mean square error (MSE) and cross entropy. The algorithm is optimized by methods such as gradient descent, and the model parameters are continuously adjusted and the loss function is minimized, thereby reducing the prediction error on historical data and improving the accuracy of the recommendation results.
[0041] S500: Collect the first data and the user behavior data in real time, and continuously optimize the recommendation model according to the first data and the user behavior data collected in real time.
[0042] Specifically, the above steps may include evaluating the recommendation effect of the recommendation model using evaluation indicators based on the first data and the user behavior data collected in real time to obtain an evaluation result; and optimizing the recommendation model based on the evaluation result.
[0043] In order to ensure the timeliness and accuracy of the recommendation results, the recommendation method of the present application can continuously collect and update the first data and user behavior data, and continuously optimize the recommendation model based on these data. The optimization process first evaluates the performance of the current model through new data obtained in real time, and uses indicators such as accuracy, recall rate, and F1 score to fully reflect the performance of the recommendation model. The recommendation effect of the recommendation model is analyzed in detail based on these evaluation indicators to identify the shortcomings of the model.
[0044] Based on the evaluation results, the model's hyperparameters (including learning rate, number of graph convolution layers, parameters of the attention mechanism, etc.) can be adjusted to improve the model's prediction performance. In the process of hyperparameter adjustment, techniques such as grid search or random search can be used to find the best hyperparameter combination to improve the recommendation effect of the recommendation model.
[0045] In addition, based on the evaluation results, the model can also be structurally adjusted, such as modifying the number of neural network layers or the number of nodes in each layer, to enhance the model's expressiveness. At the same time, the loss function can be further improved, such as introducing a weighted loss function or a custom loss function, to better adapt to specific recommendation scenarios. Regularization techniques such as L1 / L2 regularization or Dropout can also be introduced to reduce overfitting of the model and improve generalization capabilities.
[0046] In addition, some optimization steps may be performed in an automated manner, such as using automatic machine learning (AutoML) technology to automatically adjust hyperparameters and model structures, or even using intelligent algorithms such as reinforcement learning to achieve self-improvement to ensure that the recommendation effect is continuously optimized.
[0047] S600: Generate recommendation results for the user according to the recommendation model.
[0048] The continuously optimized recommendation model will be used to generate personalized recommendation results for users. The content recommendation method of the knowledge graph of this application recommends the most relevant content to users by calculating the model embedding vector and training and optimizing the recommendation model. These recommendation results can be presented in various forms, such as product recommendation lists, personalized advertising push and news recommendations.
[0049] Through the above-mentioned content recommendation method based on knowledge graph, the present application can effectively utilize existing information and obtain knowledge graph based on existing information, make content recommendations based on knowledge graph, and continuously optimize to improve the accuracy and personalization of content recommendations, providing users with a better experience.
[0050] Figure 2 This is an embodiment of a content recommendation system based on knowledge graph provided in this application, such as Figure 2 As shown in FIG. 1 , the content recommendation system based on the knowledge graph includes: An acquisition unit 11, configured to acquire first data and user behavior data; A graph unit 12, used to generate a knowledge graph according to the first data; A vector unit 13, used to obtain a model embedding vector according to the user behavior data and the knowledge graph; A training unit 14, configured to perform training using the model embedding vector to obtain a recommendation model; An optimization unit 15, configured to collect the first data and the user behavior data in real time, and continuously optimize the recommendation model according to the first data and the user behavior data collected in real time; The recommendation unit 16 is used to generate a recommendation result for the user according to the recommendation model.
[0051] The knowledge graph-based content recommendation system provided in this embodiment is used to execute the technical solution provided by any of the aforementioned method embodiments. The knowledge graph-based content recommendation system effectively utilizes existing information and obtains a knowledge graph based on the existing information, recommends content based on the knowledge graph, and continuously optimizes and improves the accuracy and personalization of content recommendations, thereby providing users with a better experience.
[0052] Optionally, the vector unit 13 is specifically used for: Constructing a heterogeneous information network based on the user behavior data and the knowledge graph; Obtaining a first embedding vector corresponding to each node in the heterogeneous information network through a graph convolution operation; Get the knowledge graph embedding vector through the embedding model; The first embedding vector and the knowledge graph embedding vector are fused to obtain a model embedding vector.
[0053] Optionally, the vector unit 13 is further used for: Extract entities and relationships related to user behavior data from the knowledge graph; Preprocess the extracted entities and relations; Taking entities as nodes and relationships as edges, a heterogeneous information network is constructed.
[0054] The preprocessing of the extracted entities and relationships includes removing redundant information and eliminating noise data.
[0055] Optionally, the vector unit 13 is further used for: Initialize an initial embedding vector for each node; According to the initial embedding vector, a first embedding vector of each node is obtained by aggregating neighbor embedding vectors.
[0056] Optionally, the vector unit 13 is further used for: Determine the set of neighbor nodes for each node; For each node, the initial embedding vectors of its neighboring nodes are aggregated to obtain the first embedding vector of each node.
[0057] Optionally, the vector unit 13 is also used to: use an attention mechanism to connect the first embedding vector with the corresponding knowledge graph embedding vector through a weighted fusion method to obtain a model embedding vector.
[0058] Figure 3 An embodiment of a content recommendation device based on a knowledge graph provided in this application, such as Figure 3 As shown, the knowledge graph-based content recommendation device includes a processor 21 and a memory 22; the memory 22 is used to store program code and transmit the program code to the processor 21; the processor 21 is used to execute the above-mentioned knowledge graph-based content recommendation method according to the instructions in the program code.
[0059] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0060] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0061] In the several embodiments provided in this application, it should be understood that the disclosed methods, systems, devices and storage media can be implemented in other ways. For example, the system embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0062] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0063] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0064] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A content recommendation method based on knowledge graph, characterized in that: include: Acquiring first data and user behavior data; Generate a knowledge graph based on the first data; Obtaining a model embedding vector according to the user behavior data and the knowledge graph; Using the model embedding vector for training to obtain a recommendation model; collecting the first data and the user behavior data in real time, and continuously optimizing the recommendation model according to the first data and the user behavior data collected in real time; Generating recommendation results for users according to the recommendation model; in, The first data includes commodity classification, commodity attributes, commodity brand information and the relationship between commodities; the relationship between commodities includes the appearance of commodities, functional similarity relationship and functional substitution relationship of commodities.
2. According to the content recommendation method based on knowledge graph in claim 1, it is characterized in that: The obtaining of a model embedding vector according to the user behavior data and the knowledge graph includes: Constructing a heterogeneous information network based on the user behavior data and the knowledge graph; Obtaining a first embedding vector corresponding to each node in the heterogeneous information network through a graph convolution operation; The knowledge graph is operated by an embedding model to obtain a knowledge graph embedding vector; The first embedding vector and the knowledge graph embedding vector are fused to obtain the model embedding vector.
3. A content recommendation method based on knowledge graph according to claim 2, characterized in that: The step of constructing a heterogeneous information network based on the user behavior data and the knowledge graph includes: Extracting entities related to the user behavior data and relationships related to the user behavior data from the knowledge graph; Preprocessing the extracted entities and relations; The heterogeneous information network is constructed by taking the entities as nodes and the relationships as edges.
4. A content recommendation method based on knowledge graph according to claim 3, characterized in that: The preprocessing of the extracted entities and relationships includes removing redundant information and eliminating noise data.
5. The content recommendation method based on knowledge graph according to claim 2, characterized in that: The step of obtaining a first embedding vector corresponding to each node in the heterogeneous information network through a graph convolution operation includes: Initializing an initial embedding vector for each of the nodes; According to the initial embedding vector, the first embedding vector of each node is obtained by aggregating neighbor embedding vectors.
6. A content recommendation method based on knowledge graph according to claim 5, characterized in that: The step of obtaining a first embedding vector of each node by aggregating neighbor embedding vectors according to the initial embedding vector includes: Determine a set of neighbor nodes of each node; For each node, initial embedding vectors of its neighboring nodes are aggregated to obtain the first embedding vector of each node.
7. The content recommendation method based on knowledge graph according to claim 2, characterized in that: The fusing the first embedding vector and the knowledge graph embedding vector to obtain the model embedding vector includes: using an attention mechanism to connect the first embedding vector and the knowledge graph embedding vector corresponding to the first embedding vector through a weighted fusion method to obtain the model embedding vector.
8. The content recommendation method based on knowledge graph according to claim 1, characterized in that: The collecting the first data and the user behavior data in real time, and continuously optimizing the recommendation model according to the first data and the user behavior data collected in real time, includes: According to the first data and the user behavior data collected in real time, evaluating the recommendation effect of the recommendation model using an evaluation index to obtain an evaluation result; The recommendation model is optimized according to the evaluation result.
9. A content recommendation system based on knowledge graph, characterized in that: include: An acquisition unit, used to acquire first data and user behavior data; A graph unit, used for generating a knowledge graph according to the first data; A vector unit, used to obtain a model embedding vector according to the user behavior data and the knowledge graph; A training unit, used for training using the model embedding vector to obtain a recommendation model; an optimization unit, configured to collect the first data and the user behavior data in real time, and continuously optimize the recommendation model according to the first data and the user behavior data collected in real time; as well as The recommendation unit is used to generate recommendation results for users according to the recommendation model.
10. A content recommendation device based on knowledge graph, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the content recommendation method based on knowledge graph according to any one of claims 1-8 according to the instructions in the program code.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the content recommendation method based on the knowledge graph described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
A data recommendation method based on a user map
CN109684548A
Method for carrying out personalized recommendation on commodities by fusing knowledge graph
CN112232925A
Recommendation processing method and device and computing equipment
CN117648494A
Product recommendation method and device, electronic equipment, medium and computer program product
CN118350944A