A method, device, equipment and storage medium for generating a graphic-text document
Patent Information
- Application Number
- CN202510473261.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2026-10-23
AI Technical Summary
但目前的文档生成主要以较短的图文内容或纯文本为主,且适用于较简单的文案生成,对于具有复杂知识内容、涉及多样主题或内容逻辑关系复杂的图文文档,目前的文档生成能力无法满足其质量要求
[0022]本申请的技术方案基于第一语言模型对目标文档的主题文本进行主题拆解,得到与主题文本逻辑关联的多个子主题集,每一子主题集包括至少一级子主题,然后从目标知识领域的文档素材库中分别获取每一子主题集相应的文档素材,进而输入第二语言模型得到文本,以通过逻辑紧密关联、逐级嵌套的子主题集作为长文本的内容脉络,提升文档素材获取的内容相关性、多样主题的匹配性和上下文的内容关联性,提升长文档的生成质量;并且,对目标文本进行插图位置识别,以从相应知识领域的图像素材库中检索与区域文本内容匹配的图像,实现文档图像的自动化插入,并提升图像文本间的内容适配性和插入位置准确性。
Smart Images

Figure CN122965433A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a method, apparatus, device, and storage medium for generating text and image documents. Background Technology
[0002] With the development of artificial intelligence, the automatic generation of text by computer systems has become a new creative trend in media dissemination, content community interaction, and creative copywriting. However, current document generation mainly focuses on short text and image content or plain text, and is suitable for generating relatively simple copy. For text and image documents with complex knowledge content, involving diverse topics, or with complex logical relationships, current document generation capabilities cannot meet their quality requirements. Summary of the Invention
[0003] This application provides a method, apparatus, device, storage medium, and computer program product for generating graphic documents, specifically including the following contents.
[0004] On the one hand, this application provides a method for generating graphic documents, the method comprising:
[0005] Based on the first language model, the topic text of the target document is decomposed to obtain multiple sub-topic sets that are logically related to the topic text. The sub-topic sets include at least one level of sub-topic.
[0006] For each of the subtopic sets, document materials matching the subtopic are retrieved from the document material library of the target knowledge domain to obtain the document materials corresponding to the subtopic set;
[0007] The target text is obtained by using the subtopic sets and the corresponding document materials as input to the second language model.
[0008] The target text is subjected to illustration location recognition to determine at least one image insertion region of the target text;
[0009] Retrieve images from the image material library of the target knowledge domain that match the text content of each of the image insertion regions to obtain the target image corresponding to each of the image insertion regions;
[0010] The target image is inserted into the target text based on the image insertion region to obtain the target document.
[0011] On the other hand, this application provides a graphic document generation apparatus, the apparatus comprising:
[0012] The topic decomposition module is used to decompose the topic text of the target document based on the first language model to obtain multiple sub-topic sets logically associated with the topic text, wherein the sub-topic sets include at least one level of sub-topic;
[0013] The document retrieval module is used to retrieve document materials that match the sub-topic from the document material library of the target knowledge domain for each sub-topic set, so as to obtain the document materials corresponding to the sub-topic set.
[0014] The document generation module is used to generate the target text by taking each of the sub-topic sets and the document materials corresponding to each of the sub-topic sets as input to the second language model.
[0015] An insertion recognition module is used to identify the image insertion location of the target text and determine at least one image insertion region of the target text.
[0016] The image matching module is used to retrieve images from the image material library of the target knowledge domain that match the text content of each image insertion area, and obtain the target image corresponding to each image insertion area;
[0017] An image insertion module is used to insert the target image into the target text based on the image insertion area to obtain the target document.
[0018] On the other hand, this application provides a computer device including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement a graphic document generation method as described in the first aspect.
[0019] On the other hand, this application provides a computer-readable storage medium storing at least one instruction or at least one program, which is loaded and executed by a processor to implement a graphic document generation method as described in the first aspect.
[0020] On the other hand, this application provides a computer program product, which includes computer instructions that, when executed by a processor, implement a graphic document generation method as described in the first aspect.
[0021] The graphic document generation method, apparatus, device, storage medium, and computer program product provided in this application have the following technical effects:
[0022] The technical solution of this application decomposes the topic text of the target document based on a first language model to obtain multiple sub-topic sets logically related to the topic text. Each sub-topic set includes at least one level of sub-topic. Then, the document materials corresponding to each sub-topic set are obtained from the document material library of the target knowledge domain, and then input into a second language model to obtain text. By using logically closely related and hierarchically nested sub-topic sets as the content framework of long text, the relevance of the obtained document materials, the matching of diverse topics, and the content relevance of the context are improved, thereby improving the quality of long document generation. Furthermore, the target text is subjected to illustration position recognition to retrieve images that match the regional text content from the image material library of the corresponding knowledge domain, thereby realizing the automatic insertion of document images and improving the content adaptability between images and text and the accuracy of insertion position.
[0023] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0024] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of the implementation environment of a graphic document generation method provided in an embodiment of this application;
[0026] Figure 2 This is a flowchart illustrating a method for generating graphic documents provided in an embodiment of this application;
[0027] Figure 3 This is a flowchart illustrating another method for generating graphic documents provided in an embodiment of this application;
[0028] Figure 4 This is a flowchart illustrating another method for generating graphic documents provided in an embodiment of this application;
[0029] Figure 5 This is a flowchart illustrating another method for generating graphic documents provided in an embodiment of this application;
[0030] Figure 6 This is a flowchart illustrating another method for generating graphic documents provided in an embodiment of this application;
[0031] Figure 7 This is a schematic diagram of the framework of a method for generating graphic documents provided in an embodiment of this application;
[0032] Figure 8 This is a schematic diagram of a graphic document generation device provided in an embodiment of this application;
[0033] Figure 9 This is a schematic diagram of the hardware structure of a device for implementing a method for generating graphic documents, provided in an embodiment of this application. Detailed Implementation
[0034] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout.
[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0036] It is understood that in the specific implementation of this application, data such as user avatars are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0037] Before introducing the method embodiments provided in this application, a brief introduction will be given on the application scenarios, related terms or nouns that may be involved in the method embodiments of this application, so as to facilitate the understanding of those skilled in the art.
[0038] Machine Learning (ML) is an interdisciplinary field that involves probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance.
[0039] Large Language Model (LLM) is a computer model capable of processing and generating natural language. LLMs can predict the next word or sentence by learning the statistical patterns and semantic information of language data. As the input dataset and parameter space expand, the capabilities of LLMs also increase. It is used in various application areas such as machine learning, machine translation, speech recognition, and image processing, hence the name "multimodal large language model."
[0040] Instruction Tuning: For each task, instruction instructions are generated individually. These instructions are then fine-tuned on several full-shot tasks before being evaluated on a specific task (zero-shot). The pre-trained model parameters are unfrozen, typically on a large set of publicly available NLP task datasets, to enhance the language model's understanding capabilities. By providing more explicit instructions, the model can understand and make the correct responses.
[0041] Game guides: As games become increasingly widespread and diverse, guides have become helpful tools for gamers. They can be understood as a map, helping users accurately find desired or unwanted game elements. Video game guides serve as a guide to help players improve their skills, complete levels, or meet specific conditions.
[0042] In light of the above background, please refer to Figure 1 This is a schematic diagram illustrating the implementation environment of a graphic document generation method provided in this application embodiment, such as... Figure 1 As shown, the implementation environment may include at least client 01 and server 02.
[0043] Specifically, client 01 can include devices such as smartphones, desktop computers, tablets, laptops, in-vehicle terminals, digital assistants, smart wearable devices, and voice interaction devices. It can also include software running on the device, such as web pages provided to users by service providers, or applications provided by those service providers. Specifically, client 01 can be used to obtain interaction information input by the target object during a dialogue between the target object and a virtual interaction object. Client 01 sends the interaction information to server 02 for processing.
[0044] Specifically, server 02 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 02 may include network communication units, processors, and memory, etc. The terminal and the server can be connected directly or indirectly through wired or wireless communication, which is not limited herein.
[0045] Specifically, server 02 can decompose the topic text of the target document based on the first language model to obtain multiple sub-topic sets, and recall document materials that match the sub-topics from the document material library of the target knowledge domain to obtain the document materials corresponding to the sub-topic sets. Then, it combines the sub-topic sets and the document materials corresponding to the sub-topic sets to generate a document based on the second language model to obtain the target text. Then, it performs illustration position recognition on the target text to determine the image insertion area in the target text that needs to be attached to the image, and retrieves the target image from the image material library of the target knowledge domain based on the text content of the corresponding area, and then inserts it into the image insertion area of the target text to obtain the target document, thus realizing the automatic generation of text and image documents.
[0046] In practical applications, besides executing the image and text document generation method provided in this application embodiment through interaction between client 01 and server 02, the interactive information processing scheme provided in this application embodiment can be executed independently by client 01 or independently by server 02. Figure 1 This is just one example.
[0047] The following describes a method for generating graphic documents provided in this application. Figure 2This is a flowchart illustrating a method for generating text and images documents according to an embodiment of this application. This application provides method operation steps as shown in the embodiments or flowcharts, but based on conventional or non-inventive methods, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or server product execution, the method can be executed sequentially according to the embodiments or accompanying drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Please refer to... Figure 2 The graphic document generation method provided in this application embodiment may include the following steps S201-S211:
[0048] S201: Based on the first language model, the topic text of the target document is decomposed into topics to obtain multiple sub-topic sets that are logically related to the topic text. Each sub-topic set includes at least one level of sub-topic.
[0049] Specifically, the target document is a document belonging to the target knowledge domain, and its content includes text and illustrations. The topic text describes the main idea of the target document, and its semantics match the semantics of the target document's title. For example, the target knowledge domain could be the gaming knowledge domain, the travel knowledge domain, the historical knowledge domain, etc., and the target document could be a game guide, a tourist attraction guide, a historical commentary, etc., with the topic text being "How to beat XX Universe 5?", "Completion Guide for XX Game", "XX Character Development Guide", "XX Mission Completion Tips", etc.
[0050] Specifically, the first language model is built upon a large-scale language model. Topic decomposition refers to breaking down a topic text into several sub-topics or sub-tasks with multiple levels in terms of semantics and text writing tasks. For example, refer to... Figure 7 The main text "How to beat XX Universe 5?" can be broken down into first-level sub-topics such as "Level Requirements", "BOSS Weaknesses", "Cosmetic Outfit Selection" and "Blessing Selection".
[0051] Specifically, a subtopic set includes one or more levels of subtopics. The subtopics within each subtopic set can form a tree structure, with logical connections between each level of subtopics and a subordinate relationship between lower-level and higher-level subtopics. By decomposing topics through a question-guided approach, structured and hierarchical subtopic sets are generated to serve as instructions for multiple document generation tasks.
[0052] In some implementations, the first language model is built based on a large language model. S201 may include S301: inputting the topic text into the first language model, using the problem decomposition instruction as the task instruction to perform multi-round iterative hierarchical problem decomposition on the topic text, to obtain the first-level sub-topic corresponding to the topic text, and several subordinate sub-topics corresponding to each first-level sub-topic. Each sub-topic set includes a first-level sub-topic and subordinate sub-topics corresponding to the first-level sub-topic.
[0053] Specifically, the problem decomposition instruction is a text that instructs the first language model to perform cyclical problem decomposition of the text. The instruction must define the target document's theme and the problem decomposition objective, specifying the rules, requirements, and output format for problem decomposition of the theme text. Multi-round iterative hierarchical problem decomposition refers to repeatedly executing the problem decomposition instruction, using the obtained sub-themes as decomposition objects and the problem decomposition instruction as the task instruction, after obtaining the next-level sub-themes of each sub-theme at the current level. This process is repeated to obtain several levels of subordinate sub-themes under each first-level sub-theme, forming a sub-theme set. The relationships between the sub-themes in each sub-theme set are represented by a tree diagram. Thus, from the perspective of the target document's reader, a cyclical questioning and problem decomposition approach, similar to a journalist's interview, is used. Based on the instructions, the large model determines the tasks and sub-themes of each stage of the target document, forming a narrative structure and writing framework. This rationally decomposes the content editing tasks in the target document, contributing to the professionalism and rationality of long documents.
[0054] The first language model can be obtained by taking sample topic text and multiple sample subtopic sets corresponding to the sample topic text as input, and fine-tuning the pre-trained LLM model based on prompt instructions to decompose topics. For example, SFT (supervised fine-tuning) and LoRA (low-rank adaptive) can be used for prompt fine-tuning of question decomposition and cyclic questioning training.
[0055] Understandably, when performing a problem decomposition task, the first language model can use the content in the knowledge base to understand the topic text and assist in problem decomposition. It retrieves document material content from the knowledge base that matches the current topic text, serving as the basic knowledge for question decomposition. This knowledge base can be a document material library of the target knowledge domain to which the target document belongs; for example, if the target document is a game guide, the corresponding document material library would be a game guide library.
[0056] For example, a problem decomposition instruction could be "Please decompose the topic 'XXX' into multiple subtopics, further decompose each subtopic, repeat the above process, and output each subtopic and the logical relationships between them." Understandably, the problem decomposition instruction can also specify the target audience's attributes, such as a walkthrough for a game, a character development guide, or task completion techniques. The target audience could be novice players, advanced players, or players performing specific tasks.
[0057] Furthermore, after determining the theme, problem breakdown objectives, and target audience, these are added to and integrated into the problem breakdown instructions to generate target instructions, which are then input into the first language model for problem breakdown. Taking the theme text "How to beat XX Universe 5?" as an example, its first-level sub-themes can include "Level Requirements," "Boss Weaknesses," "Cosmetic Outfit Selection," and "Blessing Selection," etc. Through further step-by-step breakdown using a cyclical questioning approach, we can continue to obtain sub-themes under "Level Requirements," such as "What are the specific requirements for each sub-level?" and under "Boss Weaknesses," such as "What are the weaknesses of the bosses in each level?" and "What are the strategies for defeating the bosses in each level?" etc.
[0058] Understandably, for each first-level subtopic, the number of iterations for its hierarchical problem decomposition needs to be constrained. In some cases, the number of iterations for the first-level subtopic can be preset to limit the number of decomposition levels. For example, if the preset number of iterations is 3, then the subtopic level includes first-level subtopics, second-level subtopics, and third-level subtopics. If the first language model does not decompose to a subtopic that meets the output conditions, then that level is empty and the further decomposition of that first-level subtopic stops. For example, if the second-level subtopic "What are the specific requirements for each sub-level of the grade?" is decomposed and no third-level subtopic is obtained, then the elements in the subtopic set of the first-level subtopic "Grade Requirements" are "Grade Requirements" → "What are the specific requirements for each sub-level of the grade?". In other cases, the number of decomposition levels for each first-level subtopic can be limited through adaptive iterative constraints to reasonably arrange the decomposition granularity of each first-level subtopic and the number of levels in each subtopic set, thereby improving the content quality of the target document. Accordingly, in some implementations, the method further includes S303-S305 during the topic decomposition process:
[0059] S303: Decompose the subtopics into granularity identification to obtain the granularity identification results;
[0060] S305: If the granularity identification result indicates that the decomposition granularity of the current subtopic is an atomic index, terminate the topic decomposition of the current subtopic.
[0061] Specifically, if the granularity identification result indicates that the current subtopic's decomposition granularity is not an atomic indicator, the problem decomposition of the current subtopic continues. In this way, the decomposition granularity identification adaptively matches the decomposition level for each subtopic. An atomic decomposition granularity means that the current subtopic cannot be further decomposed; it is the last level of decomposition granularity, and correspondingly, no further problem decomposition task needs to be performed. The decomposition granularity identification here can rely on human experience to determine whether to continue to the next decomposition termination condition. This can be achieved through a human-machine collaboration during the problem decomposition process or by automatically stopping according to machine-side matching rules specified by experience. Alternatively, a supervised decomposition granularity identification model can be constructed, using subtopics as input to identify the decomposition granularity and determine whether further decomposition is needed. In some cases, the input for decomposition granularity identification can be the current subtopic to be identified, or it can be the topic, the first-level subtopic, and the current subtopic to be identified, combined with the context for granularity identification. Accordingly, the decomposition granularity recognition model can be obtained through constrained training based on sample subtopics and labels representing whether they are atomic indicators as input, or it can be obtained through constrained training based on sample topics, sample first-level subtopics, and sample topics as input. Specifically, the obtained subtopics at each level can be stored in a question base.
[0062] S203: For each subtopic set, retrieve the document materials that match the subtopic from the document material library of the target knowledge domain to obtain the document materials corresponding to the subtopic set.
[0063] Specifically, the subtopic set includes a first-level subtopic in a tree-like hierarchy and several subordinate subtopics. For each first-level subtopic and its corresponding subordinate subtopics, document materials that are associated with and matched with the first-level subtopic and its subordinate subtopics are searched from the document material library, such as the entire document and related paragraphs in the document.
[0064] Specifically, the document resource library is used to store specific text content within a target knowledge domain, such as game guides and instructions within the game knowledge domain. Figure 7Initial materials can be obtained through web scraping and other methods. Then, text extraction, noise reduction, semantic cleaning, information verification, and cross-validation are performed to obtain document materials. The accuracy of information is verified through multiple sources to ensure the reliability of the content. Topic entity graph mining can also be used on the initial materials to construct a knowledge graph of topic entities, such as topics and articles associated with game IPs. Cross-validation here refers to quality checking the consistency of content from different channels of the same information source. Consistent content can be officially adopted. For example, algorithms can be used to compare the consistency of information from different sources on the same topic using vector semantic distance, followed by manual verification. The document materials also include source information. Furthermore, materials are constantly updated and supplemented, such as acquiring new game materials based on the latest game updates and patches to promptly expand the document material library.
[0065] Taking a game strategy resource library as an example, the initial materials crawled can include official game information, such as the game's official website, developer social media, and official forums. Player experiences and suggestions can also be obtained by referencing player communities, such as game social news platforms, game forums, and social media groups. Key information from official game information is extracted and documented, as are useful information and experiences from player communities, with sources clearly indicated. If it's a game video, key content from the video strategy can be transcribed and documented using methods such as ASR (Automatic Speech Recognition). After extracting, denoising, cleaning, and verifying information from the documents and materials, and performing cross-validation, a resource library is obtained, including the game name (or IP, theme, etc.) of the original long game strategy document content and the source of the game materials.
[0066] In some implementations, the document material library includes document material features of multiple document materials, which are obtained by vectorizing the text-based document materials. Specifically, the text content in the document materials is embedded and vectorized, such as using a vectorization model like BERT or a dual-tower model, and then stored in the retrieval library. For example, it can be stored in the FAISS distributed index library. In distributed vector retrieval, the FAISS framework is used to implement a distributed high-dimensional nearest neighbor retrieval platform. Employing a large-scale vector retrieval K-nearest neighbor algorithm (such as the HNSW (Hierarchical Navigable Small World) algorithm), it can efficiently recall the top N similar content of vectors from tens of millions of vectors in tens of milliseconds, thereby achieving rapid location and retrieval.
[0067] Accordingly, refer to Figure 3 S203 may include S401-S405:
[0068] S401: Based on the logical hierarchy of subtopics, the directory of each subtopic in the subtopic set is integrated to obtain the subdirectory of each subtopic set;
[0069] S403: Perform feature representation on the subdirectories to obtain subdirectory features;
[0070] S405: Using subdirectory features as the recall target, perform similar feature retrieval on the document material library, and determine the document materials to which the retrieved document material features belong as the document materials corresponding to the subtopic set.
[0071] Specifically, the subtopics within each subtopic group, arranged in a hierarchical tree structure, are integrated into a directory format to obtain subdirectories. A feature representation model for generating document material features is used to vectorize the features of these subdirectories, yielding subdirectory features that serve as recall targets. The text content of the long document is obtained through mapping and matching between the directory and the document material. Specifically, for the content of each subtopic within each subdirectory, reference is made... Figure 7 The system searches the document resource library to obtain the top N relevant documents. Similarity feature retrieval can employ existing feature similarity-based retrieval methods to obtain one or more documents matching each sub-topic set. The retrieved documents are then associated with sub-topics in the subdirectories. The subdirectories can be generated using a generative large-scale model. The sub-topics in each sub-topic set are concatenated and input into the generative large-scale model to generate the subdirectories. Thus, after iteratively questioning and breaking down the topics into their own long documents, a separate long-directory generation process using a generative large-scale model is performed for each first-level sub-topic. From an editorial perspective, content is collected for each sub-topic to obtain cited resources, thereby constructing connections between relevant knowledge and information sources.
[0072] S205: Using each subtopic set and the corresponding document materials as input to the second language model, document generation is performed to obtain the target text.
[0073] Specifically, the second language model is built upon a large-scale language model, and is trained by fine-tuning instructions to generate documents using sample sub-topic sets and corresponding sample document materials as input. For each sub-topic set and corresponding document materials, the second language model generates segmented text for that sub-directory to obtain the text content for each sub-directory. Then, the document content of each sub-directory is input into the second language model for integration and optimization to form the target text.
[0074] In some embodiments, reference is made to Figure 4 S205 may include S501-S503:
[0075] S501: Input the subdirectories and document materials corresponding to each subtopic set into the second language model to generate segmented text, and obtain the segmented text corresponding to each subtopic set. The segmented text and the subdirectories are semantically matched and logically related.
[0076] S503: Input each subdirectory and each segment of text into the second language model, use each subdirectory as a text outline and each segment of text as a content source to generate text with a consistent overall description style, and obtain the target text. The description style of each segment in the target text is matched.
[0077] Specifically, subdirectories and related document materials are input into a second language model. The language model, based on the target document's location and segmented text generation instructions, generates segmented text for each subdirectory. This process is repeated for each subdirectory and related document material. Then, all subdirectories and their respective segmented texts are input into the second language model again. Based on the target document's content location and overall text generation instructions, document integration is performed, simulating the creative behavior of a human writer to generate a complete long document. This process rationally summarizes the segmented texts and then creates a target text with a consistent overall descriptive style and segmented content matching the directory structure. Thus, from a writer's perspective, by first creating the complete text from segmented texts, the retrieved document materials are integrated and the generated intermediate content is processed. This effectively utilizes the language capabilities of the large model while reducing the demands on its text creation capabilities. It optimizes the semantic fit between content and theme and the logical hierarchy of the target text, while ensuring consistent descriptive style throughout the text, avoiding paragraph splicing, and generating high-quality, domain-specific long texts.
[0078] Specifically, the segmented text generation instruction is used to limit the text style of the segmented text and its matching with the sub-topics in the subdirectory. For example, the segmented text generation instruction can be "Please organize the following content {retrieved document materials} into a complete paragraph that matches the sub-topic, according to the XX style and the summary results of subdirectory 1".
[0079] Specifically, the overall text generation instruction is used to constrain the consistency of writing style, semantic coherence, and semantic matching and logical connection between segmented content and sub-topics in the final generated text. For example, the overall text generation instruction could be "Please organize the following content {each segmented text} according to the XX style and the summarization results of each sub-directory, and create a complete text content that fits the theme text."
[0080] In some embodiments, the subdirectories can be integrated into a master directory based on a generative model. Then, the master directory and the text of each segment are input into a second language model for text integration and content optimization based on the combined instructions to obtain the target text. For example, the master text generation instruction can be "Please organize the following content {text of each segment} into a complete text content that fits the theme text according to the XX style and the summary results of the master directory".
[0081] In some embodiments, the method further includes S213: inserting a citation record of the document material corresponding to each subtopic set into the target text, the citation record being used to indicate the citation source of the document material.
[0082] Specifically, the document resource library stores source information for each document resource. During segmented text generation or target text generation, a citation record for each paragraph or sentence cited in the text is generated based on the source information of each document resource referenced, thus representing the source and copyright ownership of that paragraph or sentence. This citation record can be appended to the text and / or the end of the text. In this way, by using the original source records in the document resource library as a mapping to form citation records, the credibility and authority of the document content are increased, and copyright issues are avoided.
[0083] S207: Perform illustration location recognition on the target text to determine at least one image insertion area of the target text.
[0084] Understandably, content with both text and images is more readable, especially for documents like game guides. Adding illustrations effectively improves readability and simplifies text comprehension. Accordingly, the target document is a mix of long text and multiple images. Accordingly, references... Figure 7 In addition to the long document content generation subtask for generating long text, the target document generation task also includes an image subtask. This is a step-by-step long document content generation processing pipeline based on problem decomposition and guidance. Specifically, the image insertion area refers to the text area where an image needs to be inserted.
[0085] In some embodiments, reference is made to Figure 5 S207 may include S601-S605:
[0086] S601: Perform text segmentation on the text content of the final sub-topic in the target text based on discourse units or word count limits to obtain multiple text structure fragments corresponding to the final sub-topic;
[0087] S603: Based on the topic relevance between text structure fragments and the final-level subtopics to which the text structure fragments belong, image insertion recognition is performed on each text structure fragment to obtain the insertion recognition result. The insertion recognition result is used to indicate the image-attached attributes of the text structure fragments.
[0088] S605: Determine the image insertion region as the filtered text structure fragment whose image attachment attribute is "image to be attached".
[0089] Specifically, the target text is first preprocessed to obtain the text content of each final-level subtopic, that is, the text paragraphs between two adjacent final-level subtopics are used as the segmentation objects for text segmentation. In some embodiments, the text content of the final-level subtopics is segmented using discourse units as the segmentation units. Here, discourse units refer to text paragraphs or sentences, that is, text content is segmented using paragraphs or sentences as the segmentation units. The corresponding text structure fragments are a complete text paragraph or a text sentence, preferably a text paragraph. For example, if a final-level subheading in the target text includes three paragraphs, it is then segmented into three text structure fragments.
[0090] In other embodiments, the text content of the final-level subtopic can be segmented using a first character count as the dividing unit, dividing the text content of the final-level subtopic into text structure segments with a character count equal to the first character count. For example, the first character count can be 300 characters, etc.
[0091] In some cases, image insertion recognition is performed for each final-level sub-topic to obtain the insertion recognition result for each text structure segment. In other cases, before performing image insertion recognition for the final-level sub-topic, the number of characters in the text content of the final-level sub-topic is obtained. If the number of characters exceeds a second character count, text segmentation of the text content is performed. If the number of characters does not exceed the second character count, it is determined that the final-level sub-topic does not require an additional image. For example, the second character count can be 100 characters, etc.
[0092] Then, text structure fragments are used as input for the insertion region recognition task. The task determines whether an image needs to be inserted into the current text structure fragment based on the topic relevance between the fragment and the current final-level sub-topic. Fragments with a "yes" result are identified as requiring image insertion and marked as image insertion regions. If the result is "no," the insertion recognition result is "no image insertion required." In this way, semantically independent fragments are obtained through text segmentation, reducing the information content of individual image insertion recognition tasks. Furthermore, combining the topic relevance of fragments for illustration classification and recognition improves the rationality of illustration placement and topic matching, thereby enhancing document generation quality.
[0093] In some embodiments, S603 may specifically include S6031-S6033:
[0094] S6031: Perform topic distribution analysis on text structure fragments to obtain the fragment topics of the text structure fragments;
[0095] S6032: Obtain the topic relevance between the topic of a fragment and the final subtopic to which the text structure fragment belongs;
[0096] S6033: If the topic relevance meets the preset relevance conditions, determine that the inserted recognition result is an image that needs to be attached.
[0097] Specifically, topic distribution analysis of text structure fragments refers to extracting content topics from document structure fragments to obtain fragment topics. In some cases, a fragment topic may include at least one extracted content topic and the probability distribution of each content topic. For example, a fragment topic may be represented as {Content Topic 1: 0.8, Content Topic 2: 0.1, Others: 0.1}, meaning the fragment topic includes two content topics with probability distributions of 0.8 and 0.1, respectively. In other cases, in addition to the content topics and their probability distributions, the fragment topic may also include the word distribution for each content topic. This word distribution indicates the high-frequency words belonging to that content topic in the text structure fragment and their probability distribution. For example, the word distribution for content topic 1 may be {Word 1: 0.4, Word 2: 0.5, Word 3: 0.03}. In one embodiment, a topic model (Latent Dirichlet Allocation, LDA) can be used to perform topic distribution analysis on the document structure fragment to obtain the fragment topic.
[0098] Topic relevance can be determined through feature distance. Specifically, the topic of a text segment and its corresponding sub-topics are represented by feature vectors to obtain the segment's topic features and sub-topic features. The topic relevance is then calculated based on the feature distance between them. Specifically, the feature vectorization, topic relevance, and insertion recognition results can be determined using classification models, such as those built with logistic regression, SVM (Support Vector Machine), or other neural networks. These models determine whether a text segment is suitable for inserting an image. The input to the classification model is the segment's topic, and the output is the insertion recognition result. Thus, by marking suitable areas for image insertion based on the description of topic changes and importance of the content at the current position in the text segment, images are inserted at appropriate positions within the content topic, enhancing the document's visualization and readability.
[0099] In some embodiments, other image insertion rules can also be set, such as allowing one or more images to be inserted for each final-level subtopic. The number of images to be inserted can be determined by a rule engine combined with machine learning, such as defining a rule to insert one image after each paragraph, or to insert an image when a specific keyword appears.
[0100] S209: Retrieve images from the image material library of the target knowledge domain that match the text content of each image insertion area, and obtain the target image corresponding to each image insertion area.
[0101] Specifically, the image resource library stores multiple images within the target knowledge neighborhood. In the subtask of generating images for the target document, relevant images are first collected, and then images are matched with the text. The images in the image resource library can be copyrighted content or content that complies with the review results generated by AIGC, such as game screenshots, to ensure the quality of the final generated content and the reading experience.
[0102] In some embodiments, reference is made to Figure 6 The image library includes multiple source images and image description text for those images. S209 can specifically include S701-S705:
[0103] S701: Generate image features based on image description text and source images;
[0104] S703: Generate inserted text features based on the fragment topic corresponding to the image insertion region in the target text;
[0105] S705: Filter the target image corresponding to the image insertion region based on the matching degree between image features and inserted text features.
[0106] Specifically, refer to Figure 7 The sources of source images can include copyright-compliant images from crawled materials in the initial source, as well as images of compliant content generated by generative AI models, such as those generated using a diffusion model. Diffusion models are simple to interact with and generate images quickly, significantly lowering the barrier to entry. The working principle of diffusion models is based on the diffusion process, a process of transforming data from a high-dimensional distribution to a low-dimensional distribution. In image generation, images can be viewed as high-dimensional data, and diffusion models transform this high-dimensional data into low-dimensional data by adding some randomness in each step, thereby generating new images.
[0107] Specifically, image description text can be generated by converting image content into text descriptions, such as through image-to-text models like Image Captioning. It can also include contextual content related to the image from the source document. This ensures that the inserted image matches the main content of the long document.
[0108] Specifically, at least one of the image description text and the source image is input into the image feature representation model and vectorized to obtain image features. Simultaneously, the fragment topic corresponding to the image insertion region is vectorized to obtain inserted text features; alternatively, the fragment topic and the final-level subtopic to which the document structure fragment belongs can also be vectorized to obtain inserted text features.
[0109] Furthermore, the inserted text features are used as the text semantic vector index and matched with the image feature index to find relevant images suitable for the image insertion area.
[0110] In some embodiments, the text and image matching algorithm can also adopt existing text-image matching algorithms, such as the image vector description scheme based on CLIP (Contrastive Language-Image Pre-Training, a multimodal pre-trained model). The text and sub-topics corresponding to the image insertion area are used as inputs for image matching. Based on the matching degree, the most matching image is determined as the target image.
[0111] In this way, by matching the features of text and images in a specified area, relevant image retrieval can be achieved, improving the reading experience and the visual layout of the final generated content, and finally outputting a long document of game strategy with pictures and text.
[0112] S211: Insert the target image into the target text based on the image insertion region to obtain the target document.
[0113] In summary, the technical solution of this application decomposes the topic text of the target document based on a first language model to obtain multiple sub-topic sets logically related to the topic text. Each sub-topic set includes at least one level of sub-topic. Then, the document materials corresponding to each sub-topic set are obtained from the document material library of the target knowledge domain, and then input into the second language model to obtain text. By using logically closely related and hierarchically nested sub-topic sets as the content framework of long text, the relevance of the obtained document materials, the matching of diverse topics, and the content relevance of the context are improved, thereby improving the quality of long document generation. Furthermore, the target text is subjected to illustration position recognition to retrieve images matching the regional text content from the image material library of the corresponding knowledge domain, thereby realizing the automatic insertion of document images and improving the content adaptability between images and text and the accuracy of insertion position.
[0114] In some embodiments, after the image is inserted, an image reference record can be generated based on the source information of the target image and added to the target document to avoid image copyright issues.
[0115] In summary, the above technical solution generates long-form documents with images and text through structured and hierarchical segmented generation tasks, making it suitable for generating high-quality long documents such as game guides. The document generation process simulates human creative roles. Based on a knowledge base and material collection in the target knowledge domain (e.g., the game domain), a step-by-step long-document (e.g., game guide) content generation pipeline based on problem decomposition and guidance is constructed. The entire long-document generation process is divided into two sub-tasks: long-document content generation and image generation, to obtain the final target document. The problem-guided and decomposition approach simulates three roles in human collaborative content creation. A large-scale language model is used to decompose and plan the tasks of different roles at each stage, ensuring the richness, professionalism, readability, and stylistic consistency of the long document content.
[0116] In related technologies, content generation mainly involves short text and image content, pure images, pure text content, or simple single text and image content, which has limited expressive capabilities. For complex long documents such as game guides, which involve multiple subjects of a single object (such as a game), the content coverage must be very comprehensive, involving complex relationships and layouts between content. Simple content generation will significantly reduce the quality of professional knowledge-based content, lacking readability and professionalism. In contrast, the technical solution of this application can generate high-quality, richly illustrated long documents with fewer materials. It can be applied to the cold start phase of various content communities or platforms, helping the corresponding channel communities to quickly start up, lowering the threshold for obtaining high-quality content, increasing the supply of high-quality content, and thus increasing the stickiness and activity of the content community as a whole.
[0117] Taking the game knowledge domain as an example, game IPs can be used as the source of creative ideas for game content. The methods described above can transform these IPs into high-quality, long-form game strategy documents. This automated, batch production of richly illustrated, high-quality game strategy content fully utilizes game IPs and related guides or official documentation as the creative source for content creation. This forms an effective source of creative ideas for the channel's game content community, ensuring that the generated game strategy content effectively meets the actual needs of the game channel's users. This effectively lowers the barrier to entry for the community's game channel content cold start, significantly reduces the manual collection and publishing process for game channel operators, and effectively reduces the labor costs of content operation. Furthermore, the phased generation method meets the quality requirements of the game strategy content itself and maintains consistency in overall content style. The distribution of this game strategy content quickly gathers the interests and hobbies of early game community users, obtaining more accurate user attribute descriptions, further promoting the distribution of the community's game content. Simultaneously, it effectively reduces the procurement cost of high-quality game strategy content, reduces and mitigates legal risks such as copyright issues associated with scraping external game strategy content, increases the effective supply of high-quality game content distributed on the platform, reduces reliance on purchasing, and improves the automation and robustness of the generation process.
[0118] This application embodiment also provides a graphic document generation device 800, such as... Figure 8 As shown, the device may include:
[0119] The topic decomposition module 10 is used to decompose the topic text of the target document based on the first language model to obtain multiple sub-topic sets that are logically related to the topic text. The sub-topic sets include at least one level of sub-topic.
[0120] The document retrieval module 20 is used to retrieve document materials that match the subtopics from the document material library of the target knowledge domain for each subtopic set, so as to obtain the document materials corresponding to the subtopic set.
[0121] The document generation module 30 is used to generate documents by taking each subtopic set and the document materials corresponding to each subtopic set as input to the second language model, and obtain the target text.
[0122] Insertion recognition module 40 is used to identify the image insertion location of the target text and determine at least one image insertion area of the target text;
[0123] The image matching module 50 is used to retrieve images from the image material library of the target knowledge domain that match the text content of each image insertion area, and obtain the target image corresponding to each image insertion area;
[0124] The image insertion module 60 is used to insert a target image into the target text based on the image insertion area to obtain the target document.
[0125] In some embodiments, the topic decomposition module 10 can be used to:
[0126] The topic text is input into the first language model. The topic text is decomposed into a problem through multiple iterations using the problem decomposition instruction as the task instruction. This results in the first-level subtopics corresponding to the topic text, as well as several subordinate subtopics corresponding to each first-level subtopic. Each subtopic set includes a first-level subtopic and its corresponding subordinate subtopics.
[0127] In some embodiments, the topic decomposition module 10 can also be used for:
[0128] The subtopics are broken down into smaller granularities for identification, and the granularity identification results are obtained.
[0129] If the granularity identification result indicates that the decomposition granularity of the current subtopic is an atomic index, the topic decomposition of the current subtopic is terminated.
[0130] In some embodiments, the document material library includes document material features of multiple document materials, and the document recall module 20 can be used to:
[0131] Based on the logical hierarchy of subtopics, the directories of each subtopic in the subtopic set are integrated to obtain the subdirectories of each subtopic set;
[0132] Subdirectories are characterized to obtain subdirectory features;
[0133] Using subdirectory features as the recall target, a similar feature retrieval is performed on the document material library, and the document materials to which the retrieved document material features belong are identified as the document materials corresponding to the subtopic set.
[0134] In some embodiments, the second language model is built upon a large language model, and the document generation module 30 can be used for:
[0135] Input the subdirectories and document materials corresponding to each subtopic set into the second language model to generate segmented text, and obtain the segmented text corresponding to each subtopic set. The segmented text and the subdirectories are semantically matched and logically related.
[0136] Each subdirectory and each segment of text is input into the second language model. Each subdirectory is used as a text outline, and each segment of text is used as a content source to generate text with a consistent overall descriptive style, resulting in the target text. The descriptive style of each segment in the target text is matched.
[0137] In some embodiments, the apparatus further includes a citation marker module for inserting citation records of document materials corresponding to each subtopic set into the target text, the citation records indicating the source of the citations to the document materials.
[0138] In some embodiments, the insertion recognition module 40 can be used to:
[0139] The target text is segmented based on discourse units to obtain multiple text structure fragments;
[0140] Each text structure segment is identified by an illustration region to obtain at least one image insertion region.
[0141] In some embodiments, the insertion recognition module 40 may be specifically used for:
[0142] Feature extraction is performed on text structural segments to obtain segment features;
[0143] Image insertion recognition is performed based on fragment features to obtain insertion recognition results, which are used to indicate the image-attached attributes of text structure fragments.
[0144] Based on the image attachment attributes of the filtered text structure fragments for which images need to be attached and the corresponding subtopics of the filtered text structure fragments, the insertion region is marked to obtain the image insertion region of the filtered text structure fragments.
[0145] In some embodiments, the image library includes multiple source images and image description text for the source images, and the image matching module 50 can be used for:
[0146] Image features are generated based on image description text and source images;
[0147] Generate inserted text features based on the fragment topic corresponding to the image insertion region in the target text;
[0148] Target images corresponding to the image insertion region are selected based on the matching degree between image features and inserted text features.
[0149] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0150] This application provides a computer device including a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement a text and image document generation method as provided in the above method embodiments.
[0151] Figure 9 This diagram illustrates a hardware structure of an apparatus for implementing a text and image document generation method provided in an embodiment of this application. The apparatus may constitute or include the device or system provided in the embodiment of this application. Figure 9 As shown, device 100 may include one or more processors 1002 (shown as 1002a, 1002b, ..., 1002n in the figure) (processor 1002 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 9 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, device 100 may also include a... Figure 9 The more or fewer components shown, or having the same Figure 9 The different configurations shown.
[0152] It should be noted that the aforementioned one or more processors 1002 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be wholly or partially integrated into any other element within device 100 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0153] The memory 1004 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method in this embodiment. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, thereby realizing the above-described method for generating graphic documents. The memory 1004 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1004 may further include memory remotely located relative to the processor 1002, and these remote memories can be connected to the device 100 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0154] The transmission device 1006 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of device 100. In one example, the transmission device 1006 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 1006 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0155] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of device 100 (or a mobile device).
[0156] This application embodiment also provides a computer-readable storage medium, which can be disposed in a server to store at least one instruction or at least one program related to implementing a graphic document generation method in the method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the graphic document generation method provided in the above method embodiment.
[0157] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0158] This invention also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a text and image document generation method provided in the various optional embodiments described above.
[0159] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.
[0160] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device, equipment, and storage medium embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0161] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0162] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for generating graphic documents, characterized in that, The method includes: Based on the first language model, the topic text of the target document is decomposed to obtain multiple sub-topic sets that are logically related to the topic text. The sub-topic sets include at least one level of sub-topic. For each of the subtopic sets, document materials matching the subtopic are retrieved from the document material library of the target knowledge domain to obtain the document materials corresponding to the subtopic set; The target text is obtained by using the subtopic sets and the corresponding document materials as input to the second language model. The target text is subjected to illustration location recognition to determine at least one image insertion region of the target text; Retrieve images from the image material library of the target knowledge domain that match the text content of each of the image insertion regions to obtain the target image corresponding to each of the image insertion regions; The target image is inserted into the target text based on the image insertion region to obtain the target document.
2. The method according to claim 1, characterized in that, The first language model is constructed based on a large language model. The process of decomposing the topic text of the target document based on the first language model to obtain multiple sub-topic sets logically related to the topic text includes: The topic text is input into the first language model, and the topic text is decomposed into a hierarchical problem through multiple iterations using the problem decomposition instruction as the task instruction. This yields the first-level subtopic corresponding to the topic text, and several subordinate subtopics corresponding to each first-level subtopic. Each subtopic set includes a first-level subtopic and its corresponding subordinate subtopics.
3. The method according to claim 2, characterized in that, In the process of decomposing the topic, the method further includes: The subtopics are decomposed and granularized to obtain granularity identification results; If the granularity identification result indicates that the decomposition granularity of the current subtopic is an atomic index, the topic decomposition of the current subtopic is terminated.
4. The method according to claim 1, characterized in that, The document resource library includes document resource features of multiple document resources. For each sub-topic set, document resources matching the sub-topic are retrieved from the document resource library of the target knowledge domain to obtain the document resources corresponding to the sub-topic set, including: Based on the logical hierarchy of the subtopics, the subtopics in the subtopic set are integrated into a directory to obtain a subdirectory for each subtopic set; The subdirectories are characterized to obtain subdirectory features; Using the subdirectory features as the recall target, a similar feature retrieval is performed on the document material library, and the document materials to which the retrieved document material features belong are determined as the document materials corresponding to the subtopic set.
5. The method according to claim 1, characterized in that, The second language model is constructed based on a large-scale language model. The step of generating target text by using each of the sub-topic sets and the corresponding document materials as input to the second language model includes: The subdirectories and document materials corresponding to each subtopic set are input into the second language model to generate segmented text, thereby obtaining segmented text corresponding to each subtopic set. The segmented text and the subdirectories are semantically matched and logically related. The subdirectories and segmented texts are input into the second language model. The subdirectories are used as text outlines and the segmented texts are used as content sources to generate text with a consistent overall descriptive style, thereby obtaining the target text.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Insert a reference record of the document material corresponding to each of the subtopic sets into the target text. The reference record is used to indicate the source of the reference of the document material.
7. The method according to any one of claims 1-5, characterized in that, The step of identifying the image insertion location of the target text and determining at least one image insertion region of the target text includes: The text content of the final sub-topic in the target text is segmented based on discourse units or word count limits to obtain multiple text structure fragments corresponding to the final sub-topic; Based on the topic relevance between the text structure fragment and the final subtopic to which the text structure fragment belongs, image insertion recognition is performed on each of the text structure fragments to obtain insertion recognition results. The insertion recognition results are used to indicate the image-attached attributes of the text structure fragment. The image insertion region is determined by the filtered text structure fragment whose attached image attribute is "image to be attached".
8. The method according to claim 7, characterized in that, Based on the topic relevance between the text structure fragment and the final-level subtopic to which the text structure fragment belongs, image insertion recognition is performed on each of the text structure fragments to obtain the insertion recognition results, including: The topic distribution analysis of the text structure fragments is performed to obtain the fragment topics of the text structure fragments; Obtain the topic relevance between the topic of the fragment and the final subtopic to which the text structure fragment belongs; If the topic relevance meets the preset relevance condition, the insertion recognition result is determined to be an image that needs to be added.
9. The method according to any one of claims 1-5, characterized in that, The image resource library includes multiple source images and image description text for the source images. The step of retrieving images from the image resource library of the target knowledge domain that match the text content of each image insertion region to obtain the target image corresponding to each image insertion region includes: Image features are generated based on the image description text and the source image; Generate inserted text features based on the fragment topic corresponding to the image insertion region in the target text; The target image corresponding to the image insertion region is selected based on the matching degree between the image features and the inserted text features.
10. A graphic document generation device, characterized in that, The device includes: The topic decomposition module is used to decompose the topic text of the target document based on the first language model to obtain multiple sub-topic sets logically associated with the topic text, wherein the sub-topic sets include at least one level of sub-topic; The document retrieval module is used to retrieve document materials that match the sub-topic from the document material library of the target knowledge domain for each sub-topic set, so as to obtain the document materials corresponding to the sub-topic set. The document generation module is used to generate the target text by taking each of the sub-topic sets and the document materials corresponding to each of the sub-topic sets as input to the second language model. An insertion recognition module is used to identify the image insertion location of the target text and determine at least one image insertion region of the target text. The image matching module is used to retrieve images from the image material library of the target knowledge domain that match the text content of each image insertion area, and obtain the target image corresponding to each image insertion area; An image insertion module is used to insert the target image into the target text based on the image insertion area to obtain the target document.
11. A computer device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the graphic document generation method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the graphic document generation method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that, The computer program product includes at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the graphic document generation method as described in any one of claims 1 to 9.