WO2025236381A1 - 文档生成方法、装置、设备以及存储介质 - Google Patents

文档生成方法、装置、设备以及存储介质

Info

Publication number
WO2025236381A1
WO2025236381A1 PCT/CN2024/104365 CN2024104365W WO2025236381A1 WO 2025236381 A1 WO2025236381 A1 WO 2025236381A1 CN 2024104365 W CN2024104365 W CN 2024104365W WO 2025236381 A1 WO2025236381 A1 WO 2025236381A1
Authority
WO
WIPO (PCT)
Prior art keywords
document
outline
similar
chart
knowledge base
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/104365
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.)
Baidu Online Network Technology Beijing Co Ltd
Original Assignee
Baidu Online Network Technology Beijing 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 Baidu Online Network Technology Beijing Co Ltd filed Critical Baidu Online Network Technology Beijing Co Ltd
Publication of WO2025236381A1 publication Critical patent/WO2025236381A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • 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/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This disclosure relates to the field of artificial intelligence technology, particularly to the fields of neural network models, generative models, or large models.
  • Option 1 The writers collect a large amount of information, write articles, create charts and graphs, and after a lot of work, produce a long document.
  • Option 2 Leveraging the generation capabilities of Large Language Models (LLMs), a portion of the document content is generated by the Large Language Model, and then staff members modify and expand the format based on the content generated by the Large Language Model.
  • LLMs Large Language Models
  • the aforementioned documents mainly refer to long, complex documents containing text and charts, such as industry analysis documents.
  • the generation of these long documents requires manual intervention, and documents in different fields require staff with different background knowledge to write or rewrite them, resulting in a large workload, long time commitment, and high costs.
  • This disclosure provides a document generation method, apparatus, device, and storage medium.
  • a document generation method comprising:
  • a document generation apparatus comprising:
  • the receiving module is used to receive document titles
  • the outline generation module is used to generate a document outline using the document title
  • the data and chart generation module is used to retrieve similar paragraphs from the document knowledge base based on the document outline, and generate chapter content using the document outline and the similar paragraphs; to retrieve relevant data from the data knowledge base based on the document outline, and generate chart information using the document outline and the relevant data; and,
  • the fusion module is used to merge the content of this chapter with the information in this chart to obtain the document.
  • an electronic device comprising:
  • At least one processor At least one processor
  • the memory is 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 any of the methods described in the present disclosure.
  • a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of this disclosure.
  • a computer program product including a computer program that, when executed by a processor, implements any of the methods according to embodiments of this disclosure.
  • the document generation method disclosed herein generates a document outline based on a user-input document title, then generates chapter content and chart information to compose the document based on this outline, and finally merges the chapter content and chart information into the final document content.
  • This method can automatically generate documents based on document titles, especially complex and long documents containing text and charts, thereby saving manpower and time costs and improving document generation efficiency.
  • Figure 1 is a schematic diagram of an application scenario according to an embodiment of the present disclosure.
  • Figure 2 is a flowchart illustrating the implementation of a document generation method according to an embodiment of the present disclosure.
  • Figure 3 is a flowchart illustrating the implementation of generating a document outline using document titles according to an embodiment of this disclosure.
  • Figure 4 is a flowchart illustrating the implementation of generating a document outline using a similar outline and a pre-trained neural network model according to an embodiment of the present disclosure.
  • Figure 5 is a schematic diagram of the overall process of generating a document according to an embodiment of the present disclosure.
  • Figure 6 is a schematic diagram of the structure of a document generation apparatus 600 according to an embodiment of the present disclosure.
  • Figure 7 is a schematic block diagram of an example electronic device 700 according to an embodiment of the present disclosure.
  • a and/or B can represent three cases: A alone, A and B simultaneously, and B alone.
  • at least one in this document means any combination of at least two of a plurality of options, such as including at least one of A, B, and C, which can mean including any one or more elements selected from the set of A, B, and C.
  • first and second in this document refer to and distinguish multiple similar technical terms, and do not imply a specific order or a limitation to only two.
  • first feature and “second feature” refer to two types/two features; the first feature can be one or more, and the second feature can also be one or more.
  • Method one involves industry report writers collecting extensive data, creating charts and graphs, and completing a report after a significant amount of work. This method requires substantial manpower and time for data collection, content writing, chart creation, and formatting adjustments, making it relatively inefficient.
  • Method two utilizes the generation capabilities of large language models to generate a portion of the document content, which staff then combine with the large model... The content generated by the model is formatted and expanded. This method can use a large model to generate some content, but the content generated by the large model cannot be used directly as the content of the report. It can only be used as part of the idea for generating the report. Staff still need to write a lot of text and draw a lot of charts, so the labor cost is still relatively high.
  • FIG. 1 is a schematic diagram of an application scenario according to an embodiment of this disclosure.
  • the application scenario of this disclosure may include, but is not limited to, a client 110 and a document generation device 120.
  • Communication between the client 110 and the document generation device 120 can be achieved through any type of wired or wireless network.
  • the client 110 can be used to receive a document title input by a user and send the document title to the document generation device 120; the document generation device 120 can be used to receive the document title, generate a corresponding document based on the document title, and return the generated document to the client 110.
  • the client 110 proposed in this embodiment includes, but is not limited to, electronic devices such as mobile phones, computers, smart voice interaction devices, smart home appliances, in-vehicle terminals, game consoles, e-book readers, multimedia playback devices, and wearable devices; the document generation device 120 can include an electronic device or server for providing document generation services to the client 110.
  • this embodiment does not impose a specific limitation on the number of clients 110; for example, the application scenario diagram of this embodiment may include one or more clients 110.
  • Figure 2 is a flowchart of a document generation method according to an embodiment of the present disclosure, including:
  • the documents generated in this embodiment mainly include long, complex documents containing both text and charts. Examples include industry analysis documents, industry reports, and research reports.
  • the document knowledge base can pre-store multiple documents in the same field as the document to be generated; the data knowledge base can pre-store related data in the same field as the document to be generated, including but not limited to chart data or chart information such as statistical charts, distribution charts, and trend charts.
  • chart data or chart information such as statistical charts, distribution charts, and trend charts.
  • the system When generating an industry analysis document, the system receives a document title input by the user, determines the corresponding field or industry based on the title, searches for documents in that field or industry in the document knowledge base, and retrieves similar paragraphs related to the document outline from the found documents. Simultaneously, the system searches for data content in that field or industry in the data knowledge base and retrieves related data related to the document outline from the found data content. Using the similar paragraphs obtained from the document knowledge base and the related data obtained from the data knowledge base as materials, the system generates the document corresponding to the document title.
  • the relevant data includes, but is not limited to, chart data or chart information, such as statistical charts, distribution charts, trend charts, etc.
  • the system can automatically generate data step-by-step based on the document title, utilizing a pre-saved document knowledge base and data knowledge base.
  • This process generates or obtains the detailed content needed for a document, including the document outline, chapter content, and charts, thus producing a complete document. No staff are required to collect data, write, or adjust the document during the generation process; therefore, it saves manpower and time costs and improves document generation efficiency.
  • generating a document outline from a document title may include: retrieving similar documents from a document knowledge base based on the received document title; extracting similar outlines from the similar documents; and generating a document outline using the similar outlines and a pre-trained neural network model.
  • the titles of the similar documents are similar to the received document title.
  • a suitable document can be selected as a similar document based on at least one of the following factors: document quality, length, number of citations, update time, and the platform on which it was first published. This improves the quality of the generated document outline. For example, documents with higher quality, longer length, more citations, more recent updates, and/or more influential initial publication platforms can be selected as similar documents.
  • the document knowledge base can pre-store various publicly available documents.
  • This embodiment of the disclosure allows for real-time updates to the document knowledge base, adding new documents and/or deleting documents that have been stored for too long. For example, it can periodically search for publicly available documents in relevant fields or industries, adding new documents to the knowledge base when found; it can also periodically organize the documents stored in the knowledge base, deleting those that have been stored for longer than a preset threshold. This approach maintains the real-time nature, accuracy, and comprehensiveness of the documents in the knowledge base, thereby improving the quality of generated documents.
  • this disclosure also allows for real-time updates to the document knowledge base during the retrieval of similar documents.
  • Figure 3 is a flowchart illustrating the implementation of generating a document outline using document titles according to an embodiment of this disclosure.
  • the document knowledge base is updated in real-time during the retrieval of similar documents. This process includes:
  • this embodiment of the disclosure can directly search for similar documents from the public domain network through a search engine when no document corresponding to the document title exists in the document knowledge base, thereby expanding the scope of similar document searches. Furthermore, similar documents found from the public domain network through the search engine can be added to the document knowledge base, thus continuously expanding the document reserve of the document knowledge base as the user uses it, and this document reserve can keep up with user habits and trends.
  • the storage time of the document can be saved simultaneously; when other users subsequently request the generation of documents, under the same conditions, documents with a storage time more recent than the current time (i.e., later storage time) can be prioritized as similar documents, thereby making the final generated document more likely to include the latest content in the relevant industry or technical field, improving the quality of the generated document.
  • Figure 4 is a flowchart illustrating the process of generating a document outline using a similar outline and a pre-trained neural network model according to an embodiment of the present disclosure. As shown in Figure 4, the process includes:
  • the first and second models can be pre-trained large language models. They can be two modules of the same model or two independent models. If they are independent, they can be trained independently or together.
  • the final output is generated by retrieving information related to the user-input document title from a document knowledge base and providing this retrieved information to the first and/or second models. This method not only improves model performance, especially when handling tasks requiring external information or domain-specific knowledge, but also enhances the reliability and accuracy of the output.
  • relevant paragraph information is retrieved from a document knowledge base.
  • This document knowledge base may be the same as the document knowledge base used to retrieve similar documents, or it may be a different knowledge base. If the document knowledge base used to retrieve paragraph information is different from the document knowledge base used to retrieve similar documents, in some implementations, the document knowledge base used to retrieve similar documents stores the complete document; the document knowledge base used to retrieve paragraph information stores the paragraph information corresponding to the headings in the outline.
  • This type of document knowledge base does not need to store the complete document, but only needs to store the individual paragraphs. Therefore, it is easier to update and expand the knowledge base content, and it is also easier to find relevant paragraphs.
  • the first outline determined based on the document title and outlines of similar documents (i.e., similar outlines), can be considered a preliminary and relatively rough outline.
  • the document outline is a more detailed outline generated based on the relevant paragraph information retrieved after searching according to the first outline. This detailed outline serves as the outline for the document to be generated. Based on this, the chapter content and chart information of the document to be generated are determined, thus generating the final document.
  • the aforementioned process of determining the document outline is a progressive refinement process. This method uses a similar document as a foundation and the document or paragraph information stored in the document knowledge base as data sources to generate a more comprehensive outline, thereby covering more information stored in the document knowledge base.
  • pre-trained neural network models as well as pre-saved document knowledge bases and data knowledge bases, can be used to generate or retrieve relevant content.
  • the document outline and the similar paragraphs are input into a pre-trained third model, which then outputs the chapter content.
  • the third model can include generative models, large language models, etc.
  • the generated chapter content can be made to fit the document outline.
  • the quality of the chapter content can be improved.
  • generating chart information using document outlines and related data includes:
  • the document outline and relevant data are input into a pre-trained fourth model, which interprets the data into charts to obtain chart analysis results. These results are then used to create charts to generate chart information.
  • the relevant data includes, but is not limited to, chart data such as statistical charts, distribution charts, and trend charts. Chart information may include chart content and corresponding annotations.
  • the fourth model may include generative models, large language models, etc.
  • charts can be drawn to meet the requirements of the document outline. Furthermore, the generation of charts is based on chart data retrieved from a data knowledge base, improving the quality of the generated charts. Moreover, this embodiment of the disclosure leverages the generation capabilities of a neural network model to enhance the chart drawing... Efficiency of production.
  • a pre-trained neural network model can also be used.
  • the chapter content and chart information can be input into a pre-trained fifth model, which will then integrate the chart information with the chapter content based on the corresponding annotation information of the chart, and adjust the format of the charts in the chart information to obtain the document.
  • the fifth model can include generative models or large language models. This fifth model integrates chapter content and chart information, and adjusts the format of the chart content to obtain the final document. It automatically integrates text and images, making it suitable for long documents containing a large amount of text and images. Compared to manual document generation, it avoids a lot of tedious manual operations such as chart drawing, and also avoids errors that are prone to occur during manual processing.
  • Figure 5 is a schematic diagram of the overall process of generating a document according to an embodiment of the present disclosure, including the following steps:
  • Receive document title For example, receive the document title entered by the user from the client.
  • the document knowledge base includes multiple documents, one or more tags are pre-set for each document; when retrieving similar documents, the document title is segmented into multiple words; each word is matched with the document's tags, and the document with the most matches is identified as a similar document to the title.
  • the document knowledge base includes multiple documents, when retrieving similar documents, the document title is segmented into multiple words, the frequency of each word in the title is determined, and the document with the most occurrences is identified as a similar document to the title.
  • the paragraph information may include content related to each heading in the first outline, such as subheadings related to the heading, or information related to the heading.
  • the second model Input the first outline and related paragraph information into the larger model, such as the second model.
  • the second model generates a more detailed outline, which serves as the outline for the document to be generated.
  • the process of generating the document outline is a progressively more detailed process. First, a rough first outline is generated based on the document title and one or more similar documents. Then, more detailed paragraph information is retrieved from the document knowledge base, and a more detailed outline is generated based on the first outline and the retrieved paragraph information. By progressively refining and adjusting the document outline, the generated document outline can cover a wider range of content stored in the document knowledge base, thereby improving the quality of the generated document.
  • the chapter content of the document can be generated based on the document outline, i.e., steps S507 and S508 are performed below; at the same time, the chart information of the document can be generated based on the document outline, i.e., steps S509-S511 are performed below. Then, the chapter content and chart information are merged, i.e., step S512 is performed below.
  • the relevant data includes, but is not limited to, chart data, such as line charts, bar charts, and other graphical data.
  • This chart information is related to the chapter content output by the third model and may include the chart and its corresponding label information.
  • steps S507-S508 and steps S509-S511 can be performed separately or sequentially.
  • This embodiment of the disclosure does not restrict the order of the two processes; they only need to be performed before step S512.
  • S512 Input the chapter content and chart information into a pre-trained large model, such as the fifth model.
  • the fifth model integrates the chart information with the chapter content based on the label information corresponding to the chart, and adjusts the format of the charts in the chart information to obtain the document.
  • the first to fifth models involved can be independent and separately trained models, or they can be multiple modules of the same model.
  • the document knowledge base involved in step S502 can be a different knowledge base than the document knowledge bases involved in steps S505 and S507.
  • the document knowledge base involved in step S502 mainly contains outline information, while the document knowledge bases involved in steps S505 and S507 mainly contain specific paragraph information; comparatively, the latter stores more detailed content.
  • FIG6 is a schematic diagram of the structure of a document generation apparatus 600 according to an embodiment of this disclosure, including:
  • Receiver module 601 is used to receive document titles
  • the outline generation module 602 is used to generate a document outline using the document title
  • the data and chart generation module 603 is used to retrieve similar paragraphs from the document knowledge base based on the document outline, and generate chapter content using the document outline and the similar paragraphs; to retrieve relevant data from the data knowledge base based on the document outline, and generate chart information using the document outline and the relevant data; and,
  • the fusion module 604 is used to merge the content of this chapter and the information in the chart to obtain the document.
  • the documents generated by the document generation device mainly include complex, long documents containing both text and charts. Examples include industry analysis documents, industry reports, and research reports.
  • the document knowledge base can pre-store multiple documents in the same field as the document to be generated; the data knowledge base can pre-store related data in the same field as the document to be generated. This related data includes, but is not limited to, chart data or chart information, such as statistical charts, distribution charts, and trend charts.
  • chart data or chart information such as statistical charts, distribution charts, and trend charts.
  • the receiving module 601 can receive the document title input by the user, such as the document title input by the user through the client.
  • the document generation device proposed in this embodiment can automatically generate or obtain the detailed content required for the document step by step, namely, the document outline, the chapter content, and the chart information, based on the document title and using a pre-saved document knowledge base and data knowledge base, thereby generating a complete document.
  • the document generation process there is no need for staff to collect data, write, or adjust; therefore, it can save manpower and time costs and improve document generation efficiency.
  • the outline generation module 602 is used for:
  • the document outline is generated using this similar outline and a pre-trained neural network model.
  • the title of the similar document is similar to the title of the document. If in the document... If multiple documents with titles similar to the received document title are retrieved from the knowledge base, a suitable document can be selected as a similar document based on at least one of the following factors: document quality, length, number of citations, update time, and the platform on which it was first published, thereby improving the quality of the generated document outline.
  • the outline generation module 602 is used for:
  • the document outline is generated using this similar outline and a pre-trained neural network model.
  • the storage time of the document can be saved at the same time.
  • documents with a storage time closer to the current time can be used as similar documents first. This makes it easier for the final generated document to contain the latest content in the relevant industry or technical field and improve the quality of the generated document.
  • the outline generation module 602 is used for:
  • relevant paragraph information is retrieved from the document knowledge base
  • the first outline and the relevant paragraph information are input into a pre-trained second model, which then outputs the document outline.
  • the first model and the second model can be pre-trained large language models.
  • the first model and the second model can be two modules of the same model or two independent models. If the first model and the second model are two independent models, they can be trained independently or trained together.
  • the data and chart generation module 603 is used for:
  • the relevant data includes chart data
  • the data and chart generation module 603 is used to: input the document outline and the relevant data into a pre-trained fourth model, and have the fourth model interpret the relevant data into charts to obtain chart analysis results; and use the chart analysis results to draw charts to obtain chart information, which includes the chart and the corresponding annotation information.
  • the relevant data includes, but is not limited to, chart data, such as statistical charts, distribution charts, and trend charts.
  • Chart information may include the chart content and corresponding annotations.
  • the fourth model may include generative models, large language models, etc.
  • the fusion module 604 is used for:
  • the chapter content and the chart information are input into the pre-trained fifth model.
  • the fifth model then integrates the chart information with the chapter content based on the annotation information corresponding to the chart, and adjusts the format of the chart in the chart information to obtain the document.
  • the fifth model can include generative models or large language models, etc.
  • this disclosure also provides an electronic device and a readable storage medium.
  • a quality and a computer program product are also provided.
  • 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 assistants, 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/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/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 document generation methods.
  • the document 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 the computing unit 701, one or more steps of the document generation method described above may be performed.
  • the computing unit 701 may be configured to perform the document 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
  • 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 transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
  • 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 transmitting 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 device, 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 the machine, partially on the machine, or partially on the machine as a standalone software package. It can be executed 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 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 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.
  • Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.
  • Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Medical Informatics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本公开提供了一种文档生成方法、装置、设备以及存储介质,涉及人工智能技术领域,尤其神经网络模型、生成模型或大模型等技术领域。具体实现方案为:接收文档标题;利用该文档标题,生成文档大纲;基于该文档大纲,从文档知识库中检索相似段落,利用该文档大纲和该相似段落生成章节内容;基于该文档大纲,从数据知识库中检索相关数据,利用该文档大纲和该相关数据生成图表信息;以及,将该章节内容和该图表信息进行融合,以得到文档。本公开能够自动生成文档,节约人力和时间成本,提高文档生成效率。

Description

文档生成方法、装置、设备以及存储介质
本申请要求在2024年05月15日提交中国专利局、申请号为202410605300.6、发明名称为“文档生成方法、装置、设备以及存储介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及人工智能技术领域,尤其神经网络模型、生成模型或大模型等技术领域。
背景技术
目前的文档生成方式可以分成两种方案,但是都离不开工作人员搜集大量的文章和数据,进行分析和撰写。具体地:
方案一:由撰写人员收集大量的资料进行撰写、图表绘制等,经过大量的工作,形成一份长文档。
方案二:借助大语言模型(LLM,Large Language Model)的生成能力,由大语言模型生成文档的一部分内容,再由工作人员结合大模型生成的内容进行格式修改及扩写。
上述文档主要指包含文字和图表、并且较为复杂的长文档。例如行业分析文档等。相关技术中,这类长文档的生成过程需要人工参与,并且不同领域的文档需要具备不同背景知识的工作人员撰写或改写,工作量大、时间长、成本高。
发明内容
本公开提供了一种文档生成方法、装置、设备以及存储介质。
根据本公开的一方面,提供了一种文档生成方法,包括:
接收文档标题;
利用该文档标题,生成文档大纲;
基于该文档大纲,从文档知识库中检索相似段落,利用该文档大纲和该相似段落生成章节内容;基于该文档大纲,从数据知识库中检索相关数据,利用该文档大纲和该相关数据生成图表信息;以及,
将该章节内容和该图表信息进行融合,以得到文档。
根据本公开的另一方面,提供了一种文档生成装置,包括:
接收模块,用于接收文档标题;
大纲生成模块,用于利用该文档标题,生成文档大纲;
数据及图表生成模块,用于基于该文档大纲,从文档知识库中检索相似段落,利用该文档大纲和该相似段落生成章节内容;基于该文档大纲,从数据知识库中检索相关数据,利用该文档大纲和该相关数据生成图表信息;以及,
融合模块,用于将该章节内容和该图表信息进行融合,以得到文档。
根据本公开的另一方面,提供了一种电子设备,包括:
至少一个处理器;以及
与该至少一个处理器通信连接的存储器;其中,
该存储器存储有可被该至少一个处理器执行的指令,该指令被该至少一个处理器执行,以使该至少一个处理器能够执行本公开实施例中任一的方法。
根据本公开的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,该计算机指令用于使该计算机执行根据本公开实施例中任一的方法。
根据本公开的另一方面,提供了一种计算机程序产品,包括计算机程序,该计算机程序在被处理器执行时实现根据本公开实施例中任一的方法。
本公开提出的文档生成方法,基于用户输入的文档标题生成文档大纲,基于该文档大纲分别生成用于组成文档的章节内容和图表信息,并将章节内容和图表信息融合为最终的文档内容。通过这种方式,能够自动基于文档标题生成文档,特别是包含文字和图表的复杂长文档,从而节约人力和时间成本,提高文档生成效率。
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。
附图说明
附图用于更好地理解本方案,不构成对本公开的限定。
图1是根据本公开实施例的应用场景示意图。
图2是根据本公开实施例的文档生成方法的实现流程图。
图3是根据本公开实施例的利用文档标题生成文档大纲的实现流程图。
图4是根据本公开实施例的利用相似大纲及预先训练的神经网络模型生成文档大纲的实现流程图。
图5是根据本公开实施例的生成文档的整体流程示意图。
图6是根据本公开实施例的文档生成装置600的结构示意图。
图7是根据本公开实施例的示例电子设备700的示意性框图。
具体实施方式
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。
本公开实施例的“和/或”表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。本文中术语“第一”、“第二”表示指代多个类似的技术用语并对其进行区分,并不是限定顺序的意思,或者限定只有两个的意思,例如,第一特征和第二特征,是指代有两类/两个特征,第一特征可以为一个或多个,第二特征也可以为一个或多个。
目前的文档生成方式都离不开工作人员搜集大量的文章和数据,进行分析、撰写。以编写行业报告为例,目前编写行业报告基本可以分成两种方式。具体地,方式一,行业报告撰写人员,收集大量的资料进行撰写、图表绘制,经过大量的工作,形成一份行业报告。这种方式需要花费大量的人力和时间,进行资料收集、内容撰写、图表绘制和格式调整,效率相对来说很低。方式二,借助大语言模型的生成能力,生成一部分文档内容,工作人员结合大模 型生成的内容进行格式修改及扩写。这种方式可以使用大模型生成部分内容,但大模型生成的内容不能直接作为报告的内容来使用,只能作为生成报告的思路的一部分,仍然需要工作人员撰写大量文字、绘制大量图表,人力成本仍然比较高。
为了解决上述问题,本公开实施例提出了一种自动生成文档的方法。这类文档主要包括包含文字和图表、并且较为复杂的长文档。例如行业报告、行业分析、研究报告等等。本方案的优势在于生成文档时,不需要工作人员进行大量资料收集,不需要进行文字撰写、图表绘制以及文档格式的调整,只需要提供文档标题,采用本方案提出的文档生成方法可以自动检索专业的知识,并结合大模型的生成能力,自动生成一份包含文档和图表等详细信息的文档,节省了大量的人力成本和时间成本,并且避免因人工处理导致的语法错误、语句错误、格式错误等问题,从而提高文档生成的效率。图1是根据本公开实施例的应用场景示意图,如图1所示,本公开实施例的应用场景示意图可以包括但不限于客户端110和文档生成装置120,各个客户端110与文档生成装置120之间可以通过任意类型的有线或无线网络进行通信。具体地,该客户端110可以用于接收用户输入的文档标题,并将文档标题发送至文档生成装置120;文档生成装置120可以用于接收文档标题,并基于文档标题生成对应的文档,并将生成的文档返回至客户端110。其中,本公开实施例提出的客户端110包括但不限于手机、电脑、智能语音交互设备、智能家电、车载终端、游戏主机、电子书阅读器、多媒体播放设备、可穿戴设备等电子设备;文档生成装置120可以包括用于为客户端110提供文档生成服务的电子设备或服务器。此外,本公开实施例并不对客户端110的数量进行具体的限制,例如,本公开实施例的应用场景示意图可以包括一个或多个客户端110。
图2是根据本公开实施例的一种文档生成方法的实现流程图,包括:
S210、接收文档标题;
S220、利用该文档标题,生成文档大纲;
S230、基于该文档大纲,从文档知识库中检索相似段落,利用该文档大纲和该相似段落生成章节内容;并且,基于该文档大纲,从数据知识库中检索相关数据,利用该文档大纲和所述相关数据生成图表信息;
S240、将该章节内容和该图表信息进行融合,以得到文档。
本公开实施例生成的文档主要包括包含文档和图表、并且较为复杂的长文档。例如行业分析文档、行业报告、研究报告等。文档知识库中,可以预先保存与将要生成的文档相同领域的多个文档;数据知识库中,可以预先保存与将要生成的文档相同领域的相关数据,该相关数据包括但不限于图表数据或图表信息,如统计图、分布图、趋势图等。以生成行业分析文档为例,文档知识库中可以包括对应不同行业的文档,数据知识库中包括对应不同行业的数据内容;在生成行业分析文档时,接收用户输入的文档标题,根据该标题确定对应的领域或行业,从文档知识库中查找该领域或行业的文档,并从查找到的文档中检索与文档大纲相关的相似段落;并且,从数据知识库中查找该领域或行业的数据内容,并从查找到的数据内容中检索与文档大纲相关的相关数据;以从文档知识库中获取的相似段落、以及从数据知识库中获取的相关数据作为素材,生成文档标题所对应的文档。其中,相关数据包括但不限于图表数据或图表信息,如统计图、分布图、趋势图等。这一过程中,可以自动根据文档标题,利用预先保存的文档知识库和数据知识库,逐步生 成或得到文档所需的细化内容,即,文档大纲、文档的章节内容和图表信息,从而生成一篇完整的文档。在生成文档的过程中无需工作人员收集数据、进行撰写或调整;因此能够节约人力和时间成本,提高文档生成效率。
在一些实施方式中,利用文档标题生成文档大纲的方式可以包括:基于接收的文档标题,从文档知识库中检索相似文档,从该相似文档中提取相似大纲,利用该相似大纲及预先训练的神经网络模型,生成文档大纲。其中,该相似文档的标题与该文档标题相似。通过从文档知识库中获取标题与接收到的文档标题相似的文档,并以该相似文档的大纲(本公开实施例中称为相似大纲)作为生成文档大纲的基础,能够比较便捷地生成文档大纲。
另外,如果在文档知识库中检索到标题与接收到的文档标题相似的多个文档,则可以按照文档的质量、长度、被引用次数、更新时间、初次公开的平台等因素中的至少之一,从该多个文档中选择适合的文档作为相似文档,进而提高生成文档大纲的质量。例如,选择质量更高、长度更长、被引用次数更多、更新时间距离当前时间更近和/或初次公开平台更有影响力的文档作为相似文档。
其中,文档知识库中可以预先保持已公开的各类文档。本公开实施例可以对文档知识库进行实时更新,实时加入新的文档,和/或删除文档知识库中存在时间过长的文档。例如,周期性搜索已公开的相关领域或行业的文档,当搜索到新的文档时,将该新的文档补充入文档知识库中;还可以周期性地对文档知识库中保存的文档进行整理,删除保存时间超过预设门限的文档。这种方式可以保持文档知识库中文档的实时性、准确性和全面性,从而提高生成文档的质量。
在一些实施方式中,本公开实施例还可以在检索相似文档的过程中,实时更新文档知识库。图3是根据本公开实施例的利用文档标题生成文档大纲的实现流程图,在该过程中,实现了在检索相似文档的过程中实时更新文档知识库。该过程包括:
S310、基于文档标题,从文档知识库中检索相似文档;
S320、在文档知识库中不存在文档标题对应的相似文档的情况下,利用搜索引擎搜索相似文档,并将该相似文档填充入文档知识库中;
S330、从该相似文档中提取相似大纲;
S340、利用该相似大纲及预先训练的神经网络模型,生成文档大纲。
采用上述方案,本公开实施例可以在文档知识库中不存在与文档标题对应的文档的情况下,直接通过搜索引擎从公域网络中搜索相似文档,从而扩大搜索相似文档的范围。并且,可以将通过搜索引擎从公域网络中搜到的相似文档扩充入文档知识库中,从而随着用户的使用过程不断扩大文档知识库的文档储备,且该文档储备能够紧跟用户使用习惯和趋势。另外,在文档知识库中保存新的文档时,可以同时保存该文档的存储时间;在后续其他用户请求生成文档时,在同等条件下,可以优先使用存储时间距离当前时间更近(也就是存储时间更晚)的文档作为相似文档,从而使得最终生成的文档更容易包含相关行业或技术领域的最新内容,提高生成文档的质量。
图4是根据本公开实施例的利用相似大纲及预先训练的神经网络模型生成文档大纲的实现流程图,如图4所示,该过程包括:
S410、将文档标题和相似大纲输入预先训练的第一模型,由该第一模型输出第一大纲;
S420、基于该第一大纲,从文档知识库中检索相关的段落信息;
S430、将该第一大纲和相关的段落信息输入预先训练的第二模型,由该第二模型输出该文档大纲。
其中,第一模型和第二模型可以是预先训练的大语言模型,第一模型和第二模型可以是同一模型的两个模块,也可以是两个相互独立的模型;如果第一模型和第二模型是两个相互独立的模型,这两个模型可以分别独立训练、或者统一进行训练。通过将从文档知识库中检索与用户输入的文档标题相关的信息,并将这些检索到的信息提供给第一模型和/或第二模型,以生成最终的输出。这种方法不仅提高了模型的性能,尤其在处理需要外部信息或特定领域知识的任务时,还提高了输出结果的可靠性和准确性。
本公开实施例中,从文档知识库中检索相关的段落信息,该文档知识库可以与检索相似文档的文档知识库是同一个知识库,或者是不同的知识库。如果检索段落信息的文档知识库与检索相似文档的文档知识库是不同的知识库,在一些实施方式中,用于检索相似文档的文档知识库保存完整的文档;用于检索段落信息的文档知识库保存大纲中的标题所对应的段落信息,这类文档知识库不需要保存完整的文档,而只需要保存独立的段落,因此比较容易更新和扩充知识库内容,也便于查找相关段落。
由上述过程可见,第一大纲根据文档标题和相似文档的大纲(即相似大纲)确定,可以认为是初步确定的、较为粗略的大纲;文档大纲是根据第一大纲进行检索后,根据检索到的相关段落信息生成的细化的大纲,该细化的大纲作为需要生成的文档的大纲,并在此基础上,确定需要生成的文档的章节内容和图表信息,从而生成最终的文档。前述确定文档大纲的过程是逐步细化的过程,这种方式以一个相似文档为基础,并以文档知识库中所保存的文档或段落信息为资料来源,生成一个更为全面的大纲,从而覆盖文档知识库中所保存更多信息。
利用文档大纲(即细化的大纲),分别生成文档所需的章节内容和图表信息,并将章节内容和图表信息进行融合,得到最终的文档。在前述各个环节中,可以利用预先训练的神经网络模型、以及预先保存的文档知识库和数据知识库生成或检索相关内容。
例如,在一些实施方式中,利用文档大纲从文档知识库中检索相似段落之后,将文档大纲和该相似段落输入预先训练的第三模型,由第三模型输出章节内容。
第三模型可以包括生成式模型、大语言模型等。通过基于文档大纲和相似段落,并利用第三模型的生成能力,生成章节内容,能够使得生成的章节内容贴合文档大纲,并以大量相似段落的内容作为生成章节内容的素材,从而提高章节内容的质量。
在一些实施方式中,利用文档大纲和相关数据生成图表信息包括:
将文档大纲和相关数据输入预先训练的第四模型,由第四模型对该相关数据进行图表解读,以得到图表分析结果;利用该图表分析结果进行图表绘制,以得到图表信息。其中,相关数据包括但不限于图表数据,如统计图、分布图、趋势图等。图表信息中可以包括图表内容及图表对应的标注信息。第四模型可以包括生成模型、大语言模型等。
基于文档大纲和相关数据(主要包括图表数据),并利用第四模型的生成能力进行图表绘制,能够绘制出满足文档大纲需求的图表信息,并且在生成图表信息时以从数据知识库中检索的图表数据为依据,提高生成图表信息的质量。并且,本公开实施例借助神经网络模型的生成能力,提高了图表绘 制的效率。
在对章节内容和图表信息进行融合时,也可以采用预先训练的神经网络模型实现,例如,将章节内容和图表信息输入预先训练的第五模型,由第五模型根据图表对应的标注信息,将图表信息与章节内容进行融合,并对图表信息中的图表进行格式调整,以得到文档。
第五模型可以包括生成模型或大语言模型等。采用第五模型对章节内容和图表信息进行融合,并且对图表信息中的图表内容进行格式调整,从而得到最终生成的文档,能够自动实现图、文融合过程,适用于包含较多图文信息的长文档,相较于人工文档生成方式,避免了人工进行图表绘制等大量繁琐操作,并且避免了人工处理容易出现的错漏。
图5是根据本公开实施例的生成文档的整体流程示意图,包括以下步骤:
S501、接收文档标题。例如从客户端接收用户输入的文档标题。
S502、基于文档标题,从文档知识库中检索与该文档标题相似的相似文档。例如,文档知识库中包括多个文档,预先为各个文档设置一个或多个标签;检索相似文档时,对文档标题进行分词处理,得到多个分词;将各个分词与文档的标签进行匹配检测,将匹配个数最多的文档确定为与该标题相似的相似文档。又如,文档知识库中包括多个文档,检索相似文档时,对文档标题进行分词处理,得到多个分词,确定标题中的分词在文档中的出现次数,将出现次数最多的文档确定为与该标题相似的相似文档。
S503、提取相似文档的大纲,即相似大纲。
S504、将文档标题和相似大纲输入预先训练的大模型,如第一模型,由第一模型输出第一大纲。该第一大纲可以认为是一个较为粗略的大纲,第一大纲符合文档标题,并以相似大纲作为参考。
S505、根据第一大纲,从文档知识库中检索相关的段落信息。在一些实施方式中,段落信息可以包括与第一大纲中各个标题相关的内容,如与标题相关的子标题,或者与标题相关的信息。
S506、将第一大纲和相关的段落信息输入大模型,如第二模型,由第二模型生成一个较为细化的大纲,该大纲作为将要生成的文档的大纲。可见,上述过程中,生成文档大纲的过程是一个逐步细化的过程,即首先根据文档标题和检索到的一个或多个相似文档生成较为粗略的第一大纲,再从文档知识库中检索更详细的段落信息,并基于第一大纲和检索到的段落信息生成更为细化的大纲。通过逐步细化和调整文档大纲,能够使生成的文档大纲尽可能地覆盖文档知识库中保存的范围更宽泛的内容,以提高生成文档的质量。
在生成文档大纲之后,可以基于该文档大纲生成文档的章节内容,即执行下述步骤S507和S508;同时,基于该文档大纲生成文档的图表信息,即执行下述步骤S509-S511,之后,将章节内容和图表信息进行融合,即执行下述步骤S512。以下详述这些过程。
S507、基于文档大纲,从文档知识库中检索与文档大纲相似的相似段落。
S508、将文档大纲和相似段落输入预先训练的大模型,如第三模型,由第三模型输出对应的章节内容。在此过程中,第三模型将相似段落作为生成章节内容的资料来源,结合文档大纲,对资料来源进行鉴别、解析、理解等处理,并在解析、理解的基础上,利用相似段落生成章节内容。
S509、基于文档大纲,从数据知识库中检索相关数据。一示例中,相关数据包括但不限于图表数据,例如折线图、柱状图等图形数据。
S510、将文档大纲和检索到的相关数据输入大模型,如第四模型,由第四模型对相关数据进行接入,以得到图表分析结果。
S511、利用图表分析结果进行图表绘制,以得到图表信息,该图表信息是与第三模型输出的章节内容相关的图表信息,可以包括图表及图表对应的标注信息等。
如图5所示,步骤S507-S508、与步骤S509-S511可以分别进行,也可以一先一后执行。本公开实施例对两个过程的先后顺序不做限制,只需要在步骤S512之前执行即可。
S512、将章节内容和图表信息输入预先训练的大模型,如第五模型,由第五模型根据图表对应的标注信息,将图表信息与章节内容进行融合,并对图表信息中的图表进行格式调整,以得到文档。
上述过程中,涉及到的第一模型至第五模型可以是独立且分别训练的模型,也可以是同一模型的多个模块。另外,上述步骤S502中涉及的文档知识库与步骤S505和S507中涉及的文档知识库可以是不同的知识库,例如,步骤S502中涉及的文档知识库中主要包含大纲信息,步骤S505和S507中涉及的文档知识库主要涉及具体的段落信息,相较而言,后者保存的内容更详细。
本公开实施例还提出一种文档生成装置,图6是根据本公开实施例的文档生成装置600的结构示意图,包括:
接收模块601,用于接收文档标题;
大纲生成模块602,用于利用该文档标题,生成文档大纲;
数据及图表生成模块603,用于基于该文档大纲,从文档知识库中检索相似段落,利用该文档大纲和该相似段落生成章节内容;基于该文档大纲,从数据知识库中检索相关数据,利用该文档大纲和该相关数据生成图表信息;以及,
融合模块604,用于将该章节内容和该图表信息进行融合,以得到文档。
文档生成装置生成的文档主要包括包含文档和图表、并且较为复杂的长文档。例如行业分析文档、行业报告、研究报告等。文档知识库中,可以预先保存与将要生成的文档相同领域的多个文档;数据知识库中,可以预先保存与将要生成的文档相同领域的相关数据,该相关数据包括但不限于图表数据或图表信息,如统计图、分布图、趋势图等。以生成行业分析文档为例,文档知识库中可以包括对应不同行业的文档,数据知识库中包括对应不同行业的数据内容。
接收模块601可以接收用户输入的文档标题,如用户通过客户端输入的文档标题。
本公开实施例提出的文档生成装置可以自动根据文档标题,利用预先保存的文档知识库和数据知识库,逐步生成或得到文档所需的细化内容,即,文档大纲、文档的章节内容和图表信息,从而生成一篇完整的文档。在生成文档的过程中无需工作人员收集数据、进行撰写或调整;因此能够节约人力和时间成本,提高文档生成效率。
在一些实施方式中,大纲生成模块602用于:
基于该文档标题,从文档知识库中检索相似文档;
从该相似文档中提取相似大纲;
利用该相似大纲及预先训练的神经网络模型,生成该文档大纲。
在一些实施方式中,该相似文档的标题与该文档标题相似。如果在文档 知识库中检索到标题与接收到的文档标题相似的多个文档,则可以按照文档的质量、长度、被引用次数、更新时间、初次公开的平台等因素中的至少之一,从该多个文档中选择适合的文档作为相似文档,进而提高生成文档大纲的质量。
在一些实施方式中,大纲生成模块602用于:
基于该文档标题,从文档知识库中检索相似文档,在该文档知识库中不存在该文档标题对应的相似文档的情况下,利用搜索引擎搜索相似文档,并将该相似文档填充入该文档知识库中;
从该相似文档中提取相似大纲;
利用该相似大纲及预先训练的神经网络模型,生成该文档大纲。
在文档知识库中保存新的文档时,可以同时保存该文档的存储时间;在后续其他用户请求生成文档时,在同等条件下,可以优先使用存储时间距离当前时间更近的文档作为相似文档,从而使得最终生成的文档更容易包含相关行业或技术领域的最新内容,提高生成文档的质量。
在一些实施方式中,大纲生成模块602用于:
将该文档标题和该相似大纲输入预先训练的第一模型,由该第一模型输出第一大纲;
基于该第一大纲,从文档知识库中检索相关的段落信息;
将该第一大纲和该相关的段落信息输入预先训练的第二模型,由该第二模型输出该文档大纲。
其中,第一模型和第二模型可以是预先训练的大语言模型,第一模型和第二模型可以是同一模型的两个模块,也可以是两个相互独立的模型;如果第一模型和第二模型是两个相互独立的模型,这两个模型可以分别独立训练、或者统一进行训练。
在一些实施方式中,数据及图表生成模块603用于:
将该文档大纲和该相似段落输入预先训练的第三模型,由该第三模型输出该章节内容。
在一些实施方式中,相关数据包括图表数据;
该数据及图表生成模块603用于:将该文档大纲和该相关数据输入预先训练的第四模型,由该第四模型对该相关数据进行图表解读,以得到图表分析结果;利用该图表分析结果进行图表绘制,以得到该图表信息,该图表信息中包括图表及该图表对应的标注信息。
其中,相关数据包括但不限于图表数据,如统计图、分布图、趋势图等。图表信息中可以包括图表内容及图表对应的标注信息。第四模型可以包括生成模型、大语言模型等。
在一些实施方式中,融合模块604用于:
将该章节内容和该图表信息输入预先训练的第五模型,由该第五模型根据该图表对应的标注信息,将该图表信息与该章节内容进行融合,并对该图表信息中的图表进行格式调整,以得到该文档。
第五模型可以包括生成模型或大语言模型等。
本公开实施例的装置的各模块、子模块的具体功能和示例的描述,可以参见上述方法实施例中对应步骤的相关描述,在此不再赘述。
本公开的技术方案中,所涉及的用户个人的获取,存储和应用等,均符合相关法律法规的规定,且不违背公序良俗。
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介 质和一种计算机程序产品。
图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)和互联网。
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,也可以为分布式系统的服务器,或者是结合了区块链的服务器。
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。

Claims (17)

  1. 一种文档生成方法,包括:
    接收文档标题;
    利用所述文档标题,生成文档大纲;
    基于所述文档大纲,从文档知识库中检索相似段落,利用所述文档大纲和所述相似段落生成章节内容;基于所述文档大纲,从数据知识库中检索相关数据,利用所述文档大纲和所述相关数据生成图表信息;以及,
    将所述章节内容和所述图表信息进行融合,以得到文档。
  2. 根据权利要求1所述的方法,其中,所述利用所述文档标题,生成文档大纲,包括:
    基于所述文档标题,从文档知识库中检索相似文档;
    从所述相似文档中提取相似大纲;
    利用所述相似大纲及预先训练的神经网络模型,生成所述文档大纲。
  3. 根据权利要求1所述的方法,其中,所述利用所述文档标题,生成文档大纲,包括:
    基于所述文档标题,从文档知识库中检索相似文档,在所述文档知识库中不存在所述文档标题对应的相似文档的情况下,利用搜索引擎搜索相似文档,并将所述相似文档填充入所述文档知识库中;
    从所述相似文档中提取相似大纲;
    利用所述相似大纲及预先训练的神经网络模型,生成所述文档大纲。
  4. 根据权利要求2或3所述的方法,其中,所述利用所述相似大纲及预先训练的神经网络模型,生成所述文档大纲,包括:
    将所述文档标题和所述相似大纲输入预先训练的第一模型,由所述第一模型输出第一大纲;
    基于所述第一大纲,从文档知识库中检索相关的段落信息;
    将所述第一大纲和所述相关的段落信息输入预先训练的第二模型,由所述第二模型输出所述文档大纲。
  5. 根据权利要求1-4中任一所述的方法,其中,所述利用所述文档大纲和所述相似段落生成章节内容,包括:
    将所述文档大纲和所述相似段落输入预先训练的第三模型,由所述第三模型输出所述章节内容。
  6. 根据权利要求1-4中任一所述的方法,其中,所述相关数据包括图表数据;
    所述利用所述文档大纲和所述相关数据生成图表信息,包括:
    将所述文档大纲和所述相关数据输入预先训练的第四模型,由所述第四模型对所述相关数据进行图表解读,以得到图表分析结果;
    利用所述图表分析结果进行图表绘制,以得到所述图表信息,所述图表信息中包括图表内容及所述图表内容对应的标注信息。
  7. 根据权利要求6所述的方法,其中,所述将所述章节内容和所述图表信息进行融合,以得到文档,包括:
    将所述章节内容和所述图表信息输入预先训练的第五模型,由所述第五模型根据所述图表内容对应的标注信息,将所述图表信息与所述章节内容进行融合,并对所述图表信息中的图表内容进行格式调整,以得到所述文档。
  8. 一种文档生成装置,包括:
    接收模块,用于接收文档标题;
    大纲生成模块,用于利用所述文档标题,生成文档大纲;
    数据及图表生成模块,用于基于所述文档大纲,从文档知识库中检索相似段落,利用所述文档大纲和所述相似段落生成章节内容;基于所述文档大纲,从数据知识库中检索相关数据,利用所述文档大纲和所述相关数据生成图表信息;以及,
    融合模块,用于将所述章节内容和所述图表信息进行融合,以得到文档。
  9. 根据权利要求8所述的装置,其中,所述大纲生成模块用于:
    基于所述文档标题,从文档知识库中检索相似文档;
    从所述相似文档中提取相似大纲;
    利用所述相似大纲及预先训练的神经网络模型,生成所述文档大纲。
  10. 根据权利要求8所述的装置,其中,所述大纲生成模块用于:
    基于所述文档标题,从文档知识库中检索相似文档,在所述文档知识库中不存在所述文档标题对应的相似文档的情况下,利用搜索引擎搜索相似文档,并将所述相似文档填充入所述文档知识库中;
    从所述相似文档中提取相似大纲;
    利用所述相似大纲及预先训练的神经网络模型,生成所述文档大纲。
  11. 根据权利要求9或10所述的装置,其中,所述大纲生成模块用于:
    将所述文档标题和所述相似大纲输入预先训练的第一模型,由所述第一模型输出第一大纲;
    基于所述第一大纲,从文档知识库中检索相关的段落信息;
    将所述第一大纲和所述相关的段落信息输入预先训练的第二模型,由所述第二模型输出所述文档大纲。
  12. 根据权利要求8-11中任一所述的装置,其中,所述数据及图表生成模块用于:
    将所述文档大纲和所述相似段落输入预先训练的第三模型,由所述第三模型输出所述章节内容。
  13. 根据权利要求8-11中任一所述的装置,其中,所述相关数据包括图表数据;
    所述数据及图表生成模块用于:将所述文档大纲和所述相关数据输入预先训练的第四模型,由所述第四模型对所述相关数据进行图表解读,以得到图表分析结果;利用所述图表分析结果进行图表绘制,以得到所述图表信息,所述图表信息中包括图表内容及所述图表内容对应的标注信息。
  14. 根据权利要求13所述的装置,其中,所述融合模块用于:
    将所述章节内容和所述图表信息输入预先训练的第五模型,由所述第五模型根据所述图表内容对应的标注信息,将所述图表信息与所述章节内容进行融合,并对所述图表信息中的图表内容进行格式调整,以得到所述文档。
  15. 一种电子设备,包括:
    至少一个处理器;以及
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-7中任一项所述的方法。
  16. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行根据权利要求1-7中任一项所述的方法。
  17. 一种计算机程序产品,包括计算机程序,所述计算机程序在被处理 器执行时实现根据权利要求1-7中任一项所述的方法。
PCT/CN2024/104365 2024-05-15 2024-07-09 文档生成方法、装置、设备以及存储介质 Pending WO2025236381A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410605300.6 2024-05-15
CN202410605300.6A CN118378097A (zh) 2024-05-15 2024-05-15 一种文档生成方法、装置、设备以及存储介质

Publications (1)

Publication Number Publication Date
WO2025236381A1 true WO2025236381A1 (zh) 2025-11-20

Family

ID=91905653

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/104365 Pending WO2025236381A1 (zh) 2024-05-15 2024-07-09 文档生成方法、装置、设备以及存储介质

Country Status (2)

Country Link
CN (1) CN118378097A (zh)
WO (1) WO2025236381A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119250024B (zh) * 2024-08-01 2025-09-16 百度在线网络技术(北京)有限公司 基于生成式大模型生成研究报告的方法、装置及存储介质
CN119597805B (zh) * 2024-11-15 2025-09-19 百度在线网络技术(北京)有限公司 信息处理方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220229832A1 (en) * 2021-01-19 2022-07-21 Microsoft Technology Licensing, Llc Automated intelligent content generation
US20230252224A1 (en) * 2021-01-22 2023-08-10 Bao Tran Systems and methods for machine content generation
CN117171296A (zh) * 2023-08-02 2023-12-05 北京百度网讯科技有限公司 信息获取方法、装置和电子设备
CN117633172A (zh) * 2023-11-09 2024-03-01 北京捷通华声科技股份有限公司 问答对数据生成方法、装置、电子设备及可读存储介质
CN117725895A (zh) * 2023-11-20 2024-03-19 同方知网数字出版技术股份有限公司 文档生成方法、装置、设备及介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220229832A1 (en) * 2021-01-19 2022-07-21 Microsoft Technology Licensing, Llc Automated intelligent content generation
US20230252224A1 (en) * 2021-01-22 2023-08-10 Bao Tran Systems and methods for machine content generation
CN117171296A (zh) * 2023-08-02 2023-12-05 北京百度网讯科技有限公司 信息获取方法、装置和电子设备
CN117633172A (zh) * 2023-11-09 2024-03-01 北京捷通华声科技股份有限公司 问答对数据生成方法、装置、电子设备及可读存储介质
CN117725895A (zh) * 2023-11-20 2024-03-19 同方知网数字出版技术股份有限公司 文档生成方法、装置、设备及介质

Also Published As

Publication number Publication date
CN118378097A (zh) 2024-07-23

Similar Documents

Publication Publication Date Title
CN116306492B (zh) 生成演示文档的方法、装置、电子设备及存储介质
CN114595686B (zh) 知识抽取方法、知识抽取模型的训练方法及装置
CN112926297B (zh) 处理信息的方法、装置、设备和存储介质
CN114861889A (zh) 深度学习模型的训练方法、目标对象检测方法和装置
US9996535B1 (en) Efficient hierarchical user interface
JP7661512B2 (ja) 情報検索方法、装置、電子機器および記憶媒体
CN118378097A (zh) 一种文档生成方法、装置、设备以及存储介质
WO2025179754A1 (zh) 生成演示文档的方法、装置、电子设备及存储介质
CN114218431B (zh) 视频搜索方法、装置、电子设备以及存储介质
CN117171296B (zh) 信息获取方法、装置和电子设备
CN119357364A (zh) 一种基于大模型的问题答复方法、装置、电子设备及介质
WO2025260445A1 (zh) 长文本生成方法及装置、设备、存储介质及计算机程序产品
CN116028618B (zh) 文本处理、文本检索方法、装置、电子设备及存储介质
CN113408660A (zh) 图书聚类方法、装置、设备和存储介质
CN115858463A (zh) 一种数据管理方法、装置、设备及存储介质
CN114077646B (zh) 信息抽取方法、装置、电子设备及存储介质
CN113377922B (zh) 用于匹配信息的方法、装置、电子设备以及介质
JP2023051423A (ja) 情報処理システム、情報処理方法、および情報処理プログラム
CN113868286A (zh) 一种信息查询方法、装置、设备及存储介质
CN119760070A (zh) 知识问答方法、装置、电子设备及存储介质
CN115203428B (zh) 一种知识图谱构建方法、装置、电子设备及存储介质
CN118734870A (zh) 基于大模型的文本转换方法、装置、电子设备及存储介质
CN119293184A (zh) 报告生成方法、装置、设备、介质及产品
WO2025175698A1 (zh) 信息生成方法和装置、电子设备、计算机可读介质
CN113239257B (zh) 信息处理方法、装置、电子设备及存储介质

Legal Events

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

Ref document number: 24938398

Country of ref document: EP

Kind code of ref document: A1