An intelligent writing method based on multi-agent cooperation

By adopting a multi-agent collaborative architecture, the rigidity of file parsing, image semantic understanding, and style control in multimodal document processing of intelligent writing systems has been solved. It has achieved fully automated generation of documents from multiple formats to Word documents, and the generated documents are logically clear, have a personalized style, and are consistent with the text and images.

CN120632092BActive Publication Date: 2025-11-07ZHEJIANG UNIV BINJIANG RES INST +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511141021.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-15
Publication Date
2025-11-07
Estimated Expiration
2045-08-15

AI Technical Summary

Technical Problem

Existing intelligent writing systems suffer from limited file parsing capabilities, insufficient image semantic understanding, rigid control over writing style, and low efficiency in utilizing literature when processing multimodal documents, making it difficult to generate high-quality, personalized, and logically coherent documents.

Method used

Employing a multi-agent collaborative architecture, this system automates the entire process of generating Word documents from various formats to a mix of text and images through multimodal understanding, dynamic style adaptation, and intelligent document matching. Specific steps include text and image resource extraction, semantic understanding, writing style feature extraction, intelligent document segmentation, and outline generation. Image-text matching, combined with image descriptions, ensures the professionalism and personalization of the articles.

Benefits of technology

It enables efficient processing of multimodal documents, generating documents with clear logic and a style that meets user needs, improving the utilization rate of document content, and ensuring consistency between text and images and the readability of articles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120632092B_ABST
    Figure CN120632092B_ABST
Patent Text Reader

Abstract

The application discloses an intelligent writing method based on multi-agent cooperation, and steps are as follows: receiving user uploading multiple format documents, extracting text and image resources, using a multimodal large language model to understand images and generate description text; using a large language model to construct a prompt word template, processing three types of input files to extract key information and construct a knowledge model; accepting user input to construct an enhanced prompt word, calling a large language model to generate an article outline; dividing the outline according to titles to generate chapter contents one by one, and writing an intelligent agent to generate text and automatically insert pictures according to requirements; and converting MarkDown format output into Word with a basic format. The application has the beneficial effect that intelligent writing is completed through multi-step cooperation, information is extracted from multiple sources, a model is constructed, an outline and content are efficiently generated and pictures are automatically inserted, and finally the format is converted, so that convenient, efficient and function-rich intelligent writing services are provided for users.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence and natural language processing, more particularly, to an intelligent writing method based on multi-agent collaboration. BACKGROUND

[0002] With the rapid development of artificial intelligence and natural language processing technology, intelligent writing systems have been widely applied in news reporting, academic research, business documents, etc. Current intelligent writing systems are mainly based on large language models (LLM) and can generate high-quality text according to user input prompts or instructions. For example, as shown in the invention patent with the patent number CN118917294B and the name of a smart writing method and system based on multi-role agents, the system and method generate naturally according to text content and writing parameters, but the above existing systems still have many limitations when processing complex documents:

[0003] Limited file parsing capability: existing systems can usually only process pure text content and lack support for documents containing multi-modal information such as images and tables. Although some tools can extract text content from PDF or Word, they still lack effective processing mechanisms for embedded chart understanding and description.

[0004] Insufficient image semantic understanding: most current intelligent writing systems cannot automatically analyze embedded images in documents and use their semantic information for subsequent writing tasks. For example, when writing a scientific paper, combining visual information from charts for explanation can significantly improve the professionalism and readability of the article.

[0005] Rigid writing style control: many systems only provide fixed writing style options (such as formal, informal, etc.), making it difficult to meet users' needs for personalized styles. In addition, existing methods usually rely on predefined rules or templates and lack dynamic adaptation capabilities, resulting in unnatural text style.

[0006] Low literature utilization efficiency: in academic writing scenarios, users often need to refer to a large amount of literature. However, existing systems lack efficient literature content extraction and matching mechanisms, making it difficult to accurately identify key passages and integrate them into newly generated articles, resulting in insufficient citations or excessive repetition of content. SUMMARY

[0007] To address the deficiencies in the prior art, the present application aims to provide an intelligent writing system and method based on multi-agent collaboration, which aims to realize the full-process automated generation from original documents to structured Markdown and then to graphic-text mixed layout Word documents through multi-modal understanding, dynamic style adaptation, and literature intelligent matching, etc.

[0008] To achieve the above object, the present application provides the following technical solutions: An intelligent writing method based on multi-agent cooperation, comprising the following steps:

[0009] Step one, receiving a user uploaded multiple format documents, using extraction tools to extract the text content and image resources of the documents, then calling a multi-modal large language model to perform semantic understanding on the extracted image resources, generating image description text for subsequent chapter generation image-text matching recommendation;

[0010] Step two, using a large language model, constructing a prompt word template, uniformly processing three types of input files provided by the user, style reference file, writing requirement file, content reference file, and extracting key information respectively;

[0011] Step three, according to the article title input by the user, and according to the writing requirements, style requirements and reference literature abstracts obtained by analysis, constructing an enhanced prompt word, and calling a large language model to generate an article outline;

[0012] Step four, according to the title, the outline generated in step three is divided, and the chapter content is generated one by one, and the writing execution agent is used to generate text according to the required literature content, style and writing requirements of the current chapter, and during the generation process, the current writing content and picture description are analyzed to automatically insert related pictures;

[0013] Step five, converting the MarkDown format model output of step four into a Word with basic document format.

[0014] As a further improvement of the present application, the specific steps of extracting text content and image resources in step one and then performing semantic understanding are as follows:

[0015] Step one, use python-magic or filetype library to identify file type; if it is a Word file, call python-docx to read; if it is a PDF file, call MinerU or PyMuPDF to extract text and image; read the result in MarkDown format;

[0016] Step two, for the images embedded in the Word / PDF file, save them to a fixed path after extraction, construct a customized prompt word template, and call a large language model to perform semantic understanding on the image to generate image description text.

[0017] As a further improvement of the present application, the specific steps of semantic understanding in step two are as follows:

[0018] Step two, image encoding is performed on the input image through VisionTransformer:

[0019]

[0020] wherein, is the input image, respectively the height, width, and number of channels;

[0021] Step two two, then use the large model as a decoder to generate image description text:

[0022] ;

[0023] Step two three, store the image description text to the original image location, the storage format is: <image_illustrate> image description < / image_illustrate> <image_path> image path < / image_path>.

[0024] As a further improvement of the application, the specific steps of the prompt word module constructed in step two for unified processing of the three types of input files provided by the user, namely the style reference file, the writing requirement file and the content reference file, are as follows:

[0025] Step two one, construct a customized prompt word template for extracting writing style and guiding the large language model to extract writing style features;

[0026] Step two two, construct a customized prompt word template for extracting writing requirements and guiding the large language model to identify key elements;

[0027] Step two three, use semantic boundary recognition algorithm to intelligently segment the reference literature file uploaded by the user, divide the full text into several paragraph units with clear semantic topics, while strictly preserving the paragraph order and structure of the original document.

[0028] As a further improvement of the application, the specific steps of the semantic boundary recognition algorithm used in step two three to intelligently segment the reference literature file uploaded by the user, divide the full text into several paragraph units with clear semantic topics, while strictly preserving the paragraph order and structure of the original document, are as follows:

[0029] Step two three one, calculate the average sentence vector of the current paragraph

[0030] ;

[0031] Step two three two, determine the segmentation point: if the cosine similarity between the vector of the first sentence of the next paragraph and the average sentence vector of the paragraph is lower than the set threshold , it is considered that the semantic has changed significantly, and a new paragraph should be started:​

[0032]

[0033] wherein, theta is automatically adjusted according to the type of document, set to 0.65 for scientific papers and 0.7 for policy documents;

[0034] Step two three, use a large model to summarize the segmented paragraph unit, and store it in structured JSON.

[0035] As a further improvement of the application, the specific steps of generating the article outline in step three are as follows:

[0036] Step three one, the user inputs the article title and additional writing requirements, and selects the required style reference file, writing requirement file and reference file, wherein the files are optional;

[0037] Step three two, integrate the user input content and the analysis results of the three types of files to construct the large model prompt word;

[0038] Step three, the large model prompt word constructed in step three two is handed over to the user for confirmation, and the user corrects or regenerates it.

[0039] As a further improvement of the application, the specific steps of generating the outline generated in step three in step four are as follows:

[0040] Step four one, the outline is divided into chapters according to the minimum level by regular expression or AST parser, and the title and its attributes are converted into structured JSON data;

[0041] Step four two, according to the file name, obtain the text content of the paragraph unit corresponding to the file, integrate the chapter title, reference, writing requirement and style information, construct the writing prompt word, and write by chapter;

[0042] Wherein, due to the uniqueness of the reference, the original information of the reference is used as the input here, and for the picture information in the reference, the large model is guided to use special format for picture reference in the writing process in the prompt word.

[0043] As a further improvement of the application, the specific steps of constructing the writing prompt word and writing by chapter in step four two are as follows:

[0044] Step four two one, maintain a global variable or cache structure to store the information of the generated chapter; after completing a chapter writing, its title, text summary and other information are stored in a structured manner, and the inserted picture information and the number of generated tables are recorded to ensure the rationality of the table number;

[0045] Step 422: When writing the next chapter, automatically integrate the summary and image information of the previous chapter into the Prompt to guide the model to generate content with logical continuity.

[0046] Steps 4, 2, and 3 involve generating text based on the aforementioned Prompt. Once the current chapter is generated, its summary information is cached again, and newly used images are recorded for use as context information for the next "previous chapter" during the next writing session.

[0047] As a further improvement to the present invention, the specific steps for converting the Markdown format model output from step four into a Word document with a basic document format in step five are as follows:

[0048] Step 51: Convert the heading levels, body content, tables, and image paths in Markdown into Word document objects, preserving the original text and image layout structure;

[0049] Step 52: Read the image path information from the Markdown file and insert the locally stored image resources into the corresponding positions in the Word document to ensure consistency between the text and images;

[0050] Step 53: Save the Word document to a local path.

[0051] The beneficial effects of this invention are:

[0052] Dynamic adaptation to writing style: This invention introduces customized prompt word templates, which can extract detailed writing style features from the user's style reference documents, including language style, tone tendency, sentence complexity, vocabulary density, etc., to achieve document imitation.

[0053] The intelligent document segmentation and abstract generation system, utilizing semantic boundary detection algorithms and the Sentence-BERT model, can divide long documents into multiple paragraphs with clearly defined topics and generate an abstract for each paragraph. This process not only preserves the original document's logical structure but also improves the utilization rate of the document content, contributing to the generation of more accurate and richer article content.

[0054] The intelligent outline generation and chapter writing system integrates information such as titles, writing requirements, style requirements, and literature abstracts to construct enhanced prompts, guiding the large language model to generate a well-structured and logically coherent article outline. Subsequently, based on this outline, the system generates chapters one by one, combining the content summaries of the generated chapters with the use of images to ensure that each paragraph has good contextual coherence and avoids content repetition or breaks.

[0055] Figure and text layout optimization and format conversion. In the content generation process, the system automatically analyzes the current writing content and picture description, and inserts relevant pictures at appropriate positions, thereby improving the visual effect of the article. Finally, the output in Markdown format is converted into a Word document with a basic document format, ensuring consistency of text and pictures and meeting the user's requirements for the final document format. BRIEF DESCRIPTION OF DRAWINGS

[0056] Fig. 1 Flowchart for file preprocessing and multi-modal data analysis of the present application;

[0057] Fig. 2 Writing knowledge extraction process of the present application;

[0058] Fig. 3 Outline generation and chapter writing process of the present application;

[0059] Fig. 4 Flowchart of the intelligent writing system and method based on multi-agent collaboration of the present application. DETAILED DESCRIPTION

[0060] The present application will be further described in detail below with reference to the embodiments given in the accompanying drawings.

[0061] Referring to Figs. 1 to 4 the present embodiment of the intelligent writing system and method based on multi-agent collaboration, includes the following steps:

[0062] S1, file preprocessing and multi-modal data analysis

[0063] S1.1, use python-magic or filetype library to identify file type; if it is a Word file, call python-docx for reading; if it is a PDF file, call MinerU or PyMuPDF to extract text and images; the reading result is stored in MarkDown format.

[0064] S1.2, for the images embedded in the Word / PDF file, save them to the local fixed path after extraction, construct a customized prompt word template, call a large language model to understand the semantics of the image, and generate an image description text.

[0065] S1.2.1, image encoding through VisionTransformer (ViT):

[0066]

[0067] wherein, is the input image, height, width, and channel number, respectively.

[0068] S1.2.2 Then, using the large model as a decoder, image description text is generated:

[0069]

[0070] S1.3. Store the image description text in the original image location, in the following format:<image_illustrate> Image description< / image_illustrate><image_path> Image path< / image_path> .

[0071] S2, Document Knowledge Extraction

[0072] S2.1, Extraction of Writing Style

[0073] S2.1.1 Construct customized prompt word templates to extract writing style. An example prompt word is as follows:

[0074] Please analyze the writing style of the following document and return the results in JSON format:

[0075] {

[0076] "language_style":"formal / informal / semi-formal",

[0077] "tone":"objective / subjective / critical / suggestive",

[0078] "sentence_complexity":"simple / medium / complex",

[0079] "vocabulary_density":"low density / medium density / high density",

[0080] "typical_phrases":["Common Phrases 1","Common Phrases 2"],

[0081] "paragraph_structure":"General-to-specific / Parallel-structure / Progressive-structure",

[0082] "outline":"Article outline",

[0083] }

[0084] The document content is as follows:

[0085] [Insert document body]

[0086] S2.1.2 guides the large language model to extract writing style features, including language style (formal / informal), sentence complexity, vocabulary density, list of common phrases, paragraph structure pattern, article table of contents structure, etc., and stores them in standard JSON format.

[0087] S2.2 Extraction of Writing Content Requirements

[0088] S2.2.1 Construct customized prompt templates to extract writing requirements. Taking a tender document as an example, an example prompt is as follows:

[0089] Please extract the core elements of the writing requirements from the following document and return them in JSON format:

[0090] {

[0091] "word_count":"Word count limit (integer)",

[0092] "format_requirements":["List of format requirements"],

[0093] "focus_areas":["key coverage areas"],

[0094] "prohibited_words":["banned words"],

[0095] "evaluation_criteria": ["Evaluation Criteria"]

[0096] }

[0097] The document content is as follows:

[0098] [Insert document body]

[0099] S2.2.2 Guide the large language model to identify key elements, including word count limits, format requirements, content focus, prohibited words, review criteria, etc., and store them in standard JSON format.

[0100] S2.3. Using a semantic boundary recognition algorithm, the reference files uploaded by users are intelligently segmented, dividing the full text into several paragraph units with clear semantic themes, while strictly preserving the paragraph order and structure of the original document.

[0101] S2.3.1. Segment the original text according to sentence level to obtain a sentence sequence:

[0102]

[0103] in Indicates the first One sentence.

[0104] S2.3.2. Use the Sentence-BERT model to map each sentence into a vector representation:

[0105]

[0106] S2.3.3 Without disrupting the original order, the system traverses the paragraphs sequentially from front to back and determines whether a new semantic paragraph should be divided at this point.

[0107] S2.3.3.1, Regarding the current paragraph Calculate the average sentence vector:

[0108]

[0109] S2.3.3.2 Determine the segmentation point: If the starting sentence of the next paragraph... vector The cosine similarity with the average sentence vector of this paragraph is below a set threshold. If the meaning has changed significantly, a new paragraph should be started.

[0110]

[0111] θ can be automatically adjusted according to the document type; for example, it can be set to 0.65 for scientific papers and 0.7 for policy documents.

[0112] S2.3.3. Use a large model to summarize the segmented paragraph units and store them in structured JSON format. An example storage structure is as follows: [

[0114] {

[0115] "content":"#Introduction\nIn recent years, artificial intelligence technology has made significant progress.\nIn particular, the development of convolutional neural networks has driven innovation in the field of computer vision."

[0116] "abstract": "Introduces the current state of development of artificial intelligence and convolutional neural networks in computer vision."

[0117] },

[0118] {

[0119] However, the application of these technologies in medical diagnosis still faces many challenges, such as data privacy issues and insufficient model interpretability.

[0120] "abstract": "Points out the main problems in the application of AI technology in the medical field."

[0121] } ]

[0123] S3, Article Outline Generation

[0124] S3.1, User inputs article title and additional writing requirements, and selects required style reference files, writing requirement files, and reference literature files, all of which are optional.

[0125] S3.2, Integrate user input content and analysis results of three types of files to construct large model prompts. An example of a prompt is as follows:

[0126] Please generate an article outline that meets the writing specifications based on the following information:

[0127] [Title]: "{title}"

[0128] [Writing Requirements]:

[0129] - Word limit: {word_count}

[0130] - Format requirements: {format_requirements}

[0131] - Content focus: {focus_areas}

[0132] [Writing Style]:

[0133] - Language style: {language_style}

[0134] - Tone: {tone}

[0135] - Sentence complexity: {sentence_complexity}

[0136] - Vocabulary density: {vocabulary_density}

[0137] [Reference Literature Abstract]:

[0138] {Article 1-1} {abstracts}

[0139] Please output the article outline in Markdown format, ensuring clear structure, logical coherence, and good continuity between sections.

[0140] Example format as follows:

[0141] # Example outline as follows:

[0142] ## 1 [Chapter Title]

[0143] ### 1.1 [Subheading]

[0144] ####1.1.1 [Subheading]

[0145] #####Chapter Overview: A fairly detailed chapter overview

[0146] References: Article 1-1, Article 2-1

[0147] In the example, article 1-1 represents the first paragraph unit of article 1.

[0148] S3.3. The user confirms the changes and can then modify or regenerate them.

[0149] S4. Based on the article outline generated by S3, execute the content writing intelligent agent to generate content and mix text and images.

[0150] S4.1. Use regular expressions or an AST parser to segment the outline according to the smallest level of chapters, and convert the titles and their attributes (such as chapter overview, references, etc.) into structured JSON data. A simple example is as follows: [

[0152] {

[0153] "section_heading":"1 Introduction\n1.1 Research Background",

[0154] "content_summary":"Describes the current state of AI technology development."

[0155] "references":["Reference 1-1","Reference 2-1"]

[0156] }, ]

[0158] S4.2. Based on the file name, obtain the main text content of the corresponding paragraph unit, integrate information such as chapter titles, references, writing requirements, and style, construct writing prompts, and proceed with chapter-by-chapter writing. Due to the unique nature of references, the original text information of the references (paragraph units) is used as input. Simultaneously, for image information in the references, the prompts guide the large model to use special formatting for image citation during the writing process.

[0159] S4.2.1 Maintain a global variable or cache structure to store information about generated chapters; after each chapter is completed, its title, abstract, and other information are saved in a structured manner, while also recording the information of inserted images and ensuring the rationality of figure and table numbering based on the number of generated tables. A simple example structure is as follows:

[0160] {

[0161] "section_heading":"2.1 Current Status of Artificial Intelligence Development",

[0162] "summary":"This section provides an overview of the recent trends in artificial intelligence technology, highlighting breakthroughs in deep learning and natural language processing.",

[0163] }

[0164] S4.2.2, when writing the next chapter, automatically integrate the summary and picture information of the previous chapter into the Prompt to guide the model to generate content with logical continuity. A simple prompt word example is as follows:

[0165] Please write the chapter "{current_section_heading}" in the following style:

[0166] - Writing language style: {language_style}

[0167] - Tone: {tone}

[0168] - Sentence complexity: {sentence_complexity}

[0169] - Vocabulary density: {vocabulary_density}

[0170] Writing requirements include:

[0171] - Word limit: {word_count} words

[0172] - Format requirements: {format_requirements}

[0173] - Content focus: {focus_areas}

[0174] [Note] You are writing the {n}th chapter, please refer to the following written chapter content to ensure logical coherence and avoid repetition:

[0175] <<<Summary of the content of the last chapter>>>

[0176] Chapter title: {last_section_heading}

[0177] Summary: "{last_summary}"

[0178] Pictures used:

[0179] {images_used}

[0180] Please write the main text based on the following references:

[0181] {reference_content_1}

[0182] {reference_content_2}

[0183] Please insert a Markdown-formatted image reference in the appropriate location, such as:

[0184] ![Fig. 4: AI Development Trends](images / ai_trend.png) ...

[0185] The main text begins:

[0186] S4.2.3. Based on the enhanced Prompt above, generate text. After the current chapter is generated, cache its summary and other information again and record the newly used images for use as new "previous chapter" context information in the next writing session.

[0187] S5. Convert to formatted Word output.

[0188] S5.1 Convert heading levels, body text, tables, and image paths in Markdown into Word document objects while preserving the original text and image layout structure;

[0189] S5.2 Read the image path information in Markdown and insert the locally stored image resources into the corresponding positions in the Word document to ensure consistency between the text and images.

[0190] S5.3, Save the Word document to a local path.

[0191] In summary, the intelligent writing system and method based on multi-agent collaboration in this embodiment has the following characteristics:

[0192] Multi-agent collaboration mechanism: This invention adopts a multi-agent collaboration architecture, in which each agent is responsible for a specific task (such as document preprocessing, knowledge extraction, outline generation, content writing, etc.). The agents collaborate by sharing global state and cached information, thereby improving the overall system efficiency and accuracy.

[0193] Multimodal understanding and image-text matching: The system can not only extract text content from documents, but also perform semantic understanding of embedded images and generate corresponding descriptive text. This image description information is used for image-text matching and recommendation in subsequent chapter generation, making the generated articles more expressive and professional.

[0194] Dynamic style adaptation and personalized writing: By extracting detailed writing style features from the user's style reference files and dynamically adjusting during the generation process, the system can generate text that meets the user's personalized needs. This flexible style control mechanism makes the system suitable for writing tasks in different scenarios, such as academic papers, business reports, and marketing copywriting.

[0195] Document intelligence processing: The invention introduces a semantic boundary detection algorithm and a Sentence-BERT model, which can intelligently segment long documents and generate summaries for each paragraph unit. This processing method not only improves the utilization of document content, but also provides rich reference materials for subsequent content generation.

[0196] Enhanced prompt construction and context-aware writing: The system integrates information such as titles, writing requirements, style features, and document summaries by constructing enhanced prompts, ensuring that the generated articles not only meet format specifications but also have content depth. In addition, record the content summary and picture usage of the generated chapter, and automatically integrate these information when writing the next chapter to ensure the logical coherence of the generated content.

[0197] Full-process automation and format conversion: From the analysis of the original document to the generation of the final Word document, the entire process is fully automated. The system can convert Markdown-formatted output into a Word document with basic document format, ensuring consistency between text and images, greatly simplifying the user's operation process.

[0198] The above is only the preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above-mentioned embodiments. Any technical solution that falls within the scope of the present invention is within the scope of protection of the present invention. It should be noted that for ordinary technical personnel in the technical field, some improvements and refinements without departing from the principles of the present invention are also considered within the scope of protection of the present invention.

Claims

1. An intelligent writing method based on multi-agent cooperation, characterized in that: Comprise the following steps: Step one, receiving the user uploaded multiple format documents, using the extraction tool to extract the text content and image resources of the document, then calling the multimodal large language model to understand the semantic of the extracted image resources, generating image description text for subsequent chapter generation image matching recommendation; Step two, using a large language model, constructing a prompt word template, uniformly processing three types of input files provided by the user: style reference file, writing requirement file, and content reference literature file, and extracting key information respectively; Step three, according to the article title input by the user, and according to the writing requirements, style requirements and reference literature abstracts obtained by parsing, construct an enhanced prompt word, and call a large language model to generate an article outline; Step four, according to the chapter title, the outline generated in step three is divided, and the chapter content is generated one by one, and the writing execution intelligent agent is used to generate text according to the required literature content, style and writing requirements of the current chapter, and automatically insert related pictures during the generation process; The specific steps of chapter writing are as follows: Step four two one, maintain a global variable or cache structure to store the information of the generated chapter; After completing a chapter writing, save the title, abstract and other information of the chapter in a structured manner, and record the inserted picture information and the number of generated tables to ensure the rationality of the table numbering; Step four two two, when writing the next chapter, automatically integrate the abstract and picture information of the previous chapter into the prompt to guide the model to generate content with logical continuity; Step four two three, according to the above prompt, generate text, and after the current chapter is generated, cache the abstract and other information again and record the newly used pictures for use as the context information of the next "previous chapter" when writing next time; Step five, convert the MarkDown format model output of step four into a Word with a basic document format.

2. The method of claim 1, wherein: The specific steps of extracting text content and image resources in step one and then performing semantic understanding are as follows: Step one one, use python-magic or filetype library to identify file type; if it is a Word file, call python-docx to read; if it is a PDF file, call MinerU or PyMuPDF to extract text and image; read the result in MarkDown format; Step one two, for the images embedded in the Word / PDF file, save them to a fixed path after extraction, construct a customized prompt word template, and call a large language model to understand the semantic of the image and generate image description text.

3. The method of claim 2, wherein: The specific steps of semantic understanding in step one two are as follows: Step one two one, encode the input image through VisionTransformer: wherein, is an input image, are height, width, and channel number, respectively; Step one two two, then use a large model as a decoder to generate image description text: ; Step one two three, store image description text to the original image location, the storage format is: <image_illustrate> image description < / image_illustrate> <image_path> image path < / image_path>. 4.The intelligent writing method based on multi-agent cooperation according to any one of claims 1 to 3, characterized in that: The specific steps of the step two constructed prompt word template for unified processing of the three types of input files provided by the user, style reference file, writing requirement file and content reference literature file are as follows: Step two one, construct a customized prompt word template for extracting writing style and guiding the large language model to extract writing style features; Step two two, construct a customized prompt word template for extracting writing requirements and guiding the large language model to identify key elements; Step two three, use semantic boundary recognition algorithm to intelligently segment the reference literature file uploaded by the user, divide the full text into several paragraph units with clear semantic theme, while strictly preserving the paragraph order and structure of the original document.

5. The method of claim 4, wherein: The specific steps of the step two three using semantic boundary recognition algorithm to intelligently segment the reference literature file uploaded by the user, divide the full text into several paragraph units with clear semantic theme, while strictly preserving the paragraph order and structure of the original document are as follows: Step two three one, for the current paragraph , compute the average sentence vector: ; Step two, determine the split point: if the cosine similarity between the vector of the first sentence of the next paragraph and the average sentence vector of the current paragraph is lower than a certain threshold , then consider that the semantic has changed significantly and a new paragraph should be started. Step two, determine the split point: if the cosine similarity between the vector of the first sentence of the next paragraph and the average sentence vector of the current paragraph is lower than a certain threshold , then consider that the semantic has changed significantly and a new paragraph should be started. Wherein, θ is automatically adjusted according to the type of literature, set to 0.65 for scientific papers and 0.7 for policy documents; Step two three three, use large model to generate abstract for segmented paragraph unit and store in structured JSON. 6.The intelligent writing method based on multi-agent cooperation according to any one of claims 1 to 3, characterized in that: The specific steps of the step three of generating article outline are as follows: Step three one, the user inputs the article title and additional writing requirements, and selects the required style reference file, writing requirement file and reference literature file, which are all optional; Step three two, integrate the user input content and the analysis results of the three types of files to construct the large model prompt word; Step three three, the large model prompt word constructed in step three two is handed over to the user for confirmation, and the user can modify or regenerate it.

7. The method of claim 1 to 3, wherein the method is based on multi-agent collaboration. The specific steps of the step four of segmenting the outline generated in step three to generate chapter content one by one are as follows: Step four one, segment the outline according to the minimum level chapter by regular expression or AST parser, and convert the title and its attributes to structured JSON data; Step four two, according to the name of the reference literature file, obtain the text content of the paragraph unit corresponding to the file, integrate the chapter title, reference literature file, writing requirement and style information, construct the writing prompt word, and write by chapter; Wherein, due to the uniqueness of the reference literature, the original information of the reference literature is used as input, and for the picture information in the reference literature, the large model is guided to make picture reference in the writing process. 8.The intelligent writing method based on multi-agent cooperation according to any one of claims 1 to 3, characterized in that: The specific steps of the step five of converting the MarkDown format model output in step four to Word with basic document format are as follows: Step five one, convert the title level, text content, table and image path in MarkDown to Word document object, and preserve the original layout structure; Step five two, read the image path information in Markdown, insert the locally stored image resources into the corresponding position of the Word document to ensure consistency of text and images; Step five three, store the Word to the local path.

Citation Information

Patent Citations

  • A smart writing method and system based on multi-role intelligent agent

    CN118917294B

  • Intelligent article generation method based on large language model and model essay template

    CN119538896A

  • Personalized writing auxiliary method and device, equipment and storage medium

    CN119783662A