Long text generation method and device, equipment, storage medium and computer program product

By generating a combination of long text outlines and text fragments, the problem of insufficient complexity and flexibility of long text generation in the existing technology is solved, and efficient and convenient personalized long text generation is achieved to meet user customization needs.

CN118940718APending Publication Date: 2024-11-12BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202410788709.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

When the existing text generation method generates long text that meets user needs, users need professional skills and high time investment, and the operation is complex and not flexible enough.

Method used

By generating a long text outline based on long text demand information, generating text fragments corresponding to chapter entries in response to received file data, and generating long text in combination with outline and fragments, providing units for outline generation, text fragment generation and long text generation, realizing the User-personalized and customized long text generation.

Benefits of technology

It realizes efficient and convenient generation of long texts, meets users' personalized needs, improves the flexibility and professionalism of text generation, and simplifies the creation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118940718A_ABST
    Figure CN118940718A_ABST
Patent Text Reader

Abstract

The invention provides a long text generation method and device, electronic equipment, a computer readable storage medium and a computer program product, and relates to the technical field of big data processing, in particular to the technical field of office intelligence. One specific embodiment of the method comprises the following steps: generating a long text outline based on long text demand information, wherein the long text outline comprises chapter items; in response to the received file data associated with the chapter entry, generating a text fragment corresponding to the chapter entry based on the file data; and generating a long text based on the long text outline and the text fragments corresponding to the chapter items. By applying the long text generation method provided by the embodiment of the invention, the long text meeting the personalized and customized requirements of the user can be flexibly, efficiently and conveniently generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of big data processing technology, in particular to the field of intelligent office technology, and specifically to a long text generation method and device, electronic equipment, computer-readable storage medium and computer program product. Background Art

[0002] In the field of text generation, generating long texts that meet user needs based on retrieved materials usually has certain operational and technical requirements, and usually requires users to have certain professional skills and time investment. Summary of the invention

[0003] The embodiments of the present disclosure propose a long text generation method and device, an electronic device, a computer-readable storage medium, and a computer program product, which can flexibly, efficiently, and conveniently generate long texts that meet the personalized and customized needs of users.

[0004] In a first aspect, an embodiment of the present disclosure proposes a long text generation method, comprising: generating a long text outline based on long text demand information, the long text outline including chapter entries; in response to receiving file data associated with the chapter entry, generating a text segment corresponding to the chapter entry based on the file data; generating a long text based on the long text outline and the text segment corresponding to the chapter entry.

[0005] In a second aspect, an embodiment of the present disclosure proposes a long text generation device, comprising: an outline generation unit, configured to generate a long text outline based on long text demand information, the long text outline including chapter entries; a text fragment generation unit, configured to generate a text fragment corresponding to the chapter entry based on the file data in response to receiving file data associated with the chapter entry; and a long text generation unit, configured to generate a long text based on the long text outline and the text fragment corresponding to the chapter entry.

[0006] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can implement the long text generation method described in any implementation method in the first aspect when executing.

[0007] In a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, which are used to enable a computer to implement the long text generation method described in any implementation manner in the first aspect when executed.

[0008] In a fifth aspect, an embodiment of the present disclosure provides a computer program product including a computer program, which, when executed by a processor, can implement the long text generation method described in any implementation manner in the first aspect.

[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0011] Figure 1 is an exemplary system architecture diagram in which the present disclosure may be applied;

[0012] Figure 2 A flowchart of a long text generation method provided by an embodiment of the present disclosure;

[0013] Figure 3 A flowchart of another long text generation method provided by an embodiment of the present disclosure;

[0014] Figure 4 A flowchart of a specific application scenario of a long text generation method provided by an embodiment of the present disclosure;

[0015] Figure 5A and Figure 5B A user interface diagram of a specific application scenario of a long text generation method provided by an embodiment of the present disclosure;

[0016] Figure 6 A structural block diagram of a long text generation device provided by an embodiment of the present disclosure;

[0017] Figure 7 A schematic diagram of the structure of an electronic device suitable for executing a long text generation method provided in an embodiment of the present disclosure. Specific embodiments

[0018] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the embodiments in the present disclosure and the features in the embodiments may be combined with each other without conflict.

[0019] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0020] Figure 1 An exemplary system architecture 100 is shown to which embodiments of the long text generation method and apparatus, electronic device, and computer-readable storage medium of the present disclosure can be applied.

[0021] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0022] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 and server 105 can be installed with various applications for realizing information communication between the two, such as long text generation applications.

[0023] Terminal devices 101, 102, 103 and server 105 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc.; when terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules, or as a single software or software module, and no specific limitation is made here. When server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server; when the server is software, it can be implemented as multiple software or software modules, or as a single software or software module, and no specific limitation is made here.

[0024] The server 105 can provide various services through various built-in applications. Taking the long text generation application that can provide users with long text generation services as an example, the server 105 can achieve the following effects when running the long text generation application: the outline generation unit generates a long text outline including chapter entries according to the long text demand information, the text fragment generation unit generates text fragments corresponding to the chapter entries according to the file data in response to receiving file data associated with the chapter entries, and the long text generation unit generates a long text according to the long text outline and the text fragments corresponding to the chapter entries.

[0025] Among them, the user can input or upload long text demand information through the terminal device, and then send the long text demand information to the server 105 via the network 104. After generating the long text outline, the server 105 can return the long text outline to the terminal device through the network 104 for presentation to the user. The user can further input or upload file data associated with the chapter entry through the terminal device, and then send the file data to the server 105 via the network 104. After generating the long text, the server 105 can return the long text to the terminal device through the network 104 for presentation to the user.

[0026] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided as required. In the present disclosure, long text may refer to any text data with a long length and containing more text content, such as text data with a text length greater than 512 characters.

[0027] Please refer to Figure 2 , Figure 2 A flowchart of a long text generation method provided in an embodiment of the present disclosure, wherein process 200 includes the following steps:

[0028] Step 201: Generate a long text outline based on the long text requirement information, where the long text outline includes chapter entries;

[0029] This step is intended to generate the execution body of the method from long text, such as Figure 1 The server 105 shown generates a corresponding long text outline according to the long text demand information, and the long text outline includes chapter entries. The embodiment of the present disclosure does not limit the implementation method of generating the corresponding long text outline according to the long text demand information. For example, the long text outline can be generated according to the long text demand information using the historically generated outline; or the long text outline can be generated according to the long text demand information using a preset outline template.

[0030] The long text requirement information is information related to the long text to be generated, and may include long text subject information and / or reference files. The embodiment of the present disclosure does not limit the form of the long text requirement information. Figure 1 The terminal device shown in the figure inputs the long text subject information, and the server 105 can generate a corresponding long text outline according to the long text subject information input by the user, and Figure 1 The terminal device shown in the figure presents the generated long text outline to the user. For another example, the user can Figure 1The terminal device shown in FIG. 1 uploads a reference file, and the server 105 determines the subject of the reference file by analyzing the reference file uploaded by the user, and generates a corresponding long text outline according to the subject of the reference file, and generates a long text outline according to the subject of the reference file. Figure 1 The terminal device shown in the figure presents the generated long text outline to the user. For another example, the user can Figure 1 The terminal device shown in the figure inputs the long text subject information and uploads the reference file. The server 105 generates the corresponding long text outline according to the long text subject information input by the user and the uploaded reference file, and Figure 1 The terminal device shown presents the generated long text outline to the user. The present disclosure provides a variety of forms of long text requirement information, which can provide greater flexibility for the generation of long texts.

[0031] Optionally, after the long text outline is generated and presented to the user, the user can also change the generated long text outline to make the generated long text outline better meet his needs. Therefore, the long text generation method can also include: in response to receiving an outline change request, generating a new long text outline based on the long text requirement information to update the long text outline. For example, the user can Figure 1 The terminal device sends an outline change request, and the server 105 can generate a new long text outline according to the long text requirement information in response to the received outline change request, and Figure 1 The terminal device shown presents the generated new long text outline to the user, thereby replacing the generated long text outline. The new long text outline is different from the previously generated long text outline, for example, the number of chapters is different, the chapter titles are different, etc., which is not limited in the embodiments of the present disclosure.

[0032] Optionally, after the long text outline is generated and presented to the user, the user can replace the entire long text outline or only replace part of the structure in the long text outline. For example, the long text outline also includes a text title, and the user can replace the text title in the long text outline. Therefore, the long text generation method may also include: in response to receiving a text title replacement request, generating a new text title based on the long text requirement information to update the text title in the long text outline. For example, the user can Figure 1 The terminal device sends a text title change request, and the server 105 can generate a new text title according to the long text requirement information in response to the received text title change request, and Figure 1 The terminal device shown presents the generated new text title to the user, realizing the replacement of the text title in the long text outline. The new text title is different from the previously generated text title, for example, the scope of the title is different, the angle of the title is different, etc., which is not limited in the embodiments of the present disclosure.

[0033] Optionally, after the long text outline is generated and presented to the user, the user can not only replace the entire long text outline or part of the structure in the long text outline, but also adjust only part of the structure in the long text outline. For example, the user can add or delete chapter items in the long text outline, or downgrade or upgrade chapter items in the long text outline. For another example, the user can modify and adjust the text title in the long text outline, or modify and adjust the chapter title of the chapter item in the long text outline. The embodiments of the present disclosure are not limited to this.

[0034] Step 202: In response to receiving file data associated with a chapter entry, generating a text segment corresponding to the chapter entry based on the file data;

[0035] On the basis of step 201, this step is intended for the above-mentioned execution subject to generate a text segment corresponding to the chapter entry according to the file data in response to receiving the file data associated with the chapter entry, as the corresponding chapter text. The embodiments of the present disclosure do not limit the implementation method of generating the text segment corresponding to the chapter entry according to the file data. For example, information retrieval can be performed based on the file data, and the text segment corresponding to the chapter entry can be generated based on the retrieved information and the file data; or key description information for the chapter entry can be generated based on the file data, and then information retrieval can be performed based on the key description information, and the text segment corresponding to the chapter entry can be generated based on the retrieved information and the file data.

[0036] The file data is data related to the text segment to be generated for the chapter entry, and may include information and / or reference files associated with the chapter entry. The embodiment of the present disclosure does not limit the form of the file data. Figure 1 The terminal device shown in FIG. 1 enters information associated with a chapter entry under the chapter entry, and the server 105 can generate a text segment corresponding to the chapter entry based on the information associated with the chapter entry entered by the user. Figure 1 The terminal device shown in FIG. 1 uploads a reference file under a chapter entry, and the server 105 can generate a text segment corresponding to the chapter entry based on the reference file uploaded by the user. Figure 1 The terminal device shown inputs information associated with the chapter entry and uploads a reference file under the chapter entry, and the server 105 can generate a text segment corresponding to the chapter entry according to the information associated with the chapter entry input by the user and the uploaded reference file.

[0037] Optionally, generating a text segment corresponding to a chapter entry based on file data in step 202 may include the following steps: generating an outline based on the long text outline and the file data associated with the chapter entry, wherein the outline outline includes key description information of the chapter entry; generating a text segment corresponding to the chapter entry based on the file data and the key description information. For example, the key description information of the chapter entry may be generated using a preset professional knowledge base based on the file data associated with the chapter entry, and the outline outline may be formed based on the long text outline and the key description information, wherein the preset professional knowledge base may improve the key description information of the chapter entry based on the file data. For example, information retrieval may be performed based on the key description information of each chapter entry, and a text segment corresponding to the chapter entry may be generated based on the retrieved information and the file data of the chapter entry, wherein the key description information may be used to determine the keywords and key points of the chapter entry, so as to perform information retrieval using the keywords and key points. By first generating the key description information of the chapter entry, and then generating the text segment corresponding to the chapter entry, the generation process of the long text may be refined, and the professionalism of the generated long text may be improved to make it more in line with the needs of users.

[0038] Optionally, the file data may include one or more of text data, image data, and table data. The embodiments of the present disclosure do not limit the type of file data, wherein text data is structured data, and image data and table data are unstructured data. In step 202, in the process of generating text segments corresponding to chapter entries, structured data and unstructured data may also be converted, which may enrich the content of the long text and improve the readability of the long text.

[0039] For example, step 202 may also include the following steps: inserting the image data in the file data into the text segment corresponding to the chapter entry; and / or inserting the table data in the file data into the text segment corresponding to the chapter entry. If the file data includes image data, in the process of generating the text segment corresponding to the chapter entry, the image data may be converted into structured data, and the position where the converted data is to be inserted is determined according to the text segment corresponding to the chapter entry, and the converted data is inserted to present the image data. If the file data includes table data, in the process of generating the text segment corresponding to the chapter entry, the table data may be converted into structured data, and the position where the converted data is to be inserted is determined according to the text segment corresponding to the chapter entry, and the converted data is inserted to present the table data. The embodiments of the present disclosure do not limit the implementation method of the format conversion of image data and table data.

[0040] For another example, step 202 may also include the following steps: converting the data description information in the text data that meets the requirements of the chart into the chart data and inserting it into the text segment corresponding to the chapter entry; and / or converting the data description information in the text data that meets the requirements of the formula into the formula data and inserting it into the text segment corresponding to the chapter entry. Wherein, the chart data and the formula data are unstructured data. If the text data includes data description information that meets the requirements of the chart, in the process of generating the text segment corresponding to the chapter entry, the data description information that meets the requirements of the chart can be converted into the chart data, and the position of inserting the converted data is determined according to the text segment corresponding to the chapter entry. The converted data is inserted and presented in the form of chart data, such as a pie chart, a bar chart, a line chart, etc. If the text data includes data description information that meets the requirements of the formula, in the process of generating the text segment corresponding to the chapter entry, the data description information that meets the requirements of the formula can be converted into the formula data, and the position of inserting the converted data is determined according to the text segment corresponding to the chapter entry. The converted data is inserted and presented in the form of formula data. The embodiments of the present disclosure do not limit the implementation method of converting text data into chart data and formula data.

[0041] Step 203: Generate a long text based on the long text outline and the text segments corresponding to the chapter entries.

[0042] On the basis of step 202, this step aims to combine the long text outline and the text fragments corresponding to the chapter entries by the above-mentioned execution subject according to the long text outline and the text fragments corresponding to the chapter entries to generate a long text that meets the requirements. The embodiment of the present disclosure does not limit the type of long text. For example, the long text can be a paper, a teaching plan, or a summary that meets different requirements. For another example, after the server 105 generates a long text according to the long text outline and the text fragments corresponding to the chapter entries, it can be generated by Figure 1 The terminal device shown presents the generated long text to the user.

[0043] Optionally, the long text generation method may further include the following steps: polishing the long text to make the generated long text more professional; and / or formatting the long text to make the generated long text more in line with the format requirements of the long text. For example, by polishing the generated long text, unnecessary logical words such as first, second, and last, etc. that appear in the long text can be removed, unnecessary repetitive content in the long text can be removed, and the content of the long text can be made more in line with the facts. Among them, the format of the long text can be determined according to the type of the long text, and the format adjustment of the long text can be determined according to the type of the long text, the generation method of the long text, etc. The embodiments of the present disclosure are not limited to this. For example, by formatting the generated long text, the chapter entries in the long text outline can be corrected to a standard chapter directory, and references, statements, etc. can be added after the long text.

[0044] Optionally, generating text fragments corresponding to chapter entries based on file data in step 202 may include: generating text fragments corresponding to multiple chapter entries based on file data associated with each of the multiple chapter entries, wherein at least one chapter entry corresponds to at least two text fragments; step 203 generating a long text based on the long text outline and the text fragments corresponding to the chapter entries may include: generating at least two long texts based on the long text outline and the text fragments corresponding to each of the multiple chapter entries. The long text generation method may also include: reviewing at least two long texts, outputting the long text with the highest score according to the review score of each long text, so as to preferentially process the generated long texts, thereby making the generated long texts more professional. The embodiments of the present disclosure do not limit the review criteria, for example, the long text may be reviewed from the dimensions of professionalism, factuality, etc.

[0045] Optionally, for a chapter entry, at least two corresponding text segments can be generated based on the parameters for generating text segments preset in the chapter entry. For example, the parameters for generating text segments preset can be diversity parameters, such as synonyms, near-synonyms, etc., or punitive parameters, such as banned words, etc. For example, for a chapter entry, a first corresponding text segment can be generated based on synonyms, and a second corresponding text segment can be generated based on near-synonyms. For another example, for a chapter entry, a first corresponding text segment can be generated based on a part of banned words, and a second corresponding text segment can be generated based on another part of banned words. Optionally, for a chapter entry, at least two corresponding text segments can be generated based on keywords for searching the chapter entry. For example, for a chapter entry, a first corresponding text segment can be generated by searching based on a part of keywords, and a second corresponding text segment can be generated by searching based on another part of keywords.

[0046] The long text generation method 200 provided by the embodiment of the present disclosure generates a long text outline including chapter entries based on long text demand information, generates text fragments corresponding to the chapter entries based on the file data in response to receiving file data associated with the chapter entries, and generates long text based on the long text outline and the text fragments corresponding to the chapter entries. It can not only automatically generate long text according to the long text demand information provided by the user, but also allow the user to provide file data under the chapter entries in the long text outline, and generate unique professional long text according to the file data, which gives great flexibility to long text generation, can meet the user's urgent needs for personalized and customized long text generation, and make the creation of long text more efficient and convenient.

[0047] Please refer to Figure 3 , Figure 3 A flowchart of another long text generation method provided in an embodiment of the present disclosure, namely, for Figure 2 Step 202 in the process 200 shown provides a specific implementation method, and other steps in the process 200 are not adjusted. The specific implementation method provided by this embodiment is replaced by step 202 to obtain a new complete embodiment.

[0048] The process 300 includes the following steps:

[0049] Step 301: Generate a long text outline based on the long text requirement information, where the long text outline includes chapter entries;

[0050] In some optional embodiments, this step is intended to be performed by the execution subject of the long text generation method, such as Figure 1 The server 105 shown inputs the long text demand information into the fine-tuning model, and generates a long text outline according to the historically generated outline through the fine-tuning model. If the user needs to replace the generated long text outline, a new long text outline can be generated according to the generated long text outline through the fine-tuning model using the historically generated outline. Among them, the long text outline generated by the fine-tuning model can meet the preset requirements for generating a long text outline, for example, the chapters of the generated outline are not repeated, the description information under each chapter item of the generated outline does not exceed 20 words, and the generated outline needs to include secondary and tertiary titles, etc. Optionally, if the user needs to replace the text title in the generated long text outline, a new text title can also be generated according to the text title in the generated long text outline through the fine-tuning model using the historically generated text title.

[0051] Step 302: input the long text outline and document data into the large language model guided by the small sample prompts, and generate the outline outline using the preset professional knowledge base;

[0052] On the basis of step 301, this step is intended to have the above-mentioned execution subject input the long text outline and file data into a large language model guided by few-shot prompting, and generate an outline outline using a preset professional knowledge base. Among them, before each outline outline is generated, the large language model needs to be guided by few-shot prompting so that the generated outline outline can strictly comply with the format of the outline. The file data may include information associated with the chapter entry edited and input by the user under the chapter entry of the long text outline, and may also include reference files uploaded by the user under the chapter entry of the long text outline, such as reference files in word, pdf, excel, png and other formats. Compared with the descriptive information under each chapter entry in the outline in step 301, the key description information under each chapter entry in the outline outline describes the chapter in more detail, and the key description information can determine the keywords and main points of the chapter.

[0053] Step 303: perform information retrieval using the key description information, and generate a text segment corresponding to the chapter entry based on the retrieved information and the file data;

[0054] In some optional embodiments, based on step 302, this step aims to split each chapter entry in the outline by the above-mentioned execution subject, and input the file data and key description information of each chapter entry obtained by splitting into a large language model that has been fine-tuned (Supervised Fine-Tun-ing, referred to as SFT), and use the key description information of the current chapter entry to determine the keywords and key points of the chapter entry, so as to use the keywords and key points to perform information retrieval, and generate a text segment corresponding to the current chapter entry based on the retrieved information and the file data of the current chapter entry. Among them, supervised fine-tuning of the large language model can ensure the effect of text segment generation, so that the text segment corresponding to each chapter entry can meet the preset requirements for generating text segments, such as the word count requirement of the generated text segment is within 1,500 words, and the generated text segment starts from the current chapter entry, and does not generate the content of other chapter entries.

[0055] Among them, the supervised fine-tuning large language model also stipulates the format of inserting data description information that meets the requirements of charts and data description information that meets the requirements of formulas in image data, table data, and text data. For example, the generated text fragment needs to refer to the image data included in the file data, and the image data can be inserted in the following format: "Figure: XXX architecture diagram,! [image description caption] (image url)--image". The text data that the generated text fragment needs to refer to includes data description information that meets the requirements of charts, and the data description information that meets the requirements of charts can be generated into a corresponding json string: {"caption":"Chart N Baidu operating cash flow (100 million RMB)","columns":["time","year-on-year (%)"],"data":[["2018FY",0]]} for insertion. The insertion of data description information that meets the requirements of formulas can refer to the insertion of data description information that meets the requirements of charts, so it will not be repeated here.

[0056] Step 304: Generate a long text based on the long text outline and the text segments corresponding to the chapter entries.

[0057] On the basis of step 303, this step aims to combine the long text outline and the text fragments corresponding to the chapter entries by the above-mentioned execution subject to generate a long text consisting of a catalog of chapters and a chapter text. In some optional embodiments, the above-mentioned execution subject can also polish and select the generated long text. For example, the long text can be input into a large language model for polishing. For example, the text fragments corresponding to each of the multiple chapter entries can be generated according to the file data associated with each of the multiple chapter entries, and at least one of the chapter entries corresponds to at least two text fragments, so that at least two long texts can be generated according to the long text outline and the text fragments corresponding to each of the multiple chapter entries, and at least two long texts can be input into the selection model for review, and the long text with the highest score can be output according to the review score of each long text. Since the two long texts are generated by artificial intelligence (AI for short), the characteristics or style of the text generated by artificial intelligence, that is, AI flavor, can be used as a dimensional review indicator when reviewing the long text. For example, the review result can be output as a json string, such as: {"best long text": long text 1}.

[0058] Step 305: Perform format adjustment processing on the long text.

[0059] In some optional embodiments, based on step 304, this step is intended to remove some content generated by the large language model by the above-mentioned execution subject, such as (Note: the above content | (Note: due to word limit | (Note: due to | due to the rigor of academic research); correct the chapter entries to a standard chapter list, such as "##Introduction" is corrected to "Chapter 1 Introduction", "### Research Purpose and Significance" is corrected to "1.1 Research Purpose and Significance"; add references and statements after the long text.

[0060] To deepen understanding, this disclosure combines a specific application scenario and provides a specific implementation solution: please refer to Figure 4 , Figure 5A and Figure 5B , Figure 4 A flowchart of a specific application scenario of a long text generation method provided by an embodiment of the present disclosure, Figure 5A and Figure 5B A user interface diagram of a specific application scenario of a long text generation method provided in an embodiment of the present disclosure.

[0061] in,

[0062] Step 401: Generate a long text outline based on the long text requirement information, the long text outline includes a text title and chapter entries. Figure 5A As shown, the user interface of the terminal device provides two ways to generate long texts according to long text demand information, wherein the left side 501 is to generate long texts through long text subject information input by the user, and the right side 502 is to generate long texts through reference files uploaded by the user. When the long text subject information input by the user is selected to generate long texts, and the long text subject information "large model" is input in the input box 503 of the user interface, the button 504 is clicked to generate a long text outline, and the generated long text outline is presented to the user in the user interface of the terminal device, as shown in FIG. Figure 5B As shown, the user can replace or adjust the generated long text outline according to their needs, such as replacing the text title or replacing the outline.

[0063] Step 402: The user may provide file data associated with the chapter entry under the chapter entry of the long text outline. The file data may include reference files uploaded by the user and / or information associated with the chapter entry input by the user. Figure 5BAs shown, the user uploaded four reference files under the chapter entry "1.1 Research Background and Significance" of the long text outline, namely, word file 505, pdf file 506, excel file 507 and txt file 508. After the user uploads the reference files under the chapter entry of the long text outline and / or enters the information associated with the chapter entry, the user can execute steps 403 to 406 to generate a long text. For example, the long text can be directly generated by clicking a button to execute the above steps, and the generated long text is presented to the user in the user interface of the terminal device.

[0064] Among them, step 403: in response to receiving the file data associated with the chapter entry, an outline outline is generated based on the long text outline and the file data associated with the chapter entry, and the outline outline includes key description information of the chapter entry; step 404: based on the file data and the key description information, a text segment corresponding to the chapter entry is generated, and a long text is generated based on the long text outline and the text segment corresponding to the chapter entry; step 405: polishing and / or selecting the long text; step 406: formatting the long text.

[0065] In the process of generating the long text, the Excel file 507 can be converted into the JSON format and inserted into the text segment corresponding to the chapter entry. The data description information in the Word file 505 that meets the chart requirements can be converted into chart data and inserted into the text segment corresponding to the chapter entry. The long text is formatted, for example, the long text in the JSON format can be mapped into a standard paper format, that is, including a table of contents and a chapter body.

[0066] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure also provides an embodiment of a long text generation device, and the long text generation device embodiment is Figure 2 The above device can be applied to various electronic devices.

[0067] like Figure 6 As shown, the long text generation device 600 of this embodiment may include: an outline generation unit 601, a text segment generation unit 602 and a long text generation unit 603. The outline generation unit 601 is configured to generate a long text outline based on long text requirement information, and the long text outline includes chapter entries; the text segment generation unit 602 is configured to generate a text segment corresponding to the chapter entry based on the file data in response to receiving file data associated with the chapter entry; the long text generation unit 603 is configured to generate a long text based on the long text outline and the text segment corresponding to the chapter entry.

[0068] In this embodiment, in the long text generation device 600, the specific processing of the outline generation unit 601, the text segment generation unit 602 and the long text generation unit 603 and the technical effects thereof can be referred to in Figure 2 The relevant descriptions of each step in the embodiment corresponding to FIG5 will not be repeated here.

[0069] This embodiment exists as an apparatus embodiment corresponding to the above-mentioned method embodiment. The long text generation device 600 provided in this embodiment can not only automatically generate a long text according to the long text demand information provided by the user, but also allow the user to provide file data under the chapter entry in the long text outline, and generate a unique professional long text according to the file data, which gives great flexibility to the long text generation, can meet the user's urgent needs for personalized and customized long text generation, and make the creation of long text more efficient and convenient.

[0070] In some optional implementations of the present embodiment, the text fragment generation unit 602 may include: an outline outline generation subunit, configured to generate an outline outline based on the long text outline and file data associated with the chapter entry, wherein the outline outline includes key description information of the chapter entry; and a text fragment generation subunit, configured to generate a text fragment corresponding to the chapter entry based on the file data and the key description information.

[0071] In some optional implementations of this embodiment, the file data includes one or more of the following: text data, image data, and table data; the text segment generation unit 602 can also be configured to: insert the image data in the file data into the text segment corresponding to the chapter entry; and / or insert the table data in the file data into the text segment corresponding to the chapter entry.

[0072] In some optional implementations of this embodiment, the text fragment generation unit 602 can also be configured to: convert data description information in the text data that meets the chart requirements into a text fragment corresponding to the chart data inserted into the chapter entry; and / or, convert data description information in the text data that meets the formula requirements into a text fragment corresponding to the formula data inserted into the chapter entry.

[0073] In some optional implementations of this embodiment, the outline generation subunit may be further configured to: input the long text outline and file data into a large language model guided by a small number of sample prompts, and generate an outline using a preset professional knowledge base.

[0074] In some optional implementations of this embodiment, the text segment generating subunit may be further configured to: perform information retrieval using key description information, and generate text segments corresponding to chapter entries based on the retrieved information and file data.

[0075] In some optional implementations of this embodiment, the long text generation device 600 may further include: a polishing unit and / or a format adjustment unit. The polishing unit may be configured to perform polishing on the long text; and the format adjustment unit may be configured to perform format adjustment on the long text.

[0076] In some optional implementations of this embodiment, the polishing processing unit may be further configured to: input the long text into the large language model for polishing processing.

[0077] In some optional implementations of this embodiment, the text fragment generation unit 602 can be further configured to: generate text fragments corresponding to each of the multiple chapter entries based on the text data associated with each of the multiple chapter entries, wherein at least one chapter entry corresponds to at least two text fragments; the long text generation unit 603 can be further configured to: generate at least two long texts based on the long text outline and the text fragments corresponding to each of the multiple chapter entries; the optimal processing unit can be further configured to: review the at least two long texts, and output the long text with the highest score based on the review score of each long text.

[0078] In some optional implementations of this embodiment, the long text requirement information includes long text subject information and / or reference files.

[0079] In some optional implementations of this embodiment, the outline generating unit 601 may also be configured to: in response to receiving an outline change request, generate a new long text outline based on the long text requirement information to update the long text outline.

[0080] In some optional implementations of this embodiment, the long text outline also includes a text title; the outline generation unit 601 can also be configured to: in response to receiving a text title change request, generate a new text title based on the long text requirement information to update the text title in the long text outline.

[0081] In some optional implementations of this embodiment, the outline generating unit 601 may be further configured to: input the long text requirement information into the fine-tuning model, and generate a long text outline according to the outlines generated historically.

[0082] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the long text generation method described in any of the above embodiments can be implemented when the at least one processor executes.

[0083] According to an embodiment of the present disclosure, the present disclosure further provides a readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to implement the long text generation method described in any of the above embodiments when executed.

[0084] An embodiment of the present disclosure provides a computer program product, which, when executed by a processor, can implement the long text generation method described in any of the above embodiments.

[0085] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0086] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0087] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0088] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the long text generation method. For example, in some embodiments, the long text generation method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the long text generation method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the long text generation method in any other appropriate manner (e.g., by means of firmware).

[0089] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0090] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0091] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0092] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0093] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with embodiments of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0094] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0095] The technical solution of the disclosed embodiment generates a long text outline including chapter entries based on long text demand information, generates text fragments corresponding to the chapter entries based on the file data in response to receiving file data associated with the chapter entries, and generates long text based on the long text outline and the text fragments corresponding to the chapter entries. It can not only automatically generate long text according to the long text demand information provided by the user, but also allow the user to provide file data under the chapter entries in the long text outline, and generate unique professional long text according to the file data, which gives great flexibility to long text generation, can meet the user's urgent needs for personalized and customized long text generation, and make the creation of long text more efficient and convenient.

[0096] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0097] The above specific embodiments do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A long text generation method, include: Generate a long text outline based on the long text requirement information, wherein the long text outline includes chapter entries; In response to receiving the file data associated with the chapter entry, generating a text segment corresponding to the chapter entry based on the file data; A long text is generated based on the long text outline and the text segments corresponding to the chapter entries.

2. The long text generation method according to claim 1, in, The step of generating the text segment corresponding to the chapter entry based on the file data includes: Generate an outline based on the long text outline and the file data associated with the chapter entry, wherein the outline outline includes key description information of the chapter entry; A text segment corresponding to the chapter entry is generated based on the file data and the key description information.

3. The long text generation method according to claim 2, in, The file data includes one or more of the following: text data, image data, table data; The method further comprises: Inserting the picture data in the file data into the text segment corresponding to the chapter entry; And / or, inserting the table data in the file data into the text segment corresponding to the chapter entry.

4. The long text generation method according to claim 3, further comprising: include: Converting data description information in the text data that meets the requirements of the chart into chart data and inserting it into the text segment corresponding to the chapter entry; And / or, converting the data description information in the text data that meets the formula requirements into formula data and inserting it into the text segment corresponding to the chapter entry.

5. The long text generation method according to claim 2, in, The generating an outline based on the long text outline and the file data associated with the chapter entry comprises: The long text outline and the file data are input into a large language model guided by a small number of sample prompts, and the outline outline is generated using a preset professional knowledge base.

6. The long text generation method according to claim 2, in, The step of generating a text segment corresponding to the chapter entry based on the file data and the key description information includes: Information retrieval is performed using the key description information, and a text segment corresponding to the chapter entry is generated based on the retrieved information and the file data.

7. The long text generation method according to any one of claims 1 to 6, further comprising: include: Polishing the long text; And / or, format adjustment is performed on the long text.

8. The long text generation method according to claim 7, in, The polishing of the long text includes: The long text is input into a large language model for polishing.

9. The long text generation method according to any one of claims 1 to 6, in, The step of generating the text segment corresponding to the chapter entry based on the file data includes: Based on the file data respectively associated with the plurality of chapter entries, respectively generate a plurality of text segments corresponding to the chapter entries, wherein at least one of the chapter entries corresponds to at least two text segments; The generating of the long text based on the long text outline and the text segments corresponding to the chapter entries includes: Generate at least two of the long texts based on the long text outline and the text segments corresponding to the multiple chapter entries; The method further includes: reviewing at least two of the long texts, and outputting the long text with the highest score according to the review score of each of the long texts.

10. The long text generation method according to any one of claims 1 to 6, in, The long text requirement information includes long text subject information and / or reference documents.

11. The long text generation method according to any one of claims 1 to 6, further comprising: include: In response to receiving the outline change request, a new long text outline is generated based on the long text requirement information to update the long text outline.

12. The long text generation method according to any one of claims 1 to 6, in, The long text outline also includes a text title; The method further comprises: In response to receiving a text title replacement request, a new text title is generated based on the long text requirement information to update the text title in the long text outline.

13. The long text generation method according to any one of claims 1 to 6, in, The generating of the long text outline based on the long text requirement information includes: The long text requirement information is input into a fine-tuning model, and the long text outline is generated according to the outlines generated historically.

14. A long text generation device, include: An outline generating unit, configured to generate a long text outline based on the long text requirement information, wherein the long text outline includes chapter entries; a text segment generating unit, configured to generate a text segment corresponding to the chapter entry based on the file data in response to receiving the file data associated with the chapter entry; The long text generating unit is configured to generate a long text based on the long text outline and the text segments corresponding to the chapter entries.

15. The long text generating device according to claim 14, in, The text segment generating unit comprises: An outline generation subunit is configured to generate an outline based on the long text outline and the file data associated with the chapter entry, wherein the outline includes key description information of the chapter entry; The text segment generating subunit is configured to generate a text segment corresponding to the chapter entry based on the file data and the key description information.

16. The long text generating device according to claim 15, in, The file data includes one or more of the following: text data, image data, table data; The text segment generating unit is further configured to: Inserting the picture data in the file data into the text segment corresponding to the chapter entry; And / or, inserting the table data in the file data into the text segment corresponding to the chapter entry.

17. The long text generation device according to claim 16, wherein the text segment generation unit is further configured to: Converting data description information in the text data that meets the requirements of the chart into chart data and inserting it into the text segment corresponding to the chapter entry; And / or, converting the data description information in the text data that meets the formula requirements into formula data and inserting it into the text segment corresponding to the chapter entry.

18. The long text generating device according to claim 15, in, The outline generation subunit is further configured to input the long text outline and the file data into a large language model guided by a small number of sample prompts, and generate the outline using a preset professional knowledge base.

19. The long text generating device according to claim 15, in, The text segment generating subunit is further configured to perform information retrieval using the key description information, and generate a text segment corresponding to the chapter entry based on the retrieved information and the file data.

20. The long text generation device according to any one of claims 14 to 19, further comprising: include: A polishing unit, configured to perform polishing on the long text; And / or, the format adjustment unit is configured to perform format adjustment processing on the long text.

21. The long text generating device according to claim 20, in, The polishing processing unit is further configured to input the long text into a large language model for polishing processing.

22. The long text generating device according to any one of claims 14 to 19, in, The text segment generating unit is further configured to generate text segments corresponding to a plurality of chapter entries respectively based on the file data respectively associated with the plurality of chapter entries, wherein at least one of the chapter entries corresponds to at least two text segments; The long text generation unit is further configured to generate at least two of the long texts based on the long text outline and the text segments corresponding to the plurality of chapter entries; The device also includes: The optimal processing unit is configured to review at least two of the long texts and output the long text with the highest score according to the review score of each of the long texts.

23. The long text generating device according to any one of claims 14 to 19, in, The long text requirement information includes long text subject information and / or reference documents.

24. The long text generating device according to any one of claims 14 to 19, wherein the outline generating unit is further configured to generate a new long text outline based on the long text requirement information in response to receiving an outline change request, so as to update the long text outline.

25. The long text generating device according to any one of claims 14 to 19, in, The long text outline also includes a text title; The outline generating unit is further configured to generate a new text title based on the long text requirement information in response to receiving a text title replacement request, so as to update the text title in the long text outline.

26. The long text generation method according to any one of claims 14 to 19, in, The outline generating unit is further configured to input the long text requirement information into a fine-tuning model and generate the long text outline according to the outline generated historically.

27. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the long text generation method according to any one of claims 1 to 13.

28. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the long text generation method according to any one of claims 1 to 13.

29. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the long text generation method according to any one of claims 1 to 13 are implemented.

Citation Information

Patent Citations

  • Natural language text generation method and device, electronic equipment and readable storage medium

    CN116796708A

  • Powerpoint generation method and device, electronic equipment and storage medium

    CN117436414A

  • Literature review generation method based on large language model

    CN117709306A

  • Long text generation method and device

    CN117743567A

  • Method for generating article content and electronic equipment

    CN117875274A

Cited By

  • Bidding file generation method and device, equipment and storage medium

    CN120068838A

  • Controllable and credible large-model article generation method, system and device and medium

    CN121256018A

  • Long-text generation method and apparatus, and device, storage medium and computer program product

    EP4715660A1