A method for generating single-language topic summarization based on heterogeneous graphs

Cross-language word embeddings are generated through multi-layer graph convolutional networks and adversarial training, combined with graph attention network aggregation information, which solves the problem of inaccurate multilingual summaries in the existing technology and achieves accurate topic summary generation in multiple languages. Suitable for rapid extraction of multi-language news information.

CN114860920BActive Publication Date: 2024-09-13INNER MONGOLIA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210416073.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-20
Publication Date
2024-09-13
Estimated Expiration
2042-04-20

AI Technical Summary

Technical Problem

Existing technologies fail to effectively consider multiple relationships between words when generating multilingual monolingual topic summaries, and lack word embeddings for non-English languages, resulting in inaccurate summaries and insufficient multilingual support.

Method used

Multi-layer graph convolutional network (Multi-GCN) is used to combine adversarial training and graph attention network to generate node information in heterogeneous graphs, generate cross-language word embeddings through GAN network, and use graph attention mechanism to aggregate node information to Improve summary accuracy.

Benefits of technology

It significantly improves the accuracy and reliability of multi-language summaries, can effectively extract the main content of news, is suitable for multiple languages, solves the problem of inaccurate long text summaries, and provides an effective solution for users to quickly obtain news information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860920B
    Figure CN114860920B
Patent Text Reader

Abstract

A method for generating single-language topic summaries based on heterogeneous graphs, which crawls a summary dataset of a source language from the Internet and performs word segmentation, sentence segmentation and labeling operations; uses adversarial training to learn a spatial linear mapping from the source language to the target language, obtains word vectors of the source language and the target language in the same shared vector space, preprocesses the data obtained by the word segmentation, sentence segmentation and labeling operations, and obtains vectors containing word nodes, sentence nodes and edge features, wherein the source language is the language of the dataset for which a summary needs to be generated, and the target language is a large language; uses a graph attention network to aggregate information on the vectors containing word nodes, sentence nodes and edge features, continuously updates word nodes and sentence nodes, and obtains sentence nodes after information aggregation; classifies the sentence nodes after information aggregation, uses cross entropy loss as the training target, sorts the sentences according to their scores, and selects sentence nodes suitable as summaries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to a method for generating a single-language topic summary based on a heterogeneous graph. Background Art

[0002] With the rapid development of the Internet, various text data containing news have emerged, making it difficult for people to quickly obtain the subject information in this article; in addition, the same news will have different perspectives when reported by different reporters, which helps users understand the full picture of a certain event. How to summarize all reports into the main points of view; when you want to read long news in your spare time, you want to quickly understand the main content of the news. How to quickly obtain the core content from text information is particularly necessary and urgent in today's situation.

[0003] Existing methods use GCN or GAT models and heterogeneous graphs to achieve single-language summarization. However, the disadvantage is that they do not consider the various relationships between words, and the existing technologies are mostly targeted at English, and there is a lack of corresponding word embedding for other languages. Summary of the invention

[0004] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a single-language topic summary generation method based on heterogeneous graphs. By using multi-GCN, the relationship between words, such as syntactic relationship and semantic relationship, can be considered; by using the GAN network, word embeddings of other languages ​​can be generated, thereby solving the summary problem of multiple languages; and the node information in the heterogeneous graph is aggregated through the graph attention network to improve the accuracy of the generated summary.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] A method for generating a single-language topic summary based on a heterogeneous graph comprises the following steps:

[0007] Step 1: crawl a source language summary dataset from the Internet, and perform word segmentation, sentence segmentation and tagging operations. The source language is the language of the dataset for which a summary needs to be generated;

[0008] Step 2: Use adversarial training to learn a spatial linear mapping from the source language to the target language, obtain word vectors of the source language and the target language in the same shared vector space, pre-process the data obtained by word segmentation, sentence segmentation and labeling operations, and obtain a vector containing word nodes, sentence nodes and edge features, wherein the target language is a large language;

[0009] Step 3: Use the graph attention network to aggregate the vectors containing word nodes, sentence nodes, and edge features, continuously update the word nodes and sentence nodes, and obtain the sentence nodes after information aggregation;

[0010] Step 4: Classify the sentence nodes after information aggregation, use cross entropy loss as the training target, sort the sentences according to their scores, and select the sentence nodes suitable as summaries.

[0011] Compared with the prior art, the present invention aims at the phenomenon that it is difficult to quickly obtain the main idea of ​​news when the text data of news emerges. If you want to quickly understand the whole picture of a thing, the present invention adopts heterogeneous graphs and graph attention mechanisms to aggregate the information of words in the sentence data set, and update the word nodes. After continuous iteration, sentences with higher importance will be obtained, which is the theme summary of the article. The present invention can solve the problem of inaccurate long text summaries to a great extent, improve the accuracy of extractive summaries, and contribute to users' rapid acquisition of news information. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a schematic diagram of the overall process of the present invention.

[0013] Figure 2 This is a multi-GCN model diagram in an embodiment of the present invention.

[0014] Figure 3 It is a schematic diagram of sentence node information update in an embodiment of the present invention. DETAILED DESCRIPTION

[0015] The embodiments of the present invention are described in detail below with reference to the accompanying drawings and examples.

[0016] The present invention provides a method for generating a single-language topic summary based on a heterogeneous graph, such as Figure 1 As shown, the following steps are included:

[0017] Step 1: crawl the source language summary dataset from the web.

[0018] The data set crawled from the web contains many invalid characters or errors, so it is necessary to clean the data first to ensure that the data set is correct and complete.

[0019] In this embodiment, Chinese is used as the source language. The data in the summary dataset is segmented (Chinese needs to be segmented to meet the subsequent word embedding requirements, other languages ​​do not need this operation), sentence segmented and labeled, and the source language is the language of the dataset for which the summary needs to be generated.

[0020] For Chinese, you can refer to the Jieba word library for word segmentation, clean up the abnormal characters and separators retained in it, and perform sentence segmentation and labeling operations on the data set after word segmentation. The label can be the i-1th sentence in the text of the abstract.

[0021] Step 2: Preprocess the data obtained by word segmentation, sentence segmentation and labeling operations to obtain a vector containing word nodes, sentence nodes and edge features.

[0022] In this step, the data obtained from the word segmentation, sentence segmentation and labeling operations are embedded using the word vectors of the source language, and the word embeddings are integrated to obtain sentence embeddings. The word embeddings are used as word nodes, the sentence embeddings are used as sentence nodes, and the relationship between word embeddings and sentence embeddings is used as edge features to construct a heterogeneous graph.

[0023] In order to ensure that the method of the present invention is applicable to all languages, it is necessary to generate word vectors of the source language for word embedding, and according to the characteristics of the heterogeneous graph, its graph structure is divided into word nodes, sentence nodes, and edge features, and the data set is preprocessed in four steps to obtain vectors containing word nodes, sentence nodes, and edge features. The details are as follows:

[0024] Step 2.1, in order to generate the word vector of the source language as the material needed for word embedding of the summary model, the present invention adopts a GAN network, uses a one-to-one corresponding data set of two languages ​​(one of which is the source language and the other is the target language, and the target language should generally be a large language, such as English, French, etc.) as a data set for confrontation, and uses the adversarial training method to learn a spatial linear mapping from the source language to the target language, and obtains the word vector of the source language and the target language in the same shared vector space. This step is to generate the word vector of the source language through GAN network training.

[0025] The mapping function W of the spatial linear mapping is as follows

[0026]

[0027] In the formula, X represents the word embedding of the source language, Y represents the word embedding of the target language corresponding to X, and the generator generates a mapping W from X to Y. is a real matrix in d×d dimensional space, || || F is the symbol of F norm, W * It represents the value of the mapping function when the F norm of WX-Y is minimum. The discriminator distinguishes the difference between WX and the corresponding Y, and the discriminator and the generator are constantly confronted until the similarity between WX and Y makes the discriminator unable to distinguish.

[0028] The parameters of the discriminator are θ D , the loss function of the discriminator is as follows:

[0029]

[0030] n is the number of words in the source language, m is the number of words in the target language, and x irepresents the word embedding of the i-th word in the source language, y i Represents the word embedding of the i-th word in the target language;

[0031] Indicates that the discriminator believes that Wx i is the probability of the source language embedding, It means that the discriminator thinks that y i is the probability of embedding in the target language;

[0032] Training W makes the discriminator unable to distinguish the original embedding WX and Y, then its loss function is:

[0033]

[0034] Indicates that the discriminator believes that Wx i is the probability of target language embedding, It means that the discriminator thinks that y i is the probability of the source language embedding;

[0035] Given an input sample, the discriminator and mapping function W are updated in turn using the stochastic gradient descent method so that L D (θ D |W) and L W (W|θ D ) is the smallest;

[0036] The training method of the model is the process of adversarial network. Given an input sample, the discriminator and the mapping matrix W are updated in turn using the stochastic gradient descent method so that L D With L W The sum is the smallest.

[0037] In order to generate reliable matching pairs between languages, the criterion is improved in the embodiment of the present invention. The CSLS method is adopted, and finally the word vectors of the source language and the target language in the same shared vector space are obtained. The neighbor nodes of any source language word are the corresponding words of the target language. The generated word vectors of the source language are used as the material required for word embedding of the summary model.

[0038] Step 2.2: Use the word vector generated in step 2.1 to perform word embedding on the word part in the dataset.

[0039] In step 2.3, use the word embedding generated in step 2.2 to initialize the words of each sentence in the dataset using CNN+BiLSTM, use Multi-GCN to capture multiple relationships between words, obtain the word embedding of the sentence, and integrate the word embeddings to obtain the sentence embedding.

[0040] In this step, based on the word vector of the source language, a convolutional neural network (CNN) is first used to capture the local n-garm features of each sentence, that is, the joint probability of words. Then a bidirectional long short-term memory network (BiLSTM) is used to capture sentence-level features, and the local n-garm features are connected with the sentence-level features to obtain the context word embedding, that is, the initialized result. For this initialized result, Multi-GCN is used to capture multiple relationships between words.

[0041] Specifically, refer to Figure 2 , where for syntactic relations, when there is a dependency relationship between two words, A r [w i ,w j ]=1, when there is no dependency relationship, A r [w i ,w j ]=0; for semantic relations, the absolute value of the dot product between word embeddings is used to construct,

[0042] In the formula, A r [w i ,w j ] represents the i-th word w i With the jth word w j The syntactic or semantic relationship between them; represents the transpose of the word vector of the i-th word, The word vector of the jth word, express and The absolute value of the dot product is used to determine whether two words are semantically similar.

[0043] Next, for A r [w i ,w j ] to fuse, the fusion layer l means calculating the relationship between a certain word and the lth word (such as I, like, eat, apple, and, like, play, badminton. If the relationship between the word "eat" and other words is captured, the third layer is to calculate the relationship between eat and apple), the update function is defined as:

[0044]

[0045]

[0046] In the formula, and denotes weights and biases, is the initial embedding after initialization, i.e., the context word embedding, Represents the final word embedding of a word at layer l-1. represents the lth GCN layer, Represents the word embedding after a word is fused with the relationship between the lth word, It represents the word embedding finally obtained by the lth GCN layer. After passing through several GCN layers, the final updated result H is obtained, and the final word embedding F w =H+X w , integrate the word embeddings of the sentence to get the sentence embedding F s .

[0047] In this step, the final word embeddings of all sentences and their corresponding sentence embeddings are obtained. The word embeddings are used as word nodes of the heterogeneous graph structure, and the sentence embeddings are used as sentence nodes of the heterogeneous graph structure.

[0048] In step 2.4, TF-IDF is used to represent the relationship between words and sentences as the edge feature of the graph structure.

[0049] In this step, the TF-IDF value is injected into the edge feature. The word frequency TF represents the i-th word w i In the jth sentence s j The number of times it appears in the document, the inverse document frequency IDF represents w i The inverse function appears.

[0050] Step 3: Use the graph attention network to aggregate the vectors containing word nodes, sentence nodes, and edge features, and continuously update the word nodes and sentence nodes to obtain the sentence nodes after information aggregation. The steps are as follows:

[0051] Step 3.1, modify GAT (graph attention network) by combining multi-head attention mechanism and residual connection.

[0052] Specifically, in this step, the graph attention network uses the graph convolutional neural network as the basic framework. The framework introduces an attention mechanism and adds a residual connection. This embodiment uses multi-head attention. The attention mechanism is introduced to collect and aggregate the feature representations of neighboring nodes with similar distances. The multi-head attention is used to play an integration role to prevent overfitting. The residual connection is added to prevent the gradient vanishing problem when aggregating node information. The specific modification process is as follows:

[0053] The attention mechanism is introduced, and the word node and sentence node are F w With F s , the node feature is represented by F w ∪F s , the edge feature is represented as E, the graph constructed by the node feature and the edge feature is represented as G, and the graph attention network is used to update the representation of the semantic node.

[0054] Specify i∈{1,...,(m+n)} is used as the hidden state of the output node, and its graph attention layer is designed as follows:

[0055] z ij =Leaky ReLU(W α [W q h i ; W k h j ])

[0056]

[0057]

[0058] Where W a ,W q ,W k ,W v is the trainable weight; a ij Yes i With h j The attention weight between is expressed in multi-head attention as:

[0059]

[0060] In order to prevent the gradient from vanishing after multiple iterations when aggregating information, a residual connection is added, so the final output is represented as:

[0061] h' i =u i +h i

[0062] After that, the graph attention network is further modified to inject the scalar weight value e of the edge ij Mapping to a multidimensional embedding space So the attention layer formula is modified as follows:

[0063] z i,j =LeakyReLU(W α [W q h i ; W k h j ;e ij ])

[0064] Finally, a position-level feed-forward layer is added after the graph attention layer.

[0065] This step describes the formula process of the model introducing the attention mechanism from GCN to GAT; the result of information aggregation is a new representation of the feature vector of the sentence node, which will be scored (i.e., similarity calculation) with the key vocabulary (keywords). The higher the score, the higher the sentence score.

[0066] Step 3.2, update the sentence nodes using the network modified in step 3.1.

[0067] Use the graph attention network to update word nodes and sentence nodes as follows:

[0068]

[0069]

[0070] in is the word-level information contained in each sentence aggregation, Indicates updating sentence nodes with word nodes. and Indicates that an attention mechanism calculation is performed, where is the query of the attention mechanism, Represents the key and value of the attention mechanism.

[0071] Then, the updated sentence nodes are used to obtain the new representations of the word nodes, and the sentence nodes are further updated iteratively. Each iteration contains a sentence-to-word and a word-to-sentence update process. The t-th iteration process can be expressed as:

[0072]

[0073]

[0074] represents the word-level information contained in the aggregation of each sentence at the t-th iteration, Indicates that the tth iteration updates the sentence node with the word node, represents the key and value of the attention mechanism at the tth iteration, Use a feed-forward layer FNN to update the key and value of the attention mechanism. FNN is a feed-forward network and GAT is a graph attention network.

[0075] refer to Figure 3, update the sentence node (each time the sentence node is iterated, its feature vector is calculated in GAT through query, key and value to obtain a new feature vector, so as to update the sentence node, that is, the information contained in the node is updated) The processing steps are as follows:

[0076] (1) Each sentence s in the document i Aggregate the word-level information contained;

[0077] (2) Use the word w i The sentence i The sentence node is updated with the new representation of the word. Since the feature vector of the sentence node is obtained by adding the feature vectors of the word nodes, if the feature vector of the word node is updated, the feature vector of the sentence node will also be updated synchronously. Therefore, the sentence node can be updated with the new representation of the word contained in the sentence (that is, the new feature vector after the feature vector is updated).

[0078] After this step, a new representation of the feature vector of the sentence node is obtained, and a score calculation (ie, similarity calculation) is performed in step 4. A high score indicates that the sentence is a summary candidate.

[0079] Step 4: Classify the sentence nodes after information aggregation, use cross entropy loss as the training target, sort the sentences according to their scores, and select the sentence nodes suitable as summaries. The specific steps are as follows:

[0080] (1) Score and rank the updated sentence nodes; the specific method is as follows:

[0081] 1) The sentence node feature vector is linearly transformed into a probability of appearing in the summary (specifically, the more keywords a sentence contains, the higher the score of the sentence, and the greater the probability of the sentence being a summary). The probability of a word appearing in a sentence is related to the vector of edge features obtained by TD-IDF.

[0082] 2) Sort by probability and select the first k as summaries.

[0083] 3) Discard sentences that have duplicate triplets with higher-ranked sentences.

[0084] (2) Remove sentences with lower scores and keep sentences with higher scores as key sentences;

[0085] (3) Remove sentences that are ranked lower among the key sentences and have the same meaning as the sentences at the top or have too many repeated keywords;

[0086] (4) Extract the final summary.

[0087] In a specific embodiment of the present invention, the hardware is a computer, and the configuration includes the hardware environment: CPU: Intel Core processor (3.1GHz) / 4.5GHz / 8GT; GPU: 6 pieces of 16G_TESLA-P100_4096b_P_CAC; memory: 16 32G ECC Registered DDR4 2666; software environment: operating system: Ubantu 16.04; deep learning framework: Pytorch; language and development environment: Python 3.6, Anaconda 3.

[0088] In this embodiment, the Chinese version of the 2017 NLPCC evaluation data set is used for analysis, and the English version of the CNN / DM data set is used for analysis. The Chinese version is segmented according to the above steps, while the English version is segmented. The word node features, sentence node features, and edge features are extracted from the processed data set, and the sentence features are aggregated, the word node information is aggregated, the sentence nodes are updated, and then the final sentence nodes are ranked to select suitable summaries and obtain the corresponding Chinese and English summaries.

[0089] Table 1 shows the data set after word segmentation and sentence segmentation in Chinese and English (partial diagram), as follows:

[0090] Table 1

[0091]

[0092]

[0093] The data set shown in Table 1 is subjected to feature extraction, sentence node aggregation and updating, and sentences suitable for being used as summaries are screened to obtain the extraction results shown in Table 2 below:

[0094] Table 2

[0095]

[0096]

[0097] By comparing the reference abstract provided by the data set in Table 2 with the abstract actually output, it can be seen that the abstract generated by the present invention is almost consistent with the reference abstract.

Claims

1. A method for generating single-language topic summaries based on heterogeneous graphs, characterized in that: The steps include: Step 1: crawl a source language summary dataset from the Internet, and perform word segmentation, sentence segmentation and tagging operations. The source language is the language of the dataset for which a summary needs to be generated; Step 2: Use adversarial training to learn a spatial linear mapping from the source language to the target language, obtain word vectors of the source language and the target language in the same shared vector space, pre-process the data obtained by word segmentation, sentence segmentation and labeling operations, and obtain a vector containing word nodes, sentence nodes and edge features, wherein the target language is a large language; Step 3: Use the graph attention network to aggregate the vectors containing word nodes, sentence nodes, and edge features, continuously update the word nodes and sentence nodes, and obtain the sentence nodes after information aggregation; Step 4: Classify the sentence nodes after information aggregation, use cross entropy loss as the training target, sort the sentences according to their scores, and select the sentence nodes suitable as summaries; In step 2, the data obtained by the word segmentation, sentence segmentation and labeling operations are subjected to word embedding operations using the word vectors of the source language, and the word embeddings are integrated to obtain sentence embeddings, the word embeddings are used as word nodes, the sentence embeddings are used as sentence nodes, and the relationship between the word embeddings and the sentence embeddings is used as an edge feature to construct a heterogeneous graph; The adversarial training adopts a GAN network, in which the data sets used for adversarial training are one-to-one corresponding, and the mapping function of the spatial linear mapping is as follows: Among them, X represents the word embedding of the source language, Y represents the word embedding of the target language corresponding to X, and the generator generates a mapping W from X to Y. is a real matrix in d×d dimensional space, || || F is the symbol of F norm, W * Indicates the value of the mapping function when the F norm of WX-Y is minimum; the discriminator distinguishes the difference between WX and the corresponding Y, and the discriminator and the generator are constantly confronted until the similarity between WX and Y makes the discriminator unable to distinguish; The parameters of the discriminator are θ D , the loss function of the discriminator is as follows: n is the number of words in the source language, m is the number of words in the target language, and x i represents the word embedding of the i-th word in the source language, y i Represents the word embedding of the i-th word in the target language; Indicates that the discriminator believes that Wx i is the probability of the source language embedding, It means that the discriminator thinks that y i is the probability of embedding in the target language; Training W makes the discriminator unable to distinguish WX from Y, then its loss function is: Indicates that the discriminator believes that Wx i is the probability of target language embedding, It means that the discriminator thinks that y i is the probability of the source language embedding; Given an input sample, the discriminator and mapping function W are updated in turn using the stochastic gradient descent method so that L D (θ D |W) and L W (Wθ D ) is the smallest; Finally, we get word vectors of the source language and the target language in the same shared vector space. The neighbor nodes of any source language word are the corresponding words in the target language. Based on the word vector of the source language, a convolutional neural network is first used to capture the local n-garm features of each sentence, and then a bidirectional long short-term memory network is used to capture the sentence-level features. The local n-garm features are connected with the sentence-level features to obtain context word embedding, and then multi-GCN is used to capture multiple relationships between words. For syntactic relationships, when there is a dependency relationship between two words, A r [w i ,w j ]=1, when there is no dependency relationship, A r [w i ,w j ]=0; for semantic relations, the absolute value of the dot product between word embeddings is used to construct, Among them, A r [w i ,w j ] represents the i-th word w i With the jth word w j The syntactic or semantic relationship between them; represents the transpose of the word vector of the i-th word, The word vector of the jth word, express and The absolute value of the dot product to determine whether two words are semantically similar; A r [w i ,w j ] to fuse, the fusion of the lth layer means calculating the relationship between a certain word and the lth word, and the update function is defined as: in, and denotes weights and biases, is the initial embedding after initialization, i.e., the context word embedding, Represents the final word embedding of a word at layer l-1. represents the lth GCN layer, Represents the word embedding after a word is fused with the relationship between the lth word, It represents the word embedding finally obtained by the lth GCN layer. After passing through several GCN layers, the final updated result H is obtained, and the final word embedding F w =H+X w , integrate the word embeddings of the sentence to get the sentence embedding F s ; In step 4, the summary sentence selection step is as follows: (1) Score and rank the updated sentence nodes; (2) Remove sentences with lower scores and keep sentences with higher scores as key sentences; (3) Remove sentences that are ranked lower among the key sentences and have the same meaning as the sentences at the top or have too many repeated keywords; (4) Extract the final summary; The specific method for scoring and ranking the updated sentence nodes is as follows: 1) The sentence node feature vector is linearly transformed to a probability of appearing in the summary; 2) Sort by probability and select the first k as summaries; 3) Discard sentences that have duplicate triplets with higher-ranked sentences.

2. According to claim 1, the method for generating a single-language topic summary based on a heterogeneous graph is characterized in that: Inject TF-IDF value into edge features, word frequency TF represents the i-th word w i In the jth sentence s j The number of times it appears in the document, the inverse document frequency IDF represents w i The inverse function appears.

3. According to claim 1, the method for generating single-language topic summaries based on heterogeneous graphs is characterized in that: In step 3, the graph attention network uses the graph convolutional neural network as the basic framework, introduces an attention mechanism, and adds a residual connection; the graph attention network is used to update the word nodes and sentence nodes as follows: in is the word-level information contained in each sentence aggregation, Indicates updating sentence nodes with word nodes. and Indicates that an attention mechanism calculation is performed, where is the query of the attention mechanism, that is, the sentence node, Represents the key and value of the attention mechanism, that is, the word node; Then, the updated sentence node is used to obtain the new representation of the word node, and the sentence node is further iteratively updated. Each iteration includes a sentence-to-word and a word-to-sentence update process. The t-th iteration process is expressed as: represents the word-level information contained in the aggregation of each sentence at the t-th iteration, Indicates that the tth iteration updates the sentence node with the word node, represents the key and value of the attention mechanism at the tth iteration, Use a feed-forward layer FNN to update the key and value of the attention mechanism. FNN is a feed-forward network and GAT is a graph attention network. The processing steps for updating a sentence node are as follows: (1) Each sentence s in the document i Aggregate the word-level information contained; (2) Use the word w i The sentence i Update the sentence node with the new representation of .