Long text generation method and device, electronic equipment and storage medium
By acquiring and processing multimodal data, and using large language models to extract and aggregate key knowledge, the problems of low long text generation efficiency and low information accuracy in the existing technology are solved, and more efficient and accurate long text generation is achieved.
Patent Information
- Application Number
- CN202411960118.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art is inefficient and has low information accuracy when generating long texts, mainly because it can only use external knowledge of text types as input, resulting in the inability to fully utilize heterogeneous data in multiple data formats.
Multimodal data, including heterogeneous data in at least two different data formats, is obtained based on retrieval enhancement generation technology, and processes these data to generate text data. Use large language models to extract and aggregate text data to obtain key knowledge, and then generate target long text based on these key knowledge.
It realizes the generation of target long text requested by the user directly based on multimodal data, and improves the efficiency of long text generation and the accuracy of information.
Smart Images

Figure CN119886064A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of natural language processing technology, and in particular to a long text generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, with the rapid development of artificial intelligence technologies such as Natural Language Processing (NLP), they are being widely applied across various industries, effectively improving work efficiency. For example, based on NLP technology, massive amounts of data can be organized and summarized to ultimately form a summary report. Compared to manual processing, this greatly improves the efficiency of information collection and the generation of long texts.
[0003] In existing technologies, the process of analyzing the collected raw data and generating summary reports is usually based on Retrieval-augmented Generation (RAG) technology, which obtains richer external knowledge from external knowledge bases and generates long texts based on this external knowledge.
[0004] However, existing solutions can only use external knowledge of text types as input to a large language model to generate long texts, which leads to problems such as low efficiency and low information accuracy in long text generation. Summary of the Invention
[0005] This disclosure provides a method, apparatus, electronic device, and storage medium for generating long text, in order to overcome the problems of low efficiency and low accuracy in generating long text.
[0006] In a first aspect, embodiments of this disclosure provide a method for generating long text, including:
[0007] In response to a command to generate a target long text, multimodal data is acquired based on retrieval-enhanced generation technology, and the multimodal data is processed to generate text data. The multimodal data consists of at least two heterogeneous data sets with different data formats. The text data is generated based on the content of each heterogeneous data set and the contextual relationships between them. A large language model is used to extract and aggregate knowledge from the text data to obtain key knowledge. This key knowledge is used to represent at least two information entities and the relationships between them. The target long text is then generated based on this key knowledge using the large language model.
[0008] Secondly, embodiments of this disclosure provide a long text generation apparatus, comprising:
[0009] The processing module is used to respond to the generation instruction of the target long text, acquire multimodal data based on the retrieval enhancement generation technology, and process the multimodal data to generate text data. The multimodal data consists of at least two heterogeneous data with different data formats, and the text data is generated based on the content of each heterogeneous data and the contextual relationship between each heterogeneous data.
[0010] The extraction module is used to extract and aggregate knowledge from the text data using a large language model to obtain key knowledge, which is used to represent at least two information entities and the relationship between the at least two information entities.
[0011] The generation module is used to generate the target long text based on the key knowledge using the large language model.
[0012] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;
[0013] The memory stores computer-executed instructions;
[0014] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the long text generation method as described in the first aspect and various possible designs of the first aspect.
[0015] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the long text generation method described in the first aspect and various possible designs of the first aspect.
[0016] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the long text generation method described in the first aspect and various possible designs of the first aspect.
[0017] The long text generation method, apparatus, electronic device, and storage medium provided in this embodiment, in response to a target long text generation instruction, acquire multimodal data based on retrieval-enhanced generation technology, and process the multimodal data to generate text data. The multimodal data consists of at least two heterogeneous data sets with different data formats. The text data is generated based on the content of each heterogeneous data set and the contextual relationships between them. A large language model is used to extract and aggregate knowledge from the text data to obtain key knowledge. This key knowledge is used to represent at least two information entities and the relationships between them. The target long text is then generated based on this key knowledge using the large language model. By acquiring multimodal data composed of at least two heterogeneous data sets with different data formats and directly processing this multimodal data using a large language model to obtain key knowledge representing information entities and their relationships, and then constructing the target long text based on this key knowledge, the method achieves the goal of directly generating the user-requested target long text from multimodal data, improving the generation efficiency and information accuracy of the target long text. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this disclosure 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 some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is an application scenario diagram of the long text generation method provided in the embodiments of this disclosure;
[0020] Figure 2 Flowchart of the long text generation method provided in the embodiments of this disclosure Figure 1 ;
[0021] Figure 3 for Figure 2 A flowchart illustrating the specific implementation of step S101 in the illustrated embodiment;
[0022] Figure 4 A flowchart illustrating the processing steps for long text data in multimodal data, provided in this embodiment of the disclosure;
[0023] Figure 5 for Figure 2 A flowchart illustrating the specific implementation of step S102 in the illustrated embodiment;
[0024] Figure 6 for Figure 5A flowchart illustrating the specific implementation of step S1021 in the illustrated embodiment;
[0025] Figure 7 Flowchart of the long text generation method provided in the embodiments of this disclosure Figure 2 ;
[0026] Figure 8 for Figure 2 A flowchart illustrating the specific implementation of step S206 in the illustrated embodiment;
[0027] Figure 9 This is a schematic diagram illustrating a process for generating target long text, provided in an embodiment of the present disclosure.
[0028] Figure 10 A structural block diagram of the long text generation apparatus provided in the embodiments of this disclosure;
[0029] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure;
[0030] Figure 12 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0033] The application scenarios of the embodiments of this disclosure are explained below:
[0034] The long text generation method provided in this disclosure can be applied to applications with intelligent assistant functions, such as document editing software, instant messaging software, and office software. More specifically, it can be applied to application scenarios such as intelligent question answering, document processing, and generation. The execution subject of this embodiment can be a terminal device running the aforementioned application with intelligent assistant functions, a server deploying the server corresponding to the aforementioned application, or other electronic devices that perform similar functions. Specifically, when the execution subject is a terminal device, the terminal device executes the method provided in this embodiment by running the aforementioned application; when the execution subject is a server, the server of the aforementioned application with intelligent assistant functions can run partially or entirely on the server, and the method provided in this embodiment is executed on the server side, while the terminal device runs the client of the application. Communication between the server and the terminal device is based on server-client communication, thereby enabling the terminal device to obtain the execution result of the method provided in this embodiment and display it as needed.
[0035] In some embodiments, the terminal device or server can implement the long text generation method provided in this disclosure by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be program-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be local applications, i.e., programs that need to be installed in the operating system to run, or mini-programs embedded in any app, i.e., programs that run in a browser environment. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin; the specific implementation can be configured as needed. Furthermore, in implementing the long text generation method provided in this disclosure, the terminal device or server can execute the method by running computer-executable instructions or computer programs set locally, or by calling computer-executable instructions or computer programs set in an external server. In some embodiments, the server may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud storage, cloud communication, cloud database, cloud computing, cloud functions, network services, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. Among these, cloud services may be interactive processing services that can be invoked by terminal devices.
[0036] Figure 1 This is an application scenario diagram of the long text generation method provided in the embodiments of this disclosure, with reference to... Figure 1As shown, the user, through operating a terminal device (e.g., via a smart assistant within the target application), inputs the required text for generating the report and clicks the "Generate" button. The required text might be, for example, "Generate a summary report about XXX." The terminal device then generates a corresponding generation instruction based on this text and sends it to the server. Upon receiving the instruction, the server uses a large language model deployed on the server to access data from an external database and generates the corresponding summary report using retrieval-enhanced generation technology. Finally, the server returns the summary report to the terminal device, which then displays it within the target application, thus completing the summary report generation process.
[0037] Retrieval-enhanced generation technology is a technique that combines with large language models to retrieve relevant information from external knowledge bases to assist the large language models in generating more accurate and richer text content. It mainly includes the following three steps:
[0038] Retrieval: Retrieve information related to the problem from external knowledge bases to provide useful contextual information and knowledge support for the subsequent generation process.
[0039] Enhancement: The retrieved information is used as contextual input to the large language model to enhance its understanding and ability to answer specific questions. External knowledge is integrated into the generation process, making the generated content more in line with user needs. Simultaneously, the enhancement step allows the large language model to fully utilize knowledge base information without requiring fine-tuning or pre-training, thus improving model performance.
[0040] Generation: Combining the above contextual input with the capabilities of the large language model itself, generate an answer that meets the user's needs.
[0041] In existing technologies, when acquiring external knowledge from external knowledge bases using retrieval-enhanced generation techniques, the data formats of external knowledge include various forms, such as images and videos, in addition to common text. However, existing technologies typically only retrieve text-type data (text corpora), resulting in the loss of a large amount of effective information. Consequently, large language models cannot obtain accurate and complete contextual information, leading to problems such as low generation efficiency and low information accuracy in long texts such as conference reports, technical summaries, and novels generated by large language models.
[0042] This disclosure provides a method for generating long text to solve the above-mentioned problems.
[0043] refer to Figure 2 , Figure 2 Flowchart of the long text generation method provided in the embodiments of this disclosure Figure 1 The method described in this embodiment can be applied to a server. This long text generation method includes:
[0044] Step S101: In response to the generation instruction of the target long text, multimodal data is obtained based on the retrieval enhancement generation technology, and the multimodal data is processed to generate text data. The multimodal data consists of at least two heterogeneous data with different data formats, and the text data is generated based on the content of each heterogeneous data and the contextual relationship between each heterogeneous data.
[0045] For example, refer to Figure 1The illustrated application scenario diagram illustrates the long text generation method provided in this embodiment, using a server as the execution entity. For example, firstly, the server receives a generation instruction from a terminal device. This instruction may include requirement information describing the generation needs of the target long text, such as information limiting the content, word count, and other characteristics of the target long text. This requirement information is generated based on the user-inputted requirement text. The target long text could be, for example, a meeting report, work report, technical summary, or a novel. Besides being included in the generation instruction, the server can also obtain this information from the terminal device through other means; this is not limited here. Next, the server uses retrieval-enhanced generation technology to perform external knowledge retrieval based on the requirement information. For example, using keywords in the requirement information, it retrieves related web pages, text, images, videos, and other heterogeneous data with different data formats from an external knowledge base, thereby obtaining a collection of the aforementioned heterogeneous data, i.e., multimodal data. Taking the technical report generated for root cause analysis of oncall services as an example, the generation instruction includes descriptive text of the aforementioned report topic. During the process of acquiring multimodal data based on retrieval-enhanced generation technology, it reads heterogeneous data from external knowledge bases, such as Q&A records, document data, system screenshots, code configuration data, and video conference records, to form multimodal data. The Q&A records come from oncall team group chats and real-time discussions in alarm handling groups. These records are automatically extracted from the enterprise data warehouse via API, covering a large amount of real-time feedback and solutions. Document data comes from technical documents, system architecture documents, design specifications, etc. These documents are typically stored in the company's internal document management platform and can be extracted using OCR (Optical Character Recognition) and NLP technologies. System screenshots come from documents, Q&A records, and system operation screenshots or log screenshots in meeting minutes. Screenshots typically contain UI information, error logs, or configuration parameters. Code configuration data comes from code repositories, configuration files, etc. The system retrieves key information from these data sources, such as service dependencies, API calls, and configuration information. The data source for video conference recordings is team video conferences related to system development and troubleshooting. The heterogeneous data within the multimodal data can be collected from the same external knowledge base or from different external knowledge bases. The implementation methods and knowledge sources of the external knowledge bases can be configured based on specific needs, which will not be elaborated upon here.
[0046] Subsequently, after receiving multimodal data composed of heterogeneous data matching the generation instructions, the server converts this multimodal data into unified text data. This text data is generated based on the content of each heterogeneous data point and the contextual relationships between them. For example, the multimodal data includes data collected for a group conversation, specifically including dialogue text, screenshots, and videos from different users. After obtaining this multimodal data, the server performs content recognition on the text content in the screenshots and the text in the videos, generating corresponding text data. Then, based on the logical order of the dialogue text, screenshots, and videos within the group, and the referencing relationships of identical names in each text segment, the server adjusts the semantics of each text segment, thus forming the final text data. In short, the above process is the conversion of multiple heterogeneous data into text data. During the conversion, the capabilities of a large language model are used to align the content of different heterogeneous data and combine the contextual relationships between them to generate semantically coherent and logically consistent text data.
[0047] Furthermore, in one possible implementation, the multimodal data includes non-textual data, such as... Figure 3 As shown, the specific implementation of step S101 includes:
[0048] Step S1011: Use a multimodal large model to identify non-textual data and generate corresponding identified text.
[0049] Step S1012: Based on the contextual relationship between each identified text and / or based on the contextual relationship between the identified text and the text data in the multimodal data, perform information fusion on the identified text to generate the corresponding matching text.
[0050] Step S1013: Generate text data based on each matched text.
[0051] For example, the server first identifies non-text data by calling a multimodal large model deployed locally or externally, generating corresponding identified text. This involves using recognition technologies such as ORC to extract text content from images, videos, etc., forming the corresponding text, i.e., the identified text. Then, information fusion is performed on the identified texts based on the contextual relationships between them. For instance, in identified text T1 generated from heterogeneous data D1, the content "Feature A has attribute a" is included, where heterogeneous data D1 is, for example, an image; in identified text T2 generated from heterogeneous data D2, the content "Feature A has attribute b" is included, where heterogeneous data D2 is, for example, a video. Based on the contextual relationship between the two, information fusion is performed on the identified texts to generate the corresponding matching text: "Feature A has attributes a and attribute b". Finally, based on the information-fused matching text, steps such as combination and semantic adjustment are performed to generate the final text data.
[0052] In another possible implementation, the text data contained in the modal data is used to fuse information in the recognition text when generating the matching text, based on the contextual relationship between the recognition text and the text data in the multimodal data. The specific implementation process is the same as the process of generating the recognition text based on the contextual relationship between the recognition texts, and will not be described again.
[0053] In this embodiment, by using a multimodal large model to identify non-textual data, corresponding identified text is generated. Information fusion is then performed by utilizing the contextual relationships between identified texts or between identified texts and text data, thereby generating text data with higher information density and more compact data structure, thus improving the quality and efficiency of the target long text subsequently generated.
[0054] Furthermore, in another possible scenario, the multimodal data also includes long text data. Long text data refers to text whose length exceeds a length threshold; it can be simply understood as ultra-long text. For large language models, due to the limitation of input text length, ultra-long text cannot be processed directly. In this embodiment, as... Figure 4 As shown, the processing steps for long text data in multimodal data include:
[0055] Step S1014: Detect the semantic structure of long text data.
[0056] Step S1015: Segment the long text data according to the semantic structure to obtain at least two text paragraphs, and the text paragraphs have semantic integrity.
[0057] Step S1016: Generate text data based on at least two text paragraphs.
[0058] For example, the semantic structure of long text data is detected using a large language model. Based on this semantic structure, the long text data is intelligently segmented into text segments of varying lengths, ensuring that each segment has semantic integrity. These segmented text segments are then used to construct the final text data. In other words, the system employs an intelligent segmentation strategy for long text data. Specifically, the system analyzes the semantic structure of the text to identify natural paragraph or topic transition points, while also considering word count limitations to ensure that the length of each segment is suitable for subsequent processing. For instance, for chat logs, the system performs semantic segmentation by detecting conversation end markers or prolonged pauses, ensuring that each text block has independent logic and semantic integrity. This avoids the problem of excessively long text segments being unprocessable by the large language model in subsequent steps.
[0059] The steps in this embodiment can be combined with steps S1011-S1013. For example, after generating the recognized text, if the recognized text is long text data, it can be segmented based on the above steps to obtain multiple text segments, and then subsequent steps can be performed to solve the problem of excessively long text in the text data.
[0060] Step S102: Using a large language model, extract and aggregate knowledge from the text data to obtain key knowledge. The key knowledge is used to represent at least two information entities and the relationship between at least two information entities.
[0061] Step S103: Generate target long text based on key knowledge.
[0062] For example, after generating text data, a large language model is used to extract and aggregate knowledge from the text data obtained based on retrieval-enhanced generation techniques, yielding key knowledge for generating the target long text. Knowledge extraction refers to semantically extracting information entities from the text data, while aggregation establishes the relationships between these information entities. This process can be implemented based on the reasoning and inductive capabilities of the large language model.
[0063] In one possible implementation, the key knowledge includes a knowledge graph; such as Figure 5 As shown, the specific implementation of step S102 includes:
[0064] Step S1021: Extract knowledge from the text data using a large language model to obtain multiple information entities and the relationships between them;
[0065] Step S1022: Generate a knowledge graph based on multiple information entities and the relationships between them.
[0066] For example, firstly, the server extracts knowledge from the text data using a large language model, obtaining multiple information entities. During knowledge extraction, the system first identifies various information entities. For instance, in the text data corresponding to a technical discussion record (heterogeneous data), the system extracts information such as service name, component name, error code, and exception logs. These information entities then serve as key elements in the target long text, and are used as a basis to generate richer content, such as providing a foundation for subsequent fault analysis. Furthermore, the system can not only identify independent technical entities but also discover the relationships between them. Through deep semantic analysis and LLM techniques including but not limited to COT and ReACT, the system can extract causal relationships between events. For example, the system can identify the causal chain between a database anomaly and subsequent service downtime. These relationships can not only be directly used to generate long texts such as analysis reports but can also be combined with relevant information about the information entities to construct a knowledge graph. Finally, using the extracted multiple information entities and the relationships between them, data representing the relationships between information entities—that is, a knowledge graph—is constructed. For example, a knowledge graph is used to represent multiple information entities, as well as the causal relationships and dependencies between them. Based on the specific content of the information entities, the knowledge graph records, for example, solutions to various problems.
[0067] Furthermore, in one possible implementation, such as Figure 6 As shown, the specific implementation of step S1021 includes:
[0068] Step S1021-1: Using a large language model, based on the domain information of the text data, knowledge points are associated with text data from different domains. The domain information is used to characterize the domain to which the heterogeneous data corresponding to the text data belongs.
[0069] Step S1021-2: After fusing the associated knowledge points, extract the corresponding information entities and the relationships between multiple information entities.
[0070] For example, based on the previous embodiments, the text data originates from the transformation of heterogeneous data. This heterogeneous data is obtained from an external knowledge base using retrieval-enhanced generation technology. Therefore, when the technical fields of the external knowledge bases differ, the technical fields of the obtained heterogeneous data also differ, and the domains of the text data generated from the heterogeneous data also differ accordingly. Domain information describes the domain and can be a domain identifier or other forms. After obtaining the text data, a large language model is used to associate knowledge points of the text data from different domains based on the domain information. For example, "network anomaly" and "slow database query" are texts from two different sets of text data, generated from heterogeneous data in different domains, and therefore correspond to different domain information. In this embodiment, to address complex cross-domain scenarios, cross-domain knowledge fusion technology is employed. This technology merges knowledge points from different domains that share commonalities (e.g., similar processing methods). For example, the aforementioned "network anomaly" and "slow database query" are associated as knowledge points. Then, after fusion, the associated knowledge points are extracted to obtain the corresponding information entities. That is, "network anomaly" and "slow database query" are merged into a single information instance, such as "network anomaly" or "slow database query," or other representations. Subsequently, based on the methods used in previous embodiments, this information instance and the relationships between it are extracted, thereby generating a more systematic root cause analysis result, making the final generated target long text more systematic.
[0071] Taking a technical report generated from the root cause analysis of oncall intelligent systems as an example, the target long text is a technical report. The report includes sections on investigation purpose, troubleshooting steps, structural observations, and analytical approaches. The investigation purpose section includes specific steps such as: "Determine if there are frequently executed SQL statements affecting database performance, leading to high proxy latency"; "Determine if business SQL statements have performance vulnerabilities such as full table scans." The troubleshooting steps include: for SQL statements executed frequently, viewing the execution plan and checking metrics such as the number of rows scanned using the platform's SQL query tool. Regarding the observation results and analytical approaches, specific content includes: "If SQL statements involve full table scans and high QPS, they are prone to database crashes, which may indicate unreasonable business logic, requiring optimization of the SQL execution method." The content of each of these sections is the result generated by inferring based on key knowledge using a large language model.
[0072] In this embodiment, in response to a command to generate a target long text, multimodal data is acquired based on retrieval-enhanced generation technology. This multimodal data is then processed to generate text data. The multimodal data consists of at least two heterogeneous data sets with different formats. The text data is generated based on the content of each heterogeneous data set and the contextual relationships between them. A large language model is used to extract and aggregate knowledge from the text data, yielding key knowledge. This key knowledge represents at least two information entities and the relationships between them. The target long text is then generated based on this key knowledge using the large language model. By acquiring multimodal data composed of at least two heterogeneous data sets with different formats and directly processing this multimodal data using a large language model to obtain key knowledge representing information entities and their relationships, and then constructing the target long text based on this key knowledge, the goal of directly generating the user-requested target long text from multimodal data is achieved, improving the generation efficiency and accuracy of the target long text.
[0073] refer to Figure 7 , Figure 7 Flowchart of the long text generation method provided in the embodiments of this disclosure Figure 2 This embodiment is in Figure 2 Based on the illustrated embodiment, step S103 is further refined, and the long text generation method includes:
[0074] Step S201: In response to the instruction to generate the target long text, multimodal data is obtained based on retrieval enhancement generation technology, and the multimodal data is processed to generate text data. The multimodal data consists of at least two heterogeneous data with different data formats, and the text data is generated based on the content of each heterogeneous data and the contextual relationship between each heterogeneous data.
[0075] Step S202: Extract knowledge from the text data using a large language model to obtain multiple information entities and the relationships between them.
[0076] Step S203: Based on the information entities and the relationships between multiple information entities, classify each information entity to obtain at least two knowledge block data.
[0077] Step S204: Aggregate knowledge block data with similarity or relevance to generate key knowledge.
[0078] For example, after obtaining the text data, a large language model is used to extract knowledge from the text data, resulting in multiple information entities and the relationships between them. The specific implementation of this step has been described in previous embodiments and will not be repeated here. Next, the large language model further classifies the information entities based on the information entities and the relationships between them. The classification method is based on multi-layer semantic understanding, which can distinguish different topics in long texts such as technical reports. For example, in the case of a target long text being an on-call technical report, the system can classify technical problems according to root causes, including "business logic problems," "database load problems," and "network latency problems." This classification of information entities helps users quickly focus on the core issues. Then, knowledge blocks with similarity or relevance are aggregated to obtain the key knowledge needed to generate the target long text. For example, in the same fault report, multiple on-call records may involve the same root cause or similar solutions. The system will aggregate this duplicate information to form a more concise summary, i.e., key knowledge, thus making the final target long text more concise and accurate.
[0079] Step S205: Based on the key knowledge, use a large language model to generate a text outline of the target long text. The text outline includes at least two chapter titles.
[0080] Step S206: Based on the text outline, generate the chapter text corresponding to each chapter title, and merge the chapter text corresponding to each chapter title to generate the target long text.
[0081] For example, further, a large language model is used to understand and reason about key knowledge, and combined with a preset report template, a text outline is generated. The report template represents the outline of the target long text, such as sections like "Problem Description," "Solution," "Root Cause Analysis," and "Future Optimization." This report template corresponds to the report type of the target long text and can be determined based on generation instructions. Based on this outline of the target long text, the large language model, combined with key knowledge, generates a text outline. The text outline includes at least two chapter titles, each corresponding to a chapter in the target long text. For example, the text outline includes the following: "Part One: Problem Description. Section One, Fault Phenomenon; Summary Two, Involved System Modules; Summary Three,..." Each of the above titles (e.g., Part One, Section One) can be considered a chapter title, and its corresponding content is a chapter in the target long text. The chapter titles in this text outline describe the main content of the corresponding chapter. Then, the large language model generates the chapter text corresponding to each chapter title, and the chapter texts are merged to generate the target long text. The large language model used to generate the text outline and the large language model used to generate the chapter text can be the same model or different models.
[0082] For example, in one possible implementation, such as Figure 8 As shown, the specific implementation of step S206 includes:
[0083] Step S2061: Based on the text outline, determine at least two text paragraph identifiers, each corresponding to at least one chapter title.
[0084] Step S2062: Call at least two large language models to asynchronously process key knowledge and generate chapter texts corresponding to each text paragraph identifier.
[0085] Step S2063: Based on the chapter semantics of each chapter text, merge the chapter texts to generate the target long text.
[0086] For example, based on the previous introduction to the text outline, firstly, at least two text paragraph identifiers can be determined according to the text outline. Each text paragraph identifier corresponds to at least one chapter title. For example, the titles of Chapter 1 and Chapter 2 are divided into one text paragraph, and a corresponding text paragraph identifier A is generated; the title of Chapter 3 is divided into another text paragraph, and a corresponding text paragraph identifier B is generated. Then, at least two large language models are called asynchronously to process key knowledge to generate the chapter text corresponding to each of the above text paragraph identifiers. Combining the above example, for instance, by calling large language model M1, using the key knowledge obtained in the previous steps as corpus data, the chapter text corresponding to text paragraph identifier A is generated, i.e., the chapter text corresponding to the titles of Chapter 1 and Chapter 2; by calling large language model M2, using the key knowledge obtained in the previous steps as corpus data, the chapter text corresponding to text paragraph identifier B is generated, i.e., the chapter text corresponding to the title of Chapter 3. Then, according to the chapter semantics of each chapter text, i.e., the chapter theme content represented by the chapter titles, the chapter texts are merged to generate the target long text.
[0087] In this embodiment, the target long text is segmented using a text outline, and multiple large language models are invoked to generate content for each text segment separately. During this process, the long text is divided into multiple independent paragraphs, each generated by a different large language model. After generation, natural language processing techniques are used to merge the content, ensuring semantic coherence between different paragraphs. This embodiment is suitable for generating logically independent report paragraphs, such as independent sections of different fault analyses.
[0088] In another possible implementation, step S206 is specifically implemented as follows:
[0089] Step S2064: Based on the text outline, determine at least two text paragraph identifiers, each corresponding to at least one chapter title.
[0090] Step S2065: Call the target large language mode to process key knowledge, and generate the chapter text corresponding to each text paragraph identifier in the target long text in sequence, thereby generating the target long text. The chapter text corresponding to the subsequent text paragraph identifier is generated based on the chapter text corresponding to the previous text paragraph identifier.
[0091] For example, in another possible implementation, the target long text is generated segment by segment by invoking the same large language model based on the text outline and the key knowledge obtained in previous steps. Specifically, after determining at least two text segment identifiers based on the text outline, the target large language model is invoked to process the key knowledge and generate the chapter texts corresponding to each text segment identifier in the target long text in sequence based on the chapter titles. For example, the chapter text corresponding to text segment identifier A (text segment identifier A corresponds to the chapter identifier of Chapter 1) is generated first. Then, the chapter text corresponding to text segment identifier B (text segment identifier B corresponds to the chapter identifiers of Chapter 2 and Chapter 3) is generated by combining the chapter text corresponding to text segment identifier A, the key knowledge, and the text outline. This process continues until the chapter text corresponding to the last text segment identifier is generated. Finally, the chapter texts corresponding to each text segment identifier are merged to generate the target long text.
[0092] In this mode, the system generates each paragraph sequentially, referencing the content of previous paragraphs to ensure overall text coherence. This is suitable for long text generation scenarios requiring a strict logical order, such as troubleshooting processes that move from problem description to root cause analysis and then to solutions.
[0093] Furthermore, during the execution of step S206 above, after generating the chapter text corresponding to each chapter title, the process also includes:
[0094] Step S200: Perform semantic analysis and style adjustment on the text of each chapter to obtain optimized chapter text corresponding to at least one chapter title.
[0095] Accordingly, the specific implementation methods for merging the chapter text corresponding to each chapter title to generate the target long text include: merging the optimized chapter text and the chapter text to generate the target long text; or merging the optimized chapter text to generate the target long text.
[0096] For example, after generating the chapter text, it can be further optimized. For instance, the server can apply a text optimization module to automatically perform syntax checks, semantic consistency analysis, and style adjustments to ensure the final output conforms to the standard format of technical documents. Through the steps described above in this embodiment, the solution can fully support efficient processing of multimodal, large-scale data and long text generation, not only improving the automated generation capability of reports but also enhancing the logic and knowledge depth of the generated target long text.
[0097] Figure 9 This is a schematic diagram illustrating a process for generating target long text according to an embodiment of the present disclosure. The following is in conjunction with... Figure 9 The process of the above embodiments will be further described, such as... Figure 9As shown, exemplarily, firstly, multimodal data is acquired through retrieval-enhanced generation technology. This multimodal data includes question-and-answer records, documents, system screenshots, code / configuration information, and video conference recordings. After receiving the generation instruction for the target long text, the server first processes the aforementioned multimodal data based on the content of the generation instruction, including image translation, document slicing, video-to-text conversion, and configuration association steps. Then, by calling a large language model, knowledge extraction and classification are performed to obtain knowledge point #1, knowledge point #2, knowledge point #3, etc., forming a knowledge graph / knowledge base. Next, the large language model is called again to generate a text outline, and segmentation generation is performed on the content of each chapter of the text outline, resulting in chapter texts such as paragraph D1, paragraph D2, and paragraph D3. Then, by calling the large language model again, the aforementioned chapter texts are synthesized and continued to generate the target long text containing the content of paragraphs D1, D2, and D3, and sent to the user's terminal device for display, completing the process of automatically generating a report.
[0098] In this embodiment, the implementation of step S201 is the same as that in this disclosure. Figure 2 The implementation of step S101 in the illustrated embodiment is the same, and will not be described in detail here.
[0099] Corresponding to the long text generation method in the above embodiment, Figure 10 This is a structural block diagram of a long text generation device provided in an embodiment of this disclosure. The method described in the above embodiments can be executed by this long text generation device, which can be implemented by software and / or hardware, and can be integrated into an electronic device with certain data processing capabilities. The electronic device may include, but is not limited to, mobile terminals with big data processing capabilities, as well as fixed terminals with big data processing capabilities such as desktop computers and supercomputers.
[0100] For ease of explanation, only the parts relevant to embodiments of this disclosure are shown. (Refer to...) Figure 10 The long text generation device 3 includes:
[0101] The processing module 31 is used to respond to the generation instruction of the target long text, acquire multimodal data based on the retrieval enhancement generation technology, process the multimodal data, and generate text data. The multimodal data consists of at least two heterogeneous data with different data formats, and the text data is generated based on the content of each heterogeneous data and the contextual relationship between each heterogeneous data.
[0102] Extraction module 32 is used to extract and aggregate knowledge from text data using a large language model to obtain key knowledge. The key knowledge is used to represent at least two information entities and the relationship between at least two information entities.
[0103] The generation module 33 is used to generate target long text based on key knowledge using a large language model.
[0104] According to one or more embodiments of this disclosure, the generation module 33 is specifically used to: generate a text outline of the target long text using a large language model based on key knowledge, the text outline including at least two chapter titles; generate chapter texts corresponding to each chapter title based on the text outline, and merge the chapter texts corresponding to each chapter title to generate the target long text.
[0105] According to one or more embodiments of this disclosure, when the generation module 33 generates chapter text corresponding to each chapter title based on the text outline, and merges the chapter text corresponding to each chapter title to generate the target long text, it is specifically used to: determine at least two text paragraph identifiers based on the text outline, wherein each text paragraph identifier corresponds to at least one chapter title; call at least two large language models to asynchronously process key knowledge and generate chapter text corresponding to each text paragraph identifier respectively; and merge the chapter texts based on the chapter semantics of each chapter text to generate the target long text.
[0106] According to one or more embodiments of this disclosure, when the generation module 33 generates chapter text corresponding to each chapter title based on the text outline, and merges the chapter text corresponding to each chapter title to generate the target long text, it is specifically used to: determine at least two text paragraph identifiers based on the text outline, each text paragraph identifier corresponding to at least one chapter title; call the target long language mode to process key knowledge, and sequentially generate the chapter text corresponding to each text paragraph identifier in the target long text, thereby generating the target long text, wherein the chapter text corresponding to the subsequent text paragraph identifier is generated based on the chapter text corresponding to the previous text paragraph identifier.
[0107] According to one or more embodiments of this disclosure, after generating the chapter text corresponding to each chapter title, the generation module 33 is further configured to: perform semantic analysis and style adjustment on each chapter text to obtain at least one optimized chapter text corresponding to a chapter title; when the generation module 33 merges the chapter text corresponding to each chapter title to generate the target long text, it is specifically configured to: merge the optimized chapter text and the chapter text to generate the target long text.
[0108] According to one or more embodiments of this disclosure, the multimodal data includes non-textual data. When processing the multimodal data to generate text data, the processing module 31 is specifically used to: recognize the non-textual data using a multimodal large model to generate corresponding recognized text; perform information fusion on the recognized text according to the contextual relationship between each recognized text, and / or according to the contextual relationship between the recognized text and the text data in the multimodal data, to generate corresponding matching text; and generate text data based on each matching text.
[0109] According to one or more embodiments of this disclosure, the multimodal data includes long text data. When the processing module 31 processes the multimodal data to generate text data, it is specifically used to: detect the semantic structure of the long text data; segment the long text data according to the semantic structure to obtain at least two text paragraphs, wherein the text paragraphs have semantic integrity; and generate text data based on the at least two text paragraphs.
[0110] According to one or more embodiments of this disclosure, the extraction module 32 is specifically used to: extract knowledge from text data through a large language model to obtain multiple information entities and the relationships between the multiple information entities; classify each information entity according to the information entities and the relationships between the multiple information entities to obtain at least two knowledge block data; and aggregate the knowledge block data that are similar or related to each other to generate key knowledge.
[0111] According to one or more embodiments of this disclosure, the key knowledge also includes a knowledge graph. After extracting knowledge from the text data through a large language model to obtain multiple information entities and the relationships between the multiple information entities, the generation module 33 is further used to: generate a knowledge graph based on the multiple information entities and the relationships between the multiple information entities.
[0112] According to one or more embodiments of this disclosure, when the extraction module 32 extracts knowledge from text data through a large language model to obtain multiple information entities and the relationships between the multiple information entities, it is specifically used to: associate knowledge points of text data in different domains based on the domain information of the text data through the large language model, where the domain information is used to characterize the domain to which the heterogeneous data corresponding to the text data belongs; and extract the associated knowledge points after fusion to obtain the corresponding information entities and the relationships between the multiple information entities.
[0113] The processing module 31, the advance module 32, and the generation module 33 are connected in sequence. The long text generation device 3 provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0114] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as... Figure 11 As shown, the electronic device 4 includes:
[0115] Processor 41, and memory 42 communicatively connected to processor 41;
[0116] Memory 42 stores instructions executed by the computer;
[0117] The processor 41 executes computer execution instructions stored in the memory 42 to achieve, for example, Figures 2-9 The long text generation method in the illustrated embodiment.
[0118] Optionally, the processor 41 and the memory 42 are connected via a bus 43.
[0119] For relevant instructions, please refer to the corresponding text. Figures 2-9 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.
[0120] This disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement this disclosure. Figures 2-9 The long text generation method provided in any of the corresponding embodiments.
[0121] This disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements this disclosure. Figures 2-9 The long text generation method provided in any of the corresponding embodiments.
[0122] To implement the above embodiments, this disclosure also provides an electronic device.
[0123] refer to Figure 12 The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 12 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0124] like Figure 12As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0125] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 12 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0126] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0127] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0128] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0129] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0130] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0131] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0132] The units or modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units or modules do not necessarily limit the specific unit itself.
[0133] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0134] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0135] In a first aspect, according to one or more embodiments of this disclosure, a long text generation method is provided, comprising:
[0136] In response to a command to generate a target long text, multimodal data is acquired based on retrieval-enhanced generation technology, and the multimodal data is processed to generate text data. The multimodal data consists of at least two heterogeneous data sets with different data formats. The text data is generated based on the content of each heterogeneous data set and the contextual relationships between them. A large language model is used to extract and aggregate knowledge from the text data to obtain key knowledge. This key knowledge is used to represent at least two information entities and the relationships between them. The target long text is then generated based on this key knowledge using the large language model.
[0137] According to one or more embodiments of this disclosure, generating the target long text based on the key knowledge using the large language model includes: generating a text outline of the target long text using the large language model based on the key knowledge, the text outline including at least two chapter titles; generating chapter texts corresponding to each chapter title based on the text outline, and merging the chapter texts corresponding to each chapter title to generate the target long text.
[0138] According to one or more embodiments of this disclosure, the step of generating chapter texts corresponding to each chapter title based on the text outline, and merging the chapter texts corresponding to each chapter title to generate the target long text, includes: determining at least two text paragraph identifiers based on the text outline, wherein each text paragraph identifier corresponds to at least one chapter title; asynchronously processing the key knowledge by calling at least two large language models to generate chapter texts corresponding to each text paragraph identifier; and merging the chapter texts based on the chapter semantics of each chapter text to generate the target long text.
[0139] According to one or more embodiments of this disclosure, the step of generating chapter texts corresponding to each chapter title based on the text outline, and merging the chapter texts corresponding to each chapter title to generate the target long text, includes: determining at least two text paragraph identifiers based on the text outline, each text paragraph identifier corresponding to at least one chapter title; calling the target large language mode to process the key knowledge, and sequentially generating chapter texts corresponding to each text paragraph identifier in the target long text, thereby generating the target long text, wherein the chapter text corresponding to a later text paragraph identifier is generated based on the chapter text corresponding to a previous text paragraph identifier.
[0140] According to one or more embodiments of this disclosure, after generating the chapter text corresponding to each chapter title, the method further includes: performing semantic analysis and style adjustment on each chapter text to obtain optimized chapter text corresponding to at least one chapter title; the step of merging the chapter text corresponding to each chapter title to generate the target long text includes: merging the optimized chapter text and the chapter text to generate the target long text.
[0141] According to one or more embodiments of this disclosure, the multimodal data includes non-textual data, and the process of processing the multimodal data to generate text data includes: using a multimodal large model to identify the non-textual data and generate corresponding identified text; performing information fusion on the identified text according to the contextual relationship between each identified text, and / or according to the contextual relationship between the identified text and the text data in the multimodal data, to generate corresponding matching text; and generating the text data based on each matching text.
[0142] According to one or more embodiments of this disclosure, the multimodal data includes long text data, and the process of processing the multimodal data to generate text data includes: detecting the semantic structure of the long text data; segmenting the long text data according to the semantic structure to obtain at least two text paragraphs, the text paragraphs having semantic integrity; and generating the text data based on the at least two text paragraphs.
[0143] According to one or more embodiments of this disclosure, the step of using a large language model to extract and aggregate knowledge from the text data to obtain key knowledge includes: extracting knowledge from the text data using a large language model to obtain multiple information entities and the relationships between the multiple information entities; classifying each information entity according to the information entities and the relationships between the multiple information entities to obtain at least two knowledge block data; and aggregating the knowledge block data with similarity or relevance to generate the obtained key knowledge.
[0144] According to one or more embodiments of this disclosure, the key knowledge further includes a knowledge graph. After extracting knowledge from the text data through a large language model to obtain multiple information entities and the relationships between the multiple information entities, the method further includes: generating a knowledge graph based on the multiple information entities and the relationships between the multiple information entities.
[0145] According to one or more embodiments of this disclosure, the step of extracting knowledge from the text data using a large language model to obtain multiple information entities and the relationships between the multiple information entities includes: using a large language model to associate knowledge points of text data in different domains based on the domain information of the text data, wherein the domain information is used to characterize the domain to which the heterogeneous data corresponding to the text data belongs; and fusing and extracting the associated knowledge points to obtain the corresponding information entities and the relationships between the multiple information entities.
[0146] Secondly, according to one or more embodiments of this disclosure, a long text generation apparatus is provided, comprising:
[0147] The processing module is used to respond to the generation instruction of the target long text, acquire multimodal data based on the retrieval enhancement generation technology, and process the multimodal data to generate text data. The multimodal data consists of at least two heterogeneous data with different data formats, and the text data is generated based on the content of each heterogeneous data and the contextual relationship between each heterogeneous data.
[0148] The extraction module is used to extract and aggregate knowledge from the text data using a large language model to obtain key knowledge, which is used to represent at least two information entities and the relationship between the at least two information entities.
[0149] The generation module is used to generate the target long text based on the key knowledge using the large language model.
[0150] According to one or more embodiments of this disclosure, the generation module is specifically configured to: generate a text outline of the target long text using a large language model based on the key knowledge, the text outline including at least two chapter titles; generate chapter texts corresponding to each chapter title based on the text outline, and merge the chapter texts corresponding to each chapter title to generate the target long text.
[0151] According to one or more embodiments of this disclosure, when the generation module generates chapter texts corresponding to each chapter title based on the text outline, and merges the chapter texts corresponding to each chapter title to generate the target long text, it is specifically configured to: determine at least two text paragraph identifiers based on the text outline, wherein each text paragraph identifier corresponds to at least one chapter title; call at least two large language models to asynchronously process the key knowledge, and generate chapter texts corresponding to each text paragraph identifier respectively; and merge the chapter texts based on the chapter semantics of each chapter text to generate the target long text.
[0152] According to one or more embodiments of this disclosure, when the generation module generates chapter text corresponding to each chapter title based on the text outline, and merges the chapter text corresponding to each chapter title to generate the target long text, it is specifically used to: determine at least two text paragraph identifiers based on the text outline, wherein each text paragraph identifier corresponds to at least one chapter title; call the target large language mode to process the key knowledge, and sequentially generate chapter text corresponding to each text paragraph identifier in the target long text, thereby generating the target long text, wherein the chapter text corresponding to the subsequent text paragraph identifier is generated based on the chapter text corresponding to the previous text paragraph identifier.
[0153] According to one or more embodiments of this disclosure, after generating the chapter text corresponding to each of the chapter titles, the generation module is further configured to: perform semantic analysis and style adjustment on each of the chapter texts to obtain at least one optimized chapter text corresponding to a chapter title; when the generation module merges the chapter texts corresponding to each of the chapter titles to generate the target long text, it is specifically configured to: merge the optimized chapter text and the chapter text to generate the target long text.
[0154] According to one or more embodiments of this disclosure, the multimodal data includes non-textual data. When the processing module processes the multimodal data to generate text data, it is specifically configured to: use a multimodal large model to identify the non-textual data and generate corresponding identified text; perform information fusion on the identified text according to the contextual relationship between each identified text, and / or according to the contextual relationship between the identified text and the text data in the multimodal data, to generate corresponding matching text; and generate the text data based on each matching text.
[0155] According to one or more embodiments of this disclosure, the multimodal data includes long text data. When the processing module processes the multimodal data to generate text data, it is specifically used to: detect the semantic structure of the long text data; segment the long text data according to the semantic structure to obtain at least two text paragraphs, the text paragraphs having semantic integrity; and generate the text data based on the at least two text paragraphs.
[0156] According to one or more embodiments of this disclosure, the extraction module is specifically used to: extract knowledge from the text data using a large language model to obtain multiple information entities and the relationships between the multiple information entities; classify each information entity according to the information entities and the relationships between the multiple information entities to obtain at least two knowledge block data; and aggregate the knowledge block data with similarity or relevance to generate the obtained key knowledge.
[0157] According to one or more embodiments of this disclosure, the key knowledge further includes a knowledge graph. After extracting knowledge from the text data using a large language model to obtain multiple information entities and the relationships between the multiple information entities, the generation module is further configured to: generate a knowledge graph based on the multiple information entities and the relationships between the multiple information entities.
[0158] According to one or more embodiments of this disclosure, when the extraction module extracts knowledge from the text data using a large language model to obtain multiple information entities and the relationships between the multiple information entities, it is specifically used to: associate knowledge points of text data in different domains based on the domain information of the text data using a large language model, wherein the domain information is used to characterize the domain to which the heterogeneous data corresponding to the text data belongs; and extract the associated knowledge points after fusion to obtain the corresponding information entities and the relationships between the multiple information entities.
[0159] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;
[0160] The memory stores computer-executed instructions;
[0161] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the long text generation method as described in the first aspect and various possible designs of the first aspect.
[0162] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, and when a processor executes the computer-executable instructions, the long text generation method described in the first aspect and various possible designs of the first aspect is implemented.
[0163] Fifthly, according to one or more embodiments of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the long text generation method as described in the first aspect and various possible designs of the first aspect.
[0164] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0165] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0166] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A long text generation method, characterized in that: include: In response to a generation instruction of a target long text, multimodal data is acquired based on a retrieval enhanced generation technology, and the multimodal data is processed to generate text data, wherein the multimodal data is composed of at least two heterogeneous data with different data formats, and the text data is generated based on the content of each heterogeneous data and the contextual relationship between each heterogeneous data; Using a large language model, extracting and aggregating knowledge from the text data to obtain key knowledge, wherein the key knowledge is used to characterize at least two information entities and an association relationship between at least two of the information entities; The target long text is generated based on the key knowledge by using the large language model.
2. The method according to claim 1, characterized in that The generating the target long text based on the key knowledge by using the large language model includes: Generate a text outline of the target long text using a large language model according to the key knowledge, wherein the text outline includes at least two chapter titles; Based on the text outline, the chapter texts corresponding to the chapter titles are generated, and based on the chapter texts corresponding to the chapter titles, they are merged to generate the target long text.
3. The method according to claim 2, characterized in that The step of generating chapter texts corresponding to the chapter titles based on the text outline, and merging the chapter texts corresponding to the chapter titles to generate the target long text includes: Determine at least two text paragraph marks according to the text outline, wherein the text paragraph marks correspond to at least one chapter title; Calling at least two large language models to asynchronously process the key knowledge and respectively generate chapter texts corresponding to the text paragraph identifiers; Based on the chapter semantics of each of the chapter texts, the chapter texts are merged to generate the target long text.
4. The method according to claim 2, characterized in that: The step of generating chapter texts corresponding to the chapter titles based on the text outline, and merging the chapter texts corresponding to the chapter titles to generate the target long text includes: Determine at least two text paragraph marks according to the text outline, wherein the text paragraph marks correspond to at least one chapter title; The target large language model is called to process the key knowledge, and the chapter texts corresponding to the text paragraph markers in the target long text are generated in sequence, thereby generating the target long text, wherein the chapter text corresponding to the latter text paragraph marker is generated based on the chapter text corresponding to the former text paragraph marker.
5. The method according to claim 2, characterized in that: After generating the chapter texts corresponding to the chapter titles, the method further includes: Performing semantic analysis and style adjustment on each of the chapter texts to obtain an optimized chapter text corresponding to at least one chapter title; The step of merging the chapter texts corresponding to the chapter titles to generate the target long text includes: The optimized chapter text and the chapter text are merged to generate the target long text.
6. The method according to claim 1, characterized in that The multimodal data includes non-text data, and the processing of the multimodal data to generate text data includes: Using a multimodal large model to recognize the non-text data and generate corresponding recognition text; According to the contextual relationship between the recognized texts, and / or according to the contextual relationship between the recognized texts and the text data in the multimodal data, information fusion is performed on the recognized texts to generate corresponding matching texts; The text data is generated based on each of the matching texts.
7. The method according to claim 1, characterized in that The multimodal data includes long text data, and the step of processing the multimodal data to generate text data includes: Detecting the semantic structure of the long text data; Segmenting the long text data according to the semantic structure to obtain at least two text paragraphs, wherein the text paragraphs have semantic integrity; The text data is generated based on the at least two text paragraphs.
8. The method according to claim 1, characterized in that The large language model is used to extract and aggregate the text data to obtain key knowledge, including: By using a large language model, knowledge is extracted from the text data to obtain a plurality of information entities and association relationships between the plurality of information entities; According to the information entity and the association relationship between the multiple information entities, each of the information entities is classified to obtain at least two knowledge block data; The knowledge block data with similarity or correlation are aggregated to generate the key knowledge.
9. The method according to claim 8, characterized in that The key knowledge also includes a knowledge graph. After the text data is subjected to knowledge extraction through a large language model to obtain a plurality of information entities and the association relationship between the plurality of information entities, the method further includes: A knowledge graph is generated based on the multiple information entities and the association relationships between the multiple information entities.
10. The method according to claim 8, characterized in that The method of extracting knowledge from the text data by using a large language model to obtain multiple information entities and the association relationships between the multiple information entities includes: The text data in different fields are associated with knowledge points by using a large language model based on the field information of the text data, wherein the field information is used to characterize the field to which the heterogeneous data corresponding to the text data belongs; The associated knowledge points are fused and extracted to obtain the corresponding information entities and the association relationships between multiple information entities.
11. A long text generation device, characterized in that: include: A processing module, configured to, in response to a generation instruction of a target long text, acquire multimodal data based on a retrieval enhanced generation technology, and process the multimodal data to generate text data, wherein the multimodal data is composed of at least two heterogeneous data with different data formats, and the text data is generated based on the content of each of the heterogeneous data and the contextual relationship between each of the heterogeneous data; An extraction module, used to extract and aggregate the text data using a large language model to obtain key knowledge, wherein the key knowledge is used to characterize at least two information entities and an association relationship between at least two of the information entities; A generation module is used to generate the target long text based on the key knowledge through the large language model.
12. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the long text generation method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the long text generation method according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the long text generation method according to any one of claims 1 to 10 is implemented.
Citation Information
Cited By
Data processing method and device based on large model, electronic equipment and medium
CN120929596A
Image generation anchor point construction method and system containing multi-dimensional constraint information
CN122287571A
Image generation anchor point construction method and system containing multi-dimensional constraint information
CN122287571B