WO2025260445A1 - 长文本生成方法及装置、设备、存储介质及计算机程序产品 - Google Patents

长文本生成方法及装置、设备、存储介质及计算机程序产品

Info

Publication number
WO2025260445A1
WO2025260445A1 PCT/CN2024/107321 CN2024107321W WO2025260445A1 WO 2025260445 A1 WO2025260445 A1 WO 2025260445A1 CN 2024107321 W CN2024107321 W CN 2024107321W WO 2025260445 A1 WO2025260445 A1 WO 2025260445A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
long
long text
outline
chapter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/107321
Other languages
English (en)
French (fr)
Inventor
庞海龙
吴广发
张超
陈天增
薛璐影
白云龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to EP24942085.2A priority Critical patent/EP4715660A1/en
Publication of WO2025260445A1 publication Critical patent/WO2025260445A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/137Hierarchical processing, e.g. outlines
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/117Tagging; Marking up; Designating a block; Setting of attributes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/131Fragmentation of text files, e.g. creating reusable text-blocks; Linking to fragments, e.g. using XInclude; Namespaces
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • G06F40/157Transformation using dictionaries or tables
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/169Annotation, e.g. comment data or footnotes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/258Heading extraction; Automatic titling; Numbering
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/55Rule-based translation
    • G06F40/56Natural language generation

Definitions

  • This disclosure relates to the field of big data processing technology, and more particularly to the field of intelligent office technology, specifically to a long text generation method and apparatus, electronic device, computer-readable storage medium, and computer program product.
  • This disclosure provides a method and apparatus for generating long text, an electronic device, a computer-readable storage medium, and a computer program product, which can flexibly, efficiently, and conveniently generate long texts that meet users' personalized and customized needs.
  • a long text generation method comprising: generating a long text outline based on long text requirement information, the long text outline including chapter entries; in response to receiving file data associated with chapter entries, generating text fragments corresponding to chapter entries based on the file data; and generating long text based on the long text outline and the text fragments corresponding to chapter entries.
  • a long text generation apparatus comprising: an outline generation unit configured to generate a long text outline based on long text requirement information; and the long text...
  • the outline includes chapter entries; a text fragment generation unit is configured to generate text fragments corresponding to chapter entries based on file data received associated with the chapter entries; and a 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.
  • 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 to enable the at least one processor to implement the long text generation method as described in any implementation of the first aspect.
  • a non-transitory computer-readable storage medium storing computer instructions that enable a computer to perform a long text generation method as described in any implementation of the first aspect.
  • a computer program product including a computer program is provided, which, when executed by a processor, is capable of implementing the long text generation method as described in any implementation of the first aspect.
  • Figure 1 is an exemplary system architecture diagram in which this disclosure can be applied
  • Figure 2 is a flowchart of a long text generation method provided in an embodiment of this disclosure
  • FIG. 3 is a flowchart of another long text generation method provided in an embodiment of this disclosure.
  • Figure 4 is a flowchart of a specific application scenario of a long text generation method provided in this embodiment of the present disclosure
  • Figures 5A and 5B are user interface diagrams of a specific application scenario of a long text generation method provided in the embodiments of this disclosure.
  • Figure 6 is a structural block diagram of a long text generation device provided in an embodiment of this disclosure.
  • Figure 7 is a schematic diagram of the structure of an electronic device suitable for performing a long text generation method according to an embodiment of this disclosure.
  • Figure 1 illustrates an exemplary system architecture 100 to which embodiments of the long text generation method and apparatus, electronic devices and computer-readable storage media of the present disclosure can be applied.
  • the system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105.
  • the network 104 serves as the medium for providing communication links between the terminal devices 101, 102, and 103 and the server 105.
  • the network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
  • Terminal devices 101, 102, and 103 Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc.
  • Various applications for enabling information communication between the terminal devices 101, 102, and 103 and server 105 can be installed. These applications include long text generation applications.
  • Terminal devices 101, 102, and 103, and server 105 can be either hardware or software.
  • terminal devices 101, 102, and 103 can be various electronic devices with displays, including but not limited to smartphones, tablets, laptops, and desktop computers.
  • terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices, and can be implemented as multiple software programs or software modules. It can be implemented as a single software program or software module, without specific limitations.
  • the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server; when the server is software, it can be implemented as multiple software programs or software modules, or as a single software program or software module, without specific limitations.
  • Server 105 can provide various services through its built-in applications. Taking a long text generation application that can provide long text generation services as an example, when server 105 runs this long text generation application, it can achieve the following effects: the outline generation unit generates a long text outline including chapter entries based on the long text requirement information; the text fragment generation unit responds to the received file data associated with the chapter entries and generates text fragments corresponding to the chapter entries based on the file data; and the long text generation unit generates long text based on the long text outline and the text fragments corresponding to the chapter entries.
  • users can input or upload long text request information through a terminal device, and then send the long text request information to the server 105 via network 104.
  • the server 105 can return the long text outline to the terminal device via network 104 for presentation to the user.
  • Users can further input or upload file data associated with chapter entries through the terminal device, and then send the file data to the server 105 via network 104.
  • the server 105 can return the long text to the terminal device via network 104 for presentation to the user.
  • long text can refer to any text data that is relatively long and contains a significant amount of text content, such as text data with a length greater than 512 characters.
  • FIG. 2 is a flowchart of a long text generation method provided in an embodiment of this disclosure, wherein process 200 includes the following steps:
  • Step 201 Generate a long text outline based on the long text requirement information.
  • the long text outline includes chapter entries.
  • This step aims to have the execution entity of the long text generation method, such as server 105 shown in Figure 1, generate a corresponding long text outline based on the long text requirement information.
  • the long text outline includes chapter entries.
  • the embodiments of this disclosure focus on generating a corresponding long text outline based on long text requirement information.
  • the implementation method is not limited. For example, a long text outline can be generated based on the long text requirement information using historically generated outlines; or a long text outline can be generated based on the long text requirement information using a preset outline template.
  • the long text requirement information refers to information related to the long text to be generated, which may include long text topic information and/or reference documents.
  • the embodiments of this disclosure do not limit the form of the long text requirement information.
  • a user can input long text topic information through the terminal device shown in Figure 1.
  • the server 105 can generate a corresponding long text outline based on the user's input long text topic information and present the generated long text outline to the user through the terminal device shown in Figure 1.
  • a user can upload reference documents through the terminal device shown in Figure 1.
  • the server 105 can analyze the uploaded reference documents to determine their topic, generate a corresponding long text outline based on the topic, and present the generated long text outline to the user through the terminal device shown in Figure 1.
  • a user can input long text topic information and upload reference documents through the terminal device shown in Figure 1.
  • the server 105 can generate a corresponding long text outline based on the user's input long text topic information and the uploaded reference documents, and present the generated long text outline to the user through the terminal device shown in Figure 1.
  • This disclosure provides various forms of long text requirement information, offering greater flexibility for long text generation.
  • the long text generation method may further include: in response to receiving an outline change request, generating a new long text outline based on long text requirement information to update the long text outline.
  • a user can issue an outline change request through the terminal device shown in Figure 1.
  • the server 105 can respond to the received outline change request by generating a new long text outline based on the long text requirement information, and present the generated new long text outline to the user through the terminal device shown in Figure 1, thereby realizing the replacement of the generated long text outline.
  • the new long text outline may differ from the previously generated long text outline, for example, in the number of chapters or the chapter titles, etc., but the embodiments of this disclosure do not limit this.
  • the long text generation method may further include: in response to receiving a text title change request, generating a new text title based on long text requirement information to update the text titles in the long text outline. For example, a user can issue a text title change request through the terminal device shown in Figure 1.
  • the server 105 can respond to the received text title change request by generating a new text title based on the long text requirement information, and present the generated new text title to the user through the terminal device shown in Figure 1, thereby changing the text titles in the long text outline.
  • the new text title may differ from the previously generated text title, for example, in terms of scope or perspective; however, the embodiments of this disclosure do not limit this.
  • the user can not only replace the entire long text outline or parts of its structure, but also adjust only parts of the structure.
  • the user can add or delete chapter entries in the long text outline, or demote or upgrade chapter entries.
  • the user can modify the text titles in the long text outline, or modify the chapter titles of the chapter entries.
  • the embodiments of this disclosure do not limit this.
  • Step 202 In response to receiving file data associated with a chapter entry, generate a text fragment corresponding to the chapter entry based on the file data;
  • this step aims to have the aforementioned executing entity, in response to receiving file data associated with chapter entries, generate text fragments corresponding to the chapter entries based on the file data, serving as the corresponding chapter text.
  • the embodiments of this disclosure do not limit the implementation method of generating text fragments corresponding to chapter entries based on file data. For example, information retrieval can be performed based on the file data, and text fragments corresponding to chapter entries can be generated based on the retrieved information and the file data; alternatively, key descriptive information for chapter entries can be generated based on the file data, followed by information retrieval based on the key descriptive information, and then text fragments corresponding to chapter entries can be generated based on the retrieved information and the file data.
  • the file data refers to data related to the text fragments to be generated for the chapter entries, and may include information associated with the chapter entries and/or reference documents.
  • the embodiments of this disclosure do not limit the form of the file data.
  • a user can input information associated with a chapter entry under a chapter entry using the terminal device shown in Figure 1, and the server 105 can generate the text fragment corresponding to that chapter entry based on the user's input.
  • the user can...
  • the server 105 can generate a text fragment corresponding to that chapter entry based on the uploaded reference files.
  • a user can enter information associated with a chapter entry and upload reference files using the terminal device shown in Figure 1; the server 105 can then generate a text fragment corresponding to that chapter entry based on the user's input information and the uploaded reference files.
  • step 202 generating text fragments corresponding to chapter entries based on file data, may include the following steps: generating an outline based on a long text outline and file data associated with the chapter entries, wherein the outline includes key descriptive information of the chapter entries; and generating text fragments corresponding to the chapter entries based on the file data and key descriptive information.
  • key descriptive information of chapter entries can be generated using a preset professional knowledge base based on file data associated with the chapter entries, and an outline can be formed based on the long text outline and key descriptive information, wherein the preset professional knowledge base can refine the key descriptive information of chapter entries based on file data.
  • information retrieval can be performed based on the key descriptive information of each chapter entry, and text fragments corresponding to the chapter entries can be generated based on the retrieved information and the file data of the chapter entries, wherein the keywords and key points of the chapter entries can be determined using the key descriptive information, so as to use the keywords and key points for information retrieval.
  • the process of generating long texts is refined, which can improve the professionalism of the generated long texts and make them more in line with user needs.
  • the file data may include one or more of text data, image data, and table data.
  • the embodiments of this disclosure do not limit the type of file data, where text data is structured data, and image data and table data are unstructured data.
  • Step 202 during the process of generating the text fragments corresponding to the chapter entries, can also convert between structured and unstructured data, which can enrich the content of long texts and improve their readability.
  • step 202 may further include the following steps: inserting image data from the file data into the text fragments corresponding to the chapter entries; and/or, inserting table data from the file data into the text fragments corresponding to the chapter entries.
  • the file data includes image data
  • the image data can be converted into structured data, and the position for inserting the converted data is determined according to the text fragments corresponding to the chapter entries, and the converted data is inserted to present the image data.
  • the file data includes table data
  • the table data can be converted into structured data. The converted data is inserted at the location determined by the text fragments corresponding to the chapter entries, and the table data is then presented.
  • the embodiments of this disclosure do not limit the implementation method of converting image data and table data formats.
  • step 202 may 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 it into the text fragment 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 it into the text fragment corresponding to the chapter entry.
  • the chart data and formula data are unstructured data.
  • the text data includes data description information that meets the requirements of a chart
  • the data description information that meets the requirements of a chart can be converted into chart data, and the position for inserting the converted data is determined according to the text fragment corresponding to the chapter entry, and the converted data is inserted and presented in the form of chart data, such as a pie chart, bar chart, line chart, etc.
  • the text data includes data description information that meets the requirements of a formula
  • the data description information that meets the requirements of a formula can be converted into formula data, and the position for inserting the converted data is determined according to the text fragment corresponding to the chapter entry, and the converted data is inserted and presented in the form of formula data.
  • the embodiments of this disclosure do not limit the implementation method of converting text data into chart data and formula data.
  • Step 203 Generate long text based on the text fragments corresponding to the long text outline and chapter entries.
  • this step aims to have the aforementioned executing entity combine the long text outline and the text fragments corresponding to the chapter entries to generate a long text that meets the requirements.
  • the embodiments of this disclosure do not limit the type of long text; for example, the long text can be a thesis, lesson plan, or summary, etc., to meet different needs.
  • server 105 After server 105 generates the long text based on the text fragments corresponding to the long text outline and chapter entries, the generated long text can be presented to the user through the terminal device shown in Figure 1.
  • the long text generation method may further include the following steps: polishing the long text to make it more professional; and/or adjusting the format of the long text to better conform to the format requirements of long texts.
  • polishing the generated long text can remove unnecessary logical connectors such as "firstly,””secondly,” and “finally,” remove unnecessary repetitions, and make the content of the long text more factual.
  • the format of the long text can be determined according to its type, and the format adjustment can be based on the type of long text and the method of its generation. The embodiments disclosed herein are not limited to this, for example, by adjusting the format of the generated long text, the chapter entries in the long text outline can be corrected into a standard chapter table of contents, and references, declarations, etc. can be added after the long text.
  • step 202 generating text fragments corresponding to chapter entries based on file data, may include: generating multiple text fragments corresponding to each chapter entry 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;
  • step 203, generating 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 the multiple chapter entries.
  • the long text generation method may further include: reviewing at least two long texts, and outputting the long text with the highest review score for each long text, thereby optimizing the generated long text and making it more professional.
  • the embodiments of this disclosure do not limit the review criteria; for example, the long text can be reviewed from dimensions such as professionalism and factuality.
  • the long text generation method 200 generateds a long text outline including chapter entries based on long text requirement information. In response to receiving file data associated with the chapter entries, it generates text fragments corresponding to the chapter entries based on the file data, and generates long text based on the long text outline and the text fragments corresponding to the chapter entries.
  • This method not only automatically generates long text based on user-provided long text requirement information, but also allows users to provide file data under the chapter entries in the long text outline, generating unique and professional long texts based on the file data. This technology provides great flexibility in generating long texts, meeting users' urgent needs for personalized and customized long text generation, and making the creation of long texts more efficient and convenient.
  • FIG. 3 is a flowchart of another long text generation method provided in this embodiment. Specifically, it provides a specific implementation of step 202 in process 200 shown in Figure 2. Other steps in process 200 are not adjusted, and a new complete embodiment is obtained by replacing step 202 with the specific implementation provided in this embodiment.
  • Process 300 includes the following steps:
  • Step 301 Generate a long text outline based on the long text requirement information.
  • the long text outline includes chapter entries.
  • this step aims to have the long text generation method's execution entity, such as server 105 shown in Figure 1, input the long text requirement information into a fine-tuning model, and then generate a long text outline based on historically generated outlines through the fine-tuning model. If the user needs to change the generated long text outline, they can generate a new long text outline based on the generated long text outline using the fine-tuning model and historically generated outlines.
  • the long text outline generated by the fine-tuning model can meet preset requirements for generating long text outlines, such as non-repeating chapters, descriptions under each chapter entry not exceeding 20 characters, and including second-level and third-level headings.
  • the user needs to change the text titles in the generated long text outline, they can also generate new text titles based on the text titles in the generated long text outline using the fine-tuning model and historically generated text titles.
  • Step 302 Input the long text outline and document data into the large language model guided by few-sample prompts, and generate the outline outline using the preset professional knowledge base;
  • this step involves the aforementioned executing entity inputting the long text outline and file data into a large language model guided by few-shot prompting, and generating an outline contour using a pre-defined professional knowledge base.
  • File data may include information associated with chapter entries edited and entered by the user under chapter entries in the long text outline, and may also include reference files uploaded by the user under chapter entries in the long text outline, such as Word, PDF, Excel, etc. Reference files in formats such as PNG.
  • the key descriptive information under each chapter entry in the outline provides a more detailed description of the chapter, from which the keywords and key points of the chapter can be identified.
  • Step 303 Use key descriptive information to perform information retrieval, and generate text fragments corresponding to chapter entries based on the retrieved information and file data;
  • this step aims to have the aforementioned executing entity split the chapter entries in the outline and input the file data and key description information of each split chapter entry into a large language model that has undergone supervised fine-tuning (SFT).
  • the key description information of the current chapter entry is used to determine the keywords and key points of the chapter entry, enabling information retrieval using these keywords and key points.
  • a text fragment corresponding to the current chapter entry is generated.
  • Supervised fine-tuning of the large language model ensures the quality of the generated text fragments, ensuring that the text fragments corresponding to each chapter entry meet the preset requirements for generating text fragments, such as a word count requirement of less than 1500 words, and that the generated text fragments start from the current chapter entry without generating content from other chapter entries.
  • the supervised fine-tuning large language model also specifies the format for inserting data description information that meets chart requirements and formula requirements from image data, table data, and text data. For example, if the generated text fragment needs to reference image data included in the file data, the image data can be inserted in the following format: " Figure: XXX Architecture Diagram, ![Image Description Caption](Image URL) -- Image” .
  • the corresponding JSON string can be generated from the data description information that meets the chart requirements: ⁇ "caption”:"Chart N Baidu Operating Cash Flow (Billion RMB)",”columns":["Time”,”Year-on-Year (%)”],”data”:[["2018FY",0]] ⁇ and inserted.
  • the insertion of data description information that meets formula requirements can refer to the insertion of data description information that meets chart requirements, so it will not be elaborated here.
  • Step 304 Generate long text based on the text fragments corresponding to the long text outline and chapter entries.
  • this step aims to have the aforementioned executing entity combine the text fragments corresponding to the long text outline and chapter entries to generate a table of contents and chapter text.
  • the generated long text can be also perform polishing and optimization processing on the generated long text.
  • the long text can be input into a large language model for polishing.
  • multiple text fragments corresponding to each chapter entry can be generated based on the file data associated with each chapter entry, and at least one chapter entry can correspond to at least two text fragments.
  • at least two long texts can be generated based on the long text outline and the text fragments corresponding to each chapter entry.
  • the at least two long texts can be input into an optimization model for review, and the long text with the highest score can be output based on the review score of each long text. Since the two long texts are generated by artificial intelligence (AI), the characteristics or style of the AI-generated text, i.e., the AI flavor, can be used as a 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 ⁇ .
  • AI artificial intelligence
  • Step 305 Adjust the format of the long text.
  • this step aims to have the aforementioned executing entity remove some content generated by the large language model, such as (Note: the above content
  • the large language model such as (Note: the above content
  • Figure 4 is a flowchart of a specific application scenario of a long text generation method provided by an embodiment of this disclosure
  • Figures 5A and 5B are user interface diagrams of the same application scenario.
  • Step 401 Generate a long text outline based on the long text requirement information.
  • the long text outline includes text titles and chapter entries.
  • the user interface of the terminal device provides two ways to generate long text based on long text requirement information.
  • 501 generates long text based on the long text topic information entered by the user
  • 502 generates long text based on reference files uploaded by the user.
  • Click button 504 to generate a long text outline, and present the generated long text outline to the user in the user interface of the terminal device, as shown in Figure 5B.
  • the user can change or adjust the generated long text outline according to their own needs, such as changing the text title or changing the outline.
  • Step 402 Users can provide file data associated with the chapter entries under the long text outline.
  • the file data may include reference files uploaded by the user and/or information entered by the user that is associated with the chapter entries.
  • the user uploaded four reference files under the chapter entry "1.1 Research Background and Significance" of the long text outline, namely a Word file 505, a PDF file 506, an Excel file 507, and a TXT file 508.
  • the user can execute steps 403 to 406 to generate the long text. For example, the user can directly generate the long text by clicking the button to execute the above steps, and the generated long text will be presented to the user in the user interface of the terminal device.
  • step 403 In response to receiving file data associated with chapter entries, an outline is generated based on the long text outline and the file data associated with the chapter entries, the outline including key descriptive information of the chapter entries; step 404: Based on the file data and key descriptive information, text fragments corresponding to the chapter entries are generated, and long text is generated based on the long text outline and the text fragments corresponding to the chapter entries; step 405: The long text is polished and/or optimized; step 406: The long text is formatted.
  • Excel file 507 can be converted to JSON format and inserted into the text fragments corresponding to chapter entries.
  • Data descriptions in Word file 505 that meet the requirements for charts and graphs can be converted into chart data and inserted into the text fragments corresponding to chapter entries.
  • the long text can be formatted; for example, JSON-formatted long text can be mapped to a standard academic paper format, including a table of contents and chapter text.
  • this disclosure also provides an embodiment of a long text generation apparatus, which corresponds to the long text generation method embodiments shown in Figures 2 to 5.
  • the above apparatus can be specifically applied to various electronic devices.
  • the long text generation device 600 of this embodiment may include: an outline generator.
  • the system comprises an outline generation unit 601, a text fragment 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 fragment generation unit 602 is configured to generate text fragments corresponding to chapter entries based on received file data associated with chapter entries;
  • the long text generation unit 603 is configured to generate long text based on the long text outline and the text fragments corresponding to chapter entries.
  • the long text generation device 600 provided in this embodiment can not only automatically generate long text according to the long text requirement 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 based on the file data, giving long text generation great flexibility, which can meet the user's urgent need for personalized and customized long text generation, and make the creation of long text more efficient and convenient.
  • the text fragment generation unit 602 may include: an outline generation subunit, configured to generate an outline based on a long text outline and file data associated with chapter entries, wherein the outline includes key descriptive information of chapter entries; and a text fragment generation subunit, configured to generate text fragments corresponding to chapter entries based on file data and key descriptive information.
  • the file data includes one or more of the following: text data, image data, and table data; the text fragment generation unit 602 may also be configured to: insert image data from the file data into text fragments corresponding to chapter entries; and/or, insert table data from the file data into text fragments corresponding to chapter entries.
  • the text fragment generation unit 602 may also be configured to: convert data description information in the text data that meets the requirements of the chart into text fragments corresponding to the chapter entries of the chart data insertion; and/or convert data description information in the text data that meets the requirements of the formula into text fragments corresponding to the chapter entries of the formula data insertion.
  • the outline generation subunit can It is further configured to: input long text outlines and document data into a large language model guided by few-sample prompts, and generate an outline profile using a preset knowledge base.
  • the text fragment generation subunit can be further configured to: perform information retrieval using key descriptive information, and generate text fragments corresponding to chapter entries based on the retrieved information and file data.
  • the long text generation apparatus 600 may further include: a polishing unit and/or a formatting adjustment unit.
  • the polishing unit may be configured to polish the long text;
  • the formatting adjustment unit may be configured to adjust the format of the long text.
  • the polishing unit can be further configured to input long text into a large language model for polishing.
  • 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 optimization 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.
  • the long text requirement information includes long text topic information and/or reference documents.
  • the outline generation unit 601 may also be configured to: in response to receiving an outline replacement request, generate a new long text outline based on the long text requirement information to update the long text outline.
  • the outline generation unit 601 can be further configured to: input long text requirement information into the fine-tuning model and generate a long text outline based on historically generated outlines.
  • the present disclosure also provides an electronic device, the 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, the instructions being 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 when executed.
  • this disclosure also provides a readable storage medium storing computer instructions that enable a computer to implement the long text generation method described in any of the above embodiments when executed.
  • FIG. 7 illustrates 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 laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • the electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and/or claimed herein.
  • device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded from storage unit 708 into random access memory (RAM) 703.
  • RAM 703 can also store various programs and data required for the operation of device 700.
  • the computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704.
  • Input/output (I/O) interface 705 is also connected to bus 704.
  • I/O interface 705 Multiple components in device 700 are connected to I/O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information/data with other devices through computer networks such as the Internet and/or various telecommunications networks.
  • input unit 706, such as keyboard, mouse, etc.
  • output unit 707 such as various types of monitors, speakers, etc.
  • storage unit 708, such as disk, optical disk, etc.
  • communication unit 709 such as network card, modem, wireless transceiver, etc.
  • Communication unit 709 allows device 700 to exchange information/data with other devices through computer networks such as the Internet and/or various telecommunications networks.
  • the computing unit 701 can be a variety of general-purpose and/or special-purpose 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 special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc.
  • the computing unit 701 performs the various methods and processes described above, such as the long text generation method.
  • the long text generation method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708.
  • part or all of the computer program may be loaded and/or installed on device 700 via ROM 702 and/or communication unit 709.
  • the computer program When the computer program is loaded into RAM 703 and executed by computing unit 701, one or more steps of the long text generation method described above may be performed.
  • the computing unit 701 may be configured to perform the long text generation method by any other suitable means (e.g., by means of firmware).
  • 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-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof.
  • FPGAs field-programmable gate arrays
  • ASICs application-specific integrated circuits
  • ASSPs application-specific standard products
  • SoCs systems-on-a-chip
  • CPLDs payload-programmable logic devices
  • Various embodiments may include implementations in one or more computer programs that can be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
  • a programmable processor which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
  • the program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages.
  • This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions/operations specified in the flowcharts and/or block diagrams to be implemented.
  • the program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
  • a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM compact disk read-only memory
  • magnetic storage devices or any suitable combination of the foregoing.
  • the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer.
  • a display device for displaying information to the user
  • LCD liquid crystal display
  • keyboard and pointing device e.g., a mouse or trackball
  • Other types of devices can also be used to provide interaction with the user; 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 sound input, voice input, or tactile input).
  • the systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components.
  • the components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
  • Computer systems can include clients and servers.
  • Clients and servers are generally located far apart and typically interact via communication networks.
  • Clients and servers are created by computer programs running on respective computers and having a client-server relationship with each other.
  • the relationship is as follows.
  • a server can be a cloud server, also known as a cloud computing server or cloud host. It is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
  • VPN Virtual Private Server
  • the technical solution of this disclosure generates a long text outline including chapter entries based on long text requirement information.
  • it In response to receiving file data associated with chapter entries, it generates text fragments corresponding to the chapter entries based on the file data. It then generates long text based on the long text outline and the text fragments corresponding to the chapter entries.
  • This not only automatically generates long text based on the long text requirement information provided by the user, but also allows the user to provide file data under the chapter entries in the long text outline.
  • Based on the file data it generates unique and professional long text, giving long text generation great flexibility. It can meet the user's urgent need for personalized and customized long text generation, making the creation of long text more efficient and convenient.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本公开提供了一种长文本生成方法及装置、电子设备、计算机可读存储介质及计算机程序产品,涉及大数据处理技术领域,尤其涉及办公智能化技术领域。该方法的一具体实施例包括:基于长文本需求信息生成长文本大纲,所述长文本大纲包括章节条目;响应于接收到与所述章节条目关联的文件数据,基于所述文件数据生成所述章节条目对应的文本片段;基于所述长文本大纲和所述章节条目对应的文本片段生成长文本。

Description

长文本生成方法及装置、设备、存储介质及计算机程序产品
相关申请的交叉引用
本专利申请要求于2024年06月18日提交的、申请号为202410788709.6、发明名称为“长文本生成方法及装置、设备、存储介质及计算机程序产品”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。
技术领域
本公开涉及大数据处理技术领域,尤其涉及办公智能化技术领域,具体涉及一种长文本生成方法及装置、电子设备、计算机可读存储介质及计算机程序产品。
背景技术
在文本生成领域,基于检索到的资料生成满足用户需求的长文本,大多存在着一定的操作要求和技术要求,通常需要用户具备一定的专业技能和时间投入。
发明内容
本公开实施例提出了一种长文本生成方法及装置、电子设备、计算机可读存储介质及计算机程序产品,可以灵活、高效、便捷的生成满足用户个性化、定制化需求的长文本。
在一个或多个实施例中,提出了一种长文本生成方法,包括:基于长文本需求信息生成长文本大纲,长文本大纲包括章节条目;响应于接收到与章节条目关联的文件数据,基于文件数据生成章节条目对应的文本片段;基于长文本大纲和章节条目对应的文本片段生成长文本。
在一个或多个实施例中,提出了一种长文本生成装置,包括:大纲生成单元,被配置成基于长文本需求信息生成长文本大纲,长文本 大纲包括章节条目;文本片段生成单元,被配置成响应于接收到与章节条目关联的文件数据,基于文件数据生成章节条目对应的文本片段;长文本生成单元,被配置成基于长文本大纲和章节条目对应的文本片段生成长文本。
在一个或多个实施例中,提供了一种电子设备,该电子设备包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,该指令被至少一个处理器执行,以使至少一个处理器执行时能够实现如第一方面中任一实现方式描述的长文本生成方法。
在一个或多个实施例中,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,该计算机指令用于使计算机执行时能够实现如第一方面中任一实现方式描述的长文本生成方法。
在一个或多个实施例中,提供了一种包括计算机程序的计算机程序产品,该计算机程序在被处理器执行时能够实现如第一方面中任一实现方式描述的长文本生成方法。
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本公开的其它特征、目的和优点将会变得更明显:
图1是本公开可以应用于其中的示例性系统架构图;
图2为本公开实施例提供的一种长文本生成方法的流程图;
图3为本公开实施例提供的另一种长文本生成方法的流程图;
图4为本公开实施例提供的一种长文本生成方法的具体应用场景的流程图;
图5A和图5B为本公开实施例提供的一种长文本生成方法的具体应用场景的用户界面图;
图6为本公开实施例提供的一种长文本生成装置的结构框图;
图7为本公开实施例提供的一种适用于执行长文本生成方法的电子设备的结构示意图。
具体实施例
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。
本公开的技术方案中,所涉及的用户个人信息的收集、存储、使用、加工、传输、提供和公开等处理,均符合相关法律法规的规定,且不违背公序良俗。
图1示出了可以应用本公开的长文本生成方法及装置、电子设备及计算机可读存储介质的实施例的示例性系统架构100。
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103和服务器105上可以安装有各种用于实现两者之间进行信息通讯的应用,例如长文本生成类应用等。
终端设备101、102、103和服务器105可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是具有显示屏的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等;当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中,其可以实现成多个软件或软件模块,也可 以实现成单个软件或软件模块,在此不做具体限定。当服务器105为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器;服务器为软件时,可以实现成多个软件或软件模块,也可以实现成单个软件或软件模块,在此不做具体限定。
服务器105通过内置的各种应用可以提供各种服务,以可以为用户提供长文本生成服务的长文本生成类应用为例,服务器105在运行该长文本生成类应用时可实现如下效果:由大纲生成单元根据长文本需求信息生成包括章节条目的长文本大纲,由文本片段生成单元响应于接收到与章节条目关联的文件数据,根据文件数据生成章节条目对应的文本片段,由长文本生成单元根据长文本大纲和章节条目对应的文本片段生成长文本。
其中,用户可以通过终端设备输入或上传长文本需求信息,然后经由网络104将长文本需求信息发送给服务器105,服务器105在生成长文本大纲后,可以将长文本大纲由网络104返回给该终端设备向用户进行呈现,用户可以进一步通过该终端设备输入或上传与章节条目关联的文件数据,然后经由网络104将文件数据发送给服务器105,服务器105在生成长文本后,可以将长文本由网络104返回给该终端设备向用户进行呈现。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。在本公开中,长文本可以指代任何长度较长、包含较多文字内容的文本数据,例如文本长度大于512字符的文本数据。
请参考图2,图2为本公开实施例提供的一种长文本生成方法的流程图,其中流程200包括以下步骤:
步骤201:基于长文本需求信息生成长文本大纲,长文本大纲包括章节条目;
本步骤旨在由长文本生成方法的执行主体,例如图1所示的服务器105,根据长文本需求信息生成对应的长文本大纲,长文本大纲包括章节条目。本公开的实施例对根据长文本需求信息生成对应的长文本大纲 的实现方式不作限定。例如,可以根据长文本需求信息利用历史生成的大纲生成长文本大纲;也可以根据长文本需求信息利用预设大纲模板生成长文本大纲。
其中,长文本需求信息是与需要生成的长文本相关的信息,可以包括长文本主题信息和/或参考文件,本公开的实施例对长文本需求信息的形式不作限定。例如,用户可以通过图1所示的终端设备输入长文本主题信息,服务器105可以根据用户输入的长文本主题信息生成对应的长文本大纲,并通过图1所示的终端设备向用户呈现所生成的长文本大纲。又例如,用户可以通过图1所示的终端设备上传参考文件,服务器105可以根据用户上传的参考文件通过对参考文件进行分析确定参考文件的主题,并根据参考文件的主题生成对应的长文本大纲,并通过图1所示的终端设备向用户呈现所生成的长文本大纲。再例如,用户可以通过图1所示的终端设备输入长文本主题信息并上传参考文件,服务器105可以根据用户输入的长文本主题信息和上传的参考文件生成对应的长文本大纲,并通过图1所示的终端设备向用户呈现所生成的长文本大纲。本公开提供多种长文本需求信息的形式,可以为长文本的生成提供更大灵活性。
可选地,在长文本大纲生成并向用户呈现后,用户还可以更换所生成的长文本大纲,以使所生成的长文本大纲更满足自己的需求。因此长文本生成方法还可以包括:响应于接收到大纲更换请求,基于长文本需求信息生成新的长文本大纲,以更新长文本大纲。例如,用户可以通过图1所示的终端设备发出大纲更换请求,服务器105可以响应于接收到的大纲更换请求根据长文本需求信息生成新的长文本大纲,并通过图1所示的终端设备向用户呈现所生成的新的长文本大纲,实现对所生成的长文本大纲的更换。其中,新的长文本大纲与前一次生成的长文本大纲不同,例如章节的数量不同、章节的标题不同等,本公开的实施例对此不作限定。
可选地,在长文本大纲生成并向用户呈现后,用户除了可以对整个长文本大纲进行更换外,也可以只对长文本大纲中的部分结构进行更换。例如长文本大纲还包括文本标题,用户可以对长文本大纲中的文 本标题进行更换。因此长文本生成方法还可以包括:响应于接收到文本标题更换请求,基于长文本需求信息生成新的文本标题,以更新长文本大纲中的文本标题。例如,用户可以通过图1所示的终端设备发出文本标题更换请求,服务器105可以响应于接收到的文本标题更换请求根据长文本需求信息生成新的文本标题,并通过图1所示的终端设备向用户呈现所生成的新的文本标题,实现对长文本大纲中文本标题的更换。其中,新的文本标题与前一次生成的文本标题不同,例如标题的范围不同、标题的角度不同等,本公开的实施例对此不作限定。
可选地,在长文本大纲生成并向用户呈现后,用户除了可以对整个长文本大纲、长文本大纲中的部分结构进行更换外,也可以只对长文本大纲中的部分结构进行调整。例如用户可以对长文本大纲中的章节条目进行增加或删除调整,或者对长文本大纲中的章节条目进行降级或升级调整。又例如用户可以对长文本大纲中的文本标题进行修改调整,或者对长文本大纲中章节条目的章节标题进行修改调整。本公开的实施例对此不作限定。
步骤202:响应于接收到与章节条目关联的文件数据,基于文件数据生成章节条目对应的文本片段;
在步骤201的基础上,本步骤旨在由上述执行主体响应于接收到与章节条目关联的文件数据,根据文件数据生成章节条目对应的文本片段,作为对应的章节正文。本公开的实施例对根据文件数据生成章节条目对应的文本片段的实现方式不作限定。例如,可以根据文件数据进行信息检索,根据检索到的信息与文件数据生成章节条目对应的文本片段;也可以根据文件数据生成对章节条目的关键描述信息,再根据关键描述信息进行信息检索,并根据检索到的信息与文件数据生成章节条目对应的文本片段。
其中,文件数据是与章节条目需要生成的文本片段相关的数据,可以包括与章节条目关联的信息和/或参考文件,本公开的实施例对文件数据的形式不作限定。例如,用户可以通过图1所示的终端设备在章节条目下输入与章节条目关联的信息,服务器105可以根据用户输入的与章节条目关联的信息生成该章节条目对应的文本片段。又例如,用户可 以通过图1所示的终端设备在章节条目下上传参考文件,服务器105可以根据用户上传的参考文件生成该章节条目对应的文本片段。再例如,用户可以通过图1所示的终端设备在章节条目下输入与章节条目关联的信息并上传参考文件,服务器105可以根据用户输入的与章节条目关联的信息和上传的参考文件生成该章节条目对应的文本片段。
可选地,步骤202中基于文件数据生成章节条目对应的文本片段可以包括以下步骤:基于长文本大纲和与章节条目关联的文件数据生成大纲轮廓,其中大纲轮廓中包括章节条目的关键描述信息;基于文件数据和关键描述信息,生成章节条目对应的文本片段。例如,可以根据与章节条目关联的文件数据利用预设专业知识库生成章节条目的关键描述信息,并根据长文本大纲和关键描述信息形成大纲轮廓,其中预设专业知识库可以根据文件数据完善对章节条目的关键描述信息。例如,可以根据各章节条目的关键描述信息进行信息检索,并根据检索到的信息与该章节条目的文件数据生成该章节条目对应的文本片段,其中可以利用关键描述信息确定章节条目的关键词和要点,以利用关键词和要点进行信息检索。通过先生成章节条目的关键描述信息,再生成章节条目对应的文本片段,细化长文本的生成过程,可以提升所生成的长文本的专业性,使其更符合用户的需求。
可选地,文件数据可以包括文本数据、图片数据、表格数据中的一项或多项,本公开的实施例对根据文件数据的类型不作限定,其中文本数据为结构化数据,图片数据和表格数据为非结构化数据。步骤202在生成章节条目对应的文本片段的过程中还可以对结构化数据和非结构化数据进行转换,可以丰富长文本的内容,提升长文本的可读性。
例如,步骤202还可以包括以下步骤:将文件数据中的图片数据插入章节条目对应的文本片段;和/或,将文件数据中的表格数据插入章节条目对应的文本片段。其中,如果文件数据包括图片数据,在生成章节条目对应的文本片段的过程中,可以将图片数据转换为结构化数据,并根据章节条目对应的文本片段确定转换后的数据插入的位置将转换后的数据插入,对图片数据进行呈现。如果文件数据包括表格数据,在生成章节条目对应的文本片段的过程中,可以将表格数据转换为结构化数据, 并根据章节条目对应的文本片段确定转换后的数据插入的位置将转换后的数据插入,对表格数据进行呈现。本公开的实施例对图片数据、表格数据格式转换的实现方式不作限定。
又例如,步骤202还可以包括以下步骤:将文本数据中满足图表要求的数据描述信息转换为图表数据插入章节条目对应的文本片段;和/或,将文本数据中满足公式要求的数据描述信息转换为公式数据插入章节条目对应的文本片段。其中,图表数据和公式数据为非结构化数据。如果文本数据包括满足图表要求的数据描述信息,在生成章节条目对应的文本片段的过程中,可以将满足图表要求的数据描述信息转换为图表数据,并根据章节条目对应的文本片段确定转换后的数据插入的位置将转换后的数据插入,以图表数据的形式进行呈现,例如饼图、柱状图、折线图等。如果文本数据包括满足公式要求的数据描述信息,在生成章节条目对应的文本片段的过程中,可以将满足公式要求的数据描述信息转换为公式数据,并根据章节条目对应的文本片段确定转换后的数据插入的位置将转换后的数据插入,以公式数据的形式进行呈现。本公开的实施例对文本数据转换为图表数据、公式数据的实现方式不作限定。
步骤203:基于长文本大纲和章节条目对应的文本片段生成长文本。
在步骤202的基础上,本步骤旨在由上述执行主体根据长文本大纲和章节条目对应的文本片段,对长文本大纲与章节条目对应的文本片段进行组合生成满足需求的长文本。本公开的实施例对长文本的类型不作限定,例如长文本可以是论文、教案或总结等满足不同需求的长文本。又例如,在服务器105根据长文本大纲和章节条目对应的文本片段生成长文本后,可以通过图1所示的终端设备向用户呈现所生成的长文本。
可选地,长文本生成方法还可以包括以下步骤:对长文本进行润色处理,以使所生成的长文本更加专业;和/或,对长文本进行格式调整处理,以使所生成的长文本更加符合长文本的格式要求。例如,通过对所生成的长文本进行润色处理,可以去除长文本中出现的不需要的逻辑词,如首先、其次、最后等,可以去除长文本中不需要的重复内容,以及使长文本的内容更符合事实。其中,长文本的格式可以根据长文本的类型确定,对长文本的格式调整可以根据长文本的类型、长文本的生成方式 等确定,本公开的实施例对此不作限定,例如,通过对所生成的长文本进行格式调整,可以将长文本大纲中的章节条目修正为标准的章节目录,可以在长文本后面添加参考文献、声明等。
可选地,步骤202中基于文件数据生成章节条目对应的文本片段可以包括:基于多个章节条目各自关联的文件数据,分别生成多个章节条目各自对应的文本片段,其中至少一个章节条目对应至少二个文本片段;步骤203基于长文本大纲和章节条目对应的文本片段生成长文本可以包括:基于长文本大纲和多个章节条目各自对应的文本片段生成至少二篇长文本。长文本生成方法还可以包括:对至少二篇长文本进行评审,根据每一篇长文本的评审得分输出得分最高的长文本,以对所生成的长文本进行择优处理,可以使所生成的长文本更加专业。本公开的实施例对评审的标准不作限定,例如可以从专业性、事实性等维度对长文本进行评审。
可选地,对于一个章节条目,可以根据章节条目预设生成文本片段的参数生成至少二个对应的文本片段,例如预设生成文本片段的参数可以是多样性参数,如同义词、近义词等,也可以是惩罚性参数,如禁用词等。例如,对于一个章节条目,可以根据同义词生成第一个对应的文本片段,可以根据近义词生成第二个对应的文本片段。又例如,对于一个章节条目,可以根据一部分禁用词生成第一个对应的文本片段,可以根据另一部分禁用词生成第二个对应的文本片段。可选地,对于一个章节条目,可以根据章节条目进行检索的关键词生成至少二个对应的文本片段。例如,对于一个章节条目,可以根据一部分关键词进行检索生成第一个对应的文本片段,可以根据另一部分关键词进行检索生成第二个对应的文本片段。
本公开的实施例提供的长文本生成方法200,通过基于长文本需求信息生成包括章节条目的长文本大纲,响应于接收到与章节条目关联的文件数据,基于文件数据生成章节条目对应的文本片段,基于长文本大纲和章节条目对应的文本片段生成长文本,不仅能够根据用户提供的长文本需求信息自动生成长文本,还允许用户在长文本大纲中的章节条目下提供文件数据,根据文件数据生成独具个性的专业长文 本,赋予了长文本生成极大的灵活性,可以满足用户对于个性化、定制化长文本生成的迫切需求,使长文本的创作变得更加高效和便捷。
请参考图3,图3为本公开实施例提供的另一种长文本生成方法的流程图,即针对图2所示的流程200中的步骤202提供了一种具体的实现方式,流程200中的其它步骤并不做调整,也将本实施例所提供的具体实现方式以替换步骤202的方式得到一个新的完整实施例。其中流程300包括以下步骤:
步骤301:基于长文本需求信息生成长文本大纲,长文本大纲包括章节条目;
在一些可选的实施例中,本步骤旨在由长文本生成方法的执行主体,例如图1所示的服务器105,将长文本需求信息输入微调模型,通过微调模型根据历史生成的大纲生成长文本大纲。用户需要更换所生成的长文本大纲,可以根据所生成的长文本大纲通过微调模型利用历史生成的大纲生成新的长文本大纲。其中,通过微调模型生成的长文本大纲可以满足预设生成长文本大纲的要求,例如所生成的大纲的各个章节不重复,所生成的大纲的每个章节条目下面的描述信息不超过20个字,所生成的大纲需要包括二级标题和三级标题等。可选地,用户需要更换所生成的长文本大纲中的文本标题,也可以根据所生成的长文本大纲中的文本标题通过微调模型利用历史生成的文本标题生成新的文本标题。
步骤302:将长文本大纲和文件数据输入经过少样本提示引导的大语言模型,利用预设专业知识库生成大纲轮廓;
在步骤301的基础上,本步骤旨在由上述执行主体将长文本大纲和文件数据输入经过少样本提示(few-shot prompting)引导的大语言模型,利用预设专业知识库生成大纲轮廓。其中,在每次生成大纲轮廓之前,都需要通过少样本提示对大语言模型进行引导,以使所生成的大纲轮廓可以严格遵从大纲的格式。文件数据可以包括用户在长文本大纲的章节条目下编辑输入的与章节条目关联的信息,也可以包括用户在长文本大纲的章节条目下上传的参考文件,例如word、pdf、excel、 png等格式的参考文件。相对于步骤301中大纲中每个章节条目下面的描述信息,大纲轮廓中每个章节条目下面的关键描述信息对章节进行了更详细的描述,由关键描述信息可以确定章节的关键词和要点。
步骤303:利用关键描述信息进行信息检索,并根据检索到的信息与文件数据生成章节条目对应的文本片段;
在一些可选的实施例中,在步骤302的基础上,本步骤旨在由上述执行主体对大纲轮廓中的各个章节条目进行拆分,并分别将拆分得到的各个章节条目的文件数据和关键描述信息输入经过有监督微调(Supervised Fine-Tun-ing,简称SFT)的大语言模型,利用当前章节条目的关键描述信息确定章节条目的关键词和要点,以利用关键词和要点进行信息检索,并根据检索到的信息与当前章节条目的文件数据生成当前章节条目对应的文本片段。其中,对大语言模型进行有监督微调可以保证文本片段生成的效果,使每个章节条目对应的文本片段可以满足预设生成文本片段的要求,例如所生成的文本片段的字数要求为1500字以内,所生成的文本片段从当前章节条目开始,而不生成其他章节条目的内容。
其中,有监督微调的大语言模型也对图片数据、表格数据、文本数据中满足图表要求的数据描述信息、满足公式要求的数据描述信息插入的格式进行了规定。例如,所生成的文本片段需要参考文件数据中包括的图片数据,图片数据可以按照如下格式进行插入“图:XXX架构图,![图片描述caption](图片url)--图片”所生成的文本片段需要参考的文本数据中包括满足图表要求的数据描述信息,可以将满足图表要求的数据描述信息生成对应的json字符串:{"caption":"图表N百度经营现金流(亿人民币)","columns":["时间","同比(%)"],"data":[["2018FY",0]]}进行插入。对满足公式要求的数据描述信息插入可以参照满足图表要求的数据描述信息的插入,故此处不再赘述。
步骤304:基于长文本大纲和章节条目对应的文本片段生成长文本。
在步骤303的基础上,本步骤旨在由上述执行主体对长文本大纲与章节条目对应的文本片段进行组合,生成由章节目录与章节正文组 成的长文本。在一些可选的实施例中,还可以由上述执行主体对所生成的长文本进行润色处理和择优处理。例如,可以将长文本输入大语言模型进行润色处理。例如,可以根据多个章节条目各自关联的文件数据分别生成多个章节条目各自对应的文本片段,并使其中至少一个章节条目对应至少二个文本片段,从而可以根据长文本大纲和多个章节条目各自对应的文本片段生成至少二篇长文本,可以将至少二篇长文本输入择优模型进行评审,根据每一篇长文本的评审得分输出得分最高的长文本。由于二篇长文本是通过人工智能(Artificial Intelligence,简称AI)生成,在对长文本进行评审时可以将人工智能生成的文本的特征或风格,即AI味作为一个维度的评审指标。例如,评审结果可以以json串输出,如:{“最好的长文”:长文1}。
步骤305:对长文本进行格式调整处理。
在一些可选的实施例中,在步骤304的基础上,本步骤旨在由上述执行主体剔除一些大语言模型生成的内容,例如(注:以上内容|(注:由于字数限制|(注:由于|由于学术研究的严谨性);将章节条目修正为标准的章节目录,例如“##引言”修正为“第一章引言”,“###研究目的及意义”修正为“1.1研究目的及意义”;在长文本后面添加参考文献和声明。
为加深理解,本公开结合一个具体应用场景,给出了一种具体的实现方案:请参考图4、图5A和图5B,图4为本公开实施例提供的一种长文本生成方法的具体应用场景的流程图,图5A和图5B为本公开实施例提供的一种长文本生成方法的具体应用场景的用户界面图。其中,
步骤401:基于长文本需求信息生成长文本大纲,长文本大纲包括文本标题和章节条目。如图5A所示,在终端设备的用户界面提供了两种根据长文本需求信息生成长文本的方式,其中,左侧501为通过用户输入的长文本主题信息生成长文本,右侧502为通过用户上传的参考文件生成长文本,当选择通过用户输入的长文本主题信息生成长文本,并在用户界面的输入框中503中输入长文本主题信息“大模 型”,点击按钮504进行长文本大纲的生成,并在终端设备的用户界面中向用户呈现所生成的长文本大纲,如图5B所示,用户可以根据自己的需求对生成的长文本大纲进行更换或调整,例如更换文本标题或更换大纲。
步骤402:用户可以在长文本大纲的章节条目下提供与章节条目关联的文件数据,文件数据可以包括用户上传的参考文件和/或用户输入的与章节条目关联的信息。如图5B所示,用户在长文本大纲的章节条目“1.1研究背景与意义”下上传了四个参考文件,即word文件505、pdf文件506、excel文件507和txt文件508,用户在长文本大纲的章节条目下上传参考文件和/或输入与章节条目关联的信息后,可以执行步骤403至步骤406生成长文本,例如可以通过点击按钮执行上述步骤直接生成长文本,并在终端设备的用户界面中向用户呈现所生成的生成长文本。
其中,步骤403:响应于接收到与章节条目关联的文件数据,基于长文本大纲和与章节条目关联的文件数据生成大纲轮廓,大纲轮廓中包括章节条目的关键描述信息;步骤404:基于文件数据和关键描述信息,生成章节条目对应的文本片段,基于长文本大纲和章节条目对应的文本片段生成长文本;步骤405:对长文本进行润色处理和/或择优处理;步骤406:对长文本进行格式调整处理。
在生成长文本的过程中,excel文件507可以转换为json格式,插入章节条目对应的文本片段中。word文件505中满足图表要求的数据描述信息可以转换为图表数据,插入章节条目对应的文本片段中。对长文本进行格式调整,例如可以将json格式的长文本映射为标准的论文格式,即包括章节目录和章节正文。
进一步参考图6,作为对上述各图所示方法的实现,本公开还提供了一种长文本生成装置实施例,长文本生成装置实施例与图2至图5所示的长文本生成方法实施例相对应。上述装置具体可以应用于各种电子设备中。
如图6所示,本实施例的长文本生成装置600可以包括:大纲生 成单元601、文本片段生成单元602和长文本生成单元603。其中,大纲生成单元601,被配置成基于长文本需求信息生成长文本大纲,长文本大纲包括章节条目;文本片段生成单元602,被配置成响应于接收到与章节条目关联的文件数据,基于文件数据生成章节条目对应的文本片段;长文本生成单元603,被配置成基于长文本大纲和章节条目对应的文本片段生成长文本。
在本实施例中,长文本生成装置600中:大纲生成单元601、文本片段生成单元602和长文本生成单元603的具体处理及其所带来的技术效果可分别参考图2至图5对应实施例中各步骤的相关说明,在此不再赘述。
本实施例作为对应于上述方法实施例的装置实施例存在,本实施例提供的长文本生成装置600,不仅能够根据用户提供的长文本需求信息自动生成长文本,还允许用户在长文本大纲中的章节条目下提供文件数据,根据文件数据生成独具个性的专业长文本,赋予了长文本生成极大的灵活性,可以满足用户对于个性化、定制化长文本生成的迫切需求,使长文本的创作变得更加高效和便捷。
在本实施例的一些可选的实现方式中,文本片段生成单元602可以包括:大纲轮廓生成子单元,被配置成基于长文本大纲和与章节条目关联的文件数据生成大纲轮廓,其中大纲轮廓中包括章节条目的关键描述信息;文本片段生成子单元,被配置成基于文件数据和关键描述信息,生成章节条目对应的文本片段。
在本实施例的一些可选的实现方式中,文件数据中包括以下一项或多项:文本数据、图片数据、表格数据;文本片段生成单元602还可以被配置成:将文件数据中的图片数据插入章节条目对应的文本片段;和/或,将文件数据中的表格数据插入章节条目对应的文本片段。
在本实施例的一些可选的实现方式中,文本片段生成单元602还可以被配置成:将文本数据中满足图表要求的数据描述信息转换为图表数据插入章节条目对应的文本片段;和/或,将文本数据中满足公式要求的数据描述信息转换为公式数据插入章节条目对应的文本片段。
在本实施例的一些可选的实现方式中,大纲轮廓生成子单元可以 被进一步配置成:将长文本大纲和文件数据输入经过少样本提示引导的大语言模型,利用预设专业知识库生成大纲轮廓。
在本实施例的一些可选的实现方式中,文本片段生成子单元可以被进一步配置成:利用关键描述信息进行信息检索,并根据检索到的信息与文件数据生成章节条目对应的文本片段。
在本实施例的一些可选的实现方式中,长文本生成装置600还可以包括:润色处理单元和/或格式调整单元。其中,润色处理单元可以被配置成对长文本进行润色处理;格式调整单元可以被配置成对长文本进行格式调整处理。
在本实施例的一些可选的实现方式中,润色处理单元可以被进一步配置成:将长文本输入大语言模型进行润色处理。
在本实施例的一些可选的实现方式中,文本片段生成单元602可以被进一步配置成:基于多个章节条目各自关联的文本数据,分别生成多个章节条目各自对应的文本片段,其中至少一个章节条目对应至少二个文本片段;长文本生成单元603可以被进一步配置成:基于长文本大纲和多个章节条目各自对应的文本片段生成至少二篇长文本;择优处理单元可以被进一步配置成:对至少二篇长文本进行评审,根据每一篇长文本的评审得分输出得分最高的长文本。
在本实施例的一些可选的实现方式中,长文本需求信息包括长文本主题信息和/或参考文件。
在本实施例的一些可选的实现方式中,大纲生成单元601还可以被配置成:响应于接收到大纲更换请求,基于长文本需求信息生成新的长文本大纲,以更新长文本大纲。
在本实施例的一些可选的实现方式中,长文本大纲还包括文本标题;大纲生成单元601还可以被配置成:响应于接收到文本标题更换请求,基于长文本需求信息生成新的文本标题,以更新长文本大纲中的文本标题。
在本实施例的一些可选的实现方式中,大纲生成单元601可以被进一步配置成:将长文本需求信息输入微调模型,根据历史生成的大纲生成长文本大纲。
根据本公开的实施例,本公开还提供了一种电子设备,该电子设备包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,该指令被至少一个处理器执行,以使至少一个处理器执行时能够实现上述任一实施例描述的长文本生成方法。
根据本公开的实施例,本公开还提供了一种可读存储介质,该可读存储介质存储有计算机指令,该计算机指令用于使计算机执行时能够实现上述任一实施例描述的长文本生成方法。
本公开实施例提供了一种计算机程序产品,该计算机程序在被处理器执行时能够实现上述任一实施例描述的长文本生成方法。
图7示出了可以用来实施本公开的实施例的示例电子设备700的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。
如图7所示,设备700包括计算单元701,其可以根据存储在只读存储器(ROM)702中的计算机程序或者从存储单元708加载到随机访问存储器(RAM)703中的计算机程序,来执行各种适当的动作和处理。在RAM 703中,还可存储设备700操作所需的各种程序和数据。计算单元701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。
设备700中的多个部件连接至I/O接口705,包括:输入单元706,例如键盘、鼠标等;输出单元707,例如各种类型的显示器、扬声器等;存储单元708,例如磁盘、光盘等;以及通信单元709,例如网卡、调制解调器、无线通信收发机等。通信单元709允许设备700通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。
计算单元701可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元701的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元701执行上文所描述的各个方法和处理,例如长文本生成方法。例如,在一些实施例中,长文本生成方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元708。在一些实施例中,计算机程序的部分或者全部可以经由ROM 702和/或通信单元709而被载入和/或安装到设备700上。当计算机程序加载到RAM 703并由计算单元701执行时,可以执行上文描述的长文本生成方法的一个或多个步骤。备选地,在其他实施例中,计算单元701可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行长文本生成方法。
本文中以上描述的系统和技术的各种实施例可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施例可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施例交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器 的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决传统物理主机与虚拟专用服务器(VPS,Virtual Private Server)服务中存在的管理难度大,业务扩展性弱的缺陷。
本公开实施例的技术方案,通过基于长文本需求信息生成包括章节条目的长文本大纲,响应于接收到与章节条目关联的文件数据,基于文件数据生成章节条目对应的文本片段,基于长文本大纲和章节条目对应的文本片段生成长文本,不仅能够根据用户提供的长文本需求信息自动生成长文本,还允许用户在长文本大纲中的章节条目下提供文件数据,根据文件数据生成独具个性的专业长文本,赋予了长文本生成极大的灵活性,可以满足用户对于个性化、定制化长文本生成的迫切需求,使长文本的创作变得更加高效和便捷。
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。
上述具体实施例,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。

Claims (29)

  1. 一种长文本生成方法,包括:
    基于长文本需求信息生成长文本大纲,所述长文本大纲包括章节条目;
    响应于接收到与所述章节条目关联的文件数据,基于所述文件数据生成所述章节条目对应的文本片段;
    基于所述长文本大纲和所述章节条目对应的文本片段生成长文本。
  2. 根据权利要求1所述的长文本生成方法,其中,所述基于所述文件数据生成所述章节条目对应的文本片段,包括:
    基于所述长文本大纲和与所述章节条目关联的文件数据生成大纲轮廓,所述大纲轮廓中包括所述章节条目的关键描述信息;
    基于所述文件数据和所述关键描述信息,生成所述章节条目对应的文本片段。
  3. 根据权利要求2所述的长文本生成方法,其中,所述文件数据中包括以下一项或多项:文本数据、图片数据、表格数据;
    所述方法还包括:
    将所述文件数据中的图片数据插入所述章节条目对应的文本片段;
    和/或,将所述文件数据中的表格数据插入所述章节条目对应的文本片段。
  4. 根据权利要求3所述的长文本生成方法,还包括:
    将所述文本数据中满足图表要求的数据描述信息转换为图表数据插入所述章节条目对应的文本片段;
    和/或,将所述文本数据中满足公式要求的数据描述信息转换为公式数据插入所述章节条目对应的文本片段。
  5. 根据权利要求2所述的长文本生成方法,其中,所述基于所述长 文本大纲和与所述章节条目关联的文件数据生成大纲轮廓,包括:
    将所述长文本大纲和所述文件数据输入经过少样本提示引导的大语言模型,利用预设专业知识库生成所述大纲轮廓。
  6. 根据权利要求2所述的长文本生成方法,其中,所述基于所述文件数据和所述关键描述信息,生成所述章节条目对应的文本片段,包括:
    利用所述关键描述信息进行信息检索,并根据检索到的信息与所述文件数据生成所述章节条目对应的文本片段。
  7. 根据权利要求1至6中任一项所述的长文本生成方法,还包括:
    对所述长文本进行润色处理;
    和/或,对所述长文本进行格式调整处理。
  8. 根据权利要求7所述的长文本生成方法,其中,所述对所述长文本进行润色处理,包括:
    将所述长文本输入大语言模型进行润色处理。
  9. 根据权利要求1至6中任一项所述的长文本生成方法,其中,所述基于所述文件数据生成所述章节条目对应的文本片段,包括:
    基于多个章节条目各自关联的所述文件数据,分别生成多个所述章节条目各自对应的文本片段,其中至少一个所述章节条目对应至少二个文本片段;
    所述基于所述长文本大纲和所述章节条目对应的文本片段生成长文本,包括:
    基于所述长文本大纲和所述多个章节条目各自对应的文本片段生成至少二篇所述长文本;
    所述方法还包括:对至少二篇所述长文本进行评审,根据每一篇所述长文本的评审得分输出得分最高的所述长文本。
  10. 根据权利要求1至6中任一项所述的长文本生成方法,其中, 所述长文本需求信息包括长文本主题信息和/或参考文件。
  11. 根据权利要求1至6中任一项所述的长文本生成方法,还包括:
    响应于接收到大纲更换请求,基于所述长文本需求信息生成新的长文本大纲,以更新所述长文本大纲。
  12. 根据权利要求1至6中任一项所述的长文本生成方法,其中,所述长文本大纲还包括文本标题;
    所述方法还包括:
    响应于接收到文本标题更换请求,基于所述长文本需求信息生成新的文本标题,以更新所述长文本大纲中的所述文本标题。
  13. 根据权利要求1至6中任一项所述的长文本生成方法,其中,所述基于长文本需求信息生成长文本大纲,包括:
    将所述长文本需求信息输入微调模型,根据历史生成的大纲生成所述长文本大纲。
  14. 一种长文本生成装置,包括:
    大纲生成单元,被配置成基于长文本需求信息生成长文本大纲,所述长文本大纲包括章节条目;
    文本片段生成单元,被配置成响应于接收到与所述章节条目关联的文件数据,基于所述文件数据生成所述章节条目对应的文本片段;
    长文本生成单元,被配置成基于所述长文本大纲和所述章节条目对应的文本片段生成长文本。
  15. 根据权利要求14所述的长文本生成装置,其中,所述文本片段生成单元,包括:
    大纲轮廓生成子单元,被配置成基于所述长文本大纲和与所述章节条目关联的文件数据生成大纲轮廓,所述大纲轮廓中包括所述章节条目的关键描述信息;
    文本片段生成子单元,被配置成基于所述文件数据和所述关键描述信息,生成所述章节条目对应的文本片段。
  16. 根据权利要求15所述的长文本生成装置,其中,所述文件数据中包括以下一项或多项:文本数据、图片数据、表格数据;
    所述文本片段生成单元还被配置成:
    将所述文件数据中的图片数据插入所述章节条目对应的文本片段;
    和/或,将所述文件数据中的表格数据插入所述章节条目对应的文本片段。
  17. 根据权利要求16所述的长文本生成装置,所述文本片段生成单元还被配置成:
    将所述文本数据中满足图表要求的数据描述信息转换为图表数据插入所述章节条目对应的文本片段;
    和/或,将所述文本数据中满足公式要求的数据描述信息转换为公式数据插入所述章节条目对应的文本片段。
  18. 根据权利要求15所述的长文本生成装置,其中,所述大纲轮廓生成子单元,被进一步配置成将所述长文本大纲和所述文件数据输入经过少样本提示引导的大语言模型,利用预设专业知识库生成所述大纲轮廓。
  19. 根据权利要求15所述的长文本生成装置,其中,所述文本片段生成子单元,被进一步配置成利用所述关键描述信息进行信息检索,并根据检索到的信息与所述文件数据生成所述章节条目对应的文本片段。
  20. 根据权利要求14至19中任一项所述的长文本生成装置,还包括:
    润色处理单元,被配置成对所述长文本进行润色处理;
    和/或,格式调整单元,被配置成对所述长文本进行格式调整处理。
  21. 根据权利要求20所述的长文本生成装置,其中,所述润色处理单元,被进一步配置成将所述长文本输入大语言模型进行润色处理。
  22. 根据权利要求14至19中任一项所述的长文本生成装置,其中,
    所述文本片段生成单元,被进一步配置成基于多个章节条目各自关联的所述文件数据,分别生成多个所述章节条目各自对应的文本片段,其中至少一个所述章节条目对应至少二个文本片段;
    所述长文本生成单元,被进一步配置成基于所述长文本大纲和所述多个章节条目各自对应的文本片段生成至少二篇所述长文本;
    所述装置还包括:
    择优处理单元,被配置成对至少二篇所述长文本进行评审,根据每一篇所述长文本的评审得分输出得分最高的所述长文本。
  23. 根据权利要求14至19中任一项所述的长文本生成装置,其中,所述长文本需求信息包括长文本主题信息和/或参考文件。
  24. 根据权利要求14至19中任一项所述的长文本生成装置,所述大纲生成单元,还被配置成响应于接收到大纲更换请求,基于所述长文本需求信息生成新的长文本大纲,以更新所述长文本大纲。
  25. 根据权利要求14至19中任一项所述的长文本生成装置,其中,所述长文本大纲还包括文本标题;
    所述大纲生成单元,还被配置成响应于接收到文本标题更换请求,基于所述长文本需求信息生成新的文本标题,以更新所述长文本大纲中的所述文本标题。
  26. 根据权利要求14至19中任一项所述的长文本生成方法,其中,所述大纲生成单元,还被配置成将所述长文本需求信息输入微调模型,根据历史生成的大纲生成所述长文本大纲。
  27. 一种电子设备,包括:
    至少一个处理器;以及
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-13中任一项所述的长文本生成方法。
  28. 一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行权利要求1-13中任一项所述的长文本生成方法。
  29. 一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现根据权利要求1-13中任一项所述长文本生成方法的步骤。
PCT/CN2024/107321 2024-06-18 2024-07-24 长文本生成方法及装置、设备、存储介质及计算机程序产品 Pending WO2025260445A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP24942085.2A EP4715660A1 (en) 2024-06-18 2024-07-24 Long-text generation method and apparatus, and device, storage medium and computer program product

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410788709.6 2024-06-18
CN202410788709.6A CN118940718A (zh) 2024-06-18 2024-06-18 长文本生成方法及装置、设备、存储介质及计算机程序产品

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US19/427,862 Continuation US20260127356A1 (en) 2024-06-18 2025-12-19 Method and apparatus for generating long text, device, storage medium, and computer program product

Publications (1)

Publication Number Publication Date
WO2025260445A1 true WO2025260445A1 (zh) 2025-12-26

Family

ID=93350575

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/107321 Pending WO2025260445A1 (zh) 2024-06-18 2024-07-24 长文本生成方法及装置、设备、存储介质及计算机程序产品

Country Status (3)

Country Link
EP (1) EP4715660A1 (zh)
CN (1) CN118940718A (zh)
WO (1) WO2025260445A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120068838A (zh) * 2025-04-25 2025-05-30 浪潮通信信息系统有限公司 投标文件生成方法、装置、设备及存储介质
CN121256018A (zh) * 2025-10-24 2026-01-02 北京信工博特智能科技有限公司 一种可控可信的大模型文章生成方法、系统、设备及介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022121165A1 (zh) * 2020-12-10 2022-06-16 平安科技(深圳)有限公司 长文本生成方法、装置、设备及存储介质
US20220237368A1 (en) * 2021-01-22 2022-07-28 Bao Tran Systems and methods for machine content generation
CN116306492A (zh) * 2023-03-27 2023-06-23 北京百度网讯科技有限公司 生成演示文档的方法、装置、电子设备及存储介质
CN117725895A (zh) * 2023-11-20 2024-03-19 同方知网数字出版技术股份有限公司 文档生成方法、装置、设备及介质
CN117743567A (zh) * 2024-02-18 2024-03-22 成都帆点创想科技有限公司 长文本生成方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230402065A1 (en) * 2022-06-08 2023-12-14 Google Llc Generating titles for content segments of media items using machine-learning
CN116796708A (zh) * 2023-06-19 2023-09-22 平安科技(深圳)有限公司 自然语言文本生成方法、装置、电子设备及可读存储介质
CN117875274A (zh) * 2023-10-16 2024-04-12 杭州阿里巴巴海外互联网产业有限公司 生成文章内容的方法及电子设备
CN117436414A (zh) * 2023-10-23 2024-01-23 科大讯飞股份有限公司 演示文稿生成方法、装置、电子设备和存储介质
CN117709306A (zh) * 2023-11-09 2024-03-15 天津大学 一种基于大语言模型的文献综述生成方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022121165A1 (zh) * 2020-12-10 2022-06-16 平安科技(深圳)有限公司 长文本生成方法、装置、设备及存储介质
US20220237368A1 (en) * 2021-01-22 2022-07-28 Bao Tran Systems and methods for machine content generation
CN116306492A (zh) * 2023-03-27 2023-06-23 北京百度网讯科技有限公司 生成演示文档的方法、装置、电子设备及存储介质
CN117725895A (zh) * 2023-11-20 2024-03-19 同方知网数字出版技术股份有限公司 文档生成方法、装置、设备及介质
CN117743567A (zh) * 2024-02-18 2024-03-22 成都帆点创想科技有限公司 长文本生成方法及装置

Also Published As

Publication number Publication date
EP4715660A1 (en) 2026-03-25
CN118940718A (zh) 2024-11-12

Similar Documents

Publication Publication Date Title
US11977567B2 (en) Method of retrieving query, electronic device and medium
WO2025260445A1 (zh) 长文本生成方法及装置、设备、存储介质及计算机程序产品
KR102561951B1 (ko) 모델링 매개 변수의 설정 방법, 장치, 전자 기기 및 기록 매체
CN114492456B (zh) 文本生成方法、模型的训练方法、装置、电子设备及介质
CN116306492A (zh) 生成演示文档的方法、装置、电子设备及存储介质
CN113535749A (zh) 查询语句生成方法及装置
WO2025086657A1 (zh) 图表生成方法、装置、设备和存储介质
CN111753147A (zh) 相似度处理方法、装置、服务器及存储介质
WO2025179754A1 (zh) 生成演示文档的方法、装置、电子设备及存储介质
US20250094694A1 (en) Multi-person cooperative input method, apparatus and system based on input method
JP2021168125A (ja) スマート応答方法及び装置、電子機器、記憶媒体並びにコンピュータプログラム
JP2022091686A (ja) データ注釈方法、装置、電子機器および記憶媒体
WO2025236381A1 (zh) 文档生成方法、装置、设备以及存储介质
WO2022139937A1 (en) Technologies for transforming a data display
CN112397050B (zh) 韵律预测方法、训练方法、装置、电子设备和介质
CN116028618B (zh) 文本处理、文本检索方法、装置、电子设备及存储介质
US20230095352A1 (en) Translation Method, Apparatus and Storage Medium
CN114757214B (zh) 用于优化翻译模型的样本语料的选取方法、相关装置
CN116088692B (zh) 用于呈现候选字符串和训练判别式模型的方法和装置
US20250103963A1 (en) Method for processing query-response information, method for training model, electronic device and medium
US20250094139A1 (en) Method of generating code based on large model, electronic device, and storage medium
CN113360537A (zh) 信息查询方法、装置、电子设备和介质
CN112084393A (zh) 用于输出信息的方法、装置、设备以及存储介质
CN118734795A (zh) 基于文档标题层级结构的文档内容切分方法、装置及设备
KR20230031855A (ko) 메모 생성 방법, 메모 생성 장치, 전자장비, 저장매체 및 컴퓨터 프로그램

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2024942085

Country of ref document: EP

Effective date: 20251219

ENP Entry into the national phase

Ref document number: 2024942085

Country of ref document: EP

Effective date: 20251219

ENP Entry into the national phase

Ref document number: 2024942085

Country of ref document: EP

Effective date: 20251219

ENP Entry into the national phase

Ref document number: 2024942085

Country of ref document: EP

Effective date: 20251219

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24942085

Country of ref document: EP

Kind code of ref document: A1