CN112115210A - Recommendation method and system based on knowledge graph - Google Patents
Recommendation method and system based on knowledge graph Download PDFInfo
- Publication number
- CN112115210A CN112115210A CN202010986792.XA CN202010986792A CN112115210A CN 112115210 A CN112115210 A CN 112115210A CN 202010986792 A CN202010986792 A CN 202010986792A CN 112115210 A CN112115210 A CN 112115210A
- Authority
- CN
- China
- Prior art keywords
- entity
- user
- code
- path
- entities
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 230000003993 interaction Effects 0.000 claims abstract description 40
- 230000010354 integration Effects 0.000 claims abstract description 17
- 238000007499 fusion processing Methods 0.000 claims abstract description 10
- 239000013598 vector Substances 0.000 claims description 27
- 230000015572 biosynthetic process Effects 0.000 claims description 19
- 238000003786 synthesis reaction Methods 0.000 claims description 19
- 230000008569 process Effects 0.000 claims description 8
- 238000013507 mapping Methods 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 7
- 230000006870 function Effects 0.000 description 21
- 230000006399 behavior Effects 0.000 description 8
- 238000010801 machine learning Methods 0.000 description 7
- 238000013528 artificial neural network Methods 0.000 description 5
- 210000004027 cell Anatomy 0.000 description 5
- 238000010586 diagram Methods 0.000 description 3
- 230000015654 memory Effects 0.000 description 3
- 230000004913 activation Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000010606 normalization Methods 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000009792 diffusion process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 238000011478 gradient descent method Methods 0.000 description 1
- 238000007477 logistic regression Methods 0.000 description 1
- 230000007787 long-term memory Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
- G06F16/288—Entity relationship models
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/048—Activation functions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Biophysics (AREA)
- Evolutionary Computation (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a recommendation method based on a knowledge graph. The technical scheme comprises the following steps: the method comprises the steps of performing feature integration on original features of a user and an entity to obtain a user feature code and an entity feature code; forming a knowledge graph according to the relation between the user and the entity, acquiring the path between the user and the entity from the knowledge graph, coding according to the relation between the user and the entity, and obtaining the comprehensive path coding of the user on all paths of the entity through fusion processing; calculating a possibility parameter of interaction between the user and the entity according to the user characteristic code, the entity characteristic code and the comprehensive path code; and recommending the entity according to the possibility parameter. The method and the system directly obtain the path between the user and the entity according to the relation between the entity and the entity in the knowledge graph and the interaction behavior of the user, and simultaneously can calculate the interaction possibility parameter under the condition that no path exists between the user and the entity.
Description
Technical Field
The invention relates to the technical field of internet information recommendation, in particular to a recommendation method and a recommendation system based on a knowledge graph.
Background
In recent years, knowledge-graphs have attracted extensive interest to researchers in the field of recommendation systems because of their rich entities and relationships, which can transform the interaction between users and entities into a triple form. And the potential relation between the users and the entities is reflected through the connection relation between the users and the entities and between the entities in the map, so that the potential relation is complementary to the traditional user-entity interaction data.
At present, the recommendation technology based on knowledge graph can be mainly divided into two categories, the first category is recommendation based on meta path, and the second category is recommendation based on embedding.
Meta-path based recommendation shortcomings:
because meta-paths generally do not take relations into account, the overall semantics of the paths cannot be specified, especially when the entities in the meta-paths are similar and the relations are different;
since meta-paths require predefined domain knowledge, they cannot be automatically discovered and inferred from unseen patterns.
The recommended shortcomings based on embedding:
only direct connections between entities are considered based on embedding, but not multiple connections as in meta-paths, lacking reasoning capabilities;
the user-entity association characterization is realized in an implicit mode, and is not direct user interest recommendation.
Therefore, the invention mainly provides a recommendation method based on the knowledge graph and fusing the user characteristics, the entity characteristics and the interaction behavior path of the user and the entity.
Disclosure of Invention
The embodiment of the application provides a recommendation method and a recommendation system based on a knowledge graph, which are used for at least solving the problem that the relation between a user and an entity is not considered in the related technology.
In a first aspect, an embodiment of the present application provides a knowledge graph-based recommendation method, including the following steps:
step 1: the method comprises the steps of performing feature integration on original features of a user and an entity to obtain a user feature code and an entity feature code;
step 2: forming a knowledge graph according to the relation between a user and an entity, acquiring a path between the user and the entity from the knowledge graph, coding according to the relation between the user and the entity, and obtaining a comprehensive path code of the user for all paths of the entity through fusion processing;
and step 3: calculating a possibility parameter of interaction between the user and the entity according to the user feature code, the entity feature code and the comprehensive path code;
and 4, step 4: and recommending the entity according to the possibility parameter.
In some of these embodiments, the user and the entity both have sparse features and dense features, and the step 1 comprises: according to the sparse features or the dense features of the users and the entities, embedding is utilized for feature integration, the users and the entities are parameterized into vector representation, and the user feature codes and the entity feature codes are obtained.
In some embodiments, the specific steps of feature integration include: and converting the sparse features into multi-dimensional dense vectors, and processing the dense features into normal distribution to obtain embedding vectors of each feature of the user and the entity so as to obtain the user feature codes and the entity feature codes.
In some embodiments, the step 2 specifically includes the following steps:
firstly, selecting a path between users and entities according to the entities in the knowledge graph, the relationship between the entities and the interaction behavior of the users, coding the users, the entities and the relationship between the users and the entities, and inputting a coding result into an RNN (radio network) model to obtain a coding result of the path;
and performing the coding on all paths between the user and the entity, and obtaining the comprehensive coded representation of all paths of the entity by the user through fusion processing.
In some of these embodiments, the step 3 comprises: and splicing the user characteristic code, the entity characteristic code and the comprehensive path code into an integral code, performing characteristic interaction by using a multilayer perceptron, and calculating a possibility parameter of interaction between a user and an entity.
In some embodiments, the step 3 specifically includes: splicing the user characteristic code, the entity characteristic code and the comprehensive path code into an integral code, wherein the multilayer perceptron has two fully-connected layers, and inputting the integral code into an input layer of the multilayer perceptron to obtain a prediction score:
wherein e is the whole code, W1 TAndis a weight parameter of the first layer and the second layer, b1And b2Is the bias parameters of the first and second layers, σ () is the sigmoid function, ReLU () is the linear rectification function,
and mapping the prediction scores into a range of [0,1], and calculating a possibility parameter of the user and the entity to generate interaction.
In a second aspect, an embodiment of the present application provides a knowledge-graph-based recommendation system, which is applied to the above knowledge-graph-based recommendation method, and includes:
the characteristic coding module is used for obtaining user characteristic codes and entity characteristic codes by carrying out characteristic integration on the own original characteristics of the users and the entities;
the path coding module is used for forming a knowledge graph according to the relation between the user and the entity, acquiring the path between the user and the entity from the knowledge graph, coding according to the relation between the user and the entity, sending a coding result into a model and outputting a path code;
the path synthesis module receives the path codes output by the path coding module, and outputs the synthesis code representation of all paths of the user and the entity after processing;
and the prediction module is used for receiving the user characteristic codes and the entity characteristic codes of the characteristic coding module, and calculating a possibility parameter of interaction between a user and an entity according to the comprehensive coded representation output by the path synthesis module.
In some embodiments, the feature coding module performs feature integration by using embedding according to sparse features or dense features of users and entities, converts the sparse features into multi-dimensional dense vectors, processes the dense features into normal distribution to obtain embedding of each feature of the users and the entities, and parameterizes the users and the entities into vector representation to obtain the user feature codes and the entity feature codes.
In some embodiments, the path coding module selects a path between users and entities according to the entities in the knowledge graph, the relationship between the entities and the interaction behavior of the users, codes the users, the entities and the relationship between the users and the entities, inputs a coding result into the RNN model, and outputs a coding result of the path to the path synthesis module, and the path synthesis module receives coding results of all paths between the users and the entities, and obtains the synthesis coding representation of all paths of the entities by the users through fusion processing.
In some embodiments, the prediction module includes a multi-layer perceptron, the multi-layer perceptron has two fully-connected layers, the prediction module splices the user feature code, the entity feature code and the synthesis 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:
wherein e is the whole code, W1 TAndis a weight parameter of the first layer and the second layer, b1And b2Is the bias parameters of the first and second layers, σ () is the sigmoid function, ReLU () is the linear rectification function,
and mapping the prediction score to the range of [0,1] to obtain a possibility parameter of the interaction between the user and the entity.
Compared with the related art, the recommendation method and system based on the knowledge graph provided by the embodiment of the application have the following advantages:
1) the invention does not need a domain expert to specify a meta-path, and can directly obtain the path between the user and the entity according to the entity in the knowledge graph, the relation between the entities and the user interaction behavior.
2) The method can calculate the possibility parameter of interaction between the user and the entity without the path to the user, and only the user characteristic vector and the entity characteristic vector are used at the moment, so long as the path is expressed as the all 0 vector, the possibility parameter of interaction between the user and the entity can be calculated.
3) Compared with the recommendation method based on embedding, the recommendation method based on embedding is strong in interpretability.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flow chart of a knowledge-graph based recommendation method as set forth in an embodiment of the present application;
FIG. 2 is a schematic flow chart of a knowledge-graph-based recommendation method proposed in an embodiment of the present application;
FIG. 3 is a knowledge-graph of a recommended case presented by an embodiment of the present application;
FIG. 4 is a schematic diagram of user feature coding proposed in the embodiment of the present application;
FIG. 5 is a schematic diagram of path coding proposed in the embodiments of the present application;
fig. 6 is a schematic structural diagram of a knowledge-graph-based recommendation system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.
It is obvious that the drawings in the following description are only examples or embodiments of the present application, and that it is also possible for a person skilled in the art to apply the present application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as referred to herein means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
embedding is one way to convert discrete variables into a continuous vector representation. In a neural network, embedding can reduce the spatial dimension of a discrete variable, and can also represent the variable meaningfully.
The imbedding can accomplish the following 3 purposes: searching nearest neighbors in the embedding space, which can be well used for recommending according to the interests of the user; as input to a supervised learning task; for visualizing the relationship between different discrete variables.
The long-short term memory model (long-short term memory) is a special RNN (Current Neural network) model, and is proposed for solving the problem of gradient diffusion of the RNN model; in the traditional RNN, BPTT is used in a training algorithm, when the time is longer, the residual error needing to be returned is exponentially reduced, so that the network weight is updated slowly, the long-term memory effect of the RNN cannot be embodied, and therefore a storage unit is needed for storing memory, and an LSTM model is proposed;
the first step of LSTM is to determine which information we will discard from the node state. This decision is determined by a sigma (Sigmoid) layer called the "forgetting 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. A1 represents "hold this completely", while a 0 represents "get rid of this completely".
The next step is to determine which new information we will store in the cell node state. This has two parts. First, a sigmoid layer called the "input gate layer" decides which values we will update. Next, the 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 a state update.
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 that determines which parts of the cell state we want to output. Then we place the cell state at tanh (pushing the value between-1 and 1) and multiply it by the output of the sigmoid gate so that we only output the part we decide.
The Multilayer Perceptron (MLP), also called Artificial Neural Network (ANN), except for the input and output layers, may have multiple hidden layers in the middle, the simplest MLP only has one hidden layer, i.e. a three-layer structure, and the multiple Perceptron layers are all connected. The bottom layer of the multilayer perceptron is an input layer, the middle layer is a hidden layer, and the last layer is an output layer.
The neuron of the hidden layer is generated by first connecting it to the input layer, and assuming that the input layer is represented by a vector X, the output of the hidden layer is f (W)1X+b1),W1Is the weight (also called the connection coefficient), b1Is an offset, the function f may be a commonly used sigmoid function or tanh function: the hidden layer to the output layer can be regarded as a multi-class logistic regression, namely softmaxRegression so the output of the output layer is softmax(W2X1+b2) And X1 denotes the output f (W) of the hidden layer1X+b1)。
All the parameters of MLP are the connection weight and bias between the layers, including W1, b1, W2, b 2. Solving the optimal parameters is an optimization problem, the simplest one is the gradient descent method (SGD): all parameters are initialized randomly first and then trained iteratively, with gradients computed and parameters updated continuously until certain conditions are met (e.g., errors are small enough and iterations are numerous enough). This process involves cost functions, Regularization, learning rate, gradient calculations, etc.
The RELU function Linear rectification function (RELU), also called modified Linear Unit, is an activation function (activation function) commonly used in artificial neural networks, and generally refers to a nonlinear function represented by a ramp function and its variants.
Based on the prior art, as shown in fig. 1, the present embodiment proposes a recommendation method based on knowledge graph, which includes the following steps:
step 1: the method comprises the steps of performing feature integration on original features of a user and an entity to obtain a user feature code and an entity feature code;
step 2: forming a knowledge graph according to the relation between the user and the entity, acquiring the path between the user and the entity from the knowledge graph, coding according to the relation between the user and the entity, and obtaining the comprehensive path coding of the user on all paths of the entity through fusion processing;
and step 3: calculating a possibility parameter of interaction between the user and the entity according to the user characteristic code, the entity characteristic code and the comprehensive path code;
and 4, step 4: and recommending the entity according to the possibility parameter.
Through the steps, the user, the entity, the relation between the user and the entity and the user interaction behavior can be directly obtained according to the knowledge graph between the user and the entity, and the path between the user and the entity can be obtained.
In some embodiments, the user and the entity both have sparse features and dense features, step 1 comprising:
according to the sparse features or the dense features of the users and the entities, embedding is utilized for feature integration, the users and the entities are parameterized into vector representation, and user feature codes and entity feature codes are obtained.
In some embodiments, the specific steps of feature integration include: and converting the sparse features into multi-dimensional dense vectors, and processing the dense features into normal distribution to obtain embedding vectors of the features of the user and the entity so as to obtain user feature codes and entity feature codes.
In a particular application, the processing of dense features into a normal distribution includes normalization and normalization.
In a particular application, both users and entities have their own sparse or dense features. The sparse features are classified features such as gender, constellation, membership and the like, the dense features are numerical features such as user historical click rate, historical purchase rate and the like, feature integration is carried out through embedding, and the user and the entity are parameterized into vector representation.
Suppose that given a user u, its feature space xuInvolving sparse feature spacesAnd dense feature spaceEach sparse feature is converted into a d-dimensional dense vector, and the dense features are normalized or normalized into a normal distribution. At this time, user u may be represented asWhereinAndrespectively representing the size of the user sparse feature space and the dense feature space, namely the number of features. The entity i can likewise be represented asIn this embodiment, d is set to 4.
In some embodiments, step 2 specifically includes the following steps:
firstly, selecting a path between users and entities according to the entities in the knowledge graph, the relationship between the entities and the interaction behavior of the users, coding the users, the entities and the relationship between the users and the entities, and inputting a coding result into an RNN (radio network) model to obtain a coding result of the path;
and carrying out the coding on all paths between the user and the entity, and obtaining the comprehensive coded representation of all paths of the entity by the user through fusion processing.
In a specific application, the RNN model may be specifically set to an LSTM model or a GRU model.
In a specific application, the path between the user and the entity is encoded, taking book purchase as an example, as shown in fig. 3, xiaoming purchases book "machine learning", and determines the possibility of interaction between xiaoming and "machine learning theory guidance", where there are three paths from user xiaoming to book "machine learning theory guidance":
these paths exhibit different multi-step relationships, including various semantics and possible interpretations of behavior. Path 1 and path 2 indicate that Xiaoming may like the author to be books of the Zhou Shihua and computer profession, path 3 has a collaborative filtering effect, and similar users may have similar preferences.
For path coding, each entity and relationship in the knowledge-graph shown in fig. 3 is first coded, and the LSTM model is used to extract information, resulting in a single path code.
Has each path [ p ]1,p2,......,pm]After the coded representation, all the path coded representations are accumulated to obtain a comprehensive path coded representation of all paths from the user to the entity.
In some embodiments, step 3 comprises:
and splicing the user code, the entity code and the comprehensive path code into an integral code, performing feature interaction by using a multilayer perceptron, and calculating a possibility parameter of interaction between the user and the entity.
The step 3 specifically comprises the following steps: splicing the user code, the entity code and the comprehensive path code into an integral code, wherein the multilayer perceptron has two full connection layers, and the integral code is input into an input layer of the multilayer perceptron to obtain a prediction score:
wherein e is the whole code, W1 TAndis a weight parameter of the first layer and the second layer, b1And b2Is the bias parameters of the first and second layers, σ () is the sigmoid function, ReLU () is the linear rectification function,
and mapping the prediction score into a range of [0,1] to obtain a possibility parameter of the interaction between the user and the entity.
In a specific application, the basic feature representation and the path representation are fused, and the interaction possibility parameter is calculated, as shown in the upper half of fig. 2.
After the user feature coding, the entity feature coding and the path coding are represented, three parts of coding vectors are combined into one representation, and feature interaction is carried out by utilizing a multilayer perceptron. And finally, predicting whether the user can generate interaction on the entity by using a sigmoid function.
The following describes the above method by way of example in practical application.
Suppose [ id, gender, age ] is selected as a user feature, each feature being coded with a dimension d of 3. As shown in FIG. 4, the input for encoding id is a one-hot vector of id, e.g., [0,0,1,0], followed by a fully-connected layer, resulting in a 3-dimensional encoded value of id. And (4) randomly initializing the weight of the full-connection layer, and continuously optimizing in the training process to obtain the final weight.
Similarly, gender and age can be coded to obtain 3-dimensional feature vector, and [ id, gender and age ] is obtained]The feature vectors are spliced to obtain the userIts dimension is 3 × 3 ═ 9.
Assume entity feature selection id, Category]The coding dimension d is also 3, each characteristic of the entity is coded and spliced, and the entity can be obtainedIts dimension is 2 × 3 ═ 6.
For path coding, as shown in fig. 3, first, a path with a length less than 6 between the target user and the target entity is extracted, and a path is selected, for exampleEncoding the entity and relationship and the encoding process of the user characteristics, thus obtaining guidance of [ Xiaoming, Purchase, machine learning, author, Zhou Zhi Hua, work, machine learning theory]Coding result of these 7 words xXiaoming liquor,xPurchasing,xMachine learning,xAuthors refer to,xZhou Zhi Hua,xWork on,xGuidance of machine learning theory]Then the result is sent to the LSTM model in sequence, and the dimension of the LSTM hidden layer is hn(e.g. h)n64) to obtain a final output h7As a result e of the encoding of the pathp1As shown in fig. 5 below:
assume that all paths between the target user and the target entity that satisfy the condition are p1,p2,......,pm]Then the coding results of all paths e can be obtainedp1,ep2,......,epm]. Accumulating the codes of all paths to obtain a comprehensive representation e of all paths from the user to the entityp。
The fusion representation method of the paths can be in a weighted summation mode, a splicing mode and the like besides accumulation.
After user coding, entity coding and path coding, splicing three parts of codes to obtain an integral code e, wherein the multilayer perceptron comprises two full-connection layers for mapping the integral code to an output prediction fraction:
wherein e is the whole code, W1 TAndis a weight parameter of the first layer and the second layer, b1And b2Is the bias-execution parameter of the first and second layers, σ () is the sigmoid function, ReLU () is the linear rectification function, maps the score to [0, 1%]And in the range, as the possibility parameter of whether the interaction is carried out, the calculation of the interaction possibility parameter between the target user and the target entity is completed.
As shown in fig. 6, this embodiment further provides a recommendation system based on a knowledge graph, which is applied to the recommendation method based on a knowledge graph, and includes:
the characteristic coding module is used for obtaining user characteristic codes and entity characteristic codes by carrying out characteristic integration on the own original characteristics of the users and the entities;
the path coding module is used for forming a knowledge graph according to the relation between the user and the entity, acquiring a path between the user and the entity from the knowledge graph, coding the relation between the user and the entity, sending a coding result into the model and outputting a path code;
the path synthesis module receives the path codes output by the path coding module, and outputs the synthesis code representation of all paths of the user and the entity after processing;
and the prediction module is used for receiving the user characteristic codes and the entity characteristic codes of the characteristic coding module, and calculating the possibility parameter of interaction between the user and the entity according to the comprehensive coded representation output by the path synthesis module.
In some embodiments, the feature coding module performs feature integration by using embedding according to sparse features or dense features of users and entities, converts the sparse features into multi-dimensional dense vectors, processes the dense features into normal distribution to obtain embedding of each feature of the users and the entities, and parameterizes the users and the entities into vector representation to obtain user feature codes and entity feature codes.
In some embodiments, the path coding module selects a path between the user and the entity according to the entity in the knowledge graph, the relationship between the entity and the entity, and the interaction behavior of the user, codes the user, the entity, and the relationship between the user and the entity, inputs the coding result into the RNN model, outputs the coding result of the path to the path synthesis module, and the path synthesis module receives the coding results of all paths between the user and the entity, and obtains the synthesis coding representation of all paths of the entity by the user through fusion processing.
In some embodiments, the prediction module includes a multi-layer perceptron, the multi-layer perceptron has two fully-connected layers, the prediction module splices the user feature code, the entity feature code and the synthesis path code into an overall code, and inputs the overall code into an input layer of the multi-layer perceptron to obtain the prediction score:
wherein e is the whole code, W1 TAndis a weight parameter of the first layer and the second layer, b1And b2Is the bias parameters of the first and second layers, σ () is the sigmoid function, ReLU () is the linear rectification function,
and mapping the prediction score into a range of [0,1] to obtain a possibility parameter of the interaction between the user and the entity. The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. An entity recommendation method based on knowledge graph is characterized by comprising the following steps:
step 1: the method comprises the steps of performing feature integration on original features of a user and an entity to obtain a user feature code and an entity feature code;
step 2: forming a knowledge graph according to the relation between a user and an entity, acquiring a path between the user and the entity from the knowledge graph, coding according to the relation between the user and the entity, and obtaining a comprehensive path code of the user for all paths of the entity through fusion processing;
and step 3: calculating a possibility parameter of interaction between the user and the entity according to the user feature code, the entity feature code and the comprehensive path code;
and 4, step 4: and recommending the entity according to the possibility parameter.
2. The knowledge-graph-based recommendation method according to claim 1, wherein the users and the entities have sparse features and dense features, and the step 1 comprises:
according to the sparse features or the dense features of the users and the entities, embedding is utilized for feature integration, the users and the entities are parameterized into vector representation, and the user feature codes and the entity feature codes are obtained.
3. The knowledge-graph-based recommendation method according to claim 2, wherein the specific steps of feature integration comprise: and converting the sparse features into multi-dimensional dense vectors, and processing the dense features into normal distribution to obtain embedding vectors of each feature of the user and the entity so as to obtain the user feature codes and the entity feature codes.
4. The knowledge-graph-based recommendation method according to claim 1, wherein the step 2 specifically comprises the steps of:
firstly, selecting a path between users and entities according to the entities in the knowledge graph, the relationship between the entities and the interaction behavior of the users, coding the users, the entities and the relationship between the users and the entities, and inputting a coding result into an RNN (radio network) model to obtain a coding result of the path;
and performing the coding on all paths between the user and the entity, and obtaining the comprehensive coded representation of all paths of the entity by the user through fusion processing.
5. The knowledge-graph-based recommendation method according to claim 1, wherein the step 3 comprises:
and splicing the user characteristic code, the entity characteristic code and the comprehensive path code into an integral code, performing characteristic interaction by using a multilayer perceptron, and calculating a possibility parameter of interaction between a user and an entity.
6. The knowledge-graph-based recommendation method according to claim 5, wherein the step 3 specifically comprises: splicing the user characteristic code, the entity characteristic code and the comprehensive path code into an integral code, wherein the multilayer perceptron has two fully-connected layers, and inputting the integral code into an input layer of the multilayer perceptron to obtain a prediction score:
wherein e is the whole code,andis a weight parameter of the first layer and the second layer, b1And b2Is the bias parameters of the first and second layers, σ () is the sigmoid function, ReLU () is the linear rectification function,
and mapping the prediction scores into a range of [0,1], and calculating a possibility parameter of the user and the entity to generate interaction.
7. A knowledge-graph-based recommendation system applied to the knowledge-graph-based recommendation method according to any one of claims 1 to 6, comprising:
the characteristic coding module is used for outputting a user characteristic code and an entity characteristic code by performing characteristic integration on the own original characteristics of the user and the entity;
the path coding module is used for forming a knowledge graph according to the relation between the user and the entity, acquiring the path between the user and the entity from the knowledge graph, coding the relation between the user and the entity, sending a coding result into a model and outputting a path code;
the path synthesis module receives the path codes output by the path coding module, and outputs the synthesis code representation of all paths of the user and the entity after processing;
and the prediction module is used for calculating a possibility parameter of interaction between the user and the entity according to the user characteristic code and the entity characteristic code output by the characteristic coding module and the comprehensive path code output by the path comprehensive module.
8. The knowledge-graph-based recommendation system according to claim 7, wherein the feature coding module performs feature integration by using embedding according to sparse features or dense features of users and entities, converts the sparse features into multi-dimensional dense vectors, processes the dense features into normal distribution, obtains embedding of each feature of the users and the entities, and parameterizes the users and the entities into vector representation, thereby obtaining the user feature codes and the entity feature codes.
9. The system of claim 8, wherein the path coding module selects a path between users and entities according to the entities in the knowledge graph, the relationship between the entities, and the interaction behavior of the users, codes the users, the entities, and the relationship between the users and the entities, inputs a coding result into the RNN model, and outputs a coding result of the path to the path synthesis module, and the path synthesis module receives coding results of all paths between the users and the entities, and performs fusion processing to obtain the comprehensive coding representation of all paths of the entities by the users.
10. The system according to claim 9, wherein the prediction module comprises a multi-layer perceptron, the multi-layer perceptron has two fully-connected layers, the prediction module concatenates the user feature code, the entity feature code, and the synthesis path code into an overall code, and the overall code is input to an input layer of the multi-layer perceptron to obtain the prediction score:
wherein e is the whole code, W1 TAndis a weight parameter of the first layer and the second layer, b1And b2Is the bias parameters of the first and second layers, σ () is the sigmoid function, ReLU () is the linear rectification function,
and mapping the prediction score to the range of [0,1] to obtain a possibility parameter of the interaction between the user and the entity.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010986792.XA CN112115210A (en) | 2020-09-18 | 2020-09-18 | Recommendation method and system based on knowledge graph |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010986792.XA CN112115210A (en) | 2020-09-18 | 2020-09-18 | Recommendation method and system based on knowledge graph |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112115210A true CN112115210A (en) | 2020-12-22 |
Family
ID=73799844
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010986792.XA Pending CN112115210A (en) | 2020-09-18 | 2020-09-18 | Recommendation method and system based on knowledge graph |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112115210A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109508419A (en) * | 2018-11-23 | 2019-03-22 | 成都品果科技有限公司 | A kind of recommended method and system of knowledge based study |
CN110275964A (en) * | 2019-06-26 | 2019-09-24 | 程淑玉 | The recommended models of knowledge based map and Recognition with Recurrent Neural Network |
CN110334221A (en) * | 2019-07-18 | 2019-10-15 | 桂林电子科技大学 | A kind of interpretation recommended method in knowledge based map path |
CN110516160A (en) * | 2019-08-30 | 2019-11-29 | 中国科学院自动化研究所 | User modeling method, the sequence of recommendation method of knowledge based map |
CN111061856A (en) * | 2019-06-06 | 2020-04-24 | 北京理工大学 | Knowledge perception-based news recommendation method |
CN111369318A (en) * | 2020-02-28 | 2020-07-03 | 安徽农业大学 | Commodity knowledge graph feature learning-based recommendation method and system |
US20200279147A1 (en) * | 2019-02-28 | 2020-09-03 | Baidu Online Network Technology (Beijing) Co., Ltd. | Method and apparatus for intelligently recommending object |
-
2020
- 2020-09-18 CN CN202010986792.XA patent/CN112115210A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109508419A (en) * | 2018-11-23 | 2019-03-22 | 成都品果科技有限公司 | A kind of recommended method and system of knowledge based study |
US20200279147A1 (en) * | 2019-02-28 | 2020-09-03 | Baidu Online Network Technology (Beijing) Co., Ltd. | Method and apparatus for intelligently recommending object |
CN111061856A (en) * | 2019-06-06 | 2020-04-24 | 北京理工大学 | Knowledge perception-based news recommendation method |
CN110275964A (en) * | 2019-06-26 | 2019-09-24 | 程淑玉 | The recommended models of knowledge based map and Recognition with Recurrent Neural Network |
CN110334221A (en) * | 2019-07-18 | 2019-10-15 | 桂林电子科技大学 | A kind of interpretation recommended method in knowledge based map path |
CN110516160A (en) * | 2019-08-30 | 2019-11-29 | 中国科学院自动化研究所 | User modeling method, the sequence of recommendation method of knowledge based map |
CN111369318A (en) * | 2020-02-28 | 2020-07-03 | 安徽农业大学 | Commodity knowledge graph feature learning-based recommendation method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111611472B (en) | Binding recommendation method and system based on graph convolution neural network | |
CN110263227B (en) | Group partner discovery method and system based on graph neural network | |
Sirat et al. | Neural trees: a new tool for classification | |
JP5395241B2 (en) | A method for determining whether an input vector is known or unknown by a neuron | |
US20190042911A1 (en) | System and method for learning the structure of deep convolutional neural networks | |
CN110892417A (en) | Asynchronous agent with learning coach and structurally modifying deep neural network without degrading performance | |
US20180082179A1 (en) | Systems and methods for deep learning with small training sets | |
KR102553041B1 (en) | Method, device and system for providing matching platform service between user and interior supplier based on artificial intelligence model | |
CN112541575B (en) | Method and device for training graph neural network | |
CN112287166A (en) | Movie recommendation method and system based on improved deep belief network | |
CN110991601A (en) | Neural network recommendation method based on multi-user behaviors | |
Chaubey et al. | Customer purchasing behavior prediction using machine learning classification techniques | |
CN116340648A (en) | Knowledge graph attention network recommendation method based on graph collaborative filtering | |
US20220230262A1 (en) | Patent assessment method based on artificial intelligence | |
KR20230069578A (en) | Sign-Aware Recommendation Apparatus and Method using Graph Neural Network | |
WO2019180314A1 (en) | Artificial neural networks | |
CN111445032B (en) | Method and device for decision processing by using business decision model | |
CN117273105A (en) | Module construction method and device for neural network model | |
CN112115210A (en) | Recommendation method and system based on knowledge graph | |
Liu | Airbnb price prediction with sentiment classification | |
CN116403608A (en) | Speech emotion recognition method based on multi-label correction and space-time collaborative fusion | |
CN115221410A (en) | Recommendation method and system based on desmooth graph convolution neural network | |
CN113378062A (en) | Graph collaborative filtering recommendation method based on decoupling and memory | |
KR20220073636A (en) | Method and apparatus for performing machine learning based on kernel density estimation | |
CN113420879A (en) | Prediction method and device of multi-task learning model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |