A document abstract generation method and device, a terminal device, and a storage medium

By constructing a document graph structure and a set of sentence features, and training a target sentence enhancement model, the problems of insufficient capture of structural information and low information density in document summarization generation are solved, resulting in high-quality and reliable document summaries.

CN122432334APending Publication Date: 2026-07-21GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG POWER GRID CO LTD
Filing Date
2026-05-13
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively capture the structural information of long documents in document summarization. The generated summaries often omit key information, exhibit significant semantic biases, and suffer from low information density and poor coherence, failing to meet demanding business requirements.

Method used

By constructing a sample document graph structure and a sample sentence feature set, anchor sentence enhancement features, positive sentence pairs, and negative sentence pairs are obtained using a pre-defined sentence enhancement model. The target sentence enhancement model is then trained using a pre-defined loss function to generate sentence enhancement features rich in global structure awareness, which are then input into the target summary generation model.

Benefits of technology

It significantly improves the reliability of document summary generation, and the generated summaries have information integrity, key data accuracy and language fluency, meeting high business requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432334A_ABST
    Figure CN122432334A_ABST
Patent Text Reader

Abstract

The application discloses a document abstract generation method and device, terminal equipment and storage medium, and belongs to the field of document abstract generation. The method is as follows: a sample document, a sample document graph structure and a sample sentence feature set are acquired; the sample document graph structure and the sample sentence feature set are input into a preset sentence enhancement model to obtain a sample sentence enhancement feature set; a sample sentence loss function is obtained based on a sentence positive example pair, a sentence negative example pair, anchor point sentence enhancement features and a preset loss function; a sentence total loss function is constructed based on a preset standard sentence loss function and the sample sentence loss function; a preset sentence enhancement model is trained based on the sentence total loss function to obtain a target sentence enhancement model; a target sentence enhancement feature set is obtained based on a to-be-optimized document and the target sentence enhancement model; and the target sentence enhancement feature set is input into a pre-acquired target abstract generation model to obtain a target abstract, so that the reliability of document abstract generation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of document summarization, and more particularly to a document summarization method, apparatus, terminal device, and storage medium. Background Technology

[0002] With the rapid development of the Internet and digital office, document summarization technology is widely used in scenarios such as news aggregation, report simplification, knowledge management, and professional document processing, aiming to quickly extract core information from massive amounts of text and improve information acquisition and decision-making efficiency.

[0003] Currently, document summarization methods based on large models can be mainly divided into two categories: sequence-to-sequence generative summarization methods and extractive summarization methods based on pre-trained language models. Sequence-to-sequence generative summarization methods typically use encoder-decoder architectures or large models based on cueing engineering to directly generate summary text. However, when processing long documents, they are limited by the model's input length and the long-range modeling capabilities of attention mechanisms, making it difficult to effectively capture the structural relationships between scattered semantic units in the document. This results in the omission of key information and significant semantic bias in the generated summary. Extractive summarization methods based on pre-trained language models rely on the pre-trained language model to rank sentences by importance and directly extract sentences from the original text to form a summary. Although they can preserve the original facts relatively well, the generated text has poor coherence, low information density, and lacks the ability to deeply extract and reconstruct content. Both existing technologies lack explicit modeling of the complex semantic relationships within the document, fail to effectively distinguish between core information and redundant content, and struggle to accurately retain key business data, professional terms, and their logical connections. They cannot meet the practical business needs that require high integrity of summary information, fluency of language, and accuracy of data. Summary of the Invention

[0004] This invention provides a document summarization method, apparatus, terminal device, and storage medium, which can solve the above-mentioned problems in the prior art and improve the reliability of document summarization generation.

[0005] This invention provides a document summarization generation method, comprising: Obtain sample documents, and based on the sample documents, obtain the sample document graph structure and sample sentence feature set; The sample document graph structure and the sample sentence feature set are input into a preset sentence enhancement model to obtain the sample sentence enhancement feature set. Obtain a reference summary, and based on the sample document, the reference summary, and the sample sentence enhancement feature set, obtain anchor sentence enhancement features, sentence positive pairs, and sentence negative pairs; Based on the sentence positive example pairs, the sentence negative example pairs, the anchor sentence enhancement features, and the preset loss function, a sample sentence loss function is obtained through an algorithm. The sentence total loss function is then constructed based on the preset standard sentence loss function and the sample sentence loss function. The preset sentence enhancement model is trained based on the total sentence loss function to obtain the target sentence enhancement model; Obtain the document to be optimized, and obtain the sentence enhancement feature set based on the document to be optimized and the target sentence enhancement model; The enhanced feature set of the sentence to be optimized is input into the pre-acquired target summary generation model to obtain the target summary.

[0006] In the above scheme, by constructing a sample document graph structure and inputting a sample sentence feature set into a preset sentence enhancement model, the sentences within the sample document are associated with the sample sentence feature set representing complex semantics, effectively overcoming the shortcomings of traditional generative summarization in capturing structural information of long documents, low information density of extractive summarization, and poor coherence. Furthermore, by utilizing reference summaries, sample document construction, and sample sentence enhancement feature sets to obtain anchor sentence enhancement features, positive sentence pairs, and negative sentence pairs, and calculating the sample sentence loss function, this is combined with the preset standard sentence loss to obtain the total sentence loss function, which is used to train the preset sentence enhancement model. This significantly enhances the final target sentence enhancement model's ability to distinguish between core key information and redundant content. Finally, the trained target sentence enhancement model is applied to the document to be optimized, generating a globally structure-aware set of sentence enhancement features to be optimized, which is then input into the target summary generation model. This ensures that the generated target summary simultaneously possesses information completeness, key data accuracy, and language fluency, effectively improving the reliability of document summary generation.

[0007] Further, the step of obtaining sample documents and, based on the sample documents, obtaining the sample document graph structure and sample sentence feature set includes: The sample document is segmented into sentences based on a preset sentence segmentation algorithm to obtain a sample sentence sequence. For each sample sentence in the sample sentence sequence, obtain the corresponding sample sentence feature, so as to obtain the sample sentence feature set corresponding to the sample sentence sequence based on the sample sentence features corresponding to all the sample sentences in the sample sentence sequence; The sample sentence sequence is processed by a preset graph construction algorithm to obtain the sample document graph structure.

[0008] In the above scheme, the sample document is segmented into a sequence of sample sentences by a preset sentence segmentation algorithm, and the corresponding sample sentence features are obtained for each sample sentence. Then, the sentence sequence is processed by a preset graph construction algorithm to construct a graph. This can transform unstructured documents into structured graph data and node features in a standardized way, providing a complete and accurate input foundation for subsequent message passing and feature enhancement of graph neural networks.

[0009] Furthermore, the step of performing graph construction processing on the sample sentence sequence based on a preset graph construction algorithm to obtain the sample document graph structure includes: For any two sample sentences in the sample sentence sequence, perform the node connection edge generation result acquisition action to obtain the node connection edge generation result, and obtain all the node connection edge generation results in the sample sentence sequence to obtain the node connection edge generation result set; Generate a set of node connection edges based on the result set of the node connection edges; Based on the set of node connection edges and the sequence of sample sentences, the sample document graph structure is obtained.

[0010] In the above scheme, by performing the node connection edge generation result acquisition action on any two sample sentences in the sample sentence sequence, the set of all node connection edge generation results is collected, and a set of node connection edges is generated based on the set of node connection edge generation results. Finally, the sample document graph structure is obtained by combining the sample sentence sequence. This can systematically determine the adjacency relationship between sentences and ensure that the graph structure fully reflects the semantic associations within the document.

[0011] Further, for any two sample sentences in the sample sentence sequence, the node connection edge generation result acquisition action is performed to obtain the node connection edge generation result, thereby obtaining all the node connection edge generation results in the sample sentence sequence, resulting in a set of node connection edge generation results, including: Sentence entities are extracted from each sample sentence in the sample sentence sequence to obtain a subset of sentence entities. Based on the subset of sentence entities corresponding to all sample sentences in the sample sentence sequence, a set of sentence entities corresponding to the sample sentence sequence is obtained. For any two sample sentences in the sample sentence sequence, obtain the generation result of the reference relationship between the two sample sentences, and obtain the sentence cosine similarity between the sample sentence features corresponding to the two sample sentences. If there are identical sentence entities between the sentence entity subsets corresponding to any two sample sentences, or if the generated result of the referential relationship between any two sample sentences indicates the existence of a referential relationship, or if the sentence cosine similarity between any two sample sentences is greater than a preset similarity threshold, then the node connection edge generated between any two sample sentences is determined as a node connection edge generated, so as to obtain all node connection edge generated results in the sample sentence sequence and obtain a set of node connection edge generated results.

[0012] In the above scheme, by extracting a subset of sentence entities from each sample sentence, obtaining the referential relationships and cosine similarity between sample sentences, and determining the generation of node connection edges when there are identical sentence entities, referential relationships, or sentence cosine similarity greater than a preset sentence threshold, it can integrate multi-dimensional information such as entity co-occurrence, co-reference resolution, and semantic similarity to construct heterogeneous graph edges, enabling the graph structure to more comprehensively capture the complex semantic relationships hidden in the document, thereby improving the ability of subsequent graph neural networks to model document structures.

[0013] Further, the step of obtaining the reference summary, and based on the sample document, the reference summary, and the sample sentence enhancement feature set, obtaining anchor sentence enhancement features, sentence positive pairs, and sentence negative pairs, includes: Obtain a reference summary, and determine positive and negative sentence samples based on the sample document and the reference summary; Anchor sentence enhancement features are selected from the sample sentence enhancement feature set based on the positive sentence samples. Sentence positive pairs are obtained based on the preset positive example pair acquisition rules, the anchor sentence enhancement features, and the sample sentence enhancement feature set; Negative sentence pairs are selected from the sample sentence enhancement feature set based on the negative sentence samples.

[0014] In the above scheme, sentence negative samples and sentence negative samples are determined by referring to the summary. Anchor sentence enhancement features and sentence negative sample pairs are selected from the sample sentence enhancement feature set. Sentence positive sample pairs are generated according to the preset positive sample pair acquisition rules. This can construct high-quality contrastive learning sample pairs, so that the subsequent contrastive loss, i.e. the sample sentence loss function, can effectively shorten the distance between the key sentence and its context representation and push away redundant sentence representation.

[0015] Further, the step of obtaining the document to be optimized and obtaining the sentence enhancement feature set based on the document to be optimized and the target sentence enhancement model includes: Obtain the document to be optimized, and based on the document to be optimized, obtain the document graph structure and the set of sentence features to be optimized; The document graph structure to be optimized and the sentence feature set to be optimized are input into the target sentence enhancement model to obtain the sentence enhancement feature set to be optimized.

[0016] In the above scheme, during the practical application stage, the same data processing is performed on the document to be optimized as during training to obtain the graph structure of the document to be optimized and the set of sentence features to be optimized. These are then input into the trained target sentence enhancement model, which ensures that the context-aware quality of the sentence enhancement features to be optimized is consistent with that of the training stage, providing stable and globally semantically rich input features for subsequent target summarization generation.

[0017] Further, the step of inputting the enhanced feature set of the sentence to be optimized into the pre-acquired target summary generation model to obtain the target summary includes: The enhanced feature set of the sample sentences is input into a preset summary generation model to obtain a candidate summary set; The target reward data is obtained based on the candidate summary set and the reference summary; Based on the target reward data, the preset frozen summary model, the preset summary generation model, and the preset summary generation model objective function, an algorithm is constructed to obtain the summary generation model objective function; Based on the preset model optimization algorithm and the objective function of the summary generation model, the target summary generation model is obtained; The enhanced feature set of the sentence to be optimized is input into the target summary generation model to obtain the target summary.

[0018] In the above scheme, candidate summaries are generated by inputting the enhanced features of sample sentences into a preset summary generation model. The target reward data is calculated by combining the reference summary. Based on the reward data, the frozen summary model and the objective function, an algorithm is constructed to obtain the objective function of the summary generation model. The model is then fine-tuned by a preset optimization algorithm. This approach can directly optimize the multi-dimensional indicators of summary quality using reinforcement learning, so that the final target summary generation model can better meet business needs while maintaining its generation capabilities.

[0019] Another embodiment of the present invention provides a document summarization generation apparatus, comprising: The basic data acquisition module is used to acquire sample documents and obtain the sample document graph structure and sample sentence feature set based on the sample documents; The sample sentence enhancement feature set generation module is used to input the sample document graph structure and the sample sentence feature set into a preset sentence enhancement model to obtain the sample sentence enhancement feature set. The intermediate data acquisition module is used to acquire the reference summary and, based on the sample document, the reference summary, and the sample sentence enhancement feature set, obtain anchor sentence enhancement features, sentence positive pairs, and sentence negative pairs. The sentence total loss function construction module is used to obtain the sample sentence loss function based on the sentence positive example pair, the sentence negative example pair, the anchor sentence enhancement feature and the preset loss function construction algorithm, and to construct the sentence total loss function based on the preset standard sentence loss function and the sample sentence loss function. The target sentence enhancement model acquisition module is used to train a preset sentence enhancement model based on the total sentence loss function to obtain the target sentence enhancement model; The module for obtaining the enhanced feature set of sentences to be optimized is used to obtain the document to be optimized and to obtain the enhanced feature set of sentences to be optimized based on the document to be optimized and the target sentence enhancement model. The target summary acquisition module is used to input the enhanced feature set of the sentence to be optimized into the pre-acquired target summary generation model to obtain the target summary.

[0020] Another embodiment of the present invention provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the steps of a document summary generation method of the present invention.

[0021] Another embodiment of the present invention provides a computer-readable storage medium item, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to perform steps such as the document digest generation method of the present invention. Attached Figure Description

[0022] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating a document summary generation method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a document summarization generation device provided in an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0026] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0028] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0029] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0030] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0031] See Figure 1To address the aforementioned problems in the prior art and improve the reliability of document summarization generation, an embodiment of the present invention provides a document summarization generation method, comprising: Step S1: Obtain sample documents and, based on the sample documents, obtain the sample document graph structure and sample sentence feature set; Step S2: Input the sample document graph structure and sample sentence feature set into the preset sentence enhancement model to obtain the sample sentence enhancement feature set; Step S3: Obtain the reference summary, and based on the sample document, the reference summary, and the sample sentence enhancement feature set, obtain the anchor sentence enhancement features, sentence positive pairs, and sentence negative pairs; Step S4: Based on the sentence positive example pairs, sentence negative example pairs, anchor sentence enhancement features and the preset loss function, construct the algorithm to obtain the sample sentence loss function, and construct the sentence total loss function based on the preset standard sentence loss function and the sample sentence loss function; Step S5: Train the preset sentence enhancement model based on the total sentence loss function to obtain the target sentence enhancement model; Step S6: Obtain the document to be optimized, and obtain the enhanced feature set of the sentence to be optimized based on the document to be optimized and the target sentence enhancement model; Step S7: Input the enhanced feature set of the sentence to be optimized into the pre-acquired target summary generation model to obtain the target summary.

[0032] In the above scheme, by constructing a sample document graph structure and inputting a sample sentence feature set into a preset sentence enhancement model, the sentences within the sample document are associated with the sample sentence feature set representing complex semantics, effectively overcoming the shortcomings of traditional generative summarization in capturing structural information of long documents, low information density of extractive summarization, and poor coherence. Furthermore, by utilizing reference summaries, sample document construction, and sample sentence enhancement feature sets to obtain anchor sentence enhancement features, positive sentence pairs, and negative sentence pairs, and calculating the sample sentence loss function, this is combined with the preset standard sentence loss to obtain the total sentence loss function, which is used to train the preset sentence enhancement model. This significantly enhances the final target sentence enhancement model's ability to distinguish between core key information and redundant content. Finally, the trained target sentence enhancement model is applied to the document to be optimized, generating a globally structure-aware set of sentence enhancement features to be optimized, which is then input into the target summary generation model. This ensures that the generated target summary simultaneously possesses information completeness, key data accuracy, and language fluency, effectively improving the reliability of document summary generation.

[0033] It should be noted that, firstly, during the training phase, a graph structure and sentence features are constructed using sample documents to obtain a set of sample document graph structures and sample sentence features. A pre-defined sentence enhancement model is then used to obtain a set of sample sentence enhancement features that integrates global semantic information. The pre-defined sentence enhancement model is preferably a multi-head graph attention network (GAT). Subsequently, comparative learning is performed between the sample documents and the reference summary. Anchor sentence enhancement features, positive sentence pairs, and negative sentence pairs are constructed based on the sample sentence enhancement feature set. Finally, a sample sentence loss function is obtained, which is combined with a pre-defined standard sentence loss function to construct a total sentence loss function. This is used to train the pre-defined sentence enhancement model, resulting in the target sentence enhancement model. During the inference phase, the same data processing flow is performed on the document to be optimized. Using the document to be optimized and the trained target sentence enhancement model, a set of sentence enhancement features to be optimized is obtained. This set is then input into a pre-trained target summary generation model, preferably a large language model based on the Transformer architecture. This ultimately generates a high-quality, reliable target summary. The entire method significantly improves the information completeness, key data accuracy, and text fluency of long document summaries through explicit modeling of the document graph structure, comparative learning to enhance key information identification, and reinforcement learning to optimize generation strategies.

[0034] In another embodiment, the step of obtaining sample documents and, based on the sample documents, obtaining a sample document graph structure and a sample sentence feature set includes: The sample document is segmented into sentences based on a preset sentence segmentation algorithm to obtain a sample sentence sequence. For each sample sentence in the sample sentence sequence, obtain the corresponding sample sentence feature, so as to obtain the sample sentence feature set corresponding to the sample sentence sequence based on the sample sentence features corresponding to all the sample sentences in the sample sentence sequence; The sample sentence sequence is processed by a preset graph construction algorithm to obtain the sample document graph structure.

[0035] In the above scheme, the sample document is segmented into a sequence of sample sentences by a preset sentence segmentation algorithm, and the corresponding sample sentence features are obtained for each sample sentence. Then, the sentence sequence is processed by a preset graph construction algorithm to construct a graph. This can transform unstructured documents into structured graph data and node features in a standardized way, providing a complete and accurate input foundation for subsequent message passing and feature enhancement of graph neural networks.

[0036] It should be noted that the preset sentence segmentation algorithm can employ a pre-trained word segmenter such as BERT, as well as sentence segmentation rules based on NLTK or SpaCy, to divide the sample document into several independent sentences, forming a sample sentence sequence. ,in, The sample sentences are represented by n, where n is the number of sample sentences in the sequence. For each sample sentence, its fixed dimensions are obtained through a pre-trained language model (e.g., BERT, RoBERTa, etc.). Vector representations of sample sentences The feature vectors of all sample sentences together constitute the sample sentence feature set. The preset graph construction algorithm, based on the semantic similarity, entity co-occurrence, and coreference resolution relationships between sentences, treats each sample sentence as a graph node, adds edges according to specific rules, and generates a sample document graph structure, providing a structural foundation for subsequent graph neural network encoding.

[0037] In another embodiment, the step of performing graph construction processing on the sample sentence sequence based on a preset graph construction algorithm to obtain a sample document graph structure includes: For any two sample sentences in the sample sentence sequence, perform the node connection edge generation result acquisition action to obtain the node connection edge generation result, and obtain all the node connection edge generation results in the sample sentence sequence to obtain the node connection edge generation result set; Generate a set of node connection edges based on the result set of the node connection edges; Based on the set of node connection edges and the sequence of sample sentences, the sample document graph structure is obtained.

[0038] In the above scheme, by performing the node connection edge generation result acquisition action on any two sample sentences in the sample sentence sequence, the set of all node connection edge generation results is collected, and a set of node connection edges is generated based on the set of node connection edge generation results. Finally, the sample document graph structure is obtained by combining the sample sentence sequence. This can systematically determine the adjacency relationship between sentences and ensure that the graph structure fully reflects the semantic associations within the document.

[0039] It should be noted that any sample sentence can be used as a node in the sample document graph structure. For any two sample sentences in the sample sentence sequence, the node connection edge generation result acquisition action is performed to obtain the node connection edge generation result, which indicates whether a node connection edge should be added between them. The above steps are repeated until the node connection edge generation results for any two sample sentences in the sample sentence sequence are obtained, resulting in a node connection edge generation result set. A node connection edge set is then generated based on the node connection edge generation result set. At this point, the nodes and the connection edges between the nodes are obtained, i.e., the sample sentence sequence and the node connection edge set are obtained. Based on this, the sample document graph structure is constructed.

[0040] In another embodiment, for any two sample sentences in the sample sentence sequence, the node connection edge generation result acquisition action is performed to obtain the node connection edge generation result, thereby obtaining all node connection edge generation results in the sample sentence sequence, resulting in a set of node connection edge generation results, including: Sentence entities are extracted from each sample sentence in the sample sentence sequence to obtain a subset of sentence entities. Based on the subset of sentence entities corresponding to all sample sentences in the sample sentence sequence, a set of sentence entities corresponding to the sample sentence sequence is obtained. For any two sample sentences in the sample sentence sequence, obtain the generation result of the reference relationship between the two sample sentences, and obtain the sentence cosine similarity between the sample sentence features corresponding to the two sample sentences. If there are identical sentence entities between the sentence entity subsets corresponding to any two sample sentences, or if the generated result of the referential relationship between any two sample sentences indicates the existence of a referential relationship, or if the sentence cosine similarity between any two sample sentences is greater than a preset similarity threshold, then the node connection edge generated between any two sample sentences is determined as a node connection edge generated, so as to obtain all node connection edge generated results in the sample sentence sequence and obtain a set of node connection edge generated results.

[0041] In the above scheme, by extracting a subset of sentence entities from each sample sentence, obtaining the referential relationships and cosine similarity between sample sentences, and determining the generation of node connection edges when there are identical sentence entities, referential relationships, or sentence cosine similarity greater than a preset sentence threshold, it can integrate multi-dimensional information such as entity co-occurrence, co-reference resolution, and semantic similarity to construct heterogeneous graph edges, enabling the graph structure to more comprehensively capture the complex semantic relationships hidden in the document, thereby improving the ability of subsequent graph neural networks to model document structures.

[0042] It should be noted that for each sample sentence, the named entity recognition model based on BERT is used to extract entities, including people, organizations, places, dates, and domain-specific entities (such as "customer number", "electricity price", etc.), forming a sentence entity subset. Each node has a corresponding sentence entity subset. The reference relationship generation result is obtained through the existing coreference resolution model and is used to determine whether there is a reference expression pointing to the same real object in different sample sentences, that is, whether there is a reference relationship in different sample sentences. The sentence cosine similarity is obtained by calculating the cosine similarity of the sample sentence features of two sample sentences. If any of the following conditions are met, the node connection edge generation result of any two sample sentences is a generated node connection edge: (1) For any two sample sentences in the sample sentence sequence, the sentence entity subsets of the two sentences have an intersection, that is, at least one identical sentence entity, when the node connection edge generation result is a generated node connection edge; (2) The corresponding reference relationship generation result between the two is that there is a coreference relationship, that is, when the sample sentences Sentence entities and sample sentences When the sentence entities in the sentences point to the same object, the node connection edge generation result is the generated node connection edge; (3) Obtain the cosine similarity between the sample sentence features corresponding to each of the two, as the sentence cosine similarity, to represent the semantic similarity between the two. When the sentence cosine similarity exceeds the preset similarity threshold, The node connection edge generation result is the generated node connection edges, with a preset similarity threshold preferably set to 0.7. Then, the node connection edge generation results for all nodes in the sample sentence sequence are obtained, resulting in a node connection edge generation result set. A node connection edge set is then generated based on this result set, with the node connection edges being undirected. Finally, using the sample sentence sequence as the node set and the node connection edge set as the connection relationships, a complete sample document graph structure is constructed.

[0043] Furthermore, the constructed sample document graph structure can be optimized by removing isolated nodes with excessively low degrees, such as those less than 2, through pruning operations to reduce noise, ultimately yielding the sample document graph structure representation. V is the set of nodes, and E is the set of edges connecting the nodes, providing a structured document representation foundation for subsequent graph neural network processing.

[0044] Furthermore, the pre-defined sentence enhancement model used in this invention is preferably a multi-head graph attention network. Its core lies in a message-passing mechanism guided by a graph structure, enabling each sentence node to adaptively aggregate neighborhood information, thereby obtaining a context-enhanced semantic representation. For each node in the graph structure of a sample document... That is, the sample sentence, which is in the first... layer to the first The sample sentence feature update of each layer is achieved using the following formula, with a total of L layers, preferably... : ; in, For the sentence features of the l-th layer samples, For the sentence features of the (l+1)th layer samples, This represents a vector concatenation operation. It is a preset number of attention heads. It is a node The set of neighboring nodes, It is the first The first attention point in the The trainable weight matrix of the layer, ( ) is the ELU activation function. Attention coefficient. The calculation is performed using the following formula: ; in This is a learnable parameter vector for the attention mechanism, where T is the vector transpose. This method stacks... The layer GAT enables each node to aggregate semantic information from multi-hop neighbors, thereby capturing long-range dependencies in the document. LeakyReLU() is the activation function, and [|] represents the augmented matrix, which is the concatenation of two matrices column by column.

[0045] In the feature fusion stage, the processed sample sentence features output from each layer are weighted and summed to obtain the final node representation. ,in, This is the set of processed sample sentence features corresponding to all nodes output by each layer. To enhance the feature set of sample sentences by weighted summation of the feature sets of all processed sample sentences from all layers, These are learnable layer weight parameters. This multi-layer feature fusion mechanism can preserve semantic information at different granular levels, providing rich document representations for downstream summarization tasks.

[0046] In another embodiment, obtaining the reference summary and, based on the sample document, the reference summary, and the sample sentence enhancement feature set, obtaining anchor sentence enhancement features, positive sentence pairs, and negative sentence pairs includes: Obtain a reference summary, and determine positive and negative sentence samples based on the sample document and the reference summary; Anchor sentence enhancement features are selected from the sample sentence enhancement feature set based on the positive sentence samples. Sentence positive pairs are obtained based on the preset positive example pair acquisition rules, the anchor sentence enhancement features, and the sample sentence enhancement feature set; Negative sentence pairs are selected from the sample sentence enhancement feature set based on the negative sentence samples.

[0047] In the above scheme, sentence negative samples and sentence negative samples are determined by referring to the summary. Anchor sentence enhancement features and sentence negative sample pairs are selected from the sample sentence enhancement feature set. Sentence positive sample pairs are generated according to the preset positive sample pair acquisition rules. This can construct high-quality contrastive learning sample pairs, so that the subsequent contrastive loss, i.e. the sample sentence loss function, can effectively shorten the distance between the key sentence and its context representation and push away redundant sentence representation.

[0048] It should be noted that positive and negative sentence samples are determined by calculating the ROUGE score of each sentence in the original sample document relative to the reference summary: the top-k sentences with the highest scores are selected as positive sentences, where top-k is the k sentences with the highest ROUGE scores, and k is preferably 5. An equal number of sentences are randomly selected from the remaining sentences as negative sentences. The anchor sentence enhancement feature is the sample sentence enhancement feature corresponding to the positive sentence sample in the sample sentence enhancement feature set. Positive sentence pairs are constructed according to a preset positive example pair acquisition rule, which is not limited here. In this embodiment, the adjacent context averaging method is used, that is, the average of the sample sentence enhancement features corresponding to several sentences adjacent to the positive sentence sample in the sample document, such as the preceding and following sentences, is calculated as the positive sentence pair. Negative sentence pairs are directly selected by selecting the sample sentence enhancement feature vector corresponding to the negative sample sentence. This construction method ensures that the positive sentence pairs and anchor sentence enhancement features are semantically related in contrastive learning, while the negative sentence pairs represent redundant or irrelevant information.

[0049] Furthermore, based on the sentence positive example pairs, the sentence negative example pairs, the anchor sentence enhancement features, and the preset loss function construction algorithm, a sample sentence loss function is obtained. The sample sentence loss function adopts the InfoNCE loss function, and the preset loss function construction algorithm is as follows: ; Where N is the number of anchor sentence enhancement features, which is equal to the number of sentence positive samples. It is used to represent the number of anchor sentence enhancement features participating in the InfoNCE loss calculation in a batch, and can also be understood as the number of sentence positive samples in that batch. Let cosine similarity function be used. As u, As v, It is a temperature over-parameter (set to 0.1). This refers to the number of negative samples in a sentence, or the number of negative example pairs in a sentence. Enhance features for anchor sentences; This is a positive example of a sentence; Enhance the sentence positive pairs corresponding to the features of other anchor sentences. These are negative example pairs of sentences. Then, a total sentence loss function is constructed based on a preset standard sentence loss function and the sample sentence loss function. Compared to the standard generation loss, i.e., cross-entropy loss With joint optimization, the total loss function is: = +γ ; Here, γ is a hyperparameter used to balance the contributions of the two losses. This joint optimization strategy enables the model to enhance its ability to identify key information while learning to generate fluent summaries.

[0050] In another embodiment, the step of obtaining the document to be optimized and obtaining the sentence enhancement feature set based on the document to be optimized and the target sentence enhancement model includes: Obtain the document to be optimized, and based on the document to be optimized, obtain the document graph structure and the set of sentence features to be optimized; The document graph structure to be optimized and the sentence feature set to be optimized are input into the target sentence enhancement model to obtain the sentence enhancement feature set to be optimized.

[0051] In the above scheme, during the practical application stage, the same data processing is performed on the document to be optimized as during training to obtain the graph structure of the document to be optimized and the set of sentence features to be optimized. These are then input into the trained target sentence enhancement model, which ensures that the context-aware quality of the sentence enhancement features to be optimized is consistent with that of the training stage, providing stable and globally semantically rich input features for subsequent target summarization generation.

[0052] It should be noted that in the practical application phase, the same data preprocessing procedure is performed on each document to be optimized as in the training phase: First, the feature set of the sentences to be optimized is obtained through sentence segmentation and encoding by a pre-trained language model; then, the graph structure of the document to be optimized is constructed based on entity co-occurrence, coreference relations, and semantic similarity; finally, the feature set of the sentences to be optimized and the graph structure of the document to be optimized are input together into the trained target sentence enhancement model. After forward propagation and feature fusion through a multi-layer graph attention network, a context-aware enhanced feature set of the sentences to be optimized is output. Each feature vector in this set has been fused with global document structure information and can be directly used for subsequent summary generation.

[0053] In another embodiment, the step of inputting the enhanced feature set of the sentence to be optimized into a pre-acquired target summary generation model to obtain the target summary includes: The enhanced feature set of the sample sentences is input into a preset summary generation model to obtain a candidate summary set; The target reward data is obtained based on the candidate summary set and the reference summary; Based on the target reward data, the preset frozen summary model, the preset summary generation model, and the preset summary generation model objective function, an algorithm is constructed to obtain the summary generation model objective function; Based on the preset model optimization algorithm and the objective function of the summary generation model, the target summary generation model is obtained; The enhanced feature set of the sentence to be optimized is input into the target summary generation model to obtain the target summary.

[0054] In the above scheme, candidate summaries are generated by inputting the enhanced features of sample sentences into a preset summary generation model. The target reward data is calculated by combining the reference summary. Based on the reward data, the frozen summary model and the objective function, an algorithm is constructed to obtain the objective function of the summary generation model. The model is then fine-tuned by a preset optimization algorithm. This approach can directly optimize the multi-dimensional indicators of summary quality using reinforcement learning, so that the final target summary generation model can better meet business needs while maintaining its generation capabilities.

[0055] It should be noted that this step describes the reinforcement learning fine-tuning of the preset summary generation model. This process is completed during the training phase to obtain the target summary generation model, which is then directly called for generation in practical applications. Specifically, in the fine-tuning phase, the preset summary generation model is the policy model to be optimized. This is typically a Transformer-based large language model decoder. The pre-defined summary generation model takes a set of enhanced features from sample sentences as input and generates multiple candidate summaries through kernel sampling, forming a candidate summary set. For each candidate summary, its ROUGE-L score relative to the reference summary is calculated as an information integrity reward. The perplexity of each candidate summary is calculated using an existing pre-trained language model and converted into a fluency reward. , The fluency reward measures the naturalness and fluency of the candidate summary's language expression. PPL represents the perplexity of the candidate summary, calculated by the existing pre-trained language model. A smaller PPL indicates that the candidate summary conforms more closely to natural language expression habits and has better fluency. `scale` represents a scaling factor used to normalize the perplexity, preventing excessively large or small values ​​from affecting the reward calculation. `exp` represents an exponential function. As shown in the formula, as PPL increases... Gradually decrease; as PPL decreases, The scale gradually increases, thus assigning higher rewards to candidate summaries with lower perplexity and more fluent language. The scale can be preset based on practical task experience, for example, set to a constant of 10 or 20; this application does not impose such a limitation. It is understood that the pre-trained language model can be an existing large language model based on the Transformer architecture, such as Qwen2.5-7B-Instruct, or other similar summarization generation models. Using existing exact matching evaluation algorithms as a benchmark against a reference summary, the accuracy of key business data (such as electricity prices, contract amounts, etc.) in each candidate summary is evaluated. The total reward for each candidate summary is obtained by weighted summing of the above three reward components. Then, the total reward for each candidate summary is processed accordingly, such as by averaging, to obtain the target reward data. A preset frozen summary model, i.e., the reference model, is used. Its parameters are frozen during training and do not change. The objective function of the summary generation model is as follows: ; in, Let x be the objective function of the summary generation model, where x represents the input sample, corresponding to the set of enhanced sentence features obtained after processing the sample document by the target sentence enhancement model. In practical applications, x can also correspond to the set of enhanced sentence features of the document to be optimized. y represents the candidate summary generated by the summary generation model based on the input x. D represents the training sample distribution. R(y) represents the total reward value corresponding to the candidate summary y, which can be obtained from the information integrity reward R. info Smoothness Bonus R fluent And key data accuracy reward R key_data The summation is obtained by weighting. β represents the KL divergence penalty coefficient, used to constrain the difference in output distribution between the current summarization model and the frozen reference model, preventing the strategy from deviating too far from the initial model. πθ(y|x) represents the probability distribution of the current summarization model generating summaries y given input x, where π... ref (y|x) represents the probability distribution of the generated summary y of the frozen reference model under the same input conditions. [ ] indicates that the expected value based on (x, y) follows the D[ ] function.

[0056] The objective function is maximized by using a pre-defined model optimization algorithm, namely the Proximal Policy Optimization (PPO) algorithm. This process enables the model to learn to generate high-reward summaries through multiple iterations, updating the parameters of the preset summarization model and ultimately obtaining the target summarization model. In practical applications, the enhanced feature set of the sentence to be optimized is directly input into this target summarization model to generate the target summary. The entire process ensures the information integrity, key data accuracy, and language fluency of the generated summary, making it particularly suitable for highly specialized scenarios such as power grid marketing documents. In summary, currently, document summarization methods based on large models can be mainly divided into two categories: sequence-to-sequence generative summarization methods and extractive summarization methods based on pre-trained language models.

[0057] (1) Sequence-to-Sequence Generative Summarizing Methods: Sequence-to-sequence generative summarizing methods typically employ an encoder-decoder architecture. The encoder maps the input document into a latent representation, and the decoder generates a summary sequence. In recent years, with the development of large language models, this method has gradually evolved into a cue engineering-based generation model. By designing appropriate cue templates, it guides large models to directly generate summary text that meets the requirements. However, when processing long documents, due to the limitation of the model input length, this method often struggles to effectively capture long-range dependencies and complex semantic structures in the document, leading to the omission of key information or semantic deviations in the generated summary.

[0058] (2) Extractive summarization method based on pre-trained language models: Extractive summarization method based on pre-trained language models focuses on directly extracting key sentences or fragments from the original text and combining them into a summary. This method usually uses a pre-trained model to obtain sentence-level representations, and then selects important sentences through classification or ranking models. Although this method can better preserve the factual information of the original text, the coherence and readability of the generated summary are poor, and it is difficult to cope with complex scenarios that require deep semantic understanding and information reconstruction.

[0059] However, existing technologies have the following drawbacks: (1) When processing long documents, generative summarization methods are limited by the length of the model input and the limitations of the attention mechanism, making it difficult to effectively model the association between distant semantic units in the document. This results in insufficient ability to capture the overall structure and logical relationship of the document, affecting the completeness and accuracy of the summary.

[0060] (2) The abstracts generated by the extractive abstracting method rely heavily on the surface sentences of the original text and lack in-depth extraction and reorganization of information, resulting in poor fluency and low information density of the abstracts, making it difficult to meet the application scenarios with high requirements for abstract quality and readability.

[0061] Existing methods often lack explicit modeling of the complex semantic relationships within documents, failing to effectively distinguish between core information and redundant content. This is especially true in professional domain documents (such as marketing texts), where key business data and technical terms are easily overlooked.

[0062] Therefore, based on the above method embodiments, corresponding apparatus embodiments are provided; like Figure 2 As shown, an embodiment of the present invention provides a document summarization generation apparatus, which includes: The basic data acquisition module is used to acquire sample documents and obtain the sample document graph structure and sample sentence feature set based on the sample documents; The sample sentence enhancement feature set generation module is used to input the sample document graph structure and the sample sentence feature set into a preset sentence enhancement model to obtain the sample sentence enhancement feature set. The intermediate data acquisition module is used to acquire the reference summary and, based on the sample document, the reference summary, and the sample sentence enhancement feature set, obtain anchor sentence enhancement features, sentence positive pairs, and sentence negative pairs. The sentence total loss function construction module is used to obtain the sample sentence loss function based on the sentence positive example pair, the sentence negative example pair, the anchor sentence enhancement feature and the preset loss function construction algorithm, and to construct the sentence total loss function based on the preset standard sentence loss function and the sample sentence loss function. The target sentence enhancement model acquisition module is used to train a preset sentence enhancement model based on the total sentence loss function to obtain the target sentence enhancement model; The module for obtaining the enhanced feature set of sentences to be optimized is used to obtain the document to be optimized and to obtain the enhanced feature set of sentences to be optimized based on the document to be optimized and the target sentence enhancement model. The target summary acquisition module is used to input the enhanced feature set of the sentence to be optimized into the pre-acquired target summary generation model to obtain the target summary.

[0063] In the above scheme, by constructing a sample document graph structure and inputting a sample sentence feature set into a preset sentence enhancement model, the sentences within the sample document are associated with the sample sentence feature set representing complex semantics, effectively overcoming the shortcomings of traditional generative summarization in capturing structural information of long documents, low information density of extractive summarization, and poor coherence. Furthermore, by utilizing reference summaries, sample document construction, and sample sentence enhancement feature sets to obtain anchor sentence enhancement features, positive sentence pairs, and negative sentence pairs, and calculating the sample sentence loss function, this is combined with the preset standard sentence loss to obtain the total sentence loss function, which is used to train the preset sentence enhancement model. This significantly enhances the final target sentence enhancement model's ability to distinguish between core key information and redundant content. Finally, the trained target sentence enhancement model is applied to the document to be optimized, generating a globally structure-aware set of sentence enhancement features to be optimized, which is then input into the target summary generation model. This ensures that the generated target summary simultaneously possesses information completeness, key data accuracy, and language fluency, effectively improving the reliability of document summary generation.

[0064] It is understood that the above-described apparatus embodiments correspond to the method embodiments of the present invention, and can implement any of the above-described method embodiments of the present invention to provide a document summary generation method.

[0065] Specifically, the basic data acquisition module is also used for: The sample document is segmented into sentences based on a preset sentence segmentation algorithm to obtain a sample sentence sequence. For each sample sentence in the sample sentence sequence, obtain the corresponding sample sentence feature, so as to obtain the sample sentence feature set corresponding to the sample sentence sequence based on the sample sentence features corresponding to all the sample sentences in the sample sentence sequence; The sample sentence sequence is processed by a preset graph construction algorithm to obtain the sample document graph structure.

[0066] In the above scheme, the sample document is segmented into a sequence of sample sentences by a preset sentence segmentation algorithm, and the corresponding sample sentence features are obtained for each sample sentence. Then, the sentence sequence is processed by a preset graph construction algorithm to construct a graph. This can transform unstructured documents into structured graph data and node features in a standardized way, providing a complete and accurate input foundation for subsequent message passing and feature enhancement of graph neural networks.

[0067] Specifically, the basic data acquisition module is also used for: For any two sample sentences in the sample sentence sequence, perform the node connection edge generation result acquisition action to obtain the node connection edge generation result, and obtain all the node connection edge generation results in the sample sentence sequence to obtain the node connection edge generation result set; Generate a set of node connection edges based on the result set of the node connection edges; Based on the set of node connection edges and the sequence of sample sentences, the sample document graph structure is obtained.

[0068] In the above scheme, by performing the node connection edge generation result acquisition action on any two sample sentences in the sample sentence sequence, the set of all node connection edge generation results is collected, and a set of node connection edges is generated based on the set of node connection edge generation results. Finally, the sample document graph structure is obtained by combining the sample sentence sequence. This can systematically determine the adjacency relationship between sentences and ensure that the graph structure fully reflects the semantic associations within the document.

[0069] Specifically, the basic data acquisition module is also used for: Sentence entities are extracted from each sample sentence in the sample sentence sequence to obtain a subset of sentence entities. Based on the subset of sentence entities corresponding to all sample sentences in the sample sentence sequence, a set of sentence entities corresponding to the sample sentence sequence is obtained. For any two sample sentences in the sample sentence sequence, obtain the generation result of the reference relationship between the two sample sentences, and obtain the sentence cosine similarity between the sample sentence features corresponding to the two sample sentences. If there are identical sentence entities between the sentence entity subsets corresponding to any two sample sentences, or if the generated result of the referential relationship between any two sample sentences indicates the existence of a referential relationship, or if the sentence cosine similarity between any two sample sentences is greater than a preset similarity threshold, then the node connection edge generated between any two sample sentences is determined as a node connection edge generated, so as to obtain all node connection edge generated results in the sample sentence sequence and obtain a set of node connection edge generated results.

[0070] In the above scheme, by extracting a subset of sentence entities from each sample sentence, obtaining the referential relationships and cosine similarity between sample sentences, and determining the generation of node connection edges when there are identical sentence entities, referential relationships, or sentence cosine similarity greater than a preset sentence threshold, it can integrate multi-dimensional information such as entity co-occurrence, co-reference resolution, and semantic similarity to construct heterogeneous graph edges, enabling the graph structure to more comprehensively capture the complex semantic relationships hidden in the document, thereby improving the ability of subsequent graph neural networks to model document structures.

[0071] Specifically, the intermediate data acquisition module is also used for: Obtain a reference summary, and determine positive and negative sentence samples based on the sample document and the reference summary; Anchor sentence enhancement features are selected from the sample sentence enhancement feature set based on the positive sentence samples. Sentence positive pairs are obtained based on the preset positive example pair acquisition rules, the anchor sentence enhancement features, and the sample sentence enhancement feature set; Negative sentence pairs are selected from the sample sentence enhancement feature set based on the negative sentence samples.

[0072] In the above scheme, sentence negative samples and sentence negative samples are determined by referring to the summary. Anchor sentence enhancement features and sentence negative sample pairs are selected from the sample sentence enhancement feature set. Sentence positive sample pairs are generated according to the preset positive sample pair acquisition rules. This can construct high-quality contrastive learning sample pairs, so that the subsequent contrastive loss, i.e. the sample sentence loss function, can effectively shorten the distance between the key sentence and its context representation and push away redundant sentence representation.

[0073] Specifically, the module for obtaining the enhanced feature set of the sentence to be optimized is also used for: Obtain the document to be optimized, and based on the document to be optimized, obtain the document graph structure and the set of sentence features to be optimized; The document graph structure to be optimized and the sentence feature set to be optimized are input into the target sentence enhancement model to obtain the sentence enhancement feature set to be optimized.

[0074] In the above scheme, during the practical application stage, the same data processing is performed on the document to be optimized as during training to obtain the graph structure of the document to be optimized and the set of sentence features to be optimized. These are then input into the trained target sentence enhancement model, which ensures that the context-aware quality of the sentence enhancement features to be optimized is consistent with that of the training stage, providing stable and globally semantically rich input features for subsequent target summarization generation.

[0075] Specifically, the target summary acquisition module is also used for: The enhanced feature set of the sample sentences is input into a preset summary generation model to obtain a candidate summary set; The target reward data is obtained based on the candidate summary set and the reference summary; Based on the target reward data, the preset frozen summary model, the preset summary generation model, and the preset summary generation model objective function, an algorithm is constructed to obtain the summary generation model objective function; Based on the preset model optimization algorithm and the objective function of the summary generation model, the target summary generation model is obtained; The enhanced feature set of the sentence to be optimized is input into the target summary generation model to obtain the target summary.

[0076] In the above scheme, candidate summaries are generated by inputting the enhanced features of sample sentences into a preset summary generation model. The target reward data is calculated by combining the reference summary. Based on the reward data, the frozen summary model and the objective function, an algorithm is constructed to obtain the objective function of the summary generation model. The model is then fine-tuned by a preset optimization algorithm. This approach can directly optimize the multi-dimensional indicators of summary quality using reinforcement learning, so that the final target summary generation model can better meet business needs while maintaining its generation capabilities.

[0077] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0078] Based on the above-described embodiment of a document summarization method, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a document summarization method according to any embodiment of the present invention.

[0079] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.

[0080] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0081] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0082] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute a document digest generation method as described in any of the above-described method embodiments of the present invention.

[0083] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0084] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A document summarization method, characterized in that, include: Obtain sample documents, and based on the sample documents, obtain the sample document graph structure and sample sentence feature set; The sample document graph structure and the sample sentence feature set are input into a preset sentence enhancement model to obtain the sample sentence enhancement feature set. Obtain a reference summary, and based on the sample document, the reference summary, and the sample sentence enhancement feature set, obtain anchor sentence enhancement features, sentence positive pairs, and sentence negative pairs; Based on the sentence positive example pairs, the sentence negative example pairs, the anchor sentence enhancement features, and the preset loss function, a sample sentence loss function is obtained through an algorithm. The sentence total loss function is then constructed based on the preset standard sentence loss function and the sample sentence loss function. The preset sentence enhancement model is trained based on the total sentence loss function to obtain the target sentence enhancement model; Obtain the document to be optimized, and obtain the sentence enhancement feature set based on the document to be optimized and the target sentence enhancement model; The enhanced feature set of the sentence to be optimized is input into the pre-acquired target summary generation model to obtain the target summary.

2. The document summarization method according to claim 1, characterized in that, The process of obtaining sample documents and, based on the sample documents, obtaining the sample document graph structure and sample sentence feature set includes: The sample document is segmented into sentences based on a preset sentence segmentation algorithm to obtain a sample sentence sequence. For each sample sentence in the sample sentence sequence, obtain the corresponding sample sentence feature, so as to obtain the sample sentence feature set corresponding to the sample sentence sequence based on the sample sentence features corresponding to all the sample sentences in the sample sentence sequence; The sample sentence sequence is processed by a preset graph construction algorithm to obtain the sample document graph structure.

3. The document summarization method according to claim 2, characterized in that, The graph construction process of the sample sentence sequence based on the preset graph construction algorithm to obtain the sample document graph structure includes: For any two sample sentences in the sample sentence sequence, perform the node connection edge generation result acquisition action to obtain the node connection edge generation result, and obtain all the node connection edge generation results in the sample sentence sequence to obtain the node connection edge generation result set; Generate a set of node connection edges based on the result set of the node connection edges; Based on the set of node connection edges and the sequence of sample sentences, the sample document graph structure is obtained.

4. The document summarization method according to claim 3, characterized in that, For any two sample sentences in the sample sentence sequence, the node connection edge generation result acquisition action is performed to obtain the node connection edge generation result, thereby obtaining all the node connection edge generation results in the sample sentence sequence, resulting in a set of node connection edge generation results, including: Sentence entities are extracted from each sample sentence in the sample sentence sequence to obtain a subset of sentence entities. Based on the subset of sentence entities corresponding to all sample sentences in the sample sentence sequence, a set of sentence entities corresponding to the sample sentence sequence is obtained. For any two sample sentences in the sample sentence sequence, obtain the generation result of the reference relationship between the two sample sentences, and obtain the sentence cosine similarity between the sample sentence features corresponding to the two sample sentences. If there are identical sentence entities between the sentence entity subsets corresponding to any two sample sentences, or if the generated result of the referential relationship between any two sample sentences indicates the existence of a referential relationship, or if the sentence cosine similarity between any two sample sentences is greater than a preset similarity threshold, then the node connection edge generated between any two sample sentences is determined as a node connection edge generated, so as to obtain all node connection edge generated results in the sample sentence sequence and obtain a set of node connection edge generated results.

5. The document summarization method according to claim 1, characterized in that, The step of obtaining the reference summary, and based on the sample document, the reference summary, and the sample sentence enhancement feature set, obtaining anchor sentence enhancement features, positive sentence pairs, and negative sentence pairs, includes: Obtain a reference summary, and determine positive and negative sentence samples based on the sample document and the reference summary; Anchor sentence enhancement features are selected from the sample sentence enhancement feature set based on the positive sentence samples; Sentence positive pairs are obtained based on the preset positive example pair acquisition rules, the anchor sentence enhancement features, and the sample sentence enhancement feature set; Negative sentence pairs are selected from the sample sentence enhancement feature set based on the negative sentence samples.

6. The document summarization method according to claim 1, characterized in that, The step of obtaining the document to be optimized and obtaining the sentence enhancement feature set based on the document to be optimized and the target sentence enhancement model includes: Obtain the document to be optimized, and based on the document to be optimized, obtain the document graph structure and the set of sentence features to be optimized; The document graph structure to be optimized and the sentence feature set to be optimized are input into the target sentence enhancement model to obtain the sentence enhancement feature set to be optimized.

7. The document summarization method according to claim 1, characterized in that, The step of inputting the enhanced feature set of the sentence to be optimized into the pre-acquired target summary generation model to obtain the target summary includes: The enhanced feature set of the sample sentences is input into a preset summary generation model to obtain a candidate summary set; The target reward data is obtained based on the candidate summary set and the reference summary; Based on the target reward data, the preset frozen summary model, the preset summary generation model, and the preset summary generation model objective function, an algorithm is constructed to obtain the summary generation model objective function; Based on the preset model optimization algorithm and the objective function of the summary generation model, the target summary generation model is obtained; The enhanced feature set of the sentence to be optimized is input into the target summary generation model to obtain the target summary.

8. A document summarization generation apparatus, characterized in that, include: The basic data acquisition module is used to acquire sample documents and obtain the sample document graph structure and sample sentence feature set based on the sample documents; The sample sentence enhancement feature set generation module is used to input the sample document graph structure and the sample sentence feature set into a preset sentence enhancement model to obtain the sample sentence enhancement feature set. The intermediate data acquisition module is used to acquire the reference summary and, based on the sample document, the reference summary, and the sample sentence enhancement feature set, obtain anchor sentence enhancement features, sentence positive pairs, and sentence negative pairs. The sentence total loss function construction module is used to obtain the sample sentence loss function based on the sentence positive example pair, the sentence negative example pair, the anchor sentence enhancement feature and the preset loss function construction algorithm, and to construct the sentence total loss function based on the preset standard sentence loss function and the sample sentence loss function. The target sentence enhancement model acquisition module is used to train a preset sentence enhancement model based on the total sentence loss function to obtain the target sentence enhancement model; The module for obtaining the enhanced feature set of sentences to be optimized is used to obtain the document to be optimized and to obtain the enhanced feature set of sentences to be optimized based on the document to be optimized and the target sentence enhancement model. The target summary acquisition module is used to input the enhanced feature set of the sentence to be optimized into the pre-acquired target summary generation model to obtain the target summary.

9. A terminal device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements a document summarization method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, include: A stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform a document digest generation method as described in any one of claims 1-7.