Knowledge graph entity relationship determination method and device, equipment and storage medium

By using time information as an independent dimension and relationship path for independent logical analysis, time triples are formed and stored in the graph database, which solves the problem of inaccurate derivation of entity relationships in the knowledge graph and improves the accuracy and consistency of logical derivation.

CN118747529APending Publication Date: 2024-10-08DAZHEN (HANGZHOU) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410967027.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

In the process of logical derivation of knowledge graphs, the relationship or attribute derivation based on triples often has the problem that the logic or attribute relationship does not match the actual situation, resulting in insufficient accuracy.

Method used

Time information is used as an independent dimension to conduct logical analysis independently of the relationship path. By forming time triples and storing them in the graph database, the entity relationship between the two entities in the knowledge graph is determined, and the time information is used to verify the relationship path. effectiveness.

Benefits of technology

It improves the accuracy of logical derivation of knowledge graphs, ensures the accuracy and consistency of entity relationships, and reduces the occurrence of derivation errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747529A_ABST
    Figure CN118747529A_ABST
Patent Text Reader

Abstract

Some embodiments of the invention disclose a knowledge graph entity relationship determination method, apparatus and device, and a storage medium, in the method, time information is taken as an independent dimension, is mutually independent from a relationship path of a relationship triple, and can be taken as an independent dimension for logic research and judgment, so as to deny the relationship path of which the time does not conform to logic, thereby improving the reliability of the knowledge graph entity relationship. And furthermore, the entity relationship between the two triads in the relationship path is accurately determined. The method comprises the following steps: forming a time triple from time information and an identifier of a relation triple, and storing the time triple into a graph database; receiving a request for determining an entity relationship between two entities, wherein other entities exist between the two entities; obtaining a target time triple to which the entity belongs and a target time triple to which an entity located between the two entities belongs from the graph database; and determining an entity relationship between the two entities according to all the target time triples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of knowledge graphs, and in particular to a method, apparatus, device and storage medium for determining entity relationships in a knowledge graph. Background Art

[0002] In the process of logical deduction of knowledge graph, the deduction logic of relationship or attribute is performed based on triples, but the deduced logic or attribute relationship often does not match the actual situation. Therefore, how to improve the accuracy of logical deduction of knowledge graph has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0003] The present application provides a method, apparatus, device and storage medium for determining entity relationships in a knowledge graph. In this method, time information is used as an independent dimension, which is independent of the relationship path and can be used as a separate dimension for logical analysis to deny the relationship path that does not conform to the logic of time, thereby accurately determining the entity relationship between two entities in the knowledge graph.

[0004] In a first aspect, an embodiment of the present application provides a method for determining a knowledge graph entity relationship, comprising:

[0005] Acquire a relation triplet from a data source, and store the relation triplet in a database, where the relation triplet in the database has a corresponding identifier;

[0006] Acquire time information corresponding to the relationship triple;

[0007] The time information and the identifier of the relationship triplet are used to form a time triplet, and the result is stored in a graph database;

[0008] Receiving a request to determine an entity relationship between two entities in a knowledge graph, wherein other entities exist between the two entities;

[0009] Acquire, from the graph database, a target time triplet to which the entity belongs, and a target time triplet to which an entity located between two of the entities belongs;

[0010] An entity relationship between two entities is determined according to all the target time triples.

[0011] In some embodiments, the step of determining the entity relationship between two entities according to all the target time triples comprises:

[0012] Determine the logical deduction relationship and the time deduction relationship between adjacent relationship triples in the relationship triples corresponding to the target time triples;

[0013] The entity relationship between two entities is determined according to the logical deduction relationship and the time deduction relationship between all adjacent relationship triples.

[0014] In some embodiments, the step of determining the logical deduction relationship and the time deduction relationship between adjacent relationship triples in the relationship triples corresponding to the target time triples comprises:

[0015] Acquire, from the database, a relation triplet corresponding to the identifier in the target time triplet, and determine a logical deduction relationship between adjacent relation triples in the acquired relation triplet corresponding to the identifier;

[0016] According to the time information in the adjacent target time triples, the time derivation relationship between the adjacent relationship triples corresponding to the adjacent target time triples is determined.

[0017] In some embodiments, the step of determining the entity relationship between two entities according to the logical derivation relationship and the temporal derivation relationship between all adjacent relationship triples comprises:

[0018] Determine the entity relationship between adjacent relationship triples according to the logical deduction relationship and the time deduction relationship between adjacent relationship triples;

[0019] The entity relationship between two entities is determined based on the entity relationships between all adjacent relationship triples.

[0020] In some embodiments, the time information includes a time attribute and a time content; the first time attribute in the time information of one of the adjacent target time triples is a validity period, and the first time content is a first start time to an end time; the second time attribute in the time information of the other target time triple is a validity period, and the second time content is a second start time; wherein, the step of determining the time derivation relationship between adjacent relationship triples corresponding to the adjacent target time triples according to the time information in the adjacent target time triples comprises:

[0021] Determine the order of the first start time, the end time, and the second start time;

[0022] If the second start time is between the first start time and the end time, determining that the attribute in the time derivation relationship between the adjacent relationship triples corresponding to the adjacent target time triples is the validity period, and the content in the time derivation relationship is from the first start time to the end time;

[0023] If the second start time is earlier than the first start time, or the second start time is later than the end time, it is determined that the attribute in the time derivation relationship between the adjacent relationship triples corresponding to the adjacent target time triples is valid, and the content in the time derivation relationship is invalid.

[0024] In some embodiments, the logical deduction relationship and the temporal deduction relationship between the adjacent relationship triples, the step of determining the entity relationship between the adjacent relationship triples comprises:

[0025] If the second start time is between the first start time and the end time, determining that the entity relationship between adjacent relationship triples is a relationship in a logical deduction relationship;

[0026] If the second start time is earlier than the first start time, or the second start time is later than the end time, it is determined that the entity relationship between adjacent relationship triples is entity-independent in the logical deduction relationship.

[0027] In a second aspect, an embodiment of the present application provides a device for determining a knowledge graph entity relationship, including:

[0028] A first acquisition unit is used to acquire a relation triplet from a data source and store the relation triplet in a database, wherein the relation triplet in the database has a corresponding identifier;

[0029] A second acquisition unit, used to acquire time information corresponding to the relationship triple;

[0030] a forming unit, configured to form a time triplet from the time information and the identifier of the relationship triplet, and store the time triplet in a graph database;

[0031] A receiving unit, configured to receive a request to determine an entity relationship between two entities in a knowledge graph, wherein other entities exist between the two entities;

[0032] A third acquisition unit is used to acquire, from the graph database, a target time triplet to which the entity belongs, and a target time triplet to which an entity located between two of the entities belongs;

[0033] A determination unit is used to determine the entity relationship between two entities according to all the target time triples.

[0034] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method for determining entity relationships in a knowledge graph when executing the computer program.

[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for determining entity relationships in a knowledge graph.

[0036] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method for determining entity relationships in a knowledge graph.

[0037] In the above embodiments, a method, device, equipment and storage medium for determining entity relationships of a knowledge graph are provided. In this method, time information is used as an independent dimension, which is independent of the relationship path and can be used as a separate dimension for logical analysis to negate the relationship path that does not conform to the logic of time, thereby accurately determining the entity relationship between two entities in the knowledge graph. The method includes: obtaining a relationship triple and storing the relationship triple in a database, wherein the relationship triple in the database has a corresponding identifier; obtaining time information corresponding to the relationship triple; forming a time triple with the time information and the identifier of the relationship triple, and storing it in a graph database; receiving a request to determine the entity relationship between two entities, wherein there are other entities between the two entities; obtaining from the graph database a target time triple to which the entity belongs, and a target time triple to which an entity located between the two entities belongs; determining the entity relationship between the two entities based on all the target time triples. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flowchart of a method for determining a knowledge graph entity relationship is exemplarily shown according to some embodiments;

[0039] Figure 2 A flowchart of another method for determining a knowledge graph entity relationship is exemplarily shown according to some embodiments;

[0040] Figure 3 A structural diagram of a device for determining entity relationships in a knowledge graph provided according to some embodiments is exemplified. DETAILED DESCRIPTION

[0041] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0042] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0043] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.

[0044] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.

[0045] In the process of logical deduction of knowledge graph, the deduction logic of relationship or attribute is performed based on triples, but the deduced logic or attribute relationship often does not match the actual situation. Therefore, how to improve the accuracy of logical deduction of knowledge graph has become a technical problem that needs to be solved urgently by those skilled in the art.

[0046] In order to solve the above technical problems, the embodiments of the present application provide a method, device, equipment and storage medium for determining entity relationships in a knowledge graph. In this method, time information is used as an independent dimension, which is independent of the relationship path and can be used as a separate dimension for logical analysis to deny the relationship path that does not conform to the logic of time, thereby accurately determining the entity relationship between two entities in the knowledge graph.

[0047] Figure 1 The flowchart of a method for determining entity relationships in a knowledge graph according to some embodiments is exemplarily shown. The method includes S100-S600.

[0048] S100: Acquire a relation triplet from a data source, and store the relation triplet in a database, wherein the relation triplet in the database has a corresponding identifier.

[0049] In some embodiments, the step of obtaining a relation triplet from a data source and storing the relation triplet in a database includes: extracting relations from the data source to obtain associated field information, generating a relation triplet using the associated field information, and storing the relation triplet in the database.

[0050] In this embodiment, the data source is a wide table containing the required relationship class data produced through steps such as labeling, feature extraction, and data cleaning. Relationship extraction from the data source is specifically to extract the required associated field information through the wide table. The step of generating a relationship triple using the associated field information and storing it in a database includes: making the triple field in the associated field information separately into a vertical table (vertical table type) and storing it separately, and storing it in the database, and constructing an identifier corresponding to the triple field in the database, which is the identifier corresponding to the relationship triple.

[0051] In the embodiment of the present application, the identifier of the relationship triplet corresponds one-to-one to the relationship triplet, and the identifier uuid can be determined by a combination of numbers and / or letters.

[0052] S200: Obtain time information corresponding to the relationship triplet.

[0053] In some embodiments, the time information includes time attributes and time content. The time attributes include validity period, start time, end time, etc. The time content is a specific time, and an exemplary time content is the start time July 10, 24. Of course, the time content can also be accurate to minutes and seconds. In some embodiments, the time information is extracted through a wide table, and the wide table includes the time information.

[0054] In the first example, the relationship triple a is (name a, husband is, name b), and the relationship triple b is (name b, son is, name c). The time attribute in the time information corresponding to the relationship triple a is the validity period is, and the time content is the start time tisa to the end time tifa. The time attribute in the time information corresponding to the relationship triple b is the validity period is, and the time content is the start time tisb.

[0055] In the second example, the relationship triple A is (name a, company b, legal person), and the relationship triple B is (company b, case number, defendant). The time attribute in the time information corresponding to the relationship triple A is the validity period, and the time content is time c to time d. The time attribute in the time information corresponding to the relationship triple B is the validity period, and the time content is time e.

[0056] S300: Form a time triplet with the time information and the identifier of the relationship triplet, and store it in a graph database.

[0057] In an embodiment of the present application, time information is associated with the graph database as an attribute table in a new triplet manner, namely, a time triplet. The format of the time triplet is (identifier of the relation triplet, time attribute, time content). In some embodiments, the number of time triples depends on the amount of time information extracted from the wide table.

[0058] In the embodiment of the present application, time information is treated as an independent dimension, which is independent of the relationship path and can be used as a separate dimension for logical analysis to deny that time does not conform to the logical relationship logic, thereby accurately determining the entity relationship between two entities.

[0059] The time triplet corresponding to the relation triplet in the first example above includes (the identifier of the relation triplet, the validity period is, the start time tisa to the end time tifa). The time triplet corresponding to the relation triplet in the second example above includes (the identifier of the relation triplet, the validity period is, the start time tisb).

[0060] S400, receiving a request to determine an entity relationship between two entities in a knowledge graph, where other entities exist between the two entities.

[0061] In the embodiment of the present application, the request may be generated by user triggering or automatically generated. It should be noted that the two entities in the request are not adjacent entities, and there are other entities between the two entities.

[0062] S500: Acquire, from the graph database, a target time triplet to which the entity belongs, and a target time triplet to which an entity located between two entities belongs.

[0063] In the embodiment of the present application, the target time triplet to which the entity belongs is the time triplet corresponding to the relationship triplet to which the entity belongs.

[0064] It can be understood that the knowledge graph includes multiple entities, and adjacent entities are connected by edges, each edge representing an attribute or logic. Since the two entities are not adjacent entities, it is necessary to obtain the target time triples to which the two entities belong respectively, as well as the target time triples to which other entities between the two entities belong.

[0065] S600: Determine an entity relationship between two entities according to all target time triples.

[0066] In the embodiment of the present application, all target time triples obtained in step S500 are used to determine the entity relationship between two entities.

[0067] In some embodiments, Figure 2 The flowchart of another method for determining entity relationships of a knowledge graph according to some embodiments is exemplarily shown. The step of determining the entity relationship between two entities according to all target time triples includes:

[0068] S601: Determine the logical deduction relationship and the time deduction relationship between adjacent relationship triples in the relationship triples corresponding to the target time triples.

[0069] In the embodiment of the present application, firstly, the logical deduction relationship and the time deduction relationship between all adjacent relationship triples in the relationship triples corresponding to all target time triples are determined.

[0070] In some embodiments, the step of determining the logical deduction relationship and the time deduction relationship between adjacent relationship triples in the relationship triples corresponding to the target time triples comprises:

[0071] From the database, a relation triple corresponding to the identifier in the target time triple is obtained, and a logical deduction relationship between adjacent relation triples in the obtained relation triples corresponding to the identifier is determined.

[0072] In the embodiment of the present application, the corresponding relation triples can be found from the database through the identifiers of the relation triples, and then the logical deduction relationship between all adjacent relation triples in all the relation triples found can be determined.

[0073] In one example, the relationship triple a0 (name a, father is, name b), and the relationship triple a1 (name b, father is, name c) are adjacent relationship triples. The logical relationship between the relationship triple a0 and the relationship triple a1 can be expressed as R (a0, a1), or as a triple (a0, a1), specifically (name a, grandfather is, name c).

[0074] According to the time information in the adjacent target time triples, the time derivation relationship between the adjacent relationship triples corresponding to the adjacent target time triples is determined.

[0075] Specifically, the time derivation relationship between adjacent relationship triplets can be determined according to the time information in the corresponding target time triplet.

[0076] In some embodiments, the time information includes a time attribute and a time content; the first time attribute in the time information of one of the adjacent target time triples is a validity period, and the first time content is a first start time to an end time; the second time attribute in the time information of the other target time triple is a validity period, and the second time content is a second start time; wherein, the step of determining the time derivation relationship between adjacent relationship triples corresponding to the adjacent target time triples according to the time information in the adjacent target time triples comprises:

[0077] Determine the order of the first start time, the end time, and the second start time;

[0078] If the second start time is between the first start time and the end time, then determining that the attribute in the time derivation relationship between the relationship triples corresponding to the adjacent target time triples is the validity period, and the content in the time derivation relationship is from the first start time to the end time;

[0079] If the second start time is earlier than the first start time, or the second start time is later than the end time, it is determined that the attribute in the time-derived relationship between the relationship triples corresponding to the adjacent target time triples is valid, and the content in the time-derived relationship is invalid.

[0080] In the first example mentioned above, the relationship triple a0 (name a, husband is, name b), the relationship triple b0 (name b, son is, name c), at this time the logical deduction relationship R (a0, b0) of the relationship triples a0 and b0, that is, the triple (a0, b0), is specifically (name a, son is, name c). The triple (b0, a0) is produced by logical deduction, which is specifically (name c, mother is, name a). But a problem arises, name b may be the ex-husband of name a, and after the divorce, name b re-establishes a family with other people and has name c. Because in the embodiment of the present application, the time triple a (the identifier of the relationship triple a0, the validity period is, the start time tisa-end time tifa) is also introduced. Time triple b (the identifier of the relationship triple b, the validity period is, the start time tisb). When outputting the triple (b0, a0), tisa (ab's marriage start time), tifa (ab's marriage end time), and tisb (the start time of the father-son relationship, which is the son's birthday according to common sense) can be used. Determining the order of the first start time, the end time, and the second start time may include determining the order of the start time tisa to the end time tifa and the start time tisb respectively; if the start time tisb is between the start time tisa and the end time tifa, then determining the attribute in the time relationship is the validity period, and the content in the time relationship is the start time tisb; if the start time tisa is later than the end time tifa, or the start time tisa is earlier than the start time tisa, then determining the attribute in the time relationship is the validity period, and the content in the time relationship is invalid, which can be expressed by the formula:

[0081]

[0082] Where TiR is the time-derived relation between relation triplets.

[0083] In the embodiment of the present application, the time link has a unique derivation relationship, and the time derivation relationship is set TiR refers to the final time relationship judgment function of two relationship triplet nodes, and Tis refers to the rule that combines multiple relationship triplet time rules. Time deduction relations are different from logical deductions. Time deduction relations have two characteristics: acting on the overall logical path and each relationship deduction process. For example, in the deduction of family blood relations, the father-son relationship only has a start time, so the continuous deduction rule of the father-son triplet takes the latest time as the validity period. However, there is a possibility of interruption in the relationship between husband and wife. The relationship between brothers needs to determine who is older, or whether they have the same father or mother, etc. Tis refers to the logic of jointly calculating different TiR relationships: for example, when judging whether it is a daughter-in-law relationship, it is necessary to first determine the validity period of the parents' marriage, compare the child's date of birth, and then compare the child's validity period.

[0084] S602: Determine the entity relationship between two entities according to the logical deduction relationship and the temporal deduction relationship between all adjacent relationship triples.

[0085] In some embodiments, the step of determining the entity relationship between two entities according to the logical derivation relationship and the temporal derivation relationship between all adjacent relationship triples comprises:

[0086] Determine the entity relationship between adjacent relationship triples according to the logical deduction relationship and the time deduction relationship between adjacent relationship triples;

[0087] In some embodiments, the step of determining the entity relationship between adjacent relationship triples based on the logical deduction relationship and the time deduction relationship between adjacent relationship triples includes: if the second start time is between the first start time and the end time, then determining that the entity relationship between adjacent relationship triples is a relationship in the logical deduction relationship; if the second start time is earlier than the first start time, or the second start time is later than the end time, then determining that the entity relationship between adjacent relationship triples is entity-irrelevant in the logical deduction relationship.

[0088] In the first example mentioned above, if the start time tisb is between the start time tisa and the end time tifa, it is determined that the entity relationship includes name c, the relationship with name a is and mother, which can be expressed as (name c, the relationship with name a is, mother);

[0089] If the start time tisa is later than the end time tifa, or the start time tisa is earlier than the end time tisa, then it is determined that the entity relationship includes name c, and its relationship with name a is and is irrelevant, which can be expressed as (name c, its relationship with name a is, irrelevant).

[0090] The entity relationship between adjacent relationship triples can be expressed by the following formula: i-1 ,a i )=Rt(r,TIR)(a i-1 ,a i ); where rit(a i-1 ,a i ) represents any two adjacent relationship triples nodes a i , a i-1 The entity relationship between them. r represents the logical inference relationship that is unique to the relationship triple; TIR represents the time inference relationship, which is Rt(r,TIR)(a i-1 ,a i ) indicates that when two relationship triple nodes calculate the entity relationship, the results of the triple relationship inference logic and the time inference relationship are considered simultaneously.

[0091] The entity relationship between two entities is determined based on the entity relationships between all adjacent relationship triples.

[0092] In the embodiment of the present application, since the relationship triplet between two entities will affect the entity relationship between the two entities, the entity relationship between the two entities is determined based on the entity relationship between all adjacent relationship triples. When the entity relationship between one of the adjacent relationship triples includes irrelevant, it is determined that the entity relationship between the two entities includes irrelevant. In one example, rit(a0,a1) is (name c, relationship with name a is, irrelevant), rit(a1,a2) is (name b, relationship with name c is, mother), then rit(a0,a2) is (name b, relationship with name a, irrelevant).

[0093] In some embodiments, according to the entity relationship between adjacent relationship triples, determining the entity relationship between two entities can be expressed by the following formula: Rs(a0,a n ) is the entity relationship between two entities, and the formula is to sum the entity relationships between adjacent relationship triplets in the relationship triples between the two entities.

[0094] In some embodiments, a vector can be generated for any entity. For example, entities a and b generate vectors Va and Vb. a and b are just link relationships in the graph. Time information can generate time dimension vectors Vta and Vtb in the time dimension. The time dimension vectors Vta and Vtb are independent of vectors Va and Vb. This can prevent dimensional interaction during neural network learning and reduce the recall rate.

[0095] In some embodiments, as an alternative in the embodiments of the present application, it is possible to determine relationship triples and separate time triples. The separate time triples are different from the time triples mentioned above. The separate time triples only involve time information and do not contain the identifier of the relationship triples. The separate time triples are data parallel to the relationship triples, and a separate time triple dimension calculation function or screening function of independent operation is added between the two relationship triples. However, the separate time triples are stored as ordinary triples, and independent operation functions are added between attributes and relationships. The calculation requires a larger amount of calculation, and the output entity relationships will be mixed with many intermediate results, and the result set needs to be cleaned.

[0096] In the embodiment of the present application, the time triple is equivalent to nesting a time triple outside the relationship triple. In the embodiment of the present application, the relationship derivation between entities provided by the knowledge graph will be affected by the effective realization of the relationship. In the derivation process of long links, the time attribute will affect the establishment of the indirect relationship model. By adding the restriction relationship of the effective time attribute, that is, the time information, the wrong derivation relationship can be prevented. The method in the embodiment of the present application facilitates the derivation of the relationship between entities and reduces the difficulty of establishing and training the vector derived by deep learning to calculate the entity relationship.

[0097] In the above embodiments, a method, device, equipment and storage medium for determining entity relationships of a knowledge graph are provided. In this method, time information is used as an independent dimension, which is independent of the relationship path and can be used as a separate dimension for logical analysis to negate the relationship path that does not conform to the logic of time, thereby accurately determining the entity relationship between two entities in the knowledge graph. The method includes: obtaining a relationship triple and storing the relationship triple in a database, wherein the relationship triple in the database has a corresponding identifier; obtaining time information corresponding to the relationship triple; forming a time triple with the time information and the identifier of the relationship triple, and storing it in a graph database; receiving a request to determine the entity relationship between two entities, wherein there are other entities between the two entities; obtaining from the graph database a target time triple to which the entity belongs, and a target time triple to which an entity located between the two entities belongs; determining the entity relationship between the two entities based on all the target time triples.

[0098] Further, as Figure 1-2 The specific implementation of the method, the embodiment of the present application provides a device for determining the entity relationship of a knowledge graph, Figure 3 A schematic diagram of a structure of a device for determining a knowledge graph entity relationship according to some embodiments is exemplarily shown, wherein the device comprises:

[0099] The first acquisition unit 301 is used to acquire a relation triplet from a data source and store the relation triplet in a database, where the relation triplet in the database has a corresponding identifier;

[0100] A second acquisition unit 302 is used to acquire time information corresponding to the relationship triple;

[0101] A forming unit 303, configured to form a time triplet from the time information and the identifier of the relationship triplet, and store the time triplet in a graph database;

[0102] A receiving unit 304 is used to receive a request to determine an entity relationship between two entities in a knowledge graph, where there are other entities between the two entities;

[0103] The third acquisition unit 305 is used to acquire, from the graph database, a target time triplet to which the entity belongs, and a target time triplet to which an entity located between two entities belongs;

[0104] The determining unit 306 is configured to determine an entity relationship between two entities according to all the target time triples.

[0105] Another embodiment of the present application provides a storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the following method steps: obtaining a relationship triple and storing the relationship triple in a database, wherein the relationship triple in the database has a corresponding identifier; obtaining time information corresponding to the relationship triple; forming a time triple with the time information and the identifier of the relationship triple, and storing it in a graph database; receiving a request to determine an entity relationship between two entities, wherein there are other entities between the two entities; obtaining from the graph database a target time triple to which the entity belongs, and a target time triple to which an entity located between the two entities belongs; and determining the entity relationship between the two entities based on all the target time triples.

[0106] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0107] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0108] The specific implementation process of the above method steps can be found in the embodiment of the method for determining entity relationships in the above knowledge graph, and this embodiment will not be repeated here.

[0109] Another embodiment of the present application provides an electronic device, which may be a server, and the electronic device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external client via a network connection. When the electronic device program is executed by the processor, it implements the functions or steps of a method for determining entity relationships in a knowledge graph on the server side.

[0110] In one embodiment, an electronic device is provided, which may be a client. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external server via a network connection. When the electronic device program is executed by the processor, it implements the functions or steps on the client side of a method for determining a knowledge graph entity relationship.

[0111] Another embodiment of the present application provides an electronic device, comprising at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the following method steps when executing the computer program in the memory:

[0112] Acquire a relationship triplet and store the relationship triplet in a database, wherein the relationship triplet in the database has a corresponding identifier; acquire time information corresponding to the relationship triplet; form a time triplet with the time information and the identifier of the relationship triplet, and store it in a graph database; receive a request to determine an entity relationship between two entities, wherein there are other entities between the two entities; acquire a target time triplet to which the entity belongs, and a target time triplet to which an entity located between the two entities belongs from the graph database; determine the entity relationship between the two entities based on all the target time triples.

[0113] Another embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method for determining the entity relationship of the knowledge graph.

[0114] The specific implementation process of the above method steps can be found in the embodiments of the method for determining entity relationships of any knowledge graph mentioned above, and this embodiment will not be repeated here.

[0115] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.

Claims

1. A method for determining entity relationships in a knowledge graph, characterized in that: include: Acquire a relation triplet from a data source, and store the relation triplet in a database, where the relation triplet in the database has a corresponding identifier; Obtaining time information corresponding to the relationship triplet; The time information and the identifier of the relationship triplet are used to form a time triplet, and the result is stored in a graph database; Receiving a request to determine an entity relationship between two entities in a knowledge graph, wherein other entities exist between the two entities; Acquire, from the graph database, a target time triplet to which the entity belongs, and a target time triplet to which an entity located between two of the entities belongs; An entity relationship between two entities is determined according to all the target time triples.

2. The method according to claim 1, characterized in that The step of determining the entity relationship between two entities according to all the target time triples comprises: Determine the logical deduction relationship and the time deduction relationship between adjacent relationship triples in the relationship triples corresponding to the target time triples; The entity relationship between two entities is determined according to the logical deduction relationship and the time deduction relationship between all adjacent relationship triples.

3. The method according to claim 2, characterized in that The step of determining the logical deduction relationship and the time deduction relationship between adjacent relationship triples in the relationship triples corresponding to the target time triples comprises: Acquire, from the database, a relation triplet corresponding to the identifier in the target time triplet, and determine a logical deduction relationship between adjacent relation triples in the acquired relation triplet corresponding to the identifier; According to the time information in the adjacent target time triples, the time derivation relationship between the adjacent relationship triples corresponding to the adjacent target time triples is determined.

4. The method according to claim 3, characterized in that The step of determining the entity relationship between two entities according to the logical deduction relationship and the temporal deduction relationship between all adjacent relationship triples comprises: Determine the entity relationship between adjacent relationship triples according to the logical deduction relationship and the time deduction relationship between adjacent relationship triples; The entity relationship between two entities is determined based on the entity relationships between all adjacent relationship triples.

5. The method according to claim 4, characterized in that The time information includes a time attribute and a time content; the first time attribute in the time information of one of the adjacent target time triples is a validity period, and the first time content is a first start time to an end time; the second time attribute in the time information of the other target time triple is a validity period, and the second time content is a second start time; wherein, the step of determining the time derivation relationship between adjacent relationship triples corresponding to the adjacent target time triples according to the time information in the adjacent target time triples comprises: Determine the order of the first start time, the end time, and the second start time; If the second start time is between the first start time and the end time, determining that the attribute in the time derivation relationship between the adjacent relationship triples corresponding to the adjacent target time triples is the validity period, and the content in the time derivation relationship is from the first start time to the end time; If the second start time is earlier than the first start time, or the second start time is later than the end time, it is determined that the attribute in the time derivation relationship between the adjacent relationship triples corresponding to the adjacent target time triples is valid, and the content in the time derivation relationship is invalid.

6. The method according to claim 5, characterized in that The logical deduction relationship and the time deduction relationship between the adjacent relationship triples, and the step of determining the entity relationship between the adjacent relationship triples comprises: If the second start time is between the first start time and the end time, determining that the entity relationship between adjacent relationship triples is a relationship in a logical deduction relationship; If the second start time is earlier than the first start time, or the second start time is later than the end time, it is determined that the entity relationship between adjacent relationship triples is entity-independent in the logical deduction relationship.

7. A device for determining entity relationships in a knowledge graph, characterized in that: include: A first acquisition unit is used to acquire a relation triplet from a data source and store the relation triplet in a database, wherein the relation triplet in the database has a corresponding identifier; A second acquisition unit, used to acquire time information corresponding to the relationship triple; a forming unit, configured to form a time triplet from the time information and the identifier of the relationship triplet, and store the time triplet in a graph database; A receiving unit, configured to receive a request to determine an entity relationship between two entities in a knowledge graph, wherein other entities exist between the two entities; A third acquisition unit is used to acquire, from the graph database, a target time triplet to which the entity belongs, and a target time triplet to which an entity located between two of the entities belongs; A determination unit is used to determine the entity relationship between two entities according to all the target time triples.

8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, it implements the steps of the method for determining the knowledge graph entity relationship described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for determining knowledge graph entity relationships described in any one of claims 1 to 7 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for determining the knowledge graph entity relationship described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Knowledge graph construction method and device, computer equipment and storage medium

    CN110489561A

  • Knowledge extraction method, related method, related device, electronic equipment and medium

    CN114218405A