Dynamic knowledge completion method for knowledge graphs in middle school experiments
By combining graph neural networks and the translation model TransH, the problem of dynamic knowledge completion of entities that do not appear in the middle school experimental knowledge graph is solved, effective judgment and high-accuracy classification of new entities are achieved, and the completion efficiency of the middle school experimental knowledge graph is improved.
Patent Information
- Application Number
- CN202111518693.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-12-13
AI Technical Summary
Existing static knowledge completion methods cannot be effectively generalized in middle school experimental knowledge graphs. They are unable to judge entities and relationships that have not appeared before, and require retraining the entire knowledge graph, which is time-consuming.
A graph neural network is used to learn the representation of nodes in the middle school experiment knowledge graph. The external entity embedding problem is solved by using neighbor node information. The translation model TransH is used to construct negative triples. The confidence of the triples is evaluated based on the semantic similarity of middle school experiments to perform dynamic knowledge completion.
It improves the generalization ability of new entities, enhances the discrimination between triples, and improves the accuracy of triple classification.
Smart Images

Figure CN114218398B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graph completion, and in particular to a dynamic knowledge completion method for knowledge graphs for middle school experiments. Background Art
[0002] The knowledge graph is a new concept proposed by Google in 2012. It represents knowledge in the form of triples and is a knowledge base presented in the form of a graph. Knowledge graphs are divided into general knowledge graphs and domain knowledge graphs. The domain knowledge graph aggregates specialized knowledge within a specific field and requires high levels of professionalism and accuracy. It can perform knowledge reasoning and decision-making support for specific domains. Middle school knowledge is a systematic and well-organized body of knowledge that has been verified and updated over generations, ensuring its authority and accuracy. Middle school experimental knowledge is a component of this body of knowledge, and knowledge graphs can effectively reflect the structural relationships of this knowledge. A knowledge graph for middle school experiments is constructed by extracting knowledge from middle school textbooks according to the syllabus. Knowledge subgraphs are then obtained from crowdsourced teaching resources to complete the knowledge graph.
[0003] Knowledge completion is often described as finding missing entities or relationships in a knowledge graph. Static knowledge completion methods aim to predict missing relationships in the knowledge graph, but they lack generalization capabilities and cannot effectively represent entities that have never appeared in the knowledge graph. This typically requires retraining the entire knowledge graph, including the knowledge subgraph, which is time-consuming.
[0004] The goal of dynamic knowledge completion is to be able to make judgments about entities and relationships that have never appeared before. Because knowledge subgraphs obtained from crowdsourcing resources may contain entities that do not appear in the middle school experiment knowledge graph, a dynamic knowledge completion method is needed. Furthermore, the knowledge completion method needs to be specialized for the structure of middle school experiments. Summary of the Invention
[0005] The purpose of the present invention is to provide a dynamic knowledge completion method for knowledge graphs for middle school experiments.
[0006] The technical solution to achieve the purpose of the present invention is: a dynamic knowledge completion method for knowledge graphs for middle school experiments, comprising the following steps:
[0007] Step 1: Obtain the embedded representation of the middle school experiment knowledge graph: Based on the graph neural network structure, the node propagation method is specified to complete the embedding of the knowledge graph, and the embedding problem of entities outside the knowledge graph is solved through the information of neighbor nodes;
[0008] Step 2: Obtain the scores of the high school experimental knowledge triples: The high school experimental knowledge triples are expressed as (head entity, relation, tail entity). The translation model TransH based on representation learning obtains the triple distance scores and preliminarily classifies the triples.
[0009] Step 3: Calculate the confidence of the high school experiment knowledge triple: A relationship connects two entities, representing a piece of knowledge in the high school experiment. The head and tail entities corresponding to the relationship are used as its semantic context. The confidence of the triple is evaluated based on the most similar relationship based on the comprehensive semantic similarity, which serves as the basis for further classification of the triple.
[0010] Step 4, complete the classification of the middle school experimental knowledge triples: preliminary classification through triple score and further judgment of triple confidence to obtain the positive example triples of middle school experimental knowledge, and use the positive example triples to complete the knowledge graph.
[0011] Preferably, the embedding representation of the middle school experiment knowledge graph includes the following steps:
[0012] Step 1.1: Initial vector representation: Use the one-hot method to obtain the initial vector representation of each entity and each relationship in the high school experimental knowledge triple.
[0013] Step 1.2: Propagation of nodes on the middle school experiment knowledge graph. The graph neural network learns by propagating information on each node separately, using edge relationships to aggregate the features of different neighboring nodes. Neighbors are the associated entities of the current middle school experiment knowledge entity, including related knowledge units, related knowledge points, related experiments, and related equipment and skills. The specific formula is as follows:
[0014] v e =Pooling(T head (v h )∪T tail (v t )),e∈G,v e ∈R d
[0015] Among them, G represents the middle school experiment knowledge graph, e represents the node in the graph, that is, the middle school experiment knowledge entity, v e Represents the hidden state vector of the current node, v h 、v t Represent the head and tail neighbor nodes respectively; Pooling(·) represents the pooling method; T head (·), T tail (·) represents the conversion function of the head and tail neighbor nodes respectively, and the output is the aggregation of neighbor features.
[0016] Step 1.3: Embedding Entities Outside the Middle School Experiment Knowledge Graph. Middle school experimental knowledge is highly interconnected. A knowledge point belongs to a knowledge unit, perhaps a specific experiment. Experiments include experimental equipment and cover knowledge points. Knowledge points have five types of relationships: parallel, predecessor, successor, parent, and child. Therefore, we believe that for the middle school experimental knowledge graph, entities outside the graph can be represented by vectors through their connections to entities within the graph, using a graph neural network node propagation method.
[0017] Preferably, obtaining the knowledge triple score S of the middle school experiment knowledge graph includes the following steps:
[0018] Step 2.1: Select TransH as the output model. Middle school experimental knowledge graphs involve complex 1-to-N and N-to-N relationship patterns. Therefore, we use the TransH translation model, a representation learning model, as the output model of the graph neural network. TransH is also a commonly used model for triple classification.
[0019] Step 2.2: Construct negative triples. The goal of model training is to distinguish positive triplets from negative triplets. The selection of negative triplets will affect the training results of the model.
[0020] The knowledge extraction method of the middle school experimental knowledge subgraph is the same as that of the main graph, so there will be no triples whose entity types on both sides of the relationship do not match the relationship pattern in the main graph. In order to strengthen the distinction between entities of the same type during model training, the head entity or tail entity in the current middle school experimental knowledge triple is randomly replaced based on the Bernoulli probability. The replacement range is the head entity set and tail entity set of all triples involved in the relationship.
[0021] Step 2.3: Obtain the knowledge triplet score S. Calculated using the distance evaluation function of the TransH model.
[0022] Preferably, calculating the confidence P of the high school experimental knowledge triplet includes the following steps:
[0023] Step 3.1: Find the most similar relation r′ by combining semantic similarity. To evaluate the similarity between relations, we directly calculate the distance between the embedding vectors, without considering the semantic information of the relations. A relation connects two entities, representing a piece of knowledge from a middle school experiment. Therefore, the head and tail entities corresponding to the relation can be used as its semantic context.
[0024] The first step is to find the relationship r The average vector of the head entity and the average vector of the tail entity in all triples are used as semantic information.
[0025] The second step is to obtain the semantic similarity between the current relationship and other relationships in the middle school experiment knowledge graph.
[0026] In the third step, the most similar relation r′ is found by comprehensively considering the semantic similarity and the similarity between relation vectors.
[0027] Step 3.2: Calculate the prior probability of the relation by counting the number of times n the relation r appears in all positive triples r and the number of occurrences of its most similar relation r′ n r′ , calculate the prior probability pro(r); the specific formula is as follows:
[0028]
[0029] Step 3.3: Calculate the semantic matching degree of the relationship. In the middle school experiment knowledge graph, the head and tail entities in the middle school experiment knowledge triple of the relationship r are the semantic information of the relationship; calculate the average head entity The distance from the head entity in the current triple, the average tail entity The distance from the tail entity in the current triple is used to determine the matching degree of the head entity h, tail entity t and r in the current triple, align(h,r,t); the specific formula is as follows:
[0030]
[0031] Step 3.4: Calculate triple confidence P. The above features are integrated to obtain triple confidence, that is, confidence P = prior probability * semantic matching degree.
[0032] Preferably, completing the classification of the high school experimental knowledge triples includes the following steps:
[0033] Step 4.1: Perform preliminary classification based on the triplet score S. When S is greater than the interval τ between the positive and negative triplet, the sample is directly classified as a negative example. In other cases, further judgment is required.
[0034] Step 4.2: Construct an approximate triple. For the current triple (h, r, t), find the most similar relation r′, construct an approximate triple (h, r′, t), obtain the score S′, and compare it with the threshold. If the approximate triple is also judged as a positive example, proceed to the confidence judgment. Otherwise, the current triple is judged as a positive example.
[0035] Step 4.3: Further judge based on the triplet confidence. Calculate the confidence of r and r′ separately. If the confidence of r′ is higher, it means that the approximate triplet is more likely to be true, and the current triplet is judged as a negative example. Otherwise, the current triplet is judged as a positive example.
[0036] Step 4.4: Use the obtained positive example triples to complete the middle school experiment knowledge graph.
[0037] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the dynamic knowledge completion method for the middle school experiment knowledge graph is implemented.
[0038] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned dynamic knowledge completion method for the middle school experiment knowledge graph.
[0039] Compared with the existing technology, the present invention has the following significant advantages: the present invention uses a graph neural network to learn the representation of nodes in the middle school experiment knowledge graph, solves the embedding problem of entities outside the knowledge graph, and increases the generalization ability of the knowledge completion method for new entities; the present invention limits the replacement range of the head and tail entities of the negative example triples, focuses on the differences in the vector space between entities involved in the same relationship, and improves the discrimination between triples; the present invention uses the confidence of the triples with the most similar semantic relationship for further classification, makes full use of the semantic information of the middle school experiment, and further improves the accuracy of triple classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is the overall process of the method of the present invention.
[0041] Figure 2 This is a knowledge subgraph of a specific embodiment. DETAILED DESCRIPTION
[0042] The present invention discloses a dynamic knowledge completion method for knowledge graphs of middle school experiments. Knowledge completion is usually described as finding missing entities or relationships in the knowledge graph. Static knowledge completion refers to the prediction of missing relationships in the graph, and the goal of dynamic knowledge completion is to make judgments on entities and relationships that have not appeared. There may be entities in the knowledge subgraph obtained from crowdsourcing resources that have not appeared in the middle school experiment knowledge graph, so a dynamic knowledge completion method is needed. A graph neural network is used to complete embedding through the information of neighbor nodes to solve the problem of embedding entities outside the graph. According to the characteristics of the middle school experiment knowledge graph, the translation model TransH of knowledge representation learning is used to construct negative example triplets that conform to the middle school experiment knowledge subgraph pattern, and the triple confidence evaluation of the most similar relationship based on the comprehensive middle school experiment knowledge semantic similarity is combined to complete the triple classification task.
[0043] A dynamic knowledge completion method for middle school experimental knowledge graphs uses a graph neural network to embed entities that exist in knowledge subgraphs obtained from crowdsourcing resources but do not appear in the middle school experimental knowledge graph. This method uses information from neighboring nodes to embed entities outside the graph, addressing the problem of embedding entities outside the graph. Based on the characteristics of the middle school experimental knowledge graph, the translation model TransH for knowledge representation learning is used to construct negative triples that conform to the middle school experimental knowledge subgraph pattern. The triplet confidence assessment is then combined with the most similar relationship based on the semantic similarity of the comprehensive middle school experimental knowledge to complete the triple classification task.
[0044] A dynamic knowledge completion method for knowledge graphs for middle school experiments includes the following steps:
[0045] Step 1: Obtain an embedded representation of the middle school experiment knowledge graph. Based on the graph neural network structure, specify the node propagation method to complete the knowledge graph embedding, and solve the embedding problem of entities outside the knowledge graph through the information of neighboring nodes;
[0046] Step 2: Obtain the score S for the high school experimental knowledge triple. The high school experimental knowledge triple is represented as (head entity, relationship, tail entity). Entity types include knowledge unit, knowledge point, experiment, and skill equipment. Relation types include parallel, predecessor, successor, parent, child, include, and cover. The translation model TransH based on representation learning obtains the triple distance score and preliminarily classifies the triples.
[0047] Step 3: Calculate the confidence P of the high school experiment knowledge triple. A relationship connects two entities, representing a piece of knowledge in a high school experiment. Therefore, the head and tail entities corresponding to the relationship can be used as its semantic context, and the confidence of the triple can be evaluated based on the most similar relationship with comprehensive semantic similarity. This serves as the basis for further classification of the triple.
[0048] Step 4: Complete the classification of the middle school experimental knowledge triples. Through the initial classification of the triples and the further judgment of the triples' confidence, we can obtain the positive example triples of the middle school experimental knowledge and use them to complete the knowledge graph.
[0049] The overall process is as follows Figure 1 shown.
[0050] In one embodiment, obtaining an embedded representation of a middle school experiment knowledge graph includes the following steps:
[0051] Step 1.1: Initial Vector Representation. The middle school experiment knowledge graph contains four types of entities: knowledge points, knowledge units, experiments, and equipment skills. Seven relationships exist between entities, organized into a relationship table: "parallel," "predecessor," "successor," "parent," "child," "include," and "cover." The one-hot initial vector for the "parallel" relationship is [1, 0, 0, 0, 0, 0].
[0052] Step 1.2: Node propagation. The graph neural network learns by propagating on each node separately, and aggregates the features of different neighboring nodes using edge relationships. The specific formula is as follows:
[0053] v e =Pooling(T head (v h )∪T tail (v t )),e∈G,ve∈R d
[0054]
[0055]
[0056] Among them, G represents the middle school experiment knowledge graph, e represents the node in the graph, that is, the middle school experiment knowledge entity, v e Represents the hidden state vector of the current node, v h 、v t Represent the head and tail neighbor nodes respectively; Pooling(·) represents the pooling method; T head (·), T tail (·) denotes the conversion function of the head and tail neighbor nodes respectively. The product of the model parameter matrix A and the neighbor vector is batch normalized (BN) and then fed into the rectified linear unit (ReLU). The output is the aggregation of neighbor features.
[0057] exist Figure 2 In the subgraph shown, the neighbor head entities of the knowledge point entity "Amber force" are {"Lorentz force," "magnetic field," "left-hand rule"}, and the neighbor tail entities are {"Lorentz force," "magnetic field," "left-hand rule," "magnetic field"}. The additional "magnetic field" in the neighbor tail entity, compared to the neighbor head entity, is a knowledge unit; the others are knowledge point entities. The vector representation of "Amber force" is affected by these nodes and also affects the vector representations of its neighboring nodes.
[0058] Step 1.3: Embedding entities outside the knowledge graph. For entities outside the knowledge graph, vector representations are obtained through edges connected to entities within the knowledge graph using a graph neural network node propagation method.
[0059] exist Figure 2 In the subgraph shown, the knowledge point entity "inductance" is an entity that does not exist in the original knowledge graph. However, since there is a "parallel" relationship between "inductance" and "current", even without an initial vector, it can be directly represented indirectly by the "current" vector through the propagation formula.
[0060] In one embodiment, obtaining the score S of the knowledge triple of the middle school experiment knowledge graph includes the following steps:
[0061] Step 2.1: Select TransH as the output model. Use the TransH model, a translation model based on representation learning, as the output model of the graph neural network. The middle school experimental knowledge graph involves complex 1-to-N and N-to-N relationship patterns, so the TransH model is used. TransH is also a commonly used model for triple classification.
[0062] Step 2.2: Construct negative example triples.
[0063] The random replacement algorithm, based on Bernoulli probability, determines the distribution density of the head and tail entities in a relationship schema and replaces the sparser side with the other entity. For one-to-many relationships, the head entity is more likely to be replaced, while for many-to-one relationships, the tail entity is more likely to be replaced. The number of tail entities corresponding to the head entity, tph, is recorded, and the number of head entities corresponding to the tail entity, hpt, is recorded. The current probability of replacing the head entity of a triple is as follows:
[0064]
[0065] Different relationships in the middle school experiment knowledge graph correspond to different entity types, such as Figure 2 In the knowledge subgraph, "include" refers to the relationship between a knowledge unit entity and a knowledge point entity, while "predecessor / successor / parent / child / parallel" relationships all involve knowledge point entities. After training, entity vectors involving the same relationship become closer in vector space. To enhance the distinction between entities corresponding to the same relationship, the replacement scope is narrowed to the head and tail entities in the triples involved in the same relationship.
[0066] Step 2.3: Obtain the knowledge triple score S. The specific calculation formula is as follows:
[0067]
[0068] Among them, v h⊥ 、v t⊥ Represents the projection of the head and tail entities on the relational hyperplane, d r A vector representing a relation on the relation hyperplane.
[0069] In one embodiment, calculating the confidence P of the high school experimental knowledge triples includes the following steps:
[0070] The most similar relation r′ is found by combining semantic similarity. The similarity between relations is evaluated by directly calculating the distance between embedding vectors, without considering the semantic information of the relations. A relation connects two entities, representing a piece of knowledge from a middle school experiment. Therefore, the head and tail entities corresponding to the relation can be used as its semantic context.
[0071] Specifically, according to the first step, based on the triples in the middle school experimental knowledge graph and subgraph, we use (h, r, t) to represent them, where v h 、v t is the vector of the head and tail entities. The total number of triples corresponding to the relation r is n r Representation. Find the average vector of the head entity of the relation and tail entity average vector As semantic information:
[0072]
[0073]
[0074] Then calculate the comprehensive similarity sim(r,r′) between the current relation r and the remaining relations r′ according to the following formula:
[0075]
[0076]
[0077] Perform the same calculation on the 7 relationships and find the most similar relationship for each.
[0078] Step 3.2: Calculate the prior probability of the relation. By counting the number of times n the relation r appears in all positive triples r and the number of occurrences of its most similar relation r′ n r′ , calculate the prior probability pro(r). The specific formula is as follows:
[0079]
[0080] Step 3.3: Calculate the semantic matching degree of the relationship. In the middle school experiment knowledge graph, the head and tail entities in the middle school experiment knowledge triple of the relationship r are the semantic information of the relationship. Calculate the average head entity The distance from the head entity in the current triple, the average tail entity The distance from the tail entity in the current triple is used to determine the matching degree of the head entity h, tail entity t and r in the current triple, align(h,r,t); the specific formula is as follows:
[0081]
[0082] like Figure 2 In the knowledge subgraph, one of the triples ("current", "parallel", "inductance"), for the matching degree between the head entity "current" and the tail entity "inductance" and the relationship "parallel" in the current triple, the vectors of "current" and "inductance" should be substituted into the above formula to calculate.
[0083] Step 3.4: Calculate the triple confidence P. The above features are integrated to obtain the triple confidence, that is, confidence P = prior probability * context matching degree.
[0084] Completing the classification of the secondary school experimental knowledge triples includes the following steps:
[0085] Step 4.1: Perform preliminary classification based on the triplet score S. When S is greater than the interval τ between the positive and negative triplet, the sample is directly classified as a negative example. In other cases, further judgment is required.
[0086] Step 4.2: Construct an approximate triple. For the current triple (h, r, t), find the most similar relation r′, construct an approximate triple (h, r′, t), obtain the score S′, and compare it with the threshold. If the approximate triple is also judged as a positive example, proceed to the confidence judgment. Otherwise, the current triple is judged as a positive example.
[0087] Step 4.3: Further judge based on the triplet confidence. Calculate the confidence of r and r′ separately. If the confidence of r′ is higher, it means that the approximate triplet is more likely to be true, and the current triplet is judged as a negative example. Otherwise, the current triplet is judged as a positive example.
[0088] Step 4.4: Use the obtained positive example triples to complete the middle school experiment knowledge graph.
Claims
1. A dynamic knowledge completion method for knowledge graphs for middle school experiments, characterized by: The following steps are involved: Step 1: Obtain the embedded representation of the middle school experiment knowledge graph: Based on the graph neural network structure, the node propagation method is specified to complete the embedding of the knowledge graph, and the embedding problem of entities outside the knowledge graph is solved through the information of neighbor nodes; Step 2: Obtain the scores of the high school experimental knowledge triples: The high school experimental knowledge triples are expressed as (head entity, relation, tail entity). The translation model TransH based on representation learning obtains the triple distance scores and preliminarily classifies the triples. Step 3: Calculate the confidence of the high school experiment knowledge triple: A relationship connects two entities, representing a piece of knowledge in the high school experiment. The head and tail entities corresponding to the relationship are used as its semantic context. The confidence of the triple is evaluated based on the most similar relationship based on the comprehensive semantic similarity, which serves as the basis for further classification of the triple. The calculation of the confidence of the secondary school experimental knowledge triples includes the following steps: Step 3.1: Find the most similar relation r′ by integrating semantic similarity. To evaluate the similarity between relations, the distance between the embedding vectors is directly calculated without considering the semantic information of the relations. The first step is to find the relationship r The average vector of the head entity and the average vector of the tail entity in all triples are used as semantic information; The second step is to obtain the semantic similarity between the current relationship and other relationships in the middle school experiment knowledge graph; The third step is to find the most similar relation r′ by comprehensively considering the semantic similarity and the similarity between relation vectors; Step 3.2: Calculate the prior probability of the relation by counting the number of times n the relation r appears in all positive triples r and the number of occurrences of its most similar relation r′ n r′ , calculate the prior probability pro(r); the specific formula is as follows: Step 3.3: Calculate the semantic matching degree of the relationship; in the middle school experiment knowledge graph, the head and tail entities in the middle school experiment knowledge triple of the relationship r are the semantic information of the relationship; calculate the average head entity The distance from the head entity in the current triple, the average tail entity The distance from the tail entity in the current triple is used to determine the matching degree of the head entity h, tail entity t and r in the current triple: align(h,r,t); the specific formula is as follows: Step 3.4: Calculate the triple confidence P; integrate the above features to obtain the triple confidence, that is, confidence P = prior probability * semantic matching degree; Step 4, complete the classification of the middle school experimental knowledge triples: preliminary classification through triple score and further judgment of triple confidence to obtain the positive example triples of middle school experimental knowledge, and use the positive example triples to complete the knowledge graph.
2. The knowledge completion method for middle school experimental knowledge graph according to claim 1 is characterized in that: Obtaining the embedded representation of the middle school experiment knowledge graph includes the following steps: Step 1.1: Initial vector representation: Use the one-hot method to obtain the initial vector representation of each entity and each relationship in the high school experimental knowledge triple; Step 1.2: Propagation of nodes on the middle school experiment knowledge graph; the graph neural network learns by propagating information on each node separately, and uses edge relationships to aggregate the features of different neighboring nodes. Neighbors are the associated entities of the current middle school experiment knowledge entity, including related knowledge units, related knowledge points, related experiments, and related equipment and skills. The specific formula is as follows: v e =Pooling(T head (v h )∪T tail (v t )),e∈G Among them, G represents the middle school experiment knowledge graph, e represents the node in the graph, that is, the middle school experiment knowledge entity, v e Represents the hidden state vector of the current node, v h 、v t Respectively represent the head and tail neighbor nodes; Pooling(·) represents the pooling method; T head (·), T tail (·) represents the conversion function of the head and tail neighbor nodes respectively, and the output is the aggregation of neighbor features; Step 1.3: Embedding of entities outside the middle school experiment knowledge graph; For the middle school experiment knowledge graph, entities outside the graph can obtain vector representations through the relationship with entities within the graph based on the node propagation of the graph neural network.
3. The knowledge completion method for middle school experimental knowledge graph according to claim 1 is characterized in that: In step 2, entity types include knowledge unit, knowledge point, experiment, and skill equipment; relationship types include parallel, predecessor, successor, parent, child, include, and cover.
4. The knowledge completion method for middle school experimental knowledge graph according to claim 1 is characterized in that: The method of obtaining the knowledge triple score S of the middle school experiment knowledge graph includes the following steps: Step 2.1: Select TransH as the output model. The middle school experimental knowledge graph involves complex 1-to-N and N-to-N relationship patterns. Therefore, we use the TransH translation model for representation learning as the output model of the graph neural network. TransH is also a commonly used model for triple classification. Step 2.2: Construct negative triples. The goal of model training is to distinguish positive triplets from negative triplets. The selection of negative triplets will affect the training results of the model. The knowledge extraction method of the middle school experimental knowledge subgraph is the same as that of the main graph. The head entity or tail entity in the current middle school experimental knowledge triple is randomly replaced based on the Bernoulli probability. The replacement range is the head entity set and tail entity set of all triples involved in the relationship. Step 2.3: Obtain the knowledge triple score S; calculate it through the distance evaluation function of the TransH model.
5. The dynamic knowledge completion method for middle school experimental knowledge graph according to claim 1 is characterized in that: The completion of the classification of the secondary school experimental knowledge triples comprises the following steps: Step 4.1: Perform preliminary classification based on the triplet score S. When S is greater than the interval τ between the positive and negative triples, the sample is directly classified as a negative example. In other cases, further judgment is required. Step 4.2: Construct an approximate triplet; for the current triplet (h, r, t), find the most similar relation r′, construct an approximate triplet (h, r′, t), obtain the score S′ and compare it with the threshold. If the approximate triplet is also judged as a positive example, then enter the confidence judgment; otherwise, the current triplet is judged as a positive example; Step 4.3: Further judge based on the confidence of the triplet; calculate the confidence of r and r' respectively. When the confidence of r' is higher, the current triplet is judged as a negative example; otherwise, the current triplet is judged as a positive example; Step 4.4: Use the obtained positive example triples to complete the middle school experiment knowledge graph.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the dynamic knowledge completion method for the middle school experiment knowledge graph as described in any one of claims 1-5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the dynamic knowledge completion method for the middle school experiment knowledge graph as described in any one of claims 1-5.
Citation Information
Patent Citations
Knowledge base completion method based on WCUR algorithm
CN111027700A