Document abstract method based on domain knowledge and multi-granularity graph network

By introducing multi-grained graph structure and domain knowledge embedding into the document summary method, the problem of difficulty in capturing the overall and local semantic interaction of the document is solved in the prior art, and high-quality and accurate document summary is achieved.

CN119623617AInactive Publication Date: 2025-03-14SSE INFORMATION NETWORK LTD

Patent Information

Application Number
CN202510167659.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing automatic document summary methods are difficult to effectively capture the multi-type interaction between the overall semantics and local semantics in documents, and it is difficult to remove redundant information and eliminate text semantic ambiguity, affecting the quality and accuracy of the summary.

Method used

Using a document summary method based on domain knowledge and multi-grained graph network, a knowledge coding module, a knowledge fusion module, a word-level semantic graph and a sentence-level semantic graph are constructed, combined with the capsule network and graph attention mechanism, the multi-type interaction between the overall and local semantics in the document and the embedding of external knowledge is achieved.

Benefits of technology

Effectively capture the multi-type interaction between the overall semantics and local semantics in the document, remove redundant information, eliminate text semantic ambiguity, and improve the quality and accuracy of document summary.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623617A_ABST
    Figure CN119623617A_ABST
Patent Text Reader

Abstract

The invention particularly relates to a document abstracting method based on domain knowledge and a multi-granularity graph network, which comprises the following steps: S1, constructing a knowledge coding module, carrying out domain knowledge graph transfer learning, extracting triple structure features in combination with a capsule network, and generating a text entity coding module; s2, constructing a knowledge fusion module, converting a document text into a semantic vector, and adaptively fusing the semantic vector with external knowledge; s3, constructing a word-level semantic graph, and aggregating neighborhood information through a semantic graph attention mechanism to obtain word embedding representation containing context; s4, constructing a sentence-level semantic graph, performing self-attention calculation on the word-level semantic vector in the S3 to obtain semantic node representation of the sentence-level semantic vector, and performing feature aggregation on sentence-level nodes to obtain global semantic information of the document; and S5, constructing an output layer, and predicting according to the document feature vector in the S4 to obtain a final extraction type abstract result. The method has the advantages that redundant information in the document is removed, and ambiguity of text semantics is eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing text mining and analysis, and in particular to a document summarization method based on domain knowledge and multi-granularity graph networks. Background Art

[0002] At present, the research on automatic document summarization is mainly divided into two categories: extractive and generative. Extractive summarization scores each sentence in the document, retains sentences with scores above the threshold and concatenates them in order, outputs a subset of sentences with key semantic information, and generates a short summary by removing redundant information. Generative summarization generates summary content by deeply analyzing the semantics of the document using a language model. Although the generative method is more flexible in expression, the extractive method performs better in accuracy and can maintain terminology consistency.

[0003] Early extractive methods mostly used autoregressive time series models, such as RNN and its variants (GRU, LSTM), to predict the importance of the previous sentence to infer the current sentence, but there are problems such as failure to capture long-distance dependencies and gradient vanishing or explosion. For this reason, a model based on the attention mechanism was proposed, which determines redundant information by calculating the correlation between sentences and is not restricted by the distance between sentences. However, the attention mechanism can only calculate the correlation pair by pair, which is difficult to parallelize, and only focuses on local semantic interactions, lacking the grasp of overall key information.

[0004] To solve these problems, we introduce a multi-granularity graph structure to model the overall and local semantic interactions of documents, and combine it with domain knowledge embedding to propose an extractive document summarization method based on domain knowledge and multi-granularity graph networks. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a document summarization method based on domain knowledge and multi-granularity graph networks to capture multi-type interactions between overall semantics and local semantics in a document, eliminate redundant information in the document, eliminate text semantic ambiguity, and improve the quality and accuracy of document summarization.

[0006] In order to achieve the above purpose, a document summarization method based on domain knowledge and multi-granularity graph network is designed. The specific steps include: step S1: constructing a knowledge encoding module, performing domain knowledge graph transfer learning based on the pre-trained language model BERT, combining the capsule network to extract the triple structure features including the head entity, the relationship vector, and the tail entity, taking the knowledge graph link prediction as the auxiliary task, adjusting the parameters of the language model through gradient back conduction, and generating a text entity encoding module that integrates domain knowledge; step S2: constructing a knowledge fusion module, converting the document text into a semantic vector, performing named entity recognition at the same time, and then using the knowledge encoding module to encode the entity information into an external knowledge vector, and finally transferring the semantic information to the external knowledge vector through the gating mechanism. Adaptive fusion of quantity and external knowledge; Step S3: Construct a word-level semantic graph, in which the nodes are knowledge-enhanced semantic vectors of dynamic slices. There are two types of edges in the word-level semantic graph: one represents the temporal relationship between words, and the other connects entities of the same type. The neighborhood information is aggregated through the semantic graph attention mechanism to obtain a word embedding representation with context; Step S4: Construct a sentence-level semantic graph, perform self-attention calculation on the word-level semantic vector obtained in S3, obtain a sentence-level semantic vector as a node representation in the sentence-level semantic graph, and then perform feature aggregation on the sentence-level nodes through the semantic graph attention mechanism to obtain the global semantic information of the document; Step S5: Construct an output layer, and according to the document feature vector aggregated by the multi-granularity graph in S4 The final extractive summary result is predicted.

[0007] Preferably, the present invention further comprises: the step S1 further comprises: the word vector input of the knowledge encoding module is constructed based on the triple structure of the knowledge graph, and its expression is: ; Where T represents the word vector, CLS and SEP are markers, CLS represents the marker at the beginning of the vector for downstream classification tasks, and SEP represents the marker used to split the parts of the triplet; h 、Tok r and Tok t Respectively represent the word vector encoding of the head entity, relationship vector and tail entity in the triple, m, n, k represent the number of words in the head entity, relationship vector and tail entity respectively; the knowledge vector is encoded by the language model BERT, and then the average pooling calculation is used to form a knowledge embedding representation of unified dimension, where the language model BERT consists of multiple Transformer layers to obtain the bidirectional semantic information in the knowledge triple. This process is expressed as: ; ; in represents the i-th input sample of the 0th layer Transformer encoder of BERT, T represents the word vector, S represents the segmentation vector and P represents the position vector, Represents the output of the l-th layer Transformer encoder; to obtain a unified triplet knowledge embedding representation, the output vector is dynamically sliced ​​and average pooled according to the SEP tag to obtain the final knowledge representation embedding , this process is expressed as: ; ; ; ; in Representing knowledge representation embedding, , and They represent the output of the head entity, the relation vector and the tail entity after the Transformer encoder respectively, and AvgPooling represents the average pooling operation; the capsule network includes: using convolution kernels of different sizes to embed knowledge representation Extract multi-scale local features and aggregate the local features through a dynamic routing algorithm to obtain the final link prediction result; the dynamic routing algorithm of the capsule network is as follows, “←” indicates assignment: Step S1.1: Initialize all capsules i in the first layer: θ i Represents the semantic vector of the i-th capsule; Step S1.2: Iterate d times; Step S1.3: For all capsules i in the first layer: ;q i represents the normalized weight of the i-th capsule; Step S1.4: For a single capsule in the second layer: ; s represents the input vector of the second layer capsule, f i Representing Knowledge Representation Embedding Output after convolution; Step S1.5: For a single capsule in the second layer: ; e represents the routing coefficient between capsules; Step S1.6: For all capsules i in the first layer: θ i Represents the semantic vector of the i-th capsule; Step S1.7: Return e; the capsule network contains two capsule layers, the first layer has τ capsules, the second layer has 1 capsule, W i ,θi is a learnable weight parameter, f represents the output of convolution in convolution kernels of various sizes, and the calculation formula is expressed as: ; Among them, W v Represents the value of the vth column in the convolution kernel matrix, represents the value of the i-th row and j-v+1-th column in the triple matrix output by the BERT encoding layer, z represents the column width of the convolution kernel matrix, b represents the bias size, σ represents the RELU activation function, and BatchNorm represents batch normalization; the training objective function of the knowledge graph link prediction of the auxiliary task is: ; ||e|| is used as the final score for link prediction, ||.|| represents the modulus length, T represents the positive sample of the knowledge graph triple, represents the negative sample of the knowledge graph triple, where γ is the factor used to distinguish positive samples from negative samples. When γ is 1, When , γ takes -1.

[0008] Preferably, the present invention further comprises: the step S2 further comprises: the gating mechanism comprises three gating units: an input gate, a transfer gate and a carrying gate, the input gate calculation is used to select the external knowledge to be updated to obtain the initial fused semantic knowledge encoding, the transfer gate calculation selects how much original semantics to transfer into the subsequent module, and the carrying gate calculation selects how much information to carry from the knowledge fusion encoding into the subsequent module, and the specific process is expressed as follows: ; ; ; ; Among them, BERT and O Knowledge They represent semantic vector and knowledge vector respectively, w is weight information, b is bias, σ is RELU nonlinear activation function, O BK is the initial fused semantic knowledge encoding calculated by the input gate, T t and T c represent the transfer gate and the carrying gate respectively, V represents the knowledge-enhanced semantic vector, and W e1 Represents the weight matrix of the semantic vector, W e2 Represents the weight matrix of the knowledge vector, W h Represents the weight matrix for computing candidate hidden states.

[0009] Preferably, the present invention further comprises: the step S3 further comprises: the aggregation method of the word-level semantic graph is specifically as follows: the topological structure information of the word-level semantic graph is represented by an adjacency matrix A word Indicates that node information is represented by V word It means that the process of semantic graph attention network aggregation of word-level semantic graph is as follows: ; ; ; ; Where X is the word-level semantic vector representation of the whole semantic graph after aggregation, x i is the semantic vector of the ith node, W represents the linear transformation weight parameter, α is the normalized semantic graph attention weight factor, N i represents the first-order neighbor node set of node i, GAT represents the graph attention network, which is used to aggregate the semantic information of nodes, where represents the rule constraints on the aggregation operation GAT, that is, the elements in the X formula are composed of the following x i Formula, α ij Formula, e ij Calculate the formula to get, x j represents the semantic vector of the jth node, α ij represents the attention weight, which represents the information contribution from neighbor node j to the current node i, e ij Represents the attention score, which is used to measure the node x i and xj, W2 represents the semantic vector x corresponding to node i i The linear transformation weight parameter, W 1 Represents the semantic vector x corresponding to node j j The linear transformation weight parameter, Concate means concatenating two vectors, and softmax means the normalization function is used to convert the attention score e ij Converted to normalized attention weight α ij .

[0010] Preferably, the present invention further comprises: the step S4 further comprises: the sentence-level semantic vector initialization process is specifically as follows: ; where clip[X,A W-S ] refers to the correspondence between words and sentences A W-S Dynamically slice the semantic vector X and perform self-attention calculation on a sentence-by-sentence basis to obtain the initialized sentence vector S 0 , where Q S , K S 、V SThey correspond to the query vector, key vector, and value vector in the self-attention mechanism, respectively. len(X) represents the number of words in the sentence. It is used to control the scaling factor of the attention score value. Self-attention refers to the self-attention mechanism, which is used by the model to assign different weights according to the importance of different parts of the input when processing information. Softmax represents the normalization function, which is used to convert the attention score into a probability distribution. si Represents the query vector; the specific method of aggregating the sentence-level semantic graph is as follows: the node information in the sentence-level semantic graph is represented by the sentence vector S={s 1 ,s 2 ,…,s m}, the topological structure information is represented by its adjacency matrix A sentence It means that the semantic graph attention calculation process of the sentence-level semantic graph is as follows: ; ; ; ; ; in represents the document semantic vector after layer l aggregation, It is used to predict the probability of containing key information in a sentence. FFN represents the feedforward neural network layer, and σ represents the RELU activation function. represents the influencing factor for controlling the elimination of document redundancy, W represents the weight parameter, represents the semantic vector of the i-th sentence in the document in the l-th layer, represents the semantic vector of the i-th sentence in the document after the l-th layer is aggregated by the graph neural network, represents a learnable linear transformation sentence, N i represents the set of first-order neighbor nodes of node i, GAT represents the graph attention network, which is used to aggregate the semantic information of nodes. Represents the document semantic vector of the l+1th layer.

[0011] Preferably, the present invention further comprises: the step S5 further comprises: predicting the final extractive summary result through an objective function, wherein the predicted objective function is: ; where y i represents the prediction result of the i-th sentence, and m represents the number of sentences in the document, that is, the probability of the current sentence depends on the prediction result of the previous sentence. represents the semantic vector of the document, Y represents the prediction result of the entire sequence, P represents the probability function, Represents the semantic vector of a given document and 1 to y i-1 Under the condition of prediction results, the current prediction result y i The conditional probability of .

[0012] Compared with the prior art, the present invention has the following advantages: Different from the previous automatic summarization models based on autoregressive recurrent network structure and attention mechanism, this paper adopts multi-granularity graph structure to model the input document, covering word-level graph and sentence-level graph. This enables the model to efficiently capture the multi-type interaction between overall semantics and local semantics in the document, improve the summary quality, especially the introduction of dynamic slicing strategy in word-level semantic graph, realize context-adaptive adjustment, and effectively remove redundant information in the document.

[0013] The present invention incorporates external knowledge embedding in specific fields, can deeply analyze the specific context and terminology semantics in documents, use BERT transfer learning and capsule networks to extract knowledge graph triple structure information, and optimize text representation through knowledge graph link prediction, thereby improving the professionalism and accuracy of the summary, eliminating the ambiguity of text semantics (such as polysemy), and thus improving the quality and accuracy of document summaries.

[0014] The present invention designs a gating mechanism for knowledge fusion, which realizes the dynamic fusion of semantics and external knowledge through input gate, transfer gate and carrying gate to avoid information redundancy or conflict. At the same time, it introduces global guidance information combined with local attention to calculate the importance of sentences and enhance the global coherence of the summary. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 , is a flow chart of the present invention; Figure 2 , is a schematic diagram of capsule network dynamic routing algorithm; Figure 3 , is a schematic diagram of the knowledge semantic vector fusion gating algorithm; Figure 4 , is a schematic diagram of the self-attention mechanism algorithm; Figure 5 , is a schematic diagram of a multi-granularity graph network; Figure 6 , is a schematic diagram of inputting text in Embodiment 2; Figure 7 , is a schematic diagram of the output results of the model in Example 2; Figure 8 , is a schematic diagram of inputting text in Embodiment 3; Fig. 9 , is a schematic diagram of the output results of the model in Example 3; Fig.10, is a schematic diagram of inputting text in Embodiment 4; Fig.11 , is a schematic diagram of the output results of the model of Example 4. DETAILED DESCRIPTION

[0016] In order to make the purpose, principle and structure of the present invention more clear, it is further described below in conjunction with the drawings and specific embodiments.

[0017] The present invention provides a document summarization method based on domain knowledge and multi-granularity graph network, which belongs to the field of natural language processing text mining and analysis. The present invention relates to a method that introduces a multi-granularity graph structure to model input documents, specifically including word-level graphs and sentence-level graphs, which can effectively capture the multi-type interactions between the overall semantics and local semantics in the document and effectively eliminate redundant information in the document. In addition, the method combines the embedding of external knowledge in a specific field, can deeply understand the specific context and terminology semantics in the document, eliminate text semantic ambiguity, such as polysemy, thereby improving the quality and accuracy of document summaries.

[0018] In order to achieve the above object, an extractive document summarization method based on domain knowledge and multi-granularity graph network of the present invention is implemented by the following technical solutions: S1: Construct a knowledge encoding module, transfer the pre-trained language model BERT to the knowledge graph in a specific field, and combine it with the capsule network to learn the structured features of triples in the knowledge graph. Use the knowledge graph link prediction as an auxiliary task to fine-tune the parameters of the language model through gradient backpropagation to obtain a text entity encoding module that integrates domain knowledge.

[0019] 1.1 The word vector input part of the knowledge encoding module in the present invention is constructed based on the triple structure (head entity, relationship, tail entity) in the knowledge graph, which can be expressed as: ; Among them, CLS and SEP are special symbols. CLS is at the beginning of the vector for downstream classification tasks, and SEP is used to split the parts of the triplet. hm , Tok rn and Tok tk They correspond to the word vector encodings of the head entity, relation, and tail entity in the triple, respectively. m, n, and k represent the number of words in the head entity, relation, and tail entity, respectively.

[0020] 1.2 In the present invention, the knowledge vector is encoded by the BERT model, and then the average pooling calculation is used to form a knowledge embedding representation of uniform dimension. Among them, BERT is composed of multiple Transformer layers to obtain the bidirectional semantic information in the knowledge triple. This process can be expressed as: ; ; in represents the i-th input sample of the 0th layer Transformer encoder of BERT, represented by the word vector T, the segmentation vector S and the sum of the position vector P. Represents the output of the first-layer Transformer encoder. To obtain a unified triplet knowledge embedding representation, the output vector is dynamically sliced ​​and average pooled according to the SEP tag to obtain the final knowledge representation embedding , the specific process is expressed as: ; ; ; ; Where AvgPooling represents the average pooling operation.

[0021] 1.3 The capsule network used in the present invention to extract multi-scale deep structural features of triple vectors consists of two parts: (1) Using convolution kernels of different sizes to embed knowledge representation Extract multi-scale local features; (2) Aggregate the local features through a dynamic routing algorithm to obtain the final link prediction result.

[0022] See attached Figure 2 , is the existing technology of capsule network dynamic routing algorithm, where V 1 1 and V 1 2 represents the first and second semantic vectors of the first layer capsule, W 1 represents the weight matrix, and q1-6 represents the normalized weight of the i-th capsule. The present invention further improves the capsule network dynamic routing algorithm of the prior art. The specific process of the capsule network dynamic routing algorithm is as follows, and “←” represents assignment: 1: Initialize all capsules i in the first layer: θ i Represents the semantic vector of the i-th capsule.

[0023] 2: Iterate d times.

[0024] 3: For all capsules i in the first layer: ;q i represents the normalized weight of the i-th capsule.

[0025] 4: For a single capsule in the second layer: ; s represents the input vector of the second layer capsule, f iRepresenting Knowledge Representation Embedding Output after convolution.

[0026] 5: For a single capsule in the second layer: ; e represents the routing coefficient between capsules.

[0027] 6: For all capsules i in the first layer: θ i Represents the semantic vector of the i-th capsule.

[0028] 7: Return e.

[0029] The network consists of two capsule layers. The first layer has τ capsules and the second layer has 1 capsule. i ,θ i is a learnable weight parameter. f represents the output of convolution in convolution kernels of different sizes. The calculation process is: ; Among them, w v Represents the value of the vth column in the convolution kernel matrix, represents the value of the i-th row and j-v+1th column in the BERT encoding layer output triple matrix, z represents the column width of the convolution kernel matrix, b represents the bias size, and σ represents the RELU activation function. ||e|| is used for the final score of link prediction, and ||.|| represents the modulus length.

[0030] 1.4 The training objective function of auxiliary task link prediction is: ; Among them, T represents the positive sample of the knowledge graph triple, and T` represents the negative sample of the knowledge graph triple.

[0031] S2: Construct a knowledge fusion module, use a word embedding model to represent the text information in the document as a semantic vector, perform named entity recognition on the document content, use the knowledge encoding module in S1 to encode the entity information to obtain an external knowledge vector, and adaptively fuse the semantic vector with the external knowledge through a gating mechanism.

[0032] 2.1 The adaptive fusion mechanism in the present invention is mainly completed through three gate control units, namely input gate, transfer gate and carrying gate. The input gate calculation is used to select the external knowledge that needs to be updated to obtain the initial fused semantic knowledge encoding, the transfer gate calculation selects how much original semantics to transfer into the subsequent module, and the carrying gate calculation selects how much information to carry from the knowledge fusion encoding into the subsequent module. The specific process can be expressed as: ; ; ; ; Among them BERT and Knowledge Represent the semantic vector and knowledge vector respectively, w is the weight information, b is the bias, and σ is the RELU nonlinear activation function. BK is the initial fused semantic knowledge encoding calculated by the input gate, T t and T c represent the transfer gate and the carrying gate respectively, V represents the knowledge-enhanced semantic vector, and W e1 Represents the weight matrix of the semantic vector, W e2 Represents the weight matrix of the knowledge vector, W h Represents the weight matrix for calculating candidate hidden states. Figure 3 , is a schematic diagram of the knowledge semantic vector fusion gating algorithm when the gating mechanism is used to construct the knowledge fusion module, W h represents the weight matrix for calculating the candidate hidden state, which is used to calculate the value of the transfer gate Tt. Te1 and Te2 represent two transformation operations in the information fusion module, which are used to transform the semantic vector o. BERT and knowledge vector o Knowledge Transform to generate the initial fusion semantic knowledge encoding O BK .

[0033] S3: Construct a word-level semantic graph, where the nodes are semantic vectors enhanced by knowledge of dynamic slicing. There are two types of edges in the word-level semantic graph: one is used to represent the temporal relationship between words, and the other is used to connect entities of the same type. The neighborhood information of each node is aggregated using the graph attention mechanism to obtain a word embedding representation containing contextual information.

[0034] 3.1 The details of the aggregation method of the word-level semantic graph in the present invention are as follows: We use the topological structure information of the word-level semantic graph with its adjacency matrix A word Indicates that node information is represented by V word It means that the process of attention network aggregation of word-level semantic graph is as follows: ; ; ; ; Where X is the word-level semantic vector representation of the whole semantic graph after aggregation, x i is the semantic vector of the ith node, W represents the linear transformation weight parameter, α is the normalized semantic graph attention weight factor, N irepresents the first-order neighbor node set of node i, where represents the index relationship, that is, each element in the X formula is composed of the following x i Formula, α ij Formula, e ij Calculate the formula to get, x j represents the semantic vector of the jth node, α ij represents the attention weight, which represents the information contribution from neighbor node j to the current node i, e ij Represents the attention score, which is used to measure the node x i and x j The degree of correlation between them.

[0035] S4: Construct a sentence-level semantic graph, perform self-attention calculation on the word-level semantic vector obtained in S3, use the calculated sentence-level semantic vector as the node representation in the sentence-level graph, and then perform feature aggregation on the sentence-level nodes through the graph attention mechanism to obtain the global semantic information of the document.

[0036] 4.1 The sentence-level semantic vector initialization process in the present invention is as follows: ; where clip[X,A W-S ] refers to the correspondence between words and sentences A W-S Dynamically slice the semantic vector X and perform self-attention calculation on a sentence-by-sentence basis to obtain the initialized sentence vector S 0 . Where Q S , K S 、V S They correspond to the query vector, key vector and value vector in the self-attention mechanism respectively. len(X) represents the number of words in the sentence. k ) is used to control the scaling factor of the attention score value.

[0037] See also Figure 4 , which illustrates the self-attention mechanism algorithm, Q S With K S Between and Q S , K S 、V S Matrix multiplication is used between them. Wq, Wk, and Wv all represent weight matrices, which are used to map the sentence-level semantic vector X into query vectors, key vectors, and value vectors, respectively.

[0038] 4.2 The aggregation method of the sentence-level semantic graph in the present invention is as follows: The node information in the graph is represented by the sentence vector S={s 1 ,s 2 ,…,s m}, the topological structure information is represented by its adjacency matrix A sentence Indicates that the graph attention calculation process is specifically as follows: ; ; ; ; ; in represents the document semantic vector after layer l aggregation, It is used to predict the probability of containing key information in a sentence. FFN represents the feedforward neural network layer, and σ represents the RELU activation function. It represents the influencing factor for controlling the elimination of document redundancy, and W represents the weight parameter.

[0039] See attached Figure 5 , step S4 aggregates word-level semantics into sentence-level semantics. The named entity nodes are obtained by named entity recognition in step S2, the word nodes are the nodes in the word-level semantic graph constructed in S3, and the sentence nodes are the nodes in the sentence-level semantic graph constructed in S4.

[0040] S5: Construct the output layer based on the document feature vector aggregated by multi-granularity graph in S4 The final extractive summary result is predicted.

[0041] 5.1 The objective function in the present invention is: ; where y i represents the prediction result of the i-th sentence, that is, the probability of the current sentence depends on the prediction result of the previous sentence, m represents the number of sentences in the document, Represents the aggregated document semantic vector.

[0042] Embodiment 1: See also Figures 1 to 4 ,This embodiment provides a specific implementation method of a document summarization method based on domain knowledge and multi-granularity graph networks.

[0043] S1: Construct a knowledge encoding module. In this example, the pre-trained language model BERT is used and transfer learning is performed on the knowledge graph of a specific domain. The word embedding vector extracted by BERT is input into the capsule network to learn the structural features of triples in the knowledge graph. The language model parameters are fine-tuned through gradient backpropagation using knowledge graph link prediction as an auxiliary task to obtain a text entity encoding module that integrates domain knowledge. The input raw document dataset to be processed is summarized through the text entity encoding module that integrates domain knowledge.

[0044] S2: Construct a knowledge fusion module, use the BERT model to represent the text information in the document as a semantic vector, perform named entity recognition on the document content, use the knowledge encoding module in S1 to encode the entity information to obtain an external knowledge vector, and adaptively fuse the semantic vector with the external knowledge through a gating mechanism.

[0045] S3: Construct a word-level semantic graph, where the nodes are semantic vectors enhanced by knowledge of dynamic slicing. There are two types of edges: one for representing the temporal relationship between words and the other for connecting entities of the same type. The graph attention mechanism is used to aggregate the neighborhood information of each node to obtain a word embedding representation containing contextual information.

[0046] S4: Construct a sentence-level semantic graph, perform self-attention calculation on the word-level semantic vector obtained in S3, use the calculated sentence-level semantic vector as the node representation in the sentence-level graph, and then perform feature aggregation on the sentence-level nodes through the graph attention mechanism to obtain the global semantic information of the document.

[0047] S5: Construct the output layer and predict the final extractive summary result based on the document feature vector S ̃ aggregated by multi-granularity graph in S4. The experimental results and output examples on three public datasets are as follows: Dataset ROUGE-1 ROUGE-2 ROUGE-L TTNews (headline news dataset) 40.8 26.2 35.7 CNewSum (Chinese news summary dataset) 40.4 25.5 34.0 Education 42.7 33.2 40.5 The calculation method of ROUGE-N is: ; Where P represents the predicted summary result, Y represents the true label, Count() is the counting function, Count match (gram n ,Y) indicates the calculation of the gram in Y n The number of matches, ROUGE-N is an evaluation indicator of the quality of text summarization, which is used to measure the similarity between the generated summary and the actual text.

[0048] Embodiment 2: See also Figure 6 , 7 The real label of this embodiment is "Fangzhi Technology intends to invest 120 million yuan of its own funds to jointly establish Jiadao Fangzhi Investment Fund". The model output result after processing the input text is highly similar to the real label.

[0049] Embodiment three: See also Figure 8 , 9The real label of this embodiment is "Zhongjiao Co., Ltd.'s main business is to provide software customization and development services, overall solutions for educational informatization for primary and secondary basic education institutions and provincial, municipal and district education management institutions, and to design, develop and provide educational solutions including teaching equipment, software and other products." The model output result after processing the input text is highly similar to the real label.

[0050] Embodiment 4: See also Fig.10 , 11 The real label of this embodiment is "Four Seasons Education plans to conduct an initial public offering in the United States". The model output result after the input text is processed has a high similarity with the real label.

[0051] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent substitutions or changes according to the technical solutions and novel concepts of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A document summarization method based on domain knowledge and multi-granularity graph network, characterized in that: The specific steps include: Step S1: Construct a knowledge encoding module, perform domain knowledge graph transfer learning based on the pre-trained language model BERT, extract triple structure features including head entity, relationship vector, and tail entity by combining capsule network, use knowledge graph link prediction as auxiliary task, adjust the parameters of language model through gradient back conduction, and generate a text entity encoding module that integrates domain knowledge; Step S2: Construct a knowledge fusion module to convert document text into semantic vectors and perform named entity recognition at the same time. Then use the knowledge encoding module to encode entity information into external knowledge vectors. Finally, the semantic vectors are adaptively fused with external knowledge through a gating mechanism. Step S3: Construct a word-level semantic graph. The nodes in the word-level semantic graph are knowledge-enhanced semantic vectors of dynamic slices. There are two types of edges in the word-level semantic graph: one represents the temporal relationship between words, and the other connects entities of the same type. The neighborhood information is aggregated through the semantic graph attention mechanism to obtain a word embedding representation with context. Step S4: construct a sentence-level semantic graph, perform self-attention calculation on the word-level semantic vector obtained in S3, obtain the sentence-level semantic vector as the node representation in the sentence-level semantic graph, and then perform feature aggregation on the sentence-level node through the semantic graph attention mechanism to obtain the global semantic information of the document; Step S5: Construct the output layer based on the document feature vector aggregated by multi-granularity graph in S4 The final extractive summary result is predicted.

2. According to claim 1, a document summarization method based on domain knowledge and multi-granularity graph network is characterized in that: The step S1 further comprises: The word vector input of the knowledge encoding module is constructed based on the triple structure of the knowledge graph, and its expression is: ; Where T represents the word vector, CLS and SEP are markers, CLS represents the marker at the beginning of the vector for downstream classification tasks, and SEP represents the marker used to split the parts of the triplet; h 、Tok r and Tok t Respectively represent the word vector encoding of the head entity, relation vector and tail entity in the triple, m, n, k represent the number of words in the head entity, relation vector and tail entity respectively; The knowledge vector is encoded through the language model BERT, and then the average pooling calculation is used to form a knowledge embedding representation of unified dimension. The language model BERT consists of multiple Transformer layers to obtain the bidirectional semantic information in the knowledge triple. This process is expressed as: ; ; in represents the i-th input sample of the 0th layer Transformer encoder of BERT, T represents the word vector, S represents the segmentation vector and P represents the position vector, Represents the output of the l-th layer Transformer encoder; In order to obtain a unified triplet knowledge embedding representation, the output vectors are dynamically sliced ​​and average pooled according to the SEP tag to obtain the final knowledge representation embedding , this process is expressed as: ; ; ; ; in Representing knowledge representation embedding, , and They represent the output of the head entity, relation vector, and tail entity after the Transformer encoder, respectively. AvgPooling represents the average pooling operation; The capsule network includes: using convolution kernels of different sizes to embed knowledge representation Extract multi-scale local features and aggregate the local features through a dynamic routing algorithm to obtain the final link prediction result; The dynamic routing algorithm of the capsule network is as follows, where “←” indicates assignment: Step S1.1: Initialize all capsules i in the first layer: θ i Represents the semantic vector of the i-th capsule; Step S1.2: Iterate d times; Step S1.3: For all capsules i in the first layer: ;q i represents the normalized weight of the i-th capsule; Step S1.4: For a single capsule in the second layer: ; s represents the input vector of the second layer capsule, f i Representing Knowledge Representation Embedding Output after convolution; Step S1.5: For a single capsule in the second layer: ; e represents the routing coefficient between capsules; Step S1.6: For all capsules i in the first layer: θ i Represents the semantic vector of the i-th capsule; Step S1.7: return e; The capsule network contains two capsule layers. The first layer has τ capsules and the second layer has 1 capsule. i ,θ i is a learnable weight parameter, f represents the output of convolution in convolution kernels of various sizes, and the calculation formula is expressed as: ; Among them, W v Represents the value of the vth column in the convolution kernel matrix, represents the value of the i-th row and j-v+1-th column in the BERT encoding layer output triplet matrix, z represents the column width of the convolution kernel matrix, b represents the bias size, σ represents the RELU activation function, and BatchNorm represents batch normalization; The training objective function of the knowledge graph link prediction of the auxiliary task is: ; ||e|| is used as the final score for link prediction, ||.|| represents the modulus length, T represents the positive sample of the knowledge graph triple, represents the negative sample of the knowledge graph triple, where is the factor used to distinguish positive samples from negative samples. When γ is 1, When , γ takes -1.

3. According to claim 1, a document summarization method based on domain knowledge and multi-granularity graph network is characterized in that: The step S2 further comprises: The gating mechanism includes three gating units: input gate, transfer gate and carrying gate. The input gate is used to select the external knowledge that needs to be updated to obtain the initial fusion semantic knowledge encoding. The transfer gate calculates how much original semantics to transfer into the subsequent module. The carrying gate calculates how much information to carry from the knowledge fusion encoding into the subsequent module. The specific process is expressed as follows: ; ; ; ; Among them, BERT and O Knowledge They represent semantic vector and knowledge vector respectively, w is weight information, b is bias, σ is RELU nonlinear activation function, O BK is the initial fused semantic knowledge encoding calculated by the input gate, T t and T c represent the transfer gate and the carrying gate respectively, V represents the knowledge-enhanced semantic vector, and W e1 Represents the weight matrix of the semantic vector, W e2 Represents the weight matrix of the knowledge vector, W h Represents the weight matrix for computing candidate hidden states.

4. The document summarization method based on domain knowledge and multi-granularity graph network according to claim 1, characterized in that: The step S3 further comprises: The aggregation method of the word-level semantic graph is as follows: the topological structure information of the word-level semantic graph is converted into an adjacency matrix A word Indicates that node information is represented by V word It means that the process of semantic graph attention network aggregation of word-level semantic graph is as follows: ; ; ; ; Where X is the word-level semantic vector representation of the whole semantic graph after aggregation, x i is the semantic vector of the ith node, W represents the linear transformation weight parameter, α is the normalized semantic graph attention weight factor, N i represents the first-order neighbor node set of node i, GAT represents the graph attention network, which is used to aggregate the semantic information of nodes, where represents the rule constraints on the aggregation operation GAT, that is, the elements in the X formula are composed of the following x i Formula, α ij Formula, e ij Calculate the formula to get, x j represents the semantic vector of the jth node, α ij represents the attention weight, which represents the information contribution from neighbor node j to the current node i, e ij Represents the attention score, which is used to measure the node x i and xj, W2 represents the semantic vector x corresponding to node i i The linear transformation weight parameter W1 represents the semantic vector x corresponding to node j. j The linear transformation weight parameter, Concate means concatenating two vectors, and softmax means the normalization function is used to convert the attention score e ij Converted to normalized attention weight α ij .

5. The document summarization method based on domain knowledge and multi-granularity graph network according to claim 1, characterized in that: The step S4 further comprises: The sentence-level semantic vector initialization process is specifically as follows: ; where clip[X,A W-S ] refers to the correspondence between words and sentences A W-S Dynamically slice the semantic vector X and perform self-attention calculation on a sentence-by-sentence basis to obtain the initialized sentence vector S 0 , where Q S , K S 、V S They correspond to the query vector, key vector, and value vector in the self-attention mechanism, respectively. len(X) represents the number of words in the sentence. It is used to control the scaling factor of the attention score value. Self-attention refers to the self-attention mechanism, which is used by the model to assign different weights according to the importance of different parts of the input when processing information. Softmax represents the normalization function, which is used to convert the attention score into a probability distribution. si represents the query vector; The specific method of aggregating the sentence-level semantic graph is as follows: The node information in the sentence-level semantic graph is represented by a sentence vector S={s1,s2,…,s m }, the topological structure information is represented by its adjacency matrix A sentence It means that the semantic graph attention calculation process of the sentence-level semantic graph is as follows: ; ; ; ; ; in represents the document semantic vector after layer l aggregation, It is used to predict the probability of containing key information in a sentence. FFN represents the feedforward neural network layer, and σ represents the RELU activation function. represents the influencing factor for controlling the elimination of document redundancy, W represents the weight parameter, represents the semantic vector of the i-th sentence in the document in the l-th layer, represents the semantic vector of the i-th sentence in the document after the l-th layer is aggregated by the graph neural network, represents a learnable linear transformation sentence, N i represents the set of first-order neighbor nodes of node i, GAT represents the graph attention network, which is used to aggregate the semantic information of nodes. Represents the document semantic vector of the l+1th layer.

6. The document summarization method based on domain knowledge and multi-granularity graph network according to claim 1, characterized in that: The step S5 further comprises: predicting the final extractive summary result through the objective function, The objective function of the prediction is: ; where y i represents the prediction result of the i-th sentence, and m represents the number of sentences in the document, that is, the probability of the current sentence depends on the prediction result of the previous sentence. represents the semantic vector of the document, Y represents the prediction result of the entire sequence, P represents the probability function, Represents the semantic vector of a given document and y1 to y i-1 Under the condition of prediction results, the current prediction result y i The conditional probability of .

Citation Information

Patent Citations

  • GENERATIVE AUTOMATIC abstracting METHOD BASED ON BERT AND EXTERNAL KNOWLES

    CN114398478A

  • Omnibearing real-time intelligent early warning method and system for dangerous source in cultural relic key area

    CN117275202A

Cited By

  • AI report automatic generation method based on big data

    CN120012730A

  • Bid document abstract generation method and system based on large language model

    CN121301563A

  • Text abstract generation method for deep semantic understanding

    CN121579686A

  • A Deep Semantic Understanding-Based Text Summarization Method

    CN121579686B

  • Satellite observation demand generation method based on triple capsule network

    CN121980192A