Knowledge graph construction method and system based on LLM multi-task iterative prompt

By adopting the LLM-based multi-task iterative prompt method in the entity relationship extraction task, the problem of difficulty in capturing the global context and insufficient accuracy in the existing technology is solved, and more efficient and accurate entity relationship extraction is achieved, which improves the quality of knowledge graph construction.

CN119670861APending Publication Date: 2025-03-21QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411727749.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The prior art is difficult to capture the global context when dealing with long-term dependencies between entities, and uses a single prompt project to complete the entity relationship extraction task, ignoring the illusion phenomenon of large language models and the influence of noisy nodes, resulting in insufficient accuracy of entity relationship extraction.

Method used

The multi-task iteration prompt method based on LLM is adopted, and the entity relationship extraction task is divided into multiple subtasks (text segmentation, entity marking, entity relationship extraction, implicit relationship prediction and entity relationship semantic merging), and the multi-task iteration method is better established, eliminated noise nodes, and improved the accuracy of entity relationship extraction.

Benefits of technology

It effectively improves the accuracy of entity relationship extraction, reduces the impact of false entity relationships and noise nodes, enhances information sharing and transmission between multitasks, and improves the quality of knowledge graph construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119670861A_ABST
    Figure CN119670861A_ABST
Patent Text Reader

Abstract

The invention provides a knowledge graph construction method and system based on LLM multi-task iterative prompt. The method comprises the steps of obtaining an industry document to be subjected to entity relationship extraction; performing entity relationship extraction on the industry document through a fine-tuned large language model in combination with preset prompt information to obtain extracted entities and relationships; wherein the extraction task of the entity relationship is divided into a text segmentation sub-task, an entity marking sub-task, an entity relationship extraction sub-task, an implicit relationship prediction sub-task and an entity relationship semantic merging sub-task, and each sub-task is realized through a fine-tuned large language model; each subtask is iteratively executed for a preset number of times to obtain a task result; and performing triple construction based on the obtained entities and relationships to obtain the industry knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of entity relationship extraction, and in particular relates to a knowledge graph construction method and system based on LLM multi-task iterative prompting. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Entity relationship extraction is an important task in the field of natural language processing and an effective way to build structured knowledge from unstructured text. In recent years, entity relationship extraction technology has been widely used in many fields, such as the construction of industry knowledge graphs. However, as documents become larger and more information becomes available, the performance and parameter count of current models cannot extract entity relationships more accurately.

[0004] In the early days, researchers used graph neural networks for entity relationship extraction. For example, Sun et al. designed a model based on graph neural network relation spiral operation, which can fully predict the relationship between entities. Su i et al. designed an entity relationship extraction model based on graph neural network, which effectively captures the information interaction between nodes in the graph structure through information transmission and aggregation mechanism. Although the above models have achieved good results, it is difficult for these models to capture the global context when dealing with long-term dependencies between entities.

[0005] In recent years, some researchers have used hint engineering and fine-tuning techniques to guide large language models to extract entity relations. For example, Wang et al. applied GPT-3.5 to the named entity recognition task, converting it into a sequence tagging task that is more acceptable to large language models. Xu et al. used a special hint engineering to guide GPT-3.5 to extract document-level entity relations. However, these methods usually use a single hint engineering to complete the entity relationship extraction task, ignoring the hallucination phenomenon of the large language model itself, and do not reduce the impact of noise nodes. At the same time, traditional hint engineering methods cannot better establish the relationship between multiple tasks, resulting in more information cannot be better shared and transmitted between multiple tasks. Summary of the invention

[0006] The present invention provides a knowledge graph construction method and system based on LLM multi-task iterative prompts to solve the problem that traditional methods are difficult to capture the global context when dealing with long-term dependencies between entities, and that traditional methods use a single prompt project to complete the entity relationship extraction task, ignoring the hallucination phenomenon of the large language model itself and the influence of noise nodes, resulting in insufficient accuracy in entity relationship extraction.

[0007] According to a first aspect of an embodiment of the present invention, a method for constructing a knowledge graph based on LLM multi-task iterative prompts is provided, comprising:

[0008] Obtain industry documents for entity relationship extraction;

[0009] For the industry documents, entity relationships are extracted by combining a fine-tuned large language model with preset prompt information to obtain extracted entities and relationships; wherein the entity relationship extraction task is divided into a text segmentation subtask, an entity tagging subtask, an entity relationship extraction subtask, an implicit relationship prediction subtask, and an entity relationship semantic merging subtask, each of which is implemented by a fine-tuned large language model, and each subtask is iterated a preset number of times to obtain the task result;

[0010] Triples are constructed based on the obtained entities and relationships to obtain the industry knowledge graph.

[0011] Furthermore, the entity relationship extraction task specifically executes the following processing procedures: based on the industry document and the pre-constructed first prompt information, the document is segmented by a fine-tuned large language model to obtain segmented text blocks and text block summaries; based on the obtained text blocks, text block summaries and the pre-constructed second prompt information, the entities in each text block are labeled by a fine-tuned large language model to obtain entity-marked text blocks; based on the obtained entity-marked text blocks and the pre-constructed third prompt information, entities and initial relationships are extracted by a fine-tuned large language model; based on the extracted entities and the pre-constructed fourth prompt information, implicit relationships between entities are predicted by a fine-tuned large language model; semantic merging of entities and relationships is performed on the obtained entities, initial relationships, implicit relationships and the pre-constructed fifth prompt information by a fine-tuned large language model to obtain merged entities and relationships.

[0012] Furthermore, for the text segmentation subtask, the generation of the text block summary is specifically performed using the following formula:

[0013] u i =summarization_task(u i-i ,v i-1 )

[0014] Among them, u i represents the summary of the i-th text block, summarization_task represents the task function for generating the summary of the text block, and v i Represents the i-th text block.

[0015] Furthermore, for the implicit relationship prediction subtask, the prediction of the implicit relationship is specifically as follows: a similarity matrix is ​​constructed based on the distance between each entity in the text block, and an implicit relationship between two entities is determined based on the similarity between the entities.

[0016] Furthermore, for the entity-relationship semantic merging subtask, its semantic merging needs to satisfy that both the similarity between entities and the similarity between relationships meet a preset threshold.

[0017] Furthermore, for the text segmentation subtask, the first prompt information is specifically expressed as follows: input data: text data to be segmented; instruction: execute text segmentation; background: subject type to which the text data to be segmented belongs; output data: text block and text block summary; for the entity labeling subtask, the second prompt information is specifically expressed as follows: input data: text block; instruction: entity labeling; background: text block summary; output data: text block after entity labeling; for the entity relationship extraction subtask, the third prompt information is specifically expressed as follows: input data: text block after entity labeling; instruction: entity and initial relationship extraction; background: text block; output data: entity and relationship; for the implicit relationship prediction subtask, the fourth prompt information is specifically expressed as follows: input data: entity; instruction: implicit relationship prediction; background: entity labeling label; output data: implicit relationship; for the entity relationship semantic merging subtask, the fifth prompt information is specifically expressed as follows: input data: entity, initial relationship and implicit relationship; instruction: semantic merging of entity relationships; background: entity labeling label; output data: merged entity and relationship.

[0018] Furthermore, the entity relationship extraction task also includes a group disambiguation subtask for eliminating ambiguous entities and relationships, a self-verification subtask for eliminating erroneous entities and relationships, and a hierarchical construction subtask for forming structured triples, wherein each subtask is implemented through a fine-tuned large language model, and each subtask is iterated a preset number of times to obtain the task result.

[0019] According to a second aspect of an embodiment of the present invention, a knowledge graph construction system based on LLM multi-task iterative prompts is provided, comprising:

[0020] A data acquisition unit, which is used to acquire industry documents to be extracted from entity relationships;

[0021] An entity relationship extraction unit is used to extract entity relationships from the industry document through a fine-tuned large language model combined with preset prompt information to obtain extracted entities and relationships; wherein the entity relationship extraction task is divided into a text segmentation subtask, an entity tagging subtask, an entity relationship extraction subtask, an implicit relationship prediction subtask, and an entity relationship semantic merging subtask, each of which is implemented through a fine-tuned large language model, and each subtask is iterated a preset number of times to obtain a task result;

[0022] The knowledge graph construction unit is used to construct triples based on the obtained entities and relationships to obtain the industry knowledge graph.

[0023] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored and running on the memory, wherein when the processor executes the program, the method for constructing a knowledge graph based on LLM multi-task iterative prompts is implemented.

[0024] According to a fourth aspect of an embodiment of the present invention, a non-transitory computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for constructing a knowledge graph based on LLM multi-task iterative prompts is implemented.

[0025] One or more of the above technical solutions have the following beneficial effects:

[0026] The present invention provides a knowledge graph construction method and system based on LLM (i.e. large language model) multi-task iterative prompting. The scheme guides the large language model to extract entity relationships at the document level through the method of multi-task iterative prompting engineering. By dividing the entity relationship extraction task into several subtasks, the relationship between multiple tasks is better established for each subtask by combining the multi-task iterative method, ensuring that each task can obtain the best result, and effectively improving the extraction accuracy of entity relationships.

[0027] In the text segmentation, the solution of the present invention provides sufficient contextual semantics through summary information of text blocks, thereby reducing the situation of separation of related entities.

[0028] The solution of the present invention effectively eliminates false entity relationships and noise nodes through entity relationship semantic merging, group disambiguation and self-verification subtasks, and further improves the accuracy of entity relationship extraction.

[0029] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0031] Figure 1 A flow chart of a knowledge graph construction method based on LLM multi-task iterative prompting described in an embodiment of the present invention;

[0032] Figure 2 Schematic diagram of the text segmentation subtask described in an embodiment of the present invention;

[0033] Figure 3 Schematic diagram of fine-tuning described in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0035] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.

[0036] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0037] Terminology explanation:

[0038] LLM: Large Language Model l, which is a model based on machine learning and natural language processing technologies.

[0039] In one or more embodiments, Figure 1 As shown, an embodiment of the present invention provides a knowledge graph construction method based on LLM multi-task iterative prompts, including:

[0040] Step 1: Obtain industry documents for entity relationship extraction;

[0041] Step 2: For the industry document, extract entity relationships through a fine-tuned large language model combined with preset prompt information to obtain extracted entities and relationships. The entity relationship extraction task is divided into text segmentation subtask, entity tagging subtask, entity relationship extraction subtask, implicit relationship prediction subtask and entity relationship semantic merging subtask. Each subtask is implemented through a fine-tuned large language model, and each subtask is iterated for a preset number of times to obtain the task result;

[0042] In a specific implementation, the entity relationship extraction task specifically performs the following processing procedures: based on the industry document and the pre-constructed first prompt information, the document is segmented by a fine-tuned large language model to obtain segmented text blocks and text block summaries; based on the obtained text blocks, text block summaries and the pre-constructed second prompt information, the entities in each text block are labeled by a fine-tuned large language model to obtain entity-marked text blocks; based on the obtained entity-marked text blocks and the pre-constructed third prompt information, entities and initial relationships are extracted by a fine-tuned large language model; based on the extracted entities and the pre-constructed fourth prompt information, implicit relationships between entities are predicted by a fine-tuned large language model; semantic merging of entities and relationships is performed on the obtained entities, initial relationships, implicit relationships and the pre-constructed fifth prompt information by a fine-tuned large language model to obtain merged entities and relationships.

[0043] In the specific implementation, for the text segmentation subtask, the generation of the text block summary is specifically performed according to the following formula:

[0044] u i =summarization_task(u i-1 ,v i-1 )

[0045] Among them, u i represents the summary of the i-th text block, summarization_task represents the task function for generating the summary of the text block, and v i Represents the i-th text block.

[0046] In a specific implementation, for the implicit relationship prediction subtask, the prediction of the implicit relationship is specifically: constructing a similarity matrix based on the distance between each entity in the text block, and determining the implicit relationship between two entities based on the similarity between the entities.

[0047] In a specific implementation, for the entity relationship semantic merging subtask, its semantic merging needs to satisfy that both the similarity between entities and the similarity between relationships meet a preset threshold.

[0048] In specific implementation, the scheme described in this embodiment extracts entity relationships by using a large language model and prompt engineering. The scheme uses the powerful performance and modeling capabilities of the large language model to extract entity relationships at the document level. By dividing the traditional entity relationship extraction task into several subtasks, the relationship between multiple tasks is better established through a multi-task iteration method to ensure that each subtask can obtain the best result. At the same time, the scheme described in this embodiment gradually eliminates the interference of noise nodes on the overall task through entity relationship semantic merging subtasks, group disambiguation subtasks and self-verification subtasks, further ensuring the accuracy of entity relationship extraction. The following is a detailed description of each subtask of entity relationship extraction:

[0049] Text segmentation subtask: It is used to obtain the documents for entity relationship extraction and perform text segmentation. After the segmentation, each text block is integrated with the summary prompt and then input into the entity labeling subtask;

[0050] Among them, for the text segmentation subtask, the first prompt information is specifically expressed as follows: input data: text data to be segmented; instruction: execute text segmentation; background: subject type to which the text data to be segmented belongs; output data: text block and text block summary;

[0051] Specifically, the text segmentation subtask is as follows: Figure 2 As shown, by adding repeated windows between adjacent text blocks, the probability of separation of related entities is reduced, and the summary hint of the previous text block is fused to provide contextual semantics.

[0052] u i =summarization_task(u i-1 ,v i-1 )

[0053] Among them, u i represents the summary of the i-th text block, summarization_task represents the task function for generating the summary of the text block, and v i Represents the i-th text block.

[0054] It should be noted here that the above formula will be input into the large model in the form of text description as an instruction in the prompt information.

[0055] Entity labeling subtask: It is used to obtain the text block to be recognized, convert it into a sequence labeling task, and recognize and label the entities in the text;

[0056] Among them, for the entity labeling subtask, the second prompt information is specifically expressed as follows: input data: text block; instruction: entity labeling; background: text block summary; output data: text block after entity labeling;

[0057] Specifically, the entity tagging subtask uses prompt engineering to convert the named entity recognition task into a sequence annotation task. The description instruction of this task consists of three parts. The first part is to tell the large language model that the input text is a constant and use language knowledge to generate output. The second part is to guide the large language model to identify and tag entities in a given text. For each input text, it is necessary to traverse all entity tags, generate prompts N times, and each iteration corresponds to a different entity type. The third part is an iteration instruction, which iteratively optimizes the second part to find the most appropriate category for each labeled entity.

[0058] Entity relationship extraction subtask: It is used to extract the identified entities and relationships and classify them according to the tags;

[0059] Among them, for the entity relationship extraction subtask, the third prompt information is specifically expressed as follows: input data: text block after entity labeling; instruction: entity and initial relationship extraction; background: text block; output data: entity and relationship;

[0060] Specifically, the entity relationship extraction subtask uses a detailed prompting project to guide the large language model to extract labeled entities and relations. Using an iterative extraction method, in each iteration, triples are extracted by focusing on different entities and relations. In this stage, the text block set is used as a constraint to extract entities and relations in the text until all entities and relations in the text block set are traversed.

[0061] Implicit relationship prediction subtask: It is used to obtain the vector representation of the entity, build a similarity matrix for the extracted entity based on the distance in the text, and predict the implicit relationship between entities;

[0062] Among them, for the implicit relationship prediction subtask, the fourth prompt information is specifically expressed as follows: input data: entity; instruction: implicit relationship prediction; background: label of entity mark; output data: implicit relationship;

[0063] Specifically, the implicit relationship prediction subtask constructs a similarity matrix based on the distance between each entity in the text, the entity vector representation is calculated by calculating the average of all entity mentions, and the representation of the mention is the average of all mentions embedded therein.

[0064]

[0065]

[0066] Among them, x i is the embedding representation of entity i, Represents entity x i The kth mention, n represents entity x iThe number of times it was mentioned, is the embedding representation of the rth token and z is the number of token mentions.

[0067] In a specific implementation, the similarity matrix is ​​constructed based on a prompt engineering method, which uses text description instructions to guide a large language model to construct a similarity matrix based on the distance between each entity in the text.

[0068] Entity-relation semantic merging subtask: It is used to merge entities and relations based on their similarity scores;

[0069] For the entity relationship semantic merging subtask, the fifth prompt information is specifically expressed as follows: input data: entity, initial relationship and implicit relationship; instruction: semantic merging of entity relationship; background: label of entity mark; output data: merged entity and relationship.

[0070] Specifically, the entity relationship semantic merging subtask calculates the similarity scores of entities and relationships and normalizes them in the range of [0, 1]. The closer the similarity score is to 1, the more likely it is to be merged. The calculation process is as follows:

[0071] E n (i, j) = θ·E i,j +μ·S i,j

[0072] R e (i, j) = γ·R i,j +δ·T i,j

[0073] Among them, E n Represents the similarity score of the entity, R e Represents the similarity score of the relationship, E i,j Represents the similarity between entities, R i,j Indicates the similarity between relationships. Among them, the parameters θ+μ=1, Y+δ=1. After multiple verifications and adjustments, we finally determined θ=0.45, μ=0.55, Y=0.35, δ=0.65. The standard used is E n (i, j) ≥ 0.9 and R e (i, j) ≥ 0.8, indicating that related entities and relations can be merged, S i,j represents the label similarity between entities, T i,j is the similarity between triples, where the similarity is calculated using cosine similarity.

[0074] Step 3: Construct triples based on the obtained entities and relationships to obtain the industry knowledge graph.

[0075] In one or more embodiments, the entity relationship extraction task also includes a group disambiguation subtask for eliminating ambiguous entities and relationships, a self-verification subtask for eliminating erroneous entities and relationships, and a hierarchical construction subtask for forming structured triples, wherein each subtask is implemented through a fine-tuned large language model, and each subtask is iterated a preset number of times to obtain the task result.

[0076] Specifically, the group disambiguation subtask is used to eliminate ambiguous entities and relationships by adding fact-checking commands to the prompt project of the module to verify the merged entities and relationships. Before traversing all entities and relationships, the model is required to return a subset of entities and relationships to further eliminate erroneous entities and relationships.

[0077] The self-verification subtask is used to solve the hallucination problem of the large language model itself. By prompting the verification instructions in the project, the model is prompted to verify whether these entities are accurate and give a simple "yes" or "no" response, thereby eliminating the erroneous entities and relations generated by the large language model.

[0078] The hierarchical construction subtask uses rich entity categories and appropriate relationship descriptions to establish appropriate connections between different entities and relationships to form structured triple groups.

[0079] It should be noted here that the group disambiguation subtask, self-verification subtask and hierarchy construction subtask are all implemented through the large language model. In the specific implementation, the prompt information of the group disambiguation subtask is a fact-checking command, for example: whether the entity belongs to this set; the principle of the self-verification subtask is the same as above, and a verification instruction is added to the prompt information to verify whether the extracted entity is accurate; the prompt information of the hierarchy construction subtask is: establish a structured triple group based on the connection between entities and relationships.

[0080] In a specific implementation, the large language model used in this embodiment is specifically Flan-T5.

[0081] Furthermore, for fine-tuning the large language model, this embodiment adopts P-Tuning V2 fine-tuning, such as Figure 3 As shown in Figure 1, a multi-task learning method is used for each task layer of different modules in the model to obtain more learnable parameters while reducing parameter redundancy.

[0082] In one or more implementations, corresponding to the method in the above embodiment, this embodiment provides a knowledge graph construction system based on LLM multi-task iterative prompts, including:

[0083] A data acquisition unit, which is used to acquire industry documents to be extracted from entity relationships;

[0084] An entity relationship extraction unit is used to extract entity relationships from the industry document through a fine-tuned large language model combined with preset prompt information to obtain extracted entities and relationships; wherein the entity relationship extraction task is divided into a text segmentation subtask, an entity tagging subtask, an entity relationship extraction subtask, an implicit relationship prediction subtask, and an entity relationship semantic merging subtask, each of which is implemented through a fine-tuned large language model, and each subtask is iterated a preset number of times to obtain a task result;

[0085] The knowledge graph construction unit is used to construct triples based on the obtained entities and relationships to obtain the industry knowledge graph.

[0086] It should be noted here that each module in this embodiment corresponds to each step in Example 1 one by one, and the specific implementation process is the same, which will not be repeated here.

[0087] In further embodiments, there is also provided:

[0088] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, no further description is given here.

[0089] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0090] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0091] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the method described in embodiment 1 is completed.

[0092] The method in the first embodiment can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0093] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in the present embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0094] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A knowledge graph construction method based on LLM multi-task iterative prompts, characterized in that: include: Obtain industry documents for entity relationship extraction; For the industry documents, entity relationships are extracted by combining a fine-tuned large language model with preset prompt information to obtain extracted entities and relationships; wherein the entity relationship extraction task is divided into a text segmentation subtask, an entity tagging subtask, an entity relationship extraction subtask, an implicit relationship prediction subtask, and an entity relationship semantic merging subtask, each of which is implemented by a fine-tuned large language model, and each subtask is iterated a preset number of times to obtain the task result; Triples are constructed based on the obtained entities and relationships to obtain the industry knowledge graph.

2. The knowledge graph construction method based on LLM multi-task iterative prompting as claimed in claim 1, characterized in that: The entity relationship extraction task specifically performs the following processing: based on the industry document and the pre-constructed first prompt information, the document is segmented by a fine-tuned large language model to obtain segmented text blocks and text block summaries; based on the obtained text blocks, text block summaries and the pre-constructed second prompt information, the entity in each text block is labeled by a fine-tuned large language model to obtain entity-labeled text blocks; Based on the obtained entity-tagged text blocks and the pre-built third prompt information, entities and initial relations are extracted through the fine-tuned large language model; Based on the extracted entities and the pre-built fourth prompt information, the implicit relationship between entities is predicted through the fine-tuned large language model; The obtained entities, initial relations, implicit relations and pre-constructed fifth prompt information are semantically merged through the fine-tuned large language model to obtain merged entities and relations.

3. The knowledge graph construction method based on LLM multi-task iterative prompting as claimed in claim 2, characterized in that: For the text segmentation subtask, the generation of the text block summary is performed according to the following formula: u i =summarization_task(u i-1 ,v i-1 ) Among them, u i represents the summary of the i-th text block, summarization_task represents the task function for generating the summary of the text block, and v i Represents the i-th text block.

4. The knowledge graph construction method based on LLM multi-task iterative prompting as claimed in claim 2, characterized in that: For the implicit relationship prediction subtask, the prediction of the implicit relationship is specifically as follows: constructing a similarity matrix based on the distance between each entity in the text block, and determining the implicit relationship between two entities based on the similarity between the entities.

5. The knowledge graph construction method based on LLM multi-task iterative prompting as claimed in claim 2, characterized in that: For the entity-relationship semantic merging subtask, its semantic merging needs to satisfy that both the similarity between entities and the similarity between relationships meet the preset threshold.

6. The knowledge graph construction method based on LLM multi-task iterative prompting as claimed in claim 2, characterized in that: For the text segmentation subtask, the first prompt information is specifically expressed as follows: input data: text data to be segmented; instruction: perform text segmentation; background: the subject type to which the text data to be segmented belongs; output data: text block and text block summary; for the entity labeling subtask, the second prompt information is specifically expressed as follows: input data: text block; Instruction: entity tag; background: text block summary; output data: text block after entity tagging; for the entity relationship extraction subtask, the third prompt information is specifically expressed as follows: input data: text block after entity tagging; instruction: entity and initial relationship extraction; background: text block; output data: entity and relationship; for the implicit relationship prediction subtask, the fourth prompt information is specifically expressed as follows: input data: entity; instruction: implicit relationship prediction; background: entity tag label; output data: implicit relationship; for the entity relationship semantic merging subtask, the fifth prompt information is specifically expressed as follows: input data: entity, initial relationship and implicit relationship; Instruction: semantic merging of entity relations; Background: labels for entity annotations; Output data: merged entities and relations.

7. The knowledge graph construction method based on LLM multi-task iterative prompting as claimed in claim 1, characterized in that: The entity relationship extraction task also includes a group disambiguation subtask for eliminating ambiguous entities and relationships, a self-verification subtask for eliminating erroneous entities and relationships, and a hierarchical construction subtask for forming structured triples, wherein each subtask is implemented through a fine-tuned large language model, and each subtask is iterated a preset number of times to obtain the task result.

8. A knowledge graph construction system based on LLM multi-task iterative prompts, characterized in that: include: A data acquisition unit, which is used to acquire industry documents to be extracted from entity relationships; An entity relationship extraction unit is used to extract entity relationships from the industry document through a fine-tuned large language model combined with preset prompt information to obtain extracted entities and relationships; wherein the entity relationship extraction task is divided into a text segmentation subtask, an entity tagging subtask, an entity relationship extraction subtask, an implicit relationship prediction subtask, and an entity relationship semantic merging subtask, each of which is implemented through a fine-tuned large language model, and each subtask is iterated a preset number of times to obtain a task result; The knowledge graph construction unit is used to construct triples based on the obtained entities and relationships to obtain the industry knowledge graph.

9. An electronic device comprising a memory, a processor and a computer program stored and running on the memory, characterized in that: When the processor executes the program, it implements a knowledge graph construction method based on LLM multi-task iterative prompts as described in any one of claims 1-7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a knowledge graph construction method based on LLM multi-task iterative prompts is implemented as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Document element rapid extraction system based on pre-training large model

    CN121189458A

  • Voice service interaction method and device, storage medium and electronic equipment

    CN121354564A

  • A voice service interaction method and device, a storage medium and an electronic device

    CN121354564B