An abstract extraction method and device, electronic equipment and storage medium

By combining heterogeneous hypergraph construction and update layer methods with multi-head attention networks and Transformer network optimization models, the problem of low accuracy in traditional summary extraction schemes is solved, and higher quality summary extraction results are achieved.

CN115905504BActive Publication Date: 2026-08-04SHANGHAI PUDONG DEVELOPMENT BANK
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI PUDONG DEVELOPMENT BANK
Filing Date
2022-10-25
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing summary extraction schemes based on traditional machine learning or Seq2Seq frameworks have low accuracy and are difficult to effectively extract high-quality summaries from documents.

Method used

We employ a combination of heterogeneous hypergraph construction layer, heterogeneous hypergraph update layer, and sentence classification layer. By constructing a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes, and summary label nodes, we update the nodes and hyperedges in the graph using multi-head attention network, TF-IDF, and Transformer network, and optimize the model by combining cross-entropy loss and contrastive learning loss.

Benefits of technology

It improves the accuracy and matching of summary extraction, enabling more precise extraction of high-quality summary sentences from documents and enhancing the effectiveness of summary extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905504B_ABST
    Figure CN115905504B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a summary extraction method and device, electronic equipment and storage medium. The method comprises: obtaining a target document and a trained summary extraction model; inputting the target document into a heterogeneous hypergraph construction layer to construct a summary-document heterogeneous hypergraph comprising word hyperedges, sentence nodes and summary label nodes for the target document by the heterogeneous hypergraph construction layer, the summary label nodes being virtually constructed; inputting the summary-document heterogeneous hypergraph into a heterogeneous hypergraph updating layer to update the word hyperedges, sentence nodes and summary label nodes by the heterogeneous hypergraph updating layer to obtain an updated heterogeneous hypergraph; inputting the updated heterogeneous hypergraph into a sentence classification layer to obtain at least one summary sentence extracted from the target document, and obtaining a summary of the target document based on the at least one summary sentence. The technical solution of the embodiments of the present application can accurately extract summary sentences from the target document, ensuring the accuracy of the summary extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of natural language processing, and in particular to a summarization extraction method, apparatus, electronic device, and storage medium. Background Technology

[0002] Abstract extraction is one of the most important research directions in the field of natural language processing. It is used to extract important sentences from documents that can cover the information in the document.

[0003] Current abstract extraction schemes are mainly based on traditional machine learning or the Seq2Seq framework. However, the accuracy of the abstracts extracted using these schemes is not high and needs improvement. Summary of the Invention

[0004] This invention provides a summary extraction method, apparatus, electronic device, and storage medium to improve the accuracy of summary extraction.

[0005] According to one aspect of the present invention, a summary extraction method is provided, which may include:

[0006] Obtain the target document and the trained summary extraction model, wherein the summary extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer connected in sequence;

[0007] The target document is input into the heterogeneous hypergraph construction layer to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes, and summary label nodes for the target document. The summary label represented by the summary label node is fictitious.

[0008] The abstract-document heterogeneous hypergraph is input into the heterogeneous hypergraph update layer to update the word hyperedges, sentence nodes and abstract label nodes through the heterogeneous hypergraph update layer to obtain the updated heterogeneous hypergraph;

[0009] The updated heterogeneous hypergraph is input into the sentence classification layer to obtain at least one summary sentence extracted from the target document, and a summary of the target document is obtained based on the at least one summary sentence.

[0010] According to another aspect of the present invention, a summary extraction apparatus is provided, which may include:

[0011] The abstract extraction model acquisition module is used to acquire the target document and the trained abstract extraction model. The abstract extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer connected in sequence.

[0012] The heterogeneous hypergraph construction module is used to input the target document into the heterogeneous hypergraph construction layer, so as to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes and summary label nodes for the target document through the heterogeneous hypergraph construction layer. The summary label represented by the summary label node is fictitious.

[0013] The heterogeneous hypergraph update module is used to input the summary-document heterogeneous hypergraph into the heterogeneous hypergraph update layer, so as to update the word hyperedges, sentence nodes and summary tag nodes through the heterogeneous hypergraph update layer to obtain the updated heterogeneous hypergraph;

[0014] The abstract extraction module is used to input the updated heterogeneous hypergraph into the sentence classification layer to obtain at least one abstract sentence extracted from the target document, and to obtain a summary of the target document based on the at least one abstract sentence.

[0015] According to another aspect of the present invention, an electronic device is provided, which may include:

[0016] At least one processor; and

[0017] A memory that is communicatively connected to at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by at least one processor, such that when the at least one processor executes the program, it implements the summary extraction method provided in any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided having computer instructions stored thereon for causing a processor to execute and implement the digest extraction method provided in any embodiment of the present invention.

[0020] The technical solution of this invention involves acquiring a target document and a trained summary extraction model, which includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer, and a sentence classification layer connected in sequence. The target document is input into the heterogeneous hypergraph construction layer to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes, and summary label nodes, wherein the summary labels represented by the summary label nodes are fictitious. The summary-document heterogeneous hypergraph is then input into the heterogeneous hypergraph update layer to update the word hyperedges, sentence nodes, and summary label nodes, resulting in an updated heterogeneous hypergraph. Finally, the updated heterogeneous hypergraph is input into the sentence classification layer to obtain at least one summary sentence extracted from the target document, and a summary of the target document is obtained based on this at least one summary sentence. The above technical solution constructs a summary-document heterogeneous graph by introducing summary node labels, thereby establishing a more detailed hierarchical relationship between words, sentences, and summaries. Then, by updating the hyperedges and nodes in the summary-document heterogeneous graph, an updated heterogeneous hypergraph that better matches the target document is obtained. Finally, the updated heterogeneous hypergraph can be used to achieve accurate extraction of the summary of the target document.

[0021] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a summary extraction method provided by an embodiment of the present invention;

[0024] Figure 2 This is a flowchart of another summary extraction method provided by an embodiment of the present invention;

[0025] Figure 3 This is a flowchart of another summary extraction method provided by an embodiment of the present invention;

[0026] Figure 4 This is a schematic diagram of the heterogeneous hypergraph update process in another summary extraction method provided by an embodiment of the present invention;

[0027] Figure 5 This is a structural block diagram of a summary extraction device according to an embodiment of the present invention;

[0028] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the summary extraction method of this invention. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The same applies to "target," "original," etc., and will not be repeated here. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0031] Figure 1 This is a flowchart of a summary extraction method provided in an embodiment of the present invention. This embodiment is applicable to extracting summaries from documents. The method can be executed by the summary extraction device provided in this embodiment of the present invention. The device can be implemented by software and / or hardware, and can be integrated into an electronic device, which can be various user terminals or servers.

[0032] See Figure 1 The method of this invention specifically includes the following steps:

[0033] S110. Obtain the target document and the trained summary extraction model, wherein the summary extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer connected in sequence.

[0034] The target document can be understood as the document from which a summary is to be extracted. The summary extraction model can be understood as a trained model for extracting summaries, specifically a model for extracting summaries from the target document. It should be noted that this summary extraction model may include a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer, and a sentence classification layer connected in sequence. The heterogeneous hypergraph construction layer is used to construct a summary-document heterogeneous hypergraph for the target document. The heterogeneous hypergraph update layer is used to update the nodes and hyperedges in the summary-document heterogeneous hypergraph. The sentence classification layer is used to extract summary sentences that can form a summary from each document sentence in the target document based on the output of the heterogeneous hypergraph construction layer.

[0035] S120. Input the target document into the heterogeneous hypergraph construction layer to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes and summary label nodes for the target document through the heterogeneous hypergraph construction layer, wherein the summary label represented by the summary label node is fictitious.

[0036] The summary-document heterogeneous hypergraph constructed through the heterogeneous hypergraph construction layer can include word hyperedges, sentence nodes, and summary label nodes. The sentence nodes can be constructed based on document sentences; the word hyperedges connecting two sentence nodes can be constructed based on words in the document sentence represented by the sentence node; and the summary label nodes can be constructed based on hypothetical summary labels. By introducing summary label nodes, the summary-document heterogeneous hypergraph can be constructed, thereby establishing a hierarchical relationship between words, sentences, and summaries, resulting in a more refined model of document hierarchical relationships.

[0037] In practical applications, optionally, the summary label can be generated based on a summary label fictitious network, which can be located in or independent of the heterogeneous hypergraph construction layer; no specific limitation is made here. Alternatively, the summary label can be generated based on the target document, in which case the summary label can reflect the uniqueness of the target document; or it can be generated based on multiple sample documents used to train the summary extraction model, in which case the summary label can reflect the common characteristics among different sample documents, and these common characteristics can, to some extent, reflect some characteristics of the target document itself; and so on.

[0038] S130. Input the abstract-document heterogeneous hypergraph into the heterogeneous hypergraph update layer to update the word hyperedges, sentence nodes and abstract label nodes through the heterogeneous hypergraph update layer to obtain the updated heterogeneous hypergraph.

[0039] Specifically, the word hyperedges, sentence nodes, and summary tag nodes in the summary-document heterogeneous hypergraph are updated through a heterogeneous hypergraph update layer to obtain an updated heterogeneous hypergraph. Compared to the original summary-document heterogeneous hypergraph, this updated heterogeneous hypergraph has a better match with the target document. In practical applications, optionally, the above steps can be performed multiple times. For example, after obtaining the updated heterogeneous hypergraph through one update, this updated heterogeneous hypergraph can be used as the summary-document heterogeneous hypergraph, and S130 can be executed again to obtain an updated heterogeneous hypergraph that better matches the target document through multiple updates.

[0040] S140. The updated heterogeneous hypergraph is input into the sentence classification layer to obtain at least one summary sentence extracted from the target document, and a summary of the target document is obtained based on the at least one summary sentence.

[0041] The updated heterogeneous hypergraph includes word hyperedges, sentence nodes, and summary label nodes that are closely matched to the target document. Therefore, the updated heterogeneous hypergraph can be input into the sentence classification layer, and the sentence classification layer can extract at least one summary sentence from the target document based on the updated heterogeneous hypergraph. Furthermore, a summary of the target document can be obtained based on the at least one summary sentence, thereby achieving the effect of summary extraction.

[0042] The technical solution of this invention involves acquiring a target document and a trained summary extraction model, which includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer, and a sentence classification layer connected in sequence. The target document is input into the heterogeneous hypergraph construction layer to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes, and summary label nodes, wherein the summary labels represented by the summary label nodes are fictitious. The summary-document heterogeneous hypergraph is then input into the heterogeneous hypergraph update layer to update the word hyperedges, sentence nodes, and summary label nodes, resulting in an updated heterogeneous hypergraph. Finally, the updated heterogeneous hypergraph is input into the sentence classification layer to obtain at least one summary sentence extracted from the target document, and a summary of the target document is obtained based on this at least one summary sentence. The above technical solution constructs a summary-document heterogeneous graph by introducing summary node labels, thereby establishing a more detailed hierarchical relationship between words, sentences, and summaries. Then, by updating the hyperedges and nodes in the summary-document heterogeneous graph, an updated heterogeneous hypergraph that better matches the target document is obtained. Finally, the updated heterogeneous hypergraph can be used to achieve accurate extraction of the summary of the target document.

[0043] An optional technical solution involves a sentence classification layer that extracts summary sentences through the following steps: The updated sentence nodes in the updated heterogeneous hypergraph are used as the updated nodes; for each updated node in the updated heterogeneous hypergraph, the sentence representation is semantically matched with the tag representation corresponding to the summary tag; based on the semantic matching result, it is determined whether to include the document sentence in the target document corresponding to the sentence representation as the summary sentence. In other words, the summary extraction is transformed into semantic matching. Compared to the graph node classification paradigm, the semantic matching paradigm better ensures the accuracy of summary extraction.

[0044] Another alternative technical solution is a heterogeneous hypergraph update layer. This layer integrates sentence information from the target document's sentences into the summary label nodes before updating word hyperedges and sentence nodes, and updates the summary label nodes based on this integration. However, when the summary labels represented by the summary label nodes are fabricated based on multiple sample documents used to train the summary extraction model, these labels cannot accurately reflect the unique summary representation of the target document, which affects the accuracy of summary extraction. To address this issue, after fabricating the summary label nodes, sentence information from the target document's sentences can be obtained and integrated into the summary label nodes, resulting in summary label nodes that better match the target document, thus ensuring the accuracy of subsequent summary extraction.

[0045] Figure 2 This is a flowchart of another summary extraction method provided in this embodiment of the invention. This embodiment is based on the above-mentioned technical solutions and optimized. In this embodiment, optionally, the heterogeneous hypergraph update layer implements the word hyperedge update process through the following steps: obtaining a word hyperedge update function that cooperates with the multi-head attention network, and updating the word hyperedge based on the word hyperedge update function to obtain the updated hyperedge; obtaining an aggregation function, and updating the representation information of the updated hyperedge based on the aggregation function to complete the word hyperedge update process; optionally, the heterogeneous hypergraph update layer implements the sentence node update process through the following steps: obtaining a sentence node update function related to the word frequency-inverse text frequency index, and updating the sentence node based on the sentence node update function to complete the sentence node update process; optionally, the heterogeneous hypergraph update layer implements the summary label node update process through the following steps: obtaining a summary label node update function related to the Transformer network and sentence position information, and updating the summary label node based on the summary label node update function to complete the summary label node update process. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.

[0046] See Figure 2 The method in this embodiment may specifically include the following steps:

[0047] S210. Obtain the target document and the trained summary extraction model, wherein the summary extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer connected in sequence.

[0048] S220. Input the target document into the heterogeneous hypergraph construction layer to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes and summary label nodes for the target document through the heterogeneous hypergraph construction layer, wherein the summary label represented by the summary label node is fictitious.

[0049] S230. Input the abstract-document heterogeneous hypergraph into the heterogeneous hypergraph update layer, and perform the following steps S240-S260 through the heterogeneous hypergraph update layer to obtain an updated heterogeneous hypergraph.

[0050] It should be noted that S240-S260 can be executed sequentially or in parallel, depending on the actual application requirements, and no specific limitation is made here.

[0051] S240. The word superedge is updated based on the word superedge update function in conjunction with the multi-head attention network to obtain the updated superedge. The representation information of the updated superedge is then updated based on the aggregation function to complete the word superedge update process.

[0052] Specifically, word superedges are updated using a word superedge update function that works in conjunction with a multi-head attention network. Based on this, word superedges are further updated using a learnable aggregation function (i.e., the updated superedges are updated). The application of this aggregation function improves the information transmission capability of the graph, making it more suitable for the summary extraction task.

[0053] S250. Obtain the sentence node update function related to the word frequency-inverse text frequency index, and update the sentence nodes based on the sentence node update function to complete the sentence node update process.

[0054] In this process, sentence nodes are updated using a sentence node update function related to term frequency–inverse document frequency (TF-IDF), which introduces the TF-IDF feature into the graph aggregation process, thereby improving the information transmission capability of the graph and making it more suitable for the summary extraction task.

[0055] S260. Obtain the summary label node update function related to the Transformer network and sentence position information, and update the summary label node based on the summary label node update function to complete the summary label node update process.

[0056] Among them, the summary label node update function, which is related to the Transformer network and sentence position information, updates the summary label node. That is, the sentence position information is introduced into the graph aggregation process, thereby improving the information transmission capability of the graph and making it more suitable for the summary extraction task.

[0057] S270. The updated heterogeneous hypergraph is input into the sentence classification layer to obtain at least one summary sentence extracted from the target document, and a summary of the target document is obtained based on the at least one summary sentence.

[0058] The technical solution of this invention improves the information transmission capability of the graph by introducing multiple features (such as TF-IDF and sentence position information) and learnable aggregation functions during the graph aggregation process, making it more suitable for the summary extraction task and thus ensuring the accuracy of summary extraction.

[0059] Figure 3 This is a flowchart of another summary extraction method provided in this embodiment of the invention. This embodiment is based on the above-mentioned technical solutions and optimized. In this embodiment, optionally, the summary extraction model is pre-trained through the following steps: obtaining sample documents and real labels used to represent the summaries of the sample documents, and using the sample documents and real labels as a set of training samples to obtain multiple sets of training samples; for each sample document in the multiple sets of training samples, the sample document is input into the intermediate extraction model to be trained to obtain predicted labels, wherein the intermediate extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer to be trained; according to the predicted labels and the real labels corresponding to the sample documents in the multiple sets of training samples, a loss value is calculated through a pre-set target loss, and the parameters in the intermediate extraction model are adjusted based on the loss value to obtain the summary extraction model, wherein the target loss is obtained by introducing a contrastive learning loss on top of the cross-entropy loss. The explanations of the same or corresponding terms as in the above embodiments are not repeated here.

[0060] See Figure 3 The method in this embodiment may specifically include the following steps:

[0061] S310. Obtain sample documents and real labels used to represent the summaries of the sample documents, and use the sample documents and real labels as a set of training samples to obtain multiple sets of training samples.

[0062] Among them, the real labels can be understood as labels manually annotated for the sample text, which can be used to indicate whether the human considers each sentence in the sample document to be a summary sentence.

[0063] S320. For each sample document in the multiple sets of training samples, the sample document is input into the intermediate extraction model to be trained to obtain the predicted label. The intermediate extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer to be trained in sequence.

[0064] The intermediate extraction model can be understood as a model to be trained into a summary extraction model. The model structure of the intermediate extraction model is the same as that of the summary extraction model, except that these layers in the intermediate extraction model have not been trained.

[0065] For each sample document, it is input into the intermediate extraction model to obtain the predicted label. This predicted label indicates whether the intermediate extraction model considers each sentence in the sample document to be a summary sentence. In other words, both predicted labels and true labels are essentially summary labels; the difference is that the former is predicted, while the latter is manually labeled.

[0066] S330. Based on the predicted labels and the real labels corresponding to the sample documents in multiple training samples, calculate the loss value through the pre-set target loss, and adjust the parameters in the intermediate extraction model based on the loss value to obtain the summary extraction model. The target loss is obtained by introducing contrastive learning loss on the basis of cross-entropy loss.

[0067] Specifically, a contrastive learning loss is introduced on top of the cross-entropy loss to obtain a target loss that enhances the perception of summary labels and reduces redundancy in extracted summary sentences. Based on this, the loss value between predicted labels and true labels is calculated using the target loss, and the parameters in the intermediate extraction model are adjusted based on this loss value to train the summary extraction model.

[0068] S340. Obtain the target document and input the target document into the heterogeneous hypergraph construction layer to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes and summary label nodes for the target document through the heterogeneous hypergraph construction layer. The summary label represented by the summary label node is fictitious.

[0069] S350. Input the abstract-document heterogeneous hypergraph into the heterogeneous hypergraph update layer to update the word hyperedges, sentence nodes and abstract label nodes through the heterogeneous hypergraph update layer, and obtain the updated heterogeneous hypergraph.

[0070] S360. Input the updated heterogeneous hypergraph into the sentence classification layer to obtain at least one summary sentence extracted from the target document, and obtain a summary of the target document based on the at least one summary sentence.

[0071] The technical solution of this invention introduces contrastive learning loss on the basis of cross-entropy loss to obtain a target loss that can enhance the perception of summary tags. The model is then trained based on this target loss, thereby further ensuring the accuracy of the trained summary extraction model in terms of summary extraction.

[0072] To better understand the various technical solutions mentioned above, we will illustrate them with specific examples below. For example, we propose a label-aware contrastive heterogeneous hypergraph network summarization extraction model, which mainly includes the following three parts: (1) a heterogeneous hypergraph construction layer; (2) a heterogeneous hypergraph update layer; and (3) a sentence classification layer. The specific contents of these layers will be elaborated in detail below.

[0073] (1) Heterogeneous Hypergraph Construction Layer

[0074] Construct a summary-document heterogeneous hypergraph by introducing summary tag nodes. This abstract-document heterogeneous hypergraph contains sentence nodes. And the summary label node (i.e., the category label node). Hyper-edge set ε w,s Each hyperedge e in s All of these are information about document terms within the document, and the hyperedge set ε s,c Each hyperedge e in c All of these are information from sentences within the document. Here, we use X. s ∈R n×F The sentence node representation matrix can optionally be obtained using Convolutional Neural Networks (CNNs) and Long Short-Term Memory (LSTM) networks.

[0075]

[0076]

[0077] in Let represent the j-th document word in the i-th document sentence. Here, we use... The document word representation matrix can be obtained from pre-trained word vectors. Similarly, here we use... The category label matrix can be obtained through matrix initialization. H... s ∈{0,1} n×m For Hypergraph The correlation matrix, if document word x i ∈s j ,but otherwise Hc ∈{0,1} 2×n For Hypergraph The correlation matrix, optionally, sets H. c It is a fully connected incidence matrix, i.e.

[0078] (2) Heterogeneous Hypergraph Update Layer

[0079] Update the summary using the heterogeneous hypergraph update layer - word hyperedges, sentence nodes, and summary tag nodes in the document heterogeneous hypergraph:

[0080]

[0081]

[0082] Among them It is a word hyperedge update function; It is a sentence node update function; This is the function for updating the summary tag node.

[0083] For details, see Figure 4 The first box shows the word superedge update process, where v s For sentence nodes (i.e., node features), and e s It is a word super-edge (i.e., edge feature).

[0084] Based on this, for

[0085]

[0086]

[0087] Among them and The weight matrix is ​​a learnable matrix. The information represented by the word hyperedge (i.e., word hyperedge representation), To and The representation information of connected sentence nodes (i.e., sentence node representations). Furthermore, for multi-head attention networks (attention add):

[0088]

[0089] Where K is the number of attention heads. In this example, a learnable aggregation function is introduced to enhance the information transmission capability of the graph structure:

[0090]

[0091] MLP(t) It is a multilayer perceptron used to fit arbitrary aggregation functions, and LN is the normalization layer.

[0092] See Figure 4 The sentence node update process shown in the second box is for... The function introduces TF-IDF features during graph aggregation:

[0093] F j =max(1,β*T) j )

[0094]

[0095] T j Let be the TF-IDF feature value of the j-th document word, and β be the weight coefficient, which is β = 2 in this example. For multi-head attention networks, The formula in the middle can be modified as follows:

[0096]

[0097] Similarly, see Figure 4 The third box in the diagram shows the summary label node update process, where l represents the summary label node (i.e., the label feature), and its specific values ​​can be... Or e c It is a sentence hyperedge. Based on this, for Introducing Transformer layers and sentence position information:

[0098]

[0099] Among them This is the updated sentence node representation matrix (i.e., the representation matrix corresponding to the updated nodes mentioned above). Simultaneously, sentence position information is incorporated during graph aggregation:

[0100]

[0101] P j This represents the sentence position information for the j-th sentence. Similarly, for multi-head attention networks, this will... The formula in the middle is modified as follows:

[0102]

[0103] It should be noted that after creating the abstract labels, in order to obtain better abstract label representations and thus improve the subsequent semantic matching results, the following steps can be performed: Initialization The category label representation matrix represents the common features of summary sentences across different documents. Simultaneously, to capture the unique summary sentence representation for each document, thereby achieving the goal of summarizing using a semantic matching paradigm, sentence information from the document sentences is integrated into the summary label nodes:

[0104]

[0105]

[0106] Among them The representation matrix of the summary tag nodes is obtained from initialization; γ1 is the initial representation matrix of the sentence nodes; γ1 is the update coefficient, which in this example is γ1 = 1. The obtained... The summary label node participates in the update process of the node and hyperedge. The final result is the updated sentence node representation. and summary tag node representation

[0107] (3) Sentence classification layer

[0108] Sentence summarization is performed using a sentence classification layer (the following formula represents semantic matching):

[0109]

[0110] In this example, a contrastive learning loss is introduced on top of the cross-entropy loss to enhance the awareness of summary labels and reduce redundancy in extracted summary sentences:

[0111]

[0112]

[0113]

[0114] Where y is the real label. This is for predicting labels. N is the number of training samples. d P represents the number of sentences in the document of the d-th training sample. i Let be the set of positive samples for the i-th training sample. Let be the set of comparison samples for the i-th training sample. Let be the summary label representation of the i-th training sample. This represents its positive samples. This is a representation of its comparison samples. τ is the temperature coefficient. γ2 is the weighting coefficient.

[0115] The aforementioned heterogeneous hypergraph network summarization model based on label perception and contrast can accurately extract summary sentences from documents, achieving good summarization results.

[0116] Figure 5 This is a structural block diagram of a summary extraction apparatus provided in an embodiment of the present invention. This apparatus is used to execute the summary extraction method provided in any of the above embodiments. This apparatus and the summary extraction methods of the above embodiments belong to the same inventive concept. Details not described in detail in the embodiments of the summary extraction apparatus can be found in the embodiments of the above summary extraction methods. See also... Figure 5 The device may specifically include: a summary extraction model acquisition module 410, a heterogeneous hypergraph construction module 420, a heterogeneous hypergraph update module 430, and a summary extraction module 440.

[0117] The abstract extraction model acquisition module 410 is used to acquire the target document and the trained abstract extraction model. The abstract extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer connected in sequence.

[0118] The heterogeneous hypergraph construction module 420 is used to input the target document into the heterogeneous hypergraph construction layer, so as to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes and summary label nodes for the target document through the heterogeneous hypergraph construction layer, wherein the summary label represented by the summary label node is fictitious;

[0119] The heterogeneous hypergraph update module 430 is used to input the summary-document heterogeneous hypergraph into the heterogeneous hypergraph update layer, so as to update the word hyperedges, sentence nodes and summary label nodes through the heterogeneous hypergraph update layer to obtain the updated heterogeneous hypergraph.

[0120] The abstract extraction module 440 is used to input the updated heterogeneous hypergraph into the sentence classification layer to obtain at least one abstract sentence extracted from the target document, and to obtain a summary of the target document based on the at least one abstract sentence.

[0121] Optionally, the heterogeneous hypergraph update layer implements the word hyperedge update process through the following modules:

[0122] The module for obtaining updated superedges is used to obtain the word superedge update function that works with the multi-head attention network, and to update the word superedges based on the word superedge update function to obtain the updated superedges;

[0123] The word hyperedge update module is used to obtain the aggregation function and update the representation information of the updated hyperedge based on the aggregation function to complete the word hyperedge update process.

[0124] Optionally, the heterogeneous hypergraph update layer implements the sentence node update process through the following modules:

[0125] The sentence node update module is used to obtain the sentence node update function related to the word frequency-inverse text frequency index, and update the sentence nodes based on the sentence node update function to complete the sentence node update process.

[0126] Optionally, the heterogeneous hypergraph update layer implements the update process of the summary label nodes through the following modules:

[0127] The summary label node update module is used to obtain the summary label node update function related to the Transformer network and sentence position information, and update the summary label node based on the summary label node update function to complete the summary label node update process.

[0128] Optionally, the sentence classification layer implements the process of extracting summary sentences through the following modules:

[0129] The updated node module is used to update the sentence nodes in the heterogeneous hypergraph as the updated nodes;

[0130] The summary sentence acquisition module is used to perform semantic matching between the sentence representation corresponding to each updated node in the updated heterogeneous hypergraph and the tag representation corresponding to the summary label, and determine whether to use the document sentence in the target document that corresponds to the sentence representation as the summary sentence based on the semantic matching result.

[0131] Optionally, a heterogeneous hypergraph update layer is used to integrate sentence information of document sentences in the target document into the summary label node before updating word hyperedges and sentence nodes, and update the summary label node based on the integration result.

[0132] Optionally, the summary extraction model is pre-trained using the following modules:

[0133] The training sample acquisition module is used to obtain sample documents and real labels used to represent the summaries of the sample documents, and uses the sample documents and real labels as a set of training samples to obtain multiple sets of training samples;

[0134] The predicted label acquisition module is used to input the sample document into the intermediate extraction model to be trained for each sample document in multiple training samples to obtain the predicted label. The intermediate extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer to be trained.

[0135] The summary extraction model module is used to calculate the loss value based on the predicted label and the real label corresponding to the sample document in multiple training samples, through a pre-set target loss. The parameters in the intermediate extraction model are adjusted based on the loss value to obtain the summary extraction model. The target loss is obtained by introducing contrastive learning loss on the basis of cross-entropy loss.

[0136] The summary extraction device provided in this embodiment of the invention acquires a target document and a trained summary extraction model through a summary extraction model acquisition module. The summary extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer, and a sentence classification layer connected in sequence. The target document is input into the heterogeneous hypergraph construction layer through the heterogeneous hypergraph construction module to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes, and summary label nodes. The summary labels represented by the summary label nodes are fictitious. The summary-document heterogeneous hypergraph is input into the heterogeneous hypergraph update layer through the heterogeneous hypergraph update module to update the word hyperedges, sentence nodes, and summary label nodes, resulting in an updated heterogeneous hypergraph. The updated heterogeneous hypergraph is input into the sentence classification layer through the summary extraction module to obtain at least one summary sentence extracted from the target document. A summary of the target document is obtained based on this at least one summary sentence. The aforementioned device constructs a summary-document heterogeneous graph by introducing summary node labels, thereby establishing a more refined hierarchical relationship between words, sentences, and summaries. Then, by updating the hyperedges and nodes in the summary-document heterogeneous graph, an updated heterogeneous hypergraph that better matches the target document is obtained. Finally, the updated heterogeneous hypergraph can be used to achieve accurate extraction of the summary of the target document.

[0137] The summary extraction device provided in this embodiment of the invention can execute the summary extraction method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0138] It is worth noting that in the embodiments of the above-mentioned summary extraction device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0139] Figure 6 A schematic diagram of an electronic device 10 that can be used to implement embodiments 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 processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0140] like Figure 6As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0141] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0142] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the summarization extraction method.

[0143] In some embodiments, the digest extraction method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the digest extraction method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the digest extraction method by any other suitable means (e.g., by means of firmware).

[0144] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0145] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0146] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0147] 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 provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0148] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0149] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0150] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0151] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A summary extraction method, characterized in that, include: Obtain the target document and the trained summary extraction model, wherein the summary extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer connected in sequence; The target document is input into the heterogeneous hypergraph construction layer to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes, and summary tag nodes for the target document through the heterogeneous hypergraph construction layer, wherein the summary tag represented by the summary tag node is fictitious; The summary-document heterogeneous hypergraph is input into the heterogeneous hypergraph update layer to update the word hyperedges, sentence nodes and summary tag nodes through the heterogeneous hypergraph update layer, thereby obtaining the updated heterogeneous hypergraph; The updated heterogeneous hypergraph is input into the sentence classification layer to obtain at least one summary sentence extracted from the target document, and a summary of the target document is obtained based on the at least one summary sentence; The heterogeneous hypergraph update layer implements the word hyperedge update process through the following steps: obtaining a word hyperedge update function that works with the multi-head attention network, and updating the word hyperedge based on the word hyperedge update function to obtain the updated hyperedge; obtaining an aggregation function, and updating the representation information of the updated hyperedge based on the aggregation function to complete the word hyperedge update process. The heterogeneous hypergraph update layer implements the sentence node update process through the following steps: obtaining a sentence node update function related to the word frequency-inverse text frequency index, and updating the sentence node based on the sentence node update function to complete the sentence node update process; The heterogeneous hypergraph update layer implements the update process of the summary label node through the following steps: obtaining the summary label node update function related to the Transformer network and sentence position information, and updating the summary label node based on the summary label node update function to complete the update process of the summary label node; The sentence classification layer extracts the summary sentences through the following steps: The updated sentence node in the updated heterogeneous hypergraph is used as the updated node; For each updated node in the updated heterogeneous hypergraph, the sentence representation is semantically matched with the tag representation corresponding to the summary tag, and the document sentence in the target document that corresponds to the sentence representation is used as the summary sentence based on the semantic matching result.

2. The method according to claim 1, characterized in that, The heterogeneous hypergraph update layer is used to integrate sentence information of document sentences in the target document into the summary tag node before updating the word hyperedge and the sentence node, and update the summary tag node according to the integration result.

3. The method according to claim 1, characterized in that, The abstract extraction model is pre-trained through the following steps: Obtain sample documents and real labels used to represent the summaries of the sample documents, and use the sample documents and the real labels as a set of training samples to obtain multiple sets of training samples; For each sample document in the multiple sets of training samples, the sample document is input into the intermediate extraction model to be trained to obtain the predicted label. The intermediate extraction model includes the heterogeneous hypergraph construction layer, the heterogeneous hypergraph update layer and the sentence classification layer to be trained. Based on the predicted labels and the real labels corresponding to the sample documents in the multiple training samples, a loss value is calculated using a pre-set target loss. The parameters in the intermediate extraction model are adjusted based on the loss value to obtain the summary extraction model. The target loss is obtained by introducing a contrastive learning loss on top of the cross-entropy loss.

4. A summary extraction device, characterized in that, include: The abstract extraction model acquisition module is used to acquire the target document and the trained abstract extraction model, wherein the abstract extraction model includes a heterogeneous hypergraph construction layer, a heterogeneous hypergraph update layer and a sentence classification layer connected in sequence. The heterogeneous hypergraph construction module is used to input the target document into the heterogeneous hypergraph construction layer, so as to construct a summary-document heterogeneous hypergraph containing word hyperedges, sentence nodes and summary label nodes for the target document through the heterogeneous hypergraph construction layer, wherein the summary label represented by the summary label node is fictitious; The heterogeneous hypergraph update module is used to input the summary-document heterogeneous hypergraph into the heterogeneous hypergraph update layer, so as to update the word hyperedges, sentence nodes and summary tag nodes through the heterogeneous hypergraph update layer to obtain the updated heterogeneous hypergraph; The abstract extraction module is used to input the updated heterogeneous hypergraph into the sentence classification layer to obtain at least one abstract sentence extracted from the target document, and to obtain a summary of the target document based on the at least one abstract sentence; The heterogeneous hypergraph update layer implements the word hyperedge update process through the following modules: an updated hyperedge acquisition module, used to obtain a word hyperedge update function that works with the multi-head attention network, and update the word hyperedge based on the word hyperedge update function to obtain the updated hyperedge; and a word hyperedge update module, used to obtain an aggregation function, and update the representation information of the updated hyperedge based on the aggregation function to complete the word hyperedge update process. The heterogeneous hypergraph update layer implements the sentence node update process through the following module: a sentence node update module, which is used to obtain a sentence node update function related to the word frequency-inverse text frequency index, and update the sentence nodes based on the sentence node update function to complete the sentence node update process; The heterogeneous hypergraph update layer implements the update process of the summary label node through the following module: the summary label node update module, which is used to obtain the summary label node update function related to the Transformer network and sentence position information, and update the summary label node based on the summary label node update function to complete the update process of the summary label node; The sentence classification layer implements the process of extracting summary sentences through the following modules: The updated node module is used to update the sentence nodes in the heterogeneous hypergraph as the updated nodes; The summary sentence acquisition module is used to perform semantic matching between the sentence representation corresponding to each updated node in the updated heterogeneous hypergraph and the tag representation corresponding to the summary label, and determine whether to use the document sentence in the target document that corresponds to the sentence representation as the summary sentence based on the semantic matching result.

5. An electronic device, characterized in that, include: At least one processor; as well as 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 to cause the at least one processor to perform the digest extraction method as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute and implement the digest extraction method as described in any one of claims 1-3.