Text abstract generation method and device, computer equipment and storage medium

By using graph neural network and Transformer model in text summary generation, combined with dynamic graph attention mechanism, the text knowledge graph is constructed, and the problem of low accuracy in traditional methods when dealing with complex texts is solved, achieving more efficient semantic understanding and summary generate.

CN119474358APending Publication Date: 2025-02-18PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411415682.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Traditional text summary methods cannot effectively capture deep semantic relationships across sentences or paragraphs when dealing with long documents, dense professional terminology and complex structures, resulting in low accuracy of generated summary.

Method used

The text summary generation method of graph neural network combined with Transformer model is adopted to optimize the information processing process and efficiently process and understand the key information and their relationships in the text by constructing text knowledge graphs and introducing dynamic graph attention mechanisms.

Benefits of technology

Improve the accuracy and relevance of text summary, and can more effectively capture deep semantic relationships in complex texts and generate coherent and informative summary.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474358A_ABST
    Figure CN119474358A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of natural language processing, and relates to a text abstract generation method and device, computer equipment and a storage medium, the method comprises the following steps: receiving a text abstract generation request carrying an original text sent by a user terminal; performing preprocessing operation on the original text to obtain an original text entity; constructing an original text knowledge graph according to the original text entity; performing vector conversion operation on the original text and the original text knowledge graph according to a graph neural network to obtain an original text feature vector; and performing abstract generation operation on the original text feature vector according to a decoder of a transform model to obtain a target text abstract. The dynamic graph attention mechanism is introduced to serve as an Encoder module of the generation system, and the information processing flow of the complex document is optimized. Key information in a text and a mutual relation of the key information are efficiently processed and understood, and the processed semantic information is converted into a coherent and information-rich text abstract through a Decoder module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a text summary generation method, apparatus, computer equipment and storage medium. Background Art

[0002] In the current field of text summarization, mainstream methods include rule-based extractive summarization and neural network-based generative summarization.

[0003] However, the applicants found that although these methods perform well in processing standard datasets and short text summarization tasks, they often fail to effectively capture deep semantic relationships across sentences or paragraphs when faced with long documents, jargon-intensive, and complexly structured texts, resulting in the problem of low accuracy in the summary texts generated by traditional text summarization methods. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a text summary generation method, apparatus, computer device and storage medium to solve the problem of low accuracy of summary text generated by traditional text summarization methods.

[0005] In order to solve the above technical problems, the present application embodiment provides a text summary generation method, which adopts the following technical solution:

[0006] Receiving a text summary generation request carrying original text sent by a user terminal;

[0007] Performing a preprocessing operation on the original text to obtain an original text entity;

[0008] Constructing an original text knowledge graph according to the original text entities;

[0009] Performing a vector conversion operation on the original text and the original text knowledge graph according to a graph neural network to obtain an original text feature vector;

[0010] A summary generation operation is performed on the original text feature vector according to the decoder of the transformer model to obtain a target text summary.

[0011] Furthermore, the step of performing a preprocessing operation on the original text to obtain the original text entity specifically includes the following steps:

[0012] Perform word segmentation operation on the original text according to the BERT model to obtain a word segmentation sequence;

[0013] An entity recognition operation is performed on the word segmentation sequence according to the GlobalPointer model to obtain the original text entity.

[0014] Furthermore, the step of constructing the original text knowledge graph according to the original text entity specifically includes the following steps:

[0015] Extracting graph entities and graph relationship information matching the original text entities in the knowledge graph;

[0016] An enhanced knowledge graph is constructed according to the graph entities and the graph relationship information to obtain the original text knowledge graph.

[0017] Furthermore, the step of performing a vector conversion operation on the original text and the original text knowledge graph according to the graph neural network to obtain the original text feature vector specifically includes the following steps:

[0018] Calculate the attention score of each node of the original text in the original text knowledge graph according to the graph attention mechanism;

[0019] Performing a state update operation on the nodes of the original text according to the attention score to obtain an updated state of each node;

[0020] The updated states are added together and added to the summary vector of the original text obtained by the preprocessing to obtain the original text feature vector.

[0021] Furthermore, the attention score e′ i It is expressed as:

[0022]

[0023] Among them, α ij represents the attention score, Represents the shared initial weight matrix of the relationship, e j An entity representing a neighboring node.

[0024] Furthermore, the attention score α ij It is expressed as:

[0025]

[0026] in, For the relationship ij The shared initial weight matrix is ​​gradually updated during the training process; the symbol || represents the concatenation of vectors, and the operation a∈R 2d is the attention mechanism parameter learned by the model, which is used to evaluate the importance of the two node representations. i Use the same a.

[0027] In order to solve the above technical problems, the present application also provides a text summary generation device, which adopts the following technical solution:

[0028] A request acquisition module, used to receive a text summary generation request carrying original text sent by a user terminal;

[0029] A preprocessing module, used for performing a preprocessing operation on the original text to obtain an original text entity;

[0030] A knowledge graph construction module, used to construct an original text knowledge graph according to the original text entity;

[0031] A vector conversion module, used to perform a vector conversion operation on the original text and the original text knowledge graph according to a graph neural network to obtain an original text feature vector;

[0032] The summary generation module is used to perform a summary generation operation on the original text feature vector according to the decoder of the transformer model to obtain a target text summary.

[0033] Furthermore, the preprocessing module includes:

[0034] A word segmentation submodule is used to perform word segmentation operation on the original text according to the BERT model to obtain a word segmentation sequence;

[0035] The entity recognition submodule is used to perform entity recognition operation on the word segmentation sequence according to the GlobalPointer model to obtain the original text entity.

[0036] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0037] The invention comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the text summary generation method as described above when executing the computer-readable instructions.

[0038] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0039] The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the text summary generation method described above are implemented.

[0040] The present application provides a text summary generation method, including: receiving a text summary generation request carrying original text sent by a user terminal; performing a preprocessing operation on the original text to obtain an original text entity; constructing an original text knowledge graph based on the original text entity; performing a vector conversion operation on the original text and the original text knowledge graph according to a graph neural network to obtain an original text feature vector; performing a summary generation operation on the original text feature vector according to a decoder of a transformer model to obtain a target text summary. Compared with the prior art, the present application introduces a dynamic graph attention mechanism as the Encoder module of the generation system, which optimizes the information processing flow of complex documents. Efficiently process and understand the key information in the text and its interrelationships, and convert these processed semantic information into a coherent and information-rich text summary through the Decoder module. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0043] Figure 2 It is a flowchart of the implementation of the text summary generation method provided in the embodiment of the present application;

[0044] Figure 3 It is a structural schematic diagram of a text summary generating device provided in an embodiment of the present application;

[0045] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0047] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0048] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0049] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0050] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0051] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0052] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0053] It should be noted that the text summary generation method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the text summary generation device is generally arranged in the server / terminal device.

[0054] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0055] Continue to refer Figure 2 , shows a flow chart of an embodiment of a text summary generation method according to the present application. The text summary generation method comprises: step S201, step S202, step S203, step S204 and step S205.

[0056] In step S201, a text summary generation request carrying original text sent by a user terminal is received.

[0057] In the embodiments of the present application, the user terminal refers to a terminal device used to execute the image processing method for preventing document abuse provided by the present application. The user terminal can be a mobile terminal such as a mobile phone, a smart phone, a laptop computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc., as well as a fixed terminal such as a digital TV, a desktop computer, etc. It should be understood that the examples of user terminals here are only for the convenience of understanding and are not used to limit the present application.

[0058] In step S202, a preprocessing operation is performed on the original text to obtain original text entities.

[0059] In an embodiment of the present application, the preprocessing operation may be to perform a word segmentation operation on the original text according to the BERT model to obtain a word segmentation sequence; and to perform an entity recognition operation on the word segmentation sequence according to the GlobalPointer model to obtain the original text entity.

[0060] In step S203, an original text knowledge graph is constructed based on the original text entities.

[0061] In an embodiment of the present application, the knowledge graph integration includes a knowledge graph query operation and a knowledge graph representation operation. Specifically, the attention score of each node of the original text in the original text knowledge graph is calculated according to the graph attention mechanism; the state of the nodes of the original text is updated according to the attention score to obtain the updated state of each node; the updated state is added and added to the summary vector of the original text obtained by preprocessing to obtain the original text feature vector.

[0062] In step S204, a vector conversion operation is performed on the original text and the original text knowledge graph according to the graph neural network to obtain the original text feature vector.

[0063] In an embodiment of the present application, the vector conversion operation can be to calculate the attention scores of the nodes of each original text in the original text knowledge graph according to the graph attention mechanism; perform a state update operation on the nodes of the original text according to the attention scores to obtain the updated states of each node; add the updated states and add them to the summary vector of the original text obtained by preprocessing to obtain the original text feature vector.

[0064] In step S205, a summary generation operation is performed on the original text feature vector according to the decoder of the transformer model to obtain a target text summary.

[0065] In the embodiment of the present application, the decoder module uses the Decoder module in the transformer, inputs the generated results in sequence, and generates a summary.

[0066] In the embodiment of the present application, a graph neural network is used as the Encoder module of the generative model. As an encoder, the graph neural network can effectively process and fuse text data with structured information in the knowledge graph, and then use the Decoder in the transformer as a decoder module to generate summaries using these rich semantic representations. This combination takes advantage of the graph neural network's advantages in processing complex relational data and the Transformer's Decoder module's high efficiency in sequence generation.

[0067] In the embodiment of the present application, a graph attention mechanism is introduced into the graph neural network to optimize the information flow and semantic relationship learning between nodes. This mechanism enables the model to evaluate the contribution of each node (including entities and words) more carefully and dynamically, thereby generating more accurate and relevant content.

[0068] In some optional implementations of the embodiments of the present application, a new training strategy can be adopted, that is, in the early stage of training, disturbance terms are added to the real entity and relationship data vectors input to the graph neural network with a certain probability to enhance the robustness of the model to noise. As the training progresses, the probability and size of the addition of the disturbance terms are gradually reduced until it is 0, so that it can more accurately learn the ability to extract and process features from real data.

[0069] In an embodiment of the present application, a text summary generation method is provided, including: receiving a text summary generation request carrying original text sent by a user terminal; performing a preprocessing operation on the original text to obtain original text entities; constructing an original text knowledge graph based on the original text entities; performing a vector conversion operation on the original text and the original text knowledge graph according to a graph neural network to obtain an original text feature vector; performing a summary generation operation on the original text feature vector according to a decoder of a transformer model to obtain a target text summary. Compared with the prior art, the present application introduces a dynamic graph attention mechanism as the Encoder module of the generation system, which optimizes the information processing flow of complex documents. Efficiently process and understand the key information in the text and its interrelationships, and convert these processed semantic information into a coherent and information-rich text summary through the Decoder module.

[0070] In some optional implementations of the embodiments of the present application, the above step of performing a preprocessing operation on the original text to obtain the original text entity specifically includes the following steps:

[0071] Perform word segmentation on the original text according to the BERT model to obtain a word segmentation sequence;

[0072] According to the GlobalPointer model, entity recognition is performed on the word segmentation sequence to obtain the original text entity.

[0073] In the embodiment of the present application, text preprocessing includes word embedding and entity recognition, wherein:

[0074] ① Word embedding: This application embeds the original text T∈R n n is the length of the word sequence. The BERT model is used to perform word segmentation and word embedding, mapping each word to a vector space of fixed length to obtain the word sequence X after segmentation.

[0075] X, Y CLS =Embed(T)

[0076] Here X∈R n×d n is the sequence length, d is the word vector embedding dimension, Y CLS ∈R 1×d This is the summary vector of the passage output by the BERT model.

[0077] ② Entity recognition: Based on the word embedding of BERT, the GlobalPointer model is applied to identify the key entities in the text, that is, to find the start and end positions of the entity through the pointer mechanism.

[0078] E = GlobalPointer_Entity(X)

[0079] Here the input X∈Rn×d is the output of the above BERT, output E∈R n×n It is an upper triangular matrix, each row position represents the end position of the entity, and the rest of the positions in each row are 0.

[0080] In some optional implementations of the embodiments of the present application, the above step of constructing the original text knowledge graph according to the original text entities specifically includes the following steps:

[0081] Extract graph entities and graph relationship information that match the original text entities in the knowledge graph;

[0082] An enhanced knowledge graph is constructed based on graph entities and graph relationship information to obtain the original text knowledge graph.

[0083] In the embodiment of the present application, the knowledge graph integration includes a knowledge graph query operation and a knowledge graph representation operation, specifically:

[0084] ① Knowledge graph query:

[0085] Link the identified entities with entities in the knowledge graph, and extract relevant entity and relationship information from the knowledge graph based on the linked entities. The knowledge graph used in this application is the open source Wikidata.

[0086] KG sub =query(KG,E)

[0087] Among them, KG represents the entire knowledge graph, E represents the set of entities that have been identified and linked, and KG sub is a subgraph consisting of these entities and their relationships.

[0088] ②Knowledge graph representation:

[0089] The extracted entity and relationship information is integrated to construct an enhanced knowledge graph representation, that is, to convert the subgraph information obtained by the query into a structured representation that can be processed:

[0090] Triplet={(e i ,r ij ,e j )|e i ,e j ∈E,r ij ∈R}

[0091] Here, e i and e j is an entity, r ij Yes Connect i and e j The relationship between , Triplet represents the set of triples.

[0092] In some optional implementations of the embodiments of the present application, the above-mentioned step of performing a vector conversion operation on the original text and the original text knowledge graph according to the graph neural network to obtain the original text feature vector specifically includes the following steps:

[0093] Calculate the attention scores of the nodes of each original text in the original text knowledge graph according to the graph attention mechanism;

[0094] Perform status update operations on the nodes of the original text according to the attention scores to obtain the updated status of each node;

[0095] The updated states are added together and added to the summary vector of the original text obtained by preprocessing to obtain the original text feature vector.

[0096] In the embodiment of the present application, the graph neural network mainly integrates text and knowledge graph information into a graph, and uses the graph model to learn the semantic relationship between nodes.

[0097] G = build_graph(X,Triplet)

[0098] The input here is the text word vector X and the entity relationship structured triplet Triplet.

[0099] In the embodiment of the present application, the vector conversion operation includes an attention score calculation operation, a node representation update operation, and an Encoder vector generation operation, specifically:

[0100] ①Graph Attention Module:

[0101] In the graph, this application introduces a graph attention mechanism to optimize the information flow and semantic relationships between nodes.

[0102] Attention score calculation:

[0103] For node i and each of its neighbors j, we calculate an attention score α ij , this score reflects the relationship between neighbor node j and r ij The importance of node i.

[0104]

[0105] here For the relationship ij The shared initial weight matrix is ​​gradually updated during the training process; the symbol || represents the concatenation of vectors, and the operation a∈R 2d is the attention mechanism parameter learned by the model, which is used to evaluate the importance of two node representations. i Use the same a.

[0106] ② Update of node representation

[0107] The new state e′ of node i i It is calculated by integrating the weighted representations of all neighbor nodes.

[0108]

[0109] σ is the ReLU activation function.

[0110] ③Encoder vector generation

[0111] In this text, e′ i After addition, it is the Y output by the above bert model CLS ∈R 1×d Add together to get the summarized vector G∈R 1×d .

[0112] In some optional implementations of the embodiments of the present application, in the early stages of training, in order to reduce the encoder's reliance on perfect input data (such as ideal representations of nodes and edges), the present application can be implemented by adding perturbations to the real entity and relationship data vectors input to the graph neural network with a certain probability, thereby enhancing the model's robustness to input noise. As the training progresses, the probability and size of the addition of the perturbation term are gradually reduced until it is 0, so that it can more accurately learn the ability to extract and process features from real data.

[0113] In summary, this application designs a text summary generation system based on dynamic graph attention encoder-decoder for text summarization tasks. The following technical improvements are achieved:

[0114] ① Introducing a hybrid encoder-decoder architecture: Using a graph neural network as an encoder to effectively process and fuse the structured information of text and knowledge graphs. Combined with the Transformer decoder, this architecture can generate high-quality summaries based on rich semantic representations;

[0115] ②Introducing graph attention mechanism: Introducing graph attention mechanism in graph neural network to optimize the information flow and semantic learning between nodes, improve the precision and dynamics of the model in evaluating the contribution of each node (including entities and words), and generate more accurate and relevant content;

[0116] ③ Dynamic sampling strategy: In the initial training, random perturbations are added to the input real entity and relationship data vectors to enhance the model’s robustness to noise. As the training progresses, the probability and size of the perturbations are gradually reduced to accurately learn feature extraction and processing capabilities.

[0117] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0118] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0119] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0120] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0121] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a text summary generation device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0122] like Figure 3 As shown, the text summary generating device 200 of the embodiment of the present application includes:

[0123] The request acquisition module 210 is used to receive a text summary generation request carrying the original text sent by a user terminal;

[0124] A preprocessing module 220 is used to perform a preprocessing operation on the original text to obtain the original text entity;

[0125] A knowledge graph construction module 230 is used to construct an original text knowledge graph according to original text entities;

[0126] A vector conversion module 240 is used to perform a vector conversion operation on the original text and the original text knowledge graph according to the graph neural network to obtain the original text feature vector;

[0127] The summary generation module 250 is used to perform a summary generation operation on the original text feature vector according to the decoder of the transformer model to obtain a target text summary.

[0128] In the embodiments of the present application, the user terminal refers to a terminal device used to execute the image processing method for preventing document abuse provided by the present application. The user terminal can be a mobile terminal such as a mobile phone, a smart phone, a laptop computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc., as well as a fixed terminal such as a digital TV, a desktop computer, etc. It should be understood that the examples of user terminals here are only for the convenience of understanding and are not used to limit the present application.

[0129] In an embodiment of the present application, the preprocessing operation may be to perform a word segmentation operation on the original text according to the BERT model to obtain a word segmentation sequence; and to perform an entity recognition operation on the word segmentation sequence according to the GlobalPointer model to obtain the original text entity.

[0130] In an embodiment of the present application, the knowledge graph integration includes a knowledge graph query operation and a knowledge graph representation operation. Specifically, the attention score of each node of the original text in the original text knowledge graph is calculated according to the graph attention mechanism; the state of the nodes of the original text is updated according to the attention score to obtain the updated state of each node; the updated state is added and added to the summary vector of the original text obtained by preprocessing to obtain the original text feature vector.

[0131] In an embodiment of the present application, the vector conversion operation can be to calculate the attention scores of the nodes of each original text in the original text knowledge graph according to the graph attention mechanism; perform a state update operation on the nodes of the original text according to the attention scores to obtain the updated states of each node; add the updated states and add them to the summary vector of the original text obtained by preprocessing to obtain the original text feature vector.

[0132] In the embodiment of the present application, the decoder module uses the Decoder module in the transformer, inputs the generated results in sequence, and generates a summary.

[0133] In the embodiment of the present application, a graph neural network is used as the Encoder module of the generative model. As an encoder, the graph neural network can effectively process and fuse text data with structured information in the knowledge graph, and then use the Decoder in the transformer as a decoder module to generate summaries using these rich semantic representations. This combination takes advantage of the graph neural network's advantages in processing complex relational data and the Transformer's Decoder module's high efficiency in sequence generation.

[0134] In the embodiment of the present application, a graph attention mechanism is introduced into the graph neural network to optimize the information flow and semantic relationship learning between nodes. This mechanism enables the model to evaluate the contribution of each node (including entities and words) more carefully and dynamically, thereby generating more accurate and relevant content.

[0135] In an embodiment of the present application, a text summary generation device 200 is provided, including: a request acquisition module 210, for receiving a text summary generation request carrying original text sent by a user terminal; a preprocessing module 220, for performing preprocessing operations on the original text to obtain original text entities; a knowledge graph construction module 230, for constructing an original text knowledge graph based on the original text entities; a vector conversion module 240, for performing vector conversion operations on the original text and the original text knowledge graph according to a graph neural network to obtain an original text feature vector; a summary generation module 250, for performing a summary generation operation on the original text feature vector according to the decoder of the transformer model to obtain a target text summary. Compared with the prior art, the present application introduces a dynamic graph attention mechanism as the Encoder module of the generation system, which optimizes the information processing flow of complex documents. Efficiently process and understand the key information in the text and its interrelationships, and convert these processed semantic information into a coherent and information-rich text summary through the Decoder module.

[0136] In some optional implementations of the embodiments of the present application, the preprocessing module includes:

[0137] The word segmentation submodule is used to perform word segmentation operations on the original text according to the BERT model to obtain a word segmentation sequence;

[0138] The entity recognition submodule is used to perform entity recognition operations on the word segmentation sequence according to the GlobalPointer model to obtain the original text entities.

[0139] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of a computer device according to an embodiment of the present application.

[0140] The computer device 300 includes a memory 310, a processor 320, and a network interface 330 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 300 having components 310-330, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0141] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0142] The memory 310 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 310 can be an internal storage unit of the computer device 300, such as a hard disk or memory of the computer device 300. In other embodiments, the memory 310 can also be an external storage device of the computer device 300, such as a plug-in hard disk equipped on the computer device 300, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Of course, the memory 310 can also include both the internal storage unit of the computer device 300 and its external storage device. In the embodiment of the present application, the memory 310 is generally used to store the operating system and various application software installed on the computer device 300, such as computer-readable instructions of the text summary generation method. In addition, the memory 310 can also be used to temporarily store various data that have been output or are to be output.

[0143] The processor 320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 320 is generally used to control the overall operation of the computer device 300. In the embodiment of the present application, the processor 320 is used to run the computer-readable instructions stored in the memory 310 or process data, such as computer-readable instructions for running the text summary generation method.

[0144] The network interface 330 may include a wireless network interface or a wired network interface. The network interface 330 is generally used to establish a communication connection between the computer device 300 and other electronic devices.

[0145] The computer device provided by this application introduces a dynamic graph attention mechanism as the encoder module of the generation system, which optimizes the information processing flow of complex documents. It efficiently processes and understands the key information in the text and its interrelationships, and converts these processed semantic information into a coherent and information-rich text summary through the decoder module.

[0146] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the text summary generation method as described above.

[0147] The computer-readable storage medium provided by the present application introduces a dynamic graph attention mechanism as the encoder module of the generation system, which optimizes the information processing flow of complex documents. It efficiently processes and understands the key information in the text and their interrelationships, and converts these processed semantic information into a coherent and information-rich text summary through the decoder module.

[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0149] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A text summary generation method, characterized in that: The steps include: Receiving a text summary generation request carrying original text sent by a user terminal; Performing a preprocessing operation on the original text to obtain an original text entity; Constructing an original text knowledge graph according to the original text entities; Performing a vector conversion operation on the original text and the original text knowledge graph according to a graph neural network to obtain an original text feature vector; A summary generation operation is performed on the original text feature vector according to the decoder of the transformer model to obtain a target text summary.

2. The text summary generation method according to claim 1, characterized in that: The step of performing a preprocessing operation on the original text to obtain the original text entity specifically includes the following steps: Perform word segmentation operation on the original text according to the BERT model to obtain a word segmentation sequence; An entity recognition operation is performed on the word segmentation sequence according to the GlobalPointer model to obtain the original text entity.

3. The text summary generation method according to claim 1, characterized in that: The step of constructing the original text knowledge graph according to the original text entity specifically includes the following steps: Extracting graph entities and graph relationship information matching the original text entities in the knowledge graph; An enhanced knowledge graph is constructed according to the graph entities and the graph relationship information to obtain the original text knowledge graph.

4. The text summary generation method according to claim 1, characterized in that: The step of performing a vector conversion operation on the original text and the original text knowledge graph according to the graph neural network to obtain the original text feature vector specifically includes the following steps: Calculate the attention score of each node of the original text in the original text knowledge graph according to the graph attention mechanism; Performing a state update operation on the nodes of the original text according to the attention score to obtain an updated state of each node; The updated states are added together and added to the summary vector of the original text obtained by the preprocessing to obtain the original text feature vector.

5. The text summary generation method according to claim 4, characterized in that: Place' The attention score e i It is expressed as: Among them, α ij represents the attention score, Represents the shared initial weight matrix of the relationship, e j An entity representing a neighboring node.

6. The text summary generation method according to claim 4, characterized in that: The attention score α ij It is expressed as: in, For the relationship ij The shared initial weight matrix is ​​gradually updated during the training process; the symbol || represents the concatenation of vectors, and the operation a∈R 2d is the attention mechanism parameter learned by the model, which is used to evaluate the importance of the two node representations. i Use the same a.

7. A text summary generation device, characterized in that: include: A request acquisition module, used to receive a text summary generation request carrying original text sent by a user terminal; A preprocessing module, used for performing a preprocessing operation on the original text to obtain an original text entity; A knowledge graph construction module, used to construct an original text knowledge graph according to the original text entity; A vector conversion module, used to perform a vector conversion operation on the original text and the original text knowledge graph according to a graph neural network to obtain an original text feature vector; The summary generation module is used to perform a summary generation operation on the original text feature vector according to the decoder of the transformer model to obtain a target text summary.

8. The text summary generating device according to claim 7, characterized in that: The preprocessing module comprises: A word segmentation submodule is used to perform word segmentation operation on the original text according to the BERT model to obtain a word segmentation sequence; The entity recognition submodule is used to perform entity recognition operation on the word segmentation sequence according to the GlobalPointer model to obtain the original text entity.

9. A computer device comprising a memory and a processor, characterized in that: The memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the text summary generation method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the text summary generation method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Social user depression tendency detection method based on heterogeneous graph attention network

    CN114628008A

  • Abstract generation method based on knowledge and semantic information enhancement

    CN116595953A