A recommendation method and system based on knowledge graph
By integrating the characteristics of users and entities, building a knowledge graph and obtaining the path between users and entities, the problems of inability to automatically discover patterns and lack of explanatory nature in existing recommendation technologies are solved, and efficient entity recommendations are achieved.
Patent Information
- Application Number
- CN202010986792.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-18
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2040-09-18
AI Technical Summary
Existing knowledge graph-based recommendation techniques have shortcomings in taking into account the relationship between users and entities, and cannot automatically discover and reason based on unseen patterns, and lack explanatory nature.
By integrating the characteristics of users and entities, a knowledge graph is constructed, the path between users and entities is obtained, and the comprehensive path encoding is obtained through fusion processing, the possibility parameters for interaction between users and entities are calculated, and the entity recommendation is finally carried out.
It is implemented to obtain the path between the user and the entity without the need for domain experts to specify the metapath, and can calculate the interaction possibility parameters between the user and the entity with no path, and is highly explanatory.
Smart Images

Figure CN112115210B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet information recommendation, and in particular to a recommendation method and system based on knowledge graph. Background Art
[0002] In recent years, knowledge graphs have attracted widespread interest among researchers in the field of recommendation systems because of their rich entities and relationships. They can convert the interaction between users and entities into triples. Moreover, through the connection between users and entities, and between entities in the graph, the potential relationship between users and entities is reflected, which is a supplement to traditional user-entity interaction data.
[0003] At present, recommendation technologies based on knowledge graphs can be divided into two categories: the first category is meta-path-based recommendation, and the second category is embedding-based recommendation.
[0004] Disadvantages of meta-path based recommendations:
[0005] Because meta-paths usually do not consider relations, it is impossible to specify the overall semantics of the path, especially when the entities in the meta-path are similar but the relations are different;
[0006] Because meta-paths require predefined domain knowledge, they cannot automatically discover and reason about unseen patterns.
[0007] Disadvantages of embedding-based recommendations:
[0008] Embedding only considers the direct connection between entities, but not multiple connections in meta-paths, which lacks reasoning ability;
[0009] The user-entity association representation is achieved in an implicit way, rather than direct user interest recommendation.
[0010] Therefore, the present invention mainly proposes a recommendation method based on knowledge graph that integrates user features, entity features, and user-entity interaction behavior paths. Summary of the invention
[0011] The embodiments of the present application provide a recommendation method and system based on a knowledge graph to at least solve the problem that the relationship between users and entities is not considered in the related art.
[0012] In a first aspect, an embodiment of the present application provides a recommendation method based on a knowledge graph, comprising the following steps:
[0013] Step 1: Integrate the original features of the user and entity to obtain the user feature code and entity feature code;
[0014] Step 2: construct a knowledge graph based on the relationship between the user and the entity, obtain the path between the user and the entity from the knowledge graph, and encode it according to the relationship between the user and the entity. After fusion processing, obtain the comprehensive path encoding of all paths of the user to the entity;
[0015] Step 3: Calculate the possibility parameter of the user interacting with the entity according to the user feature code, the entity feature code and the comprehensive path code;
[0016] Step 4: Perform entity recommendation based on the likelihood parameters.
[0017] In some of the embodiments, both the user and the entity have sparse features and dense features, and the step 1 includes: according to the sparse features or dense features of the user and the entity themselves, using embedding to integrate features, parameterizing the user and the entity into vector representations, and obtaining the user feature encoding and the entity feature encoding.
[0018] In some of the embodiments, the specific steps of the feature integration include: converting sparse features into multi-dimensional dense vectors, and processing the dense features into normal distribution, obtaining embedding vectors of each feature of the user and the entity, thereby obtaining the user feature encoding and the entity feature encoding.
[0019] In some embodiments, step 2 specifically includes the following steps:
[0020] First, a path between a user and an entity is selected according to the entities, the relationships between the entities, and the user's interactive behaviors in the knowledge graph, the user, the entity, and the relationship between the user and the entity are encoded, and the encoding result is input into the RNN model to obtain the encoding result of the path;
[0021] All paths between the user and the entity are encoded as above, and after fusion processing, the comprehensive encoding representation of all paths between the user and the entity is obtained.
[0022] In some of the embodiments, step 3 includes: splicing the user feature code, the entity feature code and the comprehensive path code into an overall code, using a multi-layer perceptron to perform feature interaction, and calculating the possibility parameter of interaction between the user and the entity.
[0023] In some embodiments, the step 3 specifically includes: splicing the user feature code, the entity feature code and the comprehensive path code into an overall code, the multi-layer perceptron has two fully connected layers, and inputting the overall code into the input layer of the multi-layer perceptron to obtain a prediction score:
[0024]
[0025] Among them, e is the overall code, W 1 T and are the weight parameters of the first and second layers, b 1 and b 2 is the bias parameter of the first and second layers, σ(.) is the sigmoid function, ReLU(.) is the linear rectification function,
[0026] The prediction score is mapped to the range of [0, 1], and the probability parameter of the user interacting with the entity is calculated.
[0027] In a second aspect, an embodiment of the present application provides a recommendation system based on a knowledge graph, which is applied to the above-mentioned recommendation method based on a knowledge graph, including:
[0028] The feature coding module integrates the original features of the user and the entity to obtain the user feature coding and the entity feature coding;
[0029] A path encoding module, which constructs a knowledge graph based on the relationship between users and entities, obtains the path between users and entities from the knowledge graph, encodes the path between users and entities based on the relationship between users and entities, feeds the encoding result into the model, and outputs the path encoding;
[0030] A path synthesis module receives the path code output by the path coding module, processes it, and outputs a comprehensive coding representation of all paths between the user and the entity;
[0031] The prediction module receives the user feature code and the entity feature code from the feature coding module, the integrated code representation output by the path synthesis module, and calculates a parameter of the possibility of interaction between the user and the entity.
[0032] In some of the embodiments, the feature encoding module uses embedding to integrate features based on the sparse features or dense features of the user and the entity themselves, converts the sparse features into multi-dimensional dense vectors, and processes the dense features into a normal distribution to obtain the embeddings of each feature of the user and the entity, parameterizes the user and the entity into a vector representation, and obtains the user feature encoding and the entity feature encoding.
[0033] In some of the embodiments, the path encoding module selects a path between the user and the entity based on the entities in the knowledge graph, the relationships between the entities, and the user's interactive behaviors, encodes the user, the entity, and the relationship between the user and the entity, and inputs the encoding result into the RNN model, and outputs the encoding result of the path to the path synthesis module. The path synthesis module receives the encoding results of all paths between the user and the entity, and after fusion processing, obtains the comprehensive encoding representation of all paths of the user to the entity.
[0034] In some embodiments, the prediction module includes a multi-layer perceptron having two fully connected layers. The prediction module concatenates the user feature code, the entity feature code, and the comprehensive path code into an overall code, and inputs the overall code into an input layer of the multi-layer perceptron to obtain a prediction score:
[0035]
[0036] Among them, e is the overall code, W 1 T and are the weight parameters of the first and second layers, b 1 and b 2 is the bias parameter of the first and second layers, σ(.) is the sigmoid function, ReLU(.) is the linear rectification function,
[0037] The prediction score is mapped to the range of [0, 1] to obtain the possibility parameter of the user interacting with the entity.
[0038] Compared with the related art, the recommendation method and system based on knowledge graph provided in the embodiment of the present application have the following advantages:
[0039] 1) The present invention does not require domain experts to specify meta-paths, and can directly obtain the path between users and entities based on entities in the knowledge graph, the relationships between entities, and user interaction behaviors.
[0040] 2) The present invention can calculate the possibility parameters of the interaction between a user and an entity that has no path with the user. In this case, there are only user feature vectors and entity feature vectors. The possibility parameters of the interaction between the user and the entity can be calculated as long as the path is represented as a vector of all zeros.
[0041] 3) Compared with the embedding-based recommendation method, the present invention has strong interpretability.
[0042] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0044] Figure 1 It is a flowchart of a recommendation method based on knowledge graph proposed in the embodiment of this application;
[0045] Figure 2 It is a flowchart of a recommendation method based on knowledge graph proposed in an embodiment of the present application;
[0046] Figure 3 It is a knowledge graph of recommended cases proposed in the embodiments of this application;
[0047] Figure 4 It is a schematic diagram of user feature coding proposed in the embodiment of this application;
[0048] Figure 5 It is a schematic diagram of path coding proposed in the embodiment of this application;
[0049] Figure 6 It is a structural diagram of a recommendation system based on knowledge graph proposed in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0051] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0052] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0053] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0054] Embedding is a way to convert discrete variables into continuous vector representations. In neural networks, embedding can reduce the spatial dimension of discrete variables while also representing the variable meaningfully.
[0055] Embedding can accomplish the following three purposes: finding the nearest neighbor in the embedding space, which can be used to make recommendations based on user interests; serving as input for supervised learning tasks; and visualizing the relationship between different discrete variables.
[0056] The long-short term memory model is a special RNN (Recurrent Neural Network) model, which is proposed to solve the problem of gradient diffusion in the RNN model. In the traditional RNN, the training algorithm uses BPTT. When the time is long, the residual that needs to be transmitted back will decrease exponentially, resulting in slow update of network weights and failure to reflect the effect of RNN's long-term memory. Therefore, a storage unit is needed to store the memory, so the LSTM model was proposed.
[0057] The first step of the LSTM is to decide what information we are going to throw away from the node state. This decision is made by a sigmoid layer called the "forget gate layer". It looks at ht-1 and xt and outputs a number between 0 and 1 for each number in the cell state Ct-1. 1 represents "totally keep this" and 0 represents "totally get rid of this".
[0058] The next step is to determine what new information we will store in the cell node state. There are two parts to this. First, a sigmoid layer called the "input gate layer" decides which values we will update. Next, a tanh layer creates a vector of new candidate values C~t that can be added to the state. In the next step, we will combine these two to create the state update.
[0059] Finally, we need to decide what we want to output. This output will be based on our cell state, but will be a filtered version. First, we run a sigmoid layer, which decides which parts of the cell state we want to output. We then take the cell state and subject it to tanh (pushing the values to between -1 and 1) and multiply it by the output of the sigmoid gate so that we only output the parts we decided on.
[0060] Multilayer Perceptron (MLP) is also called Artificial Neural Network (ANN). In addition to the input and output layers, it can have multiple hidden layers in the middle. The simplest MLP contains only one hidden layer, that is, a three-layer structure. The layers of the multilayer perceptron are fully connected. The bottom layer of the multilayer perceptron is the input layer, the middle layer is the hidden layer, and the last layer is the output layer.
[0061] The generation of neurons in the hidden layer is firstly fully connected with the input layer. Assuming that the input layer is represented by vector X, the output of the hidden layer is f(W 1 X+b 1 ), W 1 is the weight (also called connection coefficient), b 1is the bias, and the function f can be the commonly used sigmoid function or tanh function: the hidden layer to the output layer can be regarded as a multi-category logistic regression, that is, soft max Regression, so the output of the output layer is soft max (W 2 X 1 +b 2 ), X1 represents the output of the hidden layer f(W 1 X+b 1 ).
[0062] All the parameters of MLP are the connection weights and biases between each layer, including W1, b1, W2, and b2. Finding the best parameters is an optimization problem. The simplest way to solve the optimization problem is the gradient descent method (SGD): first randomly initialize all parameters, then iteratively train, continuously calculate gradients and update parameters until a certain condition is met (such as when the error is small enough and the number of iterations is large enough). This process involves cost functions, regularization, learning rates, gradient calculations, etc.
[0063] RELU function Rectified Linear Unit (ReLU), also known as the corrected linear unit, is an activation function commonly used in artificial neural networks, usually referring to nonlinear functions represented by ramp functions and their variants.
[0064] Based on existing technologies, such as Figure 1 As shown, this embodiment proposes a recommendation method based on knowledge graph, including the following steps:
[0065] Step 1: Integrate the original features of the user and entity to obtain the user feature code and entity feature code;
[0066] Step 2: Construct a knowledge graph based on the relationship between users and entities, obtain the path between users and entities from the knowledge graph, and encode it according to the relationship between users and entities. After fusion processing, obtain the comprehensive path encoding of all paths of users to the entity;
[0067] Step 3: Calculate the possibility parameter of the interaction between the user and the entity based on the user feature coding, entity feature coding and comprehensive path coding;
[0068] Step 4: Perform entity recommendation based on the likelihood parameters.
[0069] Through the above steps, we can directly obtain the path between users and entities based on the knowledge graph between users and entities, obtain users, entities, the relationship between users and entities, and user interaction behaviors. At the same time, based on user feature coding, entity feature coding and comprehensive path coding, when there is no path between users and entities, the path coding is represented as all zeros to continue calculating the possibility parameters of the interaction between users and entities.
[0070] In some embodiments, both the user and the entity have sparse features and dense features, and step 1 includes:
[0071] According to the sparse or dense features of users and entities themselves, embedding is used to integrate features, and users and entities are parameterized into vector representations to obtain user feature encoding and entity feature encoding.
[0072] In some embodiments, the specific steps of feature integration include: converting sparse features into multi-dimensional dense vectors, and processing the dense features into normal distribution, obtaining embedding vectors of each feature of the user and the entity, thereby obtaining user feature encoding and entity feature encoding.
[0073] In specific applications, the methods of processing dense features into normal distribution include standardization and normalization.
[0074] In specific applications, users and entities have their own sparse features or dense features. Sparse features are categorical features, such as gender, zodiac sign, membership, etc., and dense features are numerical features, such as user historical click-through rate, historical purchase rate, etc. Through embedding, feature integration is performed to parameterize users and entities into vector representations.
[0075] Assume that a user u is given, whose feature space x u Contains sparse feature space and dense feature space Each sparse feature is converted into a d-dimensional dense vector, and the dense features are standardized or normalized into a normal distribution. At this time, user u can be expressed as in and Respectively represent the size of the user's sparse feature space and dense feature space, that is, the number of features. Similarly, entity i can be represented as In this embodiment, d=4 is set.
[0076] In some embodiments, step 2 specifically includes the following steps:
[0077] First, a path between the user and the entity is selected based on the entities, the relationships between the entities, and the user's interactive behaviors in the knowledge graph, and the user, the entity, and the relationship between the user and the entity are encoded. The encoding result is input into the RNN model to obtain the encoding result of the path;
[0078] All paths between the user and the entity are encoded as above, and after fusion processing, a comprehensive encoding representation of all paths between the user and the entity is obtained.
[0079] In specific applications, the RNN model can be specifically set to an LSTM model or a GRU model.
[0080] In specific applications, the path between users and entities is encoded. Taking book purchase as an example, Figure 3 As shown in the figure, Xiao Ming has purchased the book "Machine Learning". To determine the possibility of interaction between Xiao Ming and "Introduction to the Theoretical Machine Learning", there are three paths from user Xiao Ming to the book "Introduction to the Theoretical Machine Learning":
[0081]
[0082]
[0083]
[0084] These paths show different multi-step relationships, including various semantics and possible explanations of behavior. Path 1 and Path 2 indicate that Xiao Ming may like books written by Zhou Zhihua and computer science, while Path 3 has the effect of collaborative filtering, where similar users may have similar preferences.
[0085] For path encoding, first Figure 3 Each entity and relationship in the knowledge graph shown is encoded, and the LSTM model is used to extract information to obtain the encoding of a single path.
[0086] With each path [p 1 ,p 2 ,......,p m ], all path encoding representations are accumulated to obtain the comprehensive path encoding representation of all paths from the user to the entity.
[0087] In some embodiments, step 3 includes:
[0088] The user code, entity code and comprehensive path code are spliced into an overall code, and the multi-layer perceptron is used for feature interaction to calculate the possibility parameters of interaction between users and entities.
[0089] Step 3 specifically includes: splicing the user code, entity code and comprehensive path code into an overall code. The multi-layer perceptron has two fully connected layers. The overall code is input into the input layer of the multi-layer perceptron to obtain the prediction score:
[0090]
[0091] Among them, e is the overall code, W 1 T and are the weight parameters of the first and second layers, b 1 and b 2 is the bias parameter of the first and second layers, σ(.) is the sigmoid function, ReLU(.) is the linear rectification function,
[0092] The prediction score is mapped to the range of [0,1] to obtain the possibility parameter of the user interacting with the entity.
[0093] In specific applications, the basic feature representation and path representation are fused to calculate the interaction possibility parameters, such as Figure 2 Upper middle part.
[0094] After having the user feature encoding, entity feature encoding and path encoding representation, the three parts of the encoding vector are combined into one representation, and the multi-layer perceptron is used for feature interaction. Finally, the sigmoid function is used to predict whether the user will interact with the entity.
[0095] The above method is explained below with examples from practical applications.
[0096] Assume that [id, gender, age] is selected as user features, and the dimension d after encoding each feature is 3. Figure 4 As shown in the figure, the input for encoding the id is the one-hot vector of the id, for example [0,0,1,0], followed by a fully connected layer to obtain the 3D encoding value of the id. The weights of the fully connected layer are randomly initialized and continuously optimized during the training process to obtain the final weights.
[0097] Similarly, gender and age can be encoded to obtain 3D feature vectors respectively. The feature vectors of [id, gender, age] are concatenated to obtain the user Its dimension is 3×3=9.
[0098] Assuming that the entity feature selection is [id, category], and the encoding dimension d is also 3, each feature of the entity is encoded and concatenated to obtain the entity Its dimension is 2×3=6.
[0099] For path encoding, such as Figure 3As shown in , first extract the paths between the target user and the target entity whose length is less than 6, and select a path, such as Encoding entities and relationships is the same as encoding user features. In this way, the encoding results of the seven words [Xiao Ming, purchase, machine learning, author, Zhou Zhihua, works, machine learning theory guide] are obtained. 小明 , x 购买 , x 机器学习 , x 作者 , x 周志华 , x 著作 , x 机器学习理论导引 ], and then the results are fed into the LSTM model in turn. The LSTM hidden layer dimension is h n (For example h n =64), and the final output h is obtained 7 As the encoding result of this path p1 ,as follows Figure 5 As shown:
[0100] Assume that all paths between the target user and the target entity that meet the conditions are [p 1 ,p 2 ,......,p m ], then the encoding results of all paths can be obtained [e p1 ,e p2 ,......,e pm ]. Accumulate the encodings of all paths to obtain a comprehensive representation of all paths from the user to the entity. p .
[0101] In addition to accumulation, the fusion representation method of the above paths can also be weighted summation, splicing, etc.
[0102] After obtaining the user code, entity code, and path code, the three parts of the code are concatenated to obtain the overall code e. The multi-layer perceptron includes two fully connected layers to map the overall code to the output prediction score:
[0103]
[0104] Among them, e is the overall code, W 1 T and are the weight parameters of the first and second layers, b 1 and b 2 is the bias parameter of the first and second layers, σ(.) is the sigmoid function, and ReLU(.) is the linear rectification function. The score is mapped to the range of [0,1] as the possibility parameter of interaction, completing the calculation of the interaction possibility parameter between the target user and the target entity.
[0105] like Figure 6 As shown, this embodiment also proposes a recommendation system based on knowledge graph, which is applied to the above-mentioned recommendation method based on knowledge graph, including:
[0106] The feature coding module integrates the original features of the user and the entity to obtain the user feature coding and the entity feature coding;
[0107] The path encoding module constructs a knowledge graph based on the relationship between users and entities, obtains the path between users and entities from the knowledge graph, encodes the relationship between users and entities, feeds the encoding result into the model, and outputs the path encoding;
[0108] The path synthesis module receives the path coding output by the path coding module, processes it, and outputs a comprehensive coding representation of all paths between the user and the entity;
[0109] The prediction module receives the user feature coding and entity feature coding from the feature coding module, and the comprehensive coding representation output by the path synthesis module, and calculates the possibility parameters of the interaction between the user and the entity.
[0110] In some embodiments, the feature encoding module uses embedding to integrate features based on the sparse features or dense features of the user and entity themselves, converts the sparse features into multi-dimensional dense vectors, and processes the dense features into a normal distribution to obtain the embeddings of each feature of the user and entity, parameterizes the user and entity into a vector representation, and obtains user feature encoding and entity feature encoding.
[0111] In some embodiments, the path encoding module selects a path between the user and the entity based on the entities in the knowledge graph, the relationships between the entities, and the user's interactive behaviors, encodes the user, the entity, and the relationship between the user and the entity, and inputs the encoding result into the RNN model, and outputs the encoding result of the path to the path integration module. The path integration module receives the encoding results of all paths between the user and the entity, and after fusion processing, obtains a comprehensive encoding representation of all paths of the user to the entity.
[0112] In some embodiments, the prediction module includes a multi-layer perceptron having two fully connected layers. The prediction module concatenates the user feature code, the entity feature code, and the comprehensive path code into an overall code, and inputs the overall code into an input layer of the multi-layer perceptron to obtain a prediction score:
[0113]
[0114] Among them, e is the overall code, W 1 T and are the weight parameters of the first and second layers, b 1 and b 2 is the bias parameter of the first and second layers, σ(.) is the sigmoid function, ReLU(.) is the linear rectification function,
[0115] The prediction score is mapped to the range of [0,1] to obtain the parameter of the possibility of interaction between the user and the entity. It should be noted that the above modules can be functional modules or program modules, which can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0116] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0117] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A knowledge graph-based entity recommendation method, characterized in that: The following steps are involved: Step 1: Integrate the original features of the user and entity to obtain the user feature code and entity feature code; According to the sparse features or dense features of the user and the entity themselves, embedding is used to integrate the features, and the user and the entity are parameterized into vector representations to obtain the user feature encoding and the entity feature encoding; The specific steps of the feature integration include: converting sparse features into multi-dimensional dense vectors, and processing the dense features into normal distribution, obtaining embedding vectors of each feature of the user and the entity, thereby obtaining the user feature code and the entity feature code; Step 2: construct a knowledge graph based on the relationship between the user and the entity, obtain the path between the user and the entity from the knowledge graph, and encode it according to the relationship between the user and the entity, and obtain the comprehensive path encoding of all paths of the user to the entity after fusion processing; Step 2 specifically includes the following steps: first, select a path between the user and the entity according to the entities, the relationship between the entities and the user's interactive behavior in the knowledge graph, encode the user, the entity and the relationship between the user and the entity, and input the encoding result into the RNN model to obtain the encoding result of the path; perform the above encoding on all paths between the user and the entity, and obtain the comprehensive path encoding representation of all paths of the user to the entity after fusion processing; Step 3: Calculate the possibility parameter of the user-entity interaction according to the user feature code, the entity feature code and the comprehensive path code; Step 3 specifically includes: splicing the user feature code, the entity feature code and the comprehensive path code into an overall code, a multilayer perceptron has two fully connected layers, and inputting the overall code into the input layer of the multilayer perceptron to obtain a prediction score: Among them, e is the overall code, and are the weight parameters of the first and second layers, and are the bias parameters of the first and second layers, is the sigmoid function, is a linear rectification function, Mapping the prediction score to the range of [0, 1] and calculating the probability parameter of the user interacting with the entity; Step 4: Perform entity recommendation based on the likelihood parameters.
2. A recommendation system based on knowledge graph, applied to the recommendation method based on knowledge graph described in claim 1, characterized in that: include: The feature coding module integrates the original features of the user and the entity to output the user feature coding and the entity feature coding; The feature encoding module integrates features using embedding according to the sparse features or dense features of the user and entity, converts the sparse features into multi-dimensional dense vectors, processes the dense features into normal distribution, obtains the embeddings of the features of the user and entity, and parameterizes the user and entity into vector representation to obtain the user feature encoding and the entity feature encoding; A path encoding module, which constructs a knowledge graph based on the relationship between users and entities, obtains the path between users and entities from the knowledge graph, encodes the relationship between users and entities, feeds the encoding result into the model, and outputs the path encoding; The path encoding module selects a path between the user and the entity according to the entities in the knowledge graph, the relationship between the entities and the user's interactive behavior, encodes the user, the entity and the relationship between the user and the entity, and inputs the encoding result into the RNN model, and outputs the encoding result of the path to the path integration module; the path integration module receives the path encoding output by the path encoding module, and after processing, outputs the comprehensive path encoding representation of all paths between the user and the entity; the path integration module receives the encoding results of all paths between the user and the entity, and after fusion processing, obtains the comprehensive path encoding representation of all paths of the user to the entity; The prediction module calculates the possibility parameter of the user interacting with the entity according to the user feature code and the entity feature code output by the feature coding module and the comprehensive path code output by the path synthesis module; the prediction module includes a multi-layer perceptron, and the multi-layer perceptron has two fully connected layers. The prediction module splices the user feature code, the entity feature code and the comprehensive path code into an overall code, and inputs the overall code into the input layer of the multi-layer perceptron to obtain a prediction score: Among them, e is the overall code, and are the weight parameters of the first and second layers, and are the bias parameters of the first and second layers, is the sigmoid function, is a linear rectification function, The prediction score is mapped to the range of [0, 1] to obtain the possibility parameter of the user interacting with the entity.
Citation Information
Patent Citations
Knowledge graph-based user modeling method and sequence recommendation method
CN110516160A
News recommendation method based on knowledge perception
CN111061856A