Knowledge graph embedding method and system for intelligent knowledge recommendation
By combining knowledge graph embedding and deep reinforcement learning technology, a complex knowledge intelligent recommendation framework is designed, and a TransEx knowledge graph embedding method is proposed, which solves the problem of poor quality of knowledge graph embedding and improves the accuracy and intelligence of knowledge recommendation.
Patent Information
- Application Number
- CN202411400782.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, the quality of knowledge graph embedding is poor, making it difficult to characterize the rich structural and semantic relationships of the knowledge graph, resulting in low accuracy of knowledge recommendation.
A knowledge graph embedding method for knowledge intelligent recommendation is proposed. Combining knowledge graph embedding and deep reinforcement learning technology, a complex knowledge intelligent recommendation framework is designed, and attention mechanism and complex value embedding is integrated. A TransEx knowledge graph embedding method is proposed to preserve the structure and semantic relationship of the graph.
It improves the accuracy of knowledge graph embedding, enhances the intelligence and interpretability of knowledge recommendations, promotes the efficient use of enterprise historical knowledge in product design and process planning, improves product design/process planning quality and shortens cycles.
Smart Images

Figure CN119808908A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent information technology of advanced manufacturing technology, and specifically relates to a knowledge graph embedding method and system for knowledge intelligent recommendation. Background Art
[0002] Knowledge engineering is the development of artificial intelligence in knowledge processing, which aims to solve engineering problems by reusing human knowledge and experience through computer systems. In this field, there have been many studies and explorations on knowledge-assisted manufacturing decision-making. As a cutting-edge technology of knowledge engineering, knowledge graph (KG) can realize the acquisition, organization and utilization of massive knowledge, and provide a basis for building the learning and cognitive ability of intelligent manufacturing systems. Knowledge graph comes from Google's next-generation intelligent semantic search engine technology. It is essentially based on the idea of semantic network. It is a semantic knowledge base with a directed graph structure, which is used to describe concepts and their relationships in the physical world in symbolic form. Knowledge graph has the following three characteristics: 1) The storage structure of data and knowledge is a directed graph structure. The directed graph structure allows the knowledge graph to effectively store the relationship between data and knowledge; 2) It has efficient data and knowledge retrieval capabilities. Knowledge graph can achieve efficient data and knowledge access through graph matching algorithms; 3) It has intelligent data and knowledge reasoning capabilities. Knowledge graph can automatically and intelligently discover and reason about implicit knowledge from multiple perspectives from existing knowledge.
[0003] Introducing knowledge graphs into the knowledge recommendation system in the field of intelligent manufacturing can obtain more semantic information, and can more deeply explore the correlation between user search intentions and knowledge, while providing explainability for the recommendation process and improving user satisfaction and acceptance of recommendation results. Knowledge Graph Embedding (KGE) is a technology that maps entities and relationships in knowledge graphs into continuous vector spaces. Through this mapping, knowledge originally stored in graph structures is converted into vector representations in low-dimensional space. These vector representations capture the semantic and structural information between entities and relationships. With the help of the information embedded in the knowledge graph, the knowledge recommendation system further combines deep reinforcement learning technology to achieve precise knowledge recommendation.
[0004] Traditional distance-based models use an evaluation function with distance as the core, that is, the rationality of a fact is determined by measuring the distance between entities. Such models are effective on large-scale knowledge graphs, but their models are simple and cannot model complex relationships in knowledge graphs, especially when dealing with one-to-many, many-to-one and many-to-many relationships. The representation ability is limited. The semantic matching-based model uses a similarity-based scoring function, that is, it measures the rationality of facts through semantic matching, but it is limited by its assumed linear relationship and is also difficult to handle more complex relationship patterns. The above two methods realize the vectorized expression of knowledge graphs in a relatively simple and intuitive way, but it is difficult to capture the complex semantic relationships in the knowledge graph and it is difficult to support complex knowledge recommendation tasks. It is necessary to optimize the embedding quality of the knowledge graph according to the requirements of complex knowledge recommendation tasks. The present invention will explore the optimization method of knowledge graph embedding, improve the embedding quality of knowledge graphs, and assist the knowledge recommendation system to achieve more accurate knowledge recommendations. Summary of the invention
[0005] The present invention aims to solve the problems existing in the prior art. In view of the problem that the knowledge graph is difficult to represent the rich structure and semantic relationship of the knowledge graph due to the poor embedding quality, thus resulting in low accuracy of knowledge recommendation, the present invention proposes a knowledge graph embedding method and system for intelligent knowledge recommendation. First, by combining knowledge graph embedding and deep reinforcement learning technology, a complex knowledge intelligent recommendation framework is designed to achieve intelligent recommendation of complex knowledge; secondly, based on the characteristics of complex knowledge in the domain, a complex knowledge graph model is constructed; then, the TransEx knowledge graph embedding method is proposed by integrating attention mechanism and complex value embedding, which uses the powerful feature extraction ability of deep neural networks to extract deeper semantic connections between entities in the knowledge graph, thereby achieving higher quality knowledge graph embedding; finally, based on the complex knowledge graph in the domain, a knowledge graph embedding algorithm verification data set is constructed, and the algorithm performance is verified using relevant indicators. Compared with traditional methods, the TransEx method proposed in this invention improves the accuracy of knowledge graph embedding, improves the intelligence and explainability of knowledge recommendation, and can effectively promote the efficient use of enterprise historical knowledge in product design, process planning and other aspects, thereby improving the quality of product design / process planning and shortening the product design / process planning cycle.
[0006] The present invention adopts the following technical solutions:
[0007] A knowledge graph embedding method for knowledge intelligent recommendation includes the following steps:
[0008] S1. Design a complex knowledge intelligent recommendation framework;
[0009] S2. Build a complex knowledge graph model, define the storage format of content of different entity categories, store some categories as entity nodes, store some categories as entity attributes, and define relationships to associate entity nodes;
[0010] S3, integrating attention mechanism and complex value embedding, proposes TransEx knowledge graph embedding algorithm, which preserves the structure and semantic relationship of the graph when converting entity nodes and relationships in the knowledge graph into vector sequences;
[0011] S4. Output all entities and relationships in the knowledge graph built based on the complex knowledge graph model in the form of triples, and construct a knowledge graph embedding algorithm verification dataset. Each data piece consists of a set of triples. Use the link prediction method to verify the superiority of the proposed knowledge graph embedding method. When evaluating the algorithm performance, use the average reciprocal ranking MRR and Hits@K as evaluation indicators.
[0012] Furthermore, in S1, the complex knowledge intelligent recommendation framework is designed as follows:
[0013] The complex knowledge intelligent recommendation framework takes text questions as input and outputs recommended knowledge consisting of reasoning chains composed of multiple triples in the knowledge graph. The complex knowledge intelligent recommendation framework consists of two modules, namely the knowledge graph embedding module and the complex knowledge recommendation module.
[0014] In the knowledge graph embedding module, all entities and relations in the knowledge graph are represented as vector sequences of fixed length, and the structure and semantic relations of the graph are preserved to the greatest extent;
[0015] In the complex knowledge recommendation module, questions in text form are received and the text is first converted into a vector sequence of fixed length, while retaining the semantic information in the text. Then, using the deep reinforcement learning model, based on the input text vector sequence, the deep reinforcement learning agent uses the key entities in the question as the starting point and searches for the answer in the knowledge spectrum. After multi-hop search, the answer entity is determined and the reasoning path formed by the agent from the starting point entity to the answer entity is used as the knowledge recommendation output to achieve intelligent recommendation of complex knowledge.
[0016] Furthermore, S2 builds a complex knowledge graph model, specifically:
[0017] First, the entity categories in each complex knowledge are refined, and the key information in the complex knowledge is extracted. Some entity categories are stored as graph nodes, and other entity categories are stored as node attributes. Finally, logical relationships are set to semantically connect the entity nodes to complete the construction of the complex knowledge graph model.
[0018] Furthermore, taking the process of process parameter knowledge recommendation as an example, the construction of a complex knowledge graph model is as follows:
[0019] The process parameter decision knowledge graph storage model contains a total of 10 types of graph nodes, 3 types of node attributes, and 9 types of graph relationships. The graph nodes include part material, part type, processing characteristics, processing procedures, machine tools, tools, fixtures, cutting fluids, cases, and process knowledge; node attributes include roughness, precision, and cutting parameters; graph relationships include part type relationship HasType, processing feature relationship HasMachiningCharacteristics, process relationship HasProcess, part material relationship HasMaterials, tool relationship HasToolType, case relationship HasCase, cutting fluid relationship HasCuttingFlude, fixture relationship HasFixture, and machine tool relationship HasMachine.
[0020] Furthermore, the part material node is connected to the process knowledge node through the relationship HasMaterials; the part type node is connected to the part material node through the relationship HasType; the machining feature node is connected to the part type node through the relationship HasMachiningCharacteristics; the machining process node is connected to the machining feature node through the relationship HasProcess; the machine tool node is connected to the machining process node through the relationship HasMachine; the tool node is connected to the machine tool node through the relationship HasToolType; each machining case node consists of three attributes, including machining accuracy, machining precision and cutting parameters, and the case node is connected to the tool node through the relationship HasCase; the fixture node is connected to the machining case node through the relationship HasFixture; the cutting fluid node is connected to the machining case node through the relationship HasCuttingFlude.
[0021] Furthermore, step 3 is specifically as follows:
[0022] S301. Given a triple (h, r, t) in a knowledge graph, where h represents the head entity in the triple, r represents the relationship in the triple, and t represents the tail entity in the triple; first, convert all entities and relationships in the knowledge graph into a vector sequence of fixed length, where the first half of the sequence is the real part and the second half is the imaginary part;
[0023] S302, concatenate the head entity and relationship vector sequences in a triple and input them into the Transformer encoder. The encoder calculates based on the multi-head self-attention mechanism and outputs four groups of vector sequences Out(A), Out(B), Out(C), and Out(D). The dimension of each group of vector sequences is half of the dimension of the entity vector sequence. The calculation formula is as follows:
[0024] Out(A),Out(B),Out(C),Out(D)=Transformer(e h ,e r )
[0025] Where Transformer(·) represents the encoder operation in Transformer; e h A vector sequence representing the head entity; e r A sequence of vectors representing a relationship;
[0026] S303, the four outputs of the Transformer encoder are subjected to complex-value embedding calculation with the vector sequence of the triple tail entity, and the calculation process is as follows:
[0027]
[0028] Where Re(·) represents the complex-valued embedding operation, i.e., the real part operation; Represents the conjugate vector of the triple's tail entity;
[0029] The calculation process of TransEx knowledge graph embedding is as follows:
[0030]
[0031] Where n represents the dimension of the triple sequence, i represents the i-th dimension of the triple sequence; Out(A), Out(B), Out(C), and Out(D) represent the outputs of the Transformer encoder; Re(e t )、Im(e t ) represents the real and imaginary parts of the triple tail entity vector sequence;
[0032] S304. Use the sigmoid function to calculate the triple probability score. The loss function is the binary cross entropy loss function. The calculation process is as follows:
[0033]
[0034] Where N represents the number of triples; Represents the i-th predicted probability vector; y∈[0,1] N represents the i-th binary label vector, Represents a set of real vectors of N dimensions.
[0035] Furthermore,
[0036] Prediction probability vector
[0037] Furthermore, step 4 is specifically as follows:
[0038] S401, converting the graph nodes in the complex knowledge graph into triples, with each triple as a piece of data, to construct an algorithm verification data set;
[0039] S402, using a link prediction method to verify the superiority of the proposed knowledge graph embedding method; the link prediction task refers to the task of predicting missing triples based on existing entities and relationships in the knowledge graph, which usually quantifies the rationality of a set of unrecognized triples by learning a scoring function;
[0040] S403. When evaluating algorithm performance, average reciprocal ranking MRR and Hits@K are used as evaluation indicators.
[0041] Furthermore, the value range of MRR is from 0 to 1. The higher the value, the better the performance of the algorithm in knowledge graph embedding. Its calculation formula is as follows:
[0042]
[0043] Where N represents the number of triples; rank i Represents the rank of the i-th predicted value.
[0044] Furthermore, the closer the value of Hits@K is to 1, the better the model performance is. Its calculation formula is as follows:
[0045]
[0046] Where N represents the number of triples; rank i Represents the rank of the i-th predicted value.
[0047] Compared with the prior art, the present invention has at least the following beneficial effects:
[0048] The present invention proposes a knowledge graph embedding method and system for knowledge intelligent recommendation, aiming to optimize the knowledge graph embedding algorithm, retain more structures and semantic relationships of the graph when converting entities and relationships in the knowledge graph into vector sequences, provide richer and more comprehensive knowledge support for the knowledge intelligent recommendation system, and realize personalized and accurate recommendation of knowledge. The method designs a complex knowledge intelligent recommendation framework, introduces knowledge graph embedding technology and deep reinforcement learning technology into the knowledge recommendation framework, and improves the intelligence and interpretability of knowledge recommendation. The characteristics of complex knowledge in the field are analyzed, a complex knowledge graph model is constructed, the key information that needs to be stored for each piece of knowledge is clarified, and the knowledge is stored in the form of a knowledge graph, which enriches the semantic information between knowledge. A knowledge graph embedding algorithm TransEx that integrates attention mechanism and complex value embedding is proposed to optimize the effect of knowledge graph embedding. In order to verify the superiority of the proposed algorithm, based on the constructed knowledge graph, the stored triples are extracted, and a knowledge graph embedding algorithm verification dataset is constructed. Based on this dataset, the performance of different algorithms in the knowledge graph embedding task can be evaluated, and MRR and Hits@K are used as algorithm comparison evaluation indicators to verify the superiority of the algorithm. In this study, we provide an effective method for the knowledge graph embedding task for knowledge intelligent recommendation and improve the knowledge graph embedding accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flow chart of the present invention;
[0050] Figure 2 A complex knowledge graph model built for the present invention;
[0051] Figure 3 The TransEx knowledge graph embedding model proposed in this invention;
[0052] Figure 4 A validation dataset for the knowledge graph embedding algorithm constructed for the present invention;
[0053] Figure 5 This is the comparison result between the TransEx algorithm proposed in this invention and other algorithms. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0056] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0057] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.
[0058] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0059] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0060] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0061] The present invention provides a knowledge graph embedding method for knowledge intelligent recommendation.
[0062] First, the knowledge graph is used as the knowledge base to improve the reasoning ability of the knowledge intelligent recommendation system. Based on the knowledge graph embedding technology and deep reinforcement learning technology, a complex knowledge intelligent recommendation framework is designed. The process problem is used as input, and the process knowledge composed of multiple triples is output to realize personalized knowledge and explainable recommendation. Secondly, a complex knowledge graph model is constructed, the entity categories and storage forms in the knowledge are refined, the semantic connection methods of different knowledge entities are designed, a unified semantic framework is provided, and the multi-dimensional association between knowledge is realized. Then, for the complex knowledge graph embedding task, the TransEx knowledge graph embedding method is proposed by integrating the attention mechanism and complex value embedding, which retains more structural and semantic information of the graph in the process of knowledge graph embedding. Finally, a knowledge graph embedding algorithm verification data set is constructed based on the complex knowledge graph, and MRR and Hits@K are used as the main evaluation indicators to verify the superiority of the proposed method. Compared with other methods, the knowledge graph embedding method proposed in the present invention is suitable for complex knowledge graph embedding tasks with multiple entity and relationship features, which can retain more information of the graph in the process of knowledge graph embedding, improve the quality of graph embedding, and provide an information basis for knowledge intelligent recommendation.
[0063] See also Figure 1 The present invention is a knowledge graph embedding method and system for knowledge intelligent recommendation, comprising the following steps:
[0064] S1. Design a complex knowledge intelligent recommendation framework. First, construct a complex knowledge graph model, and store complex knowledge in the form of a knowledge graph based on the constructed model; convert the nodes and relationships in the knowledge graph into a vector sequence that retains the graph structure and semantic information, and the output vector sequence will serve as global information to provide knowledge support for the knowledge recommendation model; finally, based on deep reinforcement learning technology, construct a knowledge recommendation model that takes the design / question as input and outputs knowledge composed of triplets in multiple knowledge graphs to achieve high accuracy and explainable recommendation of complex knowledge. The complex knowledge graph model and knowledge recommendation model constitute a complex knowledge intelligent recommendation framework.
[0065] S2. To achieve efficient knowledge reuse and optimize recommendation logic, a complex knowledge graph model is constructed based on the characteristics of complex knowledge with multiple entities and multiple relationships. The storage format of content in different entity categories is defined. Some categories are stored as entity nodes, and some categories are stored as entity attributes. Relationships are defined to associate entity nodes and enrich the semantic information between knowledge.
[0066] See also Figure 2, taking the process of process parameter knowledge recommendation as an example, a complex knowledge graph model was constructed. The process parameter decision knowledge graph storage model contains 10 types of graph nodes, 3 types of node attributes, and 9 types of graph relationships. The graph nodes include part material, part type, machining characteristics, machining process, machine tool, tool, fixture, cutting fluid, case and process knowledge; the node attributes include roughness, precision and cutting parameters; the graph relationships include part type relationship HasType, machining feature relationship HasMachiningCharacteristics, process relationship HasProcess, part material relationship HasMaterials, tool relationship HasToolType, case relationship HasCase, cutting fluid relationship HasCuttingFlude, fixture relationship HasFixture, and machine tool relationship HasMachine.
[0067] Among them, the part material node is connected to the process knowledge node through the relationship HasMaterials; the part type node is connected to the part material node through the relationship HasType; the machining feature node is connected to the part type node through the relationship HasMachiningCharacteristics; the machining process node is connected to the machining feature node through the relationship HasProcess; the machine tool node is connected to the machining process node through the relationship HasMachine; the tool node is connected to the machine tool node through the relationship HasToolType; each machining case node consists of three attributes, including machining accuracy, machining precision and cutting parameters, and the case node is connected to the tool node through the relationship HasCase; the fixture node is connected to the machining case node through the relationship HasFixture; the cutting fluid node is connected to the machining case node through the relationship HasCuttingFlude.
[0068] S3. Aiming at the characteristics of complex knowledge graphs with multiple entities and multiple relations, the TransEx knowledge graph embedding algorithm is proposed by integrating attention mechanism and complex-valued embedding. It retains as many structures and semantic relations of the graph as possible when converting entity nodes and relations in the knowledge graph into vector sequences.
[0069] See also Figure 3 , as follows:
[0070] S301. Given a triple (h, r, t) in a knowledge graph, where h represents the head entity in the triple, r represents the relationship in the triple, and t represents the tail entity in the triple. First, all entities and relationships in the knowledge graph are converted into a vector sequence of fixed length, with the first half of the sequence being the real part and the second half being the imaginary part.
[0071] S302, concatenate the head entity and relationship vector sequences in a triple and input them into the Transformer encoder. The encoder calculates based on the multi-head self-attention mechanism and outputs four groups of vector sequences Out(A), Out(B), Out(C), and Out(D). The dimension of each group of vector sequences is half of the dimension of the entity vector sequence. The calculation formula is as follows:
[0072] Out(A),Out(B),Out(C),Out(D)=Transformer(e h ,e r )
[0073] Where Transformer(·) represents the encoder operation in Transformer; e h A vector sequence representing the head entity; e r A sequence of vectors representing relations.
[0074] S303, the four outputs of the Transformer encoder are subjected to complex-value embedding calculation with the vector sequence of the triple tail entity, and the calculation process is as follows:
[0075]
[0076] Where Re(·) represents the complex-valued embedding operation, i.e., the real part operation; Represents the conjugate vector of the triple's tail entity.
[0077] The specific calculation process is as follows:
[0078]
[0079] Where n is 4, which means the four vector sequences Out(A), Out(B), Out(C), and Out(D) output by the Transformer encoder; Re(e t )、Im(e t ) represents the real and imaginary parts of the triple tail entity vector sequence, (out) i The four vector sequences Out(A), Out(B), Out(C), and Out(D) output by the encoder;
[0080] S304,
[0081] S305. After the calculation is completed, the sigmoid function is used to calculate the triple probability score. The loss function is the binary cross entropy loss function. The calculation process is as follows:
[0082]
[0083] Where N represents the number of possible tail entities predicted; Represents the predicted probability vector; y∈[0,1] |N| Represents a binary label vector, a set of real vectors of N dimensions.
[0084] S4. Output all entities and relations in the knowledge graph built based on the complex knowledge graph model in the form of triples, and construct a knowledge graph embedding algorithm verification data set, where each data consists of a set of triples. Use the link prediction method to verify the superiority of the proposed knowledge graph embedding method. When evaluating the algorithm performance, use Mean Reciprocal Rank (MRR) and Hits@K as the main evaluation indicators.
[0085] Please refer to the process of building the TransEx knowledge graph embedding algorithm validation dataset Figure 4 , as follows:
[0086] S401. Generate a knowledge graph embedding algorithm verification data set based on the entities and relationships in the process parameter decision knowledge graph. Each piece of data consists of a set of triplets in the form of <head entity, relationship, tail entity>. In order to enhance the distinguishability of process entities, some process entities add the materials processed by the current process case as supplementary information. Finally, a total of 5792 pieces of data are constructed.
[0087] S402: Use the link prediction method to verify the superiority of the proposed knowledge graph embedding method. The link prediction method refers to predicting missing triples based on existing entities and relationships in the knowledge graph, usually by learning a scoring function to quantify the rationality of a set of unrecognized triples.
[0088] by Figure 4 Taking the 5791th data in as an example, the vector sequence of the head entity "thread_titanium alloy" and the relationship "has_process" in a triple is concatenated and input into the TransEx model, and a score ranking sequence composed of multiple tail entities is output. The higher the ranking of the real tail entity "semi-finishing turning_titanium alloy", the better the algorithm performance.
[0089] For algorithm performance comparison results, please refer to Figure 5 , as follows:
[0090] S403. When evaluating the performance of the algorithm, the Mean Reciprocal Rank (MRR) and Hits@K are used as the main evaluation indicators. MRR is a statistical method for measuring the effectiveness of information retrieval, and is particularly suitable for evaluating scenarios that only care about the highest ranking results. Specifically, the value of MRR is the average of the Reciprocal Rank (RR) of each query. For each query, if the correct answer ranks first, the RR is 1, if it ranks second, the RR is 1 / 2, and so on. The value range of MRR is from 0 to 1. The higher the value, the better the performance of the algorithm in knowledge graph embedding. The calculation formula is as follows:
[0091]
[0092] Where N represents the number of triples; rank i Represents the rank of the i-th predicted value.
[0093] by Figure 4 For example, the 5791th data in the data set is taken as an example. The vector sequence of the head entity "thread_titanium alloy" and the relationship "has_process" is used as the input. In the output tail entity score ranking sequence, if the real tail entity "semi-finishing turning_titanium alloy" is ranked 1, then RR is 1. If the real tail entity is ranked 2, then RR is 1 / 2.
[0094] Hits@K is another important indicator for evaluating link prediction performance. It measures the frequency of correct answers in the first K results returned by the model. K is an adjustable parameter, and different result list lengths can be selected for evaluation according to actual needs, such as 1, 3, 10, etc. The correct answer to each query is ranked 1 when it is less than or equal to K, otherwise it is 0. The closer the value of Hits@K is to 1, the better the model performance is. The calculation formula is as follows:
[0095]
[0096] Where N represents the number of triples; rank i Represents the rank of the i-th predicted value.
[0097] by Figure 4 For example, the 5791th data in the example is taken as the input of the vector sequence of the head entity "thread_titanium alloy" and the relationship "has_process". In the output tail entity score ranking sequence, if the real tail entity "semi-finishing turning_titanium alloy" is ranked 1, then Hits@1 is 1; if the real tail entity is ranked 2, then Hits@1 is 0.
[0098] In addition to the TransEx algorithm proposed in this paper, ConvE, ComplEx and ConEx are selected as comparison algorithms, and finally MRR, Hits@10, Hits@3 and Hits@1 are used as evaluation indicators of the model. The results of the four algorithms in the process decision knowledge graph embedding task are shown in the figure. Figure 5 As shown, the TransEx model performed the best, with the values of MRR, Hits@10, Hits@3 and Hits@1 being 0.7209, 0.8707, 0.7713 and 0.6379 respectively, all of which are the highest values.
[0099] In summary, the present invention discloses a knowledge graph embedding method and system for knowledge intelligent recommendation. First, by combining knowledge graph embedding and deep reinforcement learning technology, a complex knowledge intelligent recommendation framework is designed to realize the intelligent recommendation of complex knowledge; secondly, based on the characteristics of complex knowledge in the domain, a complex knowledge graph model is constructed to enhance the correlation between knowledge; then, the TransEx knowledge graph embedding method is proposed by integrating attention mechanism and complex value embedding, which retains more structure and semantic relationships of the graph when converting entities and relationships in the knowledge graph into vector sequences, providing richer and more comprehensive knowledge support for the knowledge intelligent recommendation system; finally, based on the complex knowledge graph in the domain, a knowledge graph embedding algorithm verification data set is constructed, and MRR and Hits@K are used as the main evaluation indicators to verify the algorithm performance. Compared with traditional methods, the TransEx method proposed in the present invention improves the accuracy of knowledge graph embedding, retains the rich structure and semantic information of the knowledge graph, improves the intelligence and interpretability of knowledge recommendation, and can effectively promote the efficient use of enterprise historical knowledge in product design, process planning and other links, thereby improving the quality of product design / process planning and shortening the product design / process planning cycle.
[0100] The present invention proposes a knowledge graph embedding method and system for knowledge intelligent recommendation, aiming to optimize the knowledge graph embedding algorithm, retain more structures and semantic relationships of the graph when converting entities and relationships in the knowledge graph into vector sequences, provide richer and more comprehensive knowledge support for the knowledge intelligent recommendation system, and realize personalized and accurate recommendation of knowledge. The method designs a complex knowledge intelligent recommendation framework, introduces knowledge graph embedding technology and deep reinforcement learning technology into the knowledge recommendation framework, and improves the intelligence and interpretability of knowledge recommendation. The characteristics of complex knowledge in the field are analyzed, a complex knowledge graph model is constructed, the key information that needs to be stored for each piece of knowledge is clarified, and the knowledge is stored in the form of a knowledge graph, which enriches the semantic information between knowledge. A knowledge graph embedding algorithm TransEx that integrates attention mechanism and complex value embedding is proposed to optimize the effect of knowledge graph embedding. In order to verify the superiority of the proposed algorithm, based on the constructed knowledge graph, the stored triples are extracted, and a knowledge graph embedding algorithm verification dataset is constructed. Based on this dataset, the performance of different algorithms in the knowledge graph embedding task can be evaluated, and MRR and Hits@K are used as algorithm comparison evaluation indicators to verify the superiority of the algorithm. In this study, we provide an effective method for the knowledge graph embedding task for knowledge intelligent recommendation and improve the knowledge graph embedding accuracy.
[0101] Furthermore, the knowledge graph organizes domain knowledge in the form of a graph, and the structured representation makes knowledge more intuitive and easy to understand. On the one hand, the knowledge graph can obtain historical accumulated experience and cases, process, organize and manage the knowledge therein, and form a knowledge base. On the other hand, it can also perform semantic reasoning on similar or even repeated decision-making activities in the manufacturing process and discover new knowledge, thereby greatly promoting the accumulation, inheritance and reuse of manufacturing knowledge. Through the knowledge graph embedding technology, the reasoning and computing capabilities of the knowledge base have been enriched and improved. The introduction of the knowledge graph into the knowledge intelligent recommendation task has provided the possibility for efficient retrieval and intelligent recommendation of knowledge. Furthermore, deep reinforcement learning technology is introduced into the knowledge recommendation task to convert the knowledge recommendation process into a sequential decision-making process. Starting from the subject entity in the question, along the relationship path in the knowledge graph, the reasoning path pointing to the answer is gradually generated. By simulating the process of human brain thinking and problem solving, the required knowledge is provided to knowledge workers in a timely manner, and even part of the decision-making process is completed on behalf of people, and the decision plan is output for reference, so as to build an efficient reuse mechanism for complex knowledge and improve the accuracy and interpretability of recommended knowledge.
[0102] Furthermore, in order to achieve efficient reuse of complex knowledge, a complex knowledge graph model is constructed, the associations between knowledge are sorted out, the storage forms of different knowledge entities are clarified, and the semantic connection methods of different knowledge entities are designed, thus providing a semantic basis for efficient knowledge retrieval and recommendation.
[0103] Furthermore, since complex knowledge is stored in the form of a knowledge graph, the knowledge entity nodes are diverse and the semantic connections are richer, the traditional knowledge graph embedding method is difficult to handle such a complex relationship pattern. The present invention first uses the encoder in the Transformer to process the head entity and relationship vector sequence in the triple, and introduces a multi-head self-attention mechanism to improve the learning ability and expression ability of the algorithm, so that it can capture the correlation between data more carefully, thereby effectively improving the embedding quality of complex knowledge graphs. Then the output of the encoder in the Transformer is used to perform a complex-valued embedding calculation with the tail entity of the triple, and the Hermitian inner product of the complex space is used for radial transformation, so that the knowledge graph embedding algorithm can more comprehensively capture the symmetric and antisymmetric relationship of the graph. In addition, if the learning effect of the Transformer encoder is not good, the model can be degenerated into the ComplEx knowledge graph embedding algorithm to ensure the embedding quality of the algorithm.
[0104] Furthermore, in order to verify the superiority of this method in the knowledge graph embedding task, the complex knowledge graph was further processed, and all triples in it were exported. Each data consists of a set of triples in the form of <head entity, relationship, tail entity>, and a knowledge graph embedding algorithm verification data set was constructed. MRR and Hits@K are used as the main evaluation indicators. The MRR indicator not only focuses on whether the model can find the correct answer, but also focuses on the ranking of the correct answer among all the answers provided by the model, reflecting the comprehensive performance of the model; Hits@K measures the proportion of the correct answer in the top K predictions given by the model, which is intuitive and easy to understand. By looking at different K values, you can understand the performance of the model at different levels, so as to more comprehensively evaluate the advantages and disadvantages of the model and better reflect the effectiveness of the model in practical applications.
[0105] In summary, the present invention discloses a knowledge graph embedding method and system for knowledge intelligent recommendation. First, by combining knowledge graph embedding and deep reinforcement learning technology, a complex knowledge intelligent recommendation framework is designed to achieve intelligent recommendation of complex knowledge; secondly, based on the characteristics of complex knowledge in the domain, a complex knowledge graph model is constructed to enhance the correlation between knowledge; then, the TransEx knowledge graph embedding method is proposed by integrating attention mechanism and complex value embedding, which retains more structures and semantic relationships of the graph when converting entities and relationships in the knowledge graph into vector sequences, providing richer and more comprehensive knowledge support for the knowledge intelligent recommendation system; finally, based on the complex knowledge graph in the domain, a knowledge graph embedding algorithm verification data set is constructed, and MRR and Hits@K are used as the main evaluation indicators to verify the algorithm performance.
Claims
1. A knowledge graph embedding method for knowledge intelligent recommendation, characterized in that: The following steps are involved: S1. Design a complex knowledge intelligent recommendation framework; S2. Build a complex knowledge graph model, define the storage format of content of different entity categories, store some categories as entity nodes, store some categories as entity attributes, and define relationships to associate entity nodes; S3, integrating attention mechanism and complex value embedding, proposes TransEx knowledge graph embedding algorithm, which preserves the structure and semantic relationship of the graph when converting entity nodes and relationships in the knowledge graph into vector sequences; S4. Output all entities and relationships in the knowledge graph built based on the complex knowledge graph model in the form of triples, and construct a knowledge graph embedding algorithm verification dataset. Each data piece consists of a set of triples. Use the link prediction method to verify the superiority of the proposed knowledge graph embedding method. When evaluating the algorithm performance, use the average reciprocal ranking MRR and Hits@K as evaluation indicators.
2. According to claim 1, a knowledge graph embedding method for knowledge intelligent recommendation is characterized in that: In S1, the complex knowledge intelligent recommendation framework is designed as follows: The complex knowledge intelligent recommendation framework takes text questions as input and outputs recommended knowledge consisting of reasoning chains composed of multiple triples in the knowledge graph. The complex knowledge intelligent recommendation framework consists of two modules, namely the knowledge graph embedding module and the complex knowledge recommendation module. In the knowledge graph embedding module, all entities and relations in the knowledge graph are represented as vector sequences of fixed length, and the structure and semantic relations of the graph are preserved to the greatest extent; In the complex knowledge recommendation module, questions in text form are received and the text is first converted into a vector sequence of fixed length, while retaining the semantic information in the text. Then, using the deep reinforcement learning model, based on the input text vector sequence, the deep reinforcement learning agent uses the key entities in the question as the starting point and searches for the answer in the knowledge spectrum. After multi-hop search, the answer entity is determined and the reasoning path formed by the agent from the starting point entity to the answer entity is used as the knowledge recommendation output to achieve intelligent recommendation of complex knowledge.
3. The knowledge graph embedding method for knowledge intelligent recommendation according to claim 1 is characterized in that: S2, build a complex knowledge graph model, specifically: First, the entity categories in each complex knowledge are refined, and the key information in the complex knowledge is extracted. Some entity categories are stored as graph nodes, and other entity categories are stored as node attributes. Finally, logical relationships are set to semantically connect the entity nodes to complete the construction of the complex knowledge graph model.
4. The knowledge graph embedding method for knowledge intelligent recommendation according to claim 3 is characterized in that: Taking the process of process parameter knowledge recommendation as an example, the construction of a complex knowledge graph model is as follows: The process parameter decision knowledge graph storage model contains a total of 10 types of graph nodes, 3 types of node attributes, and 9 types of graph relationships. The graph nodes include part material, part type, processing characteristics, processing procedures, machine tools, tools, fixtures, cutting fluids, cases, and process knowledge; node attributes include roughness, precision, and cutting parameters; graph relationships include part type relationship HasType, processing feature relationship HasMachiningCharacteristics, process relationship HasProcess, part material relationship HasMaterials, tool relationship HasToolType, case relationship HasCase, cutting fluid relationship HasCuttingFlude, fixture relationship HasFixture, and machine tool relationship HasMachine.
5. A knowledge graph embedding method for knowledge intelligent recommendation according to claim 4, characterized in that: The part material node is connected to the process knowledge node through the relationship HasMaterials; the part type node is connected to the part material node through the relationship HasType; the machining feature node is connected to the part type node through the relationship HasMachiningCharacteristics; the machining process node is connected to the machining feature node through the relationship HasProcess; the machine tool node is connected to the machining process node through the relationship HasMachine; the tool node is connected to the machine tool node through the relationship HasToolType; each machining case node consists of three attributes, including machining accuracy, machining precision and cutting parameters, and the case node is connected to the tool node through the relationship HasCase; the fixture node is connected to the machining case node through the relationship HasFixture; the cutting fluid node is connected to the machining case node through the relationship HasCuttingFlude.
6. The knowledge graph embedding method for knowledge intelligent recommendation according to claim 1, characterized in that: Step 3 is as follows: S301. Given a triple (h, r, t) in a knowledge graph, where h represents the head entity in the triple, r represents the relationship in the triple, and t represents the tail entity in the triple; first, convert all entities and relationships in the knowledge graph into a vector sequence of fixed length, where the first half of the sequence is the real part and the second half is the imaginary part; S302, concatenate the head entity and relationship vector sequences in a triple and input them into the Transformer encoder. The encoder calculates based on the multi-head self-attention mechanism and outputs four groups of vector sequences Out(A), Out(B), Out(C), and Out(D). The dimension of each group of vector sequences is half of the dimension of the entity vector sequence. The calculation formula is as follows: Out(A),Out(B),Out(C),Out(D)=Transformer(e h ,e r ) Where Transformer(·) represents the encoder operation in Transformer; e h A vector sequence representing the head entity; e r A sequence of vectors representing a relationship; S303, the four outputs of the Transformer encoder are subjected to complex-value embedding calculation with the vector sequence of the triple tail entity, and the calculation process is as follows: Where Re(·) represents the complex-valued embedding operation, i.e., the real part operation; Represents the conjugate vector of the triple's tail entity; The calculation process of TransEx knowledge graph embedding is as follows: Where n represents the dimension of the triple sequence, i represents the i-th dimension of the triple sequence; Out(A), Out(B), Out(C), and Out(D) represent the outputs of the Transformer encoder; Re(e t )、Im(e t ) represents the real and imaginary parts of the triple tail entity vector sequence; S304. Use the sigmoid function to calculate the triple probability score. The loss function is the binary cross entropy loss function. The calculation process is as follows: Where N represents the number of triples; Represents the i-th predicted probability vector; y∈[0,1] N represents the i-th binary label vector, Represents a set of real vectors of N dimensions.
7. A knowledge graph embedding method for knowledge intelligent recommendation according to claim 6, characterized in that: Prediction probability vector 8. The knowledge graph embedding method for knowledge intelligent recommendation according to claim 5, characterized in that: Step 4 is as follows: S401, converting the graph nodes in the complex knowledge graph into triples, with each triple as a piece of data, to construct an algorithm verification data set; S402, using a link prediction method to verify the superiority of the proposed knowledge graph embedding method; the link prediction task refers to the task of predicting missing triples based on existing entities and relationships in the knowledge graph, which usually quantifies the rationality of a set of unrecognized triples by learning a scoring function; S403. When evaluating algorithm performance, average reciprocal ranking MRR and Hits@K are used as evaluation indicators.
9. A knowledge graph embedding method for knowledge intelligent recommendation according to claim 8, characterized in that: The value range of MRR is from 0 to 1. The higher the value, the better the algorithm performs in knowledge graph embedding. The calculation formula is as follows: Where N represents the number of triples; rank i Represents the rank of the i-th predicted value.
10. The knowledge graph embedding method for knowledge intelligent recommendation according to claim 8, characterized in that: The closer the value of Hits@K is to 1, the better the model performance is. The calculation formula is as follows: Where N represents the number of triples; rank i Represents the rank of the i-th predicted value.
Citation Information
Cited By
Knowledge graph embedding method and system for intelligent knowledge recommendation
CN119537611A
Intelligent dialogue generation method oriented to elevator emergency rescue and based on InterHT model
CN121053992A