Multi-model collaborative knowledge graph construction method, system, device and storage medium

Through the multi-model collaboration method, combined with lightweight small models and large models, the problems of dynamic update difficulties and complex context analysis in the construction of knowledge graphs are solved, efficient and accurate knowledge graph construction is achieved, domain adaptability and automation are improved, and system robustness and fault tolerance are enhanced.

CN120316272BActive Publication Date: 2025-08-26XIAMEN YUANTING INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510797299.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-08-26
Estimated Expiration
2045-06-16

AI Technical Summary

Technical Problem

In the prior art, large models are difficult to update dynamically, difficult to adapt to the rapid changes in domain knowledge and new task requirements, and lightweight small models perform poorly when dealing with complex contextual analysis tasks, and it is difficult to accurately capture deep semantic associations in text, resulting in limited coverage breadth and depth of knowledge graphs.

Method used

The multi-model collaboration method is adopted, combining lightweight small models and large models, and the routing engine, scheduling engine and execution engine are used to automate and efficient the knowledge graph construction process. Small models handle clear entity extraction tasks, large models handle complex relationships and deep semantic understanding, and use the enhancement capabilities of prompt word template libraries and large models to perform entity alignment and relationship conflict resolution.

Benefits of technology

It realizes efficient and accurate knowledge graph construction, reduces computing costs, improves field adaptability and automation, improves the depth and breadth of knowledge, reduces manual intervention, and enhances the robustness and fault tolerance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120316272B_ABST
    Figure CN120316272B_ABST
Patent Text Reader

Abstract

The present invention proposes a multi-model collaborative knowledge graph construction method, system, device and storage medium, including: a routing engine receives a knowledge graph construction request, matches a preset rule base according to target domain parameters, and generates a node component sequence; a scheduling engine constructs a task execution directed acyclic graph based on the request; an execution engine preprocesses the original document according to the graph to generate a structured document block set with metadata; a pre-trained model in a small model resource pool is called to extract entities and relationships to form a preliminary entity set and an associated relationship set; attributes are completed and implicit relationships are inferred on the preliminary entity set to generate a completed entity attribute set and a newly added relationship set; a large model performs entity alignment on the preliminary entity set and the completed entity attribute set to obtain a fused entity set; and conflict resolution is performed on the associated relationship set and the newly added relationship set to obtain a fused relationship set. The fused entity set and the fused relationship set are stored in a knowledge graph database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge graph technology, and specifically to a multi-model collaborative knowledge graph construction method, system, device and storage medium. Background Art

[0002] As a structured semantic knowledge base, knowledge graphs hold significant value in areas such as intelligent search and decision-making. Traditional construction methods rely on rule engines and statistical models (such as regular expression-based entity extraction and TF-IDF relationship mining), which suffer from high levels of manual intervention and weak semantic generalization. With the advancement of deep learning, neural network models based on RNNs and CNNs have improved automation to a certain extent, but they are insufficient in modeling long-range semantic dependencies and are severely limited by the scale of annotated data.

[0003] In recent years, large pre-trained models (such as BERT and GPT) have significantly improved semantic understanding capabilities through massive unsupervised learning, providing new insights for knowledge extraction. However, the high computational cost (e.g., hundreds of billions of parameter inference latency), high deployment barriers (dependence on GPU clusters), and difficulty in dynamic updates of these large models have limited their application in building real-time knowledge graphs. In contrast, lightweight small models (such as distillation models and TinyBERT), while offering the advantage of low resource consumption, perform significantly worse in complex context parsing (e.g., multi-hop reasoning, implicit relationship mining) and adapting to low-resource languages, limiting the breadth and depth of knowledge graph coverage.

[0004] In view of this, the present invention proposes a multi-model collaborative knowledge graph construction method, system, device and storage medium, which can meet the needs of efficient and accurate composition. Summary of the Invention

[0005] In order to solve the problems that the dynamic update of existing large models is difficult, it is difficult to adapt to the rapid changes in domain knowledge and the needs of new tasks in a timely manner, lightweight small models perform poorly when processing complex context parsing tasks, and it is difficult to accurately capture deep semantic associations in texts, the present invention provides a multi-model collaborative knowledge graph construction method, system, device and storage medium to solve the above-mentioned technical defects.

[0006] In a first aspect, the present invention proposes a method for constructing a multi-model collaborative knowledge graph, comprising the following steps:

[0007] S1. The routing engine receives a knowledge graph construction request, which includes the original document to be processed and the target domain parameters;

[0008] S2. The routing engine matches the preset rule base according to the target domain parameters and generates the node component sequence to be called. The node component sequence includes the document parsing module selection, the pre-trained model matching results and the large model intervention conditions;

[0009] S3, the scheduling engine builds a directed acyclic graph of task execution based on the node component sequence;

[0010] S4. The execution engine executes the directed acyclic graph according to the task, performs format parsing, text extraction, cleaning, and intelligent block operations on the original document, and generates a set of structured document blocks with metadata;

[0011] The execution engine calls the pre-trained model in the small model resource pool to extract entities and relationships from the structured document block set, generating a preliminary entity set and associated relationship set;

[0012] The execution engine, based on the prompt word template and in combination with the relevant text content in the structured document block set, calls the large model to complete the attributes and infer the implicit relationships of the preliminary entity set, and generates a completed entity attribute set and a newly added relationship set;

[0013] S5. The large model aligns the preliminary entity set and the completed entity attribute set based on the prompt word template to generate a fused entity set.

[0014] Perform conflict resolution on the associated relationship set and the newly added relationship set to generate a fused relationship set;

[0015] S6. Store the fused entity set and the fused relationship set in the knowledge graph database.

[0016] Preferably, in step S4, the execution engine executes the directed acyclic graph according to the task, performs format parsing, text extraction, cleaning and intelligent block segmentation on the original document, and generates a set of structured document blocks carrying metadata, which specifically includes the following sub-steps:

[0017] S411. Calling a format-adapted parsing library to extract text from the original document and perform a cleaning operation to obtain a document to be processed;

[0018] S412: Performing intelligent block division on the document to be processed to obtain document blocks, including:

[0019] Split the document to be processed by natural paragraph boundaries and heading levels;

[0020] Based on sentence vector similarity or topic model clustering algorithm, semantically coherent text fragments are aggregated into document chunks;

[0021] Set overlapping text areas of a preset length between adjacent document blocks;

[0022] S413: Add metadata to each document block to generate a structured document block set. The metadata includes: original document identifier, block identifier, starting position coordinates in the original text, and chapter information.

[0023] Preferably, in step S4, the execution engine calls the pre-trained model in the small model resource pool to extract entities and relationships from the structured document block set, generating a preliminary entity set and an associated relationship set, which specifically includes the following sub-steps:

[0024] S421. Dynamically load a pre-trained model that matches the target domain parameters from a small model resource pool according to the task execution directed acyclic graph, where the pre-trained model includes a named entity recognition model and a relationship extraction model;

[0025] S422, traversing the structured document block set, performing entity recognition on each document block using a named entity recognition model, and generating a preliminary entity set including entity text, type, and confidence level;

[0026] Use the relation extraction model to extract relations from the extracted entities, generate relation triples, form a relation set, and record the relation type and confidence level;

[0027] S423: If the number of target entity types extracted from a single document block is lower than a preset density threshold, the document block and its associated entities and relationships are eliminated;

[0028] Entities and relationships with confidence levels lower than a set threshold are removed from the preliminary entity set and relationship set. The threshold is dynamically adjusted based on the processing mode parameters in the user request.

[0029] Preferably, in step S4, the execution engine, based on the prompt word template and in combination with the relevant text content in the structured document block set, calls the large model to perform attribute completion and implicit relationship reasoning on the preliminary entity set, and generates a completed entity attribute set and a newly added relationship set, which specifically includes the following sub-steps:

[0030] S431. Match entity attribute completion templates and implicit relationship reasoning templates from the prompt word template library according to the target domain parameters;

[0031] S432, dynamically injecting entity text, associated document block content, and overlapping text area context in the preliminary entity set into the selected template to generate structured prompt words;

[0032] S433: Call the large language model to perform the following operations:

[0033] Based on structured prompt words, complete the standard name, alias, description and attribute information of the entity, and infer the implicit relationship between the entities in the preliminary entity set;

[0034] S434. Parse the results returned by the large model, extract the completed entity attributes to form a completed entity attribute set, and extract the newly added implicit relationships to form a newly added relationship set.

[0035] Preferably, in step S5, the large model performs entity alignment on the preliminary entity set and the completed entity attribute set based on the prompt word template to generate a fused entity set, performs conflict resolution on the associated relationship set and the newly added relationship set to generate a fused relationship set, which specifically includes the following sub-steps:

[0036] S51. Detecting homonymous entities and synonymous entities in the preliminary entity set and the complete entity attribute set based on entity name similarity and attribute consistency;

[0037] S52: Calling the large model to perform contextual semantic verification on entities with the same name and synonyms, merging entities that point to the same real object to generate a fused entity set;

[0038] S53. Conflict detection is performed on the relationships in the associated relationship set and the newly added relationship set, and conflicting relationships are fused based on the confidence, source reliability, and semantic consistency of the relationships to generate a fused relationship set.

[0039] Preferably, in step S3, the scheduling engine constructs a task execution directed acyclic graph according to the node component sequence, which specifically includes the following sub-steps:

[0040] S31, parsing the node component sequence, identifying each task node in the node component sequence and its execution order dependency;

[0041] S32. Construct a directed acyclic graph with node components as vertices of the graph and execution order dependencies as directed edges.

[0042] Preferably, step S1 further includes: receiving a knowledge graph construction request, extracting target domain parameters from the knowledge graph construction request, the target domain parameters including classification identification, expected output knowledge graph structure specifications, and processing mode.

[0043] In the second aspect, the present invention proposes a multi-model collaborative knowledge graph construction system, which includes: a routing engine, a scheduling engine, an execution engine, a document processor, a small model resource pool, a prompt word template library and a large model;

[0044] The routing engine is used to receive knowledge graph construction requests, which include the original document to be processed and the target domain parameters;

[0045] The routing engine is used to match the preset rule base according to the target domain parameters and generate the node component sequence to be called. The node component sequence includes the document parsing module selection, pre-trained model matching results and large model intervention conditions;

[0046] The scheduling engine is used to build a directed acyclic graph of task execution based on the sequence of node components;

[0047] The execution engine is used to execute the directed acyclic graph according to the task, call the document processor to perform format parsing, text extraction, cleaning and intelligent block operations on the original document, and generate a set of structured document blocks with metadata;

[0048] The execution engine calls the pre-trained model in the small model resource pool to extract entities and relationships from the structured document block set, generating a preliminary entity set and associated relationship set;

[0049] The execution engine uses the prompt word templates in the prompt word template library and the relevant text content in the structured document block set to call the large model to complete the attributes and infer implicit relationships of the preliminary entity set, thereby generating a completed entity attribute set and a newly added relationship set.

[0050] The large model aligns the preliminary entity set and the completed entity attribute set based on the prompt word template to generate a fused entity set; performs conflict resolution on the associated relationship set and the newly added relationship set to generate a fused relationship set; and stores the fused entity set and the fused relationship set in the knowledge graph database.

[0051] In the third aspect, the present invention proposes a terminal device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the steps of any of the above-mentioned multi-model collaborative knowledge graph construction methods are implemented.

[0052] In a fourth aspect, the present invention proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned multi-model collaborative knowledge graph construction methods.

[0053] Compared with the prior art, the present invention has the following advantages:

[0054] (1) Balance between efficiency and economy: Small models with low computational cost and high speed are used to process most clear entity extraction tasks within the domain, significantly reducing the frequency and data volume of calls to expensive large model APIs; through the document block filtering mechanism, irrelevant information sent to the large model for processing is reduced, further saving costs and improving processing speed.

[0055] (2) Improvement of accuracy and recall rate: The small model has been fully trained in a specific field and can identify the core entities and relationships in the field with high precision; the large model, with its powerful generalization and understanding capabilities, can handle long-tail entities, complex relationships, metaphorical expressions that the small model cannot cover, and perform information completion, effectively improving the recall rate and the richness of knowledge; the combination of large and small models can form a verification mechanism, for example, the large model can verify the extraction results of the small model, and vice versa (through carefully designed prompts).

[0056] (3) Stronger domain adaptability and scalability: The "small model resource pool" can easily access new domain models, enabling the system to quickly adapt to the knowledge graph construction needs of different industries or topics; the modular design of the "prompt word template library" allows you to adjust or add prompt templates for new tasks or optimize existing tasks without modifying the core code.

[0057] (4) High degree of automation, reducing manual dependence: The entire process from document processing to knowledge output is highly automated, significantly reducing the heavy manual annotation, review and rule writing work in traditional knowledge graph construction; the intelligent design of the routing engine and scheduling engine enables the system to autonomously select the optimal processing path.

[0058] (5) Ability to process heterogeneous data: The "Document Processor" supports a variety of common document formats, including text in images, which expands the breadth of knowledge sources; intelligent segmentation technology ensures the integrity of text context, which is conducive to the understanding and extraction of subsequent models.

[0059] (6) Taking into account both the depth and breadth of knowledge: small models ensure in-depth mining of knowledge in core areas; large models expand the breadth of knowledge and discover more potential connections and emerging knowledge.

[0060] (7) Robustness and fault tolerance: The scheduling engine’s fault tolerance mechanisms (such as task retry and backup plan switching) improve the stability and reliability of the system. For example, when a small model fails or performs poorly, it can automatically switch to the large model for processing.

[0061] (8) Optimize context utilization and improve the efficiency of large models: Through preliminary processing and document block filtering by small models, more accurate and relevant context information is provided to the large model, avoiding invalid reasoning in redundant information by the large model and improving its efficiency and effectiveness in handling specific tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Other features, objects and advantages of the present application will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0063] Figure 1 is a flowchart of the multi-model collaborative knowledge graph construction method according to the present invention;

[0064] Figure 2 is a schematic diagram of a multi-model collaborative knowledge graph construction system according to the present invention;

[0065] Figure 3 It is a schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0066] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the relevant invention are shown in the accompanying drawings.

[0067] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0068] This paper proposes a multi-model collaborative knowledge graph construction method. Figure 1 A flowchart of the multi-model collaborative knowledge graph construction method according to the present invention is shown as follows: Figure 1 As shown, the method includes the following steps:

[0069] S1. The routing engine receives a knowledge graph construction request, which includes the original document to be processed and the target domain parameters.

[0070] In this embodiment, a knowledge graph construction request is received from a user via an API or graphical user interface. The request includes one or more original documents to be processed and target domain parameters, where the target domain parameters include a classification identifier (e.g., "finance," "medical," "legal," or "general"), the desired output knowledge graph structure specification (schema), and a processing mode (e.g., prioritizing speed or quality). Original document formats include PDF, TXT, DOC, DOCX, HTML, Markdown, and images.

[0071] The routing engine's input parameter processor receives and parses these target domain parameters.

[0072] S2. The routing engine matches the preset rule library according to the target domain parameters and generates a sequence of node components to be called. The node component sequence includes the document parsing module selection, pre-trained model matching results and large model intervention conditions.

[0073] In this embodiment, the routing engine serves as the system's entry point and task distribution hub, responsible for determining subsequent processing flows and resource allocation based on user requests and pre-set rules. The routing engine consists of an input parameter processor and a rule-based dispatcher. The input parameter processor not only receives knowledge graph construction requests but also verifies, formats, and performs preliminary parsing of target domain parameters. It also preliminarily screens available small models and prompt templates based on domain tags, document types, and other factors. The rule-based dispatcher includes a built-in configurable rule library. When the domain parameter indicates the financial domain, it selects a financial-specific named entity recognition model. For example, when the domain is "finance" and the task type is "entity extraction," the small model "financial_ner_v1.2" is used; when the domain is "general" and the task type is "entity extraction," the large model with the prompt template "general_ner_prompt_v1.0" is used. It matches the information output by the input parameter processor with the rule library to generate task processing path instructions, including selecting a small model, determining whether the large model should be involved, and which prompt templates to use.

[0074] After receiving and parsing a knowledge graph construction request, the routing engine matches a pre-set rule base based on target domain parameters (such as classification identifiers like finance and healthcare) and dynamically generates a node component call sequence. This includes document parsing module selection (e.g., automatically triggering pdfminer for PDF files and calling the OCR engine for images), precise binding of pre-trained models (e.g., specifying the financial_ner_v1.2 model for financial entity recognition), and conditions for large-scale model intervention (e.g., activating large-scale model validation when the entity confidence threshold is less than 0.8). This process enables intelligent decision-making through the rule base. For example, entity extraction tasks in the financial domain prioritize the use of a dedicated pre-trained small model, while general-domain relationship extraction tasks directly use the large model with the general_relation_prompt template.

[0075] S3. The scheduling engine builds a directed acyclic graph of task execution based on the node component sequence.

[0076] In this embodiment, the scheduling engine parses the node component sequence, identifies each task node and its execution order dependencies, and constructs a directed acyclic graph with the node components as vertices and the execution order dependencies as directed edges. For example, the document parsing task must be completed before the entity extraction task, which in turn must be completed before the relationship completion task.

[0077] Specifically, the scheduling engine receives the instruction sequence output by the routing engine and converts it into an executable task flow: first, the composition process is decomposed into atomic tasks (document parsing → entity extraction → relationship completion → knowledge fusion), and a directed acyclic graph (DAG) is constructed to clarify the task dependencies; resources are dynamically allocated according to task characteristics (such as CPU-intensive document parsing, GPU-accelerated small model inference), and the token bucket algorithm is used to control the concurrency of the large model API to balance the load; core tasks are strictly executed in the order of the DAG dependency chain (such as entity extraction needs to wait for document segmentation to be completed), and parallel processing is enabled for non-dependent tasks (such as simultaneous entity extraction of multiple document blocks); task status is monitored in real time and fault-tolerant strategies are implemented. When the small model extraction fails or times out, it automatically switches to the large model + fallback_prompt template (backup prompt word template) for retry; finally, intermediate results (such as document blocks with metadata tags) are standardized and transmitted through the global data bus to ensure data consistency across components.

[0078] S4. The execution engine executes the directed acyclic graph according to the task, performs format parsing, text extraction, cleaning, and intelligent block operations on the original document, and generates a set of structured document blocks with metadata;

[0079] The execution engine calls the pre-trained model in the small model resource pool to extract entities and relationships from the structured document block set, generating a preliminary entity set and associated relationship set;

[0080] The execution engine, based on the prompt word template and in combination with the relevant text content in the structured document block set, calls the large model to complete the attributes and implicit relationship reasoning of the preliminary entity set, and generates a completed entity attribute set and a newly added relationship set.

[0081] In step S4, the execution engine executes the directed acyclic graph according to the task, performs format parsing, text extraction, cleaning, and intelligent block operations on the original document, and generates a set of structured document blocks with metadata. Specifically, the steps include the following:

[0082] S411. Calling a format-adapted parsing library to extract text from the original document and perform a cleaning operation to obtain a document to be processed;

[0083] S412: Performing intelligent block division on the document to be processed to obtain document blocks, including:

[0084] Split the document to be processed by natural paragraph boundaries and heading levels;

[0085] Based on sentence vector similarity or topic model clustering algorithm, semantically coherent text fragments are aggregated into document chunks;

[0086] Set overlapping text areas of a preset length between adjacent document blocks;

[0087] S413: Add metadata to each document block to generate a structured document block set. The metadata includes: original document identifier, block identifier, starting position coordinates in the original text, and chapter information.

[0088] In step S4, the execution engine calls the pre-trained model in the small model resource pool to extract entities and relationships from the structured document block set, generating a preliminary entity set and a set of associated relationships, which specifically includes the following sub-steps:

[0089] S421. Dynamically load a pre-trained model that matches the target domain parameters from a small model resource pool according to a directed acyclic graph, where the pre-trained model includes a named entity recognition model and a relationship extraction model;

[0090] S422, traversing the structured document block set, performing entity recognition on each document block using a named entity recognition model, and generating a preliminary entity set including entity text, type, and confidence level;

[0091] Use the relation extraction model to extract relations from the extracted entities, generate relation triples, form a relation set, and record the relation type and confidence level;

[0092] S423: If the number of target entity types extracted from a single document block is lower than a preset density threshold, the document block and its associated entities and relationships are eliminated;

[0093] Entities and relationships with confidence levels lower than a set threshold are removed from the preliminary entity set and relationship set. The threshold is dynamically adjusted based on the processing mode parameters in the user request.

[0094] In step S4, the execution engine uses the large model to perform attribute completion and implicit relationship reasoning on the preliminary entity set based on the prompt word template and in combination with the relevant text content in the structured document block set, thereby generating a completed entity attribute set and a newly added relationship set. The specific steps include the following:

[0095] S431. Match entity attribute completion templates and implicit relationship reasoning templates from the prompt word template library according to the target domain parameters;

[0096] S432, dynamically injecting entity text, associated document block content, and overlapping text area context in the preliminary entity set into the selected template to generate structured prompt words;

[0097] S433: Call the large language model to perform the following operations:

[0098] Based on structured prompt words, complete the standard name, alias, description and attribute information of the entity, and infer the implicit relationship between the entities in the preliminary entity set;

[0099] S434. Parse the results returned by the large model, extract the completed entity attributes to form a completed entity attribute set, and extract the newly added implicit relationships to form a newly added relationship set.

[0100] In a specific embodiment, the execution engine is used to execute tasks assigned by the scheduling engine and call corresponding node components to complete actual operations. Its components and corresponding operations are as follows:

[0101] (1) Document processing executor

[0102] The document processing executor receives the original document as input and uses the document processor to perform a series of operations on the document, including format parsing, text extraction, cleaning, and intelligent chunking. The final output is a set of structured document chunks with metadata. These structured document chunks are temporarily stored or passed to subsequent executors for further processing. The processing flow of the document processor is as follows:

[0103] First, format parsing and text extraction are performed. For documents of different formats, corresponding parsing libraries (such as pdfminer, python-docx, and BeautifulSoup) are used to extract text. For images or images within PDFs, an integrated optical character recognition (OCR) engine is used for text recognition. Next, text cleaning is performed to remove irrelevant characters, standardize text, and eliminate excess whitespace and line breaks. Intelligent chunking is then performed, starting with initial segmentation based on natural paragraphs and headings. Semantic chunking is then performed using methods based on sentence vector similarity or topic models. Semantically coherent text segments are aggregated into meaningful document chunks. Each document chunk should maintain a certain level of contextual integrity to avoid fragmentation of key information. To ensure that entity relationships are not lost during chunking, a certain overlap area is set between adjacent chunks, and metadata is appended to each document chunk. The final output is a structured list of document chunks, each containing both text content and metadata.

[0104] (2) Domain Entity Extraction Executor

[0105] The domain entity extraction executor loads pre-trained models that match the target domain parameters from the small model resource pool according to the scheduling instructions. The small model resource pool stores and manages a series of lightweight pre-trained models or rule sets. These models have the characteristics of fast inference speed and low resource consumption, including:

[0106] Domain-specific Named Entity Recognition (NER) models: For example, models for recognizing company names, product names, and financial indicators in the financial sector, and for recognizing diseases, drugs, and symptoms in the medical sector. These models can be based on classic sequence labeling models such as CRF (Conditional Random Fields) and Bidirectional Long Short-Term Memory-Conditional Random Fields (BiLSTM-CRF), or small Transformer (a self-attention-based model architecture) models fine-tuned on domain data, such as a fine-tuned version of DistilBERT (a lightweight BERT variant).

[0107] Domain Relation Extraction (RE) model: extracts specific relationships between specific entity pairs, such as "(Company A)-[Holdings]-(Company B)" in the financial field and "(Drug X)-[Treatment]-(Disease Y)" in the medical field.

[0108] Keyword extraction models: such as TF-IDF (Term Frequency-Inverse Document Frequency), TextRank (a graph-based text ranking algorithm), or YAKE (Yet Another Keyphrase Extractor).

[0109] Text classification model: used to determine the sub-domain or topic of a document block.

[0110] Rule sets: Specific pattern matching rules based on regular expressions or expert knowledge. The small model resource pool also provides model registration, version control, loading, and unloading interfaces, supporting the dynamic selection and loading of appropriate models based on task requirements.

[0111] The domain entity extraction executor traverses each document block and applies a pre-trained model to perform entity extraction. It identifies entities and records information such as their location within the document block, while also associating the extracted entities with the document block they reside in. It also performs document block filtering based on entity density, type, and confidence level to improve the accuracy and efficiency of subsequent processing. Finally, it outputs a preliminary list of extracted entities. Each entity in the list includes key information such as text, type, source document block ID, location within the block, and confidence level.

[0112] (3) Information completion and verification executor

[0113] The input of the information completion and verification executor is the entity and its associated document blocks output by the domain entity extraction executor. It mainly performs the following operations:

[0114] Entity Information Completion: An appropriate prompt word template is selected from the prompt word template library. The entity's contextual information (i.e., the text content of the document block containing the entity) is combined with the extracted entity information to form a complete prompt word. Subsequently, the large model interface is called to request that the large model complete the entity's standard name, alias, description, and key attributes based on these prompt words. For example, using a company entity, this process can complete key information such as the company's founding date, headquarters location, and industry classification, significantly enriching the entity's semantic meaning.

[0115] Relationship extraction and completion: First, a small model is used to extract relationships. If the routing engine specifies a domain relationship extraction small model, the small model attempts to extract relationships between entities. For relationship types not covered by the small model, or relationships that require deeper semantic understanding to accurately identify, the executor constructs prompt words containing multiple entities and their contextual information and requests the intervention of the large model. Leveraging the large model's powerful semantic understanding and reasoning capabilities, it identifies the type and direction of these complex relationships. For example, from the text "Company A announces the acquisition of Company B," the relationship triple (A, acquisition, B) is accurately extracted to effectively complete the relationship information.

[0116] Entity and Relationship Verification: Leveraging the superior understanding capabilities of the large model, we perform consistency verification, ambiguity resolution, and fact verification on entities and relationships extracted by the small model. For example, when the small model identifies "apple" as both a fruit and a company, the large model accurately determines the true category based on the context, correcting the small model's error and improving the accuracy and reliability of entity and relationship extraction.

[0117] Ultimately, the information completion and verification executor outputs a carefully completed and strictly verified entity list, a relationship triple list (containing subject, predicate, and object, used to represent entities and their relationships in the knowledge graph), and related metadata, laying a solid foundation for subsequent knowledge fusion and storage.

[0118] In this embodiment, the large model is preferably a large language model (LLM), which performs the following operations:

[0119] Open-domain entity recognition and relation extraction: Supplement entities and relations that are not covered or poorly recognized by small models.

[0120] Information completion and attribute inference: Complete missing attribute information for entities based on the context.

[0121] Semantic understanding and ambiguity resolution: understanding complex contexts and resolving ambiguities between entities or relationships.

[0122] Knowledge reasoning: simple logical reasoning based on existing information.

[0123] Text summarization and concept generalization: Summarize the content of a document block or generalize specific expressions into standard concepts.

[0124] Data cleaning and verification: Verify and correct the results extracted from the small model.

[0125] The prompt word template library stores and manages a series of carefully designed prompt word templates to guide large models to complete specific tasks efficiently and accurately, including the following templates:

[0126] Task type templates: such as entity extraction template, relationship extraction template, attribute completion template, text summarization template, question generation template, ambiguity elimination template, etc.

[0127] Context injection mechanism: The template contains placeholders for dynamically filling in context information such as document blocks to be processed, extracted entities, domain knowledge, etc.

[0128] Role-playing and instruction design: For example, “You are a financial analyst. Please extract all corporate entities and their financing round information from the following text…”

[0129] Output format constraints: The prompt word can include requirements for the output format (such as JSON (JavaScript Object Notation, a lightweight data exchange format), XML (eXtensible Markup Language), list, etc.) to facilitate subsequent parsing.

[0130] Few-shot examples: These can include a small number of examples (in-context learning) to improve the performance of large models on specific tasks.

[0131] Continue to refer Figure 1 The present invention provides a method for constructing a multi-model collaborative knowledge graph, further comprising the following steps:

[0132] S5. The large model aligns the preliminary entity set and the completed entity attribute set based on the prompt word template to generate a fused entity set.

[0133] Perform conflict resolution on the associated relationship set and the newly added relationship set to generate a fused relationship set;

[0134] In this embodiment, entity alignment is performed on the preliminary entity set and the completed entity attribute set to generate a fused entity set, and conflict resolution is performed on the associated relationship set and the newly added relationship set to generate a fused relationship set. Specifically, the following sub-steps are included:

[0135] S51. Detecting homonymous entities and synonymous entities in the preliminary entity set and the complete entity attribute set based on entity name similarity and attribute consistency;

[0136] S52: Calling the large model to perform contextual semantic verification on entities with the same name and synonyms and entities with different names and synonyms based on the context provided by the structured document block set, merging entities that point to the same real object to generate a fused entity set;

[0137] S53. Conflict detection is performed on the relationships in the associated relationship set and the newly added relationship set, and conflicting relationships are fused based on the confidence, source reliability, and semantic consistency of the relationships to generate a fused relationship set.

[0138] S6. Store the fused entity set and the fused relationship set in the knowledge graph database.

[0139] Specifically, the fused entity and relationship sets are stored as triples or other graph structures in a graph database (such as Neo4j, an open-source graph database), JanusGraph (an extensible graph database), or a storage system that supports RDF (Resource Description Framework). The system provides an API (Application Programming Interface) for users to query and visualize the knowledge graph, or export it to a standard format (such as RDF or CSV (comma-separated values)).

[0140] Further references Figure 2 As an implementation of the above method, the second aspect of the present invention provides an embodiment of a structure diagram of a multi-model collaborative knowledge graph construction system 200, which can be applied to various electronic devices. The multi-model collaborative knowledge graph construction system 200 includes the following modules:

[0141] Routing engine 210, scheduling engine 220, execution engine 230, document processor 231, small model resource pool 232, prompt word template library 233 and large model 234;

[0142] The routing engine 210 is used to receive a knowledge graph construction request, which includes the original document to be processed and the target domain parameters;

[0143] The routing engine 210 is used to match the preset rule base according to the target domain parameters and generate the node component sequence to be called. The node component sequence includes the document parsing module selection, the pre-trained model matching results and the large model intervention conditions;

[0144] The scheduling engine 220 is used to construct a task execution directed acyclic graph based on the node component sequence;

[0145] The execution engine 230 is used to execute the directed acyclic graph according to the task, call the document processor 231 to perform format parsing, text extraction, cleaning and intelligent block operations on the original document, and generate a set of structured document blocks carrying metadata;

[0146] The execution engine calls the pre-trained model in the small model resource pool 232 to extract entities and relationships from the structured document block set, generating a preliminary entity set and an associated relationship set;

[0147] Based on the prompt word templates in the prompt word template library 233, the large model 234 is called to perform attribute completion and implicit relationship reasoning on the preliminary entity set to generate a completed entity attribute set and a newly added relationship set;

[0148] The large model 234 performs entity alignment on the preliminary entity set and the completed entity attribute set based on the prompt word template to generate a fused entity set; performs conflict resolution on the associated relationship set and the newly added relationship set to generate a fused relationship set; and stores the fused entity set and the fused relationship set in the knowledge graph database.

[0149] This paper proposes a multi-model collaborative knowledge graph construction method and system, aiming to improve the automation, accuracy, coverage, and efficiency of knowledge graph construction while optimizing the use of computing resources. The system primarily consists of several core node components and three processing engines, which collaboratively transform raw documents into structured knowledge graphs.

[0150] In the third aspect, the present invention proposes a terminal device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the steps of any of the above-mentioned multi-model collaborative knowledge graph construction methods are implemented.

[0151] In a fourth aspect, the present invention proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned multi-model collaborative knowledge graph construction methods.

[0152] Reference below Figure 3 , which shows a structural diagram of a computer system 300 suitable for implementing a terminal device or server of an embodiment of the present application. Figure 3 The terminal device or server shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0153] like Figure 3As shown, computer system 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage unit 308 into a random access memory (RAM) 303. Various programs and data required for the operation of computer system 300 are also stored in RAM 303. CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to bus 304.

[0154] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, mouse, and the like; an output section 307 including a liquid crystal display (LCD), speakers, and the like; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN card or a modem. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. Removable media 311, such as a magnetic disk, optical disk, magneto-optical disk, or semiconductor memory, is installed in the drive 310 as needed, so that computer programs read from the media can be installed in the storage section 308 as needed.

[0155] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the method illustrated in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via the communication portion 309 and / or installed from removable media 311. When the computer program is executed by the central processing unit (CPU) 301, the functions defined in the methods of this application are performed. It should be noted that the computer-readable medium described herein can be a computer-readable signal medium or a computer-readable medium, or any combination thereof. The computer-readable medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable media include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium may be any tangible medium that contains or stores a program for use by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, embodying computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including, but not limited to, wireless, wire, optical cable, RF, or any suitable combination thereof.

[0156] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as C or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0157] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0158] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention herein is not limited to technical solutions formed by a specific combination of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the aforementioned inventive concept. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A multi-model collaborative knowledge graph construction method, characterized in that: The following steps are involved: S1. The routing engine receives a knowledge graph construction request, which includes the original document to be processed and target domain parameters; S2. The routing engine matches the preset rule library according to the target domain parameters and generates a node component sequence to be called. The node component sequence includes document parsing module selection, pre-trained model matching results, and large model intervention conditions; S3. The scheduling engine constructs a task execution directed acyclic graph according to the node component sequence; S4. The execution engine executes a directed acyclic graph according to the task, performs format parsing, text extraction, cleaning, and intelligent block segmentation on the original document, and generates a set of structured document blocks carrying metadata; The execution engine calls the pre-trained model in the small model resource pool to extract entities and relationships from the structured document block set, generating a preliminary entity set and an associated relationship set; The execution engine, based on the prompt word template and in combination with the relevant text content in the structured document block set, calls the large model to perform attribute completion and implicit relationship reasoning on the preliminary entity set, and generates a completed entity attribute set and a newly added relationship set; S5. The large model performs entity alignment on the preliminary entity set and the completed entity attribute set based on the prompt word template to generate a fused entity set; Perform conflict resolution on the associated relationship set and the newly added relationship set to generate a fused relationship set; S6. Store the fused entity set and the fused relationship set in a knowledge graph database.

2. The multi-model collaborative knowledge graph construction method according to claim 1, characterized in that: In step S4, the execution engine executes the directed acyclic graph according to the task, performs format parsing, text extraction, cleaning, and intelligent block segmentation on the original document, and generates a set of structured document blocks carrying metadata, which specifically includes the following sub-steps: S411: Calling a format-adapted parsing library to perform text extraction and cleaning operations on the original document to obtain a document to be processed; S412: Performing an intelligent block division operation on the document to be processed to obtain document blocks, including: Segment the document to be processed according to natural paragraph boundaries and heading levels; Based on sentence vector similarity or topic model clustering algorithm, semantically coherent text fragments are aggregated into document chunks; Set overlapping text areas of a preset length between adjacent document blocks; S413: Add metadata to each document block to generate a structured document block set, where the metadata includes: an original document identifier, a block identifier, a starting position coordinate in the original text, and information about the chapter to which it belongs.

3. The multi-model collaborative knowledge graph construction method according to claim 1, characterized in that: In step S4, the execution engine calls the pre-trained model in the small model resource pool to extract entities and relationships from the structured document block set, generating a preliminary entity set and a set of associated relationships, which specifically includes the following sub-steps: S421, dynamically loading a pre-trained model that matches the target domain parameters from a small model resource pool according to the task execution directed acyclic graph, wherein the pre-trained model includes a named entity recognition model and a relationship extraction model; S422, traversing the structured document block set, performing entity recognition on each document block using the named entity recognition model, and generating a preliminary entity set including entity text, type, and confidence; Use the relationship extraction model to extract relationships from the extracted entities, generate association relationship triples, form an association relationship set, and record the relationship type and confidence level; S423: If the number of target entity types extracted from a single document block is lower than a preset density threshold, the document block and its associated entities and relationships are eliminated; Entities and relationships with confidence levels lower than a set threshold are eliminated from the preliminary entity set and the relationship set. The threshold is dynamically adjusted according to the processing mode parameter in the user request.

4. The multi-model collaborative knowledge graph construction method according to claim 1, characterized in that: In step S4, the execution engine uses the large model to perform attribute completion and implicit relationship reasoning on the preliminary entity set based on the prompt word template and in combination with the relevant text content in the structured document block set, thereby generating a completed entity attribute set and a newly added relationship set. The specific steps include the following: S431, matching entity attribute completion templates and implicit relationship reasoning templates from a prompt word template library according to the target domain parameters; S432: Dynamically injecting entity text, associated document block content, and overlapping text area context in the preliminary entity set into the selected template to generate structured prompt words; S433: Call the large language model to perform the following operations: Completing the standard name, alias, description and attribute information of the entity based on the structured prompt word, and inferring the implicit relationship between the entities in the preliminary entity set; S434. Parse the results returned by the large model, extract the completed entity attributes to form a completed entity attribute set, and extract the newly added implicit relationships to form a newly added relationship set.

5. The multi-model collaborative knowledge graph construction method according to claim 1, characterized in that: In step S5, the large model performs entity alignment on the preliminary entity set and the completed entity attribute set based on the prompt word template to generate a fused entity set, performs conflict resolution on the associated relationship set and the newly added relationship set to generate a fused relationship set, which specifically includes the following sub-steps: S51. Detecting homonymous entities and synonymous entities in the preliminary entity set and the completed entity attribute set based on entity name similarity and attribute consistency; S52: Calling the large model to perform contextual semantic verification on the entities with the same or different names and synonyms, merging entities pointing to the same real object to generate a fused entity set; S53: Conflict detection is performed on the relationships in the associated relationship set and the newly added relationship set, and conflicting relationships are fused according to the confidence, source reliability and semantic consistency of the relationships to generate a fused relationship set.

6. The multi-model collaborative knowledge graph construction method according to claim 1, characterized in that: In step S3, the scheduling engine constructs a task execution directed acyclic graph based on the node component sequence, which specifically includes the following sub-steps: S31, parsing the node component sequence, identifying each task node in the node component sequence and its execution order dependency; S32. Construct a directed acyclic graph with the node components as vertices of the graph and the execution order dependency as directed edges.

7. The multi-model collaborative knowledge graph construction method according to claim 1, characterized in that: In step S1, it also includes: receiving a knowledge graph construction request, extracting target domain parameters from the knowledge graph construction request, and the target domain parameters include a classification identifier, a knowledge graph structure specification of the expected output, and a processing mode.

8. A multi-model collaborative knowledge graph construction system, characterized by: The system includes: a routing engine, a scheduling engine, an execution engine, a document processor, a small model resource pool, a prompt word template library and a large model; The routing engine is used to receive a knowledge graph construction request, wherein the request includes the original document to be processed and target domain parameters; The routing engine matches the preset rule base according to the target domain parameters to generate a node component sequence to be called, wherein the node component sequence includes document parsing module selection, pre-trained model matching results and large model intervention conditions; The scheduling engine is used to construct a task execution directed acyclic graph according to the node component sequence; The execution engine is used to execute the directed acyclic graph according to the task, call the document processor to perform format parsing, text extraction, cleaning and intelligent block segmentation on the original document, and generate a structured document block set carrying metadata; The execution engine calls the pre-trained model in the small model resource pool to extract entities and relationships from the structured document block set to generate a preliminary entity set and an associated relationship set; The execution engine, based on the prompt word templates in the prompt word template library and in combination with the relevant text content in the structured document block set, calls the large model to perform attribute completion and implicit relationship reasoning on the preliminary entity set, thereby generating a completed entity attribute set and a newly added relationship set; The large model performs entity alignment on the preliminary entity set and the completed entity attribute set based on the prompt word template to generate a fused entity set; performs conflict resolution on the associated relationship set and the newly added relationship set to generate a fused relationship set; and stores the fused entity set and the fused relationship set in a knowledge graph database.

9. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the multi-model collaborative knowledge graph construction method as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the multi-model collaborative knowledge graph construction method as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Party history knowledge base construction method and device, equipment and storage medium

    CN118349685A

  • Intelligent construction method and system for electric power marketing knowledge graph based on large model Agent

    CN119721212A