Context-driven text authoring system

CN122947760APending Publication Date: 2026-10-20TIBET LANSA ZHIHUI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611179607.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-05
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0005]本发明提供了一种面向上下文驱动的文本创作系统,通过构建动态更新的意图知识图谱并引入结构一致性校验与逆向意图动态反馈机制,解决长文本生成中固定截断导致的逻辑割裂与局部修改引发的全局设定冲突问题,实现逻辑严密且随用户意图实时协同的长文本驱动创作

Benefits of technology

[0051]本发明有效克服现有技术中基于固定数量截断导致的上下文逻辑割裂问题,通过上下文图谱构建模块,将用户的创作意图转化为动态更新的知识图谱,确定全局核心节点的权重下限,消除长文本生成中的全局逻辑断裂问题;通过语义分块提示模块引入社区发现算法,实现依据图谱结构的逻辑闭环分块,避免了生硬截断。同时,创作校验模块将概率性的文本生成与确定性的图谱结构结合,实现逆向特征抽取与多维一致性打分,。此外,意图反馈模块将用户的文本修改动作逆向转化为图谱修正信号,并触发受影响下游节点的动态重构,避免前文已改、后文依然按照旧设定生成的逻辑断裂现象,实现了高逻辑严密性与意图高度一致的长文本动态协同创作。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure QLYQS_2
    Figure QLYQS_2
  • Figure QLYQS_12
    Figure QLYQS_12
Patent Text Reader

Abstract

This invention relates to the field of natural language processing technology and discloses a context-driven text creation system, comprising: a context graph construction module for extracting initial creation intent to construct an intent knowledge graph, and dynamically updating the graph by extracting semantic features based on the generated text; a semantic block prompting module for dividing the task into multiple semantic blocks according to the logical topological relationship of the graph, and dynamically generating adaptive prompt words by combining global core nodes and extracted local graph subtrees; a creation verification module for generating text based on prompt words, extracting the logical feature structure of the text in reverse and performing consistency comparison and verification with the knowledge graph before outputting the text; and an intent feedback module for acquiring user modification actions, converting them into correction signals to update the graph, and triggering dynamic reconstruction of prompt words that have not yet generated blocks. This invention effectively avoids the problem of logical fragmentation in long text generation, ensuring global coherence and consistency of dynamic intent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and in particular to a context-driven text creation system. Background Technology

[0002] In recent years, with the rapid development of natural language processing technology and large language models (LLM), artificial intelligence has shown great potential in the fields of text generation and assisted creation. However, existing text creation systems still have the following significant shortcomings when dealing with the generation of long texts with strict logical requirements (such as patent specifications, novels, legal reports, etc.):

[0003] First, limited by the model's context window size, existing systems typically employ mechanical truncation methods based on a fixed number of tokens or simple punctuation marks for text segmentation. This approach easily severs the inherent semantic connections within the text, leading to severe fragmentation of contextual logic. Second, most existing text generation processes are unidirectional probabilistic predictions, lacking deterministic global memory and structured verification mechanisms. As text length increases, the system easily forgets core global settings, resulting in logical breaks. Finally, existing systems lack deep dynamic intent feedback mechanisms. When a user modifies a portion of the generated text, the system cannot reverse-engineer this natural language modification into a global logical layer correction. Consequently, subsequent ungenerated text continues to be generated according to the old settings, creating a disastrous continuity where previously modified text contradicts subsequent logical conflicts.

[0004] Therefore, how to provide a text creation system that can dynamically maintain global context memory, has rigorous logical verification, and can be updated in real time according to user intent is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] This invention provides a context-driven text creation system. By constructing a dynamically updated intent knowledge graph and introducing a structural consistency check and a reverse intent dynamic feedback mechanism, it solves the problems of logical fragmentation caused by fixed truncation and global setting conflicts caused by local modifications in long text generation, and realizes long text-driven creation with rigorous logic and real-time collaboration with user intent.

[0006] This invention provides a context-driven text creation system, including a context graph construction module, a semantic block prompting module, a creation verification module, and an intent feedback module. The context graph construction module is connected to the semantic block prompting module, the creation verification module, and the intent feedback module, respectively. The semantic block prompting module is also connected to the creation verification module and the intent feedback module.

[0007] The context graph construction module is used to receive the user's initial creative intent, extract the core entity nodes in the initial creative intent and the logical topological relationships between the core entity nodes, and construct an intent knowledge graph; and to receive the context-driven text output by the creation verification module, and extract the semantic features of the context-driven text to update the core entity nodes and logical topological relationships in the intent knowledge graph.

[0008] The semantic segmentation prompting module is used to determine the text creation task based on the initial creative intent, and divide the text creation task into multiple semantic segments according to the current logical topology of the intent knowledge graph. For any target semantic segment to be generated, the module extracts the graph subtree corresponding to the target semantic segment from the intent knowledge graph, and generates adaptive prompt words by combining the global core nodes identified in the intent knowledge graph.

[0009] The creation verification module is used to generate initial block text based on the adaptive prompt words, extract the logical feature structure of the initial block text, compare the logical feature structure with the intent knowledge graph for consistency, and output context-driven text after the comparison is passed.

[0010] The intent feedback module is used to obtain the modification action for the context-driven text and generate a correction signal, which is transmitted to the context graph construction module to correct the intent knowledge graph and trigger the semantic block prompting module to regenerate adaptive prompt words for the ungenerated semantic blocks using the corrected intent knowledge graph.

[0011] Furthermore, the context graph construction module includes an initial intent parsing unit, a topology graph initialization unit, a feedback feature extraction unit, and a weight update unit;

[0012] The initial intent parsing unit is used to receive the initial creative intent, perform structured mapping on the initial creative intent through a predefined intent meta-graph, classify and map the identified words into core entity nodes that contain at least topic entities, constraint entities, and feature entities, and extract the logical topological relationships between the core entity nodes according to the syntactic dependency relationships of the initial creative intent; wherein, the logical topological relationships include at least one of the following: total-to-part inclusion relationship, temporal progression relationship, and style constraint relationship;

[0013] The topology graph initialization unit is used to construct an initial intent knowledge graph based on the extracted core entity nodes and logical topological relationships, using the core entity nodes as nodes and the logical topological relationships as edges; and to assign initial weight values ​​to the nodes and edges based on the frequency of the entities appearing in the initial creative intent and the syntactic level depth.

[0014] The feedback feature extraction unit receives the context-driven text output by the creation verification module, uses the encoder of the large language model to convert the context-driven text into a high-dimensional text feature vector, performs inverse entity and relation extraction on the context-driven text based on the intent meta-graph, constructs a temporary local feedback subgraph, calculates the cosine similarity between the new entity vector in the local feedback subgraph and the node vector of the original node in the intent knowledge graph, and outputs structured semantic features based on the calculation result; wherein, the semantic features include activation features output when the similarity is greater than a preset second threshold, and derived features output when there are new entities that are not matched but have logical dependencies;

[0015] The weight update unit is used to update the core entity nodes and logical topological relationships in the intent knowledge graph based on the semantic features.

[0016] Furthermore, the topology map initialization unit further includes:

[0017] The centrality score of each node is calculated using the graph centrality algorithm. When the centrality score of the target node is higher than a preset first threshold, or when the target node belongs to the constrained entity, a global label is bound to the target node, establishing it as a global core node in the intent knowledge graph, and the lower limit of the basic weight of the global core node is determined.

[0018] Furthermore, the weight update unit specifically includes:

[0019] When the derived feature is received, a new node is created in the intent knowledge graph, and connection edges with existing nodes are established according to the context semantics;

[0020] When the activation feature is received, the intent knowledge graph is updated using a weight update formula with a time decay factor. The activation weight of node i after generating the t-th semantic block is... The update formula is:

[0021]

[0022] in, Let be the weight of node i at the previous time step; The preset time decay factor; The entity corresponding to node i; The most recently generated context-driven text; For the entity The context-driven text Semantic relevance score in;

[0023] If the activation weight of node i If the value of node i falls below a preset dormancy threshold after decay, and node i does not belong to the global core node, then node i and its connected edges are hidden or pruned in the intent knowledge graph.

[0024] Furthermore, the semantic segmentation prompting module includes a graph perception task planning unit, a local graph subtree extraction unit, and a global constraint unit;

[0025] The graph perception task planning unit is used to determine the text creation task based on the initial creative intent, and according to the current logical topology of the intent knowledge graph, to perform network graph clustering analysis on the current logical topology of the intent knowledge graph using a community detection algorithm, to identify multiple subgraph communities in the intent knowledge graph whose node connection cohesion is higher than a preset value, to map each subgraph community to a corresponding semantic block, and to arrange the multiple semantic blocks into an execution queue to be generated according to the temporal topology of the directed edges between the subgraph communities.

[0026] The local graph subtree extraction unit is used to determine the core anchor point corresponding to any target semantic block to be generated in the intent knowledge graph based on the centrality calculation result. Starting from the core anchor point, it performs a breadth-first search or random walk with a preset number of hops depth in the current intent knowledge graph, traverses and extracts all relevant nodes and their connecting edges within the preset number of hops depth, and constructs the extracted relevant nodes and their connecting edges into the graph subtree.

[0027] The global constraint unit is used to combine the global core nodes identified in the intent knowledge graph, merge the graph subtree with the global core nodes, and generate the adaptive prompt words.

[0028] Furthermore, the global constraint unit specifically includes:

[0029] Initiate a call request to the context graph construction module to obtain the global core node that has been assigned a global label;

[0030] The extracted graph subtrees and the obtained global core nodes are serialized to transform their network graph structure data into structured natural language relation description text.

[0031] Retrieve a preset prompt word template, load the serialized global core node into the global constraint region of the prompt word template, load the serialized graph subtree into the local context region of the prompt word template, and attach the text generation instruction of the current target semantic block to generate the adaptive prompt word.

[0032] Furthermore, the creation verification module includes a text generation execution unit, a logical feature reverse extraction unit, a structural consistency comparison unit, and a result output unit;

[0033] The text generation execution unit is used to receive the adaptive prompt words and input them into a pre-trained large language model to generate the initial chunked text;

[0034] The logical feature reverse extraction unit is used to identify entities and logical connections between entities in the initial block text using a preset information extraction model, encapsulate the identified entities and logical connections into a set of triples, and construct a directed logical feature structure based on the set of triples.

[0035] The structural consistency comparison unit is used to compare the logical feature structure with the intent knowledge graph and calculate the structural consistency score.

[0036] The result output unit is used to make a decision based on the structural consistency score, and outputs the context-driven text after the comparison is passed.

[0037] Furthermore, in the structural consistency comparison unit, calculating the structural consistency score specifically includes:

[0038] The logical feature structure is mapped to the currently active subtrees in the intent knowledge graph using graph isomorphism mapping, and a multidimensional consistency scoring model is used to calculate the structural consistency score. The calculation formula is:

[0039]

[0040] in, The proportion of entities contained in the logical feature structure that are hit in the graph subtree; The consistency ratio between the logical topological relationship direction between entities and the edge direction in the graph subtree; This is a hard conflict penalty term between the logical feature structure and the intent knowledge graph; These are the preset weighting coefficients.

[0041] Furthermore, the decision-making process based on the structural consistency score in the result output unit specifically includes:

[0042] The structural consistency score Compare with the preset tolerance threshold;

[0043] If the structural consistency score If the value is less than the tolerance threshold, then the features in the logical feature structure that cause conflict are identified, and the conflict features are converted into correction instructions and fed back to the text generation execution unit to trigger the regeneration of the initial block text;

[0044] If the structural consistency score If the value is greater than or equal to the tolerance threshold, then the initial segmented text is subjected to referential resolution processing and transitional connecting words between segments are generated, and the context-driven text is output.

[0045] Furthermore, the intent feedback module includes an interactive action parsing unit, a correction signal conversion unit, a graph reverse correction instruction unit, and a task dynamic reconstruction unit;

[0046] The interactive action parsing unit is used to obtain the modification action for the context-driven text, extract the difference text fragments between the modified text and the original text before modification, use a natural language understanding model to identify whether there are entity attribute changes, new entity introductions or logical relationship reversals in the difference text fragments, and determine the difference text fragments as valid modification actions when they exist.

[0047] The correction signal conversion unit is used to map the natural language change corresponding to the effective modification action into a graph operation primitive according to a preset action mapping rule. The graph operation primitive includes at least one of node deletion, node addition, or edge relationship update. The unit encapsulates the graph operation primitive and its associated semantic block identifier to generate a correction signal.

[0048] The graph reverse correction instruction unit is used to transmit the correction signal to the context graph construction module and assign the correction signal an execution priority higher than the system automatic update weight, so as to forcibly cover the original entity nodes or logical topological relationships in the intent knowledge graph and realize the correction of the intent knowledge graph.

[0049] The task dynamic reconstruction unit is used to trigger the semantic block prompting module to regenerate adaptive prompt words for ungenerated semantic blocks. Specifically, it performs a topological traversal starting from the corrected node or edge in the intent knowledge graph, identifies the downstream nodes affected by the correction signal, marks the ungenerated semantic blocks involving the downstream nodes as dirty, and triggers the semantic block prompting module to re-execute graph subtree extraction and adaptive prompt word generation for the semantic blocks in the dirty state.

[0050] The beneficial effects of this invention are as follows:

[0051] This invention effectively overcomes the problem of contextual logic fragmentation caused by fixed-quantity truncation in existing technologies. Through a context graph construction module, it transforms the user's creative intent into a dynamically updated knowledge graph, determines the lower limit of the weight of global core nodes, and eliminates the problem of global logical breaks in long text generation. A semantic segmentation prompt module introduces a community detection algorithm to achieve logical closed-loop segmentation based on the graph structure, avoiding abrupt truncation. Simultaneously, the creation verification module combines probabilistic text generation with a deterministic graph structure to achieve reverse feature extraction and multi-dimensional consistency scoring. Furthermore, the intent feedback module reverse-engineers the user's text modification actions into graph correction signals and triggers dynamic reconstruction of affected downstream nodes, avoiding the logical break phenomenon where subsequent text is generated according to the old settings even after previous text has been modified. This achieves dynamic collaborative creation of long texts with high logical rigor and high consistency of intent. Attached Figure Description

[0052] Figure 1 This is a schematic diagram of the structure of the context-driven text creation system of the present invention.

[0053] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0054] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0055] like Figure 1 As shown, the present invention provides a context-driven text creation system, including a context graph construction module, a semantic block prompting module, a creation verification module, and an intent feedback module. The context graph construction module is connected to the semantic block prompting module, the creation verification module, and the intent feedback module respectively. The semantic block prompting module is also connected to the creation verification module and the intent feedback module.

[0056] The context graph construction module is used to receive the user's initial creative intent, extract the core entity nodes in the initial creative intent and the logical topological relationships between the core entity nodes, and construct an intent knowledge graph; and to receive the context-driven text output by the creation verification module, and extract the semantic features of the context-driven text to update the core entity nodes and logical topological relationships in the intent knowledge graph.

[0057] The semantic segmentation prompting module is used to determine the text creation task based on the initial creative intent, and divide the text creation task into multiple semantic segments according to the current logical topology of the intent knowledge graph. For any target semantic segment to be generated, the module extracts the graph subtree corresponding to the target semantic segment from the intent knowledge graph, and generates adaptive prompt words by combining the global core nodes identified in the intent knowledge graph.

[0058] The creation verification module is used to generate initial block text based on the adaptive prompt words, extract the logical feature structure of the initial block text, compare the logical feature structure with the intent knowledge graph for consistency, and output context-driven text after the comparison is passed.

[0059] The intent feedback module is used to obtain the modification action for the context-driven text and generate a correction signal, which is transmitted to the context graph construction module to correct the intent knowledge graph and trigger the semantic block prompting module to regenerate adaptive prompt words for the ungenerated semantic blocks using the corrected intent knowledge graph.

[0060] (1) Context graph construction module

[0061] In a specific embodiment of the present invention, in order to achieve structured processing of intent and dynamic updating of global context, the context graph construction module includes an initial intent parsing unit, a topology graph initialization unit, a feedback feature extraction unit, and a weight update unit.

[0062] Regarding the initial intent parsing unit:

[0063] It receives the user's initial creative intent and extracts core entity nodes and the logical topological relationships between them. Specifically,

[0064] By invoking a pre-trained Natural Language Understanding (NLU) model, the system performs word segmentation, part-of-speech tagging, and basic Named Entity Recognition (NER) on the user-input natural language prompts. Unlike conventional general information extraction, a dedicated intent meta-graph is defined for the text creation task. Specifically, identified words are mapped to core entity nodes of specific types, and logical topological relationships are extracted based on a syntactic dependency tree.

[0065] Core entity nodes are forcibly divided into at least three categories: topic entities (such as patent applications, protagonist names), constraint entities (such as word limits, suspense style), and feature entities (such as knowledge graphs, comparison algorithms). Logical topological relationships are not limited to conventional verb-object relationships but are defined as structured paths guiding text generation, such as total-to-specific inclusion relationships (topic entities pointing to feature entities), temporal progression relationships (event A entity pointing to event B entity), and style constraint relationships (constraint entities pointing to all nodes). Through this mapping, an unstructured piece of intent text is transformed into an initial topological set containing multi-dimensional nodes and directed edges.

[0066] Regarding the aforementioned topology map initialization unit:

[0067] Based on the extracted core entity nodes and logical topological relationships, an intent knowledge graph is constructed, and global core nodes are identified from it. Specifically,

[0068] The above topology set is written into a graph database or in-memory vector database to establish basic physical connections between points and edges. To determine the global core nodes, a centrality evaluation and hard-labeling algorithm is executed during the graph initialization phase, specifically:

[0069] Based on the frequency of entities appearing in the user's initial input and their level depth in the syntactic tree, each node and edge is assigned an initial weight value (e.g., the initial weight of the subject entity is set to the highest value of 1.0). A graph centrality algorithm (such as a variant of PageRank) is used to calculate the centrality score of each node. When a node's centrality score is higher than a preset first threshold, or when the node belongs to a constraint entity explicitly specified by the user (such as global background, core protagonist, or key technical purpose), the node is automatically labeled "global," making it a global core node. The initial weights of these nodes with the "global" label are locked at a basic lower bound during subsequent generation (they will not decay to zero), ensuring that they always serve as absolute contextual anchors throughout the entire creation lifecycle of the article.

[0070] Regarding the feedback feature extraction unit:

[0071] The system receives the context-driven text output by the author verification module and extracts the semantic features of the context-driven text. Specifically,

[0072] The encoder layer of the large language model is invoked to transform the newly generated context-driven text (i.e., new paragraphs) into high-dimensional text feature vectors. If only vectors are extracted, the graph cannot be updated. Therefore, the unstructured new text is decomposed into structured semantic features that the graph can recognize. The process is as follows:

[0073] First, using the same intent meta-graph as the initial intent parsing unit, the newly generated text is scanned to extract new entities and relationships within the paragraph, constructing a temporary local feedback subgraph. Then, this local feedback subgraph is aligned and matched with the current intent knowledge graph. The cosine similarity between the new entity vector and the original graph node vectors is calculated. Based on the similarity calculation results, a structured semantic feature instruction set is output, specifically including: 1) Successfully matched entities (e.g., similarity > 0.85), indicating that the original context is inherited, and outputting reinforcement of the original nodes. 2) New entities that fail to match but have a strong logical dependency on the original nodes (such as dynamically updated formulas newly created in the text following the knowledge graph), output the new node. To the original node 3) If the attributes extracted from the new text contradict the original graph (for example, the original setting was automatic verification, but the new text was written as manual verification), then it is extracted as a conflict feature and an error alarm signal is output (this part of the signal is processed by the creation verification module).

[0074] Regarding the weight update unit:

[0075] This is used to update the core entity nodes and logical topological relationships in the intent knowledge graph based on the semantic features output by the feedback feature extraction unit, in order to maintain the dynamic updating of the global context. Specifically,

[0076] In the process of text creation, new concepts will inevitably emerge naturally. When the derived features output by the feedback feature extraction unit are received (i.e., new entities that have not been matched successfully but have logical dependencies appear in the new text), a new node is created in the intent knowledge graph, and the connection edges between the new node and the existing nodes in the graph are established according to the contextual semantics (such as the results of syntactic dependency analysis), so as to realize the dynamic growth of the graph structure.

[0077] When an activation feature is received (i.e., a new text that mentions or reinforces an entity already present in the original knowledge graph), the intent knowledge graph is updated using a weight update formula with a time decay factor. Specifically, the activation weight of node i after generating the t-th semantic block... The dynamic update formula is as follows:

[0078]

[0079] in, The weight of node i at the previous time step (i.e., after the generation of the (t-1)th block) represents the historical memory strength of that node. A preset time decay factor (preferably between 0.8 and 0.95) is used to simulate the natural forgetting rate of human memory. The smaller the value, the faster historical texts are forgotten; The entity corresponding to node i; The most recently generated context-driven text (i.e., the latest paragraph); For the entity The context-driven text The semantic relevance score (which can be obtained by calculating the similarity between the entity vector and the text vector, representing the degree of activation of the entity in the current paragraph).

[0080] After completing the above weight calculation, traverse the graph. If the activation weight of node i is... As text is continuously generated and decays multiple times, eventually falling below a preset dormancy threshold, the node will be processed to release computing resources and prevent contextual noise. A strict security verification mechanism is introduced during this process: first, the tag attribute of node i is determined; only if node i does not belong to the global core node is node i and its connected edges temporarily hidden or pruned in the intent knowledge graph. This ensures that minor details in long text creation are gradually forgotten, but the lower limit of the weight of the core macro-setting (global core node) is locked and will never be pruned, thereby eliminating the problem of global logical breaks in long text generation.

[0081] (2) Semantic block prompting module

[0082] In one specific embodiment of the present invention, in order to overcome the problem of fragmented contextual logic caused by relying on a fixed number of tokens or simple punctuation truncation in the prior art, the present invention relies on the structural features of the intent knowledge graph for task decomposition. The semantic block prompting module includes a graph perception task planning unit, a local graph subtree extraction unit, and a global constraint unit.

[0083] Regarding the map perception task planning unit:

[0084] Based on the initial creative intent, a text creation task is determined, and according to the current logical topology of the intent knowledge graph, the text creation task is divided into multiple semantic blocks with independent logical boundaries. Specifically,

[0085] First, the overall text creation goal, either input by the user or set by the system default, is received and treated as the macro-level text creation task. Unlike traditional linear sliding window segmentation, this invention employs community detection algorithms from graph theory (such as the Louvain algorithm or the Girvan-Newman algorithm based on edge betweenness) to perform network graph clustering analysis on the current intent knowledge graph. Through community detection algorithms, tightly connected, highly cohesive node clusters in the graph are identified as independent subgraph communities, and each subgraph community is mapped to a corresponding semantic block. For example, the node cluster related to "background defects" is divided into "block A," and the node cluster related to "core algorithm logic" is divided into "block B." This segmentation method ensures that each segmentation results in a complete logical loop, thus avoiding abrupt truncation of sentences. After segmentation, these semantic blocks are arranged into an execution queue to be generated based on the temporal topological relationships between nodes or the direction of directed edges.

[0086] Regarding the local map subtree extraction unit:

[0087] For any target semantic block to be generated, a graph subtree corresponding to the target semantic block is extracted from the intent knowledge graph. Specifically,

[0088] When preparing to generate a target semantic block in the execution queue, the core anchor point (i.e., the node with the highest centrality within the subgraph community) corresponding to that block is first determined in the graph. Starting from this core anchor point, a breadth-first search or random walk of a preset depth (e.g., N=2) is performed in the current intent knowledge graph to traverse and extract all relevant nodes and their connections (edges) within a range of N hops. The nodes and edges extracted in the above traversal are extracted from the vast global graph to form a lightweight local graph subtree containing only the current creative focus. This subtree represents the local context that the current paragraph truly needs to focus on, effectively filtering out long-term memory noise that is irrelevant to the current paragraph.

[0089] Regarding the global constraint unit:

[0090] By combining the global core nodes identified in the intent knowledge graph, the graph subtree is fused with the global core nodes to generate adaptive prompt words. Specifically,

[0091] A request is sent to the context graph construction module to retrieve the global core nodes that have been assigned global hard tags (such as the theme settings, word limits, or technical axioms that cannot be violated, as mentioned above). Since the Large Language Model (LLM) cannot directly read the physical structure of the graph database, the extracted local graph subtrees and global core nodes need to be serialized. Preferably, they are converted into structured JSON format or Markdown nested list form. For example, nodes and edges are converted into a natural language relationship description of "entity A - [leads to] → entity B". The global constraint unit has multiple preset prompt word templates. The serialized global nodes are filled into the system global constraint area of ​​the template, and the serialized local graph subtrees are filled into the current local context area of ​​the template, along with the generation instructions for the current target semantic block. After fusion and filling, highly targeted adaptive prompt words are finally generated. These prompt words have both a macro-level global perspective and a micro-level local focus, and are transmitted to the author verification module to guide specific text generation actions.

[0092] (3) Creation verification module

[0093] In a specific embodiment of the present invention, the creation verification module ensures that the generated text does not deviate from the global context logic, and deeply couples the probabilistic text generation process with the deterministic graph structure verification. The creation verification module includes a text generation execution unit, a logical feature reverse extraction unit, a structural consistency comparison unit, and a result output unit.

[0094] Regarding the text generation execution unit:

[0095] The system receives adaptive prompts from the semantic segmentation prompt module and generates initial segmented text based on these prompts. Specifically,

[0096] After receiving adaptive prompts containing global constraints and local context, these are fed into a pre-trained large language model. During generation, generation parameters (such as Temperature and Top-p) are dynamically adjusted based on the density of the spectral subtrees in the prompts. For example, when the local spectral subtrees are extremely densely connected (indicating that the paragraph is technically detailed), the Temperature parameter is automatically lowered to reduce divergence, outputting preliminary initial chunked text.

[0097] Regarding the aforementioned logical feature reverse extraction unit:

[0098] The logical feature structure of the initial segmented text is extracted to achieve dimensionality reduction mapping from unstructured text to structured features. Specifically...

[0099] Since the initial segmented text is a plain text string, it cannot be directly compared with the intent knowledge graph. Therefore, the information extraction model is invoked to scan the newly generated initial segmented text. The text extracts clearly directional "subject-verb-object" or "entity-relationship-entity" structures and encapsulates them into a set of triples. For example, if the text is "This system uses a community detection algorithm for segmentation," then the feature triples <this system, uses, community detection algorithm> and <community detection algorithm, used for, segmentation> are extracted. This set of triples is then used to construct a small, directed logical feature structure (temporary feature graph).

[0100] Regarding the structural consistency comparison unit:

[0101] The logical feature structure is compared with the intent knowledge graph for consistency, and a comparison score is calculated. Specifically,

[0102] The extracted logical feature structure (temporary feature map) is then matched with the currently active local subtrees and global core nodes in the intent knowledge graph using graph isomorphism matching. A pre-defined multidimensional consistency scoring model is used to calculate the logical accuracy of the text. The calculation formula is as follows:

[0103]

[0104] in, The final structural consistency score; Entity matching rate, which is the proportion of entities contained in the logical feature structure that are matched in the corresponding subtree of the intent knowledge graph; The relationship matching rate is the proportion of consistency between the logical topological relationship direction between entities and the connection direction set in the graph. For hard conflict penalty terms (e.g., the graph explicitly records that entity A and entity B are not connected, but a strong correlation appears in the generated text feature structure), once a conflict is triggered, It amplifies exponentially; The weighting coefficients preset for the system.

[0105] Regarding the result output unit:

[0106] Decisions are made based on consistency comparison results. After the comparison passes, post-processing is performed, and context-driven text is output. Specifically,

[0107] The calculated With the preset tolerance threshold Compare them.

[0108] like If the verification fails, it indicates that the generated text has a logical break. The conflict features that caused the deduction will be extracted and converted into natural language correction instructions (such as "Please note that entity A should not contain entity B, please rewrite this paragraph"), and this instruction will be fed back to the text generation execution unit to trigger the regeneration of the segmented text.

[0109] like If the validation is successful, the text logical structure is deemed valid and the text is output.

[0110] Before the formal output, the initial block text that has passed the verification is subjected to linguistic smoothing (such as pronoun resolution, replacing awkward entity nouns with pronouns such as "it", "method", etc.), and transitional connectors that connect with the previously generated blocks are generated. Finally, the logically rigorous and fluent context-driven text is output.

[0111] (4) Intent Feedback Module

[0112] In a specific embodiment of the present invention, the intent feedback module reverse-engineers the editing action of the text layer to the graph logic layer, thereby dynamically influencing the subsequent generation trajectory. The intent feedback module includes an interactive action parsing unit, a correction signal conversion unit, a graph reverse correction instruction unit, and a task dynamic reconstruction unit.

[0113] Regarding the interactive action parsing unit:

[0114] The system monitors and acquires user modifications to the context-driven text (i.e., text paragraphs generated by the system) in real time, and performs semantic-level difference analysis. Specifically,

[0115] In the front-end interactive interface (such as a rich text editor), a text listener is set up. When the user adds, deletes, or modifies the output context-driven text and confirms, the modified text and the original text before modification are extracted. To filter out meaningless modifications (such as simple punctuation corrections or typo corrections), a difference comparison algorithm based on natural language understanding is used. That is, the text before and after modification are input into an encoder to extract feature vectors, and entity and relation recognition is performed. Only when the text modification leads to a change in entity attributes, the introduction of new entities, or a reversal of logical relationships between entities is it judged as a valid modification action, and the specific difference text fragments are extracted.

[0116] Regarding the aforementioned corrected signal conversion unit:

[0117] The modifications deemed valid are converted into structured correction signals for recognition by the underlying mapping system. Specifically,

[0118] The built-in action mapping rule library of the signal conversion unit has been modified to convert natural language-level modifications into graph operation primitives. For example, if a user deletes a character's description in the text, it is mapped to the graph operation: [DELETE_NODE, entity A]; if a user changes "this technology improves efficiency" to "this technology reduces costs" in the text, it is mapped to the graph operation: [UPDATE_EDGE, entity A, entity B, new relation: reduced costs]; if a user forcibly inserts a completely new background setting into a paragraph, it is mapped to the graph operation: [ADD_SUBGRAPH, new node set, new edge set].

[0119] The above graph operation primitives, along with their timestamps and associated context block IDs, are encapsulated to generate standardized correction signal data packets.

[0120] Regarding the aforementioned map reverse correction instruction unit:

[0121] The correction signal is transmitted to the context graph construction module to instruct it to accurately correct the intent knowledge graph. Specifically,

[0122] The correction signal is directed to the context graph construction module. To ensure the stability of the graph, a snapshot of the current graph state is saved before sending. Upon receiving this correction signal, the context graph construction module is forced to trigger an update. This correction signal from the user is given the highest priority. Even if the user's modification contradicts the initial creative intent, the latest modification is strictly taken as the standard, forcibly updating the core entity nodes or logical topological relationships in the intent knowledge graph, thereby achieving a global memory refresh.

[0123] Regarding the aforementioned task dynamic reconstruction unit:

[0124] After the intent knowledge graph is corrected, the semantic block prompting module is triggered to regenerate adaptive prompt words for the ungenerated semantic blocks using the corrected intent knowledge graph. Specifically:

[0125] To conserve computing power, the system does not blindly reconstruct all ungenerated blocks. After graph correction, a "dependency infection check" is performed based on the graph's connectivity. Starting from the modified node or edge, the system traverses backward along the directed edges of the logical topology, marking all "downstream nodes" affected by the modification. Semantic blocks containing these "affected downstream nodes" are marked as "dirty." The semantic block hinting module is then triggered, requiring it to re-execute the local graph subtree extraction and global constraint fusion operations only for these ungenerated semantic blocks in the "dirty state."

[0126] Through the above mechanism, due to a user's modification of a core setting in the Nth block of text, the system automatically detects and rewrites the underlying prompts for the N+2 and N+5th blocks. When these blocks are generated further, the large model will receive adaptive prompts containing the latest user intent, avoiding the logical break of "the preceding text has been modified, but the following text is still generated according to the old settings".

[0127] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0128] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A context-driven text creation system, characterized in that, It includes a context graph construction module, a semantic block prompting module, a creation verification module, and an intent feedback module. The context graph construction module is connected to the semantic block prompting module, the creation verification module, and the intent feedback module, respectively. The semantic block prompting module is also connected to the creation verification module and the intent feedback module. The context graph construction module is used to receive the user's initial creative intent, extract the core entity nodes in the initial creative intent and the logical topological relationships between the core entity nodes, and construct an intent knowledge graph. It also receives the context-driven text output by the creation verification module and extracts the semantic features of the context-driven text to update the core entity nodes and logical topological relationships in the intent knowledge graph. The semantic segmentation prompting module is used to determine the text creation task based on the initial creative intent, and divide the text creation task into multiple semantic segments according to the current logical topology of the intent knowledge graph. For any target semantic segment to be generated, the module extracts the graph subtree corresponding to the target semantic segment from the intent knowledge graph, and generates adaptive prompt words by combining the global core nodes identified in the intent knowledge graph. The creation verification module is used to generate initial block text based on the adaptive prompt words, extract the logical feature structure of the initial block text, compare the logical feature structure with the intent knowledge graph for consistency, and output context-driven text after the comparison is passed. The intent feedback module is used to obtain the modification action for the context-driven text and generate a correction signal, which is transmitted to the context graph construction module to correct the intent knowledge graph and trigger the semantic block prompting module to regenerate adaptive prompt words for the ungenerated semantic blocks using the corrected intent knowledge graph.

2. The context-driven text creation system according to claim 1, characterized in that, The context graph construction module includes an initial intent parsing unit, a topology graph initialization unit, a feedback feature extraction unit, and a weight update unit; The initial intent parsing unit is used to receive the initial creative intent, perform structured mapping on the initial creative intent through a predefined intent meta-graph, classify and map the identified words into core entity nodes that contain at least topic entities, constraint entities, and feature entities, and extract the logical topological relationships between the core entity nodes according to the syntactic dependency relationships of the initial creative intent; wherein, the logical topological relationships include at least one of the following: total-to-part inclusion relationship, temporal progression relationship, and style constraint relationship; The topology graph initialization unit is used to construct an initial intent knowledge graph based on the extracted core entity nodes and logical topological relationships, using the core entity nodes as nodes and the logical topological relationships as edges; and to assign initial weight values ​​to the nodes and edges based on the frequency of the entities appearing in the initial creative intent and the syntactic level depth. The feedback feature extraction unit receives the context-driven text output by the creation verification module, uses the encoder of the large language model to convert the context-driven text into a high-dimensional text feature vector, performs inverse entity and relation extraction on the context-driven text based on the intent meta-graph, constructs a temporary local feedback subgraph, calculates the cosine similarity between the new entity vector in the local feedback subgraph and the node vector of the original node in the intent knowledge graph, and outputs structured semantic features based on the calculation result; wherein, the semantic features include activation features output when the similarity is greater than a preset second threshold, and derived features output when there are new entities that are not matched but have logical dependencies; The weight update unit is used to update the core entity nodes and logical topological relationships in the intent knowledge graph based on the semantic features.

3. The context-driven text creation system according to claim 2, characterized in that, The topology map initialization unit further includes: The centrality score of each node is calculated using the graph centrality algorithm. When the centrality score of the target node is higher than a preset first threshold, or when the target node belongs to the constrained entity, a global label is bound to the target node, establishing it as a global core node in the intent knowledge graph, and the lower limit of the basic weight of the global core node is determined.

4. The context-driven text creation system according to claim 2, characterized in that, The weight update unit specifically includes: When the derived feature is received, a new node is created in the intent knowledge graph, and connection edges with existing nodes are established according to the context semantics; When the activation feature is received, the intent knowledge graph is updated using a weight update formula with a time decay factor. The activation weight of node i after generating the t-th semantic block is... The update formula is: in, Let be the weight of node i at the previous time step; The preset time decay factor; The entity corresponding to node i; The most recently generated context-driven text; For the entity The context-driven text Semantic relevance score in; If the activation weight of node i If the value of node i falls below a preset dormancy threshold after decay, and node i does not belong to the global core node, then node i and its connected edges are hidden or pruned in the intent knowledge graph.

5. The context-driven text creation system according to claim 1, characterized in that, The semantic block prompting module includes a graph perception task planning unit, a local graph subtree extraction unit, and a global constraint unit; The graph perception task planning unit is used to determine the text creation task based on the initial creative intent, and according to the current logical topology of the intent knowledge graph, to perform network graph clustering analysis on the current logical topology of the intent knowledge graph using a community detection algorithm, to identify multiple subgraph communities in the intent knowledge graph whose node connection cohesion is higher than a preset value, to map each subgraph community to a corresponding semantic block, and to arrange the multiple semantic blocks into an execution queue to be generated according to the temporal topology of the directed edges between the subgraph communities. The local graph subtree extraction unit is used to determine the core anchor point corresponding to any target semantic block to be generated in the intent knowledge graph based on the centrality calculation result. Starting from the core anchor point, it performs a breadth-first search or random walk with a preset number of hops depth in the current intent knowledge graph, traverses and extracts all relevant nodes and their connecting edges within the preset number of hops depth, and constructs the extracted relevant nodes and their connecting edges into the graph subtree. The global constraint unit is used to combine the global core nodes identified in the intent knowledge graph, merge the graph subtree with the global core nodes, and generate the adaptive prompt words.

6. The context-driven text creation system according to claim 5, characterized in that, The global constraint unit specifically includes: Initiate a call request to the context graph construction module to obtain the global core node that has been assigned a global label; The extracted graph subtrees and the obtained global core nodes are serialized to transform their network graph structure data into structured natural language relation description text. Retrieve a preset prompt word template, load the serialized global core node into the global constraint region of the prompt word template, load the serialized graph subtree into the local context region of the prompt word template, and attach the text generation instruction of the current target semantic block to generate the adaptive prompt word.

7. The context-driven text creation system according to claim 1, characterized in that, The creation verification module includes a text generation and execution unit, a logical feature reverse extraction unit, a structural consistency comparison unit, and a result output unit. The text generation execution unit is used to receive the adaptive prompt words and input them into a pre-trained large language model to generate the initial chunked text; The logical feature reverse extraction unit is used to identify entities and logical connections between entities in the initial block text using a preset information extraction model, encapsulate the identified entities and logical connections into a set of triples, and construct a directed logical feature structure based on the set of triples. The structural consistency comparison unit is used to compare the logical feature structure with the intent knowledge graph and calculate the structural consistency score. The result output unit is used to make a decision based on the structural consistency score, and outputs the context-driven text after the comparison is passed.

8. The context-driven text authoring system according to claim 7, characterized in that, In the structural consistency comparison unit, calculating the structural consistency score specifically includes: The logical feature structure is mapped to the currently active subtrees in the intent knowledge graph using graph isomorphism mapping, and a multidimensional consistency scoring model is used to calculate the structural consistency score. The calculation formula is: in, The proportion of entities contained in the logical feature structure that are hit in the graph subtree; The consistency ratio between the logical topological relationship direction between entities and the edge direction in the graph subtree; This is a hard conflict penalty term between the logical feature structure and the intent knowledge graph; These are the preset weighting coefficients.

9. The context-driven text creation system according to claim 8, characterized in that, The decision-making process based on the structural consistency score in the result output unit specifically includes: The structural consistency score Compare with the preset tolerance threshold; If the structural consistency score If the value is less than the tolerance threshold, then the features in the logical feature structure that cause conflict are identified, and the conflict features are converted into correction instructions and fed back to the text generation execution unit to trigger the regeneration of the initial block text; If the structural consistency score If the value is greater than or equal to the tolerance threshold, then the initial segmented text is subjected to referential resolution processing and transitional connecting words between segments are generated, and the context-driven text is output.

10. The context-driven text creation system according to claim 1, characterized in that, The intent feedback module includes an interactive action parsing unit, a correction signal conversion unit, a graph reverse correction instruction unit, and a task dynamic reconstruction unit. The interactive action parsing unit is used to obtain the modification action for the context-driven text, extract the difference text fragments between the modified text and the original text before modification, use a natural language understanding model to identify whether there are entity attribute changes, new entity introductions or logical relationship reversals in the difference text fragments, and determine the difference text fragments as valid modification actions when they exist. The correction signal conversion unit is used to map the natural language change corresponding to the effective modification action into a graph operation primitive according to a preset action mapping rule. The graph operation primitive includes at least one of node deletion, node addition, or edge relationship update. The unit encapsulates the graph operation primitive and its associated semantic block identifier to generate a correction signal. The graph reverse correction instruction unit is used to transmit the correction signal to the context graph construction module and assign the correction signal an execution priority higher than the system automatic update weight, so as to forcibly cover the original entity nodes or logical topological relationships in the intent knowledge graph and realize the correction of the intent knowledge graph. The task dynamic reconstruction unit is used to trigger the semantic block prompting module to regenerate adaptive prompt words for ungenerated semantic blocks. Specifically, it performs a topological traversal starting from the corrected node or edge in the intent knowledge graph, identifies the downstream nodes affected by the correction signal, marks the ungenerated semantic blocks involving the downstream nodes as dirty, and triggers the semantic block prompting module to re-execute graph subtree extraction and adaptive prompt word generation for the semantic blocks in the dirty state.