Text abstract generation method and device based on semantic map and real-time fact checking
By constructing a dynamic semantic graph and performing real-time verification and correction, the shortcomings of large language models in terms of factual accuracy, logical coherence, and controllability are addressed, thus achieving high-quality text summarization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNITECHS
- Filing Date
- 2025-12-19
- Publication Date
- 2026-05-01
AI Technical Summary
Existing large language models have shortcomings in terms of factual accuracy, logical coherence, real-time performance, and controllability when generating text, especially in areas such as news summarization, report writing, and knowledge base construction.
A text summarization generation method based on semantic graph and real-time fact-checking is adopted. By constructing an initial semantic graph and fusing it with an external knowledge graph, a multi-dimensional dynamic weighting algorithm is applied to generate a multi-level dynamic semantic graph, extracting causal chains, temporal chains and logical reasoning chains, and performing real-time verification and correction during the generation process. A pre-trained large-scale generative model is used for controlled text generation.
It achieves the generation of text summaries that are free of illusions, factually accurate, logically coherent, and highly controllable, ensuring that the generated content is strictly consistent with the factual blueprint and logical framework, and preventing the generation of false information.
Smart Images

Figure CN121958542A_ABST
Abstract
Description
A method and apparatus for text summarization based on semantic graphs and real-time fact verification Technical Field
[0001] This invention relates to the field of text generation using large language models (LLM), and in particular to a method and apparatus for text summarization based on semantic graphs and real-time fact checking. Background Technology
[0002] Current Large Language Models (LLMs) have demonstrated unprecedented fluency and semantic understanding capabilities in text generation; however, their inherent limitations are becoming increasingly apparent, especially in professional applications where high accuracy, logical rigor, and controllability are required. The main pain points of existing Large Language Models are as follows:
[0003] (1) Factual accuracy: Existing large language models often rely on statistical patterns rather than factual verification when generating content, which can easily produce seemingly reasonable but contradictory "illusions". This seriously restricts their application in news summarization, report writing and knowledge base construction.
[0004] (2) Logical coherence: Traditional large language models often struggle to maintain coherent logic and consistent expression when generating long texts or processing complex information. They are prone to problems such as loss of contextual information, logical jumps, or self-contradictions, especially when dealing with complex reasoning relationships such as causality and temporal sequence.
[0005] (3) Real-time: The knowledge base of existing large language models is usually fixed on the deadline of its training data, which cannot reflect the latest events, data or dynamic changes in a timely manner, making it easy to provide outdated or erroneous information when dealing with time-sensitive topics.
[0006] (4) Controllability: When using large language models, users often find it difficult to precisely control the specific style, focus or content structure of the generated text, resulting in deviations between the generated results and the user's expectations. Summary of the Invention
[0007] To address the main pain points of existing large language models in terms of factual accuracy, logical coherence, real-time performance, and controllability, this invention provides a text summarization method and apparatus based on semantic graphs and real-time fact verification.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] In one embodiment of the present invention, a text summarization generation method based on semantic graphs and real-time fact verification is proposed, the method comprising:
[0010] Extract key information from multiple input sources and construct an initial semantic graph G. ISG ;
[0011] The initial semantic map G ISG It integrates with external knowledge graphs and applies a multi-dimensional dynamic weighting algorithm to generate a multi-level dynamic semantic graph (DSG).
[0012] The causal chain, temporal chain, and logical reasoning chain are extracted from the dynamic semantic graph DSG and encoded into structured planning instructions to explicitly guide text generation.
[0013] A pre-trained large-scale generative model is used to generate controlled text under the deep guidance of the planning instructions through customized attention and Logit correction mechanisms.
[0014] During the text generation process, each generated text unit is checked in real time from multiple dimensions, and a real-time correction mechanism is triggered when any inconsistency is found in any dimension.
[0015] Furthermore, the initial semantic map G ISG It integrates with external knowledge graphs and applies a multi-dimensional dynamic weighting algorithm to generate multi-level dynamic semantic graphs (DSGs), including:
[0016] The initial semantic map G ISG It is integrated with the large-scale general knowledge graph Wikidata to supplement background knowledge and verify facts. The integrated graph is denoted as... ;
[0017] exist Based on the input information, including source files, user instructions, structured knowledge base fragments, and real-time API data, as well as the specific requirements of the generation task, a dynamic weighting algorithm based on an attention mechanism is used to generate the fused graph. Each node in and each edge Assign real-time dynamic weights The weight calculation formula is as follows:
[0018]
[0019] in, Represents the weight of timeliness. Represents the weight of context relevance. Represents the weight of factual stability. Represents the fused spectrum Any node or edge in the array; For predefined weighting coefficients, satisfying These weighting coefficients are determined through pre-training on datasets containing different task preferences;
[0020] Based on the calculated dynamic weights Value, pair Filtering and hierarchical division are performed to form a multi-level dynamic semantic graph (DSG), including a fact layer, a concept layer, a causal relationship layer, and a temporal relationship layer.
[0021] Furthermore, causal chains, temporal chains, and logical reasoning chains are extracted from the Dynamic Semantic Graph (DSG) and encoded into structured planning instructions to explicitly guide text generation, including:
[0022] A graph attention model (GAT) is used, which is trained on the dynamic semantic graph (DSG) to learn node embeddings that can capture node structure information and dynamic weights. The input of the graph attention model GAT is the initial feature vector of the node in the dynamic semantic graph (DSG). The neighbor information is aggregated through a multi-layer attention mechanism to obtain the context-aware embedding of each node.
[0023] Based on the task target embedding vector encoded from the user instructions in the input information, the cosine similarity between the final embedding of all nodes in the Dynamic Semantic Graph (DSG) and the task target embedding is calculated, and nodes with similarity higher than a threshold are selected. The nodes, including all their first-degree neighbors and their connecting edges, form a core-related subgraph. ;
[0024] Based on the core related subgraph The causal chain, temporal chain, and logical reasoning chain are explicitly extracted. All extracted causal chains, temporal chains, and logical reasoning chains are encoded, and the dynamic weights of the nodes involved in the chains are used as the basis for the encoding. Based on the average value and the length of the chain, all chains are prioritized.
[0025] The highest priority The chains described above are combined into a structured sequence of planning instructions.
[0026] Furthermore, a pre-trained large-scale generative model is employed, deeply guided by the planning instructions, to perform controlled text generation through customized attention and Logit correction mechanisms, including:
[0027] We employ a pre-trained large generative model T5-XXL and adapt its architecture to Decoder-only mode;
[0028] A planning instruction attention module is introduced into the self-attention layer of the pre-trained T5-XXL model in Decoder-only mode. This planning instruction attention module embeds the encoded planning instruction as an additional key-value sequence; for the query vector of the current decoding step... The pre-trained T5-XXL model in Decoder-only mode calculates the generated text history. attention It also supports parallel computing and planning instructions. attention The final context vector It is the weighted sum of the two:
[0029]
[0030] Wherein the fusion coefficient This indicates that historically generated content dominates the integration process, and the planning instructions provide important supplementary guidance.
[0031] Based on the entities, relationships, and events explicitly mentioned in the planning instructions and the key facts in the dynamic semantic graph (DSG), a vocabulary bias dictionary is dynamically constructed. In each decoding step, after the pre-trained T5-XXL model in Decoder-only mode generates the non-standardized probability Logit for the next text unit, the Logit value for words highly relevant to the content of the planning instructions is multiplied by an enhancement factor. For terms that explicitly contradict the content of the planning instructions, their Logit value is multiplied by a penalty factor. ;
[0032] The pre-trained T5-XXL model in Decoder-only mode generates text using a beam search method under the constraints described above, with the beam width set to [value missing]. In each decoding step, the one with the highest probability is selected. The sequence of text units continues to expand; each generated text unit is immediately subject to real-time fact-checking.
[0033] Furthermore, during the text generation process, each generated text unit undergoes multi-dimensional real-time verification, and a real-time correction mechanism is triggered when any inconsistency is detected in any dimension, including:
[0034] Each time the pre-trained T5-XXL model in Decoder-only mode generates a text unit The text unit and before A text fragment composed of generated text units Three-dimensional verification is conducted, including internal consistency verification, external fact verification, and logical consistency verification.
[0035] Each generated text unit is verified through a real-time fact-checking module. Calculate a comprehensive confidence level If the internal consistency check results are inconsistent, If the external fact-checking results are inconsistent, If the logical consistency check results are inconsistent... ;in It is a predefined penalty coefficient;
[0036] If the calculated comprehensive confidence level Below the preset threshold , will generate the current step In the Logit distribution, this leads to inconsistencies in the text units. The Logit value multiplied by a very small inhibition factor Perform strong suppression, then resample a text unit from the corrected Logit distribution. ;
[0037] If resampling If the text unit fails to pass the verification after this step, the currently generated text unit is cancelled. And backtrack to the previous generation step Logit correction and text unit sampling are performed again; simultaneously, in the generation step after backtracking... In this context, the penalty factor is increased to address the inconsistencies in the chain. The backtracking depth is limited to step;
[0038] For specific planning instruction fragments that frequently cause inconsistencies during continuous generation, reduce their corresponding fusion coefficient. And adjust the enhancement factor of its corresponding Logit. The fusion coefficient mentioned after successfully generating a piece of text and the enhancement factor Automatically restores to the initial value.
[0039] In one embodiment of the present invention, a text summarization generation device based on semantic graphs and real-time fact verification is also proposed, the device comprising:
[0040] The input parsing and preprocessing module is used to receive multi-source input, perform standardized preprocessing, and extract key information from the preprocessed text.
[0041] The initial semantic graph construction module is used to integrate the extracted key information and construct the initial semantic graph G. ISG ;
[0042] The dynamic semantic graph construction module is used to construct the initial semantic graph G. ISG It integrates with external knowledge graphs and applies a multi-dimensional dynamic weighting algorithm to generate a multi-level dynamic semantic graph (DSG).
[0043] The logic chain extraction and planning instruction generation module is used to extract causal chains, temporal chains and logical reasoning chains from the dynamic semantic graph DSG, and encode them into structured planning instructions to explicitly guide text generation.
[0044] The text generation module is used to generate controlled text using a pre-trained large-scale generative model, guided by the planning instructions, through a customized attention and Logit correction mechanism.
[0045] The real-time fact-checking module is used to perform multi-dimensional real-time checks on each generated text unit during the text generation process, and to trigger a real-time correction mechanism when any inconsistency is found in any dimension.
[0046] Furthermore, the dynamic semantic graph construction module is specifically used for:
[0047] The initial semantic map G ISG It is integrated with the large-scale general knowledge graph Wikidata to supplement background knowledge and verify facts. The integrated graph is denoted as... ;
[0048] exist Based on the input information, including source files, user instructions, structured knowledge base fragments, and real-time API data, as well as the specific requirements of the generation task, a dynamic weighting algorithm based on an attention mechanism is used to generate the fused graph. Each node in and each edge Assign real-time dynamic weights The weight calculation formula is as follows:
[0049]
[0050] in, Represents the weight of timeliness. Represents the weight of context relevance. Represents the weight of factual stability. Represents the fused spectrum Any node or edge in the array; For predefined weighting coefficients, satisfying These weighting coefficients are determined through pre-training on datasets containing different task preferences;
[0051] Based on the calculated dynamic weights Value, pair Filtering and hierarchical division are performed to form a multi-level dynamic semantic graph (DSG), including a fact layer, a concept layer, a causal relationship layer, and a temporal relationship layer.
[0052] Furthermore, the logic chain extraction and planning instruction generation module is specifically used for:
[0053] A graph attention model (GAT) is used, which is trained on the dynamic semantic graph (DSG) to learn node embeddings that can capture node structure information and dynamic weights. The input of the graph attention model GAT is the initial feature vector of the node in the dynamic semantic graph (DSG). The neighbor information is aggregated through a multi-layer attention mechanism to obtain the context-aware embedding of each node.
[0054] Based on the task target embedding vector encoded from the user instructions in the input information, the cosine similarity between the final embedding of all nodes in the Dynamic Semantic Graph (DSG) and the task target embedding is calculated, and nodes with similarity higher than a threshold are selected. The nodes, including all their first-degree neighbors and their connecting edges, form a core-related subgraph. ;
[0055] Based on the core related subgraph The causal chain, temporal chain, and logical reasoning chain are explicitly extracted. All extracted causal chains, temporal chains, and logical reasoning chains are encoded, and the dynamic weights of the nodes involved in the chains are used as the basis for the encoding. Based on the average value and the length of the chain, all chains are prioritized.
[0056] The highest priority The chains described above are combined into a structured sequence of planning instructions.
[0057] Furthermore, the text generation module is specifically used for:
[0058] We employ a pre-trained large generative model T5-XXL and adapt its architecture to Decoder-only mode;
[0059] A planning instruction attention module is introduced into the self-attention layer of the pre-trained T5-XXL model in Decoder-only mode. This planning instruction attention module embeds the encoded planning instruction as an additional key-value sequence; for the query vector of the current decoding step... The pre-trained T5-XXL model in Decoder-only mode calculates the generated text history. attention It also supports parallel computing and planning instructions. attention The final context vector It is the weighted sum of the two:
[0060]
[0061] Wherein the fusion coefficient This indicates that historically generated content dominates the integration process, and the planning instructions provide important supplementary guidance.
[0062] Based on the entities, relationships, and events explicitly mentioned in the planning instructions and the key facts in the dynamic semantic graph (DSG), a vocabulary bias dictionary is dynamically constructed. In each decoding step, after the pre-trained T5-XXL model in Decoder-only mode generates the non-standardized probability Logit for the next text unit, the Logit value for words highly relevant to the content of the planning instructions is multiplied by an enhancement factor. For terms that explicitly contradict the content of the planning instructions, their Logit value is multiplied by a penalty factor. ;
[0063] The pre-trained T5-XXL model in Decoder-only mode generates text using a beam search method under the constraints described above, with the beam width set to [value missing]. In each decoding step, the one with the highest probability is selected. The sequence of text units continues to expand; each generated text unit is immediately subject to real-time fact-checking.
[0064] Furthermore, the real-time fact-checking module is specifically used for:
[0065] Each time the pre-trained T5-XXL model in Decoder-only mode generates a text unit The text unit and before A text fragment composed of generated text units Three-dimensional verification is conducted, including internal consistency verification, external fact verification, and logical consistency verification.
[0066] For each of the generated text units Calculate a comprehensive confidence level If the internal consistency check results are inconsistent, If the external fact-checking results are inconsistent, If the logical consistency check results are inconsistent... ;in It is a predefined penalty coefficient;
[0067] If the calculated comprehensive confidence level Below the preset threshold , will generate the current step In the Logit distribution, this leads to inconsistencies in the text units. The Logit value multiplied by a very small inhibition factor Perform strong suppression, then resample a text unit from the corrected Logit distribution. ;
[0068] If resampling If the text unit fails to pass the verification after this step, the currently generated text unit is cancelled. And backtrack to the previous generation step Logit correction and text unit sampling are performed again; simultaneously, in the generation step after backtracking... In this context, the penalty factor is increased to address the inconsistencies in the chain. The backtracking depth is limited to step;
[0069] For specific planning instruction fragments that frequently cause inconsistencies during continuous generation, reduce their corresponding fusion coefficient. And adjust the enhancement factor of its corresponding Logit. The fusion coefficient mentioned after successfully generating a piece of text and the enhancement factor Automatically restores to the initial value.
[0070] In one embodiment of the present invention, a computer device is also proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it realizes the aforementioned text summarization generation based on semantic graph and real-time fact verification.
[0071] In one embodiment of the present invention, a computer-readable storage medium is also proposed, which stores a computer program that performs text summarization generation based on semantic graphs and real-time fact-checking.
[0072] Beneficial effects:
[0073] 1. Construction and Multi-Dimensional Weighting Mechanism of Dynamic Semantic Graph (DSG): This invention dynamically integrates an initial semantic graph with an external knowledge base and introduces a multi-dimensional dynamic weighting algorithm based on timeliness, contextual relevance, and factual stability. This assigns a real-time importance weight to each information point in the graph and constructs multiple layers, including a factual layer, a conceptual layer, a causal relationship layer, and a temporal relationship layer, providing highly customized, constantly updated, and accurate factual evidence for subsequent generation processes.
[0074] 2. Explicit Logical Chain Extraction and Planning Instruction Generation: This invention innovatively extracts causal chains, temporal chains, and logical reasoning chains from a dynamic semantic graph. These chains constitute the "logical skeleton" of the generated text. These chains are encoded as structured "planning instructions," serving as the core guide for the generation model. This ensures the logical rigor and coherence of the generated content, avoiding the shortcomings of traditional large models in complex logical reasoning.
[0075] 3. Deep Integration of Planning Instructions and Controlled Decoding Mechanism: In the text generation stage, this invention not only uses planning instructions as simple input prefixes, but also deeply integrates planning instructions into the decoding process of the generation model through a custom attention mechanism and a Logit correction mechanism. This ensures that the model is strongly constrained and guided by planning instructions at each generation step, significantly improving the consistency between the generated content and the preset logic and facts.
[0076] 4. Integrated Real-Time Fact Checking and Correction Loop: This invention implements a real-time feedback mechanism of "generating, verifying, and correcting simultaneously," which is crucial to preventing illusions. By performing three-dimensional checks on each generated text unit—internal consistency, external factual consistency, and logical consistency—and combining correction measures such as Logit resampling, conditional backtracking, and dynamic fine-tuning of planning instructions, it can immediately intervene and correct inconsistencies upon discovery, eliminating the generation of false information at its source. Attached Figure Description
[0077] Figure 1 is a schematic diagram of the text summarization generation method based on semantic graph and real-time fact verification of the present invention;
[0078] Figure 2 is a schematic diagram of the workflow of the real-time fact-checking module of the present invention;
[0079] Figure 3 is a schematic diagram of the execution flow of the real-time correction mechanism of the present invention;
[0080] Figure 4 is a schematic diagram of the text summarization generation device based on semantic graph and real-time fact verification of the present invention;
[0081] Figure 5 is a schematic diagram of the computer device structure of the present invention. Detailed Implementation
[0082] The principles and spirit of the present invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided merely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.
[0083] Those skilled in the art will recognize that embodiments of the present invention can be implemented as an apparatus, device, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0084] According to an embodiment of the present invention, a text summarization method based on semantic graphs and real-time fact-checking is proposed. This method aims to achieve a text generation scheme that is free of illusions, factually accurate, logically coherent, and highly controllable. Its core lies in constructing a comprehensive "fact blueprint" and implementing a real-time feedback mechanism of "generating, verifying, and correcting simultaneously." The entire scheme can be summarized into the following interconnected stages:
[0085] (1) Key information is parsed and extracted from multi-source inputs (including raw text, user instructions, structured knowledge and real-time API data) to identify core elements such as entities, relationships, events and coreferences, and an initial semantic graph is constructed based on this. This stage lays the foundation for subsequent fact verification and knowledge integration.
[0086] (2) Based on the initial semantic graph, the core innovation of this scheme lies in the construction of a dynamic semantic graph (DSG). In this stage, the initial semantic graph is integrated with a large-scale external knowledge base, and a unique dynamic weighting algorithm is introduced to assign real-time weights to each node and edge in the graph based on the timeliness of the information, the contextual relevance to the user's instructions, and the stability of the facts. Finally, this weighted graph is divided into multiple levels such as the fact layer, the concept layer, the causal relationship layer, and the temporal relationship layer, forming a task-oriented, real-time updated, and highly refined "fact blueprint," which effectively addresses the challenge of the lack of factual basis in the illusion problem and supports real-time information integration. The "fact blueprint" is the refined information set provided by the dynamic semantic graph (DSG) after multi-level division and dynamic weighting. The dynamic semantic graph (DSG) is the specific structure that realizes and carries the "fact blueprint."
[0087] (3) Based on this "fact blueprint", logical chains and planning instructions are further extracted and generated. It identifies causal, temporal and logical reasoning chains that are highly relevant to the current generation task from the dynamic semantic graph, and encodes these explicit logical chains into structured "planning instructions". These instructions are like the "skeleton" and "navigation map" of text generation, which aim to solve the problem of insufficient logical coherence in the existing model and provide clear guidance for subsequent generation.
[0088] (4) An optimized large-scale generative model generates text under the deep guidance of these planning instructions. The innovation here is that the planning instructions are no longer just input prompts, but rather deeply constrain the decoding process of the optimized large-scale generative model through customized attention and Logit correction mechanisms. This means that the optimized large-scale generative model is strongly guided and biased by dynamic semantic graphs and logical planning at each step of generation, thereby ensuring strict consistency between the generated content and the factual blueprint and logical skeleton, and significantly improving the controllability and task fit of generation.
[0089] (5) The most crucial innovation is the integrated real-time fact-checking and correction mechanism. During the text generation process, whenever the optimized large-scale generation model generates a text unit, it is immediately subjected to multi-dimensional real-time verification: including internal consistency with the original input text, external consistency with high-weight facts in the dynamic semantic graph, and logical consistency with the logic represented by the planning instructions. Once any inconsistency or potential "illusion" is found during the verification, a series of corrective measures are immediately triggered, such as suppressing erroneous logit, resampling, or conditional backtracking when necessary, and even dynamically adjusting the weight of the planning instructions, thereby correcting errors at the first moment of content generation, fundamentally eliminating the occurrence of "illusion" phenomena, and ensuring that the final output text content is not only fluent but also deeply factually accurate.
[0090] The principles and spirit of the present invention will be explained in detail below with reference to several representative embodiments.
[0091] This invention aims to provide a text summarization method based on semantic graphs and real-time fact-checking. The method takes raw input (source text, user instructions, optional structured knowledge base fragments, and real-time API data) as device input and ultimately outputs a text summary or creative content that is free of illusions, factually accurate, and logically coherent. The entire technical solution works closely together through the following five steps to ensure the deep factual accuracy and logical consistency of the generated content.
[0092] Figure 1 is a schematic flowchart of the text summarization generation method based on semantic graph and real-time fact verification according to the present invention. As shown in Figure 1, the specific steps are as follows:
[0093] S1. Input parsing and initial semantic graph construction
[0094] This step aims to accurately extract key information from diverse input sources and transform it into a structured Initial Semantic Graph (ISG), laying the foundation for subsequent construction of dynamic semantic graphs.
[0095] S1.1 Input Information Reception and Preprocessing
[0096] The system receives the following input:
[0097] (1) Source text: The original text content to be summarized or created.
[0098] (2) User instructions: Specify the target, style, length and other requirements of the generated task, such as "Please summarize this news, focusing on the people and the impact of the event, and generate a length of 200 words" or "Create an article about the future development of cities, including transportation and energy innovation".
[0099] (3) Structured knowledge base fragments: Optional additional information, such as domain-specific ontology data, relational database query results, or CSV file data, to provide supplementary background knowledge.
[0100] (4) Real-time API data: Optional dynamic information, such as the latest news API, stock data API, weather API, etc., used to obtain the latest dynamic information.
[0101] All received text input undergoes standardized preprocessing, with the specific processing flow as follows:
[0102] (1) Word segmentation: Use the jieba word segmentation tool to perform precise word segmentation on Chinese text.
[0103] (2)词性标注: Use the Harbin Institute of Technology LTP toolkit to perform词性 tagging on the segmented text.
[0104] (3)去除停用词: Filter out common meaningless words in the text according to the predefined Chinese stop word list.
[0105] (4)词形还原: Restore words to their basic forms, for example, restore "正在运行" to "运行".
[0106] For structured data and API data, perform unified JSON or XML format parsing, and convert their key information into key-value pairs or triples to ensure that the subsequent information extraction module can process them consistently.
[0107] S1.2 Key Information Extraction
[0108] In this sub-step, a series of deep learning models trained or fine-tuned on specific tasks are used to perform multi-dimensional information extraction on the text preprocessed in S1. For structured data and API data, perform unified JSON or XML format parsing, and convert their key information into key-value pairs or triples to ensure that the subsequent information extraction module can process them consistently.
[0109] (1)命名实体识别与实体链接: The named entity recognition (NER) module obtained by fine-tuning the existing RoBERTa-large model on the Baidu ERNIE-NER dataset (a named entity recognition task dataset proposed by Baidu, including various entity types such as person names, place names, and organization names) is adopted. This named entity recognition module recognizes 12 predefined entity types in the text, including person names, place names, organization names, dates, proper nouns, product names, and event names. For each recognized entity, entity linking is performed by calculating the cosine similarity between its embedding vector and the entity embedding vector in the open Wikidata knowledge base, and combining the entity vectors pre-trained on the Wikidata knowledge base by the TransE embedding model (a knowledge graph embedding model). The specific implementation process is as follows: First, convert the recognized entity text into a vector representation through a pre-trained word vector model (Word2Vec); Second, use the entity embeddings learned by the TransE model on the Wikidata knowledge base to find the Wikidata entity with the highest cosine similarity to the text entity vector; If the highest similarity is higher than the preset threshold ,则将文本实体映射到该Wikidata实体标识符(Qid),实现规范化;若无匹配或相似度低于阈值 ,则视为新实体并为其创建内部唯一标识符。
[0110] (2) Relation Extraction: The existing OpenNRE-BERT-large model is used, which has been fine-tuned on the Chinese version of the Chinese relation extraction dataset FewRel 2.0, to identify semantic relationships between linked entities, such as “born in”, “located in”, “own”, “serve”, “invest”, etc. Each identified relationship is assigned a predefined relation type identifier, and its confidence score is output by the OpenNRE-BERT-large model.
[0111] (3) Event extraction: The existing EventNet-large model is adopted. This EventNet-large model is based on the Transformer architecture and is fine-tuned for event detection and argument role recognition on the Chinese event extraction public datasets DuEE-Fin and FewFC. The model can identify specific events in the text (such as “meeting”, “release”, “acquisition”, “strike”) and extract the key participants (arguments) and their roles (such as “initiator”, “victim”, “time”, “location”, “reason”).
[0112] (4) Coreference resolution: The existing Hugging Face Transformer Coreference Resolution model, which is finely tuned on the CoNLL-2012 Chinese and English dataset based on the existing SpanBERT model, is adopted. This model is used to associate different references to the same entity in the text (such as the pronoun "he", the nickname "Mr. Li", "the company"), to ensure that the same entity in the graph corresponds to only one node, thus avoiding information redundancy and ambiguity.
[0113] (5) Semantic Role Labeling: The existing Biaffine Semantic Role Labeling (SRL) model integrated in the spaCy framework is adopted. This SRL model has been trained on the Chinese PropBank corpus. This SRL model performs semantic role labeling on predicates and arguments in sentences, further revealing the structured semantics inside events (e.g., "who did what", "when and where", "how"), thereby enriching the relational information in the graph.
[0114] S1.3 Initial Semantic Graph (ISG) Construction
[0115] All entities, relationships, events, coreference information, and semantic role information extracted in S1.2 are integrated to construct a directed graph with type labels. .in, It is a set of nodes containing all extracted entities (e.g., people, places, organizations), events (e.g., meetings, releases), and key concepts; key concepts are abstract or general words / phrases extracted from the original text that are important for understanding the text's theme and subsequent tasks. It is a set of edges representing relationships between entities (e.g., "born of", "belong to"), relationships between events and arguments (e.g., "participant", "location"), coreference, and semantic role relationships. Each node and each edge is accompanied by its type label, a confidence score given by the extraction model, and its precise location information in the source text.
[0116] S2. Construction of Dynamic Semantic Graph (DSG)
[0117] This step is one of the core innovations of this invention. It transforms the initial semantic graph into a multi-level, task-oriented dynamic semantic graph (DSG) through knowledge graph fusion and dynamic weighting mechanisms, providing a real-time and accurate "fact blueprint" for the subsequent generation process.
[0118] S2.1ISG Integration with External Knowledge Graphs
[0119] This sub-step will build S1.3 It integrates with Wikidata, a large-scale general knowledge graph, to supplement background knowledge and verify facts.
[0120] (1) Entity and Relation Alignment: Entity and relation vectors pre-trained using the TransE embedding model. For For each entity and relation in Wikidata, calculate the cosine similarity between its embedding vector and the embedding vectors of all entities and relations in Wikidata. If the highest similarity exceeds a preset threshold... Then, merge or link them. The specific operation is as follows: If... If the entity has been successfully linked to the Wikidata entity (S1.2), then link it to... All relationships and attributes are merged into the corresponding Wikidata entities; if If a relationship in [the context of Wikidata] has a high similarity match with a relationship type in Wikidata, then that relationship is mapped to a Wikidata relationship type. If... If an entity or relation in the graph does not have a high similarity match in Wikidata, it is added as a new node or edge to the merged graph. The merged graph is denoted as [the graph is then described in the original text]. .
[0121] (2) Structured Knowledge Injection: Based on user instructions or preset domain rules in S1.1, retrieve relevant knowledge from the structured knowledge base provided by S1.1. This involves highly related knowledge fragments of existing entities or concepts (abstract or general topics, categories, or ideas extracted from text or integrated from external knowledge bases during DSG construction; these serve as nodes in the graph to connect and organize related facts, providing more comprehensive contextual information). These knowledge fragments are injected into the graph in the form of triples (entity 1, relation, entity 2). In this way, the domain depth and specific background knowledge of the map can be enriched.
[0122] S2.2 Dynamic Weighting Algorithm and DSG Hierarchy Construction
[0123] This step is the key innovation of this invention. Based on the input information of S1.1 and the specific requirements of the generation task, a dynamic weighting algorithm based on an attention mechanism is used to assign weights to each node in the graph. and each edge Assign real-time dynamic weights This weighting comprehensively evaluates the timeliness, contextual relevance, and factual stability of information, ensuring that the generation process prioritizes the most relevant, up-to-date, and reliable facts.
[0124] The weight calculation formula is as follows:
[0125]
[0126] in, Represents any node or edge in the graph; The predefined weighting coefficients have the following values: ,satisfy These coefficients were determined through pre-training on datasets containing different task preferences.
[0127] (1) Timeliness weight Calculation: For nodes or edges Associated time information (e.g., event occurrence time, data update timestamp), calculate its time and compare it with the current system time. (Unit: days):
[0128]
[0129] in It is the time decay coefficient, and its value is set to... . The smaller, The larger the value, the newer and more timely the information. If a node or edge does not contain explicit time information, then... The default setting is .
[0130] (2) Contextual relevance weight Calculation: Calculate nodes or edges Embedded vector With the current generated context embedding vector The cosine similarity between them. Among them, Using the existing GraphSAGE model The model is trained on the graph and learns the context-aware embedding of nodes by aggregating information from neighboring nodes. The encoded embedding vector of the user instruction in S1.1 (encoded using the existing Sentence-BERT model) or the average embedding vector of the currently generated text.
[0131]
[0132] Calculation results From the original range Linear normalization to .
[0133] (3) Weight of factual stability Calculation: This weight assesses the credibility and consensus of the facts.
[0134]
[0135] in It is the confidence score extracted from the model output from the original knowledge base (such as Wikidata) or S1.2, and its value range is... . It is the number of independent information sources that support this fact, such as the number of times the source text is mentioned during the fusion process and the number of times it is cited by external knowledge bases. It is the enhancement coefficient for the number of sources, set to Calculation results It will be truncated to the maximum value. .
[0136] (4) Construction of DSG multi-level structure: Based on the calculation in S2.2 Value, pair Filtering and hierarchical division are performed to form a multi-level DSG.
[0137] Fact Layer: Contains all The nodes and edges, which are highly verified, timely, and context-sensitive facts, serve as the foundation for generating text.
[0138] Concept Layer: Contains all But lower The nodes and edges are auxiliary concepts, background knowledge, or secondary facts used to provide context and enrich the details.
[0139] Causal Relation Layer: Extracts all edges explicitly marked as causal relationships (e.g., "cause", "due to", "cause") and their connected nodes from the fact layer.
[0140] Temporal Relation Layer: Extracts all edges explicitly marked as temporal relationships (e.g., "before", "after", "occurring simultaneously") and their connected nodes from the fact layer, and sorts them according to their timestamp attributes.
[0141] These layers together constitute a task-oriented dynamic semantic graph (DSG), stored as a queryable graph database, providing a refined view for subsequent logical planning.
[0142] S3. Logical Chain Extraction and Planning Instruction Generation
[0143] This step is another key innovation of the present invention, which aims to explicitly extract highly relevant logical chains from DSG and encode them into "planning instructions" that can be directly used by the generation model, thereby ensuring the logical coherence and factual support of the generated text.
[0144] S3.1 Core Related Subgraph Recognition
[0145] We employ an existing Graph Attention Network (GAT) model with 8 layers, each containing 8 attention heads, and using the ReLU activation function. This GAT model is trained on the DSG, and its goal is to learn node embeddings that capture node structural information and dynamic weights. The input to the GAT model is the initial feature vector of the nodes in the DSG (via TransE embedding and one-hot encoding of node type). It aggregates neighbor information through a multi-layer attention mechanism to obtain a context-aware embedding for each node.
[0146] Based on the task target embedding vector encoded by the user instructions in S1.1, calculate the cosine similarity between the final embeddings of all nodes in the DSG and the task target embedding. Nodes with similarity higher than a threshold are selected. The nodes of a given node are included, along with all their first-degree neighbors (all nodes directly connected to a given node) and their connecting edges, forming a core-related subgraph. .
[0147] S3.2 Logic Chain Extraction
[0148] In this sub-step, based on the generation of S3.1 It explicitly extracts causal chains, temporal chains, and logical reasoning chains, which constitute the "logical skeleton" of the generated text.
[0149] (1) Extraction of causal chains: in In the process, identify all edges of type "causal relationship". Utilize the existing depth-first search (DFS) algorithm from... Starting from the core event nodes (event nodes identified by the event extraction module in S1.2), the search proceeds along the causal relationship edges until the maximum search depth is reached. Or there may be no subsequent causal relationship edges. Each complete causal chain is extracted as an ordered set of fact triples, for example... and The chain .
[0150] (2) Temporal chain extraction: In In this process, all edges of type "temporal relationship" are identified. For entities or events involving time, they are precisely ordered according to their explicit timestamp attributes (e.g., date, time point) to construct a time series chain. Each time series chain is represented as an ordered list of events and times, for example... .
[0151] (3) Logical Reasoning Chain Extraction: Combining the concept and fact layers in DSG, graph reasoning is performed using predefined logical rules (e.g., "If P and Q then R") or based on existing Path Ranking Algorithms (PRA). The PRA algorithm in... Random walks are performed to search for reasoning paths between entities, thereby identifying implicit logical relationships and reasoning chains. These logical reasoning chains are represented as sets of facts for premises and conclusions.
[0152] (4) Chain Encoding and Priority Ranking: All extracted causal chains, temporal chains, and logical reasoning chains are encoded. Each chain is encoded as a serialized text string representation, for example, [CAUSAL] Entity A leads to Entity B [END_CAUSAL]. Simultaneously, the dynamic weights of the nodes involved in the chain are used to further refine the encoding. Based on the average value and chain length, all chains are prioritized. Chains with higher weights and moderate lengths (e.g., containing 2 to 4 core facts) are given higher priority.
[0153] S3.3 Planning Instruction Generation
[0154] Select the highest priority option from S3.2. These logical chains combine to form a structured sequence of "planning instructions." Here... The value is fixed at 5, which is the optimal balance point determined through experimental evaluation on different text generation tasks. The sequence begins with a specific prefix [PLAN] and contains the encoded representation of each chain to serve as explicit guidance for the decoding process of the existing T5-XXL model (a pre-trained large generative model).
[0155] Examples of planning instructions are as follows: [PLAN] [CAUSAL] Event A causes Event B [END_CAUSAL][TEMPORAL] Event C occurs after T1, and Event D occurs in T2 [END_TEMPORAL] [LOGIC] If Company A acquires Company B, then Company A owns Product X [END_LOGIC] [END_PLAN].
[0156] The overall length of the planning instruction is strictly limited to 512 tokens to accommodate the limitations of the T5 model input window.
[0157] S4. Text generation based on planning instructions
[0158] This step uses a finely tuned generative model and leverages “planning instructions” generated by S3 to deeply constrain and guide the generation process, ensuring that the generated text is strictly consistent with the logical skeleton represented by DSG.
[0159] S4.1 Generative Model Initialization
[0160] A pre-trained T5-XXL model was employed, and its architecture was tuned to Decoder-only mode (meaning the decoder part is used independently to generate text sequences from scratch) to adapt to text generation tasks. The initialized and fine-tuned Decoder-only T5-XXL model was pre-trained on a large-scale text corpus (C4 dataset) and further fine-tuned on datasets containing high-quality summaries and creative texts (selected Chinese subsets from CNN / DailyMail and Gigaword) to give it excellent language generation capabilities and instruction compliance.
[0161] S4.2 Planning Instructions Integration and Controlled Decoding
[0162] This sub-step is one of the innovations of this invention. In the text generation and decoding process of the T5-XXL model in Decoder-only mode, which is initialized and fine-tuned in S4.1, the planning instructions generated in S3.3 are not only used as prefixes of the input, but also deeply influence the generation of each step through a custom attention mechanism and Logit correction mechanism, so as to achieve real-time and fine-grained control over the generated content.
[0163] (1) Planning Instruction Attention Mechanism: In the self-attention layer of the initialized and fine-tuned Decoder-only T5-XXL model, in addition to calculating the regular query-key-value (QKV) attention, a planning instruction attention module is also introduced. This module uses the encoded embedding of the planning instructions generated in S3.3 (encoded by the T5 Encoder) as an additional sequence of "keys" and "values". For the query vector of the current decoding step... The initialized and fine-tuned Decoder-only mode T5-XXL model not only calculates the history of the generated text, but also... attention Where T represents matrix transpose, and also includes parallel computation and planning instructions. attention The final context vector It is the weighted sum of the two:
[0164]
[0165] Wherein the fusion coefficient This indicates that historically generated content dominates the fusion process, but planning instructions provide important supplementary guidance. Through this mechanism, high-weighted planning instructions will guide the model to generate words more closely related to the instruction's content.
[0166] (2) Logit Correction Mechanism: Based on the entities, relationships, events explicitly mentioned in the planning instructions generated by S3.3 and the key facts in the DSG constructed by S2, a vocabulary bias dictionary is dynamically constructed. In each decoding step, after the T5-XXL model in Decoder-only mode, which has been initialized and fine-tuned, generates the Logit (i.e., the non-normalized probability of the next token), the Logit value of words highly related to the content of the planning instructions (such as entities, verbs, etc. appearing in the instructions) is multiplied by an enhancement factor. For terms that explicitly contradict the content of the planning instructions (as verified through S5.1.3), their Logit value is multiplied by a penalty factor. This forces the model to follow planning instructions at the probabilistic level, thus avoiding the generation of words that conflict with the planning logic.
[0167] S4.3 Text Unit Generation
[0168] The initialized and fine-tuned Decoder-only T5-XXL model, under the constraints of S4.2, generates text using beam search, with the beam width set to [value missing]. In each decoding step, the one with the highest probability is selected. The token sequence continues to expand. Each generated text unit (a single token) is immediately sent to S5 for real-time fact-checking.
[0169] S5. Integrated Real-time Fact Checking and Correction
[0170] This step is the core innovation of the invention, realizing a real-time feedback mechanism of "generating, verifying, and correcting simultaneously," fundamentally eliminating the generation of illusions and ensuring the accuracy of the generated content in terms of depth and facts.
[0171] S5.1 Real-time Fact Check Module
[0172] As shown in Figure 2, each time the Decoder-only mode T5-XXL model, initialized and fine-tuned in S4.3, generates a text unit... This unit and its predecessors A text fragment composed of generated text units It is sent to the real-time fact-checking module for three-dimensional verification. The value of 5 is an empirical value that balances the granularity of verification and computational efficiency.
[0173] (1) Internal consistency check: Check the currently generated text fragment. Whether it is consistent with the facts in the original input source text in S1.1. This is accomplished through the following steps: First, a sparse retrieval machine built using the existing BM25 algorithm is used to perform fast paragraph matching on the original input text in S1.1, retrieving paragraphs that are consistent with the facts in the original input source text in S1.1. The most relevant original text fragment; secondly, The retrieved original text fragments are input into a RoBERTa binary classification model finely tuned using a Chinese Natural Language Inference (NLI) dataset (e.g., the Chinese portion of XNLI). The model then determines... Whether it "implies," "contradicts," or is "neutral" with the original text fragment. Implied (Entailment): indicates... The authenticity can be inferred from the original text fragment, that is... The content is supported by the original text fragment. Contradiction: indicates... The authenticity of the text conflicts with the original text fragment, that is... The content does not conform to the facts in the original text fragment. Neutral: indicates... The authenticity of the statement cannot be inferred from the original text fragment, nor does it conflict with it. If the model outputs a "contradictory" probability higher than... If so, it is determined to be an internal inconsistency.
[0174] (2) External fact-checking: Check the currently generated text fragment. Whether it is consistent with the high-weighted fact layer information in the DSG constructed in S2, and whether external knowledge can be selectively queried through the real-time API configured in S1.1.
[0175] (a) DSG matching: will The entity and relation extraction module in S1.2 extracts the entities and relations to form a miniature graph structure. This miniature graph structure is then graph-matched with the fact layer of the DSG in S2, specifically checking whether the triples in the miniature graph exist in the DSG, or whether they match those in the DSG. The facts are contradictory (for example, the DSG clearly states that "Company A did not acquire Company B," while...). Mentioning "Company A acquires Company B"). The graph matching success rate is lower than... This is considered an external inconsistency.
[0176] (b) API verification: If This includes entities of specific types (such as the latest stock codes, real-time weather information, and census data), which can be queried in real-time via the pre-configured API interface in S1.1 based on their entity type. If the real-time query results returned by the API are different from... If the content in the file does not match, it is determined to be an external inconsistency.
[0177] (3) Logical consistency check: Check the currently generated text fragment. Whether it aligns with the logical chain (causality, temporal sequence, logical reasoning) represented by the planning instructions extracted from S3. This is determined using an existing T5-base model fine-tuned with Chinese logical reasoning datasets (e.g., Chinese versions of ReClor and LogiQA). This model receives... Using the relevant logical chain as input, determine Does it violate or contradict the logical chain? If the probability of the model output being contradictory is higher than... If so, it is determined to be a logical inconsistency.
[0178] S5.2 Real-time Correction Mechanism
[0179] This step is a key innovation of the present invention. When any dimension in S5.1 is found to be inconsistent, the system will immediately trigger a real-time correction mechanism, as shown in Figure 3, to prevent the generation of hallucinatory content.
[0180] (1) Comprehensive confidence calculation: The real-time fact-checking module calculates the confidence level for each generated text unit. Calculate a comprehensive confidence level Its initial value is If the internal consistency check results are inconsistent, If the external fact-checking results are inconsistent, If the logical consistency check results are inconsistent... .in It is a predefined penalty coefficient that represents the severity of inconsistencies of different types, with logical inconsistencies incurring the highest penalty.
[0181] (2) Logit resampling and conditional backtracking: If the calculated overall confidence level Below the preset threshold The system will perform the following correction operations:
[0182] (a) Logit resampling: First, the current generation step is... In the Logit distribution, inconsistent text units The Logit value multiplied by a very small inhibition factor Strong suppression is applied. Then, a text unit is resampled from the modified Logit distribution. .
[0183] (b) Conditional backtracking: If resampling If a text unit token that passes the verification cannot be generated after this step, a backtracking operation is performed. Specifically, the currently generated text unit is revoked. And backtrack to the previous step Logit correction and text unit token sampling are performed again. Meanwhile, in the backtracked generation step... In S4.2.2, the penalty factor for inconsistent logical chains will be... Temporarily increased to (Right now (This becomes a stronger penalty) to prevent similar errors from recurring. The backtracking depth is limited to... This step prevents infinite backtracking.
[0184] (3) Dynamic fine-tuning of planning instructions: For specific planning instruction fragments that frequently cause inconsistencies during continuous generation, the system will temporarily reduce their fusion coefficient in S4.2.1. to And adjust the enhancement factor for the corresponding Logit in S4.2.2. to This adjustment allows the large generative model T5-XL, initialized and fine-tuned in Decoder-only mode in S4.1, to generate more flexibly within certain limits, preventing generation from being blocked or looping due to overly strict planning instructions. This adjustment is temporary and will automatically revert to the initial value after successfully generating a piece of text.
[0185] Through the tightly coupled steps described above, this invention achieves hallucination-free text summarization and creation based on semantic graph guidance and real-time fact-checking, ensuring the depth of factual accuracy and logical consistency of the generated content. The final output is text content that meets user instructions and has undergone multi-dimensional fact-checking.
[0186] It should be noted that although the operation of the method of the present invention has been described in a specific order in the above embodiments and figures, this does not require or imply that the operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0187] Based on the same inventive concept, this invention also proposes a text summarization generation device based on semantic graphs and real-time fact-checking. The implementation of this device can refer to the implementation of the method described above, and repeated details will not be repeated. The term "module" used below can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0188] Figure 4 is a schematic diagram of the text summarization generation device based on semantic graph and real-time fact verification according to the present invention. As shown in Figure 4, the device includes:
[0189] The input parsing and preprocessing module 101 is used to receive multi-source inputs and perform standardized preprocessing, and extract key information from the preprocessed text.
[0190] The initial semantic graph construction module 102 is used to integrate the extracted key information and construct the initial semantic graph G. ISG .
[0191] The dynamic semantic graph construction module 103 is used to construct the initial semantic graph G.ISG It integrates with external knowledge graphs and applies a multi-dimensional dynamic weighting algorithm to generate multi-level dynamic semantic graphs (DSGs), including:
[0192] The initial semantic map G ISG It is integrated with the large-scale general knowledge graph Wikidata to supplement background knowledge and verify facts. The integrated graph is denoted as... ;
[0193] exist Based on the input information, including source files, user instructions, structured knowledge base fragments, and real-time API data, as well as the specific requirements of the generation task, a dynamic weighting algorithm based on an attention mechanism is used to generate the fused graph. Each node in and each edge Assign real-time dynamic weights The weight calculation formula is as follows:
[0194]
[0195] in, Represents the weight of timeliness. Represents the weight of context relevance. Represents the weight of factual stability. Represents the fused spectrum Any node or edge in the array; For predefined weighting coefficients, satisfying These weighting coefficients are determined through pre-training on datasets containing different task preferences;
[0196] Based on the calculated dynamic weights Value, pair Filtering and hierarchical division are performed to form a multi-level dynamic semantic graph (DSG), including a fact layer, a concept layer, a causal relationship layer, and a temporal relationship layer.
[0197] The logic chain extraction and planning instruction generation module 104 is used to extract causal chains, temporal chains, and logical reasoning chains from the dynamic semantic graph DSG, and encode them into structured planning instructions to explicitly guide text generation, including:
[0198] A graph attention model (GAT) is used, which is trained on the dynamic semantic graph (DSG) to learn node embeddings that can capture node structure information and dynamic weights. The input of the graph attention model GAT is the initial feature vector of the node in the dynamic semantic graph (DSG). The neighbor information is aggregated through a multi-layer attention mechanism to obtain the context-aware embedding of each node.
[0199] Based on the task target embedding vector encoded from the user instructions in the input information, the cosine similarity between the final embedding of all nodes in the Dynamic Semantic Graph (DSG) and the task target embedding is calculated, and nodes with similarity higher than a threshold are selected. The nodes, including all their first-degree neighbors and their connecting edges, form a core-related subgraph. ;
[0200] Based on the core related subgraph The causal chain, temporal chain, and logical reasoning chain are explicitly extracted. All extracted causal chains, temporal chains, and logical reasoning chains are encoded, and the dynamic weights of the nodes involved in the chains are used as the basis for the encoding. Based on the average value and the length of the chain, all chains are prioritized.
[0201] The highest priority The chains described above are combined into a structured sequence of planning instructions.
[0202] Text generation module 105 is used to perform controlled text generation using a pre-trained large-scale generative model, deeply guided by the planning instructions, through a customized attention and Logit correction mechanism, including:
[0203] We employ a pre-trained large generative model T5-XXL and adapt its architecture to Decoder-only mode;
[0204] A planning instruction attention module is introduced into the self-attention layer of the pre-trained T5-XXL model in Decoder-only mode. This planning instruction attention module embeds the encoded planning instruction as an additional key-value sequence; for the query vector of the current decoding step... The pre-trained T5-XXL model in Decoder-only mode calculates the generated text history. attention It also supports parallel computing and planning instructions. attention The final context vector It is the weighted sum of the two:
[0205]
[0206] Wherein the fusion coefficient This indicates that historically generated content dominates the integration process, and the planning instructions provide important supplementary guidance.
[0207] Based on the entities, relationships, and events explicitly mentioned in the planning instructions and the key facts in the dynamic semantic graph (DSG), a vocabulary bias dictionary is dynamically constructed. In each decoding step, after the pre-trained T5-XXL model in Decoder-only mode generates the non-standardized probability Logit for the next text unit, the Logit value for words highly relevant to the content of the planning instructions is multiplied by an enhancement factor. For terms that explicitly contradict the content of the planning instructions, their Logit value is multiplied by a penalty factor. ;
[0208] The pre-trained T5-XXL model in Decoder-only mode generates text using a beam search method under the constraints described above, with the beam width set to [value missing]. In each decoding step, the one with the highest probability is selected. The sequence of text units continues to expand; each generated text unit is immediately subject to real-time fact-checking.
[0209] The real-time fact-checking module 106 is used to perform multi-dimensional real-time checks on each generated text unit during the text generation process, and to trigger a real-time correction mechanism when any inconsistency is found in any dimension, including:
[0210] Each time the pre-trained T5-XXL model in Decoder-only mode generates a text unit The text unit and before A text fragment composed of generated text units Three-dimensional verification is conducted, including internal consistency verification, external fact verification, and logical consistency verification.
[0211] For each of the generated text units Calculate a comprehensive confidence level If the internal consistency check results are inconsistent, If the external fact-checking results are inconsistent, If the logical consistency check results are inconsistent... ;in It is a predefined penalty coefficient;
[0212] If the calculated comprehensive confidence level Below the preset threshold , will generate the current step In the Logit distribution, this leads to inconsistencies in the text units. The Logit value multiplied by a very small inhibition factor Perform strong suppression, then resample a text unit from the corrected Logit distribution. ;
[0213] If resampling If the text unit fails to pass the verification after this step, the currently generated text unit is cancelled. And backtrack to the previous generation step Logit correction and text unit sampling are performed again; simultaneously, in the generation step after backtracking... In this context, the penalty factor is increased to address the inconsistencies in the chain. The backtracking depth is limited to step;
[0214] For specific planning instruction fragments that frequently cause inconsistencies during continuous generation, reduce their corresponding fusion coefficient. And adjust the enhancement factor of its corresponding Logit. The fusion coefficient mentioned after successfully generating a piece of text and the enhancement factor Automatically restores to the initial value.
[0215] It should be noted that although several modules of the text summarization device based on semantic graphs and real-time fact-checking are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided and embodied by multiple modules.
[0216] Based on the aforementioned inventive concept, as shown in Figure 5, the present invention also proposes a computer device 200, including a memory 210, a processor 220, and a computer program 230 stored in the memory 210 and executable on the processor 220. When the processor 220 executes the computer program 230, it implements the aforementioned text summarization generation method based on semantic graph and real-time fact verification.
[0217] Based on the aforementioned inventive concept, the present invention also proposes a computer-readable storage medium storing a computer program that executes the aforementioned text summarization generation method based on semantic graphs and real-time fact-checking.
[0218] The text summarization method and apparatus based on semantic graphs and real-time fact-checking proposed in this invention solves the main pain points of existing technologies, thereby promoting the development of text generation technology towards a more reliable and intelligent direction:
[0219] (1) Overcoming the "illusion" phenomenon and ensuring factual accuracy: One of the original design intentions of this invention is to fundamentally solve this problem. By constructing a task-oriented dynamic semantic graph (DSG), integrating information extracted from multiple sources and external knowledge bases, the invention achieves pre-screening and importance weighting of facts for potential generated content. More importantly, this invention introduces an integrated real-time fact-checking module, which can perform three-dimensional checks on the internal consistency, external factual, and logical consistency of each text unit in the model generation process. Once a "illusion" sign that does not conform to the factual basis is found, it is immediately corrected through Logit resampling and conditional backtracking mechanisms, thereby eliminating the occurrence of false information at the first moment of content generation and ensuring that the output content is absolutely true and credible.
[0220] (2) Enhancing Logical Coherence and Consistency: One of the core motivations of this invention is to overcome this deficiency. Highly relevant causal chains, temporal chains, and logical reasoning chains are explicitly extracted from the dynamic semantic graph, and these chains constituting the "logical skeleton" of the text are encoded into structured "planning instructions." These instructions are deeply integrated into the decoding process of the generative model through a custom attention mechanism and a Logit correction mechanism, achieving a strongly constrained controlled decoding. This mechanism ensures that the model strictly follows the preset logical path when generating text, resulting in a clear, well-organized, and logically rigorous text structure, effectively improving the overall quality of complex text.
[0221] (3) Support for real-time information integration and rapid updates: The invention considered real-time requirements from the initial design stage. Real-time API data is used as an important input source, and timeliness weights are introduced into the construction of the dynamic semantic graph, prioritizing the importance of the latest information. In addition, during the real-time fact-checking stage, the API verification mechanism allows the system to trigger real-time queries to external interfaces based on the generated content, ensuring that any dynamically referenced information originates from the latest and most accurate data sources, greatly improving the timeliness and practical value of the generated content.
[0222] (4) Enhancing the controllability and task relevance of text generation: This invention aims to improve the controllability of generated text. By accurately parsing user instructions and encoding them into task target embedding vectors, the construction of dynamic semantic graphs is guided towards the user's focus. Simultaneously, the extraction of logical chains driven by user instructions and the planning of instruction generation, combined with the deep integration and controlled decoding mechanism in the generation model, enable the model to strictly follow these instructions during generation. This ensures that the final output content accurately meets the user's specific requirements, greatly improving the relevance of the generated text to the user's intent in terms of information emphasis, style setting, and text structure.
[0223] In summary, the original intention of this invention is to systematically solve the core pain points of existing large language models in terms of factual accuracy, logical coherence, real-time performance, and controllability by constructing an advanced framework that integrates semantic graph guidance, explicit logical planning, and real-time fact verification, thereby providing a more reliable, efficient, and intelligent text generation solution.
[0224] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
[0225] Regarding the limitation of the scope of protection of this invention, those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solution of this invention are still within the scope of protection of this invention.
Claims
1. A text summarization method based on semantic graphs and real-time fact-checking, characterized in that, The method includes: extracting key information from multi-source input and constructing an initial semantic graph G. ISG The initial semantic map G ISG The system integrates with an external knowledge graph and applies a multi-dimensional dynamic weighted algorithm to generate a multi-level dynamic semantic graph (DSG). Causal chains, temporal chains, and logical reasoning chains are extracted from the DSG and encoded into structured planning instructions to explicitly guide text generation. A pre-trained large-scale generative model, guided by these planning instructions, performs controlled text generation through customized attention and Logit correction mechanisms. During text generation, each generated text unit undergoes multi-dimensional real-time verification, and a real-time correction mechanism is triggered when any inconsistency is detected in any dimension.
2. The text summarization method based on semantic graph and real-time fact-checking according to claim 1, characterized in that, The initial semantic map G ISG The process involves integrating the initial semantic graph G with an external knowledge graph and applying a multi-dimensional dynamic weighting algorithm to generate a multi-level dynamic semantic graph (DSG), including: integrating the initial semantic graph G with the external knowledge graph and applying a multi-dimensional dynamic weighting algorithm to generate a multi-level dynamic semantic graph (DSG). ISG It is integrated with the large-scale general knowledge graph Wikidata to supplement background knowledge and verify facts. The integrated graph is denoted as... ;exist Based on the input information, including source files, user instructions, structured knowledge base fragments, and real-time API data, as well as the specific requirements of the generation task, a dynamic weighting algorithm based on an attention mechanism is used to generate the fused graph. Each node in and each edge Assign real-time dynamic weights The weight calculation formula is as follows: in, Represents the weight of timeliness. Represents the weight of context relevance. Represents the weight of factual stability. Represents the fused spectrum Any node or edge in the array; For predefined weighting coefficients, satisfying These weight coefficients are determined through pre-training on datasets containing different task preferences; based on the calculated dynamic weights... Value, pair Filtering and hierarchical division are performed to form a multi-level dynamic semantic graph (DSG), including a fact layer, a concept layer, a causal relationship layer, and a temporal relationship layer.
3. The text summarization method based on semantic graph and real-time fact-checking according to claim 1, characterized in that, Extracting causal chains, temporal chains, and logical reasoning chains from the Dynamic Semantic Graph (DSG) and encoding them into structured planning instructions to explicitly guide text generation includes: employing a Graph Attention Model (GAT), which is trained on the DSG to learn node embeddings capable of capturing node structural information and dynamic weights. The input to the GAT is the initial feature vector of nodes in the DSG. Neighbor information is aggregated through a multi-layer attention mechanism to obtain the context-aware embedding of each node. Based on the task target embedding vector encoded from the user instructions in the input information, the cosine similarity between the final embeddings of all nodes in the DSG and the task target embeddings is calculated, and nodes with similarity higher than a threshold are selected. The nodes, including all their first-degree neighbors and their connecting edges, form a core-related subgraph. Based on the aforementioned core related subgraph The causal chain, temporal chain, and logical reasoning chain are explicitly extracted. All extracted causal chains, temporal chains, and logical reasoning chains are encoded, and the dynamic weights of the nodes involved in the chains are used as the basis for the encoding. Based on the average value and the length of the chain, all chains are prioritized; the chain with the highest priority is then prioritized. The chains described above are combined into a structured sequence of planning instructions.
4. The text summarization method based on semantic graph and real-time fact-checking according to claim 1, characterized in that, A pre-trained large-scale generative model is used to generate controlled text under the deep guidance of the planning instructions, through a customized attention and Logit correction mechanism. This includes: employing a pre-trained large-scale generative model T5-XXL and adjusting its architecture to Decoder-only mode; introducing a planning instruction attention module into the self-attention layer of the pre-trained T5-XXL model in Decoder-only mode, where the planning instruction attention module embeds the encoded planning instructions as additional key-value sequences; for the query vector of the current decoding step... The pre-trained T5-XXL model in Decoder-only mode calculates the generated text history. Target attention It also supports parallel computing and planning instructions. Target attention The final context vector It is the weighted sum of the two: Wherein the fusion coefficient This indicates that historically generated content dominates during fusion, with the planning instructions providing important supplementary guidance. A lexicon bias dictionary is dynamically constructed based on the entities, relationships, and events explicitly mentioned in the planning instructions and key facts in the dynamic semantic graph (DSG). At each decoding step, after the pre-trained T5-XL model in Decoder-only mode generates the non-standardized probability Logit for the next text unit, the Logit value for words highly relevant to the content of the planning instructions is multiplied by an enhancement factor. For terms that explicitly contradict the content of the planning instructions, their Logit value is multiplied by a penalty factor. The pre-trained T5-XXL model in Decoder-only mode generates text using a beam search method under the aforementioned constraints, with the beam width set to [value missing]. In each decoding step, the one with the highest probability is selected. The sequence of text units continues to expand; each generated text unit is immediately subject to real-time fact-checking.
5. The text summarization method based on semantic graph and real-time fact-checking according to claim 1, characterized in that, During the text generation process, each generated text unit undergoes multi-dimensional real-time verification, and a real-time correction mechanism is triggered when any inconsistency is detected in any dimension. This includes: whenever the pre-trained T5-XXL model in the Decoder-only mode generates a text unit... The text unit and before A text fragment composed of generated text units Three-dimensional verification is performed, including internal consistency verification, external fact verification, and logical consistency verification; a real-time fact verification module is used for each generated text unit. Calculate a comprehensive confidence level If the internal consistency check results are inconsistent, If the external fact-checking results are inconsistent, If the logical consistency check results are inconsistent... ;in It is a predefined penalty coefficient; if the calculated comprehensive confidence level Below the preset threshold , will generate the current step In the Logit distribution, this leads to inconsistencies in the text units. The Logit value multiplied by a very small inhibition factor Perform strong suppression, then resample a text unit from the corrected Logit distribution. If resampling If the text unit fails to pass the verification after this step, the currently generated text unit is cancelled. And backtrack to the previous generation step Logit correction and text unit sampling are performed again; simultaneously, in the generation step after backtracking... In this context, the penalty factor is increased to address the inconsistencies in the chain. The backtracking depth is limited to Step 1: For specific planning instruction fragments that frequently cause inconsistencies during continuous generation, reduce their corresponding fusion coefficient. And adjust the enhancement factor of its corresponding Logit. The fusion coefficient mentioned after successfully generating a piece of text and the enhancement factor Automatically restores to the initial value.
6. A text summarization generation device based on semantic graphs and real-time fact-checking, characterized in that, The device includes: an input parsing and preprocessing module, used to receive multi-source input and perform standardized preprocessing, and extract key information from the preprocessed text; and an initial semantic graph construction module, used to integrate the extracted key information and construct an initial semantic graph G. ISG The dynamic semantic graph construction module is used to construct the initial semantic graph G. ISG The system integrates with external knowledge graphs and applies a multi-dimensional dynamic weighted algorithm to generate a multi-level dynamic semantic graph (DSG). A logic chain extraction and planning instruction generation module extracts causal chains, temporal chains, and logical reasoning chains from the DSG and encodes them into structured planning instructions to explicitly guide text generation. A text generation module uses a pre-trained large-scale generation model to generate controlled text under the deep guidance of the planning instructions, employing customized attention and Logit correction mechanisms. A real-time fact-checking module performs multi-dimensional real-time checks on each generated text unit during text generation and triggers a real-time correction mechanism when any dimension is found to be inconsistent.
7. The text summarization generation device based on semantic graph and real-time fact verification according to claim 6, characterized in that, The dynamic semantic graph construction module is specifically used for: constructing the initial semantic graph G. ISG It is integrated with the large-scale general knowledge graph Wikidata to supplement background knowledge and verify facts. The integrated graph is denoted as... ;exist Based on the input information, including source files, user instructions, structured knowledge base fragments, and real-time API data, as well as the specific requirements of the generation task, a dynamic weighting algorithm based on an attention mechanism is used to generate the fused graph. Each node in and each edge Assign real-time dynamic weights The weight calculation formula is as follows: in, Represents the weight of timeliness. Represents the weight of context relevance. Represents the weight of factual stability. Represents the fused spectrum Any node or edge in the array; For predefined weighting coefficients, satisfying These weight coefficients are determined through pre-training on datasets containing different task preferences; based on the calculated dynamic weights... Value, pair Filtering and hierarchical division are performed to form a multi-level dynamic semantic graph (DSG), including a fact layer, a concept layer, a causal relationship layer, and a temporal relationship layer.
8. The text summarization generation device based on semantic graph and real-time fact verification according to claim 6, characterized in that, The logic chain extraction and planning instruction generation module is specifically used for: employing a graph attention model (GAT), which is trained on the dynamic semantic graph (DSG) to learn node embeddings that can capture node structure information and dynamic weights. The input of the GAT is the initial feature vector of the nodes in the DSG. Neighbor information is aggregated through a multi-layer attention mechanism to obtain the context-aware embedding of each node. Based on the task target embedding vector encoded from the user instructions in the input information, the cosine similarity between the final embeddings of all nodes in the DSG and the task target embeddings is calculated, and nodes with similarity higher than a threshold are selected. The nodes, including all their first-degree neighbors and their connecting edges, form a core-related subgraph. ; Based on the core related subgraph The causal chain, temporal chain, and logical reasoning chain are explicitly extracted. All extracted causal chains, temporal chains, and logical reasoning chains are encoded, and the dynamic weights of the nodes involved in the chains are used as the basis for the encoding. Based on the average value and the length of the chain, all chains are prioritized; the chain with the highest priority is then prioritized. The chains described above are combined into a structured sequence of planning instructions.
9. The text summarization generation device based on semantic graph and real-time fact verification according to claim 6, characterized in that, The text generation module is specifically configured to: employ a pre-trained large-scale generative model T5-XXL and adjust its architecture to Decoder-only mode; introduce a planning instruction attention module into the self-attention layer of the pre-trained T5-XXL model in Decoder-only mode, wherein the planning instruction attention module embeds the encoded planning instruction as an additional key-value sequence; for the query vector of the current decoding step... The pre-trained T5-XXL model in Decoder-only mode calculates the generated text history. Target attention It also supports parallel computing and planning instructions. Target attention The final context vector It is the weighted sum of the two: Wherein the fusion coefficient This indicates that historically generated content dominates during fusion, with the planning instructions providing important supplementary guidance. A lexicon bias dictionary is dynamically constructed based on the entities, relationships, and events explicitly mentioned in the planning instructions and key facts in the dynamic semantic graph (DSG). At each decoding step, after the pre-trained T5-XL model in Decoder-only mode generates the non-standardized probability Logit for the next text unit, the Logit value for words highly relevant to the content of the planning instructions is multiplied by an enhancement factor. For terms that explicitly contradict the content of the planning instructions, their Logit value is multiplied by a penalty factor. The pre-trained T5-XXL model in Decoder-only mode generates text using a beam search method under the aforementioned constraints, with the beam width set to [value missing]. In each decoding step, the one with the highest probability is selected. The sequence of text units continues to expand; each generated text unit is immediately subject to real-time fact-checking.
10. The text summarization generation device based on semantic graph and real-time fact verification according to claim 6, characterized in that, The real-time fact-checking module is specifically used to: whenever the pre-trained T5-XXL model in Decoder-only mode generates a text unit The text unit and before A text fragment composed of generated text units Three-dimensional verification is performed, including internal consistency verification, external fact verification, and logical consistency verification; for each generated text unit... Calculate a comprehensive confidence level If the internal consistency check results are inconsistent, If the external fact-checking results are inconsistent, If the logical consistency check results are inconsistent... ;in It is a predefined penalty coefficient; if the calculated comprehensive confidence level Below the preset threshold , will generate the current step In the Logit distribution, this leads to inconsistencies in the text units. The Logit value multiplied by a very small inhibition factor Perform strong suppression, then resample a text unit from the corrected Logit distribution. If resampling If the text unit fails to pass the verification after this step, the currently generated text unit is cancelled. And backtrack to the previous generation step Logit correction and text unit sampling are performed again; simultaneously, in the generation step after backtracking... In this context, the penalty factor is increased to address the inconsistencies in the chain. The backtracking depth is limited to Step 1: For specific planning instruction fragments that frequently cause inconsistencies during continuous generation, reduce their corresponding fusion coefficient. And adjust the enhancement factor of its corresponding Logit. The fusion coefficient mentioned after successfully generating a piece of text and the enhancement factor Automatically restores to the initial value.
11. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1-5.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that performs the method according to any one of claims 1-5.