Method and system for generating image-text in document based on intelligent agent
By leveraging intelligent agents and deep learning models, the problems of inaccurate and inefficient chart generation in document generation have been solved, enabling efficient and personalized document generation and ensuring the consistency and professionalism of charts and text content.
Patent Information
- Application Number
- CN202510958388.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technologies suffer from problems such as inaccurate chart generation, inconsistent parsing, and low efficiency in document generation, making it difficult to meet the specific needs of different industries and fields. Furthermore, the generated documents lack clear structure and logic, resulting in insufficient practicality.
A document image and text generation method based on intelligent agents is adopted. Initial content is generated and special tags are added through a large model service. The chart generation agent parses the description information and calls the corresponding tools to generate charts. Consistency verification is combined to ensure image and text matching. Deep learning and graph neural networks are used to understand user needs. Multiple intelligent agents work together to generate documents.
It achieves seamless integration of charts and text content, improves the accuracy and efficiency of chart generation, ensures the professionalism and readability of documents, and can generate high-quality, personalized documents according to user needs.
Smart Images

Figure CN120997339A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and document generation technology, and in particular to a method and system for generating text and images in documents based on intelligent agents. Background Technology
[0002] In the current wave of information technology, the digitization and structuring of document content has become an essential means for enterprises to improve operational efficiency and strengthen decision support. Although the widespread use of electronic documents has greatly promoted information flow and resource sharing, many enterprises still face numerous problems in document management, such as cumbersome processing workflows, difficulties in data integration, and inaccurate chart generation. These problems not only affect the daily operations of enterprises but also constrain their development potential during digital transformation. When generating document content from large models, unclear chart markings or inaccurate generation often occur; this technical bottleneck directly impacts the overall efficiency and accuracy of the document generation system.
[0003] To address key challenges in document generation and processing, existing technologies primarily include Optical Character Recognition (OCR), Natural Language Processing (NLP), machine learning algorithms, cloud storage, and cloud computing. These technologies have, to some extent, enabled rapid document retrieval, intelligent classification, and automatic parsing. However, the application of a single technology often struggles to handle complex and varied document structures and content, exhibiting problems such as inaccurate parsing, errors in chart generation, and low processing efficiency in practice. Particularly in chart generation, while existing tools can assist in creating tables or graphs, they struggle to accurately identify and process chart descriptions in complex documents, thus affecting the quality of the final output. These issues reflect the limitations of existing technologies in terms of scalability and compatibility, making it difficult to meet the specific needs of different industries and fields.
[0004] Existing technologies also face the following specific challenges: 1. Insufficient information input: Large models typically require rich contextual information to generate high-quality documents, but in practical applications, input information is often limited, leading to poor generation results. 2. Low degree of structuring: The generated documents lack clear structure and logic, making it difficult to meet the format and specification requirements of professional documents. 3. Insufficient practicality: The generated content is often disconnected from actual business needs, lacking relevance and practicality, and difficult to use directly in specific scenarios. Summary of the Invention
[0005] The purpose of this invention is to overcome the problems of low quality, low efficiency and inconsistency between text and images in traditional text and image generation technologies, and to provide a method and system for generating text and images in documents based on intelligent agents.
[0006] The technical solution adopted in this invention is: A method for generating text and images in a document based on an intelligent agent includes the following steps: Step 1: Based on the user's input, invoke the Large Model Service to generate preliminary document content, and add special markers and descriptive information to the parts involving charts; Step 2: Locate the chart's description information using special markers and parse the description information to obtain the chart type and detailed chart information; Step 3: Arrange the process according to the parsed content, and call the corresponding chart generation tool to generate chart content according to the chart type; Step 4: Replace the generated chart content with the special markers and chart descriptions in the document to obtain the replaced document; Step 5: Perform overall document consistency and accuracy verification on the replaced document, and determine whether the verification passes; if yes, output the final document to complete document generation; otherwise, proceed to step 2.
[0007] Specifically, he ensured that the content of the charts and graphs in the document fully matched the chart descriptions through consistency checks, avoiding errors or inconsistencies between the text and images. This verification process ensured the quality and accuracy of the final document's text and image content.
[0008] Furthermore, in step 1, a large model (deep learning model, such as BERT or GPT) is used to semantically understand user needs and a graph neural network (GNN) is used to generate a document outline. Then, the chapter content is written using a sequence-to-sequence (Seq2Seq) model.
[0009] Specifically, large models (such as BERT, GPT, etc.) are used to understand the overall content and logical relationships of a document, and key entity, attribute and relationship information is extracted in order to generate a document outline.
[0010] Furthermore, in step 2, the intelligent agent is generated by analyzing the chart to identify the chart type and detailed information, including size, layout, entities, attributes, and relationships.
[0011] Furthermore, in step 3, the corresponding chart generation tool is called from the tool layer. The chart generation tools provided by the tool layer include flowchart generation tool, Gantt chart generation tool, topology chart generation tool, lookup table tool, table generation tool, bar chart generation tool, line chart generation tool, pie chart generation tool, scatter plot generation tool, and heatmap generation tool.
[0012] Furthermore, in step 3, when the chart generation tool fails to execute, it provides error information, makes adjustments, and re-executes the generation process; at the same time, it records the information of the execution failure process to facilitate subsequent debugging and problem tracking, and to ensure that the document generation process is traceable.
[0013] Furthermore, it also includes a feedback process: each step and execution result are recorded through the state management layer and fed back to the graph agent to support subsequent verification and adjustment; a logging and monitoring mechanism is added to quickly locate problems when they occur; and a user feedback mechanism is provided to allow users to review the generated content at each stage and make suggestions for modification or optimization, and to adjust the parameters of the large model based on user feedback.
[0014] A document image and text generation system based on intelligent agents, comprising: Document Authoring System: As the starting point of the system, it receives user input, calls the Large Model Service to generate preliminary document content, and adds special markings and descriptive information to sections involving diagrams; Chart generation agent: It locates the chart description information through special tags and parses the description information to obtain the chart type and detailed chart information; it arranges the process according to the parsed content, and calls the corresponding chart generation tool to generate chart content according to the chart type; The image and text integration module is used to replace the generated chart content with special markers and chart descriptions in the document, resulting in a replaced document. Consistency verification module: Used to verify the overall consistency and accuracy of the replaced document, and to repeatedly parse and generate charts when the consistency verification fails, until the verification passes; Document output module: Outputs the final document that has passed the consistency check. The document contains verified text and image content.
[0015] Furthermore, the large model service integrates deep learning models, graph neural networks, and sequence-to-sequence models. It uses deep learning models to semantically understand user needs and combines graph neural networks to generate document outlines. Then, it uses sequence-to-sequence models to write chapter content to generate the initial content of the document.
[0016] Furthermore, the tool layer provides chart generation tools corresponding to different chart types, including flowchart generation tools, Gantt chart generation tools, topology diagram generation tools, table lookup tools, table generation tools, bar chart generation tools, line chart generation tools, pie chart generation tools, scatter plot generation tools, and heatmap generation tools.
[0017] Furthermore, the system includes a user feedback and optimization module. This module has a state management layer that records each step and its results, feeding them back to the chart agent to support subsequent verification and adjustments. By adding logging and monitoring mechanisms, problems can be quickly located and resolved. A user feedback mechanism allows users to review the generated content at each stage and provide suggestions for modification or optimization. Based on user feedback, the parameters of the large model are adjusted to optimize the quality and accuracy of the generated results. Through continuous learning and feedback mechanisms, the generation algorithm, chart type support, and user experience are gradually improved to meet more complex user needs.
[0018] This invention, employing the above technical solutions, possesses the following technical advantages: 1) Through the collaborative work of the user interaction agent and the task planning agent, pre-trained deep learning models such as BERT or GPT are used to extract high-level semantic information from the text, thereby more accurately understanding user needs. Through task analysis and decomposition, the system can transform user needs into specific task steps and formulate optimal execution strategies, significantly improving the personalization and accuracy of document generation. 2) Through collaboration between agents, combined with the semantic understanding and logical reasoning capabilities of large models, the automatic generation of charts and tables is achieved. The system can automatically identify the required chart types based on the document outline structure, flexibly call relevant tools to generate different types of charts and tables, and ensure the accuracy and relevance of the content, thereby greatly improving the quality and efficiency of chart generation. 3) By synchronously generating the main text and chart descriptions, and inserting specific markers in the chart section, the system ensures that the text agent and chart agent coordinate with each other during the generation process, enabling seamless integration of chart content with the main text description. While automatically generating text content according to the outline, the system precisely provides the location and detailed requirements for chart generation, thereby avoiding the problem of mismatch between the style and information of the text and graphics content. 4) By introducing a content verification agent, a BERT-based natural language verification model is used to perform grammar and format checks, ensuring the accuracy of the document content. Simultaneously, an online learning strategy, such as FTRL, is employed to automatically send verification results back to the relevant agents, continuously optimizing the content until the document output is complete, significantly improving the professionalism and readability of the document. Attached Figure Description
[0019] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments; Figure 1 This is a flowchart illustrating a document image and text generation method based on intelligent agents according to the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0021] like Figure 1As shown, this invention discloses a method for generating text and graphics in a document based on intelligent agents, relying on the collaborative work of multiple intelligent agents. First, it receives document content input by the user and generates an outline and related tags. Based on the generated outline, it automatically parses each part of the content and performs flow arrangement. On this basis, it automatically calls relevant tools, such as flowchart generation tools, Gantt chart generation tools, and topology diagram generation tools, to generate text and graphics content. After the diagram description is extracted, the diagram intelligent agent takes over and generates the corresponding diagram, which then replaces the description in the document. Finally, the generated content is verified by the intelligent agents to ensure the consistency and accuracy of the text and graphics. If the verification is successful, the document is finally output; if the verification fails, the flow will return to rearrangement until the required text and graphics content is generated. The method of this invention specifically includes the following steps: Step 1: Based on the user's input, invoke the Large Model Service to generate preliminary document content, and add special markers and descriptive information to the parts involving charts; First, the system uses Natural Language Processing (NLP) technology to parse the user-input document, extracting key entities, semantic structure, and logical relationships to generate a document outline. Simultaneously, the system marks the sections of the document that require charts and inserts special tags to these sections so that the chart generation agent can recognize and process them. The system also extracts tabular data from the document, providing foundational information and data support for subsequent chart generation. The large model service is the core module of the system, responsible for deep semantic analysis. It uses large models (such as BERT and GPT) to understand the overall content and logical relationships of the document, extracting key entity, attribute, and relational information. During this process, the system automatically generates preliminary document content and adds special tags to indicate the location of charts and related descriptive information. These tags provide necessary guidance to the chart generation agent to ensure that the generated charts match the document content.
[0022] Step 2: Locate the chart's description information using special markers and parse the description information to obtain the chart type and detailed chart information; Step 3: Arrange the process according to the parsed content, and call the corresponding chart generation tool to generate chart content according to the chart type; The chart generation agent locates and parses the chart description based on special markers inserted in the document. The system identifies the required chart type (such as flowchart, Gantt chart, bar chart, etc.) and performs detailed analysis of the chart's layout, size, and content. Then, the chart agent invokes the appropriate chart generation tools (such as flowchart generators, bar chart generators, etc.) to generate a chart that meets the requirements and inserts it into the corresponding location in the document.
[0023] Step 4: Replace the generated chart content with the special markers and chart descriptions in the document to obtain the replaced document; Step 5: Perform overall document consistency and accuracy verification on the replaced document, and determine whether the verification passes; if yes, output the final document to complete document generation; otherwise, proceed to step 2.
[0024] Specifically, he ensured that the content of the charts and graphs in the document fully matched the chart descriptions through consistency checks, avoiding errors or inconsistencies between the text and images. This verification process ensured the quality and accuracy of the final document's text and image content.
[0025] Furthermore, in step 1, a large model (deep learning model, such as BERT or GPT) is used to semantically understand user needs and a graph neural network (GNN) is used to generate a document outline. Then, the chapter content is written using a sequence-to-sequence (Seq2Seq) model.
[0026] Specifically, large models (such as BERT, GPT, etc.) are used to understand the overall content and logical relationships of a document, and key entity, attribute and relationship information is extracted in order to generate a document outline.
[0027] Furthermore, in step 2, the intelligent agent is generated by analyzing the chart to identify the chart type and detailed information, including size, layout, entities, attributes, and relationships.
[0028] Furthermore, in step 3, the corresponding chart generation tool is called from the tool layer. The chart generation tools provided by the tool layer include flowchart generation tool, Gantt chart generation tool, topology chart generation tool, lookup table tool, table generation tool, bar chart generation tool, line chart generation tool, pie chart generation tool, scatter plot generation tool, and heatmap generation tool.
[0029] Furthermore, in step 3, when the chart generation tool fails to execute, it provides error information, makes adjustments, and re-executes the generation process; at the same time, it records the information of the execution failure process to facilitate subsequent debugging and problem tracking, and to ensure that the document generation process is traceable.
[0030] Furthermore, users are notified to review the generated content of each stage of the large model and to provide suggestions for modification or optimization. The parameters of the large model are then adjusted based on user feedback.
[0031] A document image and text generation system based on intelligent agents, comprising: Document Authoring System: As the starting point of the system, it receives user input, calls the Large Model Service to generate preliminary document content, and adds special markings and descriptive information to sections involving diagrams; Specifically, the document writing system acts as a bridge between users and the large model service, ensuring that user needs are accurately communicated and processed. The large model service is the core of the system, generating document content and special tags. Based on the request, the large model service generates preliminary document content and adds special tags and descriptive information to sections involving charts. The generated content includes special tags to identify chart locations and descriptive information. These tags provide the chart generation agent with the necessary information to correctly parse and generate charts.
[0032] Chart generation agent: It locates the chart description information through special tags and parses the description information to obtain the chart type and detailed chart information; it arranges the process according to the parsed content, and calls the corresponding chart generation tool to generate chart content according to the chart type; Specifically, the chart generation agent locates and parses chart description information using special markers. The agent identifies and parses the marked chart description information in the document. It parses the chart type and detailed information, including size, layout, entities, attributes, and relationships. The agent then orchestrates the parsed content and calls tools to generate the relevant content. Finally, the agent organizes the parsed information and selects an appropriate tool to generate the chart.
[0033] The image and text integration module is used to replace the generated chart content with special markers and chart descriptions in the document, resulting in a replaced document. Consistency verification module: Used to verify the overall consistency and accuracy of the replaced document, and to repeatedly parse and generate charts when the consistency verification fails, until the verification passes; Specifically, after replacing the tags and content descriptions, the agent performs a content consistency check on the text and images, generating charts and graphs that replace the tags in the document. The agent then checks the overall document for consistency and accuracy. If the check fails: based on the check result, the agent repeats the parsing and generation process until the check passes. If the execution tool fails, it sends an error message back to the agent and repeats the check and feedback process until the generated content meets the requirements.
[0034] Document output module: Outputs the final document that has passed the consistency check. The document contains verified text and image content.
[0035] Furthermore, the large model service integrates deep learning models, graph neural networks, and sequence-to-sequence models. It uses deep learning models to semantically understand user needs and combines graph neural networks to generate document outlines. Then, it uses sequence-to-sequence models to write chapter content to generate the initial content of the document.
[0036] Furthermore, the tool layer provides chart generation tools corresponding to different chart types, including flowchart generation tools, Gantt chart generation tools, topology diagram generation tools, table lookup tools, table generation tools, bar chart generation tools, line chart generation tools, pie chart generation tools, scatter plot generation tools, and heatmap generation tools.
[0037] Furthermore, the system includes a user feedback and optimization module. This module has a state management layer that records each step and its results, feeding them back to the chart agent to support subsequent verification and adjustments. By adding logging and monitoring mechanisms, problems can be quickly located and resolved. A user feedback mechanism allows users to review the generated content at each stage and provide suggestions for modification or optimization. Based on user feedback, the parameters of the large model are adjusted to optimize the quality and accuracy of the generated results. Through continuous learning and feedback mechanisms, the generation algorithm, chart type support, and user experience are gradually improved to meet more complex user needs.
[0038] Example: In a feasible instance, the user requirement is clearly defined as generating a project management report that includes a Gantt chart of the project schedule. Furthermore, the user has provided a timeline for each phase of the project: the design phase from January to February 2025, the development phase from March to April, and the testing phase from May to June. The system may also consider the user's potential preferences for document style; generally, project management reports need to have a rigorous and clearly structured style.
[0039] During document generation, the system determines whether a project schedule Gantt chart needs to be inserted based on user requirements. Since the user explicitly requests the report to include a project schedule Gantt chart, the system automatically inserts a special marker at the appropriate location in the document. This special marker not only indicates the specific location where the Gantt chart should be inserted but also includes descriptive information related to the Gantt chart. The description might look like this: "[CHART: GANTT, PROJECT SCHEDULE, DESIGN (JAN - FEB 2025), DEVELOPMENT (MAR - APR 2025), TESTING (MAY - JUN 2025)]", clearly indicating that a Gantt chart should be inserted here to show the schedule for the project design, development, and testing phases, with a timeframe from January to June 2025. These special markers are used to indicate the location of the chart and related descriptive information, providing clear guidance for subsequent chart generation.
[0040] When generating charts, the system accurately determines the chart type as a Gantt chart based on the descriptive information in the special markers. The data to be displayed includes the schedule of the project design, development, and testing phases, along with their corresponding timeframes. Based on this information, the system extracts the necessary data from relevant project management data, such as the start and end times of each phase. Then, using a suitable chart generation tool, the system visualizes the data according to the Gantt chart format. In this example, a Gantt chart including the design (January-February 2025), development (March-April), and testing (May-June) phases will be generated. Finally, the generated Gantt chart is accurately inserted into the document at the location indicated by the special markers, thus completing the entire project management report generation process. Through this workflow, the system can efficiently and accurately generate project management reports containing project schedule Gantt charts according to user needs, ensuring both the quality of the report content and improving its visualization and readability. The specific implementation process is as follows: User input: "Generate a project management report, including a Gantt chart showing the project progress from design (January-February 2025), development (March-April), and testing (May-June)." The system generated the following preliminary content:
[0041] Project Overview: This project aims to develop a new product, with a planned timeframe of 6 months.
[0042] Project Schedule: [GANTT_CHART: Shows the project's task allocation from January 2025 to June 2025, including design (January-February), development (March-April), and testing (May-June)].
[0043] The system invokes a chart generation agent based on the generated content and special markers. The chart generation agent locates the chart description information using the special markers, parses it, and extracts the chart type (such as flowchart, Gantt chart, bar chart, etc.) and related detailed information. After parsing, the system arranges the chart content into a flow and invokes appropriate tools (such as flowchart generation tools, bar chart generation tools, etc.) to generate the specific chart content.
[0044] Determining the chart type: The system directly identifies the chart type as a Gantt chart based on the keyword "GANTT_CHART" in the special tags. When parsing the special tags, the system follows preset keyword matching rules. When it finds a keyword in the description that corresponds to a Gantt chart, it determines the chart type to generate. For cases without explicit keywords, the system utilizes the semantic understanding capabilities of its large-scale model. For example, if the description is "showing the progress of each stage of the project over time," the large-scale model will analyze based on its understanding of commonly used charts in project management and determine that a Gantt chart is most suitable for displaying this relationship between time and task progress.
[0045] Implementation details: Taking Gantt charts as an example, the system uses regular expressions for keyword matching. For Gantt charts, the regular expression can be defined as r'(Gantt chart|GANTT_CHART)'. When the chart generation agent obtains the descriptive information of the special markers, it uses this regular expression to search. If a match is successful, it is determined to be a Gantt chart. If the keyword match fails, the descriptive information is input into a fine-tuned BERT model or other larger models. These larger models analyze the content involved in the description based on the semantic knowledge learned during training and output suggested chart types. After determining the chart type, the system further parses detailed information such as task name, start time, and end time based on the characteristics of Gantt charts to generate an accurate Gantt chart.
[0046] (1) Extraction type: Gantt chart.
[0047] (2) Extracted content: task and time range.
[0048] (3) Generate a simple chart.
[0049] The generated charts and graphs will replace the original special markers and chart descriptions in the document, forming a preliminary combined text and graphics document. At this point, the system will initiate a text-graphics consistency check to ensure that the chart and graph content in the document completely matches the chart and graph descriptions, avoiding errors or inconsistencies between the text and graphics. This check process is a crucial step in ensuring the quality and accuracy of the final document's text and graphics content.
[0050] If the consistency check fails, the system will enter a check and feedback loop. The system will restart parsing and generating the chart until the check passes. If the chart generation tool fails during the chart generation process, the system will promptly provide error information, automatically adjust, and re-execute the generation process. The entire process will be recorded in detail for subsequent debugging and problem tracking, ensuring the document generation process is traceable.
[0051] Example of verification failure: If the duration of "Development A" is incorrectly generated as 50 days (it should be 40 days), verification will find a discrepancy with the description, and the system will record the following error log: [ERROR] 2025-04-09 10:00:00 - The duration of task "Development A" is inconsistent. Expected: 40 days, actual: 50 days. The system adjusts it to 40 days and regenerates: Development A :crit, a3, after a2, 40d Example of tool failure: If there is a dependency error in the Mermaid syntax (such as after aX not being defined), the system will report: [ERROR] 2025-04-09 10:01:00 - Dependency “aX” is not defined. Adjust it to “after a2” and the system will correct it and retry to ensure successful generation.
[0052] The system provides a user feedback mechanism during the generation process. Users can review the generated content at each stage at any time and offer suggestions for modification or optimization. The system will adjust the model parameters based on user feedback, thereby optimizing the quality and accuracy of the generated results. In addition, the system will continuously learn and improve the generation algorithm, chart type support, and user experience through feedback mechanisms to meet more complex user needs.
[0053] User feedback: After review, the user suggested: "Add a 'Development Completed' milestone and change the title to '2025 Project Plan'." Adjusted and optimized record generation: The system has updated the generation rules to support dynamic adjustment of milestones and titles. Feedback log: [INFO] 2025-04-09 10:02:00 - User feedback: Added milestones, title adjusted to "2025 Project Plan", generation algorithm optimized. After all steps are successfully completed and pass the consistency check, the system enters the final document output stage. The system will output the final document, which contains verified text and graphics content, with a clear structure and accurate charts, efficiently meeting user needs and ensuring the quality and professionalism of the generated document.
[0054] This invention realizes the innovative application of multi-agent collaborative cooperation and chart intelligence. Through the efficient collaboration of multiple agents, combined with the powerful semantic understanding and logical reasoning capabilities of large-scale model services, it innovatively solves problems in traditional text and image generation, such as inconsistent text / image style and content, and unclear focus. Through the collaborative work of agents, the system accurately captures and expresses key information at every step from document writing to chart generation, ensuring the consistency and professionalism of the text and image content. In particular, the chart agent, through deep analysis of chart descriptions and special markers in the document, can intelligently identify different types of chart requirements and flexibly call upon appropriate tools to generate charts that meet the requirements, greatly improving the efficiency and accuracy of chart content generation. Furthermore, the chart intelligence achieves customization and personalization of chart content through automatic arrangement and process management of the document outline, ensuring a perfect fit between the final chart and the document content.
[0055] This invention implements a closed-loop user feedback mechanism and system optimization. By establishing this mechanism, users can provide feedback at every stage of text and image generation, whether it's the initial draft stage or the final document output stage. The intelligent agent dynamically adjusts based on user feedback to ensure that the final document better meets user needs and expectations. User feedback not only optimizes the accuracy and professionalism of the content but also enhances the system's responsiveness to personalized needs. Through continuous interaction with users, the system achieves higher adaptability and user satisfaction, further driving improvements in document generation quality.
[0056] This invention, employing the above technical solutions, possesses the following technical advantages: 1) Through the collaborative work of the user interaction agent and the task planning agent, pre-trained deep learning models such as BERT or GPT are used to extract high-level semantic information from the text, thereby more accurately understanding user needs. Through task analysis and decomposition, the system can transform user needs into specific task steps and formulate optimal execution strategies, significantly improving the personalization and accuracy of document generation. 2) Through collaboration between agents, combined with the semantic understanding and logical reasoning capabilities of large models, the automatic generation of charts and tables is achieved. The system can automatically identify the required chart types based on the document outline structure, flexibly call relevant tools to generate different types of charts and tables, and ensure the accuracy and relevance of the content, thereby greatly improving the quality and efficiency of chart generation. 3) By synchronously generating the main text and chart descriptions, and inserting specific markers in the chart section, the system ensures that the text agent and chart agent coordinate with each other during the generation process, enabling seamless integration of chart content with the main text description. While automatically generating text content according to the outline, the system precisely provides the location and detailed requirements for chart generation, thereby avoiding the problem of mismatch between the style and information of the text and graphics content. 4) By introducing a content verification agent, a BERT-based natural language verification model is used to perform grammar and format checks, ensuring the accuracy of the document content. Simultaneously, an online learning strategy, such as FTRL, is employed to automatically send verification results back to the relevant agents, continuously optimizing the content until the document output is complete, significantly improving the professionalism and readability of the document.
[0057] Obviously, the described embodiments are only a part of the embodiments of this application, not all of them. Without conflict, the embodiments and features in the embodiments of this application can be combined with each other. The components of the embodiments of this application described and illustrated herein can generally be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of this application is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
Claims
1. A method for generating text and images in a document based on an intelligent agent, characterized in that: It includes the following steps: Step 1: Based on the user's input, call the large model service to generate preliminary document content, and add special markers and descriptive information to the parts involving charts; Step 2: Locate the chart's description information using special markers and parse the description information to obtain the chart type and detailed chart information; Step 3: Arrange the process according to the parsed content, and call the corresponding chart generation tool to generate chart content according to the chart type; Step 4: Replace the generated chart content with the special markers and chart descriptions in the document to obtain the replaced document; Step 5: Perform overall document consistency and accuracy verification on the replaced document, and determine whether the verification passes; if yes, output the final document to complete document generation; otherwise, proceed to step 2.
2. The method for generating text and images in a document based on an intelligent agent according to claim 1, characterized in that: In step 1, the user's needs are semantically understood using a large model and a graph neural network is used to generate a document outline. Then, the chapter content is written using a sequence-to-sequence model.
3. The method for generating text and images in a document based on an intelligent agent according to claim 1, characterized in that: In step 2, the intelligent agent is generated by analyzing the chart to identify the chart type and detailed chart information, including size, layout, entities, attributes and relationships.
4. The method for generating text and images in a document based on an intelligent agent according to claim 1, characterized in that: In step 3, the corresponding chart generation tool is called from the tool layer. The chart generation tools provided by the tool layer include flowchart generation tool, Gantt chart generation tool, topology diagram generation tool, table lookup tool, table generation tool, bar chart generation tool, line chart generation tool, pie chart generation tool, scatter plot generation tool, and heat map generation tool.
5. The method for generating text and images in a document based on an intelligent agent according to claim 1, characterized in that: In step 3, when the chart generation tool fails to execute, the error message is fed back and the generation process is re-executed after adjustments are made; at the same time, the information of the execution failure process is recorded to facilitate subsequent debugging and problem tracking, and to ensure that the document generation process is traceable.
6. The method for generating text and images in a document based on an intelligent agent according to claim 1, characterized in that: It also includes a feedback process: each step and execution result are recorded through the state management layer and fed back to the graph agent to support subsequent verification and adjustment; logging and monitoring mechanisms are added to quickly locate problems when they occur; Provide a user feedback mechanism that allows users to review the generated content at each stage and make suggestions for modification or optimization, and adjust the parameters of the large model based on user feedback.
7. A document image and text generation system based on intelligent agents, employing the document image and text generation method based on intelligent agents according to any one of claims 1 to 6, characterized in that: The system includes: Document writing system: As the starting point of the system, it is used to receive user input and call the large model service to generate the initial content of the document, and add special marks and descriptive information to the parts involving charts; Chart generation agent: It locates the chart description information through special tags and parses the description information to obtain the chart type and detailed chart information; it arranges the process according to the parsed content, and calls the corresponding chart generation tool to generate chart content according to the chart type; The image and text integration module is used to replace the generated chart content with special markers and chart descriptions in the document, resulting in a replaced document. Consistency verification module: Used to verify the overall consistency and accuracy of the replaced document, and to repeatedly parse and generate charts when the consistency verification fails, until the verification passes; Document output module: Outputs the final document that has passed the consistency check. The document includes verified text and image content.
8. The document image and text generation system based on intelligent agents according to claim 7, characterized in that: The large model service integrates deep learning models, graph neural networks, and sequence-to-sequence models. It uses deep learning models to semantically understand user needs and combines graph neural networks to generate document outlines. Then, it uses sequence-to-sequence models to write chapter content to generate the initial content of the document.
9. A document image and text generation system based on intelligent agents according to claim 7, characterized in that: The tool layer provides chart generation tools for different chart types, including flowchart generation tools, Gantt chart generation tools, topology diagram generation tools, table lookup tools, table generation tools, bar chart generation tools, line chart generation tools, pie chart generation tools, scatter plot generation tools, and heatmap generation tools.
10. A document image and text generation system based on an intelligent agent according to claim 7, characterized in that: The system also includes a user feedback and optimization module, which has a state management layer. The state management layer records each step and the execution result, and feeds it back to the graph agent to support subsequent verification and adjustment. By adding logging and monitoring mechanisms, problems can be quickly located when they occur. It provides a user feedback mechanism, allowing users to review the generated content at each stage and make suggestions for modification or optimization. The parameters of the large model are adjusted based on user feedback, thereby optimizing the quality and accuracy of the generated results.