Intelligent planning text generation method based on structured cue words and segmentation generation
By constructing structured prompts and logical state transition networks for planning text, the problem of logical inconsistencies between chapters in planning text generation was solved, achieving logical progression and semantic coherence in planning text generation, and improving the structure and consistency of the generated results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-03-27
AI Technical Summary
Existing language model-based text generation methods are insufficient to meet the needs of planning texts, which require the gradual achievement of goals between chapters and clear and explicit state transmission, resulting in semantic jumps, incoherence, or logical conflicts in the generated results.
A planning text generation method based on structured prompt words and logical state transition networks is adopted. The planning semantic units are extracted through semantic role labeling, a dependency network between state nodes is constructed, and state consistency verification and iterative reconstruction are performed after each chapter is generated to ensure the logical progression and semantic coherence of the text.
It achieves structural consistency in the generated planning text, avoids semantic jumps and logical breaks between chapters, and improves the accuracy and robustness of the generated results in terms of logical expression, goal achievement, and semantic coverage.
Smart Images

Figure CN121743484A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of text generation technology, and in particular to a method for intelligently generating planning text based on structured prompts and segmentation. Background Technology
[0002] In the field of intelligent text generation, the automatic writing of planning documents (such as urban planning, industrial process planning, and strategic plans) places higher demands on the structure, consistency, and logical dependencies of the content. However, most existing text generation methods based on language models often rely on single-round or static prompt words, lacking modeling and control over multi-stage logical state changes. This makes it difficult to meet the requirements of planning texts, such as the gradual achievement of goals between chapters and clear and explicit state transmission, resulting in semantic jumps, incoherence, or logical conflicts in the generated results.
[0003] To address the aforementioned issues, some studies have attempted to introduce auxiliary generation mechanisms based on structural templates or knowledge graphs, but these still struggle to dynamically perceive the state evolution relationships during the planning process. This invention proposes an intelligent planning text generation method driven by structured prompt words and logical state transition networks. It utilizes semantic role labeling to extract planning semantic units, constructs a dependency network between state nodes, and performs state consistency verification and iterative reconstruction after each chapter is generated. This ensures that the entire text achieves coordinated unity of state control, logical progression, and semantic coherence while generating content, thereby improving the applicability and reliability of intelligent generation in structured planning texts. Summary of the Invention
[0004] This invention provides a method for intelligently generating planning text based on structured prompts and segmentation.
[0005] A method for intelligently generating planning text based on structured prompts and segmentation includes the following steps: S1: Receive the user's initial planning intent, identify and extract planning semantic units through the semantic role labeling model; each planning semantic unit includes at least one planning entity, one planning operation, and one logical state attribute; S2: Based on the logical state attributes of all planning semantic units, construct a logical state transition network describing the state dependencies and transmission relationships between units; based on the logical state transition network, generate dynamic structured prompt words including preceding state constraints for each planning chapter to be generated; S3: Input the dynamic structured prompt words into the language model to generate the content of each chapter in sequence; for each chapter generated, extract new planning semantic units from the text in reverse, compare the logical state attributes of the new planning semantic units with the expected target of the logical state transition network, and if they are inconsistent, trigger the content reconstruction based on the state calibration prompt words, and finally output the complete planning text with consistent logical states.
[0006] Optionally, the planning entity includes resources, indicators, projects, or regions, the planning operation includes adding, reducing, laying out, or optimizing, and the logical state attribute is a parameter used to describe the state of the planning entity after the operation or the quantitative level it has reached.
[0007] Optionally, S1 includes: S11: Receive the initial planning intent text input by the user in natural language form; S12: Perform word segmentation and dependency parsing on the initial planning intent text to identify the core predicates and argument components in the sentence; S13: Input the processed text into the pre-trained semantic role labeling model. The semantic role labeling model is reinforced based on the planning domain text and can identify relevant semantic role labels in the planning text, including planning entity labels, planning operation labels and state modification labels. S14: Based on the semantic role annotation results, plan the combination and encapsulation of semantic units; S15: Link the encapsulated planning semantic unit with the pre-built planning domain ontology library to standardize semantic expression; S16: Output a set of standardized and validated planning semantic units.
[0008] Optionally, S14 includes: Noun phrases labeled as planning entities are treated as entity elements of planning semantic units; Verb components labeled as planning operations are used as operational elements of planning semantic units; Adjective, adverbial, or quantifiable phrases labeled as state modifiers are used as logical state attributes of the planned semantic units.
[0009] Optionally, S2 includes: S21: Abstract the logical state attributes of each planning semantic unit into state nodes in the logical state transition network; S22: Based on a pre-built state dependency database, analyze the dependency types between state nodes; S23: Construct a complete logical state transition network with state nodes as vertices and dependencies as directed edges; S24: Based on the preset planning text chapter structure, determine the set of target states that each chapter needs to achieve, and mark the corresponding state nodes in the logical state transition network; S25: For each chapter to be generated, trace back in reverse the logical state transition network all preceding state nodes that directly or indirectly point to the target state of the chapter to form a preceding state constraint set. S26: The set of preceding state constraints is transformed into a natural language description and embedded as a hard constraint condition into the generation prompt word template of this chapter to form a dynamic structured prompt word that includes explicit state constraints.
[0010] Optionally, the dependency types include prerequisite dependencies, causal dependencies, and reinforcing dependencies.
[0011] Optionally, the logical state transition network uses state nodes as vertices and dependencies as directed edges. The direction of the edge represents the direction of logical state transmission, and the weight of the edge represents the strength of the dependency. The network topology reflects the inherent logical structure of the planning scheme.
[0012] Optionally, S3 includes: S31: Following the chapter order of the planned text, input the dynamic structured prompts into the language generation model in sequence to generate the initial text content for each chapter; S32: After each chapter is generated, the semantic role labeling model is used to reverse-parse the chapter text, extract the planning semantic units included in the chapter text, and extract the logical state attributes from them to form the actual logical state attribute set of the chapter. S33: Compare the actual set of logical state attributes with the set of target state attributes preset for the corresponding chapter in the logical state transition network, and calculate the state consistency score; S34: When the state consistency score is higher than the preset state consistency threshold, accept the current chapter text; when it is lower than the state consistency threshold, trigger the content reconstruction process. S35: When content reconstruction is triggered, a status calibration prompt is generated, and the status calibration prompt is re-inputted into the language generation model to generate the revised chapter text; S36: Repeat the reverse parsing, state comparison and calibration reconstruction steps for the revised chapter text until the consistency score reaches the preset state consistency threshold or the maximum number of iterations is reached; S37: After all chapter texts have passed the state consistency check, the final version of each chapter text will be integrated and output to form a complete planning text with consistent logical state.
[0013] Optionally, the state calibration prompt is generated based on the original structured prompt, the expected logical state attributes, the actual logical state attributes, and the results of their difference analysis.
[0014] The beneficial effects of this invention are: This invention introduces a structured modeling approach using planning semantic units and logical state transition networks. It transforms the user's initial natural language planning intent into operable units with entity, operation, and state attributes, and constructs a global state-dependent topology to ensure that the content generated for each chapter has clear state objectives and prior dependency constraints. Compared to the lack of semantic control in traditional language model generation, this method achieves chapter-level content planning constraints through embedded state prompts, effectively avoiding semantic jumps, logical breaks, content redundancy, or omissions between chapters, thus improving the consistency, structure, and rationality of the generated planning text.
[0015] This invention innovatively designs a state consistency verification and prompt word reconstruction mechanism. After chapter generation, it automatically extracts the actual logical state attributes and compares them with the expected target state in the logical state transition network. If the consistency score is lower than the state consistency threshold, it iterative reconstruction is performed by constructing state calibration prompt words based on the differences. This mechanism enables the language model to have state awareness and self-correction capabilities, allowing for automated and controllable regression reconstruction when content deviates from expectations. This improves the accuracy and robustness of the final text in terms of logical expression, goal achievement, and semantic coverage. This state feedback-driven generation calibration method provides a stable and reliable generation path for multi-chapter, complex logic planning tasks, enhancing its practicality and adaptability. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart of a method according to an embodiment of the present invention; Figure 2 This is a logical framework diagram of an embodiment of the present invention. Detailed Implementation
[0018] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. Those skilled in the art may employ other alternative methods to implement some well-known technologies; moreover, the accompanying drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.
[0019] like Figure 1-2 As shown, a method for intelligently generating planning text based on structured prompts and segmentation includes the following steps: S1: Receive the user's initial planning intent, identify and extract planning semantic units through the semantic role labeling model; each planning semantic unit includes at least one planning entity, one planning operation, and one logical state attribute; S1 specifically includes: S11: Receive the initial planning intent text input by the user in natural language form, represented as: ; in, This represents the initial planning intent text input. For the first One word, The total number of words in the text, with a value range of [value missing]. Ensure that the text length has complete semantics but is not excessively long; S12: Initial planning intent text Perform word segmentation and dependency parsing to extract core predicates. With the set of argument components This serves as the structural basis for subsequent semantic role labeling; in, As a core dependency node for subsequent semantic annotation, verbs represent the intention of the operation. , This refers to the set of argument components (subject, object, etc.), that is, phrases marked as noun phrases or prepositional phrases in syntactic analysis, used to identify syntactic dependency structures of entity and state modifiers. The value range is 1-10. Values exceeding 10 are rare and complex sentences, which can be truncated or split. S13: Input the processed text structure into the pre-trained semantic role labeling model. Identify the semantic tag set, represented as: ; in, This is a semantic role labeling model based on fine-tuning of a planned corpus. To plan entity labels (resources, indicators, projects, or regions). To plan operation labels (add, reduce, layout, or optimize). State modification labels (parameters used to describe the state or quantification level of a planned entity after an operation). A collection of semantic tags. The value range is 1-3, and only the labels related to the three planning elements are retained. For the first The semantic role tags are limited to three categories of planning-specific role tags; S14: Define a single planning semantic unit as a triple, forming a set of planning semantic units, represented as: ; ; in, For the first Each original planning semantic unit triple is a triple, and the triple elements are extracted from the corresponding semantic tags. For the set of all planning semantic units, The value range is 1-20. If the text is too short (less than one character), or too long (suggest segmenting), it is recommended to process it into segments. For entity elements, originating from the annotation as noun phrases, As an operational element, it originates from the element marked as The verb structure, These are logical state attributes, derived from... The attributive or adverbial components of a label; The goal of this step is to combine the results identified in the previous step through semantic role labeling into planning semantic units with clear semantic functions according to a predetermined structure. The basic structure of the planning semantic unit is a triple, that is, each semantic unit includes three elements: entity element, operation element, and logical state attribute. The core basis for designing the triple encapsulation structure is as follows: (1) It fits the basic semantic structure logic of planning texts: In planning texts, most sentences can be decomposed into three parts: subject, action and state. For example, in the optimization and upgrading of transportation hubs, the transportation hub is the planning entity, the optimization and upgrading is the operation action, and the current priority may be the state modification. This three-element structure covers the vast majority of planning sentence patterns, so the use of the triple expression form has high universality and adaptability.
[0020] (2) Enhance the clarity and controllability of semantic structure: Compared with traditional planar text expression, structured semantic units can express semantic boundaries more clearly and clarify the semantic role carried by each part, which is helpful for subsequent processing such as modeling, retrieval, comparison and generation. By clearly distinguishing entities, actions and states, stable and traceable semantic reconstruction of any planning instruction can be performed.
[0021] (3) Facilitates the construction of semantic graphs and state transition networks: Each triple semantic unit can be regarded as a basic unit of a certain state change in the planning process, and is the core component of subsequent logical state transition modeling. The association between multiple triples constitutes a complete planning process. Therefore, encapsulating triples is not only a result normalization of text processing, but also a prerequisite for subsequent construction of state topology.
[0022] (4) Support for structured prompt word generation for language models: In the generation task, each triple can serve as the smallest logical semantic block, becoming the basic unit for prompt language models to generate corresponding chapter content. Through explicit structural encapsulation, high-level semantic intent can be better mapped to the input constraints of the language model.
[0023] Therefore, step S14 plays a crucial role in the entire method, structuring the natural language analysis results and providing semantically clear and structurally complete basic expression units for subsequent state logic modeling and text generation.
[0024] S15: Plan the semantic unit set Each semantic unit element in the pre-defined planning ontology library The entries in the dataset are mapped and linked to obtain normalized semantic unit triples, represented as follows: ; ; in, For the planning domain ontology library, For the ontology linking function, For entity elements after ontology standardization, These are the operational elements after the ontology has been standardized. These are the logical state attributes after ontology standardization. For normalized semantic units; In this step, the three elements (entity element, operation element, and state attribute) of the extracted original planning semantic unit are linked and matched one-to-one with the standard terms in the pre-set planning domain ontology library. The core purpose of this process is to uniformly convert the diverse, ambiguous, or redundant semantic components that may exist in natural language expression into a standard, normative, and computable knowledge expression form, so as to enhance the consistency and controllability of the subsequent state modeling and language generation process. The main considerations in designing this standardization process include: (1) Avoiding linguistic ambiguity and terminology inconsistency: In the natural language input by users, the same concept may appear in different ways. For example, “construction,” “repair,” and “build” may all mean the operation of “construction.” If these words are directly used in subsequent logical modeling, it will cause structural breaks and redundancy between semantic units. Therefore, through ontology linking, these words with different meanings can be uniformly mapped to the same standard terminology, thereby establishing a stable semantic structure foundation.
[0025] (2) Improve the accuracy and generalization ability of semantic matching: In the ontology, each term has been defined by experts and modeled in the domain, and its semantic boundaries are clear and have the ability to be extended. By linking user semantic elements with terms in the ontology, the system can have stronger generalization and reasoning capabilities. For example, without changing the core logic, the system can identify that "increased green space ratio" and "increased ecological coverage" belong to the same "ecological priority" status label in some scenarios.
[0026] (3) Provide traceable semantic representations for subsequent modules: The semantic units after ontology processing have unique identifiers and logical consistency, and can be directly used to construct logical state transition networks, generate structured prompt words, train state constraint models, etc. This avoids the interruption of the reasoning chain or the generation of chaotic logic due to the ambiguity of natural language.
[0027] (4) Enhance semantic universality across projects, users, and regions: The ontology library has industry adaptability and scalability, and can expand vocabulary and transfer semantics according to different planning applications (such as urban planning, park development, environmental remediation, etc.). By linking with the ontology, semantic units can be shared across scenarios, promoting model transfer learning and large-scale application.
[0028] In summary, S15 effectively solves the problem of heterogeneous expression in natural language by standardizing and linking the original semantic units with the domain ontology, laying a unified and high-quality semantic foundation for subsequent logical modeling and language generation, and is an important link connecting language understanding and planning reasoning.
[0029] S16: Output the complete set of verified and standardized planning semantic units as the structured input for the next step of constructing the logical state transition network, represented as: ; in, For a standardized set of semantic units, For elements of a standardized semantic unit set.
[0030] S2: Based on the logical state attributes of all planning semantic units, construct a logical state transition network that describes the state dependencies and transmission relationships between units; based on the logical state transition network, generate dynamic structured prompt words including prior state constraints for each planning chapter to be generated; S2 specifically includes: S21: Each normalized planning semantic unit Logical state attributes in Abstracted as a state node This forms a set of state nodes, represented as: ; ; in, It is the first A standardized planning semantic unit, The total number of semantic units. For the first in the logical state transition network One state node, A collection of state nodes; To achieve structured modeling, this step extracts the logical state attributes from all semantic units, numbers them one by one, and forms independent state nodes. The main design basis for doing so is as follows: (1) Provide a unified node basis for state dependency modeling: Logical state is the result expression of planning behavior, which has strong temporal, stage and dependency characteristics. Processing state attributes into nodes helps to clearly represent the dependency and transmission relationship between each state in the graph structure, and realize the modeling and tracing of the internal logic of the planning scheme.
[0031] (2) Improve the reusability and aggregation of state information: Multiple planning semantic units may contain semantically similar or identical state descriptions. Through node-based processing, the same states can be aggregated in the graph structure, thereby avoiding information redundancy and providing the possibility for cross-unit sharing of states. For example, different planning objects may all have the goal of ecological priority or functional improvement, and they can be uniformly represented as a shared state node.
[0032] (3) Facilitates the formation of a standardized state network structure: By abstracting state attributes as nodes, the constructed logical state network can be regarded as a directed graph structure, possessing topological stability and algorithm scalability. This standardized network structure not only facilitates subsequent path analysis and extraction of preceding constraints, but also provides clear constraint boundaries for the generative model.
[0033] In summary, the node-based processing of S21 is an important step in transforming loose state descriptions distributed in natural language text into a structured, computable, and traceable set of state nodes, providing a solid foundation for realizing global planning semantic modeling and chapter constraint generation.
[0034] S22: Based on a pre-defined state dependency database Analyze the dependencies between any two state nodes and define a directed dependency triple as follows: ; in, For a pre-built state dependency library, For state dependency triples, Representing state Dependent on state , The dependency type determines the logical connections between states. , respectively representing premise dependency, causal dependency, and reinforcement dependency; S23: Construct a directed weighted graph, represented as: ; in, For a set of state nodes, As an edge, Each edge has a direction and a weight, with the edge weight being... This indicates the strength of the dependency and is used to quantify the degree of influence between states. , For the intensity function, , It is a state transition network, which represents the propagation and constraint relationship of logical states in the planning process. It is a directed weighted graph, with state nodes as vertices and dependencies as edges. The direction and weight of the edges represent the logical dependencies between states. In this step, the set of state nodes and the dependencies between states obtained in the first two steps are further integrated and constructed into a directed weighted graph with a clear topology, namely, a logical state transition network. The core function of this network is to simulate how states in planning semantics trigger, depend on, and reinforce each other, thereby revealing the logical evolution path of the entire planning process.
[0035] Specifically: Each node in the network corresponds to an abstract logical state (such as functional improvement, traffic accessibility, ecological priority, etc.), and these states come from the state attributes in each planning semantic unit; Each directed edge in the network represents a semantic dependency between two states; The direction of an edge is used to identify the direction of dependency or transitivity; The weights of the edges are used to quantify the strength of the dependency. Different types of dependencies have different degrees of influence. For example, the prerequisite dependency has the largest weight (value 1.0), which means that the target state cannot be reached if the condition is not met; while the reinforcement dependency has a lower weight (e.g. 0.5), which means that it only plays a reinforcing rather than a decisive role.
[0036] The design of the state transition network in this step has the following advantages: (1) It has semantically driven interpretability: The essence of planning text is the description of a logical chain, rather than a simple list of parallel statements. By explicitly constructing directed connections between states, it is possible to clearly reveal how a certain target state is supported or influenced by several preceding states, thereby improving the interpretability and traceability of planning reasoning.
[0037] (2) Supports automated path analysis and chapter constraint extraction: The network structure provides a basic framework for subsequent steps (such as chapter pre-state extraction, generation of prompt words, etc.). With the help of the network's graph structure, all pre-state paths, influencing paths and their dependent weights of any state node can be efficiently found through graph traversal algorithms, providing precise logical constraints for controlling text generation.
[0038] (3) Facilitates the structured management of complex planning schemes: In large-scale planning documents, there may be complex relationships between states, such as cross-dependencies, chain reinforcement, or parallel constraints. Unified modeling through graph structures helps to unify management, hierarchical control, and dynamically adjust the association between different states, which facilitates consistency checks and conflict resolution in the subsequent generation process.
[0039] Therefore, the design of S23 not only realizes the structured modeling of state logic, but also provides an operable, computable, and interpretable semantic graph foundation for the subsequent generation module. It is a link between the previous and subsequent steps in the entire intelligent generation method of planning text.
[0040] S24: Suppose the planning text includes a set of chapters, and for each chapter... A predefined set of target states is represented as: ; ; in, This represents the set of planning chapters. The total number of chapters represents the set of chapters in the planning document, with each chapter corresponding to a planning objective. Indicates the first The set of target states for each chapter, i.e., the chapter The set of logical state target nodes that need to be achieved serves as the core objective of the planning task; S25: For each chapter For the target state set In state transition networks In the process of performing reverse dependency tracing, a set of preceding state constraints is formed, represented as: ; in, For the first The set of preceding state constraints for each chapter is obtained through reverse dependency tracing. S26: Set the previous state constraints Each state node Converted into natural language phrases, it can be represented as: ; in, It is the first The dynamic structured prompts for each chapter are natural language prompts generated from the constraints of the preceding state, which are used by the language model to generate chapter content. S3: Input the dynamic structured prompt words into the language model to generate the content of each chapter in sequence; for each chapter generated, extract the new planning semantic unit from the text in reverse, compare the logical state attribute of the new planning semantic unit with the expected target of the logical state transition network, and if they are inconsistent, trigger the content reconstruction based on the state calibration prompt words, and finally output the complete planning text with consistent logical state. S3 specifically includes: S31: Input the dynamic structured prompts into the language generation model sequentially according to the chapter order of the planning text. Generate initial text content, represented as: ; in, To plan the chapter index of the text, This represents the iteration number generated for the current chapter, indicating which version of the text has been generated. It is used for state verification and reconstruction processes, and its value ranges from 0 to 5. For the first The dynamic, structured prompts for each chapter are used to constrain the chapter generation goals, ensuring that the generated content meets the state requirements. This is the initial text content. It is a text language generation model that receives dynamic structured prompt words as input and outputs coherent chapter text; S32: Process the generated chapter text (No. (Next version) uses a semantic role labeling model Perform reverse analysis to extract the set of planning semantic units. And obtain the actual generated set of logical state attributes, represented as: ; in, A semantic role annotation model is used to inversely extract planning semantic units and their state attributes from text. It is the first Chapter Number The text generated this time. From The set of semantic units extracted in reverse engineering represents the planning semantic structure content included in the current text. It is the first The reverse-engineered planning semantic unit includes standardized entity elements, action elements, and state elements, which serve as the basic unit for extracting state attributes. It is the first Logical state attributes in a planning semantic unit It is the first Chapter Number The set of logical state attributes extracted from the secondary generated text represents the actual state output; This step performs reverse semantic parsing on the chapter text generated by the language model to re-identify and extract the implicit planning semantic structure in the text, thereby obtaining the set of logical state attributes of the actual output. The core objective of this process is to remap the natural language generation results into a semantic representation that the model can process through structured parsing, providing a quantifiable basis for subsequent consistency verification and reconstruction. The design of this step is based on the following main points: (1) Ensure the interpretability and traceability of language generation results: Since the text generated by large-scale language models is often semantically rich but structurally loose, it is impossible to directly judge whether its logic meets the planning requirements based solely on the original output. By extracting semantic units through semantic role labeling, the natural language content can be transformed back into a computable set of states, making logical alignment possible; (2) Establishing a bridge between language generation and logical state model: This step essentially connects natural language expression with structured state modeling, realizing automatic mapping from the text layer to the semantic layer, and providing a unified structural basis for subsequent consistency comparison; (3) Support for subsequent dynamic reconstruction mechanism: Only by accurately extracting the state information contained in the actual generated text can the degree of deviation from the expected target be judged, and calibration prompts can be generated for correction. Therefore, reverse parsing is an important part of the entire state consistency control process; In summary, S32 achieves reverse structured analysis of chapter-generated text through semantic role labeling, making the natural language generation results logically verifiable and providing technical support for the structured generation and logical consistency of planning text.
[0041] S33: The set of logical state attributes of the actual output With the target state set The comparison is performed, and the consistency score is calculated, which is expressed as: ; in, It is the first The set of target states for the chapter For the first The state consistency score corresponding to the generated chapter text represents the degree of consistency between the generated text and the target state, and is used to evaluate whether the target has been met. This represents the state consistency scoring function, also known as the Jaccard similarity function. It is suitable for situations where state attributes are in the form of sets, and is intuitive and easy to interpret; S34: Let the state consistency threshold be... The judgment is as follows: ; ; in, The range of values is This threshold is used to determine whether consistency is met. The higher the state consistency threshold, the stricter the constraints on the generated content; the lower the state consistency threshold, the greater the allowable deviation. A value of 0.75-0.85 can ensure that the chapter content covers the core logical state while allowing a certain degree of difference in natural language expression, thereby improving the overall stability and generation efficiency, and is especially suitable for planning-related texts. S35: When the consistency score is below the state consistency threshold At that time, construct state calibration prompts, re-enter them into the generative model, and represent them as follows: ; ; in, Indicates the first The generated state calibration prompts are combined with the original prompts, the differences between the expected state and the actual state, and used for accurate reconstruction. It is the first Chapter Number The revised text generated in each round represents the reconstructed chapter content. Its length must match the chapter granularity and the stable range generated by the language model. This represents the state calibration prompt generation function, where the state calibration prompt includes the original structured prompt, the expected logical state attributes, the actual logical state attributes, and information on the difference between the two. In the language model-based planning text generation process, the output of each chapter must meet pre-defined logical state constraints to maintain the consistency and rationality of the overall planning logic. However, due to issues such as semantic diffusion and inference bias in natural language generation, the content of the chapters generated by the model may not match the expected logical state, manifesting as missing state attributes, incorrect causal order, or deviation from the target. To address this, this step introduces a state-driven automatic calibration mechanism to ensure that the generation results of each chapter always revolve around the logical goal, achieving precise control of planning semantics and continuous improvement in generation quality.
[0042] Specifically, when the consistency score between the actual generated state attribute set and the target state set of a chapter is detected to be lower than a preset state consistency threshold, a state calibration prompt word is constructed. This prompt word integrates the initial structured prompt, the expected logical state description, and the actual generated state analysis, and serves as new input to drive the language model to generate a revised version. Through the state compensation and semantic alignment effects of this state calibration prompt word, the model can effectively correct logical deviations and output chapter content that meets the planning requirements. This mechanism constructs a state feedback loop, achieving closed-loop control of consistency between chapter-level generation and the global logical state, thereby enhancing the controllability, coherence, and logical rigor of the planned text.
[0043] S36: Repeat S32-S35 until any of the following conditions are met: Consistency met; : Reaching the maximum number of iterations; in, This represents the maximum number of iterations, ranging from 3 to 5. If the target cannot be met even after exceeding this limit, it can be determined that the section is difficult to converge, thus avoiding an infinite loop. S37: When all chapters After all the final versions of the text have passed the state consistency check, they are integrated into a complete planning text, outputting a complete planning document with consistent logical states, represented as: ; in, For the first Final version of the chapter text (passed consistency check). This is the complete planning text that is ultimately integrated from all the chapters. It represents the final output of the overall planning document and is organized into an overall structure according to the order of the chapters.
[0044] This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the following preferred embodiments; however, those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0045] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for intelligently generating planning text based on structured prompts and segmentation, characterized in that, Includes the following steps: S1: Receive the user's initial planning intent, identify and extract planning semantic units through the semantic role labeling model; each planning semantic unit includes at least one planning entity, one planning operation, and one logical state attribute; S2: Based on the logical state attributes of all planning semantic units, construct a logical state transition network describing the state dependencies and transmission relationships between units; based on the logical state transition network, generate dynamic structured prompt words including preceding state constraints for each planning chapter to be generated; S3: Input the dynamic structured prompt words into the language model to generate the content of each chapter in sequence; for each chapter generated, extract new planning semantic units from the text in reverse, compare the logical state attributes of the new planning semantic units with the expected target of the logical state transition network, and if they are inconsistent, trigger the content reconstruction based on the state calibration prompt words, and finally output the complete planning text with consistent logical states.
2. The intelligent generation method for planning text based on structured prompts and segmentation as described in claim 1, characterized in that, The planning entity includes resources, indicators, projects, or regions; the planning operation includes adding, reducing, laying out, or optimizing; and the logical state attribute is a parameter used to describe the state or quantitative level achieved by the planning entity after the operation.
3. The intelligent generation method for planning text based on structured prompt words and segmentation as described in claim 1, characterized in that, S1 includes: S11: Receive the initial planning intent text input by the user in natural language form; S12: Perform word segmentation and dependency parsing on the initial planning intent text to identify the core predicates and argument components in the sentence; S13: Input the processed text into the pre-trained semantic role labeling model. The semantic role labeling model is reinforced based on the planning domain text and can identify relevant semantic role labels in the planning text, including planning entity labels, planning operation labels and state modification labels. S14: Based on the semantic role annotation results, plan the combination and encapsulation of semantic units; S15: Link the encapsulated planning semantic unit with the pre-built planning domain ontology library to standardize semantic expression; S16: Output a set of standardized and validated planning semantic units.
4. The intelligent generation method for planning text based on structured prompt words and segmentation as described in claim 3, characterized in that, S14 includes: Noun phrases labeled as planning entities are treated as entity elements of planning semantic units; Verb components labeled as planning operations are used as operational elements of planning semantic units; Adjective, adverbial, or quantifiable phrases labeled as state modifiers are used as logical state attributes of the planned semantic units.
5. The intelligent generation method for planning text based on structured prompt words and segmentation as described in claim 1, characterized in that, S2 includes: S21: Abstract the logical state attributes of each planning semantic unit into state nodes in the logical state transition network; S22: Based on a pre-built state dependency database, analyze the dependency types between state nodes; S23: Construct a complete logical state transition network with state nodes as vertices and dependencies as directed edges; S24: Based on the preset planning text chapter structure, determine the set of target states that each chapter needs to achieve, and mark the corresponding state nodes in the logical state transition network; S25: For each chapter to be generated, trace back in reverse the logical state transition network all preceding state nodes that directly or indirectly point to the target state of the chapter to form a preceding state constraint set. S26: The set of preceding state constraints is transformed into a natural language description and embedded as a hard constraint condition into the generation prompt word template of this chapter to form a dynamic structured prompt word that includes explicit state constraints.
6. The intelligent generation method for planning text based on structured prompt words and segmentation as described in claim 5, characterized in that, The dependency types include prerequisite dependencies, causal dependencies, and reinforcing dependencies.
7. The intelligent generation method for planning text based on structured prompt words and segmentation as described in claim 5, characterized in that, The logical state transition network uses state nodes as vertices and dependencies as directed edges. The direction of the edge indicates the direction of logical state transmission, and the weight of the edge indicates the strength of the dependency. The network topology reflects the inherent logical structure of the planning scheme.
8. The intelligent generation method for planning text based on structured prompt words and segmentation as described in claim 6, characterized in that, S3 includes: S31: Following the chapter order of the planned text, input the dynamic structured prompts into the language generation model in sequence to generate the initial text content for each chapter; S32: After each chapter is generated, the semantic role labeling model is used to reverse-parse the chapter text, extract the planning semantic units included in the chapter text, and extract the logical state attributes from them to form the actual logical state attribute set of the chapter. S33: Compare the actual set of logical state attributes with the set of target state attributes preset for the corresponding chapter in the logical state transition network, and calculate the state consistency score; S34: When the state consistency score is higher than the preset state consistency threshold, accept the current chapter text; when it is lower than the state consistency threshold, trigger the content reconstruction process. S35: When content reconstruction is triggered, a status calibration prompt is generated, and the status calibration prompt is re-inputted into the language generation model to generate the revised chapter text; S36: Repeat the reverse parsing, state comparison and calibration reconstruction steps for the revised chapter text until the consistency score reaches the preset state consistency threshold or the maximum number of iterations is reached; S37: After all chapter texts have passed the state consistency check, the final version of each chapter text will be integrated and output to form a complete planning text with consistent logical state.
9. The intelligent generation method for planning text based on structured prompt words and segmentation as described in claim 8, characterized in that, The state calibration prompts are generated based on the original structured prompts, expected logical state attributes, actual logical state attributes, and their difference analysis results.
Citation Information
Patent Citations
Intelligent writing method based on multi-agent cooperation
CN120632092A
Multi-agent collaborative task planning method, related device, equipment and storage medium
CN120723402A
Selection of delivery mechanism for text-based document
US20060123346A1
Generating a document structure
US20150339278A1