Long-text generation method and apparatus, and device, storage medium and computer program product
By generating long text outlines and using a large language model to generate chapter entry text fragments, the problem of complex user operations in existing technologies is solved, and flexible and efficient long text generation is achieved.
Patent Information
- Application Number
- PCT/CN2024/107321
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-18
- Filing Date
- 2024-07-24
- Publication Date
- 2025-12-26
AI Technical Summary
Existing technologies are time-consuming and require users to have professional skills when generating long texts that meet user personalization and customization needs.
By generating long text outlines, responding to the file data associated with chapter entries, using a large language model to generate text fragments corresponding to chapter entries, and combining polishing and formatting adjustments, personalized generation of long texts is achieved.
It enables the flexible and efficient generation of long texts that meet user needs, improving creation efficiency and convenience.
Smart Images

Figure CN2024107321_26122025_PF_FP_ABST
Abstract
Description
Long text generation method and device, equipment, storage medium and computer program product
[0001] Cross-reference to Related Applications
[0002] The present patent application claims priority to the Chinese patent application No. 202410788709.6, filed on June 18, 2024, and entitled "Long text generation method and device, equipment, storage medium and computer program product", the entire contents of which are incorporated herein by reference. TECHNICAL FIELD
[0003] The present disclosure relates to the technical field of big data processing, in particular to the technical field of office intelligentization, and specifically to a long text generation method and device, an electronic device, a computer readable storage medium and a computer program product. BACKGROUND
[0004] In the field of text generation, generating a long text meeting the user's demand based on the retrieved materials usually requires certain operation requirements and technical requirements, and the user usually needs to have certain professional skills and time investment.
[0005] SUMMARY
[0006] The present disclosure provides 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 a long text meeting the user's individualized and customized demand.
[0007] In one or more embodiments, a long text generation method is provided, including: generating a long text outline based on long text demand information, the long text outline including chapter items; in response to receiving file data associated with a chapter item, generating a text segment corresponding to the chapter item based on the file data; and generating a long text based on the long text outline and the text segment corresponding to the chapter item.
[0008] In one or more embodiments, a long text generation device is provided, including: an outline generation unit configured to generate a long text outline based on long text demand information, the long text outline including chapter items; a text segment generation unit configured to, in response to receiving file data associated with a chapter item, generate a text segment corresponding to the chapter item based on the file data; and a long text generation unit configured to generate a long text based on the long text outline and the text segment corresponding to the chapter item.
[0009] In one or more embodiments, an electronic device is provided, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to implement the long text generation method as described in any implementation of the first aspect.
[0010] In one or more embodiments, a non-transitory computer-readable storage medium storing computer instructions is provided, and the computer instructions are used to enable a computer to implement the long text generation method as described in any implementation of the first aspect when the computer executes the computer instructions.
[0011] In one or more embodiments, a computer program product comprising a computer program is provided, and the computer program is capable of implementing the long text generation method as described in any implementation of the first aspect when executed by a processor.
[0012] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the disclosure, nor is it used to limit the scope of the disclosure. Other features of the disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS
[0013] Other features, objects, and advantages of the disclosure will become more apparent from the following detailed description of non-limiting embodiments made with reference to the drawings:
[0014] FIG. 1 is an exemplary system architecture diagram to which the present disclosure can be applied;
[0015] FIG. 2 is a flowchart of a long text generation method provided by an embodiment of the present disclosure;
[0016] FIG. 3 is a flowchart of another long text generation method provided by an embodiment of the present disclosure;
[0017] FIG. 4 is a flowchart of a specific application scenario of a long text generation method provided by an embodiment of the present disclosure;
[0018] FIGS. 5A and 5B are user interface diagrams of a specific application scenario of a long text generation method provided by an embodiment of the present disclosure;
[0019] FIG. 6 is a structural block diagram of a long text generation apparatus provided by an embodiment of the present disclosure;
[0020] FIG. 7 is a structural schematic diagram of an electronic device suitable for executing a long text generation method provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings, which are meant to be exemplary in nature, and include various details intended to facilitate understanding of the present disclosure. However, those skilled in the art will realize that the embodiments described herein are not the only embodiments that can be contemplated. Accordingly, various changes and modifications can be made to the embodiments described and illustrated herein, without departing from the scope and spirit of the present disclosure. Also, for the purpose of clarity and a concise description, descriptions of well-known functions and constructions are omitted herein. Note that the embodiments in the present disclosure and the features in the embodiments can be combined with each other as long as there is no conflict.
[0022] In the technical solutions of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information comply with relevant laws and regulations and do not violate public order and good customs.
[0023] FIG. 1 shows an exemplary system architecture 100 that can apply embodiments of the long text generation method and device, electronic device, and computer readable storage medium of the present disclosure.
[0024] As shown in FIG. 1, the system architecture 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium to provide a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0025] A user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. The terminal devices 101, 102, 103 and the server 105 can be installed with various applications for realizing information communication between them, such as long text generation applications, etc.
[0026] The terminal devices 101, 102, 103 and the server 105 can be hardware or software. When the terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, etc. When the terminal devices 101, 102, 103 are software, they can be installed in the above-mentioned electronic devices, and can be implemented as multiple software or software modules, or as a single software or software module, which is not specifically limited herein. When the 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 105 is software, it can be implemented as multiple software or software modules, or as a single software or software module, which is not specifically limited herein.
[0027] The server 105 can provide various services through various applications built-in, taking a long text generation application for providing long text generation service for users as an example, the server 105 can achieve the following effects when running the long text generation application: generating a long text outline including chapter entries by the outline generation unit according to long text demand information, generating text segments corresponding to chapter entries by the text segment generation unit in response to receiving file data associated with the chapter entries, and generating a long text by the long text generation unit according to the long text outline and the text segments corresponding to the chapter entries.
[0028] The user can input or upload long text demand information through a terminal device, and then send the long text demand information to the server 105 via the network 104, the server 105 can return the long text outline to the terminal device via the network 104 after generating the long text outline, and present the long text outline to the user, the user can further input or upload file data associated with the chapter entries through the terminal device, and then send the file data to the server 105 via the network 104, the server 105 can return the long text to the terminal device via the network 104 after generating the long text, and present the long text to the user.
[0029] It should be understood that the number of terminal devices, networks and servers in FIG. 1 is only illustrative. According to the needs of implementation, there can be any number of terminal devices, networks and servers. In this disclosure, long text can refer to any text data with a relatively long length and containing a large amount of text content, for example, text data with a text length greater than 512 characters.
[0030] Please refer to FIG. 2, which is a flowchart of a long text generation method provided by an embodiment of the present disclosure, wherein the flow 200 includes the following steps:
[0031] Step 201: generating a long text outline based on long text demand information, the long text outline including chapter entries;
[0032] This step aims to generate a corresponding long text outline according to long text demand information by the execution subject of the long text generation method, for example, the server 105 shown in FIG. 1, the long text outline including chapter entries. The embodiments of the present disclosure do not limit the implementation manner of generating a corresponding long text outline according to long text demand information. For example, the long text outline can be generated according to long text demand information by using a historically generated outline; or the long text outline can be generated according to long text demand information by using a preset outline template.
[0033] The long text demand information is information related to the long text to be generated, and can include long text topic information and / or reference files. Embodiments of the present disclosure do not limit the form of the long text demand information. For example, the user can input the long text topic information through the terminal device shown in FIG. 1, the server 105 can generate a corresponding long text outline according to the long text topic information input by the user, and present the generated long text outline to the user through the terminal device shown in FIG. 1. For another example, the user can upload a reference file through the terminal device shown in FIG. 1, the server 105 can determine the topic of the reference file by analyzing the reference file according to the reference file uploaded by the user, and generate a corresponding long text outline according to the topic of the reference file, and present the generated long text outline to the user through the terminal device shown in FIG. 1. For another example, the user can input the long text topic information and upload the reference file through the terminal device shown in FIG. 1, the server 105 can generate a corresponding long text outline according to the long text topic information input by the user and the reference file uploaded by the user, and present the generated long text outline to the user through the terminal device shown in FIG. 1. The present disclosure provides multiple forms of long text demand information, which can provide greater flexibility for long text generation.
[0034] Optionally, after the long text outline is generated and presented to the user, the user can also replace the generated long text outline to make the generated long text outline better meet his own needs. Therefore, the long text generation method can further include: in response to receiving an outline replacement request, generating a new long text outline based on the long text demand information to update the long text outline. For example, the user can issue an outline replacement request through the terminal device shown in FIG. 1, and the server 105 can generate a new long text outline according to the long text demand information in response to the received outline replacement request, and present the generated new long text outline to the user through the terminal device shown in FIG. 1, to realize replacement of the generated long text outline. The new long text outline is different from the long text outline generated before, for example, the number of chapters is different, the titles of chapters are different, etc., and embodiments of the present disclosure do not limit this.
[0035] Optionally, after the long text outline is generated and presented to the user, the user can replace only part of the structure in the long text outline in addition to replacing the entire 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 can further 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 issue a text title replacement request through the terminal device shown in FIG. 1, and the server 105 can generate a new text title according to the long text requirement information in response to the received text title replacement request, and present the generated new text title to the user through the terminal device shown in FIG. 1, to realize 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 range of the title is different, the angle of the title is different, etc., and the embodiments of the present disclosure do not limit this.
[0036] Optionally, after the long text outline is generated and presented to the user, the user can adjust only part of the structure in the long text outline in addition to replacing the entire long text outline or part of the structure in the long text outline. For example, the user can increase or delete adjustment of the chapter item in the long text outline, or downgrade or upgrade adjustment of the chapter item in the long text outline. For another example, the user can modify adjustment of the text title in the long text outline, or modify adjustment of the chapter title of the chapter item in the long text outline. The embodiments of the present disclosure do not limit this.
[0037] Step 202: in response to receiving file data associated with a chapter item, generating a text segment corresponding to the chapter item based on the file data;
[0038] On the basis of step 201, this step aims to generate, by the above-mentioned execution subject, a text segment corresponding to a chapter item according to file data associated with the chapter item, as the corresponding chapter body. The embodiments of the present disclosure do not limit the implementation manner of generating the text segment corresponding to the chapter item according to the file data. For example, information retrieval can be performed according to the file data, the text segment corresponding to the chapter item is generated according to the retrieved information and the file data; or key description information of the chapter item is generated according to the file data, information retrieval is performed according to the key description information, and the text segment corresponding to the chapter item is generated according to the retrieved information and the file data.
[0039] The file data is data related to a text segment to be generated for the chapter entry, and can include information associated with the chapter entry and / or a reference file. Embodiments of the present disclosure do not limit the form of the file data. For example, the user can input information associated with the chapter entry under the chapter entry through the terminal device shown in FIG. 1, and the server 105 can generate the text segment corresponding to the chapter entry according to the information associated with the chapter entry input by the user. For another example, the user can upload a reference file under the chapter entry through the terminal device shown in FIG. 1, and the server 105 can generate the text segment corresponding to the chapter entry according to the reference file uploaded by the user. For another example, the user can input information associated with the chapter entry under the chapter entry through the terminal device shown in FIG. 1 and upload a reference file, and the server 105 can generate the text segment corresponding to the chapter entry according to the information associated with the chapter entry input by the user and the reference file uploaded by the user.
[0040] Optionally, the generating of the text segment corresponding to the chapter entry based on the file data in step 202 can include the following steps: generating an outline profile based on the long text outline and the file data associated with the chapter entry, wherein the outline profile includes key description information of the chapter entry; and generating the 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 can be generated according to the file data associated with the chapter entry by using a preset professional knowledge base, and the outline profile can be formed according to the long text outline and the key description information, wherein the preset professional knowledge base can improve the key description information of the chapter entry according to the file data. For example, information retrieval can be performed according to the key description information of each chapter entry, and the text segment corresponding to the chapter entry can be generated according to the retrieved information and the file data of the chapter entry, wherein the key words and points of the chapter entry can be determined by using the key description information, so as to perform information retrieval by using the key words and 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 is refined, which can improve the professionalism of the generated long text and make it more in line with the needs of the user.
[0041] Optionally, the file data can include one or more of text data, picture data, and table data, and embodiments of the present disclosure do not limit the type of file data, wherein the text data is structured data, and the picture data and the table data are unstructured data. The structured data and the unstructured data can be converted in the process of generating the text segment corresponding to the chapter entry in step 202, which can enrich the content of the long text and improve the readability of the long text.
[0042] For example, step 202 can further include the following steps: inserting picture data in the file data into the text segment corresponding to the chapter entry; and / or, inserting table data in the file data into the text segment corresponding to the chapter entry. If the file data includes picture data, in the process of generating the text segment corresponding to the chapter entry, the picture data can be converted into structured data, and the converted data is inserted into the text segment corresponding to the chapter entry according to the position determined by the chapter entry, and the picture data is presented. If the file data includes table data, in the process of generating the text segment corresponding to the chapter entry, the table data can be converted into structured data, and the converted data is inserted into the text segment corresponding to the chapter entry according to the position determined by the chapter entry, and the table data is presented. The embodiments of the present disclosure do not limit the implementation manner of the conversion of picture data and table data formats.
[0043] For another example, step 202 can further include the following steps: converting data description information in the text data that meets the requirements of a chart into chart data and inserting the chart data into the text segment corresponding to the chapter entry; and / or, converting data description information in the text data that meets the requirements of a formula into formula data and inserting the formula data into the text segment corresponding to the chapter entry. The chart data and the formula data are unstructured data. If the text data includes data description information that meets the requirements of a chart, in the process of generating the text segment corresponding to the chapter entry, the data description information that meets the requirements of a chart can be converted into chart data, and the converted data is inserted into the text segment corresponding to the chapter entry according to the position determined by the chapter entry, and the chart data is presented in the form of a chart, such as a pie chart, a column chart, a line chart, etc. If the text data includes data description information that meets the requirements of a formula, in the process of generating the text segment corresponding to the chapter entry, the data description information that meets the requirements of a formula can be converted into formula data, and the converted data is inserted into the text segment corresponding to the chapter entry according to the position determined by the chapter entry, and the formula data is presented in the form of a formula. The embodiments of the present disclosure do not limit the implementation manner of the conversion of the text data into chart data and formula data.
[0044] Step 203: generating a long text based on the long text outline and the text segment corresponding to the chapter entry.
[0045] On the basis of step 202, this step aims to combine the long text outline and the text segment corresponding to the chapter entry to generate a long text that meets the requirements according to the long text outline and the text segment corresponding to the chapter entry by the above-mentioned execution subject. The embodiments of the present disclosure do not limit the type of the long text, for example, the long text can be a paper, a teaching plan, or a summary, etc. For another example, after the server 105 generates the long text based on the long text outline and the text segment corresponding to the chapter entry, the generated long text can be presented to the user through the terminal device shown in FIG. 1.
[0046] Optionally, the long text generation method can further include the following steps: polishing the long text to make the generated long text more professional; and / or adjusting the format of 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, last, etc. in the long text can be removed, unnecessary repeated content in the long text can be removed, and the content of the long text can be made more in line with the facts. 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 do not limit this, for example, by adjusting the format of the generated long text, the chapter entries in the long text outline can be corrected to the standard chapter directory, and references, statements, etc. can be added at the end of the long text.
[0047] Optionally, the step 202 of generating a text segment corresponding to a chapter entry based on file data can include: generating a text segment corresponding to each of the plurality of chapter entries based on the file data associated with each of the plurality of chapter entries, wherein at least one chapter entry corresponds to at least two text segments; and the step 203 of generating a long text based on a long text outline and a text segment corresponding to a chapter entry can include: generating at least two long texts based on the long text outline and the text segments corresponding to the plurality of chapter entries. The long text generation method can further include: reviewing the at least two long texts, and outputting the long text with the highest score according to the review score of each long text to perform optimization processing on the generated long text, so that the generated long text is more professional. The embodiments of the present disclosure do not limit the review standard, for example, the long text can be reviewed from the dimensions of professionalism, factuality, etc.
[0048] Optionally, for a chapter entry, at least two corresponding text segments can be generated according to the parameters for generating the text segments preset for the chapter entry, for example, the parameters for generating the text segments can be diversity parameters such as synonyms, near synonyms, etc., or penalty parameters such as forbidden words, etc. For example, for a chapter entry, a first corresponding text segment can be generated according to synonyms, and a second corresponding text segment can be generated according to near synonyms. For another example, for a chapter entry, a first corresponding text segment can be generated according to a part of forbidden words, and a second corresponding text segment can be generated according to another part of forbidden words. Optionally, for a chapter entry, at least two corresponding text segments can be generated according to keywords for searching the chapter entry. For example, for a chapter entry, a first corresponding text segment can be generated according to a part of keywords for searching, and a second corresponding text segment can be generated according to another part of keywords for searching.
[0049] The long text generation method 200 provided by the embodiment of the present disclosure can automatically generate a long text according to long text demand information provided by a user, and allow the user to provide file data under a chapter item in the long text outline, generate a personalized professional long text according to the file data, greatly improve the flexibility of long text generation, and meet the urgent needs of the user for personalized and customized long text generation, and make the creation of the long text more efficient and convenient.
[0050] Please refer to FIG. 3, which is a flowchart of another long text generation method provided by the embodiment of the present disclosure, that is, a specific implementation manner is provided for step 202 in the flow 200 shown in FIG. 2, and other steps in the flow 200 are not adjusted, and the specific implementation manner provided by the present embodiment is obtained by replacing step 202 to obtain a new complete embodiment. The flow 300 includes the following steps:
[0051] Step 301: generating a long text outline based on long text demand information, the long text outline including chapter items;
[0052] In some optional embodiments, the present step is intended to input the long text demand information into the fine-tuning model by the execution subject of the long text generation method, for example, the server 105 shown in FIG. 1, and generate a long text outline according to the historical 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 by the fine-tuning model according to the historical generated outline. The long text outline generated by the fine-tuning model can meet the preset requirements for generating a long text outline, for example, each chapter of the generated outline is not repeated, the description information under each chapter item of the generated outline does not exceed 20 characters, and the generated outline needs to include a secondary title and a tertiary title. Alternatively, if the user needs to replace the text title in the generated long text outline, a new text title can also be generated by the fine-tuning model according to the historical generated text title.
[0053] Step 302: inputting the long text outline and the file data into the few-shot prompt guided large language model, and generating an outline profile by using a preset professional knowledge base;
[0054] On the basis of step 301, this step aims to input the long text outline and file data into the few-shot prompting guided large language model by the above-mentioned execution subject, and generate an outline profile by using a preset professional knowledge base. Wherein, before generating the outline profile each time, the large language model needs to be guided by few-shot prompting, so that the generated outline profile can strictly comply with the format of the outline. The file data can include the information associated with the chapter entry edited and input by the user under the chapter entry of the long text outline, or can include the reference file uploaded by the user under the chapter entry of the long text outline, such as word, pdf, excel, png, etc. Compared with the description information under each chapter entry in the outline in step 301, the key description information under each chapter entry in the outline profile describes the chapter in more detail, and the key description information can determine the keywords and points of the chapter.
[0055] Step 303: information retrieval is performed by using the key description information, and a text segment corresponding to the chapter entry is generated according to the retrieved information and the file data;
[0056] In some optional embodiments, on the basis of step 302, this step aims to split each chapter entry in the outline profile by the above-mentioned execution subject, and input the file data and key description information of each chapter entry obtained by splitting into the large language model subjected to supervised fine-tuning (SFT), determine the keywords and points of the chapter entry by using the key description information of the current chapter entry, and perform information retrieval by using the keywords and points, and generate a text segment corresponding to the current chapter entry according to the retrieved information and the file data of the current chapter entry. Wherein, the supervised fine-tuning of the large language model can ensure the effect of the text segment generation, so that the text segment corresponding to each chapter entry can meet the preset requirements of the generated text segment, for example, the number of words of the generated text segment is required to be within 1500 words, and the generated text segment starts from the current chapter entry, without generating the content of other chapter entries.
[0057] Wherein, the large language model subjected to supervised fine-tuning also regulates the format of the data description information meeting the chart requirements, the data description information meeting the formula requirements, and the inserted picture data, table data and text data. For example, the generated text segment needs to refer to the picture data included in the file data, and the picture data can be inserted in the following format: “Figure: XXX architecture diagram,! [picture description caption] (picture url) - picture” 。The generated text segment needs to refer to the data description information that meets the chart requirements. The data description information that meets the chart requirements can be generated into a corresponding json string: {"caption":"Chart N Baidu Operating Cash Flow (100 million RMB)", "columns":["Time", "Same period(%)"], "data":[["2018FY", 0]]} for insertion. The insertion of data description information that meets the formula requirements can refer to the insertion of data description information that meets the chart requirements, so this place will not be repeated.
[0058] Step 304: generating a long text based on the long text outline and the text segments corresponding to the chapter entries.
[0059] On the basis of step 303, this step aims to combine the long text outline and the text segments corresponding to the chapter entries by the above-mentioned execution subject to generate a long text composed of chapter directory and chapter text. In some optional embodiments, the generated long text can also be polished and processed by the above-mentioned execution subject. For example, the long text can be input into a large language model for polishing. For example, a plurality of text segments corresponding to a plurality of chapter entries respectively can be generated according to the file data respectively associated with the plurality of chapter entries, and at least one chapter entry corresponds to at least two text segments, so that at least two long texts can be generated according to the long text outline and the text segments corresponding to the plurality of chapter entries, and the at least two long texts can be input into a 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 two long texts are generated by artificial intelligence (AI), the characteristics or style of the AI-generated text, i.e. AI flavor, can be used as a dimension of the review index when reviewing the long text. For example, the review result can be output in a json string, such as: {“best long text”: long text 1}.
[0060] Step 305: format adjustment processing of the long text.
[0061] In some optional embodiments, on the basis of step 304, this step aims to eliminate some content generated by a large language model by the above-mentioned execution subject, for example, (Note: the above content | (Note: due to the word limit | (Note: due to | due to the rigor of academic research); modify the chapter entry to a standard chapter directory, for example, “## Introduction” is modified to “Chapter 1 Introduction”, “### Research purpose and significance” is modified to “1.1 Research purpose and significance”; add references and statements after the long text.
[0062] To deepen the understanding, the disclosure gives a specific implementation scheme in combination with one specific application scenario: please refer to FIG. 4, FIG. 5A and FIG. 5B, FIG. 4 is a flow chart of a specific application scenario of a long text generation method provided by the embodiment of the disclosure, and FIG. 5A and FIG. 5B are user interface diagrams of a specific application scenario of a long text generation method provided by the embodiment of the disclosure. Among them,
[0063] Step 401: generating a long text outline based on long text demand information, the long text outline including a text title and chapter entries. As shown in FIG. 5A, two ways of generating a long text according to long text demand information are provided in the user interface of the terminal device, wherein the left side 501 is to generate a long text through user input long text theme information, and the right side 502 is to generate a long text through user uploaded reference files, when selecting to generate a long text through user input long text theme information, and inputting long text theme information "big model" in the input box 503 of the user interface, clicking the button 504 to generate a long text outline, and presenting the generated long text outline to the user in the user interface of the terminal device, as shown in FIG. 5B, the user can replace or adjust the generated long text outline according to his own demand, for example, replacing the text title or replacing the outline.
[0064] Step 402: the user can provide file data associated with the chapter entry under the chapter entry of the long text outline, the file data can include user uploaded reference files and / or user input information associated with the chapter entry. As shown in FIG. 5B, the user uploads four reference files under the chapter entry "1.1 research background and significance" of the long text outline, that is, the word file 505, the pdf file 506, the excel file 507 and the txt file 508, after the user uploads the reference files and / or inputs the information associated with the chapter entry under the chapter entry of the long text outline, the user can execute steps 403 to 406 to generate a long text, for example, the above steps can be directly executed by clicking the button to generate a long text, and the generated long text is presented to the user in the user interface of the terminal device.
[0065] Among them, step 403: in response to receiving the file data associated with the chapter entry, generating an outline sketch based on the long text outline and the file data associated with the chapter entry, the outline sketch including key description information of the chapter entry; step 404: generating a text segment corresponding to the chapter entry based on the file data and the key description information, generating a long text based on the long text outline and the text segment corresponding to the chapter entry; step 405: polishing and / or optimizing the long text; step 406: adjusting the format of the long text.
[0066] In the process of generating the long text, the excel file 507 can be converted into a 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 in the json format can be mapped to a standard paper format, i.e., including a chapter directory and a chapter body, through format adjustment.
[0067] With further reference to FIG. 6, as an implementation of the method shown in the above figures, the present disclosure further provides a long text generation device embodiment, which corresponds to the long text generation method embodiments shown in FIGS. 2 to 5. The above device can be applied in various electronic devices.
[0068] As shown in FIG. 6, the long text generation device 600 of the present embodiment can 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, the long text outline including chapter entries. The text segment generation unit 602 is configured to generate a text segment corresponding to a chapter entry based on file data associated with the chapter entry in response to receiving the file data. 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.
[0069] In the present embodiment, the specific processing of the outline generation unit 601, the text segment generation unit 602, and the long text generation unit 603 in the long text generation device 600 and the technical effects brought by the processing can be respectively referred to the related descriptions of the steps in the corresponding embodiments of FIGS. 2 to 5, which will not be repeated here.
[0070] The present embodiment exists as a device embodiment corresponding to the above method embodiments. The long text generation device 600 provided by the present embodiment not only can automatically generate a long text according to long text requirement information provided by a user, but also allows the user to provide file data under a chapter entry in a long text outline, and generate a professional long text with unique individuality according to the file data, thereby greatly increasing the flexibility of long text generation and meeting the urgent needs of users for individualized and customized long text generation, and making the creation of long text more efficient and convenient.
[0071] In some optional implementations of the present embodiment, the text segment generation unit 602 can include an outline profile generation subunit configured to generate an outline profile based on the long text outline and the file data associated with the chapter entry, wherein the outline profile includes key description information of the chapter entry; and a text segment generation subunit configured to generate a text segment corresponding to the chapter entry based on the file data and the key description information.
[0072] In some optional implementations of the embodiment, the file data includes one or more of the following: text data, picture data, table data; the text segment generation unit 602 can be further configured to: insert the picture 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.
[0073] In some optional implementations of the embodiment, the text segment generation unit 602 can be further configured to: convert the data description information in the text data that meets the chart requirement into chart data and insert it into the text segment corresponding to the chapter entry; and / or, convert the data description information in the text data that meets the formula requirement into formula data and insert it into the text segment corresponding to the chapter entry.
[0074] In some optional implementations of the embodiment, the outline profile generation subunit can be further configured to: input the long text outline and the file data into the few-shot prompt guided large language model, and generate the outline profile by using the preset professional knowledge base.
[0075] In some optional implementations of the embodiment, the text segment generation subunit can be further configured to: perform information retrieval by using the key description information, and generate the text segment corresponding to the chapter entry according to the retrieved information and the file data.
[0076] In some optional implementations of the embodiment, the long text generation apparatus 600 can further include a polishing processing unit and / or a format adjustment unit. The polishing processing unit can be configured to perform polishing processing on the long text; and the format adjustment unit can be configured to perform format adjustment processing on the long text.
[0077] In some optional implementations of the embodiment, the polishing processing unit can be further configured to: input the long text into the large language model to perform polishing processing.
[0078] In some optional implementations of the embodiment, the text segment generation unit 602 can be further configured to: generate the text segment corresponding to each of the plurality of chapter entries based on the text data associated with each of the plurality of chapter entries, wherein at least one chapter entry corresponds to at least two text segments; 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 segment corresponding to each of the plurality of chapter entries; and the selection processing unit can be further configured to: review the at least two long texts, and output the long text with the highest score according to the review score of each long text.
[0079] In some optional implementations of the embodiment, the long text requirement information includes long text theme information and / or reference file.
[0080] In some optional implementations of the present embodiment, the outline generation unit 601 can be further configured to, in response to receiving the outline replacement request, generate a new long text outline based on the long text requirement information to update the long text outline.
[0081] In some optional implementations of the present embodiment, the long text outline further comprises a text title; the outline generation unit 601 can be further configured to, in response to receiving a text title replacement request, generate a new text title based on the long text requirement information to update the text title in the long text outline.
[0082] In some optional implementations of the present embodiment, the outline generation unit 601 can be further configured to input the long text requirement information into a fine-tuning model, and generate the long text outline according to a historical generated outline.
[0083] According to embodiments of the present disclosure, the present disclosure further provides an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to implement the long text generation method described in any of the above embodiments.
[0084] According to embodiments of the present disclosure, the present disclosure further provides a readable storage medium, which stores computer instructions for enabling a computer to implement the long text generation method described in any of the above embodiments when the computer executes the computer instructions.
[0085] The present 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.
[0086] FIG. 7 shows a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit the implementations of the present disclosure described and / or claimed in this document.
[0087] As shown in FIG. 7, the device 700 includes a computing unit 701 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 702 or a computer program loaded into a random access memory (RAM) 703 from a storage unit 708. 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 through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0088] A plurality 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, and the like; an output unit 707, such as various types of displays, speakers, and the like; a storage unit 708, such as a magnetic disk, an optical disk, and the like; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, and the like. 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.
[0089] The computing unit 701 can be various general-purpose and / or special-purpose processing components having 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 specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, and the like. The computing unit 701 performs various methods and processes described above, such as the long text generation method. For example, in some embodiments, the long text generation method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the long text generation method described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the long text generation method by any other appropriate means, such as by means of firmware.
[0090] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0091] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, or entirely on a remote machine or server.
[0092] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0093] To provide for interaction with a user, the systems and techniques described here 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 a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, 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, speech, or tactile input.
[0094] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, 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.
[0095] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can 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 large management difficulty and weak business scalability in traditional physical host and virtual private server (VPS, Virtual Private Server) services.
[0096] The technical solutions of the embodiments of the present disclosure generate a long text outline including chapter items based on long text demand information, generate a text segment corresponding to a chapter item based on file data associated with the chapter item in response to receiving the file data, and generate a long text based on the long text outline and the text segment corresponding to the chapter item. Not only can the long text be automatically generated according to the long text demand information provided by the user, but the user is also allowed to provide file data under the chapter item in the long text outline, generate a personalized professional long text based on the file data, and give great flexibility to the long text generation. The urgent needs of the user for personalized and customized long text generation can be met, and the creation of the long text becomes more efficient and convenient.
[0097] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps described in the present disclosure can be performed in parallel, in series, or in a different order, without limitation herein, so long as the desired results of the technology described in the present disclosure are achieved.
[0098] The above specific embodiments do not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principles of the present disclosure shall fall within the protection scope of the present disclosure.
Claims
1. A method for generating long text, comprising: A long text outline is generated based on the long text requirement information, and the long text outline includes chapter entries; In response to receiving file data associated with the chapter entry, a text fragment corresponding to the chapter entry is generated based on the file data; A long text is generated based on the long text outline and the text fragments corresponding to the chapter entries.
2. The long text generation method according to claim 1, wherein, The process of generating the text fragments corresponding to the chapter entries based on the file data includes: An outline is generated based on the long text outline and the file data associated with the chapter entries, and the outline includes key descriptive information of the chapter entries; Based on the file data and the key description information, text fragments corresponding to the chapter entries are generated.
3. The long text generation method according to claim 2, wherein, The file data includes one or more of the following: text data, image data, and table data; The method further includes: Insert the image data from the file data into the text fragment corresponding to the chapter entry; And / or, insert the tabular data from the file data into the text fragments corresponding to the chapter entries.
4. The long text generation method according to claim 3 further includes: Convert the data description information in the text data that meets the chart requirements into chart data and insert it into the text fragment corresponding to the chapter entry; And / or, convert the data description information in the text data that meets the formula requirements into formula data and insert it into the text fragment corresponding to the chapter entry.
5. The long text generation method according to claim 2, wherein, The process of generating an outline based on the long text outline and the file data associated with the chapter entries includes: The long text outline and the document data are input into a large language model guided by few-sample prompts, and the outline contour is generated using a preset professional knowledge base.
6. The long text generation method according to claim 2, wherein, The step of generating text fragments corresponding to the chapter entries based on the file data and the key description information includes: Information retrieval is performed using the key descriptive information, and text fragments corresponding to the chapter entries are 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: The long text was polished. And / or, perform formatting adjustments on the long text.
8. The long text generation method according to claim 7, wherein, The polishing process for 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, wherein, The process of generating the text fragments corresponding to the chapter entries based on the file data includes: Based on the file data associated with each of the multiple chapter entries, text fragments corresponding to each of the multiple chapter entries are generated respectively, wherein at least one chapter entry corresponds to at least two text fragments; The process of generating long text based on the long text outline and the text fragments corresponding to the chapter entries includes: At least two long texts are generated based on the long text outline and the text fragments corresponding to each of 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 based on the review score of each long text.
10. The long text generation method according to any one of claims 1 to 6, wherein, The long text requirement information includes long text topic information and / or reference documents.
11. The long text generation method according to any one of claims 1 to 6, further comprising: In response to receiving an 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, wherein, The long text outline also includes text headings; The method further includes: In response to receiving a text title change 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, wherein, The generation of a long text outline based on long text requirement information includes: The long text requirement information is input into the fine-tuning model, and the long text outline is generated based on the previously generated outlines.
14. A long text generation apparatus, comprising: The outline generation unit is configured to generate a long text outline based on long text requirement information, the long text outline including chapter entries; The text fragment generation unit is configured to generate a text fragment corresponding to the chapter entry based on the file data received in response to receiving file data associated with the chapter entry; The long text generation unit is configured to generate long text based on the long text outline and the text fragments corresponding to the chapter entries.
15. The long text generation apparatus according to claim 14, wherein, The text fragment generation unit includes: The outline generation subunit is configured to generate an outline based on the long text outline and file data associated with the chapter entries, the outline including key descriptive information of the chapter entries; The text fragment generation subunit is configured to generate text fragments corresponding to the chapter entries based on the file data and the key description information.
16. The long text generation apparatus according to claim 15, wherein, The file data includes one or more of the following: text data, image data, and table data; The text fragment generation unit is further configured to: Insert the image data from the file data into the text fragment corresponding to the chapter entry; And / or, insert the tabular data from the file data into the text fragments corresponding to the chapter entries.
17. The long text generation apparatus according to claim 16, wherein the text fragment generation unit is further configured to: Convert the data description information in the text data that meets the chart requirements into chart data and insert it into the text fragment corresponding to the chapter entry; And / or, convert the data description information in the text data that meets the formula requirements into formula data and insert it into the text fragment corresponding to the chapter entry.
18. The long text generation apparatus according to claim 15, wherein, The outline generation subunit is further configured to input the long text outline and the document data into a large language model guided by few-sample prompts, and generate the outline outline using a preset professional knowledge base.
19. The long text generation apparatus according to claim 15, wherein, The text fragment generation subunit is further configured to perform information retrieval using the key description information, and generate text fragments corresponding to the chapter entries based on the retrieved information and the file data.
20. The long text generation apparatus according to any one of claims 14 to 19, further comprising: The polishing unit is configured to polish the long text. And / or, the formatting unit is configured to perform formatting processing on the long text.
21. The long text generation apparatus according to claim 20, wherein, The polishing unit is further configured to input the long text into a large language model for polishing.
22. The long text generation apparatus according to any one of claims 14 to 19, wherein, The text fragment generation unit is further configured to generate multiple text fragments corresponding to each of the multiple chapter entries based on the file 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 is 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 device further includes: The selection processing unit is configured to review at least two of the long texts and output the long text with the highest score based on the review score of each of the long texts.
23. The long text generation apparatus according to any one of claims 14 to 19, wherein, The long text requirement information includes long text topic information and / or reference documents.
24. The long text generation apparatus according to any one of claims 14 to 19, wherein the outline generation unit is further 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.
25. The long text generation apparatus according to any one of claims 14 to 19, wherein, The long text outline also includes text headings; The outline generation unit is further 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.
26. The long text generation method according to any one of claims 14 to 19, wherein, The outline generation unit is also configured to input the long text requirement information into the fine-tuning model and generate the long text outline based on the historically generated outlines.
27. An electronic device comprising: 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 to enable the at least one processor to perform the long text generation method according to any one of claims 1-13.
28. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the long text generation method according to any one of claims 1-13.
29. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the long text generation method according to any one of claims 1-13.
Citation Information
Patent Citations
Method and device for generating presentation document, electronic equipment and storage medium
CN116306492A
Document generation method and device, equipment and medium
CN117725895A
Long text generation method and device
CN117743567A
Systems and methods for machine content generation
US20220237368A1
Long text generation method and apparatus, device and storage medium
WO2022121165A1