Device, computer program and computer-packaged method for determining negative samples for training knowledge graph embedding of knowledge graph

JP2023009024A5Active Publication Date: 2025-05-13ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2022108359
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-07-06
Filing Date
2022-07-05
Publication Date
2025-05-13
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

Generating suitable negative triples for training knowledge graph embeddings is challenging due to the difficulty in creating incorrect facts that contradict the knowledge graph and its ontology.

Method used

A method for determining negative samples by augmenting the knowledge graph with an ontology to identify contradictions, replacing entities within triples to create semantically similar incorrect triples, and using these to train the knowledge graph embeddings.

Benefits of technology

This approach systematically generates negative samples that effectively improve the training of knowledge graph embeddings by identifying and correcting inconsistencies, enhancing the model's predictive accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To provide a method, a program and a device for determining negative samples for training a knowledge graph embedding of a knowledge graph.SOLUTION: A method includes the steps of: determining predicted triples 310, using knowledge graph embedding 308; determining a set 312 of triples including at least one triple of a knowledge graph 302, and at least one of the predicted triples 310 that are inconsistent with respect to ontology 304; determining, from the set 312 of triples, a replacement entity for object entity in the triple of the prediction triple 310; determining a negative sample 306-1 so as to include a relation, subject entity and replacement entity; or determining, from a subset 312, a replacement entity for the subject entity in the predicted triples 310; and determining the negative sample 306-1 so as to include the relation, the object entity and the replacement entity.SELECTED DRAWING: Figure 3
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a computer-implemented method for determining negative samples for training knowledge graph embedding of a knowledge graph KG.

Background Art

[0002] KG can be trained using positive triples or negative triples. Since KG explicitly stores only positive triples as facts of the KG, generating appropriate negative triples is recognized as a very difficult problem.

Summary of the Invention

Problems to be Solved by the Invention

[0003] It is desirable to provide a method having a systematic approach for providing negative samples that are actually inappropriate facts.

Means for Solving the Problems

[0004] Disclosure of the Invention A computer-implemented method for determining negative samples for training a knowledge graph embedding of a knowledge graph, wherein the knowledge graph is extended by an ontology, the ontology includes at least one constraint for distinguishing facts in the knowledge graph from false facts, wherein the method includes the following steps: namely, determining a predictive triple using a knowledge graph embedding; determining a set of triples including at least one triple of the knowledge graph and at least one predictive triple that is inconsistent with respect to the ontology, wherein at least one of the predictive triples includes subject entities, relation entities and object entities from the knowledge graph; determining a negative sample from the set of triples to include a substitute entity for the object entity in at least one of the predictive triples, and including a relation entity and a substitute entity, or determining a negative sample from a subset to include a substitute entity for the subject entity in at least one of the predictive triples, and including a relation entity and a substitute entity. The set of triples including the triples from the input knowledge graph and the predictive triples created by the embedding represents an explanation for inconsistency. This explanation leads to the inference of further semantically similar contradictory triples. These further contradictory triples are determined through the generalization of the contradictory triples inferred by the embedding model. The triples generated by this method are negative samples that contradict the knowledge graph and its associated ontology.

[0005] The method may include the step of determining a replacement entity for an object entity such that the triple resulting from replacing the object entity with a replacement entity is different from at least one predictive triple and a triple in the knowledge graph, or the step of determining a replacement entity for a subject entity such that the triple resulting from replacing the subject entity with a replacement entity is different from at least one predictive triple and a triple in the knowledge graph.

[0006] The step of determining a replacement entity for a subject entity may include determining the local type of the subject entity within a set of triples, and selecting a replacement entity that has the local type of the subject entity in a predetermined order from the local type of the subject entity. This means that an entity in the neighborhood of the knowledge graph will be found as a substitute for the subject entity.

[0007] The step of determining a substitute entity for an object entity may include determining the local type of the object entity within a set of triples, and selecting a substitute entity having the local type in a predetermined order from the local type of the object entity. This means that an entity in the neighborhood of the knowledge graph will be found as a substitute for the object entity.

[0008] Preferably, the method includes the steps of determining multiple substitution entities within a set of triples, and determining a negative sample for each substitution entity within the multiple substitution entities.

[0009] To make negative samples available for further training, the method includes the steps of determining and / or storing training data that includes at least one negative sample.

[0010] This method may include a step of training a knowledge graph embedding within an iteration using at least one negative sample from a previous iteration.

[0011] A device for determining negative samples for training a knowledge graph embedding of a knowledge graph, wherein the knowledge graph is augmented by an ontology, wherein the ontology includes at least one constraint for distinguishing facts in the knowledge graph from false facts. The device is configured to perform the method.

[0012] A computer program includes computer-readable instructions that cause the computer to perform this method when it is executed by the computer.

[0013] Further preferred embodiments can be derived from the following description and drawings. [Brief explanation of the drawing]

[0014] [Figure 1] This is a diagram illustrating an example of a knowledge graph. [Figure 2] This diagram schematically illustrates a device for determining negative samples to train knowledge graph embeddings in a knowledge graph. [Figure 3] This figure illustrates part of the method for determining negative samples to train knowledge graph embeddings in a knowledge graph. [Modes for carrying out the invention]

[0015] A knowledge graph (KG) includes a set of entities and a set of relationships. A KG describes facts about a given domain of interest by representing facts using at least one entity from the set of entities, which are interconnected to at least one other entity from the set of entities via at least one relationship from the set of relationships.

[0016] In the KG representation, entities are represented by KG nodes, and the relationship between two entities is represented by KG edges between these nodes.

[0017] A fact is a triple of subject, predicate, and object. In KG, the subject is an entity, the object is also an entity, and the predicate represents a relationship.

[0018] In the Knowledge Graph Embedding (KGE) of the Knowledge Graph (KG), entities are represented by embeddings. In the KGE, relationships are represented by embeddings. A triple of subject, predicate, and object embeddings for a given fact represents that fact in the KGE.

[0019] KG may be used to predict the relationship between a first given entity and a second given entity. The relationship may be selected from a set of relationships depending on the score. The score may be determined using a scoring function that maps the embedding of the first entity in KGE, the embedding of the second entity in KGE, and the embedding of the relationship in KGE to the score.

[0020] KG may be used to predict a first entity having a given relationship to a given second entity. The first entity may be selected from a set of entities depending on the score. The score may be determined using a scoring function that maps the embedding of the first entity in KGE, the embedding of a given second entity in KGE, and the embedding of a given relationship in KGE to the score.

[0021] The embedding may be a vector in a vector space. The step of determining the score using a scoring function may include a step of determining a vector sum or vector multiplication. Different expressions may be used similarly to determine the score. The step of determining the vector sum may include a step of adding a vector representing a relation to a vector representing a first entity. The step of determining the score may include a step of determining the distance of the vector sum with respect to a vector representing a second entity. This distance may similarly be determined by vector multiplication or a different expression.

[0022] An entity embedding may be a vector in a first vector space. A relation embedding may be a vector in a first or second vector space. The step of determining the score may include determining the mapping between a first vector representing a first entity in the first vector space and the first vector in the second vector space. The step of determining the score may include determining the mapping between a second vector representing a second entity in the first vector space and the second vector in the second vector space. The step of determining the score using a score function may include determining the vector sum. The step of determining the vector sum may include adding a vector representing a relation in the second vector space to the first vector. The step of determining the score may include determining the distance of the vector sum with respect to the second vector.

[0023] In one example, this distance is the Euclidean distance.

[0024] To predict the relationship with KG, an input containing two given entities may be mapped to an output containing a relationship. The relationship may be selected from a set of relationships. In one example, the selected relationship will have a higher score than at least the other relationships in the set. Preferably, this relationship is the one with the highest score in the set of relationships.

[0025] To predict entities using KG, an input containing a given entity and a predetermined relationship may be mapped to an output containing the entity. The entity may be selected from a set of entities. In one example, the selected entity will have a higher score than at least the other entities in the set. Preferably, this entity is the one with the highest score in the set of entities.

[0026] A neural network may be trained to represent KGE. The neural network may be trained with training data that includes embedded triples. The training data may include triples that represent true facts of KG. The training data may also include triples that represent triples that are not true facts of KG.

[0027] The neural network may be trained to map a first embedding of a given first entity and a second embedding of a given second entity in a set of entities to a relation-specific score in a set of relations. The relation score represents the probability that this relation is between a given first entity and a given second entity.

[0028] The neural network may be trained to map a given entity embedding and a given relation embedding of a set of relations to an entity-specific score for the set of entities. The entity score represents the probability that this entity has a given relation to a given entity.

[0029] KG is widely used for natural language question-and-answer, web search, the Internet of Things, and data analysis. KG stores information on millions of facts.

[0030] KG may be built automatically or semi-automatically, or it may be built at least partially manually, for example, by using crowdsourcing techniques.

[0031] In training, KG or KGE, particularly neural networks, can be trained using training data to represent available knowledge. This training data may include positive triples representing true facts and negative triples representing false facts.

[0032] KG or KGE, in particular neural networks, may be trained using positive triples or negative triples.

[0033] The method described below provides a systematic approach to generating negative triples, which are inaccurate facts.

[0034] This method recognizes correct triples, i.e., positive triples, and incorrect triples, i.e., negative triples.

[0035] KG represents an interlinked collection of fact information. KG may also be encoded as a set of triples (subject; predicate; object), for example, (john;worksAt;bosch). The subject or object of such a triple is called an entity, and the predicate is called a relation. A set of KG triples can be represented as a directed graph with labeled vertices and edges. A KG triple is called a fact. A KG fact is expressed as follows: man(john),worksAt(john;bosch) It can be expressed as a unary or binary base predicate.

[0036] Figure 1 schematically shows knowledge graph 100. This knowledge graph 100 contains multiple entities and multiple relationships. From this knowledge graph 100, the following knowledge graph facts can be derived, namely, (102,120,104) (110,122,104) (106,124,102) (106,128,108) (110,126,106) (110,130,108) (112,132,114) This is available. In this example, knowledge graph facts are defined by triples (X, Y, Z), where X represents the subject entity, Y represents the relation, and Z represents the object entity.

[0037] In this example, entity 102 is "hpi", entity 104 is "germany", entity 106 is "bob", entity 108 is "person", entity 110 is "john", entity 112 is "bosch", and entity 114 is "company". In this example, relation 120 is "locatedIn", relation 122 is "livesIn", relation 124 is "worksAt", relation 126 is "friendOf", relation 128 is "type", relation 130 is "type", relation 132 is "type", and relation 134 is "locatedIn". Other entities and other relations may also exist.

[0038] In this example, relation 134 is a false predictive fact. In this example, relations 120, 122, 124, 126, 128, 130, and 132 are true facts.

[0039] KG is extended using ontologs. An ontology contains the representations, formal names, and definitions of the individuals, classes, and properties that materialize the domain of each discussion. An ontology includes formal explicit descriptions of classes and / or properties, and axioms relating to said classes and / or properties.

[0040] The ontology may be provided to detect or avoid inconsistencies in the KG. Inconsistency means, for example, that there is a contradiction between one or more facts in the first dataset and one or more axioms in the ontology.

[0041] The KG in Figure 1 refers to, for example, the following:

number

[0042] In the context of this disclosure, a set of types is a set of class names N C This refers to a set of relationships, and a set of property names N p This refers to a set of entities as a set of individuals N. I It is called that.

[0043] Set N of property names p This includes the relation rdf:type, which is referred to as a type.

[0044] KGG is a set of triples of the form <s,o,p>, where s∈N I If p∈Np and p≠type, then o∈N I , otherwise o∈N C That is the case.

[0045] The KG follows the open-world assumption, meaning that only the positive fact portion can be stored. For example, given the KG in Figure 1, <john,type,person> and <john,livesIn,germany> are true KG facts, however, it is unknown whether <john,worksAt,bosch> is a true KG fact or not.

[0046] Given a triple α, Ent(α) represents the set of all entities that appear in α. For a set of triples, this is given by Ent(G) = U α∈G It is extended to something like Ent(α).

[0047] In this example, ontology O is

number

[0048] The class C indicating a set of entities and the role R indicating a binary relationship between entities are in the following syntax

Number

[0049] Here, A, B ∈ N C are atomic classes, P ∈ N P is an atomic property, that is, a binary relationship. The ontology O reflects the transitivity of the relationship R

Number

Number

[0050]

Table 1

[0051] In the above, A; R are class names and property names respectively, C and D are class expressions, P; S are property expressions, and a; b are entities.

[0052] The exemplary KG shown in Figure 1, extended with ontology O, reflects domain knowledge about people and their workplaces. This ontology explicitly states that (1) the domain of the "worksAt" relationship is "person," (2) the scope of "locatedIn" is "location," and (3) "person" is disjointed with "location."

[0053] The semantics of knowledge graphs and ontologs may be used to detect inconsistencies in the KG and to provide explanations for them. The semantics of the KG and ontologs are interpreted as I=(Δ I ,· I It is defined using direct model theory semantics via ), and this interpretation I=(Δ I ,· I ) contains the non-empty set Δ I The domain of I and each A∈N C Subset A I ⊆△ I Assign R∈N R A binary relation R I ⊆△ I ×△ I Assign a ∈ N I element a I ∈△ I Interpretation function to assign. I It includes [this].

[0054] Regarding particularly complex classes and roles, Interpretation I applies when the corresponding conditions are met, i.e.,

number

[0055] For KGG and ontology O, I is a model of G∪O, that is, for all axioms α∈G∪O

number

number

number

[0056] KGG is inconsistent with respect to the ontology O if no model of G∪O exists. For example, G∪O is inconsistent if some facts of G contradict some axioms of O.

[0057] Under the considered ontology language, KG inconsistencies have local properties. That is, the problem of checking for inconsistencies with respect to ontology O can be reduced to checking for inconsistencies with respect to separate KG modules with respect to O.

[0058] Given KGG and an entity e∈Ent(G), the module of e with respect to G may be defined as M(e;G)={α|α∈G and e appears in α}. The set of modules for individuals appearing in G is denoted as MG={M(e,G)|e∈Ent(G)}.

[0059] G∪O is consistent if M(a,G)∪O is consistent for all a∈Ent(G).

[0060] The explanation for the contradiction of G∪O is ε G ⊆G and ε O ε=ε using ⊆O G ∪ε O This is shown by the following. This explanation ε is, in this example, the smallest contradictory subset of G∪O.

[0061] For example, the fact in Figure 1 that has relation 134 is inconsistent with ontology O. A possible explanation for this is ε G ={〈bosch,locatedIn,john〉,〈john,type,person〉} and

number

[0062] In this example, KGE represents entities and relations in a continuous vector space as embeddings, i.e., vectors or matrices. These embeddings are represented in this example by a scoring function, i.e., f:N I ×N P ×N I It is used to estimate the likelihood of a triple that should be true via [this method].

[0063] The specific scoring functions are defined based on various assumptions about the vector space. The likelihood of each assumption of the embedding method holding should be higher for triples within the KG than for negative samples outside the KG. The learning process may be carried out by minimizing the errors induced by the assumptions given by each loss function.

[0064] According to the paper "Translating embedding for modeling multi-relational data. In: NeurIPS. pp. 2787-2795 (2013)" by Bordes, A., Usunier, N., Garcia-Duran, A., Weston, J., Yakhnenko, O., TransE embeds entities and relationships as vectors for true triples.

number

number

[0065] According to the paper "Complex embedding for simple link prediction. In: ICML. pp.2071-2080 (2016)" by Trouillon, T., Welbl, J., Riedel, S., Gaussier, E., Bouchard, G., ComplEx embeds entities as vectors and relationships as matrices, and for true triples, it embeds the subject v S Linear mapping M P However, object embedding v O :

number

number

[0066] KGE may be trained using one of these loss functions, or it may be trained using any other loss function.

[0067] Device 200 for determining negative samples for training KGE is schematically shown in Figure 2. This device 200 includes at least one storage and at least one processor.

[0068] In this example, storage 202 is configured to store KG, KGE, ontology, positive samples, and negative samples.

[0069] In this example, processor 204 is configured to execute a method for determining negative samples for training KGE. This method will be described below with reference to Figure 3. Storage 202 can store computer-readable instructions that cause processor 204 to execute this method when executed by processor 204.

[0070] The inputs to this method are KG302 and ontology 304. KG302 may be G, and ontology 304 may be O. The output of this method is a set of negative samples 306-1. The method also includes a step of providing positive samples 306-2 from KG302. These negative samples 306-1 and positive samples 306-2 are incorporated during the iterative training and tuning of KGE308 in at least one iteration.

[0071] KGE308 may be defined according to any embedding method, such as TransE or ComplEx. The aim of this method is to generate an extended KGE308 that is trained to predict triples consistent with KG302 and ontology 304.

[0072] Negative sample 306-1 is obtained based on at least one predictive triple 310, and on at least one set of triples 312 that represent an explanation for the discrepancy with respect to KG302 and ontology 304.

[0073] This method begins in step 1 during the first training iteration. In step 1, the KGE308 model is initialized.

[0074] In Step 1, negative sample 306-1 is determined from KG302 using a negative sampling method, as described in the paper "Translating embedding for modeling multi-relational data. In: NeurIPS. pp.2787-2795 (2013)" by Bordes, A., Usunier, N., Garcia-Duran, A., Weston, J., Yakhnenko, O. et al.

[0075] Then, step 2 is performed.

[0076] Step 2 of the method includes the step of performing embedded training using negative sample 306-1 and positive sample 306-2 to build a model for KGE308.

[0077] This KGE308 model is used to obtain predictions and compute a set of negative samples for the next training iteration.

[0078] Then, step 3 is executed.

[0079] Step 3 includes the step of determining at least one predictive triple 310 using KGE308.

[0080] At least one triple 310 includes subject and object entities from the knowledge graph 302 and relationships defined for the knowledge graph 302.

[0081] The step of predicting at least one triple 310 may include object prediction and / or subject prediction. The method may include such predictions for each triple in the training data or for a selected triple in the training data. The training data includes negative sample 306-1 and positive sample 306-2.

[0082] In object prediction, the object o is determined for a triple in the training set using the subject s and predicate p of that triple. Preferably, multiple candidate objects are predicted and ranked according to their respective likelihood of being the object that yields a consistent triple, and the top-ranked object o is selected from among the multiple objects.

[0083] These factors allow the prediction triple <s,p,o> to be extracted as the respective predicted values ​​of the KGE308 model.

[0084] In subject prediction, the subject s is determined for a triple in the training set using the object o and predicate p of that triple. Preferably, multiple candidate subjects are predicted and ranked according to their respective likelihood of being the subject that yields a consistent triple, and the top-ranked subject s is selected from among the multiple subjects.

[0085] These factors allow the prediction triple <s,p,o> to be extracted as the respective predicted values ​​of the KGE308 model.

[0086] In this example, triples that are not included in the training set are considered as predicted values. In this example, triples that are included in the training set are not considered predicted values.

[0087] Then, step 4 is performed.

[0088] Step 4 includes determining a set of triples 312 such that it includes at least one triple of the knowledge graph 302 and at least one predictive triple 310 that is inconsistent with respect to the ontology 304.

[0089] Step 4 may include determining a set of explanations for the contradiction and selecting explanations from this set. It is possible that K number explanations are selected.

[0090] Then, step 5 is executed.

[0091] Step 5 includes, with respect to object prediction, determining from a set of triples a substitute entity for the object entity in at least one prediction triple 310, and determining a negative sample 306-1 to include relation, subject entity and substitute entity.

[0092] The step of determining a substitute entity for an object entity may include the steps of determining the local type of the object entity within a set of triples 312, and selecting a substitute entity having a local type from the local type of the object entity in a predetermined order.

[0093] Preferably, the replacement entity for the object entity is determined such that the triple resulting from replacing the object entity with the replacement entity is different from at least one predictive triple and the triples of the knowledge graph 302.

[0094] Step 5 includes determining, for subject prediction, a replacement entity for the subject entity in at least one triple of prediction triple 310 from a set of triples 312, and determining a negative sample 306-1 to include relation, object entity and replacement entity.

[0095] The step of determining a replacement entity for a subject entity may include the steps of determining the local type of the subject entity within a set of triples 312, and selecting replacement entities having the local type from the local type of the subject entity in a predetermined order.

[0096] The local type of an entity is defined as a tuple that includes other entities via type-relationships, as well as input / output relationships to and from that entity. The local types of entities can be ordered based on some criterion, such as subset-relationships.

[0097] Preferably, the replacement entity for the subject entity is determined such that the triple resulting from replacing the subject entity with the replacement entity is different from at least one predictive triple and triples in the knowledge graph.

[0098] This means that at least one predicted triple 310 is generalized to a generalized triple for other semantically similar triples. Using this generalized triple, an extended set of negative samples 306-1 is obtained.

[0099] Subsequently, the calculated negative sample 306-1 is fed back as input for training. Preferably, negative samples for subject prediction and object prediction are fed back as input for training.

[0100] Then, step 2 is performed.

[0101] Steps 4 and 5 describe at least one predictive triple 310. If more than one predictive triple 310 is found to be inconsistent with respect to KG302 and ontology 304, these triples may be treated similarly.

[0102] Preferably, a set of inconsistent triples is predicted during training. Therefore, once inconsistent predictions for a triple are identified, step 5 may include the step of detecting an inconsistency pattern from that prediction and generalizing the inconsistency pattern to obtain entities of KG302 which may be used as replacement entities to form other similar inappropriate triples. The similar inappropriate triples are triples generalized with respect to the inconsistent triples actually detected.

[0103] In this way, a sufficient number of negative samples 306-1 are computed for retraining the KGE308 model. The negative samples 306-1 provide hints to the KGE308 model about the incorrectly learned patterns, thereby avoiding similar incorrect triple predictions in subsequent iterations.

[0104] For example, a predictive triple with inconsistent object predictions.

number

number

number

[0105] However, object

number

[0106] Objects that create contradictions regarding ontology

number

number

[0107] In the exemplary KGG and ontology O shown in Figure 1, the prediction triple may be assumed to be α = <bosch, locatedIn, john>. This means that the KGE model 310 predicted "john" as the object entity for the given subject "bosch" and relation "locatedIn". The explanation for the inconsistency of Relv(α, G, G) ∪ O is ε = ε G ∪ε O And this is ε G ={〈bosch,locatedIn,john〉,〈john,type,person〉} and

number

[0108] To formally obtain a generalized triple, the concept of local types of entities may be used, for example, as described in the following: "ISWC. pp. 180-195 (2014)" by Glimm, B., Kazakov, Y., Liebig, T., Tran, TK, Vialard, V., "Ontology materialization by abstraction refinement in horn SHOIF. In: AAAI. pp. 1114-1120 (2017)" by Glimm, B., Kazakov, Y., Tran, T., or "Fast computation of explanations for inconsistency in large-scale kgs. In: WWW 2020. pp. 2613-2619 (2020)" by Tran, T., Gad-Elrab, MH, Stepanova, D., Kharlamov, E., Stroetgen, J.

[0109] Local type: Let T be a set of triples, and let e be an entity that appears in T. Then, if T is obvious from the context, the local type of e with respect to T, described as τ(e;T) or τ(e), is the tuple τ(e) = 〈τ i (e), τ c (e), τ o (e)〉 is defined as follows: where τ i (e) = {p|〈s,p,e〉∈G}, τ c (e) = {t|〈e,type,t〉∈G} and τ o (e) = {p'|〈e,p',o〉∈G}.

number

number

[0110] The local type of an entity is a set of types τ c , as well as the input relation τ for that entity within the set of triples i and output relationship τ o It represents.

[0111] In the example KG shown in Figure 1, the local type of "bob" with respect to G is τ(bob) = <{friendOF},{person},{worksAt}>. Explanation ε G The local type of "john" with respect to \α is

number

number

[0112] The generalized triple may be determined as a generalized sample of a given inconsistent predicted triple.

[0113] Generalized sample: In the following, KG302 will be referred to as G, Ontology 304 as O, and Triple 310 as

number

number

number

number

number

number

number

[0114] In the case of KGG, the triple α of ontology O and its Relv(α,G)∪O is the explanatory ε G ∪ε O This contradicts the fact that GeneralizedSamples(α) is a set of generalized triples of α with respect to ε,G, and some entities that appear in α,Relv(β,G)∪O contradict β∈GeneralizedSamples(α).

[0115] The generalized triple of the iteration may be used as the negative sample 306-1 for retraining the KGE model 308 in the next one or more iterations.

[0116] The predictive triple may relate to the machine's state, the properties of the object in the digital image, or the answer to the question.

[0117] The aforementioned triples may represent the machine's state, the properties of the object in the digital image, or the answer to a question.

[0118] A knowledge graph may represent knowledge about the mapping of machine status messages to machine states. This method may include receiving a status message and outputting a machine state in response to the status message. The state may be determined by predicting, using a knowledge graph embedding model, whether a triple exists that includes a subject entity representing the status and an object entity representing the machine state. This method may include outputting the machine state.

[0119] In the case of digital image processing, the knowledge graph may be a description of the object recognized in object recognition for an image. Entities in the knowledge graph can represent the object and / or its properties. This method may include receiving an object and outputting a description corresponding to the object.

[0120] In Street View, the object may be a car, a person, a house, or other part of the infrastructure. In Street View, a knowledge graph triple can describe the object and / or the relationship between the object and other objects, particularly in the digital image. This method may include receiving an object and outputting a description corresponding to the object.

Claims

1. 1. A computer-implemented method for determining negative samples (306-1) for training a knowledge graph embedding (308) of a knowledge graph (302), comprising:

1. A method according to claim 1, wherein the knowledge graph (302) is extended by an ontology (304), the ontology (304) including at least one constraint for distinguishing facts of the knowledge graph (302) from false facts, the method comprising: determining (3) predicted triples (310) using the knowledge graph embeddings (308); determining (4) a set of triples (312) comprising at least one triple in the knowledge graph (302) and at least one predicted triple (310) that is in conflict with respect to the ontology (304), wherein at least one of the predicted triples (310) comprises a subject entity, a relation, and an object entity from the knowledge graph (302); determining (5) from the set of triples (312) a replacement entity for the object entity in at least one of the predicted triples (310) and determining the negative sample (306-1) to include the relation, the subject entity and the replacement entity; or determining (5) from the subset (312) a replacement entity for the subject entity in at least one of the predicted triples (310) and determining the negative sample (306-1) to include the relation, the object entity and the replacement entity; 16. A computer-implemented method comprising:

2. 2. The method of claim 1, further comprising: determining (5) a replacement entity for the object entity such that triples resulting from replacing the object entity with the replacement entity differ from the at least one predicted triple and from triples in the knowledge graph (302); or determining (5) a replacement entity for the subject entity such that triples resulting from replacing the subject entity with the replacement entity differ from the at least one predicted triple and from triples in the knowledge graph (302).

3. 2. The method of claim 1, wherein determining (5) the replacement entity for the subject entity comprises determining a local type of the subject entity within the set of triples (312) and selecting from the local types of the subject entity the replacement entity having a local type within a predetermined order.

4. 2. The method of claim 1, wherein the step of determining (5) the replacement entity for the object entity comprises the steps of determining a local type of the object entity within the set of triples (312) and selecting from the local types of the object entity the replacement entity having a local type within a predetermined order.

5. 2. The method of claim 1, comprising determining a plurality of replacement entities within the set of triples (312); and determining a negative sample (306-1) for each replacement entity within the plurality of replacement entities.

6. The method of claim 1, comprising determining and / or storing training data comprising at least one negative sample (306-1).

7. 2. The method of claim 1, further comprising the step of: training (2) the knowledge graph embedding (308) within an iteration using at least one negative sample (306-1) of a previous iteration.

8. A device (200) for determining negative samples (306-1) for training a knowledge graph embedding (308) of a knowledge graph (302), comprising: A device (200) in which the knowledge graph (302) is extended by an ontology (304), the ontology (304) including at least one constraint for distinguishing facts of the knowledge graph (302) from false facts, A device (200) configured to carry out the method according to any one of claims 1 to 7.

9. A computer program comprising computer readable instructions which, when executed by a computer, cause the computer to carry out the method according to any one of claims 1 to 7.