CN114048331A - Knowledge graph recommendation method and system based on improved KGAT model - Google Patents
Knowledge graph recommendation method and system based on improved KGAT model Download PDFInfo
- Publication number
- CN114048331A CN114048331A CN202111457641.6A CN202111457641A CN114048331A CN 114048331 A CN114048331 A CN 114048331A CN 202111457641 A CN202111457641 A CN 202111457641A CN 114048331 A CN114048331 A CN 114048331A
- Authority
- CN
- China
- Prior art keywords
- recommendation
- user
- graph
- knowledge
- article
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000012163 sequencing technique Methods 0.000 claims abstract description 18
- 230000003993 interaction Effects 0.000 claims abstract description 15
- 239000013598 vector Substances 0.000 claims description 40
- 230000006870 function Effects 0.000 claims description 23
- 238000003860 storage Methods 0.000 claims description 16
- 230000002776 aggregation Effects 0.000 claims description 9
- 238000004220 aggregation Methods 0.000 claims description 9
- 239000011159 matrix material Substances 0.000 claims description 9
- 238000012549 training Methods 0.000 claims description 7
- 230000007246 mechanism Effects 0.000 claims description 6
- 230000004927 fusion Effects 0.000 claims description 4
- 238000013519 translation Methods 0.000 claims description 4
- 230000004913 activation Effects 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 claims description 3
- 238000012512 characterization method Methods 0.000 claims description 3
- 230000009133 cooperative interaction Effects 0.000 claims description 3
- 238000005315 distribution function Methods 0.000 claims description 3
- 238000005457 optimization Methods 0.000 claims description 3
- 230000008447 perception Effects 0.000 claims description 3
- 238000004590 computer program Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 238000011156 evaluation Methods 0.000 description 5
- 238000001914 filtration Methods 0.000 description 4
- 238000013459 approach Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 3
- 238000005065 mining Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000002195 synergetic effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000012795 verification 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/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2415—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Biophysics (AREA)
- Animal Behavior & Ethology (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Probability & Statistics with Applications (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a knowledge graph recommendation method and a knowledge graph recommendation system based on an improved KGAT model; the method comprises the following steps: constructing a domain knowledge graph; taking a user as a node of a domain knowledge graph, adding historical interaction of the user and an article as a relation edge into the knowledge graph, and constructing a collaborative knowledge graph; learning the collaborative knowledge map by adopting an improved KGAT model to obtain vectorization representation of users and articles and weight information of adjacent edges of article nodes; sequencing all the item sets to be recommended, and selecting the first N items as the item sets to be recommended for the user; generating a recommendation reason based on the sequencing result and the weight information of the adjacent edges of the article nodes corresponding to the sequencing result in the collaborative knowledge graph; when the user requests recommendation, a recommendation list is generated and returned to the user together with the item according to the recommendation reason. The invention realizes the generation of the personalized recommendation list aiming at the user and can also generate the personalized recommendation reason, thereby improving the credibility of the recommendation result.
Description
Technical Field
The invention belongs to the technical field of machine learning, and particularly relates to a knowledge graph recommendation method and system based on an improved KGAT model.
Background
The recommendation system is one of effective tools for solving the problem of information overload, and generally comprises a user portrait modeling module, an article portrait modeling module and a recommendation algorithm module, wherein the recommendation algorithm is a core module. Recommendation algorithms are generally classified into demographic-based recommendations, content-based recommendations, and collaborative filtering algorithms. The algorithm based on collaborative filtering is the most widely applied and successful algorithm because the algorithm does not depend on the characteristic data of the user or the article, and only carries out recommendation according to the historical interaction data of the user and the article, but still has the problems of data sparseness, cold start and the like.
The knowledge graph is a part of knowledge engineering technology, is a huge heterogeneous information network, and has the basic constituent elements of a triple, such as (h, r, t) representing a triple, and h, r and t respectively representing a head node, a relation and a tail node. The knowledge graph establishes a deep semantic relation among the articles, so that more associated information among the articles can be mined, the knowledge graph is applied to a recommendation system, and the problems of data sparseness, cold start and the like can be effectively relieved.
There are generally three methods of applying knowledge-maps to recommendation systems: an embedding-based approach, a path-based approach, and a hybrid approach. The embedding-based method and the path-based method have advantages and disadvantages respectively, and the hybrid method is a more efficient method by combining the former two modes. A Knowledge Graph Attention Network model (KGAT) is a Knowledge Graph embedding learning model based on a hybrid mode, and not only utilizes node information of a Graph, but also utilizes relation information of edges of the Graph, and simultaneously gives weight information of the edges based on the learning mode of Attention.
Present KGAT model, it is at first based on TransR map embedding algorithm imbeds the study to the knowledge map, and the vector space at relation r place is projected to the triplex group data to the TransR model, and this projection process can bring the noise influence to influence the model performance, in addition, the attention allocation function of current knowledge map attention network model is too simple, improves it also will promote the model performance at a certain degree.
Disclosure of Invention
In view of the above analysis, the present invention aims to disclose a knowledge-graph recommendation method and system based on an improved KGAT model, which solve the problems of the existing KGAT model and realize the generation of personalized recommendation reasons.
The invention discloses a knowledge graph recommendation method based on an improved KGAT model, which comprises the following steps:
constructing a domain knowledge graph by constructing a mode layer and a graph database of the knowledge graph;
taking a user as a node of the domain knowledge graph, adding historical interaction of the user and an article as a relation edge into the knowledge graph, and constructing a collaborative knowledge graph;
learning the collaborative knowledge map by adopting an improved KGAT model to obtain vectorization representation of users and articles and weight information of adjacent edges of article nodes; in the improved KGAT model, a three-layer MLP network is adopted as an attention distribution function to generate weight information;
sequencing all the item sets to be recommended, and selecting the first N items as the item sets to be recommended to the user finally;
generating a recommendation reason based on the sequencing result and the weight information of the adjacent edges of the article nodes corresponding to the sequencing result in the collaborative knowledge graph; and when the user requests recommendation, generating a recommendation list together with the item by the recommendation reason and returning the recommendation list to the user.
Further, in the process of learning the collaborative knowledge map by adopting an improved KGAT model,
simultaneously learning the structure information of the map and the cooperative interaction information of the user and the article in a joint learning mode by utilizing an improved KGAT model to obtain vectorized representation of the structure information of the map and the historical interaction information of the user and the article; learning based on an attention mechanism to obtain weight information of adjacent edges of the object nodes in the collaborative knowledge graph; and saving the learned vectorized representation of the user and the article and the weight information of the adjacent edges of the article nodes.
Further, the improved KGAT model comprises a map embedding learning layer, an attention propagation layer and a prediction layer;
the map embedding learning layer is used for adopting a distance-based translation model transR map embedding algorithm to learn vector representation of entity nodes of the map;
the attention propagation layer is used for carrying out information propagation, knowledge perception attention and information aggregation to obtain multilayer user node vector representation and multilayer article node vector representation;
and the prediction layer performs model prediction and optimization according to the output of the information transmission layer to obtain the characterization vectors of the user and the article.
Further, in the information dissemination layer, the three-layer MLP network as the attention allocation function is represented as:
where ω' (h, r, t) is the attention-assignment function; relu is a hidden layer activation function;erandan embedded vector in a vector space determined for the relationship r; w1、W2A trainable weight parameter matrix, an operation by bit;
Further, an aggregation function for information aggregation in the information propagation layer is as follows:
wherein e ishAtlas inlayThe node representation learned by the entry layer,represents the head node h as the weighted sum of the tail nodes connected with the head node h; wherein "" indicates a bitwise multiplication operation, W3、W4Is a trainable parameter matrix;
wherein, is a representation of the tail node t generated by the previous layer information propagation step.
Further, the sorting all the item sets to be recommended includes:
1) recalling all the item sets to be recommended to obtain a candidate recommended item set of a rough sorting result;
2) loading feature vectors of the trained users and the trained articles according to the recommendation target users and the candidate article sets to be recommended, and multiplying the feature vectors of the users and the feature vectors of all the articles to be used as predicted click probabilities of the users on the articles;
3) and sorting the candidate item sets to be recommended according to the click probability from large to small, selecting the first N items as the item sets to be recommended for the user finally, and storing the item sets.
Further, when a recommendation reason is generated, according to the sorting result, the weight information of all adjacent edges of the nodes in the corresponding collaborative knowledge graph is obtained, the edge with the largest weight is selected, then a recommendation explanation is generated according to the type or the attribute of the edge, the generated recommendation reason and the corresponding article are stored together, and when a user requests recommendation, a recommendation list is generated together with the article and returned to the user.
The invention discloses a knowledge-graph recommendation system based on an improved KGAT model, which comprises the following components:
the domain knowledge graph building module is used for building and storing a mode layer of the knowledge graph; importing the acquired data layer data into a graph database after knowledge fusion;
the collaborative knowledge graph building module is used for taking a user as a node of the knowledge graph and adding historical interaction of the user and an article as an edge of a representative relationship into the knowledge graph to build the collaborative knowledge graph;
the map embedding and recommendation model training module is used for learning the collaborative knowledge map by adopting a KGAT model to obtain a set of all articles to be recommended;
the sorting module is used for sorting all the item sets to be recommended and selecting the first N items as the item sets to be recommended to the user finally;
the recommendation reason generating module is used for generating a recommendation reason based on the sequencing result and the weight information of the edges adjacent to the article nodes corresponding to the sequencing result in the collaborative knowledge graph; and storing the recommendation reason together with the corresponding article, and generating a recommendation list together with the article and returning the recommendation list to the user when the user requests recommendation.
In another aspect, the present invention discloses an electronic device, including:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the improved KGAT model-based knowledge-graph recommendation method as described above.
In another aspect, the present invention discloses a computer readable medium, on which a computer program is stored, which when executed by a processor implements the improved KGAT model-based knowledge-map recommendation method as described above.
The invention can realize at least one of the following beneficial effects:
the invention realizes the generation of the personalized recommendation list aiming at the user and can also generate the personalized recommendation reason, thereby improving the credibility of the recommendation result.
Compared with the existing KGAT model, the improved KGAT model reduces the noise influence caused by the adoption of the TransR projection process, the improved attention allocation function adopts a three-layer MLP network to replace the dot product operation of the attention allocation function in the reference model, and more accurate weight data are obtained through training. Experimental results on three common data sets demonstrate that the performance of the model is superior to the existing methods.
Drawings
The drawings are only for purposes of illustrating particular embodiments and are not to be construed as limiting the invention, wherein like reference numerals are used to designate like parts throughout.
FIG. 1 is a flow diagram of a knowledge-graph recommendation method in an embodiment of the invention;
FIG. 2 is a schematic diagram of a collaborative knowledge graph according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an improved KGAT model according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating mining of first-order connectivity information of neighboring nodes according to an embodiment of the present invention;
FIG. 5 is a block diagram illustrating the connections of the components of the knowledge-graph recommendation system in an embodiment of the invention;
FIG. 6 is a schematic block diagram of the connection of electronic device components in an embodiment of the present invention;
FIG. 7 is a block diagram of a computer-readable medium in an embodiment of the invention.
Detailed Description
The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form a part hereof, and which together with the embodiments of the invention serve to explain the principles of the invention.
Example one
The embodiment discloses a knowledge graph recommendation method based on an improved KGAT model, as shown in fig. 1, including:
s1, constructing a domain knowledge graph by constructing a mode layer and a graph database of the knowledge graph;
s2, taking the user as a node of the domain knowledge graph, adding historical interaction of the user and the article as a relation edge into the knowledge graph, and constructing a collaborative knowledge graph;
step S3, learning the collaborative knowledge map by adopting an improved KGAT model to obtain vectorization representation of users and articles and weight information of adjacent edges of article nodes; in the improved KGAT model, a three-layer MLP network is adopted as an attention distribution function to generate weight information;
s4, sequencing all the item sets to be recommended, and selecting the first N items as the item sets to be recommended to the user finally;
step S5, generating a recommendation reason based on the sequencing result and the weight information of the adjacent edges of the article nodes corresponding to the sequencing result in the collaborative knowledge graph; and when the user requests recommendation, generating a recommendation list together with the item by the recommendation reason and returning the recommendation list to the user.
Specifically, in step S1, a top-down construction method is adopted, and a knowledge graph pattern layer body framework is first constructed and stored. Then acquiring data layer data from a structured or unstructured data source, and storing the data layer data into a graph database after knowledge fusion; the data source is actually acquired data existing in reality.
Specifically, in step S2, the constructed collaborative knowledge map is mainly served by the improved KGAT model in this embodiment, and is used to learn the characteristics of the articles and the associated characteristics of the articles in the knowledge map, and learn the user characteristics at the same time, so that the collaborative filtering idea can be applied to recommendation. The structure of the collaborative knowledge graph is schematically shown in FIG. 2. The construction method comprises the steps of firstly using a user as a node of a knowledge graph, and then adding historical interaction of the user and an article into the knowledge graph as an edge of a representative relationship. The construction of the collaborative knowledge graph does not change the domain knowledge graph structure in step S1, but only adds the historical interaction data of the user and the article to the graph data saved in the form of the triplet (h, r, t) in the domain knowledge graph-derived data file referred to in module 1.
Not generally, taking a movie recommendation as an example, the items 1, 2, 3, 4 in FIG. 2 may be names of movies, and the entities 1, 2, 3 may be names of stars, where the relationship r1To interact, r2For director, r3Is a lead actor.
Specifically, in the step S3, in learning the collaborative knowledge map by using the improved KGAT model, the improved KGAT model is used to simultaneously learn the structure information of the map and the collaborative interaction information of the user and the article in a joint learning manner, so as to obtain vectorized representation of the map structure information and the historical interaction information of the user and the article; learning based on an attention mechanism to obtain weight information of adjacent edges of the object nodes in the collaborative knowledge graph; and saving the learned vectorized representation of the user and the article and the weight information of the adjacent edges of the article nodes.
The structure of the improved KGAT model is schematically shown in FIG. 3, and comprises a map embedding learning layer, an attention propagation layer and a prediction layer;
the map embedding learning layer is used for adopting a distance-based translation model transR map embedding algorithm to learn vector representation of entity nodes of the map;
the attention propagation layer is used for carrying out information propagation, knowledge perception attention and information aggregation to obtain multilayer user node vector representation and multilayer article node vector representation;
and the prediction layer performs model prediction and optimization according to the output of the information transmission layer to obtain the characterization vectors of the user and the article.
The specific implementation process of the model is as follows:
1) map embedding layer:
learning vector representation of entity nodes of the graph by adopting a distance-based translation model transR graph embedding algorithm, and assuming that the triples (h, r, t) are in the close stateThe embedded vector representations in the vector space determined by the system r are respectivelyerAndthen they have the relationship:
let WrIs a projection matrix, then there is a distance formula between the three:
wherein | | | purple hair2Is a norm of L2 and,Wr∈Rk×dis a trainable parameter transformation matrix; e.g. of the typeh、et∈Rd,er∈Rk,eh、etIs a d-dimensional embedded vector representation of entity h, entity t, and er is a k-dimensional embedded vector representation of relationship r.
Then a loss function is established based on the distance:
LKG=∑(h,r,t,t′)∈T-lnδ(g(h,r,t′)-g(h,r,t));
2) An information propagation layer:
and mining the first-order connected information adjacent to the nodes in a graph convolution mode, and then recursively mining the higher-order connected information. As shown in fig. 4, to mine the first order connectivity information of neighboring nodes, the head node h can be represented as a weighted sum of the tail nodes connected thereto:
where ω (h, r, t) is the weight of the relation r, etIs an embedded vector learned based on TransR in the previous layer,is a weighted summed node representation, distinct from a graph-embedded representation vector e of a head node learned based on TransRh. The weight ω (h, r, t) is obtained based on attention mechanism learning.
Preferably, the attention-sharing function employs a three-layer MLP network. The three-layer MLP network as a function of attention allocation is represented as
Wherein relu is a hidden layer activation function;i.e. et,ehMapping in vector space where the relation r is located, respectively.Is an approximate representation of the tail node in the vector space of the relation rW1、W2An element of a trainable weight parameter matrix indicates a bitwise multiplication operation. Then, performing normalization processing by adopting a softmax function:
Will be provided withNode representation e learned with graph embedding layerhAnd performing information aggregation, wherein an aggregation function is as follows:
indicating that a node information representation fused with a one-layer relationship, wherein "" indicates a bitwise multiplication operation, W3、W4Is a matrix of trainable parameters.
Repeating the steps, and iterating to obtain the L-th layer representation e related to the entity(l):
Wherein Is a representation of the tail node t generated by the previous layer information propagation step, NhIs a set of triples (h, r, t).
3) Prediction layer:
representing the obtained multi-layer user node vectorAnd multi-layer article node vector representationMultiplying to obtain a predicted score
The multi-layer vector representation of the user and the article node is to connect vector representations of different layers, namely:
the final pre-measured score was:
the final loss function is the synergistic loss L of user interaction with the objectCFLoss of spectrum L of the first layerKGAnd then adding a parameter regularization term:
collaborative loss L of user interaction with an itemCFIs defined as:
wherein O { (u, i, j) | (u, i) ∈ R+,(u,j)∈R-},R+As a positive example, R-For negative example samples, δ is the sigmoid function.
Specifically, in step S4, the sorting all the item sets to be recommended includes:
1) recalling all the item sets to be recommended to obtain a candidate recommended item set of a rough sorting result;
the recalling adopts a recalling algorithm based on articles, collaborative filtering, hot statistics and the like, and the candidate to-be-recommended article set obtained by recalling is a set which is much smaller than all the article sets to be recommended.
2) Loading feature vectors of the trained users and the trained articles according to the recommendation target users and the candidate article sets to be recommended, and multiplying the feature vectors of the users and the feature vectors of all the articles to be used as predicted click probabilities of the users on the articles;
3) and sorting the candidate item sets to be recommended according to the click probability from large to small, selecting the first N items as the item sets to be recommended for the user finally, and storing the item sets.
Specifically, in step S5, the weight information of the edges adjacent to the item node corresponding to the sorting result in the knowledge graph obtained by the model training in step S3 is based on the sorting result in step S4.
More specifically, according to the sorting result, the weight information of all adjacent edges of the nodes in the corresponding knowledge graph is obtained, the edge with the largest weight is selected, then a recommendation explanation is generated according to the type or the attribute of the edge, the generated recommendation reason and the corresponding article are stored together, and when the user requests recommendation, a recommendation list is generated together with the article and returned to the user.
In conclusion, the embodiment realizes that the personalized recommendation list is generated for the user, and meanwhile, the personalized recommendation reason can also be generated, so that the credibility of the recommendation result is improved.
Compared with the existing KGAT model, the improved KGAT model reduces the noise influence caused by the adoption of the TransR projection process, the improved attention allocation function adopts a three-layer MLP network to replace the dot product operation of the attention allocation function in the reference model, and more accurate weight data are obtained through training. Experimental results on three common data sets demonstrate that the performance of the model is superior to the existing methods.
Example two
The embodiment discloses a knowledge-graph recommendation system based on an improved KGAT model, as shown in fig. 5, including:
the domain knowledge graph building module is used for building and storing a mode layer of the knowledge graph; importing the acquired data layer data into a graph database after knowledge fusion;
the collaborative knowledge graph building module is used for taking a user as a node of the knowledge graph and adding historical interaction of the user and an article as an edge of a representative relationship into the knowledge graph to build the collaborative knowledge graph;
the map embedding and recommendation model training module is used for learning the collaborative knowledge map by adopting a KGAT model to obtain a set of all articles to be recommended;
the sorting module is used for sorting all the item sets to be recommended and selecting the first N items as the item sets to be recommended to the user finally;
the recommendation reason generating module is used for generating a recommendation reason based on the sequencing result and the weight information of the edges adjacent to the article nodes corresponding to the sequencing result in the collaborative knowledge graph; and storing the recommendation reason together with the corresponding article, and generating a recommendation list together with the article and returning the recommendation list to the user when the user requests recommendation.
The specific technical details and advantageous effects in this embodiment are the same as those in the first embodiment, and please refer to the first embodiment, which is not repeated herein.
EXAMPLE III
This example demonstrates the effectiveness of the improved knowledge-graph proposed by the present invention in comparison to existing methods across multiple data sets.
1. Data set
Three data sets of Amazon-book, LastFM and Yelp2018 are selected in the experiment, and the description of the relevant data sets is shown in Table 1:
TABLE 1
2. Evaluation index
In the embodiment, three model evaluation indexes of accuracy (accuracycacy), precision (precision) and recall (call) are selected. In the test data set, in combination with the prediction result, the recommended definition that is also interesting to the user is TP, the recommended definition that is not interesting to the user is FP, the non-recommended definition that is not interesting to the user is FN, and the non-recommended definition that is not interesting to the user is TN. The above concepts may be described as a confusion matrix, as in table 2 below.
TABLE 2
Of interest to the user (obverse type) | The user is not interested (negative type) | |
Is recommended to | TP | FP |
Is not recommended | FN | TN |
The accuracy rate represents the proportion of all the items which are recommended and are not interested by the user to the total number of samples, namely:
the precision rate is also called precision rate, and represents the proportion of the recommended items of interest to all the recommended items, namely:
the recall rate is also called recall rate, and represents the proportion of the recommended user interest items to all the user interest items, namely:
3. learning process
In learning, the data set is divided according to a ratio of 2:8, wherein 20% of the data set is used as a verification data set, 80% of the data set is used as a training set, the size of an embedded vector is set to 64, the batch processing size is set to 1024, the learning rate range is adjusted to be 0.1-0.001, and the regularization parameter coefficient is initialized to be 0. In the process of the embodiment, after the model of the embodiment is iterated for 100 times, the accuracy of the model reaches the best.
4. Comparison results
The present invention compares The results on three Data sets with The results shown in The database of The invention for evaluation of Data in The database of evaluation of Data in evaluation of, the performance of the improved knowledge graph attention network model provided by the invention is obviously superior to that of a comparison method.
TABLE 3
Example four
The present embodiment discloses an electronic device, and its block diagram is shown in fig. 6, and the electronic device 900 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As in fig. 6, the electronic device 600 is embodied in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 that connects the various system components (including the storage unit 620 and the processing unit 610), a display unit 640, and the like.
The storage unit stores a program code, which can be executed by the processing unit 610, so that the processing unit 610 executes the improved KGAT model-based knowledge-graph recommendation method according to the first embodiment.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)6201 and/or a cache memory unit 6202, and may further include a read-only memory unit (ROM) 6203.
The memory unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
EXAMPLE five
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware.
Therefore, as shown in fig. 7, the technical solution according to the embodiment of the present invention may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiment of the present invention.
The software product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The computer readable medium carries one or more programs which, when executed by the apparatus, implement the improved KGAT model-based knowledge-graph recommendation method as described in embodiment one.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention.
Claims (10)
1. A knowledge graph recommendation method based on an improved KGAT model is characterized by comprising the following steps:
constructing a domain knowledge graph by constructing a mode layer and a graph database of the knowledge graph;
taking a user as a node of the domain knowledge graph, adding historical interaction of the user and an article as a relation edge into the knowledge graph, and constructing a collaborative knowledge graph;
learning the collaborative knowledge map by adopting an improved KGAT model to obtain vectorization representation of users and articles and weight information of adjacent edges of article nodes; in the improved KGAT model, a three-layer MLP network is adopted as an attention distribution function to generate weight information;
sequencing all the item sets to be recommended, and selecting the first N items as the item sets to be recommended to the user finally;
generating a recommendation reason based on the sequencing result and the weight information of the adjacent edges of the article nodes corresponding to the sequencing result in the collaborative knowledge graph; and when the user requests recommendation, generating a recommendation list together with the item by the recommendation reason and returning the recommendation list to the user.
2. The knowledge-graph recommendation method according to claim 1, wherein in learning the collaborative knowledge-graph using an improved KGAT model,
simultaneously learning the structure information of the map and the cooperative interaction information of the user and the article in a joint learning mode by utilizing an improved KGAT model to obtain vectorized representation of the structure information of the map and the historical interaction information of the user and the article; learning based on an attention mechanism to obtain weight information of adjacent edges of the object nodes in the collaborative knowledge graph; and saving the learned vectorized representation of the user and the article and the weight information of the adjacent edges of the article nodes.
3. The knowledge-graph recommendation method according to claim 2, wherein said modified KGAT model comprises a graph embedding learning layer, an attention propagation layer and a prediction layer;
the map embedding learning layer is used for adopting a distance-based translation model transR map embedding algorithm to learn vector representation of entity nodes of the map;
the attention propagation layer is used for carrying out information propagation, knowledge perception attention and information aggregation to obtain multilayer user node vector representation and multilayer article node vector representation;
and the prediction layer performs model prediction and optimization according to the output of the information transmission layer to obtain the characterization vectors of the user and the article.
4. The knowledge-graph recommendation method according to claim 3, wherein, in the information dissemination layer, the three-layer MLP network as the attention allocation function is represented as:
where ω' (h, r, t) is the attention-assignment function; relu is a hidden layer activation function;erandan embedded vector in a vector space determined for the relationship r; w1、W2A trainable weight parameter matrix, an operation by bit;
5. The knowledge-graph recommendation method of claim 4, wherein the aggregation function for information aggregation in the information dissemination layer is as follows:
wherein e ishThe node representations learned by the graph embedding layer,represents the head node h as the weighted sum of the tail nodes connected with the head node h; w3、W4Is a trainable parameter matrix;
6. The knowledge-graph recommendation method of claim 1,
the sorting of all the item sets to be recommended includes:
1) recalling all the item sets to be recommended to obtain a candidate recommended item set of a rough sorting result;
2) loading feature vectors of the trained users and the trained articles according to the recommendation target users and the candidate article sets to be recommended, and multiplying the feature vectors of the users and the feature vectors of all the articles to be used as predicted click probabilities of the users on the articles;
3) and sorting the candidate item sets to be recommended according to the click probability from large to small, selecting the first N items as the item sets to be recommended for the user finally, and storing the item sets.
7. The knowledge graph recommendation method according to claim 1, wherein when a recommendation reason is generated, according to a sorting result, weight information of all adjacent edges of nodes in the corresponding collaborative knowledge graph is obtained, an edge with the largest weight is selected, then a recommendation explanation is generated according to the type or attribute of the edge, the generated recommendation reason is stored together with the corresponding article, and when a user requests recommendation, a recommendation list is generated together with the article and returned to the user.
8. A knowledge-graph recommendation system based on an improved KGAT model is characterized by comprising:
the domain knowledge graph building module is used for building and storing a mode layer of the knowledge graph; importing the acquired data layer data into a graph database after knowledge fusion;
the collaborative knowledge graph building module is used for taking a user as a node of the knowledge graph and adding historical interaction of the user and an article as an edge of a representative relationship into the knowledge graph to build the collaborative knowledge graph;
the map embedding and recommendation model training module is used for learning the collaborative knowledge map by adopting a KGAT model to obtain a set of all articles to be recommended;
the sorting module is used for sorting all the item sets to be recommended and selecting the first N items as the item sets to be recommended to the user finally;
the recommendation reason generating module is used for generating a recommendation reason based on the sequencing result and the weight information of the edges adjacent to the article nodes corresponding to the sequencing result in the collaborative knowledge graph; and storing the recommendation reason together with the corresponding article, and generating a recommendation list together with the article and returning the recommendation list to the user when the user requests recommendation.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the improved KGAT model-based knowledge-graph recommendation method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, implements the improved KGAT model-based knowledge-graph recommendation method according to any one of claims 1 to 7.
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111457641.6A CN114048331A (en) | 2021-12-01 | 2021-12-01 | Knowledge graph recommendation method and system based on improved KGAT model |
PCT/CN2022/081055 WO2023097929A1 (en) | 2021-12-01 | 2022-03-16 | Knowledge graph recommendation method and system based on improved kgat model |
ZA2024/01818A ZA202401818B (en) | 2021-12-01 | 2024-03-01 | Knowledge graph recommendation method and system based on improved kgat model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111457641.6A CN114048331A (en) | 2021-12-01 | 2021-12-01 | Knowledge graph recommendation method and system based on improved KGAT model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114048331A true CN114048331A (en) | 2022-02-15 |
Family
ID=80212007
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111457641.6A Withdrawn CN114048331A (en) | 2021-12-01 | 2021-12-01 | Knowledge graph recommendation method and system based on improved KGAT model |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN114048331A (en) |
WO (1) | WO2023097929A1 (en) |
ZA (1) | ZA202401818B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115221413A (en) * | 2022-08-03 | 2022-10-21 | 湖北工业大学 | Sequence recommendation method and system based on interactive graph attention network |
CN115934990A (en) * | 2022-10-24 | 2023-04-07 | 北京数慧时空信息技术有限公司 | Remote sensing image recommendation method based on content understanding |
WO2023097929A1 (en) * | 2021-12-01 | 2023-06-08 | 浙江师范大学 | Knowledge graph recommendation method and system based on improved kgat model |
CN117252664A (en) * | 2023-11-10 | 2023-12-19 | 浙江口碑网络技术有限公司 | Medicine recommendation reason generation method, device, medium and equipment |
CN117290611A (en) * | 2023-11-24 | 2023-12-26 | 北京信立方科技发展股份有限公司 | Instrument recommendation method and device based on multi-level knowledge graph |
Families Citing this family (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116541538B (en) * | 2023-07-06 | 2023-09-01 | 广东信聚丰科技股份有限公司 | Intelligent learning knowledge point mining method and system based on big data |
CN117033775B (en) * | 2023-07-28 | 2024-03-19 | 广东工业大学 | Knowledge graph-based industrial software component recommendation method and system |
CN117056575B (en) * | 2023-10-12 | 2024-01-30 | 深圳市华图测控系统有限公司 | Method for data acquisition based on intelligent book recommendation system |
CN117216417B (en) * | 2023-11-07 | 2024-02-20 | 北京智谱华章科技有限公司 | Recommendation method, device, equipment and medium for fusing knowledge information and collaborative information |
CN117539996B (en) * | 2023-11-21 | 2024-07-16 | 北京拓医医疗科技服务有限公司 | Consultation question-answering method and system based on user portrait |
CN117609466A (en) * | 2023-12-04 | 2024-02-27 | 北方工业大学 | Voice intelligent question-answering system based on big data analysis |
CN117573904B (en) * | 2024-01-17 | 2024-04-30 | 广东讯飞启明科技发展有限公司 | Multimedia teaching resource knowledge graph generation method and system based on recognition analysis |
CN117688247B (en) * | 2024-01-31 | 2024-04-12 | 云南大学 | Recommendation method, terminal device and storage medium |
CN117992679B (en) * | 2024-02-23 | 2024-07-05 | 宁夏大学 | Project recommendation method, system and computer equipment |
CN118013135B (en) * | 2024-02-29 | 2024-07-02 | 重庆理工大学 | Graph comparison learning recommendation method based on relationship graph convolution neural network |
CN117952724B (en) * | 2024-03-21 | 2024-06-14 | 烟台大学 | Article recommendation method, system and equipment based on knowledge graph and neural network |
CN118227884A (en) * | 2024-04-12 | 2024-06-21 | 东莞市依加易电子科技有限公司 | Personalized recommendation system and method based on knowledge graph and collaborative filtering |
CN118052291B (en) * | 2024-04-16 | 2024-06-25 | 北京海纳数聚科技有限公司 | Vertical domain large language model training method based on expansion causal graph embedding |
CN118133883B (en) * | 2024-05-06 | 2024-08-27 | 杭州海康威视数字技术股份有限公司 | Graph sampling method, graph prediction method, and storage medium |
CN118277675B (en) * | 2024-06-03 | 2024-08-30 | 松立控股集团股份有限公司 | Similar parking lot recommendation method and system based on space-time knowledge graph |
CN118606453A (en) * | 2024-06-12 | 2024-09-06 | 北京粉笔蓝天科技有限公司 | Interview guiding method and system based on large model and artificial intelligence |
CN118377979B (en) * | 2024-06-24 | 2024-09-27 | 杭州电子科技大学 | Interest point recommendation method and medium based on time sequence knowledge graph and electronic equipment |
CN118521840B (en) * | 2024-07-24 | 2024-10-29 | 中国交通信息科技集团有限公司杭州分公司 | Intelligent recommendation method and system based on BIM (building information modeling) component |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190266497A1 (en) * | 2018-02-23 | 2019-08-29 | Microsoft Technology Licensing, Llc | Knowledge-graph-driven recommendation of career path transitions |
CN112199508B (en) * | 2020-08-10 | 2024-01-19 | 淮阴工学院 | Parameter self-adaptive agricultural knowledge graph recommendation method based on remote supervision |
CN113158033A (en) * | 2021-03-19 | 2021-07-23 | 浙江工业大学 | Collaborative recommendation model construction method based on knowledge graph preference propagation |
CN114048331A (en) * | 2021-12-01 | 2022-02-15 | 浙江师范大学 | Knowledge graph recommendation method and system based on improved KGAT model |
-
2021
- 2021-12-01 CN CN202111457641.6A patent/CN114048331A/en not_active Withdrawn
-
2022
- 2022-03-16 WO PCT/CN2022/081055 patent/WO2023097929A1/en unknown
-
2024
- 2024-03-01 ZA ZA2024/01818A patent/ZA202401818B/en unknown
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023097929A1 (en) * | 2021-12-01 | 2023-06-08 | 浙江师范大学 | Knowledge graph recommendation method and system based on improved kgat model |
CN115221413A (en) * | 2022-08-03 | 2022-10-21 | 湖北工业大学 | Sequence recommendation method and system based on interactive graph attention network |
CN115934990A (en) * | 2022-10-24 | 2023-04-07 | 北京数慧时空信息技术有限公司 | Remote sensing image recommendation method based on content understanding |
CN117252664A (en) * | 2023-11-10 | 2023-12-19 | 浙江口碑网络技术有限公司 | Medicine recommendation reason generation method, device, medium and equipment |
CN117290611A (en) * | 2023-11-24 | 2023-12-26 | 北京信立方科技发展股份有限公司 | Instrument recommendation method and device based on multi-level knowledge graph |
CN117290611B (en) * | 2023-11-24 | 2024-02-23 | 北京信立方科技发展股份有限公司 | Instrument recommendation method and device based on multi-level knowledge graph |
Also Published As
Publication number | Publication date |
---|---|
ZA202401818B (en) | 2024-10-30 |
WO2023097929A1 (en) | 2023-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114048331A (en) | Knowledge graph recommendation method and system based on improved KGAT model | |
WO2023000574A1 (en) | Model training method, apparatus and device, and readable storage medium | |
CN112529168B (en) | GCN-based attribute multilayer network representation learning method | |
CN110796190B (en) | Exponential modeling with deep learning features | |
CN113535984B (en) | Knowledge graph relation prediction method and device based on attention mechanism | |
TWI612488B (en) | Computer device and method for predicting market demand of commodities | |
CN109766557B (en) | Emotion analysis method and device, storage medium and terminal equipment | |
CA3053531A1 (en) | Method and apparatus of machine learning using a network with software agents at the network nodes and then ranking network nodes | |
CN112966114B (en) | Literature classification method and device based on symmetrical graph convolutional neural network | |
WO2021034932A1 (en) | Automated path-based recommendation for risk mitigation | |
CN112905801A (en) | Event map-based travel prediction method, system, device and storage medium | |
Lee et al. | Streamlined mean field variational Bayes for longitudinal and multilevel data analysis | |
CN112861936A (en) | Graph node classification method and device based on graph neural network knowledge distillation | |
CN112131261A (en) | Community query method and device based on community network and computer equipment | |
CN112069404A (en) | Commodity information display method, device, equipment and storage medium | |
CN111178986A (en) | User-commodity preference prediction method and system | |
CN116992151A (en) | Online course recommendation method based on double-tower graph convolution neural network | |
CN116208399A (en) | Network malicious behavior detection method and device based on metagraph | |
CN112055038B (en) | Method for generating click rate estimation model and method for predicting click probability | |
CN115879508A (en) | Data processing method and related device | |
Zekić-Sušac et al. | Modeling the cost of energy in public sector buildings by linear regression and deep learning | |
WO2023174064A1 (en) | Automatic search method, automatic-search performance prediction model training method and apparatus | |
Liu | POI recommendation model using multi-head attention in location-based social network big data | |
CN117010480A (en) | Model training method, device, equipment, storage medium and program product | |
Zong et al. | Research on the Decision Model of Product Design Based on a Deep Residual Network |
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 | ||
CB03 | Change of inventor or designer information |
Inventor after: Xu Huiying Inventor after: Zhu Xinzhong Inventor after: Jin Lintong Inventor before: Zhu Xinzhong Inventor before: Xu Huiying Inventor before: Jin Lintong |
|
CB03 | Change of inventor or designer information | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20220215 |
|
WW01 | Invention patent application withdrawn after publication |