Text generation method, system, electronic device, storage medium and program product
By configuring modules and execution plans, and combining model parsing and filling technologies, the problem of inconsistent text generated by the model is solved, achieving efficient generation of consistent and realistic text, which is suitable for scenarios such as technical documents and patent application documents.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NEW PRIME NUMBER (BEIJING) DATA CO LTD
- Filing Date
- 2026-05-22
- Publication Date
- 2026-07-31
AI Technical Summary
Existing models struggle to ensure that the output content remains consistent with the established outline text when generating highly specialized texts, and they are prone to fabricating content, reducing the authenticity and effectiveness of the text.
By pre-configuring the explanatory text module to be generated and the execution plan, and combining the original text and outline text parsing with the first model, structured data is extracted. Based on the structured data and the module execution plan, slot fields are filled to ensure that the generation process conforms to template rules and is manually led.
It improves the efficiency and quality of text generation, ensures consistency between the generated text and the outline text, reduces fabricated content, and enhances the authenticity and effectiveness of the text.
Smart Images

Figure CN122491241A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of information processing technology, and in particular to a text generation method, system, electronic device, storage medium, and program product. Background Technology
[0002] Currently, the writing of highly specialized texts still relies heavily on manual labor, such as writing technical explanatory texts based on a pre-defined outline. While some models have been widely applied in text processing scenarios and possess basic text understanding and generation capabilities, they struggle to ensure that the output content remains consistent with the pre-defined outline. Furthermore, during the generation process, models are prone to deviating from the input material and generating fabricated content, thereby reducing the authenticity and validity of the text. Summary of the Invention
[0003] The purpose of the embodiments in this specification is to provide a text generation method, system, electronic device, storage medium, and program product, which can improve efficiency by utilizing models while realizing the text generation process led by humans and controlled by template rules, thereby ensuring that the text content is consistent with the predetermined outline text and that the content is authentic and effective.
[0004] To achieve the above objectives, the embodiments in this specification adopt the following technical solutions: Firstly, embodiments of this specification provide a text generation method, including: Obtain at least one module contained in the description text to be generated and the configuration information of each module. The configuration information of the module includes the fixed text and slot fields contained in the module, and the execution plan of the module. The original text and outline text are parsed using the first model to obtain structured data; the structured data includes: the structural information of the outline text, and the field values of the slot fields; Based on the structured data and the execution plan of each module, fields are populated for at least one module; Combine at least one of the filled modules to obtain the explanatory text corresponding to the outline text.
[0005] Secondly, embodiments of this specification provide a text generation system, including: The acquisition unit is used to acquire at least one module contained in the description text to be generated and the configuration information of each module. The configuration information of the module includes the fixed text and slot fields contained in the module, and the execution plan of the module. The parsing unit is used to parse the original text and outline text using the first model to obtain structured data; the structured data includes: the structural information of the outline text, and the field values of the slot fields; An execution engine unit is used to populate fields of at least one module based on the structured data and the execution plan of each module; The output unit is used to combine at least one of the filled modules to obtain the explanatory text corresponding to the outline text.
[0006] Thirdly, embodiments of this specification provide an electronic device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the text generation method provided in the first aspect.
[0007] Fourthly, embodiments of this specification provide a computer-readable storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the steps of the text generation method provided in the first aspect.
[0008] Fifthly, embodiments of this specification provide a computer program product including a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform steps of the text generation method provided in the first aspect.
[0009] The above-described at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects: By pre-configuring information such as at least one module, the content of each module, and the execution plan of the explanatory text to be generated, and dividing the module content into fixed text and slot fields, the generation process of the explanatory text can balance human guidance with template rule constraints. Furthermore, the first model is used to parse the original text and outline text, extracting structured data such as the structural information of the outline text and the field values corresponding to the slot fields of each module, providing content support and structural constraints for the explanatory text generation process. Further, based on the structured data and the execution plans of each module, the slot fields are filled, which not only clarifies the source of the content of the slot fields, effectively reducing fabricated content, but also strengthens the consistency between the explanatory text and the outline text, thereby improving the overall quality of the text. Finally, combining the filled modules yields the explanatory text. It is evident that relying on the first model to assist in the generation process can significantly improve the efficiency of text activation while ensuring text quality. Attached Figure Description
[0010] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a schematic diagram of an example environment in which the embodiments of this specification can be implemented; Figure 2 A flowchart illustrating a text generation method provided in an embodiment of this specification; Figure 3 This is a schematic diagram of the structure of a text generation system provided in an embodiment of this specification; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this document clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative effort are within the scope of protection of this document.
[0012] The term "comprising" and its variations as used in this document are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. The term "in response to" indicates that the performed operation depends on a condition or state. When the dependent condition or state is met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which multiple operations are performed.
[0013] It should be noted that the concepts of "first" and "second" mentioned in this document are used only to distinguish different devices, modules or units, and are not used to restrict the order of functions performed by these devices, modules or units or their interdependencies.
[0014] It should be noted that the terms "one" and "more" used in this document are illustrative rather than restrictive, and those skilled in the art should understand that they should be understood as "one or more" unless explicitly stated in the context.
[0015] The names of messages or information exchanged between multiple devices in this document are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0016] In this document, any processing of personal information will be conducted only on a legal basis (such as with the consent of the data subject or as necessary for the performance of a contract) and will only be carried out within the scope stipulated or agreed upon. A user's refusal to have personal information beyond what is necessary for basic functions processed will not affect their use of basic functions.
[0017] As mentioned earlier, although some models have been widely used in text processing scenarios and have basic text understanding and generation capabilities, it is difficult to ensure that the output content is consistent with the established outline text. In addition, during the generation process, the model is prone to deviating from the input material and generating fabricated content, thereby reducing the authenticity and effectiveness of the text content.
[0018] In view of this, embodiments of this specification provide a text generation method. By pre-configuring information such as at least one module, the content of each module, and the execution plan of the explanatory text to be generated, and dividing the module content into fixed text and slot fields, the explanatory text generation process can balance human guidance and template rule constraints. Furthermore, a first model is used to parse the original text and outline text, extracting structured data such as the structural information of the outline text and the field values corresponding to the slot fields of each module, providing content support and structural constraints for the explanatory text generation process. Further, based on the structured data and the execution plans of each module, slot field filling is completed. This not only clarifies the content source of the slot fields, effectively reducing fabricated content, but also strengthens the consistency between the explanatory text and the outline text, thereby improving the overall text quality. Finally, combining the filled modules yields the explanatory text. It is evident that relying on the first model to assist the generation process can significantly improve the efficiency of text generation while ensuring text quality.
[0019] The technical solutions provided in the various embodiments of this manual are described in detail below with reference to the accompanying drawings.
[0020] Figure 1 A schematic diagram illustrates an example environment in which embodiments of this specification can be implemented. For example... Figure 1 As shown, this example environment may include a text generation system 10 and a terminal device 20.
[0021] The text generation system 10 can be deployed locally on the terminal device 20 and / or supported by a server device. For example, the terminal device 20 can run a client with the text generation system 10, which can support interaction between the user 30 and the text generation system 10. When the text generation system 10 runs locally on the terminal device 20, the user 30 can directly interact with the local text generation system 10 using the terminal device 20. When the text generation system 10 runs on a server device, the server device can provide services to the client running on the terminal device 20 based on the communication connection with the terminal device 20.
[0022] The text generation system 10 can present a corresponding interface to the user 30 based on the user's actions, in order to output and / or receive relevant information from the user. The text generation system 10 supports multiple modalities of input, including text, audio, and visual input (such as images and videos).
[0023] In some embodiments, the text generation system 10 may provide an interactive interface for configuration, allowing the user 30 to configure at least one module contained in the explanatory text to be generated, the content of each module and the execution plan, and to divide the content of the module into fixed text and slot fields.
[0024] In some embodiments, the text generation system 10 may also provide an interactive interface for text generation, to receive input materials such as original text and outline text from user 30, and to generate explanatory text and present it to user 30 based on these input materials, at least one of the above-mentioned modules and the configuration information of each module.
[0025] For example, the text generation system 10 can use the first model 40 to parse the input material and obtain structured data such as the structural information of the outline text and the field values corresponding to the slot fields in each module; further, based on the structured data and the execution plan of each module, the slot fields are filled, and the filled modules are combined to obtain the explanatory text.
[0026] The first model 40 can learn from a large corpus and possess text understanding and generation capabilities. The first model 40 can include various artificial intelligence models, such as including but not limited to at least one of the following: large language models, multimodal large models, text generation models, etc.
[0027] In some embodiments, the first model 40 can be deployed locally on the terminal device 20 or on the server device.
[0028] In some embodiments, the terminal device 20 may include any type of mobile terminal, fixed terminal, or portable terminal, specifically including but not limited to: smartphones, tablets, laptops, desktop computers, smart voice interaction devices, smart wearable devices, etc.
[0029] In some embodiments, the server device may include any type of server, such as a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0030] Figure 2 This is a flowchart illustrating a text generation method provided in an embodiment of this specification. The method may include the following steps: S202, obtain at least one module contained in the description text to be generated and the configuration information of each module. The configuration information of the module includes the fixed text and slot fields contained in the module and the execution plan of the module.
[0031] Each module is a component of the explanatory text to be generated. For example, in the scenario of processing patent application documents, the explanatory text may include the specification of the patent application document, which may include the following modules: Invention Title, Technical Field, Background Art, Invention Content, Invention Content - Technical Solution - Independent Claim, Invention Content - Technical Solution - Independent Claim - Feature List, Invention Content - Beneficial Effects, Embodiments - Global Introduction and Inventive Concept, Embodiments - Independent Claim - Summary, Embodiments - Independent Claim - Individual Feature, Embodiments - Independent Claim - Dependent Claim, Embodiments - Independent Claim - Beneficial Effects, Cathymen, etc.
[0032] It is worth noting that each module can contain only fixed text, only slot fields, or both fixed text and slot fields.
[0033] Taking the module "Invention Title" as an example, its content is "[Invention Title]", where "[Invention Content]" is a slot field. Taking the module "Invention Content-Technical Solution-Independent Claim" as an example, its content is "The embodiments of this invention provide a [Independent Claim Title], used to [Solve a macroscopic problem], the [Independent Claim Subject] includes:", where "[Independent Claim Title]", "[Solve a macroscopic problem]", and "[Independent Claim Subject]" are all slot fields, and the rest of the content is fixed text.
[0034] Optionally, the module's configuration information may also include at least one of the following: the module's number, the module's name, the module's purpose, and the attribute information of the slot fields contained in the module. The attribute information of the slot fields may include, but is not limited to, at least one of the following: field name, field value source, and filling rules (such as parsing method, parsing description, and field combination method). The field value source may include, but is not limited to, at least one of the following: outline text, raw text, and external input (such as manual input by the user). The parsing method may include, but is not limited to, original text extraction and inductive generation. The parsing description is used to explain the parsing method.
[0035] For example, taking the "Invention Title" module mentioned above as an example, the field name of its slot field "[Invention Title]" is "Invention Title". The source of the field value can include outline text, the parsing method can include inductive generation, and the parsing description can include "prioritizing the reading of the name of the main method or the main device, extracting the technical object, core action or use and object type, and standardizing it to form the invention title".
[0036] It is worth noting that different modules can contain the same slot field. The source of the field value of the slot field in different modules can be the same or different. For example, both the module "Summary of Invention - Technical Solution - Independent Claim" and the module "Embodiment - Independent Claim - Summary" contain the slot field "[Independent Claim Name]".
[0037] A module's execution plan consists of pre-defined execution rules and process constraints, providing a pre-defined basis for the generation of subsequent explanatory text. In some embodiments, the module's execution plan may include, but is not limited to, at least one of the following: execution order, activation conditions, and loop rules.
[0038] For example, taking the "Invention Title" module as an example, its execution order can be first, the activation condition can include always enabled, and the loop mode can be non-looping. Taking the "Invention Content - Technical Solution - Independent Claim" module as an example, its execution order can be fifth, the activation condition can include "corresponding to the independent claim of the actual type", and the loop mode is looping according to the first level of independent claims.
[0039] At least one of the above modules can be obtained in various ways, and the embodiments in this specification do not limit this.
[0040] In some embodiments, the above-mentioned at least one module can be obtained by: obtaining a first template, the first template corresponding to the type of the explanatory text to be generated; and segmenting the first template based on a preset segmentation rule to obtain at least one module.
[0041] For example, the segmentation rules can be set according to actual needs. For example, the segmentation rules can include, but are not limited to, at least one of the following: segmentation by title, segmentation by content, segmentation by word count, segmentation by component unit, etc. Regardless of the segmentation rule used, the related information in the first template can be retained in the same module.
[0042] The first template can be pre-configured by the user, or multiple templates can be presented in the interactive interface. In response to the selection of multiple templates, the selected template is used as the first template.
[0043] The first template corresponds to the type of explanatory text to be generated, and can be understood as being suitable for generating explanatory text of the corresponding type. For example, if the explanatory text to be generated is a specification of a patent application, the first template can be a specification-specific template, which includes components such as a title, technical field, background art, invention content, description of drawings, and detailed embodiments. Furthermore, the first template can be divided according to each component, with each component serving as an independent module, thus dividing the first template into multiple modules.
[0044] In some embodiments, the above-mentioned at least one module can be obtained by: presenting a first template, the first template corresponding to the type of the explanatory text to be generated; and, in response to a segmentation operation on the first template, segmenting the first template into at least one module.
[0045] The segmentation operation can be user-inputted, meaning users can segment the first template into at least one module according to their actual needs, ensuring that each segmented module has complete semantic boundaries and an independent content-carrying structure. Therefore, interactive segmentation operations can improve the flexibility of template segmentation.
[0046] In some embodiments, the text generation method provided in this specification may further include the following steps: presenting a configuration interface, the configuration interface including configuration controls for at least one module respectively; determining the configuration information of the second module based on the editing operation of the configuration controls of the second module, wherein the second module is any one of the at least one module.
[0047] For example, users can drag and drop modules on the configuration interface to adjust their positions. Users can also input configuration information for each module through its configuration controls, such as the fixed text and slot fields contained in the module, the module's execution plan, and setting attribute information for each slot field.
[0048] As can be seen, the interactive configuration method described above not only improves configuration flexibility but also enables each module to be executable.
[0049] It is worth noting that the configuration of at least one of the above modules can be executed at any time, and the embodiments in this specification do not limit this. For example, it can be executed before generating the explanatory text or during the text generation process to achieve dynamic control of the generation process. In the latter case, the explanatory text can be updated based on the new configuration information.
[0050] S204. Use the first model to parse the original text and outline text to obtain structured data. The structured data includes the structural information of the outline text and the field values of the slot fields.
[0051] The original text can be understood as the raw material carrying basic business and technical information, providing the original information basis and source of materials for the extraction of the outline text and the generation of the explanatory text. The outline text can be understood as a guiding structured text formed based on the original text, using items and sub-items as basic units, defining the overall logical framework, content boundaries, and hierarchical relationships. It does not elaborate on details, but only retains the core points and structural constraints, providing a unified framework benchmark and content guidelines for the generation of the explanatory text. For example, the outline text may include at least one item, and these items have hierarchical relationships, such as one item being a sub-item of another item.
[0052] Taking the processing of patent application documents as an example, the original text may include a technical disclosure document, and the outline text may include the claims of the patent application document, in which each claim is an entry, and dependent claims are sub-entries of the independent claims they reference.
[0053] The structural information of the outline text may include various information that can reflect the structure of the outline text, such as the hierarchical relationship between the items in the outline text, etc. This specification does not limit this aspect in the embodiments.
[0054] The first model may include various artificial intelligence models with text understanding and generation capabilities, and the embodiments in this specification are not limited to this. For example, the first model may include, but is not limited to, at least one of the following: a large language model, a multimodal large model, a text generation model, etc.
[0055] Because the first model has the ability to understand and generate text, it can obtain the field values of slot fields in each module, the hierarchical relationship between each item in the outline text, and the content of each item by understanding the original text and the outline text, thereby obtaining structured data.
[0056] Parsing the original text may include, but is not limited to, at least one of the following: parsing the content of the original text, parsing the content related to each item in the original text, etc. Parsing the outline text may include, but is not limited to, at least one of the following: parsing the structure of the outline text, parsing the content of the outline text, etc.
[0057] In some embodiments, the outline text includes at least one entry, and the slot fields in at least one module may include global slot fields and non-global slot fields associated with each entry.
[0058] In this context, global slot fields can be understood as slot fields applicable to all modules. An entry being related to a non-global slot field can be understood as the entry containing that non-global slot field, or the source of the non-global slot field's value including that entry. For example, taking the module "Summary of Invention - Technical Solution - Independent Claims" as an example, it contains the global slot field "[Macro Problem Solved]" and the non-global slot fields "[Independent Claim Name]" and "[Independent Claim Subject Matter]", where these non-global slot fields are related to each independent claim (i.e., entry) in the claims (i.e., the outline text).
[0059] Accordingly, in the above S204, the first model is used to parse the original text and the outline text to obtain structured data, which may include the following: obtaining the first prompt word, and inputting the first prompt word, the original text and the outline text into the first model to obtain structured data.
[0060] The first prompt word is used to instruct the user to perform the following actions: The original text and outline text are parsed to obtain the field values of global slot fields and the field values of non-global slot fields associated with each entry; Perform structural analysis on the outline text to obtain the hierarchical relationship between at least one item; Structured data is generated based on the field values of global slot fields, the field values of non-global slot fields associated with each entry, and the hierarchical relationship between at least one entry.
[0061] This allows for better guidance of the first model in parsing the original and outline texts, ensuring that structured data provides authentic, reliable, and effective content support and structured constraints for the explanatory text generation process.
[0062] Optionally, the first prompt may also include at least one of the following information for the slot fields in each module: the source of the field value, the filling rules, etc. It is understood that adding the source of the slot field value to the first prompt helps mitigate the risk of generating fabricated content; adding the filling rules to the first prompt ensures the accuracy and validity of the generated content.
[0063] For example, continuing with the processing scenario of patent application documents, the technical disclosure document (i.e., the original text) can be parsed to obtain the field values of global slot fields such as "current state of technology", "existing solutions", "existing defects", "inventive ideas" and "macro-level problems solved", as well as the field values of non-global slot fields such as "sole effect", "subordinate micro-effect", "subordinate implementation description" and "feature implementation description".
[0064] For the claims (i.e., the outline text), its content can be parsed to obtain the field values of non-global slot fields (such as claim number, distinguishing point, subordinate function, additional subordinate module name, feature number, feature content, feature corresponding attached subordinate, module feature function, etc.) related to each claim (i.e., item), as well as the field values of global slot fields such as "technical field" and "invention title"; and the claims can be structurally parsed to obtain the hierarchical relationship between the claims.
[0065] The first model can generate structured data in various ways, and the embodiments in this specification do not limit this.
[0066] In some cases, the first prompt word can instruct the first model to output structured data directly, including field values based on global slot fields, field values of non-global slot fields associated with each entry, and hierarchical relationships between at least one entry.
[0067] In other cases, the first prompt word also includes a first structured object to be populated and a second structured object to be populated, the first structured object including a global slot field, and the second structured object including at least one sub-object with a hierarchical relationship, the at least one sub-object corresponding to at least one entry.
[0068] Accordingly, the first prompt word indicates that structured data is generated in the following manner: Populate the field values of the global slot fields into the first structured object; Based on the hierarchical relationship between at least one item, the field value of the first non-global slot field is filled into the first-level sub-object of the second structured object, and the field value of the second non-global slot field is filled into the second-level sub-object belonging to the first-level sub-object; wherein, the first non-global slot field includes non-global slot fields related to the first-level items in the outline text, and the second non-global slot field includes non-global slot fields related to the sub-items of the first-level items; The first and second structured objects after being filled are used as structured data.
[0069] For example, continuing with the scenario of processing patent application documents, both the first and second structured objects can be JSON (JavaScript Object Notation) objects. One example of a first structured object to be populated is as follows: { "Invention Name": "", Technical Fields: "", "Current Technological Status": "", "Current Status of Technology - Original Text": "", Existing Solution: "", "Existing Solution - Original Text": "", "Existing defects": "", "Existing Defects - Original Text": "", "Inventive Idea": "", "Inventive Idea - Original Text": "", "Macroeconomic problems to be solved": "", "The macro-level problems addressed - original text": " }” The second structure object to be populated is as follows: { "authorization": "", "Type of Rights": "" "Unique Name": " "Sole Rights Theme": " "Rights Content": "" "Weight Characteristics": "" "Differences": "" "Sole power effect": " "The effect of monopolistic power - original text": " "Independent Expansion Method": " "Independent device rights corresponding to independent method rights": " "Feature List": [ { "Identifier": "" "Feature content": "" "Feature Implementation Overview": "" "Feature Implementation Description": " Feature Implementation Description - Original Text: " "Feature corresponds to attached sub-right": [] "Module Features and Functions": "" } ], "List of Subordinates": [ { "Authorization": "" "Type of Rights": "" "Subordinate rights belong to sole rights": " "Rights Content": "" "Weight Characteristics": "" "Differences": "" "Subordinate type": "" "Micro-level effects": " "From the perspective of micro-level effects - original text": " "Description of the implementation of the right": " "Description of the implementation of the right of way - Original text": " "Subordinate Function": " "Additional Subordinate Module Naming": " } ] }” It is understandable that by adding a first structured object and a second structured object to the first prompt word and instructing that structured data be generated by populating these objects, the text parsing process of the first model can be further constrained, reducing fabricated content. In addition, these structured objects also separate the hierarchical relationships between global slot fields, non-global slot fields, and items in the outline text, making it easier to populate each module more efficiently and accurately in the future.
[0070] S206, based on structured data and the execution plan of each module, populate fields for at least one module.
[0071] Specifically, at least one module can be scheduled based on the execution plan of each module, and the structure information of the outline text can be recursively expanded to fill the field values of each slot field into the corresponding module.
[0072] In some embodiments, the execution plan of a module may include the execution order of the modules and the enabling conditions. In this case, S206 above may include the following steps: S2062, based on the execution order and enabling conditions of each module, determine the first module to be scheduled from at least one module.
[0073] For example, the enableable modules can be determined based on the enablement conditions of each module, and the enableable modules can be arranged in execution order, thereby determining the first module to be scheduled based on the arrangement order.
[0074] Continuing with the example of patent application document processing, if the activation conditions of modules "Invention Title", "Technical Field", "Background Art", "Invention Content" and "Invention Content-Technical Solution-Independent Claims" are all met, then according to the execution order, the scheduling order of these modules is determined as follows: "Invention Title" -> "Technical Field" -> "Background Art" -> "Invention Content" -> "Invention Content-Technical Solution-Independent Claims".
[0075] Next, according to the scheduling order, each module can be sequentially designated as the first module to be scheduled, and after the current module is filled, the next module can be designated as the first module. Alternatively, all modules can be designated as the first module, and multiple threads can be used, each corresponding to one module. By running multiple threads in parallel, the modules can be filled in parallel.
[0076] S2064, based on the structural information and the field value of the first slot field, fill the field of the first module, where the first slot field is the slot field in the first module.
[0077] In some cases, the module's configuration information also includes the module's purpose. Accordingly, in response to the first entry of the outline text describing the purpose of the first module, the first module's fields are populated based on the first field value of the first slot field, where the first field value is derived from the first entry.
[0078] Understandably, this approach not only clarifies the source of field values for slots in each module, reducing fabricated content, but also ensures that the filling of each module strictly follows the hierarchical relationship between items in the outline text. This strengthens the consistency between the final generated explanatory text and the outline text, enabling the explanatory text to more fully support the outline text and improve its logical consistency.
[0079] Optionally, the module's execution plan may also include the module's loop rules. The loop rules specifically define the module's looping method, that is, the constraint rules for module reuse and circular calls.
[0080] Accordingly, filling the field of the first module based on the first field value of the first slot field may include: performing the following operations on the first module in a loop based on a loop rule: obtaining the field value of the current loop from the first field value from the first entry, and filling the field of the first module based on the field value of the current loop; and combining the first modules after each loop filling in response to the end of the loop.
[0081] For example, the purpose of the module "Summary of Invention - Technical Solution - Independent Claims" is to describe the independent claims (i.e., the first item) in the claims document (i.e., the outline text). This module contains slot fields "Independent Claim Name" and "Independent Claim Subject," and its loop rule is to loop through the independent claims. Based on this, during the scheduling of this module, the following operations can be performed on the first module in a loop until all independent claims have been traversed: traverse the independent claims in the outline text; for each independent claim encountered, obtain its name and subject; fill the obtained name into the "Independent Claim Name" slot field of this module; fill the obtained subject into the "Independent Claim Subject" slot field of this module, thus obtaining the description text of that independent claim; then proceed to the next independent claim. After obtaining the description texts of all independent claims, these description texts are combined to complete the scheduling of this module.
[0082] It is understandable that by configuring loop rules for each module and filling the modules according to the loop rules, not only is module reuse achieved and the utilization rate of the modules improved, but the module filling process is also further constrained to ensure that it unfolds strictly in accordance with the hierarchical relationship between the items in the outline text.
[0083] As can be seen, in the above embodiments, the execution plan of each module constrains the generation method of the explanatory text, and the structured data constrains the generated content and content hierarchy, ultimately automatically completing the conversion from rules to text. This approach helps to significantly improve the efficiency and accuracy of text generation.
[0084] In some embodiments, S206 may include the following steps: obtaining a second prompt word, and inputting the second prompt word, the execution plan of each module, the fixed text and slot fields contained in each module, and structured data into a second model to obtain explanatory text output by the second model. The second prompt word is used to indicate, based on the structural information of the execution plan and outline text of each module, to fill the slot values in the structured data into the corresponding modules, and to combine the filled modules into explanatory text.
[0085] The second model may include various models with text understanding and generation capabilities, and this specification does not limit the specific models used in the embodiments. For example, the second model may include, but is not limited to, large language models, multimodal large models, and text generation models.
[0086] S208, combine at least one of the filled modules to obtain the explanatory text corresponding to the outline text.
[0087] The fact that the explanatory text corresponds to the outline text can be understood as follows: the explanatory text strictly follows the content boundaries and structural specifications defined by the outline text in terms of the overall framework, item hierarchy, core technical points and logical relationships, and the description text corresponding to each item does not deviate, omit, or fabricate.
[0088] The filled modules can be combined according to their execution order to obtain the explanatory text corresponding to the outline text.
[0089] In some embodiments, in order to ensure that the explanatory text content is accurate, standardized and complete, after S208 above, at least one of the following may be included: polishing the explanatory text corresponding to the outline text; performing consistency verification on the outline text and the explanatory text corresponding to the outline text, etc.
[0090] Polishing explanatory text can include optimizing the expression of its content, such as adjusting sentence structure without changing the semantics or hierarchical relationships.
[0091] The consistency check of the outline text and its corresponding explanatory text may include, but is not limited to, at least one of the following: checking whether each item in the outline text has a corresponding descriptive text in the explanatory text; checking whether each item in the outline text and its corresponding descriptive text in the explanatory text are consistent in content; checking whether the logic of the explanatory text is self-consistent; checking whether the wording in the explanatory text is consistent; checking whether the word references in the explanatory text are clear; and checking whether there is duplicate content in the explanatory text.
[0092] The text processing method provided in this specification, through pre-configuring information such as at least one module, the content of each module, and the execution plan of the explanatory text to be generated, and dividing the module content into fixed text and slot fields, allows the explanatory text generation process to balance human guidance and template rule constraints. Furthermore, the first model is used to parse the original text and outline text, extracting structured data such as the structural information of the outline text and the field values corresponding to the slot fields of each module, providing content support and structural constraints for the explanatory text generation process. Further, based on the structured data and the execution plans of each module, the slot fields are filled, which not only clarifies the content source of the slot fields, effectively reducing fabricated content, but also strengthens the consistency between the explanatory text and the outline text, thereby improving the overall text quality. Finally, the combined filled modules yield the explanatory text. It is evident that relying on the first model to assist the generation process can significantly improve the efficiency of text generation while ensuring text quality.
[0093] The text generation method provided in the embodiments of this specification can be applied to various scenarios of generating explanatory text, such as technical documents, patent application documents, etc., and the embodiments of this specification do not limit it.
[0094] To facilitate understanding of the text generation method provided in the embodiments of this specification, the generation process of the specification will be described in detail below using the processing scenario of patent application documents as an example.
[0095] In this scenario, the original text includes the technical disclosure, the outline text includes the claims, and the explanatory text includes the specification. The structural information of the outline text may include: the descriptive information of the independent claims in the claims, the set of features contained in the independent claims, and the descriptive information of the dependent claims contained in the independent claims.
[0096] The process of generating the instruction manual may include the following two stages: Phase 1: Module Configuration.
[0097] First, a first template is presented, which corresponds to the instruction manual to be generated, and in response to the segmentation operation on the first template, the first template is segmented into multiple modules.
[0098] Next, a configuration interface is presented, which includes configuration controls for each module; based on the editing operation of the configuration controls for the second module, the configuration information of the second module is determined, and the second module is any one of the above modules.
[0099] Phase Two: Generating the instruction manual.
[0100] First, the claims and technical disclosure are parsed using the first model to obtain the field values of the global slot field and the structural information of the claims. The structural information of the claims may include: the descriptive information of each independent claim, the feature set contained in each independent claim, and the descriptive information of the dependent claims contained in each independent claim.
[0101] Then, based on the field values of the global slot fields, the structural information of the claims, and the execution plans of each module, the fields of each module are filled in, and the filled modules are combined to obtain a preliminary specification.
[0102] Finally, the specification is polished and verified to obtain the specification corresponding to the claims.
[0103] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0104] Based on the same inventive concept, embodiments of this specification also provide a text generation system. Figure 3 This is a schematic diagram of the structure of a text generation system 300 provided in an embodiment of this specification. The system 300 may include: an acquisition unit 310, a parsing unit 320, an execution engine unit 330, and an output unit 340.
[0105] The acquisition unit 310 is used to acquire at least one module contained in the description text to be generated and the configuration information of each module. The configuration information of the module includes the fixed text and slot fields contained in the module and the execution plan of the module.
[0106] The parsing unit 320 is used to parse the original text and outline text using the first model to obtain structured data. The structured data includes: the structural information of the outline text, and the field values of the slot fields.
[0107] The execution engine unit 330 is used to populate fields of the at least one module based on the structured data and the execution plan of each module.
[0108] The output unit 340 is used to combine at least one of the filled modules to obtain the explanatory text corresponding to the outline text.
[0109] In some embodiments, the outline text includes at least one entry, and the slot fields in the at least one module include global slot fields and non-global slot fields associated with each entry; The parsing unit is used for: Obtain the first prompt word, and input the first prompt word, the original text, and the outline text into the first model to obtain structured data; the first prompt word is used to instruct the following operations: The original text and the outline text are parsed to obtain the field values of the global slot fields and the field values of the non-global slot fields associated with each entry. The outline text is structurally parsed to obtain the hierarchical relationship between the at least one item; Structured data is generated based on the field values of the global slot field, the field values of the non-global fields associated with each entry, and the hierarchical relationship.
[0110] In some embodiments, the first prompt word further includes a first structured object to be filled and a second structured object to be filled, the first structured object including the global slot field, and the second structured object including at least one sub-object having a hierarchical relationship, the at least one sub-object corresponding to the at least one entry; The first prompt word indicates that the structured data is generated in the following manner: Fill the field value of the global slot field into the first structured object; Based on the hierarchical relationship between the at least one item, the field value of the first non-global slot field is filled into the first-level sub-object of the second structured object, and the field value of the second non-global slot field is filled into the second-level sub-object belonging to the first-level sub-object; wherein, the first non-global slot field includes non-global slot fields related to the first-level items in the outline text, and the second non-global slot field includes non-global slot fields related to the sub-items of the first-level items; The first and second structured objects after being filled are used as the structured data.
[0111] In some embodiments, the first prompt word may also include at least one of the following information for the slot field in each module: field value source and filling rules.
[0112] In some embodiments, the execution plan of the module includes the execution order and enabling conditions of the module; The execution engine unit is used for: Based on the execution order and activation conditions of each module, determine the first module to be scheduled from the at least one module; Based on the structural information and the field value of the first slot field, the first module is filled with fields, where the first slot field is the slot field in the first module.
[0113] In some embodiments, the configuration information of the module may also include the purpose of the module; The execution engine unit populates the fields of the first module in the following way: In response to the purpose instruction of the first module describing the first entry in the outline text, the first module is populated with fields based on the first field value of the first slot field, the first field value being derived from the first entry.
[0114] In some embodiments, the execution plan of the module may further include the module's loop rules; The execution engine unit populates the fields of the first module in the following way: Based on the loop rule, the first module performs the following operations in a loop: obtain the field value for the current loop from the first field value derived from the first entry, and fill the field of the first module based on the field value for the current loop; In response to the end of the loop, the first module after each loop fill is combined.
[0115] In some embodiments, the text generation system may further include an interactive control unit; The interactive control unit is used for: A first template is presented, which corresponds to the type of the explanatory text to be generated; In response to the segmentation operation on the first template, the first template is segmented into the at least one module.
[0116] In some embodiments, the text generation system may further include a configuration unit; The configuration unit is used for: A configuration interface is presented, which includes configuration controls for each of the at least one module; Based on the editing operation of the configuration control of the second module, the configuration information of the second module is determined, wherein the second module is any one of the at least one module.
[0117] In some embodiments, the text generation system may further include a verification unit; The verification unit is used to perform at least one of the following: Polish the explanatory text corresponding to the outline text; A consistency check is performed on the outline text and the corresponding explanatory text.
[0118] In some embodiments, the original text includes a technical disclosure document, the outline text includes the claims of a patent application document, and the explanatory text includes the specification of a patent application document; The structural information includes: the description information of the independent claims in the claim set, the feature set contained in the independent claims, and the description information of the dependent claims contained in the independent claims.
[0119] Clearly, the aforementioned text generation system can serve as... Figure 2 The execution body of the text generation method shown is therefore able to realize the text generation method in Figure 2 The functions implemented are the same, so they will not be described in detail here.
[0120] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. Please refer to it. Figure 4At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0121] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0122] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0123] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a text generation system at the logical level. The processor executes the program stored in memory and specifically performs the following operations: Obtain at least one module contained in the description text to be generated and the configuration information of each module. The configuration information of the module includes the fixed text and slot fields contained in the module, and the execution plan of the module. The original text and outline text are parsed using the first model to obtain structured data; the structured data includes: the structural information of the outline text, and the field values of the slot fields; Based on the structured data and the execution plan of each module, fields are populated for at least one module; Combine at least one of the filled modules to obtain the explanatory text corresponding to the outline text.
[0124] The above is as described in this instruction manual. Figure 2The text generation system method disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0125] The electronic device can also perform Figure 2 The method, and implement the text generation system in Figure 2 The functions of the embodiments shown are not described in detail here.
[0126] Of course, in addition to software implementation, the electronic device described in this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0127] This specification also provides a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 2 The method of the illustrated embodiment is specifically used to perform the following operations: Obtain at least one module contained in the description text to be generated and the configuration information of each module. The configuration information of the module includes the fixed text and slot fields contained in the module, and the execution plan of the module. The original text and outline text are parsed using the first model to obtain structured data; the structured data includes: the structural information of the outline text, and the field values of the slot fields; Based on the structured data and the execution plan of each module, fields are populated for at least one module; Combine at least one of the filled modules to obtain the explanatory text corresponding to the outline text.
[0128] This specification also provides a computer program product including a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform the steps of the text generation method provided in this specification.
[0129] In summary, the above description is merely a preferred embodiment of this specification and is not intended to limit the scope of protection of this document. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this document should be included within the scope of protection of this document.
[0130] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0131] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in this article, computer-readable media do not include transient media, such as modulated data signals and carrier waves.
[0132] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0133] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
Claims
1. A text generation method characterized by, include: Obtain at least one module contained in the description text to be generated and the configuration information of each module. The configuration information of the module includes the fixed text and slot fields contained in the module, and the execution plan of the module. The first model is used to parse the original text and outline text to obtain structured data; The structured data includes: the structural information of the outline text, and the field values of the slot fields; Based on the structured data and the execution plan of each module, fields are populated for at least one module; Combine at least one of the filled modules to obtain the explanatory text corresponding to the outline text.
2. The method of claim 1, wherein, The outline text includes at least one entry, and the slot fields in the at least one module include global slot fields and non-global slot fields associated with each entry; The process of parsing the original text and outline text using the first model to obtain structured data includes: Obtain the first prompt word, and input the first prompt word, the original text, and the outline text into the first model to obtain structured data; the first prompt word is used to instruct the following operations: The original text and the outline text are parsed to obtain the field values of the global slot fields and the field values of the non-global slot fields associated with each entry. The outline text is structurally parsed to obtain the hierarchical relationship between the at least one item; Structured data is generated based on the field values of the global slot field, the field values of the non-global fields associated with each entry, and the hierarchical relationship.
3. The method of claim 2, wherein, The first prompt word also includes a first structured object to be filled and a second structured object to be filled. The first structured object includes the global slot field, and the second structured object includes at least one sub-object with a hierarchical relationship, wherein the at least one sub-object corresponds to the at least one entry. The first prompt word indicates that the structured data is generated in the following manner: Fill the field value of the global slot field into the first structured object; Based on the hierarchical relationship between the at least one item, the field value of the first non-global slot field is filled into the first-level sub-object of the second structured object, and the field value of the second non-global slot field is filled into the second-level sub-object belonging to the first-level sub-object; wherein, the first non-global slot field includes non-global slot fields related to the first-level items in the outline text, and the second non-global slot field includes non-global slot fields related to the sub-items of the first-level items; The first and second structured objects after being filled are used as the structured data.
4. The method of claim 2, wherein, The first prompt also includes at least one of the following pieces of information for the slot field in each module: the source of the field value and the filling rule.
5. The method of claim 1, wherein, The execution plan of the module includes the execution order and activation conditions of the module; The process of populating fields for at least one module based on the structured data and the execution plan for each module includes: Based on the execution order and activation conditions of each module, determine the first module to be scheduled from the at least one module; Based on the structural information and the field value of the first slot field, the first module is filled with fields, where the first slot field is the slot field in the first module.
6. The method of claim 5, wherein, The configuration information of the module also includes the purpose of the module; The step of filling fields in the first module based on the structural information and the slot value of the first slot includes: In response to the purpose instruction of the first module describing the first entry in the outline text, the first module is populated with fields based on the first field value of the first slot field, the first field value being derived from the first entry.
7. The method according to claim 6, characterized in that, The execution plan of the module also includes the module's loop rules; The step of filling the field of the first module based on the first field value of the first slot field includes: Based on the loop rule, the first module performs the following operations in a loop: obtain the field value for the current loop from the first field value derived from the first entry, and fill the field of the first module based on the field value for the current loop; In response to the end of the loop, the first module after each loop fill is combined.
8. The method according to claim 1, characterized in that, The at least one module is obtained in the following way: A first template is presented, which corresponds to the type of the explanatory text to be generated; In response to the segmentation operation on the first template, the first template is segmented into the at least one module.
9. The method according to claim 1, characterized in that, The method further includes: A configuration interface is presented, which includes configuration controls for each of the at least one module; Based on the editing operation of the configuration control of the second module, the configuration information of the second module is determined, wherein the second module is any one of the at least one module.
10. The method according to claim 1, characterized in that, The method further includes at least one of the following: Polish the explanatory text corresponding to the outline text; A consistency check is performed on the outline text and the corresponding explanatory text.
11. The method according to claim 1, characterized in that, The original text includes a technical disclosure document, the outline text includes the claims of a patent application document, and the explanatory text includes the specification of a patent application document; The structural information includes: the description information of the independent claims in the claim set, the feature set contained in the independent claims, and the description information of the dependent claims contained in the independent claims.
12. A text generation system, characterized in that, include: The acquisition unit is used to acquire at least one module contained in the description text to be generated and the configuration information of each module. The configuration information of the module includes the fixed text and slot fields contained in the module, and the execution plan of the module. The parsing unit is used to parse the original text and outline text using the first model to obtain structured data; The structured data includes: the structural information of the outline text, and the field values of the slot fields; An execution engine unit is used to populate fields of at least one module based on the structured data and the execution plan of each module; The output unit is used to combine at least one of the filled modules to obtain the explanatory text corresponding to the outline text.
13. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the text generation method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the steps of the text generation method as described in any one of claims 1 to 11.
15. A computer program product, characterized in that, The computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform the steps of the text generation method as described in any one of claims 1 to 11.