A generative summarization method for case public opinion multi-document based on factor graph attention

By constructing heterogeneous graphs and performing joint learning using a method based on element graph attention, the problem of integrating the differences and connections between case public opinion and case elements in the Chinese multi-document generative summary of case public opinion is solved, improving the accuracy and prediction of the summary. Effect.

CN114969304BActive Publication Date: 2024-08-23KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210499501.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-09
Publication Date
2024-08-23
Estimated Expiration
2042-05-09

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively integrate the differences and connections between the Chinese text of case public opinion and case elements in the multi-document generative summary of case public opinion, resulting in a low accuracy of abstract extraction.

Method used

The case public opinion multi-document generative summary method based on element graph attention is adopted. By constructing a heterogeneous graph and graph attention mechanism, filtering sentence features, and combining the main task model and the auxiliary model for joint learning, the performance of the generative summary is improved.

Benefits of technology

It improves the accuracy of Chinese multi-document generative summaries of case public opinion, effectively filters sentence features through the graph attention mechanism, enhances the prediction effect of the model, has strong parallelism, and captures rich character features and category features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114969304B
    Figure CN114969304B
Patent Text Reader

Abstract

The present invention relates to a method for generative summarization of case public opinion multi-documents based on element graph attention, and belongs to the field of natural language processing. The present invention comprises: constructing a case public opinion multi-document summary dataset; firstly, through a method of integrating case elements based on a graph attention mechanism, constructing a heterogeneous graph composed of sentence nodes, word nodes and case element nodes to capture the correlation between sentences, and finally classifying the sentences to generate summaries. The present invention adopts a graph attention method to represent different nodes, and adopts a graph attention mechanism and updates the parameters of the main task model and the auxiliary model through the correlation between sentence nodes and element nodes. The present invention realizes the generative work of public opinion summaries by integrating case elements and effectively screening sentences containing more keywords, extracting summaries from the acquired case public opinion data, and playing an important supporting role in the subsequent rapid understanding of the case, grasping and monitoring the development trend of public opinion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a case public opinion multi-document generative summary method based on factor graph attention, and belongs to the field of natural language processing. Background Art

[0002] The case public opinion summary can be regarded as a summary for a specific field, in which the generative summary directly generates a summary similar to the original text theme from the original text. Because the generated sentences are faithful to the original text theme, the fluency and fidelity are good, and good results are achieved in actual scenarios.

[0003] Generative summarization methods refer to understanding and summarizing the core ideas of the input document and then generating a summary. The summary generated by this method consists of new sentences and has a high degree of semantic fit with the original text. Traditional generative summarization methods can be divided into sentence fusion-based methods, topic paraphrase-based methods, and information extraction-based methods.

[0004] With the in-depth study of deep learning, generative methods have achieved good results in single document summarization. Among them, transformer-based methods have become the mainstream methods for generative summarization and pre-trained language models. Zhang et al. proposed a hierarchical bidirectional encoder (Hibert) model, and constructed two Berts for document encoding and pre-training with unlabeled data, respectively, and initialized the model from the pre-trained encoder to classify sentences. In addition, several general sequence-to-sequence pre-training models, such as T5 and BART, have been proposed, which are further fine-tuned for summary tasks and optimize pre-trained models. Zhang et al. proposed the PEGASUS model, which designed a self-supervised pre-training model specifically for generative summarization, deleted or blocked a key sentence from the document, and generated this key sentence according to other sentences in the document. These sentences are used as summary sentences, similar to extractive summarization. Zou et al. proposed to pre-train a generative summary model based on Seq2Seq on unlabeled text. By giving manually constructed input text, the model is pre-trained to recover the source text for generating summaries, and three sequence-to-sequence pre-training target models are proposed. These targets include sentence rearrangement, next sentence generation, and masked document generation. These three targets are closely related to the generative summary task.

[0005] Traditional graph-based summarization methods refer to sorting text units on the graph and then selecting text units with significant information to form a summary. LexRank calculates the sentence significance score by connecting the centers of the feature vectors in the graph by cosine similarity, and then extracts sentences with high scores to form a summary. Wan et al. proposed a multi-document summarization model based on a graph sorting algorithm, combining document-level information and sentence-to-document relationships, and applied it to the graph-based sorting process. Christensen et al. proposed a joint model for selection and sorting, respectively based on indicators including discourse clues, verb nouns, co-reference, etc., to construct a multi-document graph to represent the discourse relationship between sentences and estimate the coherence of a candidate summary.

[0006] In the graph neural network method, Tan et al. introduced a graph-based attention mechanism in the traditional encoder-decoder model to identify salient sentences; at the decoding end, a hierarchical decoding model was proposed, and a reference mechanism was introduced to improve the novelty, information correctness and fluency of the summary. Yasunaga et al. constructed an approximate discourse graph based on discourse markers and case element links, and then applied a graph convolutional network on the relationship graph to score sentences. Fan et al. proposed a model for query-based open domain natural language processing tasks, constructed a local graph knowledge base, compressed network search information, reduced redundancy, and then linearized it into a structured input sequence. The model can encode the representation of the graph in a standard Seq2Seq setting. Huang et al. further designed a graph encoder and improved the graph attention network, using dual encoders, document encoders and graph encoders to maintain the contextual global and local information features of entity information. Wang et al. constructed heterogeneous graphs by introducing text nodes of different granularity levels to achieve generative summary tasks. These text nodes act as intermediaries between sentences and enrich the relationship between cross-sentences. Summary of the invention

[0007] The present invention provides a case public opinion multi-document generative summary model based on factor graph attention, which generates summaries from the perspectives of case public opinion Chinese text and case factors, and improves the performance of the generative summary task by introducing a shared feature filtering and selection layer to discard invalid features and select favorable features.

[0008] Invention technical solution: A case public opinion multi-document generative summary method based on factor graph attention, the specific steps of the method are as follows:

[0009] The specific steps of the method are as follows:

[0010] Step 1. Use crawler technology to crawl case public opinion text datasets, and manually clean and annotate the datasets to obtain case public opinion summary multi-document datasets; construct a case library containing case names, search according to case names, and display search results in the form of web pages. The first content of the web page is used as the summary, and the second content of the web page describing the case is defined as the case element. After screening and preprocessing, the resulting json format file is formed;

[0011] Step 2: Encode the features of the case public opinion text and case elements through word embedding and position embedding respectively, use CNN and BiLSTM encoders to extract sentence features, construct a heterogeneous graph with the obtained sentence features and case element features to extract document features, and then use the method based on graph attention mechanism to integrate case elements into the document features to effectively filter and select sentences, and use graph attention to simultaneously learn and update the parameters of the main task model and the auxiliary model.

[0012] As a further solution of the present invention, the specific steps of Step 1 are:

[0013] Step 1.1. Use crawler technology to crawl case public opinion news texts, crawling a total of 4569 documents, each of which contains a summary, case elements and the text describing the case;

[0014] Step 1.2: Filter and screen the text and case elements in the case public opinion summary multi-document dataset. The filtering and screening methods are as follows: (1) remove redundant symbols, hyperlinks, and special characters in the text content; (2) remove the same case element information in the text;

[0015] Step 1.3, use manual annotation to obtain the case public opinion dataset; first, label each sentence in the text, 1 is a candidate summary, and 0 is not a candidate summary.

[0016] As a further solution of the present invention, the specific steps of Step 2 are as follows:

[0017] Step 2.1, construct the element relationship diagram: The input source document is multiple documents D = {d1, d2, ..., d n}, first D is divided into smaller semantic units, paragraphs p = {p1, p2, ..., p n}; Then construct an element relationship graph G = (V, E); V includes paragraph node V p and case element node V c , E represents the undirected edge between nodes. There is no edge inside a paragraph node or a case element node. There are only edges between paragraph nodes or case element nodes. i and c j The edge between them refers to the case element node cj Contained in paragraph node p i In which p i represents the i-th paragraph node, c j represents the jth case element node;

[0018] In order to obtain more semantic information, the relationship matrix is ​​obtained by fusing case element nodes and paragraph nodes. The element e in E ij ≠0 indicates element node c j In the paragraph node p i In E, the TFIDF values ​​between feature nodes and paragraph nodes are calculated to form the edge weight matrix to model the importance of the relationship between case elements and paragraphs;

[0019] Step 2.2: Segment multiple documents, and then stack several token-level transformer encoding layers together to encode the contextual information in each paragraph. Represents the input token vector. For the lth transformer layer, the input feature is The hidden state is The output is

[0020]

[0021]

[0022] LayerNorm is a normalization operation, MHAttn is the multi-head attention of transformer, FFN represents a feedforward neural network, and its activation function is ReLU. The output of the last layer is used as a token-level feature. To represent the token-level feature matrix, where n w is the total number of tokens in all paragraphs, d w is the dimensionality of the token embedding;

[0023] In order to obtain a fixed-length paragraph representation, a weighted merging operation is applied, and the multi-head attention mechanism calculates the weight distribution on the token, allowing the model to flexibly encode the paragraph when representing it in different subspaces through different heads;

[0024] h p =MHPool(h w1 ,h w2 ,...) (3)

[0025] use to represent the feature matrix of a paragraph, n represents the number of paragraphs, d hrepresents the size of the hidden layer dimension; the case element encoder representation is the same as the paragraph encoder representation process, but the two encoders do not share parameters, and model the relationship between paragraphs and case elements in a unified semantic space; pronouns and stop words in case elements are deleted, respectively. and To represent the token-level feature matrix and the case-level feature matrix; mw It indicates the total number of token-level features obtained after word segmentation of case elements, and m indicates the number of case elements;

[0026] Step 2.3, use the graph attention network GAT to update the representation of semantic nodes; i, j ∈ {1, 2, ..., (m + n)} represents any node in the graph, and use Represents the node representation, with N i Represents the set of adjacent nodes of node i, and the GAT layer is designed as follows:

[0027] z ij =LeakyReLU(W a [W q h i ; W k h j ]) (4)

[0028]

[0029]

[0030]

[0031] Where W a ,W q ,W k ,W v represents the trainable weight, σ is the sigmoid activation function, The idea is to represent edge weights by discretizing real values ​​into integers, and then learn embeddings of integers to map weights to a multidimensional embedding space. In this way, the information contained in the value needs to be learned through an additional embedding matrix. The TFIDF value indicates the proximity between the case element node and the paragraph node. Therefore, by updating the attention weight using formula (5), the original TFIDF information is directly incorporated into the GAT mechanism;

[0032] Combining the graph attention mechanism GAT with multi-head operations to obtain h i , a residual connection is added to avoid gradient vanishing after a few iterations:

[0033]

[0034] Use the above GAT layer and position feed-forward layer to iteratively update the node representation; each iteration contains an update process from paragraph to case element and from case element to paragraph. After t iterations, Represents each input feature matrix;

[0035]

[0036] represents the paragraph feature matrix updated by case elements; where n c Indicates the number of element nodes, d c Represents the input dimension of the feature node, d h Represents the contextual dimension;

[0037] Step 2.4: In each decoding step, the decoder state is s, and the case element node c is calculated. i Attention score:

[0038]

[0039] In formula (10), represents the transposed matrix obtained after training, W q ,W k is a trainable parameter, z i is the attention coefficient in state s;

[0040]

[0041] In formula (11) are the edge weights derived from the TFIDF value matrix, represents the paragraph node coefficient, and formula (11) passes through the information flow between the element node and the paragraph node;

[0042]

[0043] Formula (12) is normalized, weighted and summed, and then passed through an activation function to obtain the attention weight of the element node; the attention score β is selected j The highest first k paragraph nodes, and then T in the selected paragraph nodes w Tokens use attention mechanism;

[0044]

[0045] In formula (13) represents the transposed matrix obtained after training, W q ,W k is a trainable parameter, z wiis the attention coefficient of the paragraph node token level in state s, Represents the token-level context vector obtained after the paragraph is segmented;

[0046]

[0047] Formula (14) is normalized, weighted and summed, and then passed through an activation function to obtain the token-level attention weight in the paragraph node; the attention score β is selected j The highest k paragraph nodes, and then T in the selected paragraph w Apply attention mechanism to tokens;

[0048]

[0049] Formula (15) is obtained by factor node attention β j Aggregated with the token-level paragraph features, we get the token-level paragraph features of the two-level attention mechanism.

[0050]

[0051] In formula (16) Represents the token-level context vector, which is the token-level paragraph feature after the two-level attention mechanism After weighted summation, we finally get the paragraph context vector representation v t ;

[0052] The context vector is taken as the salient information generated from the source document summary and is combined with the decoder hidden state s t Concatenate to get the vocabulary distribution:

[0053] P vocab =Softmax(W o [s t ;v t ]) (17)

[0054] Formula (17) is obtained by hidden state s t and the paragraph context vector representation v t Concatenate, and then normalize with the trainable matrix parameter W0 to get the final decoding result;

[0055] Step 2.5, generate summary: Finally, select the Adam optimizer, iteratively update the neural network weights based on the training data, and use the trained neural network to generate summary.

[0056] The beneficial effects of the present invention are:

[0057] (1) For the Chinese multi-document generative summary of case public opinion, how to consider both the difference between the Chinese text of the case public opinion and the case elements, as well as the connection between them, and how to filter and select key features in the case elements to improve the accuracy of summary extraction. A graph attention mechanism is proposed to achieve the fusion of paragraphs and case elements, and a multi-task joint learning model for the fusion of case elements is designed to promote the generation of summaries. For the first time, case elements are introduced as auxiliary tasks to improve its prediction performance.

[0058] (2) The proposed model uses the graph attention mechanism to filter and select sentence feature streams to effectively screen sentence nodes, thereby improving the prediction effect of the model.

[0059] (3) The multi-head attention of the encoder structure using graph attention GAT can capture richer character features and character category features, and has good parallelism. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a specific structural diagram of the case public opinion multi-document generative summary method based on factor graph attention proposed in the present invention. DETAILED DESCRIPTION

[0061] Example 1: Figure 1 As shown in FIG. 1 , a method for generating summaries of case public opinion multi-documents based on factor graph attention is described. The specific steps of the method are as follows:

[0062] The specific steps of the method are as follows:

[0063] Step 1. Use crawler technology to crawl case public opinion text datasets, and manually clean and annotate the datasets to obtain case public opinion summary multi-document datasets; construct a case library containing case names, search according to case names, and display search results in the form of web pages. The first content of the web page is used as the summary, and the second content of the web page describing the case is defined as the case element. After screening and preprocessing, the resulting json format file is formed;

[0064] Step 2: Encode the features of the case public opinion text and case elements through word embedding and position embedding respectively, use CNN and BiLSTM encoders to extract sentence features, construct a heterogeneous graph with the obtained sentence features and case element features to extract document features, and then use the method based on graph attention mechanism to integrate case elements into the document features to effectively filter and select sentences, and use graph attention to simultaneously learn and update the parameters of the main task model and the auxiliary model.

[0065] As a further solution of the present invention, the specific steps of Step 1 are:

[0066] Step 1.1. Use crawler technology to crawl case public opinion news texts, crawling a total of 14,214 documents, each of which contains a summary, case elements and the text describing the case;

[0067] Step 1.2: Filter and screen the text and case elements in the case public opinion summary multi-document dataset. The filtering and screening methods are as follows: (1) remove redundant symbols, hyperlinks, and special characters in the text content; (2) remove the same case element information in the text;

[0068] Step 1.3, use manual annotation to obtain the case public opinion data set; first, label each sentence in the text, 1 is a candidate summary, and 0 is not a candidate summary. The scale of the experimental corpus is shown in Table 1:

[0069] Table 1 Multi-document summary dataset information

[0070]

[0071] As a further solution of the present invention, the specific steps of Step 2 are as follows:

[0072] Step 2.1, construct the element relationship diagram: The input source document is multiple documents D = {d1, d2, ..., d n}, first D is divided into smaller semantic units, paragraphs p = {p1, p2, ..., p n}; Then construct an element relationship graph G = (V, E); V includes paragraph node V p and case element node V c , E represents the undirected edge between nodes. There is no edge inside a paragraph node or a case element node. There are only edges between paragraph nodes or case element nodes. i and c j The edge between them refers to the case element node c j Contained in paragraph node p i In which p i represents the i-th paragraph node, c j represents the jth case element node;

[0073] In order to obtain more semantic information, the relationship matrix is ​​obtained by fusing case element nodes and paragraph nodes. The element e in E ij ≠0 indicates element node c j In the paragraph node p i In E, the TFIDF values ​​between feature nodes and paragraph nodes are calculated to form the edge weight matrix to model the importance of the relationship between case elements and paragraphs;

[0074] Step 2.2: Segment multiple documents, and then stack several token-level transformer encoding layers together to encode the contextual information in each paragraph. Represents the input token vector. For the lth transformer layer, the input feature is The hidden state is The output is

[0075]

[0076]

[0077] LayerNorm is a normalization operation, MHAttn is the multi-head attention of transformer, FFN represents a feedforward neural network, and its activation function is ReLU. The output of the last layer is used as a token-level feature. To represent the token-level feature matrix, where n w is the total number of tokens in all paragraphs, d w is the dimensionality of the token embedding;

[0078] In order to obtain a fixed-length paragraph representation, a weighted merging operation is applied, and the multi-head attention mechanism calculates the weight distribution on the token, allowing the model to flexibly encode the paragraph when representing it in different subspaces through different heads;

[0079] h p =MHPool(h w1 ,h w2 ,...) (3)

[0080] use to represent the feature matrix of a paragraph, n represents the number of paragraphs, d h represents the size of the hidden layer dimension; the case element encoder representation is the same as the paragraph encoder representation process, but the two encoders do not share parameters, and model the relationship between paragraphs and case elements in a unified semantic space; pronouns and stop words in case elements are deleted, respectively. and To represent the token-level feature matrix and the case-level feature matrix; mw It indicates the total number of token-level features obtained after word segmentation of case elements, and m indicates the number of case elements;

[0081] Step 2.3, use the graph attention network GAT to update the representation of semantic nodes; i, j ∈ {1, 2, ..., (m + n)} represents any node in the graph, and use Represents the node representation, with Ni Represents the set of adjacent nodes of node i, and the GAT layer is designed as follows:

[0082] z ij =LeakyReLU(W a [W q h i ; W k h j ]) (4)

[0083]

[0084]

[0085]

[0086] Where W a ,W q ,W k ,W v represents the trainable weight, σ is the sigmoid activation function, The idea is to represent edge weights by discretizing real values ​​into integers, and then learn embeddings of integers to map weights to a multidimensional embedding space. In this way, the information contained in the value needs to be learned through an additional embedding matrix. The TFIDF value indicates the proximity between the case element node and the paragraph node. Therefore, by updating the attention weight using formula (5), the original TFIDF information is directly incorporated into the GAT mechanism;

[0087] Combining the graph attention mechanism GAT with multi-head operations to obtain h i , a residual connection is added to avoid gradient vanishing after a few iterations:

[0088]

[0089] Use the above GAT layer and position feed-forward layer to iteratively update the node representation; each iteration contains an update process from paragraph to case element and from case element to paragraph. After t iterations, Represents each input feature matrix;

[0090]

[0091] represents the paragraph feature matrix updated by case elements; where n c Indicates the number of element nodes, d c Represents the input dimension of the feature node, d h Represents the contextual dimension;

[0092] Step 2.4: In each decoding step, the decoder state is s, and the case element node c is calculated. i Attention score:

[0093]

[0094] In formula (10), represents the transposed matrix obtained after training, W q ,W k is a trainable parameter, z i is the attention coefficient in state s;

[0095]

[0096] In formula (11) are the edge weights derived from the TFIDF value matrix, represents the paragraph node coefficient, and formula (11) passes through the information flow between the element node and the paragraph node;

[0097]

[0098] Formula (12) is normalized, weighted and summed, and then passed through an activation function to obtain the attention weight of the element node; the attention score β is selected j The highest first k paragraph nodes, and then T in the selected paragraph nodes w Tokens use attention mechanism;

[0099]

[0100] In formula (13) represents the transposed matrix obtained after training, W q ,W k is a trainable parameter, z wi is the attention coefficient of the paragraph node token level in state s, Represents the token-level context vector obtained after the paragraph is segmented;

[0101]

[0102] Formula (14) is normalized, weighted and summed, and then passed through an activation function to obtain the token-level attention weight in the paragraph node; the attention score β is selected j The highest k paragraph nodes, and then T in the selected paragraph w Apply attention mechanism to tokens;

[0103]

[0104] Formula (15) is obtained by factor node attention β j Aggregated with the token-level paragraph features, we get the token-level paragraph features of the two-level attention mechanism.

[0105]

[0106] In formula (16) Represents the token-level context vector, which is the token-level paragraph feature after the two-level attention mechanism After weighted summation, we finally get the paragraph context vector representation v t ;

[0107] The context vector is taken as the salient information generated from the source document summary and is combined with the decoder hidden state s t Concatenate to get the vocabulary distribution:

[0108] P vocab =Softmax(W o [s t ;v t ]) (17) Formula (17) is obtained by hidden state s t and the paragraph context vector representation v t Concatenate, and then normalize with the trainable matrix parameter W0 to get the final decoding result;

[0109] Step 2.5, generate summary: Finally, select Adam optimizer, iteratively update the weights of neural network based on training data, and use the trained neural network to generate summary. Adam optimizer, which converges faster and more stably, can iteratively update the weights of neural network based on training data. The learning rate (step size) is set to 5e-4, which determines the length of each step in the negative direction of the gradient during the gradient descent iteration. If the step size is too small, the convergence is slow, and if the step size is too large, it will be far away from the optimal solution. So test from small to large, and select an optimal solution of 5e-4.

[0110] In order to illustrate the effect of the present invention, three groups of comparative experiments are set up. The first group of experiments verifies the improvement of generative summarization performance, the second group is an ablation experiment, and the third group of experiments verifies different case element extraction methods.

[0111] (1) Verification of the performance improvement of generative summarization. This experiment was conducted on a case public opinion multi-document summary dataset. The ROUGE value was used to automatically evaluate the summary quality, and ROUGE-1 (RG-1), ROUGE-2 (RG-2), and ROUGE-L (RG-L) were used as evaluation indicators. In the hyperparameters, the number of Transformer encoding layers was set to 6, the hidden size was set to 256, the number of heads was set to 8, and the hidden size of the feedforward layer was 1024. We truncated the length of the input paragraph and case elements to 100 and 10 tokens, respectively. In the multi-head pooling layer, the number of heads is 8. In the graph encoding process, each layer has 8 heads and the hidden size is 256. Other training parameters are shown in Table 2:

[0112] Table 2 Model training parameter settings

[0113]

[0114] To verify the effectiveness of the proposed method, we compare it with Transformer and graph-based summary models:

[0115] (1) Flat transformer (FT) is a 6-layer encoder-decoder model. The case public opinion data title and document are concatenated into a long text, and the first 800 tokens are intercepted as model input.

[0116] (2) T-DMCA (Transformer Decoder with Memory Compressed Attention model) is based on the cross-attention mechanism of Transformer encoding. It uses a Transformer decoder and applies a convolutional layer to compress the key and value values ​​in the self-attention mechanism.

[0117] (3) HT (Hierarchical Transformer) This model can effectively process multiple input documents and extract the Transformer architecture with the ability to encode documents in a hierarchical manner. First, an attention mechanism is used to represent cross-document relations.

[0118] (4) GraphSum This model uses graphs to represent a multi-document generative summary model, constructs a topic relationship graph and a chapter structure graph, and uses graphs to encode documents in order to capture the relationship between documents.

[0119] The first set of experiments is a comparative experiment between the proposed model and four baseline models on the case public opinion single-document and multi-document summary datasets. The results are shown in Table 3.

[0120] Table 3 Baseline model comparison experiments

[0121]

[0122] It can be seen from the experimental results in the above table that: (1) Compared with the FT model, the values ​​of RG-1 and RG-2 of the model of the present invention are increased by 2.53 and 2.66 respectively. This is because in the multi-document summary of the FT model, the first 800 words are intercepted. The words intercepted by this method may cause the key information of the case public opinion to be removed and cannot fully summarize the theme of the article; (2) Compared with the T-DMCA model, the values ​​of RG-1 and RG-2 of the model of the present invention are increased by 1.59 and 1.56 respectively. This is because in the T-DMCA model, the information generated by the multi-layer decoder in the Transformer is redundant, and the multi-layer decoder will cause the problem of low efficiency during reasoning. Parallel matrix operations can improve The decoding speed of the decoder; (3) Compared with HT, the model of the present invention has improved by 0.87 and 1.02 on RG-1 and RG-2 respectively. This is because in the HT model, sentence-level and word-level transformers are introduced to encode the case public opinion text at the same time, which increases the number of parameters and the complexity of the model; (4) Compared with the GraphSum model, the model of the present invention has improved by 0.29 and 0.82 on RG-1 and RG-2 respectively, indicating that the use of graph structure to represent the correlation between sentences across documents is more effective. However, the method of incorporating case elements as auxiliary information into the model of the present invention is more effective and can effectively reduce redundant information. It plays an important guiding role in generating sentences that are closer to the topic of the document.

[0123] (2) Ablation experiment

[0124] In order to verify the effectiveness of individual components such as the graph encoder module and the two-stage attention module, we conducted ablation study experiments and the results are shown in Table 4:

[0125] Table 4 Ablation experiment

[0126]

[0127] w / o graph enconder means the experiment without graph encoding module, and the case element representation and paragraph representation are fixed after the multi-head pooling layer; w / o two-level attention means the experiment without two-level attention, we directly apply token-level attention, but pay extra attention to the case element representation, which is a simple way to combine case element information. The results in Table 4 show the effectiveness of our newly introduced module. Combining case element information to build a heterogeneous graph network enables better information flow between text nodes, and the two-level attention mechanism plays an important role in the multi-document summarization task.

[0128] (3) Comparative experimental analysis of different case factor extraction methods

[0129] The third group of experiments mainly verifies the influence of different methods for obtaining case elements on summary generation. Keywords are extracted from case texts as case elements using TFIDF, TextRank and named entity recognition algorithms, and then integrated into the model of the present invention to generate summaries. The results are shown in Table 5.

[0130] Table 5 Comparative experiment of different case element extraction methods (%)

[0131]

[0132] It can be seen from the above table that: (1) Compared with the NER model, the RG-1 and RG-2 values ​​of the model of the present invention are improved by 1.57 and 1.51, because the NER method obtains a large amount of redundant information, which is not conducive to the learning of graph attention, resulting in a decrease in the performance of summary summarization; (2) Compared with the TFIDF model, the RG-1 and RG-2 values ​​of the model of the present invention are improved by 1.44 and 1.29, respectively, because TFIDF is a method based on word frequency statistics. Keywords in the text can fully express the theme information of the article, thereby improving the summary performance, but words with higher word frequency in the case public opinion text are not necessarily related to the text theme; (3) Compared with the TextRank method, the model of the present invention is improved by 0.66 and 0.45 on RG-1 and RG-2, respectively. The difference in the method of extracting keywords by TextRank is very small. When there are multiple documents but no case elements, keywords can be extracted to serve as case elements and integrated into the model of the present invention to assist in the generation of summaries.

[0133] In this paper, a multi-document generative summary model based on case element graph attention is proposed. In addition to text unit nodes, case element nodes are also introduced to construct a heterogeneous graph to assist the model in capturing the complex relationship between text units. A decoder with a two-level attention mechanism is also introduced, which first focuses on case element nodes and then uses attention weights to direct attention to text units, which can effectively handle saliency and redundancy issues.

[0134] In the next step of research, we will continue to explore other methods, such as reinforcement learning-based methods, to further improve the summary quality in the multi-document summary environment. We can also apply the model of this invention to other tasks, such as multi-document question answering.

[0135] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A case public opinion multi-document generative summarization method based on factor graph attention, characterized by: The specific steps of the method are as follows: Step 1. Use crawler technology to crawl case public opinion text datasets, and manually clean and annotate the datasets to obtain case public opinion summary multi-document datasets; construct a case library containing case names, search according to case names, and display search results in the form of web pages. The first content of the web page is used as the summary, and the second content of the web page describing the case is defined as the case element, which is filtered and preprocessed to form a json format file; Step 2: Encode the features of the case public opinion text and case elements through word embedding and position embedding respectively, extract sentence features using CNN and BiLSTM encoders, construct heterogeneous graphs with the obtained sentence features and case element features to extract document features, and then use the method of integrating case elements based on the graph attention mechanism to effectively filter and select sentences for document features, and use graph attention to simultaneously learn and update the parameters of the main task model and the auxiliary model; The Step 2 includes: Step 2.1, construct the element relationship diagram: The input source document is multiple documents D = {d1, d2, ..., d n }, first D is divided into smaller semantic units, paragraphs p = {p1, p2, ..., p n }; Then construct an element relationship graph G = (V, E); V includes paragraph node V p and case element node V c , E represents the undirected edge between nodes. There is no edge inside a paragraph node or a case element node. There is only an edge between a paragraph node and a case element node. i and c j The edge between them refers to the case element node c j Contained in paragraph node p i In which p i represents the i-th paragraph node, c j represents the jth case element node; In order to obtain more semantic information, the relationship matrix is ​​obtained by fusing case element nodes and paragraph nodes. The element e in E ij ≠0 indicates element node c j In the paragraph node p i In E, the TFIDF values ​​between feature nodes and paragraph nodes are calculated to form the edge weight matrix to model the importance of the relationship between case elements and paragraphs; The Step 2 includes: Step 2.2: Segment multiple documents, and then stack several token-level transformer encoding layers together to encode the contextual information in each paragraph. Represents the input token vector. For the lth transformer layer, the input feature is The hidden state is The output is LayerNorm is a normalization operation, MHAttn is the multi-head attention of transformer, FFN represents a feedforward neural network, and its activation function is ReLU. The output of the last layer is used as a token-level feature. To represent the token-level feature matrix, where n w is the total number of tokens in all paragraphs, d w is the dimensionality of the token embedding; In order to obtain a fixed-length paragraph representation, a weighted merging operation is applied, and the multi-head attention mechanism calculates the weight distribution on the token, allowing the model to flexibly encode the paragraph when representing it in different subspaces through different heads; h p =MHPool(h w1 ,h w2 ,...)(3) use to represent the feature matrix of a paragraph, n represents the number of paragraphs, d h represents the size of the hidden layer dimension; the case element encoder representation is the same as the paragraph encoder representation process, but the two encoders do not share parameters, and model the relationship between paragraphs and case elements in a unified semantic space; pronouns and stop words in case elements are deleted, respectively. and To represent the token-level feature matrix and the case-level feature matrix; mw It indicates the total number of token-level features obtained after word segmentation of case elements, and m indicates the number of case elements; The Step 2 includes: Step 2.3, use the graph attention network GAT to update the representation of semantic nodes; i, j ∈ {1, 2, ..., (m + n)} represents any node in the graph, and use Represents the node representation, with N i Represents the set of adjacent nodes of node i, and the GAT layer is designed as follows: With ij =LeakyReLU(W a [IN q h i ;IN k h j ])(4) Where W a ,W q ,W k ,W v represents the trainable weight, σ is the sigmoid activation function, The idea is to represent edge weights by discretizing real values ​​into integers, and then learn embeddings of integers to map weights to a multidimensional embedding space. In this way, the information contained in the value needs to be learned through an additional embedding matrix. The TFIDF value indicates the proximity between the case element node and the paragraph node. Therefore, by updating the attention weight using formula (5), the original TFIDF information is directly incorporated into the GAT mechanism; Combining the graph attention mechanism GAT with multi-head operations to obtain h i , a residual connection is added to avoid gradient vanishing after a few iterations: Use the above GAT layer and position feed-forward layer to iteratively update the node representation; each iteration contains an update process from paragraph to case element and from case element to paragraph. After t iterations, Represents each input feature matrix; represents the paragraph feature matrix updated by case elements; where n c Indicates the number of element nodes, d c Represents the input dimension of the feature node, d h Represents the contextual dimension; The Step 2 includes: Step 2.4: In each decoding step, the decoder state is s, and the case element node c is calculated. i Attention score: In formula (10) represents the transposed matrix obtained after training, W q ,W k is a trainable parameter, z i is the attention coefficient in state s; In formula (11) are the edge weights derived from the TFIDF value matrix, represents the paragraph node coefficient, and formula (11) passes through the information flow between the element node and the paragraph node; Formula (12) is normalized, weighted and summed, and then passed through an activation function to obtain the attention weight of the element node; the attention score β is selected j The highest first k paragraph nodes, and then T in the selected paragraph nodes w Tokens use attention mechanism; In formula (13) represents the transposed matrix obtained after training, W q ,W k is a trainable parameter, z wi is the attention coefficient of the paragraph node token level in state s, Represents the token-level context vector obtained after the paragraph is segmented; Formula (14) is normalized, weighted and summed, and then passed through an activation function to obtain the token-level attention weight in the paragraph node; the attention score β is selected j The highest k paragraph nodes, and then T in the selected paragraph w Apply attention mechanism to tokens; Formula (15) is obtained by factor node attention β j Aggregated with the token-level paragraph features, we get the token-level paragraph features of the two-level attention mechanism. In formula (16) Represents the token-level context vector, which is the token-level paragraph feature after the two-level attention mechanism After weighted summation, we finally get the paragraph context vector representation v t ; The context vector is taken as the salient information generated from the source document summary and is combined with the decoder hidden state s t Concatenate to get the vocabulary distribution: P vocab =Softmax(W o [s t ;v t ])(17) Formula (17) is obtained by hidden state s t and the paragraph context vector representation v t Concatenate, and then normalize with the trainable matrix parameter W0 to get the final decoding result; Step 2.5, generate summary: Finally, select the Adam optimizer, iteratively update the neural network weights based on the training data, and use the trained neural network to generate summary.

2. The method for generating summarization of case public opinion multi-documents based on factor graph attention according to claim 1 is characterized by: The specific steps of Step 1 are: Step 1.

1. Use crawler technology to crawl case public opinion news texts, crawling a total of 4569 documents, each of which contains a summary, case elements and the text describing the case; Step 1.2: Filter and screen the text and case elements in the case public opinion summary multi-document dataset. The filtering and screening methods are as follows: (1) remove redundant symbols, hyperlinks, and special characters in the text content; (2) remove the same case element information in the text; Step 1.3, use manual annotation to obtain the case public opinion dataset; first, label each sentence in the text, 1 is a candidate summary, and 0 is not a candidate summary.