A method and system for joint extraction of entity relations in data discovery

By introducing a multi-grained hybrid attention mechanism and CNN module in the joint extraction of entity relationships, the problem of handling ambiguity and overlapping relationships in the prior art is solved, and a more efficient and accurate joint extraction of entities and relationships is achieved.

CN117743475BActive Publication Date: 2025-02-11CHENGDU UNIV OF INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311545712.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2025-02-11
Estimated Expiration
2043-11-17

AI Technical Summary

Technical Problem

In the joint extraction of end-to-end relationships between entities and relationships, the prior art is difficult to deal with the problem of ambiguity and overlapping relationships, and there is a lack of effective local feature extraction and multi-grained attention mechanisms.

Method used

Using a data discovery method based on multi-grained mixed attention, text semantic information is obtained through Bert pre-trained model, local features are extracted in combination with the CNN module, and global and local attention information is formed using the multi-headed attention mechanism, and finally achieved through the dual affine model. Joint extraction of entities and relationships.

Benefits of technology

It improves the accuracy of joint extraction of entity relationships, can handle ambiguity and overlapping relationships more effectively, and enhances the quality of the knowledge graph and the performance of intelligent search engines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117743475B_ABST
    Figure CN117743475B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of natural language processing, and discloses a method and system for joint extraction of entity relations based on data discovery of multi-granularity mixed attention, including: marking the positions of entities and relations in the form of a table space, sending text into a pre-trained model Bert, and obtaining semantic information of the text; obtaining local feature information in the semantic information through a CNN module; obtaining global and local attention information through a multi-head attention module; obtaining entity feature information through a gating unit; obtaining entity attention information fused with entity features by using a multi-head attention module; obtaining entity-relation joint feature information through a gating unit, and inputting it into a dual affine model to complete the joint extraction of entities and relations. The present invention better integrates context information to handle ambiguity, more accurately identifies entities and relations, and improves the accuracy of joint extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of natural language processing, and specifically relates to a method and system for jointly extracting entity relationships based on data discovery of multi-granularity mixed attention. Background Art

[0002] As data continues to grow, data security becomes critical. In this context, data classification and data identification and discovery become increasingly critical. Data classification helps to classify and label different types of entities and relationships, thereby providing more context and semantic information for information extraction tasks. At the same time, data identification and discovery technology can automatically identify and explore potential entities and relationships, providing support for the expansion of information extraction models.

[0003] The key to information extraction in natural language processing (NLP) is to extract entities and their relationships from text. These entity pairs are connected by semantic relations to form relation triplets, usually in the form of subject, relation, and object. Joint extraction models have attracted much attention because they can simultaneously process entities and their relationships, which helps to improve the consistency and efficiency of information extraction.

[0004] In existing research methods, a single model is usually used to model entities and relations to achieve end-to-end joint extraction of triples. Although this method helps to improve the consistency and efficiency of information extraction, it fails to solve the polysemy of a word representing different entities or relations in different contexts, and fails to deal with the overlap of an entity participating in multiple relations in the same text.

[0005] Therefore, current research needs to focus on solving problems such as ambiguity and overlapping relationships, and combine data grading and classification with data identification and discovery methods to extract entity and relationship information more comprehensively and accurately, thereby promoting the development of downstream tasks such as knowledge graph construction, machine translation, and question-answering systems.

[0006] Through the above analysis, the problems and defects of the prior art are as follows:

[0007] Modeling entities and relations in a single model to achieve end-to-end joint extraction of triples of relations cannot effectively solve the problem of ambiguity when a word represents different entities or relations in different contexts, and the problem of overlapping relations when an entity participates in multiple relations in the same text.

[0008] Existing technology: BERT-based entity relationship extraction method

[0009] This technology uses the BERT pre-trained model to represent the context of text and extracts entities and relationships through a series of neural network modules. Specifically, the method first inputs text data into the BERT model to obtain the context features of each word. Then, these features are used for entity recognition and relationship extraction.

[0010] Technical problems existing in existing technologies:

[0011] 1) Insufficient local feature extraction: Traditional BERT-based entity relationship extraction methods mainly rely on BERT's global context features, but are insufficient in extracting local features in the text. Local features are of great value for some specific entity relationship extraction tasks, such as named entity recognition.

[0012] 2) Lack of multi-granularity attention mechanism: The existing BERT-based models lack the attention mechanism for features of different granularities, which makes the model unable to fully utilize multi-level and multi-scale information.

[0013] 3) Insufficient linkage in entity relationship extraction: Traditional methods usually perform entity extraction first, and then perform relationship extraction based on the extracted entities. The two steps are relatively independent and do not fully consider the linkage between entities and relationships, which will affect the accuracy of extraction.

[0014] 4) Lack of effective fusion mechanism: When dealing with entities and relationships, existing technologies often lack effective information fusion mechanisms, resulting in the model being unable to fully utilize the information between entities and relationships. Summary of the invention

[0015] In response to the problems existing in the prior art, the present invention provides a method and system for joint extraction of entity relationships based on data discovery with multi-granularity mixed attention.

[0016] The present invention is implemented as follows: a method for jointly extracting entity relationships based on data discovery with multi-granularity mixed attention, the method for jointly extracting entity relationships based on data discovery with multi-granularity mixed attention comprising:

[0017] Step 1: Mark the locations of entities and relationships in the form of a table space, input the text data into the Bert pre-training model, obtain the context representation of each word, and capture the D-dimensional text semantic information M1;

[0018] Step 2: Input the text semantic information M1 into the CNN module to extract the local feature information M5;

[0019] Step 3: Input the text semantic information M1 into the first multi-head attention module to form the global attention information E1, and input the local feature information M5 into the second multi-head attention module to form the local attention information E2;

[0020] Step 4: Add the text semantic information M1, the global attention information E1 and the local attention information E2, and then input them into the gate control unit to obtain the entity feature information D2;

[0021] Step 5: Add the text local feature information M5 and the entity feature information D2, and further process them through a small residual network and LayerNorm layer. Use the fused information as the k value of the multi-head attention module. At the same time, use the text semantic information M1 as the v value of the third multi-head attention module, and the entity feature information D2 as the q value of the third multi-head attention module to obtain the entity attention information E3 that integrates the entity features.

[0022] Step six, add the semantic information M1, global attention information E1 and entity attention information E3 and input them into the gated unit to obtain the entity relationship joint feature information, which is then input into the dual affine model to complete the joint extraction of entities and relationships.

[0023] Furthermore, in step 2, the semantic information M1 is used as input, and the local feature information of the text is obtained using the CNN module. The specific calculation formula is as follows:

[0024] M2=CNN(M1)

[0025] M3=Maxpooling(M2)

[0026] M4=Averagepooling(M3)

[0027] M5=Relu(MLP(M3+M4))

[0028] CNN stands for convolutional neural network, Maxpooling stands for maximum pooling layer, Averagepooling stands for average pooling layer, MLP stands for fully connected layer, M2, M3, M4, M5 are D-dimensional vectors, and M5 is the final local feature information.

[0029] Further, in step three, the semantic information is input into the first multi-head attention module M1 to obtain the global attention information. The specific formula is as follows:

[0030] head j =Attention(Q j ,K j ,V j )

[0031]

[0032] MultiHead(M1)=Concact(head1,...,head h )W1 O

[0033] E1=MultiHead(M1)

[0034] in and head j It represents the output of the jth attention module, Concact represents the connection operation, and E1 represents the global attention information;

[0035] The local feature information M5 of the text is input into the second multi-head attention module to obtain the local attention information. The specific formula is as follows:

[0036] head j =Attention(Q j ,K j ,V j )

[0037]

[0038] MultiHead(M1)=Concact(head1,...,head h )W2 O

[0039] E2=MultiHead(M5)

[0040] in and head j It represents the output of the j-th attention module, Concact represents the connection operation, and E2 represents the local attention information.

[0041] Furthermore, in step 4, the text semantic information M1, the global attention information E1 and the local attention information E2 are added and input into the gate control unit to obtain the entity feature information. The specific formula is as follows:

[0042] D1=M1+E1+E2

[0043] D2=σ(D1)*D1

[0044] Where D1 and D2 are D-dimensional vectors, and σ() represents the sigmoid activation function.

[0045] Further, in step 5, the specific formula is as follows:

[0046] M6=LayerNorm(M5+D2)+M5+D2

[0047] head j =Attention(Q j ,K j ,V j )

[0048]

[0049] MultiHead(D2,M6,M1)=Concact(head1,...,head h )W3 O

[0050] E3=MultiHead(D2,M6,M1)

[0051] in and LayerNorm represents the layer normalization operation, head j It represents the output of the j-th attention module, Concact represents the connection operation, and E3 represents the entity attention information integrated with entity features.

[0052] Furthermore, in step six, the semantic information M1, the global attention information E1 and the entity attention information E3 are added and input into the gate control unit to obtain the entity relationship joint feature information. The specific formula is as follows:

[0053] D3=M1+E1+E3

[0054] D4=σ(D3)*D3

[0055] Where D3 and D4 are vectors of D dimension;

[0056] The entity relationship joint feature information D4 is input into the dual affine model to complete the joint extraction of entities and relationships. The specific formula is as follows:

[0057] U l =MLP1(D4)

[0058] U r =MLP2(D4)

[0059]

[0060] in and and is the trainable parameter of the model, U l and U r Represent the feature vectors of subject and object respectively.

[0061] Another object of the present invention is to provide an entity relationship joint extraction system based on multi-granularity mixed attention data discovery, the entity relationship joint extraction system based on multi-granularity mixed attention data discovery comprises:

[0062] The semantic representation module is used to obtain the contextual representation of each word using the Bert pre-trained model;

[0063] Feature extraction module, used to obtain feature information of text;

[0064] The joint extraction module is used to realize the joint extraction of entities and relations through a bi-affine model.

[0065] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the entity relationship joint extraction method based on multi-granularity mixed attention data discovery.

[0066] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the entity relationship joint extraction method based on multi-granularity mixed attention data discovery.

[0067] Another object of the present invention is to provide an information data processing terminal, which is used to implement the entity relationship joint extraction system based on multi-granularity mixed attention data discovery.

[0068] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0069] First, the entity relationship joint extraction method based on data discovery of multi-granularity mixed attention proposed in the present invention is expected to solve the above problems and improve the accuracy of entity relationship joint extraction by introducing technologies such as multi-head attention mechanism, CNN module, and dual affine model.

[0070] The present invention uses an improved unified space tagging scheme to solve the problem of overlapping relationships. The unified space tagging scheme is based on the attention mechanism and develops a multi-granularity fusion attention model to better integrate context information to handle ambiguity. By considering the meaning of words in different contexts, entities and relationships can be identified more accurately, thereby improving the accuracy of joint extraction.

[0071] Second, from a product perspective, the technical solution of the present invention can be used in information extraction systems for data classification and classification, and can be widely used in the fields of text analysis, knowledge graph construction, intelligent search engines, etc. Its technical effects and advantages include:

[0072] Improve the accuracy of information extraction, make it more accurate to extract entities and relationships from large amounts of text, and reduce the spread of false information.

[0073] The quality of knowledge graphs has been enhanced, making the construction and maintenance of knowledge graphs more reliable, which helps to achieve smarter applications and decision support systems.

[0074] The performance of the intelligent search engine has been improved, allowing users to find the information they need more quickly and improving the search engine user experience.

[0075] Third, as auxiliary evidence of the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:

[0076] (1) The expected benefits and commercial value of the technical solution of the present invention after transformation are:

[0077] The expected benefits and business value include improving the quality and efficiency of information extraction and knowledge graph applications, which will have a positive impact on multiple fields, such as finance, healthcare, search engine optimization, etc. This will help companies reduce costs, improve efficiency, and increase market competitiveness.

[0078] (2) The technical solution of the present invention fills the technical gap in the industry at home and abroad:

[0079] This paper introduces a multi-granularity fusion attention model and an improved labeling scheme, filling the technical gap in existing information extraction methods. These technical innovations improve the accuracy and reliability of data extraction and bring important technological progress to related fields.

[0080] (3) The technical solution of the present invention solves the technical problems that people have been eager to solve but have never been able to solve successfully:

[0081] The present invention successfully solves the problem of overlapping relations, which has always been a difficult problem in the field of information extraction. Traditional methods have difficulty in dealing with this problem, but the multi-granularity fusion attention model of the present invention effectively solves this challenge.

[0082] (4) By introducing a multi-granularity fusion attention model, the present invention reduces the technical bias in data extraction and makes the extraction results more comprehensive and objective. This helps to reduce errors and improve the credibility of data.

[0083] Fourth, the present invention provides a method for joint extraction of entity relationships based on data discovery with multi-granularity mixed attention. This method includes the following steps:

[0084] 1. Mark the location of entities and relations: Input text data into the Bert pre-trained model in a table space to obtain the contextual representation of each word, thereby capturing D-dimensional text semantic information.

[0085] 2. Extract local feature information: Input the text semantic information obtained in step 1 into the CNN module to extract local feature information.

[0086] 3. Form global and local attention information: Input the text semantic information into the first multi-head attention module to form global attention information; input the local feature information into the second multi-head attention module to form local attention information.

[0087] 4. Obtain the feature information of the entity: Add the text semantic information, global attention information, and local attention information, and then input them into the gated unit to obtain the feature information of the entity.

[0088] 5. Entity attention information fused with entity features: The local feature information of the text is added to the entity feature information, and further processed through a small residual network and a LayerNorm layer. The fused information is then used as the k value of the multi-head attention module. At the same time, the text semantic information is used as the v value of the third multi-head attention module, and the entity feature information is used as the q value of the third multi-head attention module. In this way, the entity attention information fused with entity features is obtained.

[0089] 6. Joint extraction of entities and relations: The semantic information, global attention information and entity attention information are added together and input into the gated unit to obtain the entity-relationship joint feature information, which is then input into the dual affine model to complete the joint extraction of entities and relations.

[0090] The significant technical progress of the method provided by the present invention is that by using a multi-granularity hybrid attention mechanism, the feature information of entities and relationships can be processed simultaneously at the global and local levels, thereby more effectively performing the joint extraction of entities and relationships. In addition, by using a gated unit and a dual affine model, the joint extraction results of entities and relationships can be further optimized. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] Figure 1 is a flow chart of a method provided by an embodiment of the present invention;

[0092] Figure 2 is a specific schematic diagram of a labeling scheme provided by an embodiment of the present invention;

[0093] Figure 3 It is a specific schematic diagram of the model architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0094] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0095] The entity relationship joint extraction method based on multi-granularity hybrid attention provided by the present invention can be applied to a variety of scenarios, such as knowledge graph construction and information extraction. The following are two specific application examples:

[0096] 1. Application Example 1: Knowledge Graph Construction

[0097] The knowledge graph is a complex network containing a large number of entities and their relationships. This method can help automatically extract entities and their relationships from large amounts of text data to automatically construct a knowledge graph.

[0098] The specific implementation plan includes the following steps:

[0099] This method is used to extract entities and their relationships from large amounts of text data.

[0100] Use a database or graph database to store the extracted entities and their relationships.

[0101] Use a visualization tool to display the constructed knowledge graph.

[0102] 2. Application Example 2: Information Extraction

[0103] Information extraction is to extract structured information from unstructured text data, such as entities, relationships, etc. This method can be used to improve the efficiency and accuracy of information extraction.

[0104] The specific implementation plan includes the following steps:

[0105] This method is used to extract entities and their relationships from unstructured text data.

[0106] Use a database or file system to store the extracted structured information.

[0107] If necessary, a search engine or query system can be used to retrieve the stored structured information.

[0108] like Figure 1 As shown, the entity relationship joint extraction method based on multi-granularity mixed attention data discovery provided by the embodiment of the present invention includes the following steps:

[0109] S101, mark the locations of entities and relations in the form of a table space, input the text data into the Bert pre-training model, obtain the context representation of each word, and capture the D-dimensional text semantic information M1;

[0110] S102, inputting the text semantic information M1 into the CNN module to extract local feature information M5;

[0111] S103, inputting the text semantic information M1 into the first multi-head attention module to form the global attention information E1, and inputting the local feature information M5 into the second multi-head attention module to form the local attention information E2;

[0112] S104, adding the text semantic information M1, the global attention information E1 and the local attention information E2, and then inputting them into the gate control unit to obtain the feature information D2 of the entity;

[0113] S105, adding the text local feature information M5 and the entity feature information D2, and further processing them through a small residual network and LayerNorm layer, using the fused information as the k value of the multi-head attention module, and using the text semantic information M1 as the v value of the third multi-head attention module, and the entity feature information D2 as the q value of the third multi-head attention module, to obtain the entity attention information E3 that integrates the entity features;

[0114] S106, add the semantic information M1, global attention information E1 and entity attention information E3 and input them into the gating unit to obtain entity relationship joint feature information, which is then input into the dual affine model to complete the joint extraction of entities and relationships.

[0115] The embodiment of the present invention provides a feature of a unified space annotation solution, specifically, Figure 2 shown.

[0116] The specific schematic diagram of the model architecture provided by the embodiment of the present invention is as follows Figure 3 shown.

[0117] In step 2 provided in the embodiment of the present invention, the semantic information M1 is used as input, and the local feature information of the text is obtained by using the CNN module. The specific calculation formula is as follows:

[0118] M2=CNN(M1)

[0119] M3=Maxpooling(M2)

[0120] M4=Averagepooling(M3)

[0121] M5=Relu(MLP(M3+M4))

[0122] CNN stands for convolutional neural network, Maxpooling stands for maximum pooling layer, Averagepooling stands for average pooling layer, MLP stands for fully connected layer, M2, M3, M4, M5 are D-dimensional vectors, and M5 is the final local feature information.

[0123] In step three provided by the embodiment of the present invention, the semantic information is input into M1 into the first multi-head attention module to obtain global attention information. The specific formula is as follows:

[0124] head j =Attention(Q j ,K j ,V j )

[0125]

[0126] MultiHead(M1)=Concact(head1,...,head h )W1 O

[0127] E1=MultiHead(M1)

[0128] in and head j It represents the output of the jth attention module, Concact represents the connection operation, and E1 represents the global attention information;

[0129] The local feature information M5 of the text is input into the second multi-head attention module to obtain the local attention information. The specific formula is as follows:

[0130] head j =Attention(Q j ,K j ,V j )

[0131]

[0132] MultiHead(M1)=Concact(head1,...,head h )W2 O

[0133] E2=MultiHead(M5)

[0134] in and head jIt represents the output of the j-th attention module, Concact represents the connection operation, and E2 represents the local attention information.

[0135] In step 4 provided by the embodiment of the present invention, the text semantic information M1, the global attention information E1 and the local attention information E2 are added and input into the gate control unit to obtain the entity feature information. The specific formula is as follows:

[0136] D1=M1+E1+E2

[0137] D2=σ(D1)*D1

[0138] Where D1 and D2 are D-dimensional vectors, and σ() represents the sigmoid activation function.

[0139] The specific formula of step 5 provided in the embodiment of the present invention is as follows:

[0140] M6=LayerNorm(M5+D2)+M5+D2

[0141] head j =Attention(Q j ,K j ,V j )

[0142]

[0143] MultiHead(D2,M6,M1)=Concact(head1,...,head h )W3 O

[0144] E3=MultiHead(D2,M6,M1)

[0145] in and LayerNorm represents the layer normalization operation, head j It represents the output of the j-th attention module, Concact represents the connection operation, and E3 represents the entity attention information integrated with entity features.

[0146] In step 6 provided by the embodiment of the present invention, the semantic information M1, the global attention information E1 and the entity attention information E3 are added and input into the gate control unit to obtain the entity relationship joint feature information. The specific formula is as follows:

[0147] D3=M1+E1+E3

[0148] D4=σ(D3)*D3

[0149] Where D3 and D4 are vectors of D dimension;

[0150] The entity relationship joint feature information D4 is input into the dual affine model to complete the joint extraction of entities and relationships. The specific formula is as follows:

[0151] U l =MLP1(D4)

[0152] U r =MLP2(D4)

[0153]

[0154] in and and is the trainable parameter of the model, U l and U r Represent the feature vectors of subject and object respectively.

[0155] The entity relationship joint extraction system based on multi-granularity mixed attention data discovery provided by the embodiment of the present invention includes:

[0156] The semantic representation module is used to obtain the contextual representation of each word using the Bert pre-trained model;

[0157] Feature extraction module, used to obtain feature information of text;

[0158] The joint extraction module is used to realize the joint extraction of entities and relations through a bi-affine model.

[0159] The entity relationship joint extraction method for data discovery based on multi-granularity mixed attention provided by an application embodiment of the present invention is applied to a computer device, wherein the computer device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the entity relationship joint extraction method for data discovery based on multi-granularity mixed attention.

[0160] The entity relationship joint extraction method based on multi-granularity mixed attention data discovery provided by the application embodiment of the present invention is applied to an information data processing terminal, and the information data processing terminal is used to implement the entity relationship joint extraction system based on multi-granularity mixed attention data discovery.

[0161] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0162] The embodiments of the present invention have achieved some positive effects during the development or use process, and indeed have great advantages over the prior art. The following content is described in conjunction with data, charts, etc. of the test process.

[0163] First, the present invention adopts a table space method to mark the locations of entities and relations. This modeling method aims to solve the problem of overlapping relations, thereby making the extracted relation triples more practical.

[0164] Next, the text data is fed into the Bert pre-trained model to obtain the semantic information of the text, and then passed into the CNN module to extract local feature information. These local feature information helps the model focus on the boundary information of the entity, thereby improving the recognition accuracy of the entity.

[0165] In addition, the semantic information of the text is passed to the first multi-head attention module to create global attention. This enables the model to better grasp the semantics of the entire text and fully understand the context, thereby effectively overcoming the ambiguity problem in the text. Next, the local feature information is passed to the second multi-head attention module to further improve the recognition accuracy of the entity. Next, the local feature information is passed to the second multi-head attention module to further improve the recognition accuracy of the entity.

[0166] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A method for joint extraction of entity relations based on data discovery of multi-granularity mixed attention, characterized in that: include: Step 1: Mark the locations of entities and relationships in the form of a table space, input the text data into the Bert pre-training model, obtain the context representation of each word, and capture the D-dimensional text semantic information M1; Step 2: Input the text semantic information M1 into the CNN module to extract the local feature information M5; Step 3: Input the text semantic information M1 into the first multi-head attention module to form the global attention information E1, and input the local feature information M5 into the second multi-head attention module to form the local attention information E2; Step 4: Add the text semantic information M1, the global attention information E1 and the local attention information E2, and then input them into the gate control unit to obtain the entity feature information D2; Step 5: Add the text local feature information M5 and the entity feature information D2, and further process them through a small residual network and LayerNorm layer. Use the fused information as the k value of the multi-head attention module. At the same time, use the text semantic information M1 as the v value of the third multi-head attention module, and the entity feature information D2 as the q value of the third multi-head attention module to obtain the entity attention information E3 that integrates the entity features. Step 6: Add the semantic information M1, global attention information E1 and entity attention information E3 and input them into the gate unit to obtain entity relationship joint feature information, which is then input into the dual affine model to complete the joint extraction of entities and relationships. In step 4, the text semantic information M1, the global attention information E1 and the local attention information E2 are added and input into the gate control unit to obtain the entity feature information. The specific formula is as follows: D1=M1+E1+E2 D2=σ(D1)*D1 Where D1 and D2 are D-dimensional vectors, σ() represents the sigmoid activation function; In step 6, the semantic information M1, the global attention information E1 and the entity attention information E3 are added and input into the gate control unit to obtain the entity relationship joint feature information. The specific formula is as follows: D3=M1+E1+E3 D4=σ(D3)*D3 Where D3 and D4 are vectors of D dimension; The entity relationship joint feature information D4 is input into the dual affine model to complete the joint extraction of entities and relationships. The specific formula is as follows: U l =MLP1(D4) U r =MLP2(D4) where U∈R D And W m1 ∈R |y|×D×D , W m2 ∈R |y|×D and b m ∈R |y| is the trainable parameter of the model, U l and U r Represent the feature vectors of subject and object respectively.

2. The entity relationship joint extraction method based on multi-granularity mixed attention data discovery according to claim 1 is characterized in that: In the second step, the semantic information M1 is used as input, and the local feature information of the text is obtained by using the CNN module. The specific calculation formula is as follows: M2=CNN(M1) M3=Maxpooling(M2) M4=Averagepooling(M3) M5=Relu(MLP(M3+M4)) CNN stands for convolutional neural network, Maxpooling stands for maximum pooling layer, Averagepooling stands for average pooling layer, MLP stands for fully connected layer, M2, M3, M4, M5 are D-dimensional vectors, and M5 is the final local feature information.

3. The entity relationship joint extraction method based on multi-granularity mixed attention data discovery according to claim 1 is characterized in that: In step 3, the semantic information M1 is input into the first multi-head attention module to obtain the global attention information. The specific formula is as follows: head j =Attention(Q j ,K j ,V j ) MultiHead(M1)=Concact(head1,...,head h )W1 O E1=MultiHead(M1) Where Q j ∈R D / h ,K j ∈R D / h ,V j ∈R D / h and W1 O ∈R D , head j It represents the output of the jth attention module, Concact represents the connection operation, and E1 represents the global attention information; The local feature information M5 of the text is input into the second multi-head attention module to obtain the local attention information. The specific formula is as follows: head j =Attention(Q j ,K j ,V j ) MultiHead(M1)=Concact(head1,...,head h )W2 O E2=MultiHead(M5) Where Q j ∈R D / h ,K j ∈R D / h ,V j ∈R D / h and W2 O ∈R D , head j It represents the output of the j-th attention module, Concact represents the connection operation, and E2 represents the local attention information.

4. The entity relationship joint extraction method based on multi-granularity mixed attention data discovery according to claim 1 is characterized in that: The specific formula of step 5 is as follows: M6=LayerNorm(M5+D2)+M5+D2 head j =Attention(Q j ,K j ,V j ) MultiHead(D2,M6,M1)=Concact(head1,...,head h )W3 O E3=MultiHead(D2,M6,M1) Where Q j ∈R D / h ,K j ∈R D / h ,V j ∈R D / h and W3 O ∈R D , LayerNorm represents the layer normalization operation, head j It represents the output of the j-th attention module, Concact represents the connection operation, and E3 represents the entity attention information integrated with entity features.

5. A system for joint extraction of entity relationships based on multi-granularity mixed attention data discovery according to any one of claims 1 to 4, characterized in that: The entity relationship joint extraction system based on multi-granularity mixed attention data discovery includes: The semantic representation module is used to obtain the contextual representation of each word using the Bert pre-trained model; Feature extraction module, used to obtain feature information of text; The joint extraction module is used to realize the joint extraction of entities and relations through a bi-affine model.

6. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the entity relationship joint extraction method based on multi-granularity mixed attention data discovery as described in any one of claims 1-4.

7. A computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the entity relationship joint extraction method based on multi-granularity mixed attention data discovery as described in any one of claims 1-4.

8. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the entity relationship joint extraction system based on multi-granularity mixed attention data discovery as described in claim 5.

Citation Information

Patent Citations

  • Data enhancement method for information extraction task based on attention mechanism

    CN114564583A

  • Scientific and technological paper data text semantic feature extraction method and system and storage medium

    CN114818737A