Document abstract generation method and device, electronic equipment and storage medium
By segmenting documents and performing cyclic summary extraction, the problem of context limitations of large language models in generating long documents is solved, the efficiency and accuracy of summary generation are improved, and system resource consumption is reduced.
Patent Information
- Application Number
- CN202411138255.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-08-19
AI Technical Summary
In the existing technology, when relying on large language models to generate document summaries, there are context limits, which leads to the lack of summary details for long documents and slow model inference speed.
By dividing the documents to be processed into blocks, using a pre-trained summary extraction model to extract summaries of the unit documents to be processed, and cyclically extracting the summary process until the target document summary is generated, the consumption of system resources is reduced.
It improves the efficiency and accuracy of document summary extraction, reduces the consumption of system resources, and realizes efficient summary generation of long documents.
Smart Images

Figure CN119047479B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of document processing technology, and in particular to a document summary generation method, device, electronic device and storage medium. Background Art
[0002] An abstract is a brief summary and distillation of the document's contents, intended to provide the document's key information and main points so that you can quickly understand the document's core content.
[0003] In the prior art, document summaries are mainly generated by using LLM (Large Language Model), which is a method of generating a document summary by inputting documents containing tens of thousands of words into a large language model.
[0004] However, this method relies on the contextual capabilities of the LLM. The current LLM context limit is around 128k. Moreover, the output summary is generally around 1,000 words. For documents with tens of thousands of words, there are cases where summary details are missing, and the document summary generation effect is poor. At the same time, because too much text is input at one time, the LLM model inference speed will be slowed down. Summary of the Invention
[0005] The present invention provides a document summary generation method, device, electronic device and storage medium, which realizes cyclic summary extraction of documents to be processed. Without relying on long context, it can reduce the consumption of system resources and improve the summary extraction efficiency and summary extraction effect of documents.
[0006] According to one aspect of the present invention, a method for generating a document summary is provided, the method comprising:
[0007] Obtaining a document to be processed, and dividing the document to be processed into blocks to obtain at least two units of documents to be processed;
[0008] Inputting each unit document to be processed into a pre-trained summary extraction model, and outputting the unit document summary and unit output state parameter corresponding to each unit document to be processed;
[0009] Dividing each of the unit document summaries to obtain at least one unit document summary group, and determining a unit group document and a unit group input state parameter of the unit document summary group based on each of the unit document summaries and corresponding unit output state parameters in the unit document summary group;
[0010] Inputting each of the unit group documents and the corresponding unit group input state parameters into the summary extraction model, and outputting a unit group document summary and a unit group output state parameter corresponding to at least one of the unit document summary groups;
[0011] When it is detected that the number of the unit group document summaries is greater than 1, the unit group document summary is updated to the unit document summary, the unit group output state parameter is updated to the unit output state parameter, and the step of dividing the unit document summaries to obtain at least one unit document summary group is returned to be executed, and the unit group document and unit group input state parameter of the unit document summary group are determined according to each unit document summary and the corresponding unit output state parameter in the unit document summary group, until it is detected that the number of the unit group document summaries is equal to 1, and the unit group document summary corresponding to the unit document summary group is determined as the target document summary of the document to be processed.
[0012] According to another aspect of the present invention, a document summary generating device is provided, the device comprising:
[0013] A document segmentation module is used to obtain a document to be processed and segment the document to be processed into at least two units of documents to be processed;
[0014] A first summary extraction module is used to input each unit document to be processed into a pre-trained summary extraction model, and output a unit document summary and a unit output state parameter corresponding to each unit document to be processed;
[0015] a document summary grouping module, configured to divide each of the unit document summaries to obtain at least one unit document summary group, and determine a unit group document and a unit group input state parameter of the unit document summary group based on each of the unit document summaries and the corresponding unit output state parameter in the unit document summary group;
[0016] a second summary extraction module, configured to input each of the unit group documents and the corresponding unit group input state parameters into the summary extraction model, and output a unit group document summary and a unit group output state parameter corresponding to at least one of the unit document summary groups;
[0017] A document summary generation module is used to update the unit group document summary to the unit document summary when it is detected that the number of the unit group document summaries is greater than 1, update the unit group document summary to the unit document summary, update the unit group output state parameter to the unit output state parameter, return to execute the steps of dividing each of the unit document summaries to obtain at least one unit document summary group, and determine the unit group document and unit group input state parameter of the unit document summary group according to each of the unit document summaries and the corresponding unit output state parameter in the unit document summary group, until it is detected that the number of the unit group document summaries is equal to 1, and determine the unit group document summary corresponding to the unit document summary group as the target document summary of the document to be processed.
[0018] According to another aspect of the present invention, an electronic device is provided, comprising:
[0019] at least one processor; and
[0020] a memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the document summary generation method according to any embodiment of the present invention.
[0022] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the document summary generation method according to any embodiment of the present invention when executed.
[0023] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the document summary generation method according to any embodiment of the present invention is implemented.
[0024] The technical scheme of the embodiment of the present application divides the to-be-processed document into multiple unit to-be-processed documents by dividing the to-be-processed document, adopts a pre-trained summary extraction model to extract summaries from the unit to-be-processed documents, obtains unit document summaries corresponding to the unit to-be-processed documents and unit output state parameters, based on the summary extraction model, the efficiency and accuracy of the unit to-be-processed document summary extraction can be improved, based on the unit output state parameters, the information extraction of the unit to-be-processed document can be realized; at least one unit document summary group is obtained by dividing the unit document summaries, the unit group document and the unit group input state parameter of the unit document summary group are determined according to the unit document summaries in the unit document summary group and the corresponding unit output state parameters, the unit group document and the corresponding unit group input state parameter are input into the summary extraction model, and the unit group document summary and the unit group output state parameter corresponding to the at least one unit document summary group are output; when it is detected that the number of unit group document summaries is greater than 1, the unit group document summary is updated to the unit document summary, the unit group output state parameter is updated to the unit output state parameter, and the step of dividing the unit document summaries to obtain at least one unit document summary group is returned to be executed, and the unit group document and the unit group input state parameter of the unit document summary group are determined according to the unit document summaries in the unit document summary group and the corresponding unit output state parameters, until it is detected that the number of unit group document summaries is equal to 1, the unit group document summary corresponding to the unit document summary group is determined as the target document summary of the to-be-processed document, and the same summary extraction model is used to realize the cyclic summary extraction of the to-be-processed document, which can reduce the consumption of system resources on the basis of not depending on a long context, and can improve the summary extraction efficiency and summary extraction effect of the document.
[0025] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creating laborious work.
[0027] Figure 1 is a flowchart of a document summary generation method according to the first embodiment of the present application;
[0028] Figure 2 is a flowchart of a document summary generation method according to the second embodiment of the present application;
[0029] Figure 3 is a schematic diagram of a document summary generation method according to a second embodiment of the present invention;
[0030] Figure 4 is an algorithm flow chart of a document summary generation method according to a second embodiment of the present invention;
[0031] Figure 5 This is a schematic diagram of the structure of a document summary generation device provided in accordance with a third embodiment of the present invention;
[0032] Figure 6 The figure is a schematic diagram of the structure of an electronic device for implementing the document summary generation method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] Example 1
[0036] Figure 1 This is a flowchart of a document summary generation method provided in Example 1 of the present invention. This embodiment of the present invention is applicable to summarizing large-scale documents. The method can be performed by a document summary generation device, which can be implemented in hardware and / or software. The document summary generation device can be configured in an electronic device that carries the document summary generation function, such as a client or server.
[0037] See also Figure 1 The document summary generation method shown includes:
[0038] S110: Obtain a document to be processed, and divide the document to be processed into blocks to obtain at least two units of documents to be processed.
[0039] The document to be processed may be a document for which a summary is to be generated. The document to be processed may be a large document. It can be understood that the document to be processed may be a document containing tens of thousands of words. The unit document to be processed may be a result of segmenting the document to be processed.
[0040] Specifically, the document to be processed may be divided into blocks according to a preset word count range to obtain at least two units of documents to be processed. For example, the word count of the document to be processed may be 15,000 words; the preset word count range of the blocks may be 3,000-4,000 words.
[0041] In an optional embodiment of the present invention, the document to be processed is divided into blocks to obtain at least one unit document to be processed, including: parsing the document to be processed to obtain the document structure of the document to be processed; and dividing the document to be processed into blocks according to the document structure of the document to be processed to obtain at least two unit documents to be processed.
[0042] The document structure of the document to be processed may include the document sections of the document to be processed and the document structure determined based on the document segmentation mark. For example, the document segmentation mark may be a space character, a carriage return character, or a page break character.
[0043] Specifically, a document parsing algorithm may be used to parse the document to be processed to obtain a document structure of the document to be processed. The document to be processed may be divided into blocks according to the document structure of the document to be processed, for example, according to the document sections of the document to be processed, to obtain at least two unit documents to be processed.
[0044] This solution parses the document to be processed to obtain the document structure of the document to be processed, and divides the document to be processed into blocks based on the document structure of the document to be processed to obtain at least two unit documents to be processed. This takes the document structure of the document to be processed into consideration and further improves the accuracy of document summary extraction.
[0045] S120 , inputting each unit document to be processed into a pre-trained summary extraction model, and outputting the unit document summary and unit output state parameters corresponding to each unit document to be processed.
[0046] The summary extraction model can be used to extract summaries. The input data of the summary extraction model can be at least one unit document to be processed (or at least one unit group document and the corresponding unit group input state parameter); the output data of the summary extraction model can be the unit document summary and the unit output state parameter corresponding to each unit document to be processed (or the unit group document summary and the unit group output state parameter corresponding to each unit document summary group). Optionally, a supervised training method can be used to pre-train the summary extraction model. The unit document summary can be the summary extraction result of the unit document to be processed. The unit output state parameter can be the information parameter of the unit document to be processed. It can be understood that the unit output state parameter can be used to characterize the document information of the unit document to be processed.
[0047] For example, the summary extraction model can be a pre-trained time step model. The following formula can be used to express the detection principle of the summary extraction model:
[0048]
[0049] y out =Ch out ;
[0050] Where h out h is the unit output state parameter (or unit group output state parameter); in Input state parameters for the unit (or unit group input state parameters), where the unit input state parameters are empty; x in The unit document to be processed (or unit group document); out is the unit document summary (or unit group document summary); and C are the model parameters of the summary extraction model.
[0051] Specifically, each unit document to be processed may be input into a pre-trained summary extraction model, and the unit document summary and unit output state parameters corresponding to each unit document to be processed may be output.
[0052] S130 , dividing each unit document summary to obtain at least one unit document summary group, and determining a unit group document and a unit group input state parameter of the unit document summary group according to each unit document summary and the corresponding unit output state parameter in the unit document summary group.
[0053] The unit document summary group may be a grouping result of the unit document summaries. The number of unit document summaries included in the unit document summary group may be at least two. The unit group document may be a combination result of the unit document summaries in the unit document summary group. The unit group input state parameter may be a combination result of the unit output state parameters corresponding to the unit document summaries in the unit document summary group.
[0054] Specifically, a preset grouping method can be used to divide the unit document summaries to obtain at least one unit document summary group. The unit document summaries in the unit document summary group can be directly combined to obtain the unit group documents of the unit document summary group. The unit output state parameters corresponding to the unit document summaries in the unit document summary group can be directly summed to obtain the unit group input state parameters of the unit document summary group. The preset grouping method can be a preset grouping method for each unit document summary. Exemplarily, the preset grouping method can include random grouping and equal division according to a preset number of summaries. The preset number of summaries can be the number of unit document summaries contained in a preset unit document summary group. The preset grouping method and the preset number of summaries can be set and adjusted by technical personnel based on experience. For example, the preset number of summaries can be 2.
[0055] S140: Input each unit group document and the corresponding unit group input state parameter into a summary extraction model, and output a unit group document summary and a unit group output state parameter corresponding to at least one unit document summary group.
[0056] The unit group document summary may be a summary extraction result of the unit group document. The unit group output state parameter may be an information parameter of the unit group document. It can be understood that the unit group output state parameter can be used to represent the document information of the unit group document.
[0057] Specifically, each unit group document and the corresponding unit group input state parameter may be input into the summary extraction model, and a unit group document summary and a unit group output state parameter corresponding to at least one unit document summary group may be output.
[0058] S150. When it is detected that the number of unit group document summaries is greater than 1, the unit group document summary is updated to a unit document summary, the unit group output status parameter is updated to a unit output status parameter, and the step of dividing the unit document summaries to obtain at least one unit document summary group, and determining the unit group document and the unit group input status parameter of the unit document summary group according to the unit document summaries and the corresponding unit output status parameters in the unit document summary group is returned until it is detected that the number of unit group document summaries is equal to 1, and the unit group document summary corresponding to the unit document summary group is determined as the target document summary of the document to be processed.
[0059] If the number of unit group document summaries is greater than 1, it can be understood that the cyclic summary extraction for the document to be processed has not been completed. If the number of unit group document summaries is equal to 1, it can be understood that the cyclic summary extraction for the document to be processed has been completed. The target document summary can be the final summary generation result of the document to be processed.
[0060] Specifically, when the number of unit group document summaries is detected to be equal to 1, the unit group document summary corresponding to the unit document summary group can be determined as the target document summary of the to-be-processed document. When the number of unit group document summaries is detected to be greater than 1, the unit group document summary can be updated to the unit document summary, the unit group output state parameter is updated to the unit output state parameter, and the step of dividing each unit document summary to obtain at least one unit document summary group is executed, and the unit group document and the unit group input state parameter of the unit document summary group are determined according to each unit document summary and the corresponding unit output state parameter in the unit document summary group, until the number of unit group document summaries is detected to be equal to 1, and the unit group document summary corresponding to the unit document summary group is determined as the target document summary of the to-be-processed document.
[0061] The technical scheme of the embodiment of the application divides the to-be-processed document into multiple unit to-be-processed documents by blocking, extracts summaries from each unit to-be-processed document by using a pre-trained summary extraction model to obtain a unit document summary and a unit output state parameter corresponding to each unit to-be-processed document, can improve the efficiency and accuracy of the unit to-be-processed document summary extraction based on the summary extraction model, and can realize information extraction of the unit to-be-processed document based on the unit output state parameter. The unit document summary is divided to obtain at least one unit document summary group, the unit group document and the unit group input state parameter of the unit document summary group are determined according to each unit document summary and the corresponding unit output state parameter in the unit document summary group, each unit group document and the corresponding unit group input state parameter are input into the summary extraction model, the unit group document summary and the unit group output state parameter corresponding to at least one unit document summary group are output, when the number of unit group document summaries is detected to be greater than 1, the unit group document summary is updated to the unit document summary, the unit group output state parameter is updated to the unit output state parameter, the step of dividing each unit document summary to obtain at least one unit document summary group is executed, and the unit group document and the unit group input state parameter of the unit document summary group are determined according to each unit document summary and the corresponding unit output state parameter in the unit document summary group, until the number of unit group document summaries is detected to be equal to 1, and the unit group document summary corresponding to the unit document summary group is determined as the target document summary of the to-be-processed document. Through the same summary extraction model, the cycle summary extraction of the to-be-processed document is realized, the consumption of system resources can be reduced on the basis of not relying on a long context, and the summary extraction efficiency and the summary extraction effect of the document can be improved.
[0062] In an optional embodiment of the application, after the target document summary of the to-be-processed document is determined, the target document summary is vectorized to obtain a target document summary vector, and the target document summary vector and the to-be-processed document are stored in a database.
[0063] The target document summary vector may be a word vector of the target summary document. The target document summary vector may be used to represent the target document summary or the document to be processed corresponding to the target document summary.
[0064] Specifically, a word vector generation algorithm can be used to vectorize the target document summary to obtain a target document summary vector. The target document summary vector and the document to be processed can be stored in a database in a corresponding manner. The word vector generation algorithm can be a word vector algorithm.
[0065] This solution facilitates the management of target document summaries by vectorizing the target document summaries and storing the target document summary vectors and the corresponding documents to be processed, thereby improving the convenience of managing the documents to be processed corresponding to the target document summaries.
[0066] In an optional embodiment of the present invention, after the target document summary vector is stored corresponding to the document to be processed, the method further includes: when querying the document to be processed, obtaining document query information sent by the document query party; vectorizing the document query information to obtain a document query vector; matching the document query vector with each candidate document summary vector in the database; determining the candidate document summary vector with the highest matching degree with the document query vector as the target document summary vector, and obtaining the corresponding stored document to be processed.
[0067] A document querying party may be a party that queries documents in a database. Document query information may be used to query documents in the database. The document query information may be sent by the document querying party. Optionally, the document query information may include document information of a pending document known to the document querying party. A document query vector may be used to query the pending document. The document query vector may be a term vector of the document query information. The candidate document summary vector may be a document summary vector stored in the database. The number of candidate document summary vectors stored in the database may include at least one.
[0068] Specifically, after the target document summary vector is stored in association with the document to be processed, when a query is performed on the document to be processed, the document query information sent by the document querying party can be obtained. The document query information is vectorized to obtain a document query vector. Fuzzy matching or similarity matching is performed on the document query vector and each candidate document summary vector in the database. The candidate document summary vector with the highest degree of match to the document query vector is determined as the target document summary vector, and the document to be processed corresponding to the target document summary vector is retrieved from the database.
[0069] This solution, after storing the target document summary vector in correspondence with the document to be processed, obtains the document query information sent by the document query party when querying the document to be processed, vectorizes the document query information to obtain a document query vector, matches the document query vector with each candidate document summary vector in the database, determines the candidate document summary vector with the highest matching degree with the document query vector as the target document summary vector, and obtains the corresponding stored document to be processed. By using the candidate document summary vectors and document query vectors pre-stored in the database, the document query efficiency can be improved.
[0070] Example 2
[0071] Figure 2 A flowchart of a document summary generation method provided in the second embodiment of the present invention. Based on the above embodiments, the embodiment of the present invention concretizes "determining the unit group document and unit group input state parameters of the unit document summary group based on the unit document summaries and corresponding unit output state parameters in the unit document summary group" into "combining the unit document summaries in the unit document summary group to determine the unit group document of the unit document summary group; combining the unit group input state parameters corresponding to the unit document summaries in the unit document summary group to determine the unit group input state parameters of the unit document summary group", which can improve the accuracy of the generated document summary. It should be noted that for the parts not described in detail in the embodiments of the present invention, please refer to the description of other embodiments.
[0072] See also Figure 2 The document summary generation method shown includes:
[0073] S210: Obtain a document to be processed, and divide the document to be processed into blocks to obtain at least two units of documents to be processed.
[0074] S220 , inputting each unit document to be processed into a pre-trained summary extraction model, and outputting the unit document summary and unit output state parameter corresponding to each unit document to be processed.
[0075] S230: Divide the unit document summaries to obtain at least one unit document summary group, and combine the unit document summaries in the unit document summary group to determine the unit group documents of the unit document summary group.
[0076] Specifically, the unit document summaries in the unit summary group can be directly combined to obtain the unit group documents of the unit document summary group. Alternatively, the combination can be performed in a random order or in the output order of the unit document summaries in the summary extraction model.
[0077] S240, combine the unit output state parameters corresponding to each unit document summary in the unit document summary group to determine the unit group input state parameter of the unit document summary group.
[0078] Specifically, the unit output state parameters corresponding to each unit document summary in the unit document summary group can be directly summed to obtain the unit group input state parameter of the unit document summary group.
[0079] In an optional embodiment of the present application, combining the unit output state parameters corresponding to each unit document summary in the unit document summary group to determine the unit group input state parameter of the unit document summary group comprises: obtaining the unit document summary weight of each unit document summary in the unit document summary group; and using the unit document summary weight to perform weighted summation on the unit output state parameters corresponding to each unit document summary in the unit document summary group to obtain the unit group input state parameter of the unit document summary group.
[0080] The unit document summary weight can be used to represent the importance of each unit document summary in the unit document summary group. Optionally, the sum of the unit document summary weights of each unit document summary in the unit document summary group can be 1.
[0081] Specifically, the unit document summary weight of each unit document summary in the unit document summary group can be obtained. The unit document summary weight can be used to perform weighted summation on the unit output state parameters corresponding to each unit document summary in the unit document summary group to obtain the unit group input state parameter of the unit document summary group. The unit document summary weight can be determined and adjusted by the technician according to experience.
[0082] The present scheme introduces the unit document summary weight of each unit document summary in the unit document summary group, and determines the unit group input state parameter of the unit document summary group through the unit document summary weight of each unit document summary in the unit document summary group, which can improve the accuracy of the unit group input state parameter of the unit document summary group obtained.
[0083] S250, input each unit group document and the corresponding unit group input state parameter into the summary extraction model to output at least one unit group document summary corresponding to the unit group document summary and the unit group output state parameter.
[0084] S260. When it is detected that the number of unit group document summaries is greater than 1, the unit group document summary is updated to a unit document summary, the unit group output state parameter is updated to a unit output state parameter, and the step of dividing the unit document summaries to obtain at least one unit document summary group, combining the unit document summaries in the unit document summary group, and determining the unit group document of the unit document summary group is returned until it is detected that the number of unit group document summaries is equal to 1, and the unit group document summary corresponding to the unit document summary group is determined as the target document summary of the document to be processed.
[0085] The technical solution of the embodiment of the present invention can improve the accuracy of the generated document summary by combining the unit document summaries in the unit document summary group to determine the unit group document of the unit document summary group, and combining the unit group input state parameters corresponding to the unit document summaries in the unit document summary group to determine the unit group input state parameters of the unit document summary group.
[0086] Figure 3 This is the principle diagram of the document summary generation method. Figure 3 As shown, the document to be processed can be divided into blocks to obtain eight blocks of unit documents to be processed. The eight blocks of unit documents to be processed can be input into a summary extraction model, which outputs unit document summaries and unit output state parameters corresponding to the eight blocks of unit documents to be processed. The unit document summaries can be grouped in pairs to obtain four unit document summary groups. Two unit document summaries in a unit document summary group can be directly combined to obtain unit group documents of the unit document summary group. The two unit output state parameters corresponding to the two unit document summaries in the unit document summary group can be directly summed to determine the unit group input state parameters of the unit document summary group. The four groups of unit group documents and the corresponding unit group input state parameters can be input into a summary extraction model, which outputs unit group document summaries and unit group output state parameters corresponding to the four groups of unit document summary groups. When it is detected that the number of unit group document summaries is greater than one, the unit group document summaries are updated to unit document summaries, and the unit group output state parameters are updated to unit output state parameters. The unit document summaries can be grouped in pairs to obtain two unit document summary groups. Two unit document summaries in a unit document summary group can be directly combined to obtain one unit group document of the unit document summary group. The two unit output state parameters corresponding to the two unit document summaries in the unit document summary group can be directly summed to determine the unit group input state parameter of the unit document summary group. A group of unit group documents and the corresponding unit group input state parameters can be input into a summary extraction model to output a unit group document summary and unit group output state parameters corresponding to the unit document summary group. When it is detected that the number of unit group document summaries is equal to 1, the unit group document summary corresponding to the unit document summary group is determined as the target document summary of the document to be processed. Figure 4This is the algorithm flow chart of the document summary generation method. Figure 4 As shown, there can be 3 TimeSteps, namely TimeStep 0, TimeStep 1 and TimeStep 2. The pre-trained parameters of the summary extraction model can be and C. For TimeStep 0, since there is no previous time step, and there is no unit group output state parameter of the previous time step, Ah -1 can be ignored. The input data of the summary extraction model may include the unit group document and unit group input state parameters of the previous time step. The output of the summary extraction model may include the unit group document summary and unit group output state parameters corresponding to the unit document group at the current time step. This allows for cyclic summary extraction of documents to be processed, improving the efficiency of summarization processing for long documents and reducing resource consumption.
[0087] Example 3
[0088] Figure 5 This is a schematic diagram of the structure of a document summary generation device provided in Example 3 of the present invention. This embodiment of the present invention is applicable to situations where summaries of large-scale documents are generated. The device can execute a document summary generation method. The device can be implemented in hardware and / or software and can be configured in an electronic device that carries the document summary generation function, such as a client or server.
[0089] See also Figure 5The document summary generation device shown includes: a document segmentation module 510, a first summary extraction module 520, a document summary grouping module 530, a second summary extraction module 540 and a document summary generation module 550. The document segmentation module 510 is used to obtain a document to be processed and segment the document to be processed to obtain at least two unit documents to be processed; the first summary extraction module 520 is used to input each unit document to be processed into a pre-trained summary extraction model, and output a unit document summary and a unit output state parameter corresponding to each unit document to be processed; the document summary grouping module 530 is used to divide each unit document summary to obtain at least one unit document summary group, and determine the unit group document and the unit group input state parameter of the unit document summary group according to each unit document summary and the corresponding unit output state parameter in the unit document summary group; the second summary extraction module 540 is used to input each unit group document and the corresponding unit group input state parameter into the summary extraction model. , outputting a unit group document summary and a unit group output status parameter corresponding to at least one of the unit document summary groups; a document summary generating module 550, for, when detecting that the number of the unit group document summaries is greater than 1, updating the unit group document summary to the unit document summary, updating the unit group output status parameter to the unit output status parameter, returning to execute the step of dividing each of the unit document summaries to obtain at least one unit document summary group, and determining the unit group document and unit group input status parameter of the unit document summary group according to each of the unit document summaries and the corresponding unit output status parameter in the unit document summary group, until detecting that the number of the unit group document summaries is equal to 1, determining the unit group document summary corresponding to the unit document summary group as the target document summary of the document to be processed.
[0090] The technical solution of the embodiment of the present invention is to divide the document to be processed into multiple unit documents to be processed by blocking, and use a pre-trained summary extraction model to extract the summary of each unit document to be processed, so as to obtain the unit document summary and unit output state parameter corresponding to each unit document to be processed. Based on the summary extraction model, the efficiency and accuracy of the unit document summary extraction can be improved, and based on the unit output state parameter, the information extraction of the unit document to be processed can be realized; by dividing the summary of each unit document, at least one unit document summary group is obtained, and according to the unit document summary of each unit document and the corresponding unit output state parameter in the unit document summary group, the unit group document and the unit group input state parameter of the unit document summary group are determined, and each unit group document and the corresponding unit group input state parameter are input into the summary extraction model, and the unit group corresponding to the at least one unit document summary group is output. Document summary and unit group output status parameters. When it is detected that the number of unit group document summaries is greater than 1, the unit group document summary is updated to the unit document summary, the unit group output status parameters are updated to the unit output status parameters, and the execution is returned to divide the unit document summaries to obtain at least one unit document summary group, and according to the unit document summaries and the corresponding unit output status parameters in the unit document summary group, the unit group documents and unit group input status parameters of the unit document summary group are determined until it is detected that the number of unit group document summaries is equal to 1, and the unit group document summary corresponding to the unit document summary group is determined as the target document summary of the document to be processed. Through the same summary extraction model, the cyclic summary extraction of the document to be processed is realized. Without relying on long context, the consumption of system resources can be reduced, and the summary extraction efficiency and summary extraction effect of the document can be improved.
[0091] In an optional embodiment of the present invention, the document summary grouping module 530 includes: a unit document summary combination unit, used to combine the unit document summaries in the unit document summary group to determine the unit group document of the unit document summary group; a unit output state parameter combination unit, used to combine the unit output state parameters corresponding to the unit document summaries in the unit document summary group to determine the unit group input state parameters of the unit document summary group.
[0092] In an optional embodiment of the present invention, the unit output state parameter combination unit includes: a unit document summary weight acquisition subunit, used to obtain the unit document summary weight of each unit document summary in the unit document summary group; a unit output state parameter combination subunit, used to use the unit document summary weight to perform weighted summation on the unit output state parameters corresponding to each unit document summary in the unit document summary group to obtain the unit group input state parameters of the unit document summary group.
[0093] In an optional embodiment of the present invention, the document segmentation module 510 includes: a document structure parsing unit, used to parse the document to be processed to obtain the document structure of the document to be processed; a document segmentation unit, used to segment the document to be processed according to the document structure of the document to be processed to obtain at least two unit documents to be processed.
[0094] In an optional embodiment of the present invention, the device also includes: a document summary vectorization module, which is used to vectorize the target document summary after the target document summary is determined to be the document to be processed, so as to obtain a target document summary vector; and a target document summary vector storage module, which is used to store the target document summary vector and the document to be processed in a database in correspondence.
[0095] In an optional embodiment of the present invention, the device also includes: a document query information acquisition module, which is used to obtain document query information sent by the document query party when querying the document to be processed after the target document summary vector is stored in correspondence with the document to be processed; a document query information vectorization module, which is used to vectorize the document query information to obtain a document query vector; a vector matching module, which is used to match the document query vector with each candidate document summary vector in the database; a document query module, which is used to determine the candidate document summary vector with the highest matching degree with the document query vector as the target document summary vector, and obtain the corresponding stored document to be processed.
[0096] The document summary generation device provided in the embodiment of the present invention can execute the document summary generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0097] In the technical solution of the embodiment of the present invention, the acquisition, storage and application of the documents to be processed, the unit document summary weights of each unit document summary in the unit document summary group, and the document query information sent by the document query party all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0098] Example 4
[0099] Figure 6A schematic diagram of the structure of an electronic device 600 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0100] like Figure 6 As shown, the electronic device 600 includes at least one processor 601, and a memory connected to the at least one processor 601 in communication, such as a read-only memory (ROM) 602, a random access memory (RAM) 603, etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 601 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 602 or the computer program loaded from the storage unit 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The processor 601, ROM 602 and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0101] Multiple components in the electronic device 600 are connected to the I / O interface 605, including an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0102] Processor 601 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processor, controller, microcontroller, etc. Processor 601 executes the various methods and processes described above, such as the document summary generation method.
[0103] In some embodiments, the document summary generation method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by processor 601, one or more steps of the document summary generation method described above can be performed. Alternatively, in other embodiments, processor 601 can be configured to perform the document summary generation method in any other appropriate manner (e.g., via firmware).
[0104] Various embodiments of the systems and techniques described above 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), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0105] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0106] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0107] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0108] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0109] A computing system may include clients and servers. The clients and servers are generally remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within a cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS (Virtual Private Server) services.
[0110] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0111] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A document summary generation method, characterized in that: The method comprises: Obtaining a document to be processed, and dividing the document to be processed into blocks to obtain at least two units of documents to be processed; Inputting each unit document to be processed into a pre-trained summary extraction model, and outputting the unit document summary and unit output state parameter corresponding to each unit document to be processed; Dividing each of the unit document summaries to obtain at least one unit document summary group, and determining a unit group document and a unit group input state parameter of the unit document summary group based on each of the unit document summaries and corresponding unit output state parameters in the unit document summary group; Inputting each of the unit group documents and the corresponding unit group input state parameters into the summary extraction model, and outputting a unit group document summary and a unit group output state parameter corresponding to at least one of the unit document summary groups; When it is detected that the number of the unit group document summaries is greater than 1, the unit group document summary is updated to the unit document summary, the unit group output state parameter is updated to the unit output state parameter, and the step of dividing the unit document summaries to obtain at least one unit document summary group is returned to be executed, and the unit group document and unit group input state parameter of the unit document summary group are determined according to each unit document summary and the corresponding unit output state parameter in the unit document summary group, until it is detected that the number of the unit group document summaries is equal to 1, and the unit group document summary corresponding to the unit document summary group is determined as the target document summary of the document to be processed.
2. The method according to claim 1, characterized in that The determining, based on each of the unit document summaries in the unit document summary group and the corresponding unit output state parameter, of the unit document summary group and the unit group input state parameter includes: combining the unit document summaries in the unit document summary group to determine a unit group document of the unit document summary group; The unit output state parameters corresponding to the unit document summaries in the unit document summary group are combined to determine the unit group input state parameters of the unit document summary group.
3. The method according to claim 2, characterized in that The combining of the unit output state parameters corresponding to the unit document summaries in the unit document summary group to determine the unit group input state parameters of the unit document summary group includes: Obtaining a unit document summary weight of each unit document summary in the unit document summary group; The unit document summary weights are used to perform weighted summation on the unit output state parameters corresponding to the unit document summaries in the unit document summary group to obtain the unit group input state parameters of the unit document summary group.
4. The method according to claim 1, wherein The step of dividing the document to be processed into blocks to obtain at least two units of documents to be processed includes: Parsing the document to be processed to obtain the document structure of the document to be processed; According to the document structure of the document to be processed, the document to be processed is divided into blocks to obtain at least two unit documents to be processed.
5. The method according to claim 1, wherein After determining the target document summary as the document to be processed, the method further includes: Vectorizing the target document summary to obtain a target document summary vector; The target document summary vector and the document to be processed are stored in a database in correspondence.
6. The method according to claim 5, characterized in that After storing the target document summary vector in correspondence with the document to be processed, the method further includes: When querying a document to be processed, obtaining document query information sent by the document querying party; Vectorizing the document query information to obtain a document query vector; Matching the document query vector with each candidate document summary vector in the database; The candidate document summary vector having the highest matching degree with the document query vector is determined as the target document summary vector, and the corresponding stored document to be processed is obtained.
7. A document summary generating device, characterized in that: The device comprises: A document segmentation module is used to obtain a document to be processed and segment the document to be processed into at least two units of documents to be processed; A first summary extraction module is used to input each unit document to be processed into a pre-trained summary extraction model, and output a unit document summary and a unit output state parameter corresponding to each unit document to be processed; a document summary grouping module, configured to divide each of the unit document summaries to obtain at least one unit document summary group, and determine a unit group document and a unit group input state parameter of the unit document summary group based on each of the unit document summaries and the corresponding unit output state parameter in the unit document summary group; a second summary extraction module, configured to input each of the unit group documents and the corresponding unit group input state parameters into the summary extraction model, and output a unit group document summary and a unit group output state parameter corresponding to at least one of the unit document summary groups; A document summary generation module is used to update the unit group document summary to the unit document summary when it is detected that the number of the unit group document summaries is greater than 1, update the unit group document summary to the unit document summary, update the unit group output state parameter to the unit output state parameter, return to execute the steps of dividing each of the unit document summaries to obtain at least one unit document summary group, and determine the unit group document and unit group input state parameter of the unit document summary group according to each of the unit document summaries and the corresponding unit output state parameter in the unit document summary group, until it is detected that the number of the unit group document summaries is equal to 1, and determine the unit group document summary corresponding to the unit document summary group as the target document summary of the document to be processed.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the document summary generation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the document summary generation method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the document summary generation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Text abstract generation method and device, computer equipment and storage medium
CN109657051A
Video abstract generation method and device, equipment and medium
CN118102050A