Knowledge graph inconsistency checking method and device based on large model and computer equipment

By automatically identifying and detecting inconsistencies and potential risk entities in the knowledge graph based on large-model methods, the limitations of traditional methods relying on manual rules are solved, and the efficient and automated maintenance of the knowledge graph is achieved.

CN119808912APending Publication Date: 2025-04-11SHEN ZHEN SHI HENG QIANG KE JI YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411848861.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The traditional knowledge graph inconsistency testing method relies on manually defined business rules, which leads to time-consuming and labor-intensive and difficult maintenance, limiting the level of automated management of knowledge graphs.

Method used

Using a big model-based method, by obtaining the knowledge graph to be tested, sorting out the entities, relationships and attributes, converting them into rule templates, populating known conditions, using big model inference and generating inference results, converting them into Datalog syntax to perform automated detection, identifying inconsistencies and potential risk entities.

Benefits of technology

It realizes fully automated maintenance of the knowledge graph, reduces dependence on manual intervention, improves processing efficiency and accuracy, and reduces the need for manual review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808912A_ABST
    Figure CN119808912A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge graph inconsistency checking method and device based on a large model and computer equipment. The method comprises the steps of obtaining a to-be-inspected knowledge graph; carding entities, relationships and attributes of the to-be-inspected knowledge graph to obtain a carding result; converting the carding result into a rule template; filling the rule template to obtain known conditions; and reasoning known conditions through a large model, generating a reasoning result, converting the reasoning result into a Datalog grammar to execute automatic detection, and identifying inconsistent and potential risk entities in the knowledge graph to be detected. By implementing the method provided by the invention, the limitation of the traditional method can be overcome, the dependence on manual intervention is reduced, and the full-automatic maintenance of the knowledge graph is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a knowledge graph, and more specifically to a method, device and computer equipment for checking inconsistency of a knowledge graph based on a large model. Background Art

[0002] In the field of risk identification, heterogeneous knowledge graphs are increasingly used, among which inconsistency checking is a key link in discovering potential risks. Traditional inconsistency checking relies on manually defined business rules, which are then applied to the graph reasoning engine to automatically detect abnormal nodes and relationships. For example, in actual business scenarios, entity identifiers such as ID numbers, phone numbers, company names, email addresses, or URLs usually require global or local uniqueness. If related entities share the same identifier but have differences in other attributes, it may indicate data inconsistency, suggesting potential risks.

[0003] However, this approach has significant limitations. First, the process of manually formulating rules is time-consuming and labor-intensive. Second, as the structure of the knowledge graph expands and becomes more complex, it becomes increasingly difficult to maintain and update these rules, which limits the level of automated management of the knowledge graph.

[0004] Therefore, it is necessary to design a new method that overcomes the limitations of traditional methods, reduces dependence on human intervention, and realizes fully automated maintenance of knowledge graphs. Summary of the invention

[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device and computer equipment for checking inconsistency of knowledge graph based on a large model.

[0006] To achieve the above object, the present invention adopts the following technical solution: a knowledge graph inconsistency detection method based on a large model, comprising:

[0007] Obtain the knowledge graph to be tested;

[0008] Sorting out entities, relationships and attributes of the knowledge graph to be tested to obtain a sorting result;

[0009] Converting the combing results into a rule template;

[0010] Filling the rule template to obtain known conditions;

[0011] The known conditions are inferred through a large model to generate inference results, which are then converted into Datalog syntax for automated detection to identify inconsistencies and potential risk entities in the knowledge graph to be tested.

[0012] A further technical solution is: combing entities, relationships and attributes of the knowledge graph to be tested to obtain a combing result, including:

[0013] The pattern of the knowledge graph to be tested is analyzed to obtain entities, relationships and attributes to form a combing result.

[0014] A further technical solution is: converting the combing result into a rule template includes:

[0015] A fixed sentence format is used to construct a rule template according to the combing result, wherein the fixed sentence format includes a format for describing the relationship between entities and a format for describing the relationship between an entity and a corresponding attribute.

[0016] A further technical solution is: filling the rule template to obtain the known conditions includes:

[0017] Traversing all the entities, relationships and attributes, identifying all possible values, to obtain conditional values;

[0018] Combining the condition values ​​of the rule template to obtain a combined condition;

[0019] The combined conditions are filled into the rule template to obtain known conditions.

[0020] A further technical solution is: performing permutations and combinations of the condition values ​​on the rule template to obtain the combined conditions includes:

[0021] By selecting the same entity to establish a relationship with different entities or attributes, a known condition that reflects the association between different entities under the same condition is generated, and / or, two different entities are selected and assigned different relationships or attributes to create a known condition that shows the differential association between entities under different conditions, and the known conditions are arranged and combined to obtain the combined conditions.

[0022] Its further technical solution is: the known conditions are inferred through a large model to generate inference results, and the inference results are converted into Datalog syntax to perform automatic detection, and the inconsistencies and potential risk entities in the knowledge graph to be tested are identified, including:

[0023] Input the known conditions and the combing results into the big model, and input prompt words to guide the big model to deduce all possible logical relationships to obtain reasoning results;

[0024] The reasoning result is converted into a logical reasoning expression using the grammatical rules of the Datalog reasoning engine, and the Datalog reasoning engine automatically detects inconsistencies and potential risk entities in the knowledge graph to be tested.

[0025] The present invention also provides a knowledge graph inconsistency detection device based on a large model, comprising:

[0026] An acquisition unit, used for acquiring a knowledge graph to be tested;

[0027] A combing unit, used for combing entities, relationships and attributes of the knowledge graph to be tested to obtain a combing result;

[0028] A conversion unit, used for converting the combing result into a rule template;

[0029] A filling unit, used to fill the rule template to obtain a known condition;

[0030] The reasoning unit is used to infer the known conditions through the large model and generate reasoning results, and convert the reasoning results into Datalog syntax to perform automated detection to identify inconsistencies and potential risk entities in the knowledge graph to be tested.

[0031] Its further technical solution is: the combing unit is used to analyze the pattern of the knowledge graph to be tested to obtain entities, relationships and attributes to form a combing result.

[0032] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.

[0033] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0034] Compared with the prior art, the present invention has the following beneficial effects: the present invention avoids the tedious process of manual combing one by one by automatically identifying entities, relationships and attributes in the knowledge graph; converts complex information in the knowledge graph into standardized rule templates, eliminates manual interpretation and structuring deviations, and improves processing efficiency; relies on the reasoning ability of large models to automatically generate reasoning results, avoiding the limitations and errors of manual reasoning; converts reasoning results into Datalog syntax and automatically performs consistency detection, reducing the need for manual intervention in the verification process; the system automatically identifies inconsistencies and potential risk entities in the graph, improves the maintenance efficiency and accuracy of the knowledge graph, and reduces dependence on manual review.

[0035] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0037] Figure 1 A schematic diagram of a flow chart of a knowledge graph inconsistency checking method based on a large model provided in an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of a sub-process of a large-model-based knowledge graph inconsistency checking method provided in an embodiment of the present invention;

[0039] Figure 3 A schematic diagram of a sub-process of a large-model-based knowledge graph inconsistency checking method provided in an embodiment of the present invention;

[0040] Figure 4 A schematic diagram of a knowledge graph model provided by an embodiment of the present invention;

[0041] Figure 5 A schematic diagram of the use of a large-model-based knowledge graph inconsistency detection method provided in an embodiment of the present invention;

[0042] Figure 6 A schematic block diagram of a knowledge graph inconsistency checking device based on a large model provided by an embodiment of the present invention;

[0043] Figure 7 A schematic block diagram of a filling unit of a knowledge graph inconsistency checking device based on a large model provided in an embodiment of the present invention;

[0044] Figure 8 A schematic block diagram of an inference unit of a knowledge graph inconsistency checking device based on a large model provided by an embodiment of the present invention;

[0045] Fig. 9 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0048] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0049] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0050] See also Figure 1 , Figure 1 A schematic flow chart of a knowledge graph inconsistency check method based on a large model provided in an embodiment of the present invention. The knowledge graph inconsistency check method based on a large model is applied in a terminal, and utilizes the specific and powerful natural language understanding ability of the large model to guide the large model to identify entities, relationships or attribute values ​​that should remain consistent in the knowledge graph pattern through prompt words, and converts them into building inconsistency check rules, converting the rules into reasoning statements of the graph reasoning engine, which are automatically executed by the graph reasoning engine. It overcomes the limitations of traditional inconsistency check methods, reduces dependence on manual intervention, and realizes fully automated maintenance of knowledge graphs.

[0051] Figure 1 Schematic diagram of the process of the knowledge graph inconsistency test method based on a large model provided by an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S110 to S150.

[0052] S110. Obtain the knowledge graph to be tested.

[0053] In this embodiment, the knowledge graph to be tested refers to a data structure that has been constructed to represent entities and their relationships in a specific field. It includes entities (such as people, places, organizations, etc.), relationships between entities (such as parent-child relationships, employment relationships, etc.), and attribute information related to these entities (such as an individual's date of birth, a company's establishment time, etc.).

[0054] Knowledge graphs to be verified refer to those that need to be checked for internal consistency, data quality, and logical correctness through a series of methods and techniques. Such a verification process aims to discover and correct potential problems, such as inconsistent data, incorrect relationship definitions, or missing information, to ensure the quality and reliability of the knowledge graph, thereby improving the performance of services or applications based on the knowledge graph.

[0055] S120, combing entities, relationships and attributes of the knowledge graph to be tested to obtain a combing result.

[0056] In this embodiment, the combing results include entities, relationships, and attributes in the knowledge graph to be verified.

[0057] Identify all entity categories in the selected knowledge graph. For example, in the field of family relationships, common entities may include "natural person", "enterprise", "address", etc. For each entity, its boundaries and scope should be clearly defined. For some professional terms with special meanings, additional explanations or examples should be provided so that the big model can better understand and process these concepts. For example, "natural person" refers to an actual individual rather than a legal person or other organization.

[0058] List all the types of relationships between entities. For example, "father and son", "husband and wife", "mother and son", "brother and sister", "residence", "employment", etc. are all ways to express the relationship between different entities. Provide a detailed description for each relationship, especially those that are easy to confuse. For example, "residence" means that someone lives in a place for a long time, and "employment" refers to the working status of a person in a position.

[0059] Indicate the attributes of each entity. For example, a "natural person" may have an attribute such as "contact information", while an "enterprise" may have attributes such as "establishment date" and "registered capital". For each attribute, a specific definition and its value range need to be given. For example, for "natural person's contact information", the manual supplementary explanation "contact information includes telephone number and email address" can be further specified, and format requirements can be further specified, such as the telephone number should follow a certain international standard format.

[0060] For example, Figure 4 The figure shows a knowledge graph model, with entity set E = [natural person, enterprise, address], relationship set R = [father and son, husband and wife, mother and son, brothers and sisters, residence, position], and attribute set A = [natural person.contact information]. For the contact information, the manual supplementary explanation is “Contact information includes telephone number and email address.

[0061] S130: Convert the combing result into a rule template.

[0062] In this embodiment, the rule template refers to a standardized expression form used to describe entities in the knowledge graph schema, the relationships between entities, and the associations between entities and attributes.

[0063] Specifically, a fixed sentence format is used to construct a rule template according to the combing result, wherein the fixed sentence format includes a format for describing the relationship between entities and a format for describing the relationship between an entity and a corresponding attribute.

[0064] This process involves building rule templates using fixed sentence formats to ensure that all converted rules are consistent and readable. These fixed sentence formats include, but are not limited to, two main types:

[0065] Describe the relationship between entities:

[0066] The fixed format is: "[Entity] and [Entity] are [Relationship]"; for example: from the knowledge graph model, it can be concluded that there is a "father-son" relationship between "natural person" and "natural person", which is converted into a rule template: "[Natural person] and [Natural person] are father and son".

[0067] Describe the relationship between an entity and its corresponding attribute: the fixed format is: "[entity] has [attribute]"; for example: if the knowledge graph model defines that "natural person" has an attribute such as "contact information", then it is converted into a rule template: "[natural person] has [contact information]".

[0068] Furthermore, the above format can be extended to cover more complex relationships or property descriptions:

[0069] For location or address information, such as "residence", you can use something like: "[natural person] resides at [address]". For position or work unit information, such as "employment", you can use: "[natural person] holds [company]".

[0070] Through this conversion method, the originally abstract knowledge graph model structure can be converted into an easy-to-understand and standardized rule template, which is convenient for subsequent application development, data verification or logical reasoning. This process not only helps to improve the application flexibility of the knowledge graph, but also enhances the convenience of its maintenance and update.

[0071] In summary, the goal of step S130 is to convert the sorted knowledge graph pattern definitions (i.e., entities and their relationships and attributes) into a set of clear rule templates that follow a fixed format, so that this information can be more easily understood and applied.

[0072] S140: Fill in the rule template to obtain known conditions.

[0073] In this embodiment, the known conditions refer to explicit statements formed by filling the values ​​of specific entities, relationships, and attributes into the previously constructed rule template. These known conditions can be used to simulate specific situations in real scenarios, and considering computing performance, only two combinations of known conditions are considered during design.

[0074] In one embodiment, see Figure 2 , the above-mentioned step S140 may include steps S141 to S143.

[0075] S141. Traverse all the entities, relationships and attributes, identify all possible values, and obtain conditional values.

[0076] In this embodiment, all entities defined in the knowledge graph model, their relationships, and the attributes corresponding to the entities are traversed, that is, the combing results are traversed to identify all possible value situations. For example, for a natural person entity, possible values ​​include a specific individual; for an address attribute, it may be specific address information, etc.

[0077] S142: Arrange and combine the condition values ​​of the rule template to obtain a combined condition.

[0078] In this embodiment, by selecting the same entity to establish a relationship with different entities or attributes, a known condition that reflects the association between different entities under the same conditions is generated, and / or, two different entities are selected and assigned different relationships or attributes to create a known condition that shows the differential association between entities under different conditions, and the conditions are arranged and combined to obtain the combined conditions.

[0079] Specifically, based on all possible values ​​identified in step S141, the rule template is arranged and combined with conditional values. This process involves selecting the same entity to establish a relationship with different entities or attributes, generating known conditions that reflect the association between different entities under the same conditions, and / or selecting two different entities and assigning different relationships or attributes to create known conditions that show the differential association between entities under different conditions. The specific design is as follows:

[0080] Combinations under the same conditions: When two conditions have the same value, it means that the same type of relationship or attribute is being examined. For example, "[Natural person A] and [Natural person B] are father and son" and "[Natural person A] and [Natural person C] are father and son", which indicates that the same father-son relationship exists between natural person A and multiple other natural persons; or "[Natural person A] lives at [Address A]" and "[Natural person B] lives at [Address A]", which indicates that multiple natural persons live at the same address.

[0081] Combinations under different conditions: When two conditions have different values, it means that different types of relationships or attributes are being compared. For example, "[Natural person A] and [Natural person B] are father and son" and "[Natural person A] and [Natural person C] are husband and wife", which shows the different social relationships between natural person A and other natural persons; or "[Natural person A] lives at [Address A]" and "[Natural person B] lives at [Address B]", which means that different natural persons live at different addresses.

[0082] S143. Fill the combined conditions into the rule template to obtain known conditions.

[0083] In this embodiment, the combined conditions obtained in the above steps are filled into the corresponding rule template to form specific known conditions. In this way, the originally abstract rule template is concretized into a clear statement describing specific entities and their relationships or attributes, thereby facilitating further applications such as logical reasoning, query optimization, etc.

[0084] Through the above process, the information in the knowledge graph can be effectively utilized to generate rich known conditions, which not only helps to improve computing efficiency but also better reflects complex scenarios in real life.

[0085] S150. The known conditions are inferred through a large model to generate inference results, and the inference results are converted into Datalog syntax to perform automated detection to identify inconsistencies and potential risk entities in the knowledge graph to be tested.

[0086] In one embodiment, see Figure 3 , the above-mentioned step S150 may include steps S151 to S152.

[0087] S151, input the known conditions and the combing results into the big model, and input prompt words to guide the big model to deduce all possible logical relationships to obtain reasoning results.

[0088] In this embodiment, the previously filled known conditions are input into a pre-trained large-scale language model, that is, a large model. At the same time, a specific prompt word template is provided to the large model to guide the model on how to reason based on the given known conditions and find other results that meet the logical relationship in addition to these known conditions.

[0089] Specifically, one or more prompts are constructed according to the given prompt word template format to guide the large model to understand the task requirements. For example, if the known conditions are "[Natural person A] and [Natural person B] are father and son" and "[Natural person A] and [Natural person C] are husband and wife", then the prompt word may be: "Known {known conditions}. Please output the following entities and relationships as accurately and non-repetitively as possible, except for the known conditions, and other results that meet the logical relationship. The entities and relationships can only be selected from the following optional values. The optional entities include {entity set E}, and the optional relationships include {relationship set R}."

[0090] Submit the above sorting results, known conditions and prompt words to the big model, and use its powerful natural language processing capabilities to derive new logical relationships. Figure 5 Using the question-and-answer method shown, based on the aforementioned known conditions, the big model will infer that "[Natural person C] and [Natural person B] are mother and son."

[0091] S152. Convert the inference result into a logical inference expression using the grammatical rules of the Datalog inference engine, and use the Datalog inference engine to automatically detect inconsistencies and potential risk entities in the knowledge graph to be checked.

[0092] In this embodiment, after the reasoning is completed, the next step is to convert the obtained reasoning results into a form that can be understood and executed by a knowledge reasoning engine such as Datalog. This step is intended to ensure that the consistency of the entire knowledge graph can be automatically verified, specifically including:

[0093] According to the inference results given by the big model, follow the grammatical rules of Datalog to convert them into corresponding logical inference expressions. For example, for the relationship "[natural person C] and [natural person B] are mother and child" inferred by the big model, the corresponding Datalog expression is (<-(: mother and child: natural person? C: natural person? B)

[0094] (:Father and son:Natural person? A:Natural person? B)

[0095] (:Spouse:Natural person? A:Natural person? C)).

[0096] The converted Datalog expression is loaded into the Datalog reasoning engine, which will traverse the entire knowledge graph dataset and check whether all nodes comply with these rules. Any violation of the rules will be marked as an inconsistency or potential risk point.

[0097] By combining the powerful reasoning capabilities of large models with the efficient rule matching of the Datalog reasoning engine, we can achieve in-depth analysis of complex knowledge graph data, which not only improves the efficiency and accuracy of data analysis, but also enables timely discovery and resolution of problems in the data. This helps maintain the high quality and reliability of the knowledge graph, thereby better supporting upper-level applications and services.

[0098] For example: Figure 4 The knowledge graph model shown first sorts out three types of basic information:

[0099] Entity set (E): contains all entity types that appear, such as natural persons, enterprises, addresses, etc.

[0100] Relationship set (R): Lists the relationship types between all entities, such as father and son, husband and wife, mother and son, brothers and sisters, residence, position, etc.

[0101] Attribute set (A): Lists the attributes related to the entity, such as the contact information of a natural person (including phone number and email address, etc.).

[0102] According to the knowledge graph model, a set of rule templates are formed to represent the relationship between entities. These rule templates reflect the basic structure of entities and relationships in the graph, for example:

[0103] Natural persons may have father-son relationships, husband-wife relationships, etc.

[0104] A natural person may have contact details or be associated with an address, business, etc.

[0105] Example rule template:

[0106] [Natural person] and [natural person] are father and son;

[0107] [Natural person] and [Natural person] are husband and wife;

[0108] [Natural person] has [contact details];

[0109] [Natural person] residence [address];

[0110] [Natural person] works for [Enterprise];

[0111] Based on specific entities and relationships, traverse all possible combinations of conditions to form specific known conditions. For example:

[0112] A combination of two conditions that are the same: "[Natural person A] and [Natural person B] are father and son" and "[Natural person A] and [Natural person C] are father and son"; "[Natural person A] and [Natural person B] are husband and wife" and "[Natural person A] and [Natural person C] are husband and wife";

[0113] Different combinations of two conditions: "[Natural person A] and [Natural person B] are father and son" and "[Natural person A] and [Natural person C] are husband and wife"; "[Natural person A] and [Natural person B] are husband and wife" and "[Natural person C] and [Natural person B] are mother and son"; through such traversal, all known conditions are generated, a total of 67.

[0114] In this stage, the big model is used to reason about known conditions and deduce implicit logical relationships. For example, given the known conditions "[Natural Person A] and [Natural Person B] are father and son" and "[Natural Person A] and [Natural Person C] are husband and wife", the inference result should be "[Natural Person C] and [Natural Person B] are mother and son".

[0115] This reasoning process can be completed through the reasoning ability of the model, combining conditions into valid reasoning conclusions according to the rule template.

[0116] Once the inference result is obtained, it needs to be converted into Datalog syntax rules to facilitate execution in the inference engine. For example, convert the inference result "[Natural Person C] and [Natural Person B] are mother and son" into a Datalog statement:

[0117] (<-(:mother and son:natural person?C:natural person?B)(:father and son:natural person?A:natural person?B)

[0118] (:spouse:natural person? A:natural person? C));

[0119] When executed in the Datalog inference engine, if a relationship does not meet the conditions (such as the relationship (:spouse:natural person? pB:natural person? pC)), a warning will be triggered, indicating that the actual value of the relationship may be inconsistent, identifying potential risks in the graph.

[0120] In this embodiment, the reasoning engine detects that the relationship between natural person pB and natural person pC should be "mother and child" rather than "husband and wife", so it believes that there is inconsistency between this pair of entities and marks them as potential risk entities.

[0121] Through the above steps, we can not only systematically identify logical inconsistencies in the graph, but also automatically perform reasoning and detect potential risk entities. The core of this method is the reasoning mechanism based on rule templates. Through the reasoning ability of large models and the automatic execution of Datalog syntax, data inconsistencies in the graph can be discovered and handled in a timely manner.

[0122] The method of this embodiment uses the semantic understanding ability of the large model to build inconsistency verification rules, output them in OWL format, and automatically connect to the graph reasoning engine to achieve fully automated maintenance of the knowledge graph. The advantages of the Datalog reasoning engine are mainly reflected in the following points:

[0123] Accurate reasoning verification and consistency checking; derivation of complex reasoning relationships; automation and scalability; traceability and transparency of reasoning.

[0124] The above-mentioned knowledge graph inconsistency verification method based on a large model avoids the tedious process of manual sorting one by one by automatically identifying the entities, relationships and attributes in the knowledge graph; converts the complex information in the knowledge graph into a standardized rule template, eliminates the deviation of manual interpretation and structuring, and improves processing efficiency; relies on the reasoning ability of the large model to automatically generate reasoning results, avoiding the limitations and errors of manual reasoning; by converting the reasoning results into Datalog syntax, it automatically performs consistency detection, reducing the need for manual intervention in the verification process; the system automatically identifies inconsistencies and potential risk entities in the graph, improves the maintenance efficiency and accuracy of the knowledge graph, and reduces dependence on manual review.

[0125] Figure 6 is a schematic block diagram of a knowledge graph inconsistency checking device 300 based on a large model provided by an embodiment of the present invention. Figure 6 As shown, corresponding to the above-mentioned knowledge graph inconsistency checking method based on a large model, the present invention also provides a knowledge graph inconsistency checking device 300 based on a large model. The knowledge graph inconsistency checking device 300 based on a large model includes a unit for executing the above-mentioned knowledge graph inconsistency checking method based on a large model, and the device can be configured in a desktop computer, a tablet computer, a laptop computer, and other terminals. Specifically, please refer to Figure 6 The knowledge graph inconsistency checking device 300 based on a large model includes an acquisition unit 301, a combing unit 302, a conversion unit 303, a filling unit 304 and a reasoning unit 305.

[0126] An acquisition unit 301 is used to acquire a knowledge graph to be checked; a combing unit 302 is used to comb entities, relationships and attributes of the knowledge graph to be checked to obtain a combing result; a conversion unit 303 is used to convert the combing result into a rule template; a filling unit 304 is used to fill the rule template to obtain a known condition; an inference unit 305 is used to infer the known conditions through a large model and generate an inference result, and convert the inference result into Datalog syntax to perform automated detection to identify inconsistencies and potential risk entities in the knowledge graph to be checked.

[0127] In one embodiment, the combing unit 302 is used to analyze the pattern of the knowledge graph to be verified to obtain entities, relationships and attributes to form a combing result.

[0128] In one embodiment, the conversion unit 303 is used to construct a rule template according to the combing result using a fixed sentence format, wherein the fixed sentence format includes a format for describing the relationship between entities and a format for describing the relationship between an entity and a corresponding attribute.

[0129] In one embodiment, if Figure 7 As shown, the filling unit 304 includes a traversal subunit 3041 , a combination subunit 3042 and a conditional filling subunit 3043 .

[0130] The traversal subunit 3041 is used to traverse all the entities, relationships and attributes, identify all possible values, and obtain conditional values; the combination subunit 3042 is used to arrange and combine the conditional values ​​of the rule template to obtain the combined condition; the condition filling subunit 3043 is used to fill the combined condition into the rule template to obtain the known condition.

[0131] In one embodiment, the combination subunit 3042 is used to generate known conditions that reflect the association between different entities under the same conditions by selecting the same entity to establish a relationship with different entities or attributes, and / or select two different entities and assign different relationships or attributes to create known conditions that show the differential association between entities under different conditions, and perform permutations and combinations to obtain the combined conditions.

[0132] In one embodiment, if Figure 8 As shown, the reasoning unit 305 includes a large model reasoning subunit 3051 and an automatic execution subunit 3052.

[0133] The large model reasoning subunit 3051 is used to input the known conditions and the combing results into the large model, and input prompt words to guide the large model to deduce all possible logical relationships to obtain reasoning results; the automatic execution subunit 3052 is used to convert the reasoning results into logical reasoning expressions using the grammatical rules of the Datalog reasoning engine, and the Datalog reasoning engine automatically detects inconsistencies and potential risk entities in the knowledge graph to be tested.

[0134] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned knowledge graph inconsistency verification device 300 based on the large model and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.

[0135] The above-mentioned knowledge graph inconsistency checking device 300 based on a large model can be implemented in the form of a computer program. The computer program can be used in Fig. 9 Runs on the computer device shown.

[0136] See also Fig. 9 , Fig. 9 500 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a terminal, wherein the terminal may be an electronic device with communication function such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device.

[0137] See also Fig. 9 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0138] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, which, when executed, can enable the processor 502 to execute a knowledge graph inconsistency detection method based on a large model.

[0139] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0140] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a knowledge graph inconsistency verification method based on a large model.

[0141] The network interface 505 is used to communicate with other devices over the network. Fig. 9 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0142] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0143] Acquire the knowledge graph to be tested; sort out the entities, relationships and attributes of the knowledge graph to be tested to obtain sorting results; convert the sorting results into rule templates; fill in the rule templates to obtain known conditions; infer the known conditions through a large model and generate inference results, and convert the inference results into Datalog syntax to perform automated detection to identify inconsistencies and potential risk entities in the knowledge graph to be tested.

[0144] In one embodiment, when the processor 502 implements the step of combing entities, relationships, and attributes of the knowledge graph to be checked to obtain a combing result, the processor 502 specifically implements the following steps:

[0145] The pattern of the knowledge graph to be tested is analyzed to obtain entities, relationships and attributes to form a combing result.

[0146] In one embodiment, when the processor 502 implements the step of converting the combing result into a rule template, the processor 502 specifically implements the following steps:

[0147] A fixed sentence format is used to construct a rule template according to the combing result, wherein the fixed sentence format includes a format for describing the relationship between entities and a format for describing the relationship between an entity and a corresponding attribute.

[0148] In one embodiment, when the processor 502 implements the step of filling the rule template to obtain the known condition, the processor 502 specifically implements the following steps:

[0149] Traverse all the entities, relationships and attributes, identify all possible values, and obtain conditional values; perform permutations and combinations of the conditional values ​​on the rule template to obtain combined conditions; and fill the combined conditions into the rule template to obtain known conditions.

[0150] In one embodiment, when the processor 502 implements the step of permuting and combining the condition values ​​of the rule template to obtain the combined condition, the processor 502 specifically implements the following steps:

[0151] By selecting the same entity to establish a relationship with different entities or attributes, a known condition that reflects the association between different entities under the same condition is generated, and / or, two different entities are selected and assigned different relationships or attributes to create a known condition that shows the differential association between entities under different conditions, and the known conditions are arranged and combined to obtain the combined conditions.

[0152] In one embodiment, the processor 502 implements the following steps when implementing the steps of reasoning the known conditions through the large model and generating reasoning results, converting the reasoning results into Datalog syntax to perform automatic detection, and identifying inconsistencies and potential risk entities in the knowledge graph to be tested:

[0153] Input the known conditions and the combing results into the big model, and input prompt words to guide the big model to deduce all possible logical relationships to obtain reasoning results; according to the reasoning results, use the grammatical rules of the Datalog reasoning engine to convert them into logical reasoning expressions, and the Datalog reasoning engine automatically detects inconsistencies and potential risk entities in the knowledge graph to be tested.

[0154] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0155] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0156] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:

[0157] Acquire the knowledge graph to be tested; sort out the entities, relationships and attributes of the knowledge graph to be tested to obtain sorting results; convert the sorting results into rule templates; fill in the rule templates to obtain known conditions; infer the known conditions through a large model and generate inference results, and convert the inference results into Datalog syntax to perform automated detection to identify inconsistencies and potential risk entities in the knowledge graph to be tested.

[0158] In one embodiment, when the processor executes the computer program to implement the step of combing entities, relationships, and attributes of the knowledge graph to be checked to obtain a combing result, the processor specifically implements the following steps:

[0159] The pattern of the knowledge graph to be tested is analyzed to obtain entities, relationships and attributes to form a combing result.

[0160] In one embodiment, when the processor executes the computer program to implement the step of converting the combing result into a rule template, the processor specifically implements the following steps:

[0161] A fixed sentence format is used to construct a rule template according to the combing result, wherein the fixed sentence format includes a format for describing the relationship between entities and a format for describing the relationship between an entity and a corresponding attribute.

[0162] In one embodiment, when the processor executes the computer program to implement the step of filling the rule template to obtain the known condition, the processor specifically implements the following steps:

[0163] Traverse all the entities, relationships and attributes, identify all possible values, and obtain conditional values; perform permutations and combinations of the conditional values ​​on the rule template to obtain combined conditions; and fill the combined conditions into the rule template to obtain known conditions.

[0164] In one embodiment, when the processor executes the computer program to implement the step of permuting and combining the condition values ​​of the rule template to obtain the combined condition, the processor specifically implements the following steps:

[0165] By selecting the same entity to establish a relationship with different entities or attributes, a known condition that reflects the association between different entities under the same condition is generated, and / or, two different entities are selected and assigned different relationships or attributes to create a known condition that shows the differential association between entities under different conditions, and the known conditions are arranged and combined to obtain the combined conditions.

[0166] In one embodiment, when the processor executes the computer program to implement the steps of reasoning the known conditions through the large model and generating reasoning results, converting the reasoning results into Datalog syntax to perform automatic detection, and identifying inconsistencies and potential risk entities in the knowledge graph to be tested, the processor specifically implements the following steps:

[0167] Input the known conditions and the combing results into the big model, and input prompt words to guide the big model to deduce all possible logical relationships to obtain reasoning results; according to the reasoning results, use the grammatical rules of the Datalog reasoning engine to convert them into logical reasoning expressions, and the Datalog reasoning engine automatically detects inconsistencies and potential risk entities in the knowledge graph to be tested.

[0168] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0169] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0170] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0171] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0172] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0173] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A knowledge graph inconsistency detection method based on a large model, characterized in that: include: Obtain the knowledge graph to be tested; Sorting out entities, relationships and attributes of the knowledge graph to be tested to obtain a sorting result; Converting the combing results into a rule template; Filling the rule template to obtain known conditions; The known conditions are inferred through a large model to generate inference results, which are then converted into Datalog syntax for automated detection to identify inconsistencies and potential risk entities in the knowledge graph to be tested.

2. The knowledge graph inconsistency detection method based on a large model according to claim 1 is characterized in that: The combing of entities, relationships and attributes of the knowledge graph to be tested to obtain a combing result includes: The pattern of the knowledge graph to be tested is analyzed to obtain entities, relationships and attributes to form a combing result.

3. The knowledge graph inconsistency detection method based on a large model according to claim 1 is characterized in that: The converting the combing result into a rule template comprises: A fixed sentence format is used to construct a rule template according to the combing result, wherein the fixed sentence format includes a format for describing the relationship between entities and a format for describing the relationship between an entity and a corresponding attribute.

4. The knowledge graph inconsistency detection method based on a large model according to claim 1 is characterized in that: The filling of the rule template to obtain the known condition includes: Traversing all the entities, relationships and attributes, identifying all possible values, to obtain conditional values; Combining the condition values ​​of the rule template to obtain a combined condition; The combined conditions are filled into the rule template to obtain known conditions.

5. The knowledge graph inconsistency detection method based on a large model according to claim 4 is characterized in that: The permuting and combining the condition values ​​of the rule template to obtain a combined condition includes: By selecting the same entity to establish a relationship with different entities or attributes, a known condition that reflects the association between different entities under the same condition is generated, and / or, two different entities are selected and assigned different relationships or attributes to create a known condition that shows the differential association between entities under different conditions, and the known conditions are arranged and combined to obtain the combined conditions.

6. The knowledge graph inconsistency detection method based on a large model according to claim 1 is characterized in that: The method of inferring the known conditions through the large model and generating inference results, and converting the inference results into Datalog syntax to perform automated detection, and identifying inconsistencies and potential risk entities in the knowledge graph to be tested, includes: Input the known conditions and the combing results into the big model, and input prompt words to guide the big model to deduce all possible logical relationships to obtain reasoning results; The reasoning result is converted into a logical reasoning expression using the grammatical rules of the Datalog reasoning engine, and the Datalog reasoning engine automatically detects inconsistencies and potential risk entities in the knowledge graph to be tested.

7. A knowledge graph inconsistency checking device based on a large model, characterized in that: include: An acquisition unit, used for acquiring a knowledge graph to be tested; A combing unit, used for combing entities, relationships and attributes of the knowledge graph to be tested to obtain a combing result; A conversion unit, used for converting the combing result into a rule template; A filling unit, used to fill the rule template to obtain a known condition; The reasoning unit is used to infer the known conditions through the large model and generate reasoning results, and convert the reasoning results into Datalog syntax to perform automated detection to identify inconsistencies and potential risk entities in the knowledge graph to be tested.

8. The knowledge graph inconsistency checking device based on a large model according to claim 7 is characterized in that: The combing unit is used to analyze the pattern of the knowledge graph to be tested to obtain entities, relationships and attributes to form a combing result.

9. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.