A knowledge graph construction method based on fine-grained retrieval and reverse restoration self-correction
By employing fine-grained retrieval and reverse reconstruction self-correction methods, dynamically matching reference cases, and introducing a closed-loop feedback mechanism, the robustness and information omission issues in constructing knowledge graphs using large language models are resolved, thereby improving the accuracy and recall of triple extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-08
- Publication Date
- 2026-07-10
Smart Images

Figure CN122364468A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of knowledge graph construction, specifically a knowledge graph construction method based on fine-grained retrieval and reverse reconstruction self-correction. Background Technology
[0002] Knowledge graphs outline the semantic skeleton of information through nodes (entities) and edges (relationships), transforming massive amounts of heterogeneous data into structured networks that computers can understand, enabling machines to perform relational reasoning and deep semantic understanding. Whether it's an intelligent search and question-answering system that provides accurate answers or a personalized recommendation system that mines deep connections, knowledge graphs play a crucial driving role.
[0003] In the current frontier exploration of artificial intelligence, knowledge graphs, as high-quality and traceable prior knowledge bases, can effectively constrain and enhance large language models, providing an indispensable deterministic foundation for retrieval enhancement generation, complex logical reasoning, fine-grained knowledge extraction, and the self-correction mechanism of the system.
[0004] Although knowledge graphs have shown great value in knowledge modeling and application, their construction process is highly dependent on manual labor and faces problems such as high cost and long cycle. Therefore, the automated construction of knowledge graphs is a research direction of common concern to academia and industry.
[0005] Currently, the automated construction of knowledge graphs has evolved through three main stages: First, there are traditional rule-matching methods, where domain experts pre-define extraction rules. While this method boasts high accuracy in specific scenarios, its generalization performance is limited because the rules cannot cover all language patterns. Second, there are deep learning-based methods, which automatically capture features through neural networks. Although this significantly improves extraction efficiency, it often requires massive amounts of labeled data to support model training. With the rise of large language models, automated construction has entered a new stage based on large models. Leveraging their superior information understanding and logical reasoning capabilities, large language models can extract high-quality entities and relationships with only a very small number of labeled samples or even zero samples.
[0006] In practice, this approach mainly involves two strategies:
[0007] One approach is fine-tuning, which involves fine-tuning the large, distilled model for a specific task. While this process requires significant computing power, its ability to support local, private deployment effectively meets the stringent data privacy requirements of government and enterprise clients. Although this method ensures privacy, it still requires a large amount of training data.
[0008] Another approach is based on contextual learning. This method directly calls top-level models and designs sophisticated prompts to guide the model to extract knowledge by mimicking the triple structure in the examples. This approach significantly lowers the technical barrier and greatly improves the flexibility and efficiency of cross-domain construction. However, the reference examples in the context are mostly fixed. When faced with complex and varied specific sentences, the sentence structure or relational types of the reference examples may not match the target sentence. The large model cannot obtain effective contextual guidance, resulting in poor robustness and poor generalization performance in specific domains or complex sentence structures.
[0009] Finally, existing extraction processes are mostly one-way open-loop processes of "text input -> triple output". Due to attention shifts or illusions in large models, hidden triples are easily missed. The lack of verification and feedback nodes makes it difficult to detect and correct omission errors. Summary of the Invention
[0010] This invention addresses the core technical challenges of existing knowledge graph construction techniques using large language models (especially triple extraction), such as poor robustness due to fixed reference cases in prompt words, ineffective long-tail relation extraction, and information omission. It proposes a knowledge graph construction method based on fine-grained retrieval and reverse reconstruction self-correction. This method introduces the RAG concept and closed-loop feedback mechanism into knowledge graph construction, retrieving different reference cases for different sentences. It innovatively reorders the retrieved sentences based on logical relevance and semantic similarity, dynamically matching the most suitable reference case for each sentence. Simultaneously, it introduces a multi-round correction function based on "reverse reconstruction," enhancing the traditional unidirectional "text -> triple" extraction into a closed-loop self-correction system of "text -> triple - text - triple," improving the accuracy and recall of triple extraction while avoiding redundancy.
[0011] The specific steps of the knowledge graph construction method based on fine-grained retrieval and reverse reconstruction self-correction are as follows:
[0012] Step 1: Construct a standard reference case library that includes "reference sentence-standard triplet" pairs, and vectorize all reference sentences to obtain each standard reference vector.
[0013] Refer to the case library to indicate ;
[0014] in Indicates the first One reference sentence, This represents the corresponding set of standard triples.
[0015] Reference Sentence The reference vector refers to the dense feature vector that is mapped to a fixed dimension. :
[0016] Right now , This is a pre-trained text embedding model.
[0017] Step 2: For the unstructured long text to be tested, decompose it into a set of independent sentences to be processed; vectorize each sentence to obtain its own query feature vector.
[0018] For the sentence to be processed The text is vectorized using a text embedding model X to obtain the query feature vector. ;
[0019]
[0020] Step 3: Calculate the similarity score between the query feature vector and each standard reference vector, sort them in descending order of score, and recall the top feature vectors with the highest similarity. A standard reference case.
[0021] Step 4: Translate the sentence Inputting into a large language model, and using prompts containing filtered reference cases, extracting sentences. It contains non-standard logical relationships;
[0022] Logical relation expressions include relational predicates in natural language forms such as "possess", "work for", and "belong to".
[0023] The specific selection process for the reference cases is as follows:
[0024] First, initialize and set the logical relationship set. Uncovered relation set and the set of covered relationships Set the target iteration count to 1. .
[0025] in, For the front The set of all logical relationships in a standard reference case;
[0026] "Uncovered set of relations" Initially "Set of Covered Relationships" Initially empty;
[0027] For the first iteration, from the previous Candidate criterion cases are selected by iterating through the standard reference cases. And calculate its three-dimensional multidimensional score tuples. ;
[0028] Specifically:
[0029] Step 401, through candidate standard cases The set of logical relationships contained therein Calculate the number of elements that intersect with the current "uncovered relation set" to obtain the incremental contribution. : ;
[0030] Step 402, extract the logical relationship of the corresponding intersection from the set Delete;
[0031] Step 403, calculate the set of logical relations. The redundancy penalty term is obtained by taking the negative of the number of elements in the intersection with the "covered relation set". : ;
[0032] In the first iteration, this penalty term It is an empty set;
[0033] Step 404, set Add the deleted logical relationship to the collection middle;
[0034] Step 405: Calculate candidate standard cases and sentences. The vector similarity score yields the context matching degree. ;
[0035] For the second iteration, from the previous Candidate criterion cases are selected by iterating through the standard reference cases. And calculate its three-dimensional multidimensional score tuples. ;
[0036] Repeat the process for the 3rd, 4th, ... iterations until the maximum number of iterations is reached. In order of priority: Compare and select the ones that meet the requirements. The index of each standard reference case is added to the "Selected List".
[0037] The number of prompt words that include the standard reference case.
[0038] Step 5: Transform all non-standard logical relations into relation feature vectors of the same dimension as the standard relations preset in the knowledge graph; calculate the cosine similarity between the non-standard logical relations and the feature vectors of all standard relations, sort them in descending order, and retain the top-P preset standard relations with the highest similarity as candidate mappings.
[0039] Step Six: Translate the sentence The candidate mappings corresponding to all non-standard logical relations in the sentence are summarized to obtain the sentence. A standardized "list of potential logical relationships" is generated, and a multi-round greedy reordering algorithm is used, combining logical relationships with vector similarity, from the previous... Selected from standard reference cases indivual;
[0040] The specific filtering process is similar to the process of filtering prompts containing reference cases, the difference being: [The text abruptly ends here, likely due to an incomplete sentence or a formatting error.] For sentences A set of "potential logical relationships";
[0041] Step 7: Process the current sentence to be processed. , and the selected By concatenating several reference cases, a context-guided input large language model is obtained. This model performs initial triple extraction, outputting an initial set of entity and relation triples. .
[0042] Step 8: Large Language Model Based on Relational Triple Set Reverse reconstruction of text in natural language form and the sentence to be processed. Perform a semantic comparison to determine if any information is missing. If so, proceed to step nine; otherwise, retain the set of relation triples. Proceed to step ten;
[0043] Missing information includes: omitted entities, implicit logical relationships, key modifying adjectives, or time.
[0044] Step 9: Targeting the text The missing information in the sentence is used to process the current sentence using a large language model. Perform the second triplet extraction to generate a new set of triplets. and the set of relation triples Merging The input is then deduplicated by using a large language model.
[0045] Step 10: Return to Step 3, select the next sentence to be processed, repeatedly obtain its "potential logical relation list", and use the large language model to output the corresponding set of relation triples;
[0046] Step 11: Construct the final knowledge graph using the set of relation triples of all sentences to be processed from the input unstructured long text.
[0047] The advantages of this invention are:
[0048] 1. Significantly enhanced robustness: Through fine-grained retrieval and relation reordering, the model can obtain the most suitable reference cases regardless of the domain or complex sentence structure, overcoming the performance fluctuations caused by fixed prompt words.
[0049] 2. Significantly improved extraction accuracy: Tests show that this method improves the core evaluation metrics by 3-4 percentage points compared to the current best baseline model.
[0050] 3. Extremely low knowledge omission rate: The pioneering forward and reverse comparison self-correction mechanism effectively detects and supplements long-tail information that is difficult to find in a single extraction, greatly improving the completeness of the knowledge map construction. Attached Figure Description
[0051] Figure 1 This is a flowchart of a knowledge graph construction method based on fine-grained retrieval and reverse reconstruction self-correction according to the present invention; Detailed Implementation
[0053] To facilitate understanding and implementation of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are merely some, not all, embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort should fall within the scope of protection of the present invention.
[0054] This invention proposes a knowledge graph construction method based on fine-grained retrieval and reverse reconstruction self-correction. It addresses the challenge of overcoming the limitations of static prompts to achieve dynamic and accurate historical triple extraction case matching for sentences to be extracted, while ensuring the completeness and accuracy of triple extraction through a self-correction mechanism. This method breaks away from the limitations of traditional fixed reference cases by employing a two-stage refined retrieval process of "vector initial detection + logical relation reordering" to dynamically match the optimal reference case for each sentence. Furthermore, after triple extraction, a comparative verification mechanism of "triple reverse reconstruction of sentences" is introduced to supplement missing information and achieve final deduplication and merging, thereby significantly improving the robustness and recall of knowledge graph construction.
[0055] The knowledge graph construction method based on fine-grained retrieval and reverse reconstruction self-correction, such as Figure 1 As shown, the specific steps are as follows:
[0056] Step 1: Construct a standard reference case library that includes "reference sentence-standard triplet" pairs using existing public datasets, and use a pre-trained text embedding model X to vectorize all reference sentences to obtain each standard reference vector.
[0057] Refer to the case library to indicate ;
[0058] in Indicates the first One reference sentence, This represents the corresponding set of standard triples.
[0059] Reference Sentence The reference vector refers to the dense feature vector that is mapped to a fixed dimension. :
[0060] Right now , This is a pre-trained text embedding model.
[0061] Step 2: For the unstructured long text input during the knowledge graph construction process, use a natural language processing toolkit to decompose it into a set of independent sentences to be processed.
[0062] Step 3: For the sentence to be processed The text is vectorized using a text embedding model X to obtain the query feature vector. ;
[0063]
[0064] Step 4: Calculate the query feature vector The similarity scores with each standard reference vector are sorted in descending order of score, and the top vectors with the highest similarity are recalled. A standard reference case.
[0065] For query feature vectors With standard reference vector The cosine similarity between them is calculated as follows:
[0066]
[0067] in, This represents the dimension of the text feature vector. and These represent the query feature vectors respectively. and standard reference vector In the Feature values in each dimension.
[0068] Step 5: Translate the sentence Input the sentence into a large language model, and guide it with prompts containing reference examples to deeply analyze the contextual semantics of the sentence, extracting the sentence in an open-ended manner. It contains non-standard logical relationships;
[0069] Logical relation expressions include relational predicates in natural language forms such as "possess", "work for", and "belong to".
[0070] The specific filtering process for prompt words is as follows:
[0071] First, initialize and set the logical relationship set. Uncovered relation set and the set of covered relationships Set the number of iterations to [number]. .
[0072] in, For the front The set of all logical relationships in a standard reference case;
[0073] "Uncovered set of relations" Initially "Set of Covered Relationships" Initially empty;
[0074] For the first iteration, from the previous Candidate criterion cases are selected by iterating through the standard reference cases. And calculate its three-dimensional multidimensional score tuples. ;
[0075] Specifically:
[0076] Step 501, through candidate standard cases The set of logical relationships contained therein Calculate the number of elements that intersect with the current "uncovered relation set" to obtain the incremental contribution. : ;
[0077] Step 502, extract the logical relationship of the corresponding intersection from the set Delete;
[0078] Step 503, calculate the set of logical relations. The redundancy penalty term is obtained by taking the negative of the number of elements in the intersection with the "covered relation set". : ;
[0079] In the first iteration, this penalty term It is an empty set;
[0080] Step 504, set Add the deleted logical relationship to the collection middle;
[0081] Step 505: Calculate candidate standard cases and sentences. The vector similarity score yields the context matching degree. ;
[0082] For the second iteration, from the previous Candidate criterion cases are selected by iterating through the standard reference cases. And calculate its three-dimensional multidimensional score tuples. ;
[0083] Repeat the process for the 3rd, 4th, ... iterations until the maximum number of iterations is reached. In order of priority: Compare and select the ones that meet the requirements. The index of each standard reference case is added to the "Selected List".
[0084] The number of prompt words that include the standard reference case.
[0085] When each standard reference case When they are equal, compare the reference cases of each standard. When the standard reference case When they are equal, compare the reference cases of each standard. Filter by order from highest to lowest.
[0086] Step 6: Input all non-standard logical relations and the standard relations preset by the knowledge graph into the text embedding model X respectively to transform them into relation feature vectors of the same dimension;
[0087] The standard relation set is Non-standard logical relationships The transformed relational feature vector is ;gather The Middle The relation feature vector transformed from the standard relation is: .
[0088] Step 7: Targeting the relation feature vector Calculate the cosine similarity between the feature vectors of the mapping and all standard relations, sort them in descending order, and retain the top-P pre-defined standard relations with the highest similarity as candidate mappings.
[0089] The formula for cosine similarity is:
[0090]
[0091] Step 8: Translate the sentence The candidate mappings corresponding to all non-standard logical relations in the sentence are summarized to obtain the sentence. A standardized "list of potential logical relationships".
[0092] Step Nine: Sentence-Based The "list of potential logical relationships" utilizes a triplet scoring mechanism. A multi-round greedy reordering algorithm, combining logical relationships and vector similarity, reorders the first... Perform dual-feature re-ranking on standard reference cases and filter out... The most valuable comprehensive reference case;
[0093] The specific process is as follows:
[0094] Step 901: Perform state initialization.
[0095] Let the sentence be The set of "potential logical relationship list" is Define the "uncovered set of relations". Initially "Set of Covered Relationships" Initially empty; simultaneously, the target iteration number is set to... .
[0096] Step 902: For the first iteration, from the previous... Candidate criterion cases are selected by iterating through the standard reference cases. And calculate its three-dimensional multidimensional score tuples. ;
[0097] Step 9021, through candidate standard cases The set of logical relationships contained therein Calculate the number of elements that intersect with the current "uncovered relation set" to obtain the incremental contribution. : ;
[0098] Step 9022, extract the logical relationship of the corresponding intersection from the set Delete;
[0099] Step 9023, calculate the set of logical relations. The redundancy penalty term is obtained by taking the negative of the number of elements in the intersection with the "covered relation set". : ;
[0100] In the first iteration, this penalty term It is an empty set;
[0101] Step 9024, set Add the deleted logical relationship to the collection middle;
[0102] Step 9025: Calculate candidate standard cases and sentences. The vector similarity score yields the context matching degree. ;
[0103] Step 903: For the second iteration, from the previous... Candidate criterion cases are selected by iterating through the standard reference cases. And calculate its three-dimensional multidimensional score tuples. ;
[0104] Step 904: Repeat step 903, performing the 3rd, 4th, ... iterations until the number of iterations reaches M, in order of priority: The comparison is performed, and the indexes of the top N standard reference cases that meet the requirements are added to the "selected list".
[0105] After completing a single round of traversal, the system uses lexicographical comparison to compare all candidate cases. A rigorous comparison was conducted: when each standard reference case... When they are equal, compare the reference cases of each standard. When the standard reference case When they are equal, compare the reference cases of each standard. Filter in descending order.
[0106] Step 10: Process the current sentence to be processed. , and the selected By concatenating several reference cases, a context-guided input large language model is obtained. This model performs initial triple extraction, outputting an initial set of entity and relation triples. .
[0107] Step 11: Large Language Model Based on Relational Triple Set Reverse reconstruction of text in natural language form and the sentence to be processed. Perform a semantic comparison to determine if any information is missing. If so, proceed to step 12; otherwise, retain the set of relation triples. Proceed to step fourteen;
[0108] Missing information includes: omitted entities, implicit logical relationships, key modifying adjectives, or time.
[0109] Step 12: Targeting the text The missing information in the sentence is used to process the current sentence using a large language model. Perform the second triplet extraction to generate a new set of triplets. .
[0110] The constraints for the secondary extraction are as follows:
[0111] When specifying a relational predicate for a new triple, the standard relation set list must be queried first. Only when the semantics of the missing information are consistent with A new relationship is only allowed when there are significant differences between the two.
[0112] By using prompt words to enforce normative constraints, the large language model is forced to output the supplementary extracted results in standard JSON format. .
[0113] Step 13: Set the relation triples and the set of new triples Merging The data is then input into a large language model for deduplication.
[0114] The deduplication rules are as follows:
[0115] Based on the original sentence, establish the factual boundaries. Referencing the expression styles of the Top-N reference cases, [the following is done / does not occur]. Redundant triples are deduplicated.
[0116] Filter out extractable items that do not match or are irrelevant to the original sentence; merge semantically similar synonyms; remove fragmented segments that belong to more complete triples.
[0117] Step fourteen: Return to step three, select the next sentence to be processed, repeatedly obtain its "potential logical relation list", and use the large language model to output the corresponding set of relation triples;
[0118] Step 15: Construct the final knowledge graph using the set of relation triples of all sentences to be processed from the input unstructured long text. Example
[0119] Step 1: Vectorization and fine-grained preliminary retrieval of the reference case library;
[0120] First, construct a reference case library that covers high-quality "sentence-standard triple" pairs in the domain; then, select a pre-trained text embedding model (such as Qwen3-Embedding, llama-embed-nemotron, Octen-Embedding) to map all reference sentences in the library into dense feature vectors of fixed dimensions.
[0121] To meet the high-concurrency, low-latency retrieval requirements of massive reference cases, high-performance vector database technologies such as FAISS (Facebook AISimilarity Search) are adopted. An efficient underlying index is built based on feature vectors to achieve persistent storage of vector data and the construction of a fast retrieval engine.
[0122] In the actual knowledge graph construction process, after receiving the input unstructured long text, the system first uses a natural language processing toolkit to precisely decompose it into a set of independent sentences to be processed. For any given sentence... Similarly, the text embedding model described above is used to encode it to obtain the query feature vector. Subsequently, cosine similarity or other distance metric algorithms are used to calculate in the global reference feature space. With each reference case vector in the case library Spatial similarity score between them.
[0123] After calculating the similarity score using the above formula, the system sorts the results in descending order of score, initially truncating and recalling the top results with the highest similarity. One (Top-M) reference case.
[0124] Step 2: Extracting logical relationships based on a large language model.
[0125] To compensate for the shortcomings of single-vector retrieval in understanding complex sentence structures, this stage introduces a large language model to perform in-depth logical feature analysis and standardized mapping of the sentences to be processed.
[0126] Specifically, the sentence to be processed is first taken as input, and the large language model is guided by specific prompt words to deeply analyze the contextual semantics of the sentence and extract the potential logical relationship expressions contained in the sentence in an open form (for example, extracting relational predicates in natural language forms such as "possess", "employed in", "belong to").
[0127] To ensure the accuracy of relation extraction in large language models, prompt words need to include specific reference cases. Since the logical relation expressions directly extracted by large language models are often arbitrary and suffer from synonym overload, they cannot be directly applied to structured knowledge graphs. Therefore, they need to be aligned with predefined standard relation schemas.
[0128] Let the pre-defined set of standard relation categories for the knowledge graph be... The non-standard logical relation extracted by the large language model is The system calls the text embedding model again, and... as well as Each standard relation label in the vector is transformed into a relation feature vector of the same dimension, denoted as follows: and Subsequently, for each extracted non-standard logical relationship... Calculate its eigenvector Relationship vectors with all preset standard vectors The cosine similarity between them is calculated; the similarity scores are then sorted in descending order, and the system assigns each extracted [score / value] to a specific value. Accurately retrieve and retain the top-2 pre-defined standard relationships with the highest similarity as candidate mappings.
[0129] Finally, the Top-2 standard relation labels corresponding to all extracted relations in the current sentence to be processed are summarized (if multiple relations are included, their union is taken), thus obtaining the normalized "potential logical relation list" of the sentence to be processed. This list transforms the originally unstructured text semantics into a graph structure feature that can be quantified and matched, laying the foundation for subsequent case re-ranking.
[0130] Step 3: Combine logical relationships and vector similarity for dual-feature reordering.
[0131] The aim is to accurately select from the top-M reference cases of the initial recall. (of which) The cases with the highest comprehensive value are selected to build high-quality dynamic reference cases.
[0132] It should be noted that the reference case selection algorithm described in this step is not only used for triple extraction in the subsequent step 4, but also applied in step 2 (using this algorithm to provide diverse and comprehensive reference cases for the large model).
[0133] Specifically, this invention designs a triplet-based scoring mechanism. Multi-round greedy reordering algorithm:
[0134] First, perform state initialization. Let the set of target logical relations that the sentences to be processed need to cover be... (This set is derived from the output of step 2). Define the "uncovered relation set". (Initial state) In step 2 Initially, this consists of the set of all relations in all reference cases, and the "set of covered relations". (Initially an empty set) At the same time, the total number of reference cases selected for the target selection is set to be [number missing]. .
[0135] Subsequently, the system executes The system iterates through the Top-M list of candidate reference cases that have not yet been selected, and selects each candidate case in an iterative selection process. Calculate a multidimensional rating tuple containing three dimensions. ;
[0136] Core metric: Extracting candidate cases The set of logical relationships contained therein The number of intersection elements between the candidate case and the current "uncovered relationship set" is calculated. This indicator quantifies how many new logical relationships that the current candidate case can bring to the target task that are "urgently needed but not yet acquired".
[0137] Diversity index: Calculates the set of logical relationships among candidate cases. The negative number of the intersection with the "set of covered relations" will result in a severe negative penalty if the candidate case contains a large number of relations covered by the selected case, thereby forcing the system to select differentiated cases and avoid redundant prompt information.
[0138] Context matching: The cosine similarity score of the vector space between the candidate case and the sentence to be processed is directly reused to ensure that when the contribution of logical relationship is the same, the case with language expression that is closer to the current sentence is selected first.
[0139] After completing a single round of traversal, the system uses lexicographical comparison to compare all candidate cases. A rigorous comparison will be performed: the comparison priorities are as follows: The system selects the case with the highest overall score (i.e., the largest tuple value) and adds its index to the "Selected List." Finally, a status update is performed. The relations contained in the best case of this round are removed from the "Uncovered Relationship Set." Remove from the list and simultaneously merge into the "covered relationship set". The system iteratively executes the above evaluation and update process. The final output of the Top-N reference cases, based on text similarity, maximizes the deduplication coverage of the target logical relationships, greatly improving the robustness and accuracy of context learning in large language models.
[0140] Step 4: Preliminary triple extraction and inverse loop closure supplementation based on dynamic context.
[0141] This step aims to extract triples from the target sentence using the high-quality reference cases retrieved in the previous step, and to perform gap filling through an unsupervised feedback mechanism to maximize the information recall rate.
[0142] In the initial triple extraction stage, the system extracts the original sentences to be processed. The model then structurally combines the top-N high-quality reference cases selected through multi-dimensional re-sorting in step 3 to construct a highly matched contextual guide. Afterward, the large language model performs its first information extraction task, outputting a preliminary set of entity and relation triples, denoted as... .
[0143] To overcome potential information omissions in large language models, the system obtains... Subsequently, an "unsupervised graph audit module" is used, which requires no reference cases (zero-shot) and relies entirely on the internal logical reasoning of the large model. The system issues strict instruction configurations and executes the following audit logic in sequence.
[0144] Restricted reverse reconstruction: requires the large language model to be based solely on the currently extracted preliminary set of triples. Reverse engineering to generate a reconstructed text in natural language form This step restores discrete triples to coherent text for easier modal comparison.
[0145] Fine-grained difference comparison: System-guided large language model for "reconstructing text" "and "original unprocessed sentence" "Deep semantic alignment and cross-validation are performed, and the model autonomously analyzes and locates..." It exists in, but is not reflected in. Fragments of specific factual information (such as omitted entities, implicit logical relationships, key modifying adjectives, or time attributes).
[0146] Constrained Supplement Extraction: For the identified missing factual information, the large language model performs targeted secondary extraction to generate a new set of triples. .
[0147] To ensure the consistency of the graph structure, the system sets strict "relation anchoring rules". When specifying relation predicates for new triples, the system must first query the preset standard relation set list. Only when the semantics of the missing information are consistent with A new relationship is only allowed when there are significant differences between the two.
[0148] Finally, the system enforces normalization instructions to force the large language model to output the supplementary extraction results in standard JSON format. This completes a closed loop of data flow: "preliminary extraction - reverse verification - difference discovery - supplementary extraction".
[0149] Step 5: Global ternary combination and deduplication to prevent redundancy.
[0150] In obtaining the initial extracted triples Triples extracted by reverse supplementation Then, the two parts are merged into a set of triples. To prevent the same objective fact from being extracted repeatedly due to generation bias in the reverse reconstruction stage of the large language model, this step uses the large language model to perform global deduplication and normalization operations.
[0151] Specifically, the system assembles the "original sentence to be processed," the "merged set of triples," and the "selected Top-N reference cases" into a refined prompt word input large language model. The large language model establishes the true fact boundary based on the original sentence, strictly refers to the relational norms and expression styles shown in the Top-N reference cases, performs a global review of the redundant triple set, filters out erroneous extraction items that are inconsistent with or irrelevant to the original sentence, merges semantically similar synonyms into a unified standard relation identifier, and automatically identifies and removes fragmented segments that belong to a more complete subset of triples.
[0152] Ultimately, the large language model outputs a set of simplified triples that are globally deduplicated, relationally normalized, and factually accurate using a standardized data structure, thus completing the end-to-end construction of high-quality knowledge graph data.
[0153] The key innovations and technical points of this invention are as follows:
[0154] This invention performs initial vector screening of unstructured text; it calls a large language model to extract potential logical relationships and aligns them with preset standard relationships; it greedily reorders the initially screened cases based on logical relationship coverage and text similarity; it uses high-value cases after reordering to guide the initial extraction of triples; then it reverse-reconstructs sentences through the large model and compares the differences to supplement missing information from zero samples; finally, it completes global deduplication and merging based on the large language model and dynamic reference cases.
[0155] In the retrieval enhancement generation process, in order to overcome the blind spot of single vector similarity retrieval in terms of semantic structure, the "logical relationship standardization alignment" technology is introduced: a technical solution that uses a large language model to openly extract the potential logical relationship of a sentence, and calculates the cosine similarity of the feature vectors of the extracted relationship and the preset standard relationship set to accurately recall and map the Top-P standard relationship labels for the sentence to be processed.
[0156] By constructing a multi-dimensional scoring tuple that includes "incremental contribution (i.e., the number of new logical relationships provided)," "redundancy penalty (i.e., the opposite of the number of duplicate relationships with the selected cases)," and "contextual matching degree (i.e., text cosine similarity)," and using multi-round iteration and lexicographical comparison rules, a reordering strategy is adopted to maximize the coverage of target logical relationships while suppressing information redundancy, thereby accurately selecting the Top-N reference cases.
[0157] The unsupervised "gap filling" closed-loop feedback network connected after knowledge extraction is a technical solution that forces the large language model to generate reconstructed text in reverse based only on the initially extracted triples under information isolation; then cross-validates the reconstructed text with the original input text to autonomously locate missing facts (such as entities, implicit relations, and time modifiers); and under the constraint of forcibly prioritizing the query of a preset standard relation set, performs secondary extraction of missing information.
[0158] After completing the initial extraction and supplementary extraction, a graph merging technique with redundancy prevention and refinement is used with a large language model: the top-N reference cases selected by multidimensional reordering are used as normalization reference paradigms to guide the large language model to establish the factual boundaries of the original sentences. This is not only used to merge synonyms and filter erroneous facts, but also to automatically identify and remove fragmented segments that belong to more complete triplet subsets, and finally output a standard and concise triplet set.
Claims
1. A knowledge graph construction method based on fine-grained retrieval and reverse reconstruction self-correction, characterized in that, Includes the following steps: Step 1: Construct a standard reference case library using existing public datasets, and use a pre-trained text embedding model X to vectorize all reference sentences to obtain each standard reference vector. Step 2: Decompose the unstructured long text S to be tested into a set of independent sentences to be processed. For each sentence to be processed, use the text embedding model X to vectorize it and obtain its respective query feature vector. Step 3: Target the sentence to be processed. Calculate its query feature vector Similarity scores with each standard reference vector are calculated and sorted in descending order, recalling the top vectors with the highest similarity. One standard reference case; Step 4: Translate the sentence Input the sentence into a large language model, and guide it to analyze the contextual semantics of the sentence using prompt words containing standard reference cases, extracting the sentence in an open-ended manner. It contains non-standard logical relationships; Non-standard logical relations include relational predicates in natural language forms such as "possess", "work for", and "belong to". Step 5: Input all non-standard logical relations into the text embedding model X and transform them into relation feature vectors of the same dimension as the preset standard relations; Step 6: For a single non-standard logical relation transformed into a relation feature vector, calculate its cosine similarity with the feature vectors of all standard relations, sort them in descending order, and retain the Top-P preset standard relations with the highest similarity as candidate mappings; Step 7: Translate the sentence The candidate mappings corresponding to all non-standard logical relations in the sentence are summarized to obtain the sentence. A standardized "list of potential logical relationships"; and the use of a triplet scoring mechanism. A multi-round greedy reordering algorithm, combining logical relationships and vector similarity, reorders the first... Perform dual-feature re-ranking on standard reference cases and filter out... The most comprehensive and valuable standard reference case; Step 8: Translate the sentence With the selected By concatenating several standard reference cases, a context-guided input large language model is obtained. Initial triple extraction is then performed, outputting an initial set of entity and relation triples. ; Step 9: Large Language Model Based on Relational Triple Set Reverse reconstruction of text in natural language form and with sentences Perform a semantic comparison to determine if any information is missing. If so, proceed to step ten; otherwise, retain the set of relation triples. Proceed to step eleven; Step 10: Targeting the text Missing information in the sentence, using a large language model to analyze the sentence Perform the second triplet extraction to generate a new set of triplets. and the set of relation triples Merging Input the data into a large language model for deduplication; Step 11: Return to Step 3, select the next sentence to be processed, repeatedly obtain its "potential logical relation list", and use the large language model to output the corresponding relation triple set until all sentences to be processed have been processed. Step 12: Using the set of relation triples of all sentences to be processed, construct the final knowledge graph of the unstructured long text S to be tested.
2. The method as described in claim 1, characterized in that, In step one, the reference case library is represented. ;in Indicates the first One reference sentence, This represents the corresponding set of standard triples; Reference Sentence The reference vector refers to the dense feature vector that is mapped to a fixed dimension. : Right now , This is a pre-trained text embedding model.
3. The method as described in claim 2, characterized in that, In step three, the feature vector is queried. With standard reference vector The cosine similarity between them is calculated as follows: in, This represents the dimension of the text feature vector. and These represent the query feature vectors respectively. and standard reference vector In the Feature values in each dimension.
4. The method as described in claim 1, characterized in that, Step five includes the specific filtering process for prompt words in the standard reference cases, which is similar to the process in step seven. Perform dual-feature re-ranking on standard reference cases and filter out... The process is the same for all standard reference cases; specifically as follows: First, initialize the system by setting up sets of logical relationships. Uncovered relation set and the set of covered relationships ; In the specific filtering of prompt words containing standard reference cases, the following is assumed: The set of all logical relationships in the standard reference cases is ; Forward Perform dual-feature re-ranking on standard reference cases and filter out... In the process of establishing a standard reference case, sentences are set. The set of "potential logical relationship list" is ; Define a set The initial value is ;gather Initially empty; simultaneously, the target iteration number is set to... ; Then, for the first iteration, from the previous Candidate criterion cases are selected by iterating through the standard reference cases. And calculate its three-dimensional multidimensional score tuples. ; Specifically: Step 501, through candidate standard cases The set of logical relationships contained therein Calculate the number of elements in the intersection between the current "uncovered relation set" and the original set to obtain the incremental contribution. : ; Step 502, extract the logical relationship of the corresponding intersection from the set Delete; Step 503, calculate the set of logical relations. The redundancy penalty term is obtained by taking the negative of the number of elements in the intersection with the "covered relation set". : ; In the first iteration, this penalty term It is an empty set; Step 504, set Add the deleted logical relationship to the collection middle; Step 505: Calculate candidate standard cases and sentences. The vector similarity score yields the context matching degree. ; Next, regarding the second iteration, from the previous... Candidate criterion cases are selected by iterating through the standard reference cases. And calculate its three-dimensional multidimensional score tuples. ; Repeat this process for the 3rd, 4th, and so on, until the number of iterations reaches the target. In order of priority: Compare and select the ones that meet the requirements. One or before The index of each standard reference case is added to the "Selected List"; The number of prompt words that include the standard reference case.
5. The method as described in claim 4, characterized in that, When each standard reference case When they are equal, compare the reference cases of each standard. When the standard reference case When they are equal, compare the reference cases of each standard. Filter in descending order.
6. The method as described in claim 1, characterized in that, In step nine, the missing information includes: omitted entities, implicit logical relationships, key descriptive adjectives, or time.
7. The method as described in claim 1, characterized in that, In step ten, the second triplet extraction must meet the following constraints: When specifying a relational predicate for a new triple, the standard relation set list is queried first. Only when the semantics of the missing information are consistent with A new relationship is only allowed when the differences exceed a set threshold; By using prompt words to enforce normative constraints, the large language model is forced to output the supplementary extracted results in standard JSON format. .
8. The method as described in claim 1, characterized in that, In step ten, the deduplication rule is as follows: Based on the original sentence, establish factual boundaries: refer to the selected... The presentation style of each reference case, on Redundant triplet sets are deduplicated; Filter out extractable items that do not match or are irrelevant to the original sentence; merge semantically similar synonyms; remove fragmented segments that belong to more complete triples.