Abstract extraction method, device, computer device and readable storage medium

By constructing a heterogeneous graph structure and combining a graph convolution neural network, the problem of low accuracy of traditional abstract extraction methods is solved, and efficient abstract extraction of complex texts is achieved.

CN113779233BActive Publication Date: 2025-06-13SHANGHAI PUDONG DEVELOPMENT BANK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110980961.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-25
Publication Date
2025-06-13
Estimated Expiration
2041-08-25

AI Technical Summary

Technical Problem

Traditional abstract extraction methods lead to low accuracy of abstract extraction results.

Method used

By obtaining the text feature matrix of text keyword graph structure, text sentence similarity graph structure, text sentence sequence graph structure and sentence position information, a heterogeneous graph structure is constructed, and a graph convolutional neural network is used for abstract extraction.

Benefits of technology

It improves the accuracy of abstract extraction, can be effectively applied to text with complex structures, and has good scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113779233B_ABST
    Figure CN113779233B_ABST
Patent Text Reader

Abstract

The present application relates to a method, apparatus, computer device, and storage medium for abstract extraction. The method includes: obtaining a text feature matrix of a text keyword graph structure, a text sentence similarity graph structure, a text sentence order graph structure, and sentence position information from the text to be extracted, superimposing the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features, and obtaining an abstract extraction result through the heterogeneous graph structure and the text feature matrix. By using this method, graph structures with different features can be obtained, a heterogeneous graph structure with multi-feature fusion can be constructed through the graph structures with different features, and further, the text feature matrix of sentence position information is fused to implement text abstract extraction. The specific process considers different text features, can be applied to texts with complex structures, and has good scalability, thereby improving the accuracy of abstract extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information processing technologies, and in particular, to a method and apparatus for abstract extraction, a computer device, and a readable storage medium. Background Art

[0002] With the rapid development of information technology, the application of information processing technology has penetrated into all aspects of life. For example, text abstract extraction technology is widely used in scenarios of automatically extracting the core content of text, and there are also similar news abstract extraction, article abstract extraction, etc. The extracted text forms a passage with strong readability and high information importance on the basis of not losing important text information, enabling people to effectively reduce the reading volume, so this technology is widely used in the industry.

[0003] In traditional technologies, a text graph structure is constructed by calculating the correlation between sentences to achieve the purpose of abstract extraction. However, traditional methods may result in a relatively low accuracy of abstract extraction results. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide a method and apparatus for abstract extraction, a computer device, and a readable storage medium.

[0005] A method for abstract extraction, the method includes:

[0006] Obtain a text feature matrix of text keyword graph structure, text sentence similarity graph structure, text sentence order graph structure, and sentence position information from the text to be extracted;

[0007] Overlay the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features;

[0008] Obtain an abstract extraction result through the heterogeneous graph structure and the text feature matrix.

[0009] In one embodiment, the obtaining a text feature matrix of sentence position information from the text to be extracted includes:

[0010] Obtain the text to be extracted;

[0011] Encode the text to be extracted to obtain original sentence vectors corresponding to each sentence in the text to be extracted;

[0012] Obtain the total number of original sentences corresponding to all original sentence vectors;

[0013] Calculate a sentence vector to be processed through the total number of original sentences, a preset sentence number threshold, and the original sentence vectors;

[0014] Calculate the text feature matrix based on the sentence vector to be processed and the sentence length corresponding to the sentence vector to be processed.

[0015] In one embodiment, the obtaining of the sentence vector to be processed from the total number of original sentences, the preset sentence number threshold, and the original sentence vectors includes:

[0016] If the total number of original sentences is greater than or equal to the preset sentence number threshold, obtain the preset sentence number threshold of original sentence vectors from the original sentence vectors as the sentence vector to be processed;

[0017] If the total number of original sentences is less than the preset sentence number threshold, perform padding processing on the original sentence vectors to obtain the sentence vector to be processed, and the number of sentences in the sentence vector to be processed is equal to the preset sentence number threshold.

[0018] In one embodiment, the obtaining of the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure from the text to be extracted includes:

[0019] Determine the number of co-occurring keywords in each pair of sentences, the number of co-occurring words in each pair of sentences, the total number of keywords in the text to be extracted, the length of each sentence in the text to be extracted, and the position of the sentence in the text to be extracted through the text to be extracted;

[0020] Construct the text keyword graph structure based on the number of co-occurring keywords in each pair of sentences and the total number of keywords in the text to be extracted;

[0021] Construct the text sentence similarity graph structure based on the number of co-occurring words in each pair of sentences and the length of each sentence in the text to be extracted;

[0022] Construct the text sentence order graph structure based on the position of the sentence in the text to be extracted.

[0023] In one embodiment, the obtaining of the abstract extraction result from the heterogeneous graph structure and the text feature matrix includes:

[0024] Obtain the adjacency matrix of the multi-channel t-step jump connection through the heterogeneous graph structure;

[0025] Obtain the text sentence feature matrix at the t-th step through the text feature matrix;

[0026] Input the adjacency matrix of the multi-channel t-step jump connection and the text sentence feature matrix at the t-th step into a graph convolutional neural network to obtain the text sentence representation matrix after aggregating the t-step jump connections of the text sentence;

[0027] Input the text sentence representation matrix of the last time step into a classifier to obtain the abstract extraction result.

[0028] In one embodiment, obtaining the adjacency matrix of the multi-channel t-step jump connection through the heterogeneous graph structure includes:

[0029] Calculate the multi-hop connection adjacency matrix of multiple channels through the heterogeneous graph structure and the weight matrix of different text features in the heterogeneous graph structure;

[0030] Obtain the adjacency matrix of the multi-channel t-step jump connection through the multi-hop connection adjacency matrix of the multiple channels.

[0031] In one embodiment, calculating the multi-hop connection adjacency matrix of multiple channels through the heterogeneous graph structure and the weight matrix of different text features in the heterogeneous graph structure includes:

[0032] Expand the weight matrix to obtain an expanded weight matrix;

[0033] Obtain the multi-hop connection adjacency matrix of the multiple channels through the heterogeneous graph structure and the expanded weight matrix.

[0034] In one embodiment, obtaining the adjacency matrix of the multi-channel t-step jump connection through the multi-hop connection adjacency matrix of the multiple channels includes:

[0035] Calculate the adjacency matrix corresponding to each step in the first t steps through the multi-hop connection adjacency matrix of the multiple channels;

[0036] Multiply the adjacency matrices corresponding to each step in the first t steps to obtain the adjacency matrix of the multi-channel t-step jump connection.

[0037] An abstract extraction device, the device includes:

[0038] An information acquisition module, configured to obtain a text feature matrix of a text keyword graph structure, a text sentence similarity graph structure, a text sentence order graph structure, and sentence position information through the text to be extracted;

[0039] An overlay module, configured to overlay the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features;

[0040] An abstract extraction module, configured to obtain an abstract extraction result through the heterogeneous graph structure and the text feature matrix.

[0041] A computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the following steps are implemented:

[0042] Obtain a text feature matrix of text keyword graph structure, text sentence similarity graph structure, text sentence order graph structure, and sentence position information through the text to be extracted;

[0043] Overlay the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features;

[0044] Obtain an abstract extraction result through the heterogeneous graph structure and the text feature matrix.

[0045] A readable storage medium stores a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0046] Obtain a text feature matrix of text keyword graph structure, text sentence similarity graph structure, text sentence order graph structure, and sentence position information through the text to be extracted;

[0047] Overlay the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features;

[0048] Obtain an abstract extraction result through the heterogeneous graph structure and the text feature matrix.

[0049] In the above abstract extraction method, device, computer device, and readable storage medium, the computer device obtains a text feature matrix of text keyword graph structure, text sentence similarity graph structure, text sentence order graph structure, and sentence position information through the text to be extracted. The text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure are overlaid to obtain a heterogeneous graph structure of text features. An abstract extraction result is obtained through the heterogeneous graph structure and the text feature matrix. This method can obtain graph structures with different features, construct a heterogeneous graph structure with multi-feature fusion through graph structures with different features, and further fuse the text feature matrix of sentence position information to achieve text abstract extraction. The specific process considers different text features, can be applied to texts with complex structures, and has good scalability, thereby improving the accuracy of abstract extraction. Description of the Drawings

[0050] Figure 1 It is a schematic flowchart of the abstract extraction method in an embodiment;

[0051] Figure 2 It is a schematic flowchart of the method for obtaining a text feature matrix in another embodiment;

[0052] Figure 3 Schematic flowchart of a method for constructing different feature map structures in another embodiment;

[0053] Figure 4 Schematic flowchart of a method for obtaining an abstract extraction result in another embodiment;

[0054] Figure 5 Block diagram of the structure of an abstract extraction device in one embodiment;

[0055] Figure 6 Internal structure diagram of a computer device in one embodiment. Detailed implementation manners

[0056] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0057] The abstract extraction method provided in this embodiment can be applied to a computer device. The computer device can be an electronic device with an image processing function such as a smart phone, a tablet computer, a notebook computer, a desktop computer or a personal digital assistant, etc. The specific form of the computer device is not limited in this embodiment.

[0058] In one embodiment, as Figure 1 shown, a method for abstract extraction is provided. Taking the application of this method to a computer device as an example, the method includes the following steps:

[0059] S100. Obtain a text feature matrix of a text keyword graph structure, a text sentence similarity graph structure, a text sentence order graph structure and sentence position information from the text to be extracted.

[0060] Specifically, the computer device can count information such as the number of keywords, the number of ordinary characters, the arrangement order of sentences in the text to be extracted, the sentence length, and the total number of characters included in the sentences in the text to be extracted, so as to obtain a text feature matrix of sentence position information, and can also construct a text keyword graph structure A corresponding to the text to be extracted through the above-obtained information k 、a text sentence similarity graph structure A s and a text sentence order graph structure A o . Among them, the text keyword, the text sentence similarity and the text sentence order are all text features of the text to be extracted. In addition, the text features can be extended to topic features, syntactic features, etc., so as to extend the abstract extraction method and improve the wide adaptability of the abstract extraction method.

[0061] Before counting the information in the text to be extracted, the text to be extracted can also be preprocessed. The preprocessing process can be to convert traditional Chinese characters in the text to be extracted into simplified Chinese characters, convert full-width characters in the text to be extracted into half-width characters, set the text within parentheses in the text to be extracted as special flag bits, remove stop words in the text to be extracted, and can also be to set punctuation marks in the text to be extracted as special flag bits, and split the sentences in the text to be extracted through the special flag bits. This process is not limited.

[0062] S200. Overlay the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features.

[0063] It can be understood that the computer device can use the text keyword graph structure A k , the text sentence similarity graph structure A s and the text sentence order graph structure A o to overlay and obtain a heterogeneous graph structure A of text features. Overlaying can be understood as the process of splicing the text keyword graph structure A k , the text sentence similarity graph structure A s and the text sentence order graph structure A o , and can also be understood as the process of adding the text keyword graph structure A k , the text sentence similarity graph structure A s and the text sentence order graph structure A o . In this embodiment, overlaying the text keyword graph structure A k , the text sentence similarity graph structure A s and the text sentence order graph structure A o to obtain a heterogeneous graph structure A of text features can actually be understood as the process of overlaying the text keyword graph structure A k , the text sentence similarity graph structure A s and the text sentence order graph structure A o on the 0th dimension. Specifically, it can be expressed by the formula as:

[0064]

[0065] where A ∈ R 3×n×n , n represents the number of sentences in the text to be extracted, and i and j represent the sentence positions.

[0066] S300. Obtain the abstract extraction result through the heterogeneous graph structure and the text feature matrix.

[0067] Specifically, the computer device can perform arithmetic processing on the heterogeneous graph structure A of text features and the text feature matrix H of sentence position information to obtain an arithmetic result, and then perform classification processing on the arithmetic result to obtain an abstract extraction result. The arithmetic processing method can be arithmetic operations, exponential operations, power operations, logarithmic operations, etc., or a combined operation of these operations.

[0068] The above abstract extraction method can obtain a text keyword graph structure, a text sentence similarity graph structure, a text sentence order graph structure, and a text feature matrix of sentence position information from the text to be extracted. The text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure are superimposed to obtain a heterogeneous graph structure of text features. Through the heterogeneous graph structure and the text feature matrix, an abstract extraction result is obtained. This method can obtain graph structures with different features, construct a heterogeneous graph structure with multi-feature fusion through graph structures with different features, and further fuse the text feature matrix of sentence position information to realize text abstract extraction. The specific process considers different text features, can be applied to texts with complex structures, and has good scalability, thereby improving the accuracy of abstract extraction.

[0069] As one of the embodiments, as Figure 2 shown, the step of obtaining the text feature matrix of sentence position information from the text to be extracted in S100 above can specifically include:

[0070] S110. Obtain the text to be extracted.

[0071] The above text to be extracted can be various texts in different fields, or news, articles, papers, etc., such as legal-related texts, medical-related texts, mechanical-related texts, communication-related texts, computer-related texts, etc. This embodiment does not make any limitations in this regard.

[0072] S120. Encode the text to be extracted to obtain the original sentence vectors corresponding to each sentence in the text to be extracted.

[0073] In this embodiment, the computer device can encode each sentence in the text to be extracted based on the sentence encoder of the neural network model to obtain a sentence encoding, that is, the original sentence vectors corresponding to each sentence in the text to be extracted. The elements in the original sentence vectors can include the encoding vectors of each character in a sentence. Optionally, the neural network model can be a convolutional neural network model, a long short-term memory network model, etc.

[0074] S130. Obtain the total number of original sentences corresponding to all the original sentence vectors.

[0075] Among them, the total number of original sentence vectors can also be referred to as the total number of original sentences, which can be greater than, equal to, or less than the total number of all sentences in the text to be extracted.

[0076] S140. Obtain the sentence vector to be processed based on the total number of original sentences, the preset sentence quantity threshold, and the original sentence vectors.

[0077] Specifically, the computer device can compare the total number of original sentences with the preset sentence quantity threshold, and obtain the sentence vector to be processed according to the comparison result and the original sentence vectors, and further process the sentence vector to be processed to achieve abstract extraction. The preset sentence quantity threshold can be set customarily.

[0078] Among them, the step of obtaining the sentence vector to be processed based on the total number of original sentences, the preset sentence quantity threshold, and the original sentence vectors in the above S140 may specifically include: if the total number of original sentences is greater than or equal to the preset sentence quantity threshold, obtain the preset sentence quantity threshold of original sentence vectors from the original sentence vectors as the sentence vector to be processed; if the total number of original sentences is less than the preset sentence quantity threshold, perform padding processing on the original sentence vectors to obtain the sentence vector to be processed, and the number of sentences in the sentence vector to be processed is equal to the preset sentence quantity threshold.

[0079] If the computer device determines that the total number of original sentences is greater than or equal to the preset sentence quantity threshold, it can indicate that the total number of sentences in the text to be extracted is greater than or equal to the preset sentence quantity threshold. In this case, the computer device can extract the first preset sentence quantity threshold of original sentence vectors in the text to be extracted according to the position order of each sentence in the text to be extracted, and use the extracted original sentence vectors as the vectors to be processed. The original sentence vectors can carry the position information of the corresponding sentences in the text to be extracted in the text.

[0080] If the computer device determines that the total number of original sentences is less than the preset sentence quantity threshold, it can indicate that the total number of sentences in the text to be extracted is less than the preset sentence quantity threshold. In this case, the computer device can perform padding processing after all the original sentence vectors, and use the padded sentence vectors as the sentence vectors to be processed. The content for padding can be the padding vectors obtained by encoding special symbols, and the special symbols can be unk, null, etc., and there is no limitation on this.

[0081] In this embodiment, according to the comparison result of the total number of original sentence vectors and the preset sentence quantity threshold, the sentence vector to be processed is further obtained through the original sentence vectors. Whether the number of sentences in the text to be extracted is more or less, the abstract extraction can be realized by a unified method, thereby improving the generality of the method.

[0082] S150. Calculate the text feature matrix based on the sentence vector to be processed and the sentence length corresponding to the sentence vector to be processed.

[0083] Specifically, the length of the sentence corresponding to the sentence vector to be processed can be equal to the number of elements in the sentence vector to be processed. The computer device can calculate the text feature matrix H of the sentence position information based on all the sentence vectors to be processed and the lengths of the sentences corresponding to all the sentence vectors to be processed. This calculation method can be arithmetic operations, dimension conversion, matrix splicing, matrix operations, etc., and can also be a combined operation of these operations.

[0084] In this embodiment, the sentence vector to be processed can be represented by H'. If the text to be extracted passes through a convolutional neural network model, the encoded sentence vector to be processed H' = Cnn(x 1 , x 2 , …, x m ), where m is the sentence length. Assuming that the total number of sentences in the sentence vector to be processed is equal to n, the identity matrix v pos = eye(n) can be further obtained. Then, the sentence vector to be processed H' and the identity matrix are spliced to obtain the text feature matrix H of the sentence position information, that is, H = cat(H', v pos ), and H ∈ R n×(p+n) , where p represents the dimension of the sentence vector to be processed output by the convolutional neural network model. Among them, in this embodiment, the last dimension of the sentence vector to be processed H' and the identity matrix can be spliced.

[0085] The above abstract extraction method can obtain the text feature matrix of the sentence position information from the text to be extracted, and then fuse the obtained heterogeneous graph structure with the text feature matrix of the sentence position information to achieve the abstract extraction result. This method can consider different text features in the text, can be applied to texts with complex structures, and has good scalability, further improving the accuracy of abstract extraction.

[0086] As one of the embodiments, as Figure 3 shown, the steps of obtaining the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure from the text to be extracted in S100 above can be implemented through the following steps:

[0087] S160. Determine the number of co-occurring keywords in each pair of sentences, the number of co-occurring words in each pair of sentences, the total number of keywords in the text to be extracted, the length of each sentence in the text to be extracted, and the position of the sentence in the text to be extracted from the text to be extracted.

[0088] Specifically, the computer device can, based on the text to be extracted, count the number of co-occurring keywords in pairs of sentences in the text to be extracted, the number of co-occurring words in pairs of sentences, the total number of keywords in the text to be extracted, the length of each sentence in the text to be extracted, and the position of the sentence in the text to be extracted. In this embodiment, the computer device can also obtain the number of text features, the number of key text features, etc. through the text to be extracted.

[0089] S170. Construct a text keyword graph structure based on the number of co-occurring keywords in pairs of sentences and the total number of keywords in the text to be extracted.

[0090] Specifically, the computer device can perform arithmetic processing on the number of co-occurring keywords K sumi,j in pairs of sentences and the total number of keywords k in the text to be extracted to construct the text keyword graph structure A k of the text to be extracted. The method of arithmetic processing can be any one or a combination of multiple arithmetic operations. However, in this embodiment, the constructed text keyword graph structure A k The specific method can be expressed as:

[0091] where k i,j = K sumi,j / k(2);

[0092] In the formula, K sumi,j represents the number of co-occurring keywords in sentences i and j in the text to be extracted. The first threshold can be 0.4. Of course, it can also be other values, which can be specifically set according to actual needs.

[0093] S180. Construct a text sentence similarity graph structure based on the number of co-occurring words in pairs of sentences and the length of each sentence in the text to be extracted.

[0094] Specifically, the computer device can perform arithmetic processing on the number of co-occurring words c i,j in pairs of sentences and the length l of each sentence in the text to be extracted to construct the text sentence similarity graph structure A s of the text to be extracted. In this embodiment, the constructed text sentence similarity graph structure A s The specific method can be expressed as:

[0095] where s i,j = c i,j / l j (3);

[0096] In the formula, c i,j represents the number of co-occurring words in sentences i and j in the text to be extracted, and l jDenote the length of sentence j. The second threshold can be 0.35. Of course, it can also be other values, which can be specifically set according to actual requirements.

[0097] S190. Construct a text sentence order graph structure based on the positions of sentences in the text to be extracted.

[0098] Specifically, the computer device can construct a text sentence order graph structure A based on the positions of sentences in the text to be extracted. o In this embodiment, the constructed text sentence order graph structure A o The specific method can be expressed as:

[0099]

[0100] In the formula, i and j represent the positions of sentences in the text to be extracted. The third threshold can be 1. Of course, it can also be other values, which can be specifically set according to actual requirements.

[0101] The above abstract extraction method can obtain a text feature matrix of a text keyword graph structure, a text sentence similarity graph structure, a text sentence order graph structure, and sentence position information from the text to be extracted. Further, by superimposing the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure, a heterogeneous graph structure of text features is obtained. This method considers a multi-feature fusion method to obtain a heterogeneous graph structure, so that the abstract extraction method can be applied to texts with complex structures and improve the accuracy of abstract extraction.

[0102] As one of the embodiments, as Figure 4 shown, the step of obtaining the abstract extraction result through the heterogeneous graph structure and the text feature matrix in the above S300 may include:

[0103] S310. Obtain the adjacency matrix of the multi-channel t-step jump connection through the heterogeneous graph structure.

[0104] Specifically, the computer device can perform conversion processing through the heterogeneous graph structure A to obtain the adjacency matrix A of the multi-channel t-step jump connection. t The conversion processing method can be arithmetic operation processing, exponential operation processing, power operation processing, etc. It can also be a combined operation processing of these operations, which is not limited herein.

[0105] Among them, the step of obtaining the adjacency matrix of the multi-channel t-step jump connection through the heterogeneous graph structure in the above S310 may specifically include: calculating the multi-hop connection adjacency matrix of multiple channels through the heterogeneous graph structure and the weight matrix of different text features in the heterogeneous graph structure; obtaining the adjacency matrix of the multi-channel t-step jump connection through the multi-hop connection adjacency matrix of multiple channels.

[0106] It can be understood that the above heterogeneous graph structure A contains three graph structures with different text features, namely the text keyword graph structure A k , the text sentence similarity graph structure A s and the text sentence order graph structure A o . Therefore, weight matrices for three different text features in the heterogeneous graph structure can be set ( Te represents the types of text features included in the heterogeneous graph structure), and the weight matrix contains the normalized weight matrices for three different text features. The computer device can perform transformation processing through the heterogeneous graph structure A and the weight matrices of different text features in the heterogeneous graph structure to obtain a multi-channel multi-hop connection adjacency matrix and calculate the adjacency matrix A for the multi-channel t-step jump connection through the multi-channel multi-hop connection adjacency matrix . t .

[0107] Among them, the steps of calculating the multi-channel multi-hop connection adjacency matrix through the heterogeneous graph structure and the weight matrices of different text features in the heterogeneous graph structure may specifically include: expanding the weight matrix to obtain an expanded weight matrix; obtaining the multi-channel multi-hop connection adjacency matrix through the heterogeneous graph structure and the expanded weight matrix

[0108] . Further, the computer device can first expand the weight matrices of different text features in the heterogeneous graph structure to obtain an expanded weight matrix, that is, expand the weight matrices of different text features in the heterogeneous graph structure into multi-channel weight matrices, namely . Further, arithmetic operations are performed through the heterogeneous graph structure and the expanded weight matrix to obtain a multi-channel multi-hop connection adjacency matrix . The specific calculation formula can be expressed as:

[0109]

[0110]

[0111] In this embodiment, expanding the weight matrix can expand the low-dimensional weight matrix into a multi-dimensional weight matrix tensor, thereby obtaining a more stable adjacency matrix and better constructing the text graph structure

[0112] . Among them, the steps of obtaining the adjacency matrix for the multi-channel t-step jump connection through the multi-channel multi-hop connection adjacency matrix may specifically include: calculating the adjacency matrix corresponding to each step in the first t steps through the multi-channel multi-hop connection adjacency matrix; multiplying the adjacency matrices corresponding to each step in the first t steps to obtain the adjacency matrix for the multi-channel t-step jump connection

[0113] To obtain a richer adjacency matrix, different matrices can be set at each jump moment. Meanwhile, to highlight the temporal order of multi-hop connections, the adjacency matrices of the previous t time steps (i.e., the adjacency matrices corresponding to each step in the previous t steps ) are multiplied together to obtain the adjacency matrix A of the jump connection at the t-th step t (A t ∈R c×n×n )

[0114]

[0115]

[0116] The above c is the number of channels, and Stack is the stacking operation.

[0117] S320. Obtain the text sentence feature matrix at the t-th step through the text feature matrix.

[0118] Specifically, the computer device can perform arithmetic processing on the text feature matrix H of the sentence position information to obtain the text sentence feature matrix H (t) at the t-th step. The specific calculation process can be expressed by the formula:

[0119]

[0120]

[0121]

[0122]

[0123] where || represents the concatenation operation, and M s represents the feature space transformation matrix, which is a trainable parameter matrix and is obtained through initialization. To reduce the algorithm parameters, M at different time steps can be s shared.

[0124] S330. Input the multi-channel adjacency matrix of the t-th step jump connection and the text sentence feature matrix of the t-th step into the graph convolutional neural network to obtain the text sentence representation matrix after aggregation of the t-th step jump connection of the text sentence.

[0125] The computer device can input the multi-channel adjacency matrix A t of the t-th step jump connection and the text sentence feature matrix H (t) of the t-th step into the graph convolutional neural network to obtain the text sentence representation matrix H t。The graph convolutional neural network can perform arithmetic operations, splicing operations, conversion operations, etc. on the input data, and there is no limitation on this. However, in this embodiment, the graph convolutional neural network can specifically perform operations on the adjacency matrix A of the multi-channel t-step jump connection t and the text sentence feature matrix H at the t-th step (t) The processing process is as follows:

[0126]

[0127]

[0128] Among them, represents the degree matrix of, and W represents the trainable transformation matrix.

[0129] S340. Input the text sentence representation matrix at the last time step into the classifier to obtain the abstract extraction result.

[0130] Specifically, through the text sentence feature matrix H at the t-th step (t) , the text sentence representation matrix H at the last time step can be obtained Z . Furthermore, input the text sentence representation matrix H at the last time step Z into the classifier, and the abstract extraction result y~ can be obtained. The classifier can be a multi-classifier. In this embodiment, the classifier can be a binary classifier, which can be used to extract the vector corresponding to the abstract in the text to be extracted and filter out the vector corresponding to the non-abstract.

[0131] Furthermore, the computer device can first input the text sentence representation matrix H at the last time step Z into the multi-layer perceptron, and then input the output result X into the binary classifier to output the abstract extraction result

[0132] X = MLP(H Z ) (15);

[0133]

[0134] Among them, MLP represents the multi-layer perceptron, and softmax represents the binary classifier. When training the binary classifier, it can be optimized and trained through the cross-entropy loss function , that is y represents the standard abstract extracted manually, and N represents the number of samples.

[0135] The above abstract extraction method can fuse the heterogeneous graph structure with multi-features and the text sentence matrix based on sentence position information to achieve text abstract extraction. By adding cross-feature difference aggregation with semantic enhancement, it has a better effect than extracting text abstracts solely through the heterogeneous graph structure, can effectively improve the accuracy of abstract extraction, is applicable to texts with complex structures, and the algorithm has good scalability.

[0136] For the convenience of those skilled in the art, specifically, as Figure 5 shown, the method includes:

[0137] (1) Obtain the text to be extracted;

[0138] (2) Encode the text to be extracted to obtain the original sentence vectors corresponding to each sentence in the text to be extracted;

[0139] (3) Obtain the total number of original sentences corresponding to all the original sentence vectors;

[0140] (4) If the total number of the original sentences is greater than or equal to the preset sentence number threshold, obtain the preset sentence number threshold of original sentence vectors from the original sentence vectors as the sentence vectors to be processed; otherwise, perform padding processing on the original sentence vectors to obtain the sentence vectors to be processed, and the number of sentences in the sentence vectors to be processed is equal to the preset sentence number threshold;

[0141] (5) Calculate the text feature matrix through the sentence vectors to be processed and the sentence lengths corresponding to the sentence vectors to be processed;

[0142] (6) Determine the number of co-occurring keywords in each pair of sentences, the number of co-occurring words in each pair of sentences, the total number of keywords in the text to be extracted, the length of each sentence in the text to be extracted, and the position of the sentence in the text to be extracted through the text to be extracted;

[0143] (7) Construct the text keyword graph structure through the number of co-occurring keywords in each pair of sentences and the total number of keywords in the text to be extracted;

[0144] (8) Construct the text sentence similarity graph structure through the number of co-occurring words in each pair of sentences and the length of each sentence in the text to be extracted;

[0145] (9) Construct the text sentence order graph structure through the position of the sentence in the text to be extracted;

[0146] (10) Superimpose the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain the heterogeneous graph structure of text features;

[0147] (11) Expand the weight matrix of different text features in the heterogeneous graph structure to obtain an expanded weight matrix;

[0148] (12) Obtain the multi-channel multi-hop connection adjacency matrix through the heterogeneous graph structure and the expanded weight matrix;

[0149] (13) Calculate the adjacency matrix corresponding to each step in the first t steps through the multi-channel multi-hop connection adjacency matrix;

[0150] (14) Multiply the adjacency matrices corresponding to each step in the first t steps to obtain the adjacency matrix of the multi-channel t-step jump connection;

[0151] (15) Obtain the text sentence feature matrix of the t-th step through the text feature matrix;

[0152] (16) Input the adjacency matrix of the multi-channel t-step jump connection and the text sentence feature matrix of the t-th step into a graph convolutional neural network to obtain the text sentence representation matrix aggregated by the t-step jump connection of the text sentence;

[0153] (17) Input the text sentence representation matrix of the last time step into a classifier to obtain the abstract extraction result.

[0154] The execution processes of the above (1) to (17) can specifically refer to the descriptions of the above embodiments, and their implementation principles and technical effects are similar, so they will not be elaborated here.

[0155] It should be understood that although Figures 1-4 the steps in the flowchart are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figures 1-4 at least a part of the steps in

[0156] In one embodiment, as Figure 5 shown, a kind of abstract extraction device is provided, including: an information acquisition module 11, a superposition module 12, and an abstract extraction module 13, where:

[0157] An information acquisition module 11, configured to obtain a text feature matrix of a text keyword graph structure, a text sentence similarity graph structure, a text sentence order graph structure, and sentence position information through the text to be extracted;

[0158] An overlay module 12, configured to overlay the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features;

[0159] An abstract extraction module 13, configured to obtain an abstract extraction result through the heterogeneous graph structure and the text feature matrix.

[0160] The abstract extraction device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.

[0161] In one embodiment, the information acquisition module 11 includes: a text acquisition unit, an encoding unit, a sentence number acquisition unit, a processing unit, and a calculation unit, where:

[0162] The text acquisition unit is configured to acquire the text to be extracted;

[0163] The encoding unit is configured to encode the text to be extracted to obtain original sentence vectors corresponding to each sentence in the text to be extracted;

[0164] The sentence number acquisition unit is configured to acquire the total number of original sentences corresponding to all the original sentence vectors;

[0165] The processing unit is configured to obtain processed sentence vectors through the total number of original sentences, a preset sentence number threshold, and the original sentence vectors;

[0166] The calculation unit is configured to calculate the text feature matrix through the processed sentence vectors and the sentence lengths corresponding to the processed sentence vectors.

[0167] The abstract extraction device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.

[0168] In one embodiment, the processing unit includes a first processing subunit and a second processing subunit, where:

[0169] The first processing subunit is configured to, when the total number of original sentences is greater than or equal to the preset sentence number threshold, acquire a preset number of original sentence vectors from the original sentence vectors as the processed sentence vectors;

[0170] The second processing subunit is configured to, when the total number of original sentences is less than the preset sentence number threshold, perform padding processing on the original sentence vectors to obtain processed sentence vectors, and the number of sentences in the processed sentence vectors is equal to the preset sentence number threshold.

[0171] The abstract extraction device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.

[0172] In one embodiment, the information acquisition module 11 further includes: an information determination unit, a first graph structure construction unit, a second graph structure construction unit, and a third graph structure construction unit, where:

[0173] The information determination unit is configured to determine, from the text to be extracted, the number of co-occurring keywords in pairs of sentences, the number of co-occurring words in pairs of sentences, the total number of keywords in the text to be extracted, the length of each sentence in the text to be extracted, and the position of the sentence in the text to be extracted;

[0174] The first graph structure construction unit is configured to construct a text keyword graph structure based on the number of co-occurring keywords in pairs of sentences and the total number of keywords in the text to be extracted;

[0175] The second graph structure construction unit is configured to construct a text sentence similarity graph structure based on the number of co-occurring words in pairs of sentences and the length of each sentence in the text to be extracted;

[0176] The third graph structure construction unit is configured to construct a text sentence order graph structure based on the position of the sentence in the text to be extracted.

[0177] The abstract extraction device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.

[0178] In one embodiment, the abstract extraction module 13 includes: a first acquisition unit, a second acquisition unit, a third acquisition unit, and a classification unit, where:

[0179] The first acquisition unit is configured to obtain the adjacency matrix of the multi-channel t-step jump connection through the heterogeneous graph structure;

[0180] The second acquisition unit is configured to obtain the text sentence feature matrix at the t-th step through the text feature matrix;

[0181] The third acquisition unit is configured to input the adjacency matrix of the multi-channel t-step jump connection and the text sentence feature matrix at the t-th step into a graph convolutional neural network to obtain the text sentence representation matrix aggregated by the t-step jump connection of the text sentence;

[0182] The classification unit is configured to input the text sentence representation matrix at the last time step into a classifier to obtain the abstract extraction result.

[0183] The abstract extraction device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.

[0184] In one embodiment, the first acquisition unit includes a first calculation subunit and a second calculation subunit, where:

[0185] The first calculation subunit is configured to calculate a multi-channel multi-hop connection adjacency matrix through a heterogeneous graph structure and a weight matrix of different text features in the heterogeneous graph structure;

[0186] The second calculation subunit is configured to obtain an adjacency matrix of the multi-channel t-step jump connection through the multi-channel multi-hop connection adjacency matrix.

[0187] The abstract extraction device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.

[0188] In one embodiment, the first calculation subunit is specifically configured to expand the weight matrix to obtain an expanded weight matrix, and obtain a multi-channel multi-hop connection adjacency matrix through the heterogeneous graph structure and the expanded weight matrix.

[0189] The abstract extraction device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.

[0190] In one embodiment, the second calculation subunit is specifically configured to calculate the adjacency matrix corresponding to each step in the first t steps through the multi-channel multi-hop connection adjacency matrix, and multiply the adjacency matrices corresponding to each step in the first t steps to obtain an adjacency matrix of the multi-channel t-step jump connection.

[0191] The abstract extraction device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.

[0192] For the specific limitations of the abstract extraction device, reference can be made to the limitations on the abstract extraction method in the above text, which will not be elaborated here. Each module in the above abstract extraction device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0193] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 6As shown in the figure. The computer device includes a processor, a memory, and a network interface connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the text to be extracted. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a method for abstract extraction.

[0194] Those skilled in the art can understand that Figure 6 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0195] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:

[0196] Obtain a text feature matrix of a text keyword graph structure, a text sentence similarity graph structure, a text sentence order graph structure, and sentence position information through the text to be extracted;

[0197] Overlay the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features;

[0198] Obtain an abstract extraction result through the heterogeneous graph structure and the text feature matrix.

[0199] In one embodiment, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the following steps are implemented:

[0200] Obtain a text feature matrix of a text keyword graph structure, a text sentence similarity graph structure, a text sentence order graph structure, and sentence position information through the text to be extracted;

[0201] Overlay the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features;

[0202] Obtain an abstract extraction result through the heterogeneous graph structure and the text feature matrix.

[0203] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above various methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0204] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0205] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. A method for abstract extraction, characterized in that, the method includes: obtaining a text feature matrix of text keyword graph structure, text sentence similarity graph structure, text sentence order graph structure and sentence position information from the text to be extracted; superimposing the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features; obtaining an abstract extraction result through the heterogeneous graph structure and the text feature matrix; the obtaining a text feature matrix of sentence position information from the text to be extracted includes: obtaining the text to be extracted; encoding the text to be extracted to obtain original sentence vectors corresponding to each sentence in the text to be extracted; the original sentence vectors carry position information of the corresponding sentences in the text to be extracted; obtaining the total number of original sentences corresponding to all the original sentence vectors; obtaining processed sentence vectors through the total number of original sentences, a preset sentence number threshold, and the original sentence vectors; Calculate the text feature matrix based on the sentence vector to be processed and the sentence length corresponding to the sentence vector to be processed; the calculating the text feature matrix based on the sentence vector to be processed and the sentence length corresponding to the sentence vector to be processed includes: concatenating the sentence vector to be processed and the identity matrix to obtain a text feature matrix of sentence position information, and the total number of sentences of the sentence vector to be processed is equal to n , the identity matrix v pos = eye ( n ); the obtaining an abstract extraction result through the heterogeneous graph structure and the text feature matrix includes: obtaining an adjacency matrix of the multi-channel t-step jump connection through the heterogeneous graph structure; obtaining the text sentence feature matrix of the t-th step through the text feature matrix; inputting the adjacency matrix of the multi-channel t-step jump connection and the text sentence feature matrix of the t-th step into a graph convolutional neural network to obtain a text sentence representation matrix after aggregation of the t-step jump connection of the text sentence; inputting the text sentence representation matrix of the last time step into a classifier to obtain the abstract extraction result.

2. The method according to claim 1, characterized in that, the obtaining processed sentence vectors through the total number of original sentences, a preset sentence number threshold, and the original sentence vectors includes: if the total number of original sentences is greater than or equal to the preset sentence number threshold, obtaining the preset sentence number threshold of original sentence vectors from the original sentence vectors as the processed sentence vectors; if the total number of original sentences is less than the preset sentence number threshold, performing padding processing on the original sentence vectors to obtain the processed sentence vectors, and the number of sentences of the processed sentence vectors is equal to the preset sentence number threshold.

3. The method according to any one of claims 1-2, characterized in that, the obtaining a text keyword graph structure, a text sentence similarity graph structure, and a text sentence order graph structure from the text to be extracted includes: determining the number of co-occurring keywords in pairs of sentences, the number of co-occurring words in pairs of sentences, the total number of keywords in the text to be extracted, the length of each sentence in the text to be extracted, and the position of the sentence in the text to be extracted through the text to be extracted; constructing the text keyword graph structure through the number of co-occurring keywords in pairs of sentences and the total number of keywords in the text to be extracted; constructing the text sentence similarity graph structure through the number of co-occurring words in pairs of sentences and the length of each sentence in the text to be extracted; constructing the text sentence order graph structure through the position of the sentence in the text to be extracted.

4. The method according to claim 1, wherein, the obtaining of the adjacency matrix of the multi-channel t-step jump connection through the heterogeneous graph structure includes: calculating the multi-hop connection adjacency matrix of multiple channels through the heterogeneous graph structure and the weight matrix of different text features in the heterogeneous graph structure; obtaining the adjacency matrix of the multi-channel t-step jump connection through the multi-hop connection adjacency matrix of the multi-channel.

5. The method according to claim 4, wherein, the calculating of the multi-hop connection adjacency matrix of multiple channels through the heterogeneous graph structure and the weight matrix of different text features in the heterogeneous graph structure includes: extending the weight matrix to obtain an extended weight matrix; obtaining the multi-hop connection adjacency matrix of the multi-channel through the heterogeneous graph structure and the extended weight matrix.

6. The method according to claim 4, wherein, the obtaining of the adjacency matrix of the multi-channel t-step jump connection through the multi-hop connection adjacency matrix of the multi-channel includes: calculating the adjacency matrix corresponding to each step in the first t steps through the multi-hop connection adjacency matrix of the multi-channel; multiplying the adjacency matrices corresponding to each step in the first t steps to obtain the adjacency matrix of the multi-channel t-step jump connection.

7. A summary extraction device, wherein, the device includes: an information acquisition module, configured to obtain a text feature matrix of a text keyword graph structure, a text sentence similarity graph structure, a text sentence order graph structure, and sentence position information through the text to be extracted; a superposition module, configured to superpose the text keyword graph structure, the text sentence similarity graph structure, and the text sentence order graph structure to obtain a heterogeneous graph structure of text features; a summary extraction module, configured to obtain a summary extraction result through the heterogeneous graph structure and the text feature matrix; the information acquisition module is further configured to: obtain the text to be extracted; encode the text to be extracted to obtain an original sentence vector corresponding to each sentence in the text to be extracted; the original sentence vector carries the position information of the corresponding sentence in the text to be extracted; obtain the total number of original sentences corresponding to all the original sentence vectors; obtain a sentence vector to be processed through the total number of original sentences, a preset sentence number threshold, and the original sentence vector; calculate the text feature matrix through the sentence vector to be processed and the sentence length corresponding to the sentence vector to be processed; The information acquisition module is further configured to: splice the to-be-processed sentence vector and the identity matrix to obtain a text feature matrix of sentence position information, and the total number of sentences of the to-be-processed sentence vector is equal to n , the identity matrix v pos = eye ( n ); the summary extraction module includes: a first acquisition unit, a second acquisition unit, a third acquisition unit, and a classification unit, where: The first acquisition unit is configured to obtain the adjacency matrix of the multi-channel t-step jump connection through the heterogeneous graph structure; the second acquisition unit is configured to obtain the text sentence feature matrix of the t-th step through the text feature matrix; the third acquisition unit is configured to input the adjacency matrix of the multi-channel t-step jump connection and the text sentence feature matrix of the t-th step into a graph convolutional neural network to obtain the text sentence representation matrix after aggregation of the t-step jump connection of the text sentence; the classification unit is configured to input the text sentence representation matrix of the last time step into a classifier to obtain the abstract extraction result.

8. A computer device, comprising a memory and a processor, the memory storing a computer program, wherein, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A readable storage medium, having stored thereon a computer program, wherein, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Text summarization method and device based on heterogeneous graph, storage medium and terminal

    CN113127632A