Construction and extension method and system based on dynamic semantic knowledge graph

By constructing and expanding dynamic semantic knowledge graphs, the problems of insufficient depth of knowledge graph content, weak semantic understanding ability and insufficient data volume in the existing technology are solved, and high-quality knowledge graph generation and expansion are achieved, which are suitable for scenarios such as intelligent question-and-answer and information retrieval.

CN120258115BActive Publication Date: 2025-08-19JIANGXI NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510736200.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-08-19
Estimated Expiration
2045-06-04

AI Technical Summary

Technical Problem

The existing knowledge graph construction technology has problems such as insufficient content depth, weak semantic understanding ability and insufficient data size, which is difficult to meet the knowledge representation needs in complex scenarios.

Method used

By obtaining the head entity, tail entity and entity relationship of text block, attaching attribute key-value pairs, generating relationship instance triplets, constructing structured and semantic knowledge graphs, and using LLM for masking reasoning and verification, generating trusted knowledge graphs, realizing the expansion and deepening of the knowledge graphs.

Benefits of technology

It realizes high-quality construction of knowledge graphs, ensures semantic accuracy and structural consistency, expands data volume, improves coverage and depth, is suitable for intelligent applications in complex scenarios, and improves verification efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120258115B_ABST
    Figure CN120258115B_ABST
Patent Text Reader

Abstract

The present invention discloses a construction and expansion method and system based on dynamic semantic knowledge graph, which belongs to the field of artificial intelligence technology. It includes: first extracting the head entity, tail entity and their relationship from the text, and adding attribute key-value pairs to enhance the semantic information; then constructing a structured knowledge graph and an indexed semantic knowledge graph to improve the knowledge organization ability; generating a credible knowledge graph through a masked reasoning mechanism, that is, randomly masking the entities or relationships in the triples, and using the pre-trained knowledge reasoning of the Large Language Model (LLM) to complete and verify its rationality. Finally, the three types of knowledge graphs, structured, semantic and credible, are integrated to form a dynamic and extensible target knowledge graph. The present invention effectively solves the problems of insufficient content depth, weak semantic understanding ability and insufficient data volume of traditional knowledge graphs through the triple mechanisms of attribute enhancement, semantic indexing and reasoning verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence technology, and specifically relates to a construction and expansion method and system based on a dynamic semantic knowledge graph. Background Art

[0002] Knowledge graphs (KGs), as complex network structures for organizing and representing data, have become a key tool for the efficient utilization of data elements. Through structured representations of entities and their relationships, knowledge graphs enable the transformation from data to knowledge and are widely used in scenarios such as information retrieval, personalized recommendations, and intelligent question-and-answer services. As data continues to grow in size and complexity, existing knowledge graph construction technologies face challenges such as insufficient content depth, weak semantic understanding capabilities, and insufficient data volume.

[0003] Although the existing knowledge graph construction technology has made certain progress, it still faces the following key problems in the construction process: First, at present, knowledge graph construction mostly remains in the shallow learning stage, mainly reflecting the organizational structure and hierarchical entity relationships of the data, and fails to deeply explore and express the content depth of knowledge. This leads to insufficient capture of the inherent logic and details of knowledge, limiting its application effect in solving complex problems. Second, the knowledge graph's understanding of the semantic level is still insufficient. Existing technologies mostly focus on the surface features of entities and the processing of direct entity relationships, and fail to deeply analyze semantic attributes and complex entity relationship networks. This shallow semantic expression method is difficult to meet users' needs for knowledge accuracy in complex scenarios. Third, in the current knowledge graph construction process, the data volume is limited, and it is difficult to reason and expand through automated means. This deficiency leads to limited knowledge coverage and affects the performance of knowledge graphs in large-scale applications. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a construction and expansion method and system based on a dynamic semantic knowledge graph, which can solve the problems of insufficient content depth, weak semantic understanding ability and insufficient data volume in the process of constructing knowledge graphs in the existing technology.

[0005] In order to solve the above technical problems, this application is implemented as follows:

[0006] In the first aspect, the embodiment of the present application provides a construction and expansion method based on a dynamic semantic knowledge graph, the method comprising: obtaining the head entity, tail entity, and entity relationship of each text block, wherein the entity relationship represents the semantic entity relationship between the head entity and the tail entity; attaching corresponding attribute key-value pair sets to the head entity, the tail entity, and the entity relationship, respectively, and obtaining the attached head entity, the attached entity relationship, and the attached tail entity, respectively, wherein the attribute key-value pair set includes multiple attribute keys and attribute values corresponding to the head entity and the tail entity; generating the relationship entity corresponding to each text block based on the attached head entity, the entity relationship, and the attached tail entity. Example triples; generate a structured knowledge graph based on the relationship instance triples; generate a semantic knowledge graph based on the additional head entity, additional tail entity, and additional entity relationship after the corresponding index information has been added; select any one of the additional head entity, additional tail entity, and entity relationship in the relationship instance triple as the masking object, and infer the masking object based on the other two in the relationship instance triples, generate multiple inferred relationship instance triplets and then verify them to generate a trusted knowledge graph; fuse the structured knowledge graph, semantic knowledge graph, and trusted knowledge graph to generate the target knowledge graph.

[0007] As an optional implementation of the first aspect of the present application, the specific process of obtaining relationship instance triples includes: constructing an entity set and an entity relationship set based on the entities and entity relationships of multiple text blocks, the entity set includes multiple head entities and multiple tail entities, and the entity relationship set includes multiple entity relationships; fusing the entity set based on preset fusion rules to generate an attribute key-value pair set; obtaining the entity type and attribute key-value pair set corresponding to each entity in the entity set based on the head entity and the tail entity; generating relationship instance triples based on the entity set, the entity relationship set, and the attribute key-value pair set.

[0008] As an optional implementation of the first aspect of the present application, the preset fusion rules include: obtaining the entity type, entity name and attribute value of each text block; when the entity type and entity name are the same but the attribute values are different, determining whether the attribute key corresponding to the attribute value exists; when the attribute key exists, replacing the attribute value of the later batch with the attribute value of the previous batch; when the attribute key does not exist, adding a new attribute key-value pair based on the updated attribute key and the attribute value of the later batch.

[0009] As an optional implementation of the first aspect of the present application, the process of generating a semantic knowledge graph includes:

[0010] ;

[0011] in, Represents a semantic knowledge graph, Represents the head entity, Represents the tail entity, Represents entity relationships, Indicates the index of the head entity, An index representing an entity relationship, Represents the index of the tail entity, A collection of attribute key-value pairs representing the head entity. A collection of attribute key-value pairs representing entity relationships, A collection of attribute key-value pairs representing the tail entity.

[0012] As an optional implementation of the first aspect of the present application, a process of reasoning about an obscured object includes:

[0013] The head entity, tail entity and entity relationship in the relationship instance triple are masked respectively, and multiple relationship instance triplets after partial information hiding are obtained accordingly; the LLM driver is used to perform missing information reasoning on the relationship instance triple after partial information hiding to obtain the reasoned head entity, the reasoned entity relationship and the reasoned tail entity; the LLM driver is used to perform attribute reasoning on the reasoned head entity and the reasoned tail entity to obtain the reasoned attribute set; the reasoned attribute set, the reasoned head entity and the reasoned entity relationship are combined to generate multiple relationship instance triplets after reasoning.

[0014] As an optional implementation of the first aspect of the present application, the process of generating a trusted knowledge graph includes: searching for web page content blocks associated with the inferred relationship instance triples through a Web search engine, each inferred relationship instance triple corresponding to a web page content block; calculating the cosine similarity between each inferred relationship instance triple and the corresponding web page content block; verifying each inferred relationship instance triple based on the size relationship between the cosine similarity and a preset threshold to generate multiple verified relationship instance triples; and combining multiple verified relationship instance triples to generate a trusted knowledge graph.

[0015] As an optional implementation of the first aspect of the present application, the process of verifying each inferred relationship instance triple based on the size relationship between the cosine similarity and the preset threshold includes evidence sufficiency verification and multi-path verification. After the evidence sufficiency verification is passed, the multi-path verification is performed to generate multiple verified relationship instance triples.

[0016] The adequacy verification process includes:

[0017]

[0018] The multi-path verification process includes:

[0019]

[0020] in, Indicates the sufficiency verification result, Indicates that the sufficiency verification is successful. Indicates that the sufficiency verification failed. Indicates the preset threshold, represents the intersection operation, and represents the vector generated after encoding by the embedding model, represents the cosine similarity between the inferred relation instance triple and a single web page content block, 、 、 Indicates three different prompt words, represents the relation instance triple after reasoning, Indicates the multi-path verification result. Represents large language model reasoning.

[0021] In a second aspect, an embodiment of the present application provides a system for constructing and expanding a dynamic semantic knowledge graph, the system comprising:

[0022] The extraction module is used to obtain the head entity, tail entity, and entity relationship of each text block;

[0023] An attribute appending module is used to append corresponding attribute key-value pair sets to the head entity, tail entity, and entity relationship, respectively, to obtain the appended head entity, the appended entity relationship, and the appended tail entity;

[0024] A relation instance triple construction module is used to generate a relation instance triple corresponding to each text block based on the additional head entity, entity relationship, and additional tail entity;

[0025] A structured knowledge graph generation module is used to generate a structured knowledge graph based on relationship instance triples;

[0026] A semantic knowledge graph generation module is used to generate a semantic knowledge graph based on the additional head entity, additional tail entity, and additional entity relationship after the corresponding index information has been added;

[0027] The trusted knowledge graph generation module is used to select any one of the additional head entity, additional tail entity, and entity relationship in the relationship instance triple as the masked object, infer the masked object based on the other two in the relationship instance triple, generate multiple inferred relationship instance triplets, and then verify them to generate a trusted knowledge graph.

[0028] The target knowledge graph generation module is used to fuse the structured knowledge graph, semantic knowledge graph, and trusted knowledge graph to generate the target knowledge graph.

[0029] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method of the first aspect.

[0030] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.

[0031] Compared with the existing technology, the method for constructing and expanding a dynamic semantic knowledge graph provided by the present invention has the following advantages:

[0032] First, the present invention uses a knowledge graph extraction method based on LLM, adopts step-by-step block parsing and semantic-driven entity relationship extraction technology, realizes the unified fusion of multiple data sources and multimodal information, and forms a structured semantic knowledge graph. When processing text data, it can automatically maintain context integrity, ensuring the semantic accuracy and structural consistency of the knowledge graph. The redundancy and inconsistency problems between different data blocks are solved through the fusion algorithm, so that the generated knowledge graph has high quality and high availability, meeting the knowledge representation requirements in complex scenarios.

[0033] Second, the present invention uses an LLM-based reasoning method to automatically infer new entities, entity relationships, and attribute key-value pairs based on the existing knowledge graph. During the reasoning process, through the strategy of concealment and filling, the model can not only verify the integrity of existing data, but also expand the data volume of the knowledge graph. This method is particularly suitable for areas where data is insufficient or not fully annotated. It can achieve semantic expansion of the knowledge graph, significantly improve its coverage and depth, and provide richer data support for subsequent intelligent applications.

[0034] Third, the present invention combines Boolean query and verification strategies to ensure the correctness and credibility of the reasoning results. For each newly added reasoning relationship instance triple, this method can quickly collect evidence sources and perform association matching based on the semantic similarity of the RAG system, effectively improving the efficiency and accuracy of verification. In the case of insufficient evidence, the reliability of the results is further enhanced through a three-way verification mechanism. This verification method combined with the chain of evidence enhances the usability and user trust of the knowledge graph, and is suitable for scenarios with high data quality requirements.

[0035] Fourth, this invention innovatively implements a closed-loop operation of knowledge graph reasoning and verification, generating new knowledge through reasoning, ensuring data quality through verification, and continuously optimizing the knowledge graph in an iterative manner. The entire system is highly adaptable and scalable, not only capable of handling complex semantic scenarios but also dynamically updating and expanding the content of the knowledge graph to meet the knowledge updating needs of practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a flowchart of a method for constructing and expanding a dynamic semantic knowledge graph provided in the first embodiment of the present application;

[0037] Figure 2 This is a full flow chart of the knowledge graph construction provided by the first embodiment of this application;

[0038] Figure 3 This is a flowchart of the structured knowledge graph generation process provided by the first embodiment of the present application;

[0039] Figure 4 This is an internal structure diagram of a system for building and expanding a dynamic semantic knowledge graph provided in the second embodiment of this application. DETAILED DESCRIPTION

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

[0041] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects and are not used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments of this application can be implemented in a sequence other than those illustrated or described herein. In addition, the term "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents an entity relationship of "or" between the objects associated therewith.

[0042] Below, in combination with the accompanying drawings, a method and system for constructing and expanding a dynamic semantic knowledge graph provided by the embodiment of the present application is described in detail through specific embodiments and their application scenarios.

[0043] Example 1

[0044] See also Figure 1 , which represents a flowchart of a method for constructing and expanding a dynamic semantic knowledge graph provided by the present invention, and the method includes steps S1 to S7.

[0045] Step S1: Obtain the head entity, tail entity, and entity relationship of each text block. The entity relationship represents the semantic entity relationship between the head entity and the tail entity.

[0046] Specifically, the present invention first pre-processes the text data and gradually divides the text data into blocks, that is, evenly divides the text data into multiple text blocks of equal length. During the cutting process, the integrity of the context in which the text blocks are located must be ensured.

[0047] Step S2: Attach corresponding attribute key-value pair sets to the head entity, tail entity, and entity relationship respectively, and obtain the attached head entity, attached entity relationship, and attached tail entity respectively. The attribute key-value pair sets include multiple attribute keys and attribute values corresponding to the head entity and the tail entity.

[0048] Specifically, the present invention firstly extracts the entity type from each text block based on the defined entity type. , using LLM to identify entity sets one by one , then based on the defined entity relationship type , extract the entity relationship set between entities from each text block , each entity relationship links two entities and , and finally for the entity collection Each entity within , get the attribute key set held by each entity type. Among them, Represents entity type Each entity type within Representing a collection of entities Each entity within Indicates relationship type Each relationship type within Representing a set of relationships The relationships among the entities within.

[0049] Among them, multiple attribute keys and attribute values corresponding to the head entity and the tail entity are extracted from the attribute key set. For example, the operating system, this entity type has multiple instance entities such as Linux, Hongmeng, IOS, etc. This type has attribute keys "architecture" and "compatibility". The values corresponding to the same attribute key of each instance entity are different, and finally form an attribute key-value pair set. ,in, Represents different attribute key-value pairs, 、 、 Represents different attribute keys, 、 、 Represents different attribute values.

[0050] Step S3: Based on the additional head entity, entity relationship, and additional tail entity, a relation instance triple corresponding to each text block is generated.

[0051] Specifically, the specific process of obtaining relationship instance triples includes: constructing an entity set and an entity relationship set based on the entities and entity relationships of multiple text blocks, the entity set includes multiple head entities and multiple tail entities, and the entity relationship set includes multiple entity relationships; fusing the entity set based on preset fusion rules to generate an attribute key-value pair set; obtaining the entity type and attribute key-value pair set corresponding to each entity in the entity set based on the head entity and the tail entity; generating relationship instance triples based on the entity set, the entity relationship set, and the attribute key-value pair set.

[0052] The preset fusion rules include: obtaining the entity type, entity name, and attribute value of each text block. When the entity type and entity name are the same but the attribute value is different, determining whether the attribute key corresponding to the attribute value exists. If the attribute key exists, the attribute value of the subsequent batch is replaced with the attribute value of the previous batch. If the attribute key does not exist, a new attribute key-value pair is added based on the updated attribute key and the attribute value of the subsequent batch. The specific algorithm implementation formula is as follows:

[0053] ;

[0054] in, Represents the final fused attribute set, Indicates the number of text blocks, Represents a property key, Indicates the attribute value of the previous batch, Indicates the attribute value of the subsequent batch, represents the intersection operation, represents the union operation, Represents a collection of property key-value pairs.

[0055] Step S4: Generate a structured knowledge graph based on the relationship instance triples.

[0056] Specifically, the specific process of generating a structured knowledge graph includes: generating a structured knowledge graph based on the extracted entities and entity relationships, and the mathematical expression is:

[0057] ;

[0058] in, Represents a structured knowledge graph, Represents a collection of attributes for the head entity, Represents the attribute set of the tail entity, Represents the head entity, Represents the tail entity, Represents entity relationships.

[0059] Furthermore, multiple Combine to obtain a structured knowledge graph .

[0060] Step S5: Generate a semantic knowledge graph based on the additional head entity, additional tail entity, and additional entity relationship after the corresponding index information has been added.

[0061] Specifically, the present invention sets the entity , entity relationship set , the final fused attribute set Integrate into the final semantic knowledge graph ,in, Representing a collection of entities Each entity within Representing a set of relationships Each relationship within, to obtain the final semantic knowledge graph The specific process is as follows: First, focus on the entity relationship set. For each entity relationship, the head and tail entities are extracted, similar to extracting a complete sentence in a document. The predicate is extracted, and then the subject and object are extracted in sequence to form a complete subject-predicate-object structure. The relationship instance triple is the basic component of the knowledge graph (not the smallest one). Its integration process is similar, also traversing each entity relationship in the entity relationship set. The entity relationship structure contains head and tail entities, but does not contain type and attribute information. Therefore, it is necessary to integrate the information in the entity set and attribute set. For example, if you traverse an entity relationship: Ibuprofen-Relief->Pain, at this time, you only have the basic information that constitutes the relationship instance triple, but lack more important details: entity type and entity attributes. Therefore, you need to use the head and tail entities as indexes respectively, and return to the entity set and attribute combination to find the type and attribute information they hold. For example, if there is ibuprofen:drug in the entity set, the index "ibuprofen" can be used to obtain its type information "drug". Similarly, its attribute information can also be obtained.

[0062] Among them, the mathematical expression of the semantic knowledge graph is:

[0063] ;

[0064] in, Represents a semantic knowledge graph, Represents the head entity, Represents the tail entity, Represents entity relationships, Indicates the index of the head entity, An index representing an entity relationship, Represents the index of the tail entity, A collection of attribute key-value pairs representing the head entity. A collection of attribute key-value pairs representing entity relationships, A collection of attribute key-value pairs representing the tail entity.

[0065] Step S6: Select any one of the additional head entity, additional tail entity, and entity relationship in the relationship instance triple as the masked object, infer the masked object based on the other two in the relationship instance triple, generate multiple inferred relationship instance triples, and then verify them to generate a trusted knowledge graph.

[0066] Specifically, the process of reasoning on the masked object includes: respectively masking the head entity, tail entity and entity relationship in the relationship instance triple, and obtaining multiple relationship instance triplets after partial information hiding; using LLM to drive missing information reasoning on the relationship instance triple after partial information hiding, and obtaining the reasoned head entity, reasoned entity relationship, and reasoned tail entity; using LLM to drive attribute reasoning on the reasoned head entity and reasoned tail entity, respectively, to obtain the reasoned attribute set; combining the reasoned attribute set, reasoned head entity, and reasoned entity relationship to generate multiple reasoned relationship instance triplets.

[0067] The specific process of masking the head entity, tail entity, and entity relationship in the relationship instance triple includes:

[0068] #Note: Entity structure

[0069] h->{

[0070] Type: "Th",

[0071] name: "h",

[0072] Attributes: {

[0073] "attr1": "value1", ...

[0074] }

[0075] };

[0076] After concealment, the above entities will be processed into:

[0077] ->{

[0078] Type: "Th" #Type information is still retained in order to guide the LLM reasoning direction and prevent the reasoning process from introducing a large amount of noise data

[0079] name: "?" #Hide the name

[0080] Attributes: {

[0081] "attr1": "?", #keep the attribute key and hide the attribute value

[0082] };

[0083] Among them, Type, name, Attributes, and "attr1" represent the attributes in the entity structure, "Th" represents the attribute value corresponding to the Type attribute before the masking process, "h" represents the attribute value corresponding to the name attribute before the masking process, "value1" represents the attribute value corresponding to the "attr1" attribute before the masking process, and h- represents the entity before the masking process. - represents the entity after masking, "Th" represents the attribute value corresponding to the Type attribute after masking, "?" represents the attribute value corresponding to the name attribute and the attribute value corresponding to the "attr1" attribute after masking, and Attributes represents multiple attributes.

[0084] Then, the entity information of the relationship instance triples in the knowledge graph is partially hidden, and the entity relationship is completely hidden, forming three types of hidden relationship instance triples: hidden head entity, hidden entity relationship and hidden tail entity.

[0085] Furthermore, LLM is used to drive missing information reasoning on the relation instance triples after partial information hiding to generate the missing information. The reasoning formula is:

[0086] ;

[0087] in, The output generated for LLM is, is the input of hidden relation instance triples, It is a hint word designed to guide LLM to generate accurate missing information.

[0088] Furthermore, for the entities generated by reasoning, LLM is used to generate their attribute key-value pair sets , the reasoning formula is:

[0089] ;

[0090] in, represents the attribute set generated by reasoning, Represents the target attribute key set, Represents a property key, Represents an attribute value.

[0091] The process of generating a trusted knowledge graph in the present invention includes: searching for web page content blocks associated with inferred relationship instance triples through a Web search engine, where each inferred relationship instance triple corresponds to a web page content block; calculating the cosine similarity between each inferred relationship instance triple and the corresponding web page content block; verifying each inferred relationship instance triple based on the size relationship between the cosine similarity and a preset threshold to generate multiple verified relationship instance triples; and combining multiple verified relationship instance triples to generate a trusted knowledge graph.

[0092] Specifically, based on the relationship between the cosine similarity and the preset threshold, the process of verifying each inferred relationship instance triple includes evidence sufficiency verification and multi-way verification. After the evidence sufficiency verification is passed, multi-way verification is performed to generate multiple verified relationship instance triples.

[0093] The adequacy verification process includes:

[0094]

[0095] The multi-path verification process includes:

[0096]

[0097] in, Indicates the sufficiency verification result, Indicates that the sufficiency verification is successful. Indicates that the sufficiency verification failed. Indicates the preset threshold, represents the intersection operation, and represents the vector generated after encoding by the embedding model, represents the cosine similarity between the inferred relation instance triple and a single web page content block, 、 、 Indicates three different prompt words, represents the relation instance triple after reasoning, Indicates the multi-path verification result. Represents large language model reasoning.

[0098] Furthermore, when the sufficiency verification and multi-path verification are passed at the same time, the verified entity relationship implementation triples after reasoning are regarded as verification relationship instance triples, and multiple verification relationship instance triplets are combined to obtain a trusted knowledge graph.

[0099] The specific steps of the present invention to obtain a trusted knowledge graph include: first, traversing each reasoning triple one by one, and organizing it into a Boolean query statement, screening out the most relevant web pages through an advanced search engine, and extracting the web page content. Then, through the RAG system, the web page content is embedded and encoded into a vector, and the reasoning triple is used as a query statement, and the most relevant web page content is retrieved from the vector library as evidence. If the evidence is sufficient and reasonable, the correctness of the reasoning triple is considered reliable and the credibility is high, and it is directly marked as a trusted triple. Otherwise, it further enters the multi-path verification module, and through the three designed verification logics, drives LLM as an auditor to comprehensively judge the correctness or credibility of the triple from three perspectives. If the three judgment results are all correct, the reasoning triple is also considered correct and marked as a trusted triple. Finally, all trusted triples are integrated into a complete trusted knowledge graph.

[0100] In summary, the present invention ensures the correctness and credibility of the reasoning results by combining Boolean queries and multi-way verification strategies based on search engines and LLM reasoning. For each newly added reasoning triple, the present invention can quickly collect the source of evidence and perform association matching based on the semantic similarity of the RAG system, effectively improving the efficiency and accuracy of verification. In the case of insufficient evidence, the reliability of the results is further enhanced through a three-way verification mechanism. This verification method combined with the chain of evidence enhances the usability and user trust of the knowledge graph, and is suitable for scenarios with high data quality requirements.

[0101] Step S7: Fuse the structured knowledge graph, semantic knowledge graph, and trusted knowledge graph to generate the target knowledge graph.

[0102] Specifically, the process of generating the target knowledge graph includes:

[0103] ;

[0104] in, represents the target knowledge graph, For structured knowledge graph, Represents a semantic knowledge graph, Represents the trusted knowledge graph, target knowledge graph It will serve as the input for subsequent intelligent question-answering systems or information retrieval. Represents a union operation.

[0105] See also Figure 2, which represents the full process flow of the knowledge graph construction of the present invention, including: first, the input file is structured to generate a structured knowledge graph. Then, a knowledge graph with semantic information is constructed by parsing the text and its index relationships. After the semantic knowledge graph is constructed, it is reasoned to generate new semantic associations and entities to complete the information that may be missing in the knowledge graph. Subsequently, the knowledge generated by reasoning is verified to ensure its accuracy and reliability. Finally, the verified knowledge is integrated with the original knowledge to generate the final semantic knowledge graph.

[0106] See also Figure 3 , which represents a flow chart of the structured knowledge graph generation process of the present invention, Figure 3 This paper demonstrates how to extract structured information from files in formats such as PDF, DOCX, or TXT (such as directories with structured metadata such as Chapter 1 -> Section 1 -> 1.1 -> 1.1.1, and other content such as abstracts, experiments, etc.) and generate a structured knowledge graph. The process is as follows: convert structured files (PDF files, DOCX files, and TXT files) into Markdown text, then extract relationship instance structure triples based on subordinate and priority relations, generate subordinate relationship instance triples and priority relationship instance triples, and then assign entity text attributes to the triples to generate a structured knowledge graph.

[0107] Specifically, the file content is first read and converted into Markdown format. By parsing the hierarchical and sequential relationships (such as Chapter 1 precedes Chapter 2, and Section 1 is a relative subordinate of Chapter 1), instance triples are extracted. The extracted triples will be attached with text attribute information (such as the node "Chapter 1", the value of the attribute "text" is a summary of the content of this chapter), such as the chapter and title to which each entity belongs, thereby generating a complete structured knowledge graph. The output form of the structured knowledge graph includes (Chapter1 [Text: Text1], has, First Title1 [Text: Text2]), etc., and the correspondence between the index and the text is generated at the same time, providing a basis for the subsequent construction of the semantic knowledge graph.

[0108] The present invention is based on the construction of indexed structured knowledge graph and semantic knowledge graph, and includes the following steps:

[0109] 1) File conversion and structured information extraction;

[0110] Convert the input PDF, DOCX, TXT and other files into Markdown format through automated tools or manual markup, parse the file content to generate instance relationship instance triples based on the upper and lower entity relationships and the order of entity relationships (e.g., markdown content:

[0111] # Chapter 1 Chapter Summary 1

[0112] ## 1.1.1

[0113] Specific content 1.1.1

[0114] # Chapter 2

[0115] Chapter Summary 2

[0116] ## 2.1.1

[0117] Specific content 2.1.1

[0118] According to the markdown syntax, the grammatical marker of Chapter 1 is the superordinate entity relationship of the grammatical marker 1.1.1, so it is extracted as a structural relationship instance triple (Chapter 1, superordinate, 1.1.1). Because the grammatical marker of Chapter 2 is at the same level as the chapter but appears after the latter, it is extracted as a structural relationship instance triple (Chapter 1, before, Chapter 2). At the same time, the corresponding content is used as the attribute of the entity. The process of extracting structured information is as follows:

[0119] {

[0120] Header Entity: {

[0121] "name": "Chapter 1",

[0122] "Type": "Chapter 2",

[0123] "Attributes": {

[0124] "text": "Chapter Summary 1"

[0125] },

[0126] Entity Relationship: {

[0127] "name": "1.1.1"

[0128] "Type": "Level 3 title"

[0129] "Attributes": {

[0130] "text": "Specific content 1.1.1"

[0131] }

[0132] }

[0133] };

[0134] Each entity will have attribute information attached, which is in the following form:

[0135] ;

[0136] in, Representing an entity The corresponding attribute information, Represents an entity, Indicates the attribute name, Indicates the corresponding attribute value, Representing an entity The corresponding number of attributes.

[0137] 2) Construction of structured knowledge graph;

[0138] After structured information extraction, a structured knowledge graph is generated based on the extracted entities and entity relationships. The expression is:

[0139] ;

[0140] in, Represents a structured knowledge graph, Represents a collection of attributes for the head entity, Represents the attribute set of the tail entity, Represents the head entity, Represents the tail entity, Represents entity relationships.

[0141] 3) Construction of semantic knowledge graph;

[0142] On the basis of the structured knowledge graph, an index attribute is added to represent each relationship instance triple. The representation of the semantic knowledge graph is as follows:

[0143] ;

[0144] in, Represents a semantic knowledge graph, is an index attribute, indicating the text source of the relation instance triple (e.g., idx = "C++ Primer->Chapter 1 Introduction", which proves that the node comes from the first chapter of this book). The attribute set representing the entity relationship r. The resulting semantic knowledge graph serves as the basis for subsequent reasoning and verification.

[0145] The present invention is based on the construction process of the index-free reasoning knowledge graph, which includes the following steps:

[0146] 1) Semantic information extraction;

[0147] By dividing the text into chunks, entities and entity relations are extracted from it:

[0148] ;

[0149] ;

[0150] in, Respectively represent the entities and entity relationship sets that meet the target type, types representing entities and entity relationships, are the target entity type set and the target entity relationship type set respectively. Represents an entity, Represents entity relationships, Represents a collection of entities, Represents a collection of entity relationships.

[0151] 2) Initial generation of relation instance triples;

[0152] Combine the extracted entities and entity relations to generate semantic relationship instance triples :

[0153] ;

[0154] 3) semantic reasoning;

[0155] The potential semantic entity relationships and entities are inferred through the existing relationship instance triples. Through information hiding processing, hidden relationship instance triples are obtained, and based on the original retained entity type, entity relationship type, and attribute key set, the LLM is driven to perform hidden information reasoning and completion. The mathematical expression is:

[0156] I ;

[0157] ;

[0158] Among them, I Represents the result of reasoning, that is, the triple of reasoning relation instances, Indicates the prompt words designed to drive LLM to perform reasoning completion. Represents the input relation instance triple after information hiding, Represents the entity relationship generated after LLM reasoning, Represents the head entity generated after LLM reasoning, Represents the tail entity generated after LLM reasoning.

[0159] 4) Integration of reasoning results;

[0160] New relation instance triples generated by reasoning Integrated into:

[0161] ;

[0162] Combine multiple reasoning generated new relation instance triples Combine them to generate an index-free reasoning knowledge graph.

[0163] In summary, the present invention can automatically infer new entities, entity relationships, and attribute information based on the existing knowledge graph through an LLM-based reasoning method. During the reasoning process, through the strategies of concealment and filling, the model can not only verify the integrity of existing data, but also expand the data volume of the knowledge graph. This method is particularly suitable for areas where data is insufficient or not fully labeled. It can achieve semantic expansion of the knowledge graph, significantly improve its coverage and depth, and provide richer data support for subsequent intelligent applications.

[0164] Example 2

[0165] See also Figure 4 , shown is an internal structure diagram of a system for building and expanding a dynamic semantic knowledge graph according to the second embodiment of the present application, the system comprising:

[0166] Extraction module 100, for obtaining the head entity, tail entity, and entity relationship of each text block;

[0167] The attribute adding module 200 is used to add corresponding attribute key-value pair sets to the head entity, the tail entity, and the entity relationship, respectively, to obtain the added head entity, the added entity relationship, and the added tail entity;

[0168] A relationship instance triple construction module 300 is used to generate a relationship instance triple corresponding to each text block based on the additional head entity, the entity relationship, and the additional tail entity;

[0169] A structured knowledge graph generation module 400 is used to generate a structured knowledge graph based on relationship instance triples;

[0170] A semantic knowledge graph generation module 500 is used to generate a semantic knowledge graph based on the additional head entity, additional tail entity, and additional entity relationship after the corresponding index information has been added;

[0171] The trusted knowledge graph generation module 600 is used to select any one of the additional head entity, additional tail entity, and entity relationship in the relationship instance triple as the masked object, infer the masked object based on the other two in the relationship instance triple, generate multiple inferred relationship instance triples, and then verify them to generate a trusted knowledge graph.

[0172] The target knowledge graph generation module 700 is used to fuse the structured knowledge graph, the semantic knowledge graph, and the trusted knowledge graph to generate the target knowledge graph.

[0173] The beneficial effects of the construction and expansion system based on dynamic semantic knowledge graph provided by the present invention are as follows:

[0174] First, through the extraction module 100, a unified fusion of multiple data sources and multimodal information is achieved to form a structured semantic knowledge graph. When processing text data, the context integrity can be automatically maintained, ensuring the semantic accuracy and structural consistency of the knowledge graph. The fusion algorithm solves the redundancy and inconsistency problems between different data blocks, making the generated knowledge graph high-quality and highly usable, meeting the knowledge representation needs in complex scenarios.

[0175] Second, through the trusted knowledge graph generation module 600, new entities, entity relationships and attribute information are automatically inferred based on the existing knowledge graph. During the reasoning process, through the concealment and filling strategies, the model can not only verify the integrity of the existing data, but also expand the data volume of the knowledge graph. This method is particularly suitable for areas where data is insufficient or not fully labeled. It can achieve semantic expansion of the knowledge graph, significantly improve its coverage and depth, and provide richer data support for subsequent intelligent applications. At the same time, through the trusted knowledge graph generation module 600, combined with Boolean query and multi-way verification strategies, the correctness and credibility of the reasoning results are ensured. For each newly added reasoning triple, the method can quickly collect evidence sources and perform association matching based on the semantic similarity of the RAG system, effectively improving the efficiency and accuracy of verification. In the case of insufficient evidence, the reliability of the results is further enhanced through a three-way verification mechanism. This verification method combined with the chain of evidence enhances the usability and user trust of the knowledge graph and is suitable for scenarios with high data quality requirements.

[0176] In the embodiments of the present application, a system for constructing and expanding a dynamic semantic knowledge graph can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), while the non-mobile electronic device can be a server, network attached storage (NAS), personal computer (PC), television, ATM, or self-service machine, etc., without specific limitations in the embodiments of the present application.

[0177] In the embodiments of the present application, a system for constructing and expanding a dynamic semantic knowledge graph can be a device having an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.

[0178] The construction and expansion system based on dynamic semantic knowledge graph provided by the embodiment of the present application can achieve Figures 1 to 3 In the method embodiment, each process of implementing a construction and expansion system based on a dynamic semantic knowledge graph is not described here to avoid repetition.

[0179] Optionally, an embodiment of the present application also provides an electronic device, including a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, each process of the above-mentioned embodiment of the method for constructing and expanding a dynamic semantic knowledge graph is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0180] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned embodiment of the method for constructing and expanding a dynamic semantic knowledge graph is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0181] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk.

[0182] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0183] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a more preferred embodiment. Based on this understanding, the technical solution of this application, or the part that contributes to the existing technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of this application.

[0184] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A method for constructing and expanding a dynamic semantic knowledge graph, characterized in that: include: Obtaining a head entity, a tail entity, and an entity relationship of each text block, wherein the entity relationship represents a semantic entity relationship between the head entity and the tail entity; Attach corresponding attribute key-value pair sets to the head entity, the tail entity, and the entity relationship, respectively, to obtain an attached head entity, an attached entity relationship, and an attached tail entity, respectively, wherein the attribute key-value pair sets include multiple attribute keys and attribute values corresponding to the head entity and the tail entity; generating a relation instance triple corresponding to each text block based on the additional head entity, the entity relationship, and the additional tail entity; Generate a structured knowledge graph based on the relationship instance triples; Generate a semantic knowledge graph according to the additional head entity, the additional tail entity, and the additional entity relationship after the corresponding index information has been added respectively; Select any one of the additional head entity, additional tail entity, and entity relationship in the relationship instance triple as the masked object, perform reasoning on the masked object based on the other two in the relationship instance triple, generate multiple reasoned relationship instance triples and then verify them to generate a trusted knowledge graph, wherein the process of reasoning on the masked object includes: respectively masking the head entity, tail entity, and entity relationship in the relationship instance triple, and correspondingly obtaining multiple relationship instance triples after partial information hiding; using LLM to drive missing information reasoning on the relationship instance triple after partial information hiding to obtain the reasoned head entity, the reasoned entity relationship, and the reasoned tail entity; using LLM to drive attribute reasoning on the reasoned head entity and the reasoned tail entity to obtain the reasoned attribute set; combining the reasoned attribute set, the reasoned head entity, and the reasoned entity relationship to generate multiple reasoned relationship instance triples; The structured knowledge graph, the semantic knowledge graph, and the trusted knowledge graph are integrated to generate a target knowledge graph.

2. A method for constructing and expanding a dynamic semantic knowledge graph according to claim 1, characterized in that: The specific process of obtaining the relationship instance triples includes: Constructing an entity set and an entity relationship set based on entities and entity relationships of multiple text blocks, wherein the entity set includes multiple head entities and multiple tail entities, and the entity relationship set includes multiple entity relationships; Fusing the entity set based on a preset fusion rule to generate an attribute key-value pair set; According to the head entity and the tail entity, respectively obtain the entity type and attribute key-value pair set corresponding to each entity in the entity set; Relationship instance triples are generated based on the entity set, the entity relationship set, and the attribute key-value pair set.

3. A method for constructing and expanding a dynamic semantic knowledge graph according to claim 2, characterized in that: The preset fusion rules include: obtaining the entity type, entity name and attribute value of each text block; when the entity type and entity name are the same but the attribute values are different, determining whether the attribute key corresponding to the attribute value exists; when the attribute key exists, replacing the attribute value of the later batch with the attribute value of the previous batch; when the attribute key does not exist, adding an attribute key-value pair based on the updated attribute key and the attribute value of the later batch.

4. The method for constructing and expanding a dynamic semantic knowledge graph according to claim 1, wherein: The process of generating a semantic knowledge graph includes: ; in, Represents a semantic knowledge graph, Represents the head entity, Represents the tail entity, Represents entity relationships, Represents the index of the head entity, An index representing an entity relationship, Represents the index of the tail entity, A collection of attribute key-value pairs representing the head entity. A collection of attribute key-value pairs representing entity relationships, A collection of attribute key-value pairs representing the tail entity.

5. The method for constructing and expanding a dynamic semantic knowledge graph according to claim 1, wherein: The process of generating a trusted knowledge graph includes: Searching for web page content blocks associated with the inferred relationship instance triples through a web search engine, wherein each inferred relationship instance triple corresponds to a web page content block; Calculating the cosine similarity between each of the inferred relation instance triples and the corresponding webpage content block; Based on the magnitude relationship between the cosine similarity and a preset threshold, verifying each of the inferred relationship instance triples to generate a plurality of verified relationship instance triples; The multiple verified relationship instance triples are combined to generate a trusted knowledge graph.

6. A method for constructing and expanding a dynamic semantic knowledge graph according to claim 5, characterized in that: Based on the relationship between the cosine similarity and the preset threshold, the process of verifying each of the inferred relationship instance triples includes evidence sufficiency verification and multi-path verification. After the evidence sufficiency verification is passed, the multi-path verification is performed to generate multiple verified relationship instance triples. The process of adequacy verification includes: The multi-path verification process includes: in, Indicates the sufficiency verification result, Indicates that the sufficiency verification is successful. Indicates that the sufficiency verification failed. Indicates the preset threshold, represents the intersection operation, and represents the vector generated after encoding by the embedding model, represents the cosine similarity between the inferred relation instance triple and a single web page content block, 、 、 Indicates three different prompt words, represents the triple of relation instances after reasoning, Indicates the multi-path verification result. Represents large language model reasoning.

7. A system for building and expanding a dynamic semantic knowledge graph, characterized in that: include: The extraction module is used to obtain the head entity, tail entity, and entity relationship of each text block; An attribute adding module is used to add corresponding attribute key-value pair sets to the head entity, the tail entity, and the entity relationship, respectively, to obtain an additional head entity, an additional entity relationship, and an additional tail entity; a relationship instance triple construction module, configured to generate a relationship instance triple corresponding to each text block based on the additional head entity, the entity relationship, and the additional tail entity; A structured knowledge graph generation module, configured to generate a structured knowledge graph based on the relationship instance triples; A semantic knowledge graph generation module, configured to generate a semantic knowledge graph based on the additional head entity, the additional tail entity, and the additional entity relationship after the corresponding index information has been added; A trusted knowledge graph generation module is used to select any one of the additional head entity, additional tail entity, and entity relationship in the relationship instance triple as a masked object, and to infer the masked object based on the other two in the relationship instance triple to generate multiple inferred relationship instance triples and then verify them to generate a trusted knowledge graph, wherein the process of reasoning on the masked object includes: respectively masking the head entity, tail entity, and entity relationship in the relationship instance triple to obtain multiple relationship instance triples after partial information hiding; using LLM to drive missing information reasoning on the relationship instance triples after partial information hiding to obtain the inferred head entity, the inferred entity relationship, and the inferred tail entity; using LLM to drive attribute reasoning on the inferred head entity and the inferred tail entity to obtain the inferred attribute set; combining the inferred attribute set, the inferred head entity, and the inferred entity relationship to generate multiple inferred relationship instance triples; The target knowledge graph generation module is used to fuse the structured knowledge graph, the semantic knowledge graph, and the trusted knowledge graph to generate a target knowledge graph.

8. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of a method for constructing and expanding a dynamic semantic knowledge graph based on any one of claims 1 to 6 are implemented.

9. A readable storage medium, characterized in that: The readable storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of a method for constructing and expanding a dynamic semantic knowledge graph as described in any one of claims 1-6 are implemented.

Citation Information

Patent Citations

  • Fusion reasoning method, system and equipment based on large language model and medium

    CN117709468A

  • Knowledge reasoning method based on multi-training global perception

    CN118674033A