Joint extraction method of entities and relations based on deep neural network

Through the joint training method of deep neural network, the problem of not being able to utilize entity category information in entity recognition and relationship extraction is solved, and automated entity and relationship extraction is realized, and the accuracy of information extraction is improved.

CN112214966BActive Publication Date: 2025-02-25TRS INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010923832.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-04
Publication Date
2025-02-25
Estimated Expiration
2040-09-04

AI Technical Summary

Technical Problem

In the prior art, entity recognition and relation extraction have the problem that the entity category information implicitly is not fully utilized when entity recognition, resulting in the erroneous propagation of knowledge and the inability to share knowledge.

Method used

The integrated method based on deep neural network is adopted to realize joint training learning of entity recognition and relationship extraction. Through long-term and short-term memory neural networks and conditional random field algorithms, the entities contained in the text and the relationship between entities are automatically extracted.

Benefits of technology

It simplifies the data processing process, realizes knowledge sharing, improves the accuracy of information extraction, and can automatically extract entities and relationships without manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112214966B_ABST
    Figure CN112214966B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of information processing. In order to solve the technical problem in the prior art that entity recognition and relationship extraction cannot fully utilize the entity category information implicit in entity recognition, the present invention provides a method for joint extraction of entities and relationships based on a deep neural network, a non-volatile storage medium and a data processing system. The deep neural network is used to adopt an integrated method to realize joint training and learning of entity recognition and relationship extraction, and there is no need for manual intervention in combining entities in the input text, and the entities contained in the text and the relationships between entities can be automatically extracted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing, and in particular to a method for jointly extracting entities and relationships based on a deep neural network, a non-volatile storage medium, and a data processing system. Background Art

[0002] In the knowledge graph, a large amount of knowledge, such as information in open databases and encyclopedias, is usually expressed in the form of relational data sets. In relational data sets, basic facts are abstracted as entities, while rules, logic, reasoning and other related information are abstracted as relationships between entities. If entities correspond to points and relationships correspond to edges, this knowledge can be further presented in the form of a graph, so that it can be used efficiently by computers, which is the significance of studying knowledge graphs. This model of structuring entities and abstract concepts into multi-relational data sets has also been strongly advocated in recent years.

[0003] Entity recognition and relationship extraction are the core technologies of information extraction. The goal is to extract triples such as "entity 1-relationship-entity 2" from unstructured text. The commonly used method is to use a pipeline approach to extract triples: first send the text to model 1 for entity recognition, then combine the recognized entities in pairs, and then send them to model 2 for relationship classification, and finally combine the entity pairs and the corresponding relationships into triples for output.

[0004] There are several main problems with the pipeline extraction method: 1) incorrect propagation of knowledge. The wrong entities identified in the entity recognition module will affect the effect of the relationship classification module. 2) knowledge cannot be shared. The existing neural network-based methods require the learning and representation of implicit knowledge in the input text. The pipeline method makes it impossible for the relationship classification module to fully utilize the implicit entity category and other information during entity recognition. Summary of the invention

[0005] In order to solve the technical problem in the prior art that entity recognition and relationship extraction cannot fully utilize the entity category information implicit in entity recognition, the present invention provides a method for joint extraction of entities and relationships based on a deep neural network, a non-volatile storage medium and a data processing system, which uses a deep neural network to adopt an integrated method to realize joint training and learning of entity recognition and relationship extraction, and can automatically extract the entities contained in the text and the relationships between entities without manual intervention in combining entities in the input text.

[0006] On one hand, the present invention provides a method for joint extraction of entities and relationships based on a deep neural network, characterized in that it includes:

[0007] Perform text segmentation on the input text to obtain word segmentation after text processing;

[0008] Perform vector processing on the word segmentation after text processing, and input the vectorized word segmentation into the long short-term memory neural network to perform forward encoding and reverse encoding on the text;

[0009] Performing text feature concatenation processing on the forward coding and the reverse coding to obtain features of each word after integrating context information;

[0010] The conditional random field algorithm is used to obtain the conditional transition probability between entity tags and the probability distribution of each word on the entity tag, and the entity tag with the largest probability value for each word is vectorized.

[0011] Merge the features of each word in the text after integrating the context information with the corresponding label vector representation;

[0012] Each word in the text is traversed in turn, and the vector features corresponding to each word are compared with the vector features corresponding to other words in the text. According to the text processing process including word segmentation, text vectorization, forward and reverse encoding of long short-term memory neural network, feature fusion, conditional random field algorithm, conditional transition probability and probability distribution processing of each word on the entity label, and attention operation between features, the corresponding deep neural network model is used for relationship classification processing. Based on the relationship classification processing results, the entities contained in the text and the corresponding relationships between entities are extracted.

[0013] In a preferred implementation of an embodiment of the present invention, the relationship classification processing includes: performing attention operations on the vector corresponding to each word and the vectors corresponding to other words in the text, and using a multi-classification approach to determine whether there is a relationship or multiple relationships between the two words; based on the judgment result between the two words, extracting the entities contained in the text and the corresponding relationships between the entities.

[0014] In a preferred implementation of an embodiment of the present invention, the relationship classification processing is based on a deep neural network entity and relationship joint extraction method to label entity labels using a BIO labeling method; the BIO labeling includes: the starting position label of the entity, the non-starting position label of the entity, and the label of the non-entity part; the relationship labels are extracted using a multi-classification method.

[0015] In a further preferred implementation of the embodiment of the present invention, the entity labels are annotated by using a BIO annotation method and the relationship labels are extracted by using a multi-classification method, specifically including:

[0016] The obtained word vector is sent to a k-layer bidirectional long short-term memory neural network composed of forward and reverse directions for learning, and finally the obtained forward and reverse outputs are concatenated to obtain a text composed of a matrix Ml;

[0017] The output of the bidirectional long short-term memory neural network is sent to the conditional random field algorithm layer for learning to obtain the conditional probability transfer matrix Mt and the entity label matrix Mb, where Mb is the result of taking the maximum probability value of each word in the text T on the entity label probability distribution;

[0018] In the BIO annotation processing layer, the entity label matrix Mb is vectorized to obtain the vectorized matrix Me;

[0019] Concatenate the matrix M1 and the matrix Me row by row to obtain a matrix Mr;

[0020] Traverse the vector corresponding to each word in Mr, perform attention calculation based on the vector corresponding to each word and the vectors corresponding to other words, and obtain the relationship probability distribution R;

[0021] Based on the entity label matrix Mb and the relationship probability distribution R, the entity labels and corresponding relationships contained in the text are counted, and according to the system parameters and thresholds, the relationships with low probability values ​​or invalid are filtered out to extract the entities contained in the text and the corresponding relationships between entities.

[0022] In a further preferred implementation of the embodiment of the present invention, the above method also includes: reading data, segmenting the text, and obtaining a segmented text T; sending the segmented text to a word embedding layer to perform a word embedding operation, and each word will be represented as a D-dimensional vector; the text T can be represented as an L×D matrix, where L is the maximum length of the text after segmentation.

[0023] In a preferred implementation of an embodiment of the present invention, the above method also includes: performing text feature splicing processing on long short-term memory neural networks, forward encoding and reverse encoding, conditional random field algorithm, conditional transition probability and probability distribution processing of each word on the entity label, merging the features of each word in the text after integrating context information with the corresponding label vector representation, performing model training, and obtaining model parameters through convergence method or training method with maximum number of iterations.

[0024] In a preferred implementation of the embodiment of the present invention, based on the trained model parameters, entity and relationship joint extraction is performed on the text to be processed to extract the entities contained in the text to be processed and the corresponding relationships between the entities.

[0025] In a preferred implementation of an embodiment of the present invention, the entity and relationship joint extraction method based on a deep neural network is applied to the environment of python3 and tensorflow, and is written in python language, and the application medium is a python script.

[0026] The second aspect of the present invention also provides a non-volatile storage medium, characterized in that a computer program is stored thereon; the computer program is executed by a processor to implement the entity and relationship joint extraction method based on a deep neural network as described in any one of the items provided in the first aspect.

[0027] The third aspect of the present invention further provides a data processing system, characterized in that it includes:

[0028] Memory,

[0029] processor, and

[0030] Computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the entity and relationship joint extraction method based on a deep neural network as described in any one of the first aspects.

[0031] In entity recognition and relationship classification, this application uses an integrated method through deep neural networks to achieve joint training and learning of entity recognition and relationship extraction, simplify the data processing process, and achieve knowledge sharing, which can effectively improve the accuracy of information extraction. Moreover, there is no need for manual intervention in the combination of entities in the input text, and the entities contained in the text and the relationships between entities can be automatically extracted.

[0032] Other features and advantages of the invention will be described in the following description, and partly become apparent from the description, or understood by implementing the technical solution of the invention. The purpose and other advantages of the invention can be achieved and obtained by the structures and / or processes specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flowchart of a method for joint extraction of entities and relationships based on a deep neural network is provided for an embodiment of the present invention.

[0034] Figure 2 An embodiment of the present invention provides a schematic diagram of the architecture of a deep neural network model.

[0035] Figure 3 A flowchart of a deep neural network model training method is provided for an embodiment of the present invention.

[0036] Figure 4 A model prediction flow chart based on a trained deep neural network model is provided for an embodiment of the present invention.

[0037] Figure 5 A structural block diagram of a data processing system is provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The following will describe the implementation methods of the present invention in detail with reference to the accompanying drawings and embodiments, so that the implementation process of how the present invention applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that these specific descriptions are only to make it easier and clearer for ordinary technicians in the field to understand the present invention, rather than a restrictive interpretation of the present invention; and as long as there is no conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other, and the technical solutions formed are all within the protection scope of the present invention.

[0039] Additionally, the steps shown in the flowcharts of the accompanying drawings may be executed in a control system such as a set of controller executable instructions, and although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown here.

[0040] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments:

[0041] Example

[0042] like Figure 1 As shown, this embodiment provides a method for joint extraction of entities and relationships based on a deep neural network, the method comprising:

[0043] S110, performing text segmentation processing on the input text to obtain word segmentation after text processing;

[0044] S120, performing vector processing on the word segmentation after text processing, and inputting the vectorized word segmentation into a long short-term memory neural network to perform forward encoding and reverse encoding on the text;

[0045] S130, performing text feature concatenation processing on the forward coding and the reverse coding to obtain the feature of each word after integrating the context information;

[0046] S140, using a conditional random field algorithm to obtain the conditional transition probability between entity tags and the probability distribution of each word on the entity tag, and vectorizing each word in the entity tag with the largest corresponding probability value;

[0047] S150, merging the features of each word in the text after integrating the context information with the corresponding label vector representation;

[0048] S160, traverse each word in the text in turn, and compare the vector features corresponding to each word with the vector features corresponding to other words in the text, and perform relationship classification processing according to the deep neural network model corresponding to the text processing process including word segmentation, text vectorization, forward and reverse encoding of long short-term memory neural network, feature fusion, conditional random field algorithm, conditional transition probability and probability distribution processing of each word on the entity label, and attention operation between features. Based on the relationship classification processing results, extract the entities contained in the text and the corresponding relationships between entities.

[0049] In a preferred implementation of this embodiment, the relationship classification processing includes: performing attention operations on the vector corresponding to each word and the vectors corresponding to other words in the text, and using a multi-classification approach to determine whether there is a relationship or multiple relationships between the two words; based on the judgment result between the two words, extracting the entities contained in the text and the corresponding relationships between the entities.

[0050] Among them, the relationship classification processing uses the entity and relationship joint extraction method based on deep neural networks to annotate entity labels using the BIO annotation method; the BIO annotation includes: the starting position label of the entity, the non-starting position label of the entity, and the label of the non-entity part; the relationship label is extracted using a multi-classification method.

[0051] In a further preferred implementation of this embodiment, the entity labels are annotated using a BIO annotation method and the relationship labels are extracted using a multi-classification method, specifically including:

[0052] The obtained word vector is sent to a k-layer bidirectional long short-term memory neural network composed of forward and reverse directions for learning, and finally the obtained forward and reverse outputs are concatenated to obtain a text composed of a matrix Ml;

[0053] The output of the bidirectional long short-term memory neural network is sent to the conditional random field algorithm layer for learning to obtain the conditional probability transfer matrix Mt and the entity label matrix Mb, where Mb is the result of taking the maximum probability value of each word in the text T on the entity label probability distribution;

[0054] In the BIO annotation processing layer, the entity label matrix Mb is vectorized to obtain the vectorized matrix Me;

[0055] Concatenate the matrix M1 and the matrix Me row by row to obtain the matrix Mr;

[0056] Traverse the vectors corresponding to each word in Mr, perform attention calculation based on the vector corresponding to each word and the vectors corresponding to other words, and obtain the relationship probability distribution R;

[0057] Based on the entity label matrix Mb and the relationship probability distribution R, the entity labels and corresponding relationships contained in the text are counted. According to the system parameters and thresholds, the relationships with low probability values ​​or invalid are filtered out, and the entities contained in the text and the corresponding relationships between entities are extracted.

[0058] In a further preferred implementation of this embodiment, the above method also includes: reading data, segmenting the text, and obtaining a segmented text T; sending the segmented text to a word embedding layer to perform a word embedding operation, and each word will be represented as a D-dimensional vector; the text T can be represented as an L×D matrix, where L is the maximum length of the text after segmentation.

[0059] In a preferred implementation of this embodiment, the above method also includes: performing text feature splicing processing on long short-term memory neural networks, forward encoding and reverse encoding, conditional random field algorithm, conditional transition probability and probability distribution processing of each word on the entity label, merging the features of each word in the text after integrating context information with the corresponding label vector representation, performing model training, and obtaining model parameters through convergence method or training method with maximum number of iterations.

[0060] In a preferred implementation of this embodiment, based on the trained model parameters, entity and relationship joint extraction is performed on the text to be processed to extract the entities contained in the text to be processed and the corresponding relationships between the entities.

[0061] In the preferred implementation of this embodiment, the entity and relationship joint extraction method based on deep neural network is applied to the environment of python3 and tensorflow, and is written in python language, and the application medium is a python script.

[0062] The above technical solution provided in this embodiment adopts an integrated method through a deep neural network in entity recognition and relationship classification to realize joint training and learning of entity recognition and relationship extraction, simplify the data processing process, and realize knowledge sharing, which can effectively improve the accuracy of information extraction. Moreover, there is no need for manual intervention in the combination of entities in the input text, and the entities contained in the text and the relationships between entities can be automatically extracted.

[0063] In the technical solution provided in this embodiment, a deep neural network is used to implement joint training and learning of entity recognition and relationship extraction in an integrated manner; and the system automatically extracts the entities contained in the text and the relationships between the entities without manual intervention in combining entities in the input text. More specifically, Figure 2 As shown, the model architecture used by the entity and relationship joint extraction method based on deep neural network provided in this embodiment includes:

[0064] 1. Text segmentation: The input text is segmented into words. Chinese characters are segmented at the granularity of single Chinese characters, and numbers, English letters, etc. are segmented at the granularity of words with spaces as boundaries.

[0065] 2.Embedding: word embedding layer, which can use tools such as word2vec, ELMO, BERT, etc. to vectorize text.

[0066] 3. Forward LSTM: Use long short-term memory neural network (LSTM) to forward encode the text.

[0067] 4. Reverse LSTM: Use long short-term memory neural network (LSTM) to reverse encode the text.

[0068] 5. Merge LSTM: Concatenate the text features obtained by forward and reverse encoding to obtain the features of each token (e.g., word) in the text after integrating the context information.

[0069] 6. CRF: Use the conditional random field algorithm (CRF) to obtain the conditional transition probability between entity tags and the probability distribution of each token on the entity tag

[0070] 7.BIO Embedding: Vectorize each token in the entity tag with the largest corresponding probability value.

[0071] 8. Merge: Merge the features of each token in the text after integrating the context information with the corresponding label vector.

[0072] 9. Relationship classification: traverse each token in the text in turn, and perform attention operations on the vector corresponding to the token and the vectors corresponding to other tokens in the text, and use a multi-classification method to determine whether there is a relationship or multiple relationships between the two tokens.

[0073] The entity and relationship joint extraction method based on deep neural network uses BIO annotation to annotate entity labels (B represents the starting position label of the entity, I represents the non-starting position label of the entity, and O represents the label of the non-entity part), and uses multi-classification to extract relationship labels. The specific process is as follows:

[0074] Step 1: Read the data and segment the text. The segmented text T can be represented as token1, token2, ..., tokenn.

[0075] Step 2: Send the segmented text to the Embedding layer for word embedding. Each token will be represented as a D-dimensional vector: e1, e2, …, en. At this time, the text T can be represented as an L×D matrix, where L is the maximum length of the text after segmentation, which is specified by the system parameters.

[0076] Step 3: Send the obtained word vector to a k-layer bidirectional LSTM consisting of forward and reverse for learning, and finally concatenate the obtained forward and reverse outputs. At this time, the text T can be represented as an L×2h matrix Ml, where h is the dimension of the hidden layer in the LSTM. Because the forward and reverse outputs are concatenated, it eventually becomes 2h;

[0077] Step 4: Send the output of the bidirectional LSTM layer to the CRF layer for learning, and you will get an N×N conditional probability transfer matrix Mt and an L×1 entity label matrix Mb, where Mb is the result of taking the maximum probability value of each token in the text T on the entity label probability distribution;

[0078] Step 5: Vectorize the entity label matrix Mb at the BIO Embedding layer to obtain an L×d matrix Me, where d is specified by the system parameters;

[0079] Step 6: Concatenate the matrix M1 obtained in step 3 and the matrix Me obtained in step 5 row by row to obtain a matrix Mr of L×(2h+d);

[0080] Step 7: Traverse the vector corresponding to each token in Mr, and perform attention calculation on the vector and the vectors corresponding to other tokens to obtain the relationship probability distribution R;

[0081] Combined with Mb in step 4 and R in step 7, the entity labels and corresponding relationships contained in the text are counted, and the relationships with low probability values ​​or invalid are filtered out according to the combined effect of system parameters topk and threshold. Finally, the entities contained in the text and the corresponding relationships between entities are extracted.

[0082] like Figure 3 As shown, a deep neural network model training method is provided for this embodiment, and the model training method includes:

[0083] S210. Start training task;

[0084] S220. Reading data, that is, reading sample data for which entities and corresponding relationships between entities have been constructed;

[0085] S230. Build the model according to Figure 1 Corresponding method or Figure 2The corresponding deep neural network constructs the corresponding network model framework, but the parameters needed in the network model can be set to be determined after training.

[0086] S240. Start training. Start training based on the data read in S220 and the model constructed in S230.

[0087] S250. Determine whether the (deep neural network) model has converged (for example, whether the entities and the corresponding relationships between entities after the last training meet the predetermined requirements), or whether the maximum number of iterations has been reached (for example, N trainings have been completed)? If so, execute S260; otherwise, execute S280.

[0088] S260. Save the final model, determine the final deep neural network model based on the trained parameters (a model for subsequent entity and corresponding relationship prediction between entities); then execute S270 (end the training task)

[0089] S280. Save the model after the current training, and then continue training (S240).

[0090] Figure 4 A model prediction flow chart based on a trained deep neural network model is provided for this embodiment. The model prediction process (method) includes:

[0091] S310. Start the test task,

[0092] S320. Read data, read text data of the entity to be determined and the corresponding relationship between entities;

[0093] S330. Loading model: Record Figure 3 The deep neural network model trained in the corresponding process.

[0094] S340. Start prediction: Execute prediction based on the data read in S320 and the corresponding record model in S330.

[0095] S350. Save the results according to Figure 1 The corresponding method performs the operation and saves the result.

[0096] S360. End the prediction task.

[0097] like Figure 5 As shown, this embodiment further provides a data processing system 100, and the data processing system 100 includes:

[0098] Storage 110, one or more storage devices may be deployed;

[0099] The processor 120 may be deployed in one or more units and may be on the same device or on a different device as the memory 110; and

[0100] Computer program; wherein the computer program is stored in a memory and is configured to be executed by a processor to implement any of the entity and relationship joint extraction methods based on a deep neural network as provided above.

[0101] This embodiment also provides a non-volatile storage medium on which a computer program is stored; the computer program is executed by a processor to implement any of the entity and relationship joint extraction methods based on a deep neural network as provided above.

[0102] In order to make it easier for those skilled in the art to understand the technical solution of this embodiment, the following is an example in combination with a specific operating environment:

[0103] 1. Configure the python3+tensorflow environment. The present invention is an application software based on the open source deep learning framework tensorflow. Before using the present invention, the environment needs to be configured first.

[0104] 2. This embodiment is written in Python language, and the application medium is a Python script. When deploying this embodiment, all .py files need to be submitted to a machine with a configured environment.

[0105] 3. This embodiment is divided into two parts: training and prediction:

[0106] 1) Training part:

[0107] Run the shell command through the command line or other means to call it. The command format is as follows:

[0108] python train_joint_nre.py (main program script) [calling parameters]

[0109] Parameter Description:

[0110] data_type: training data format, supports txt text files and json files, the corresponding values ​​are [txt,json]

[0111] train_file: The location of the training data, which can be specific to the file name or the path name of the file

[0112] train_file_encode: data file encoding format, [gb18030,utf-8]

[0113] lstm_size: Long short-term memory neural network (LSTM) hidden layer dimension

[0114] num_layers: number of layers of bidirectional LSTM

[0115] label_dim: entity label vector dimension

[0116] train_batch_size: The size of the training data batch

[0117] max_seq_length: Maximum length of the input text

[0118] learning_rate: learning rate size

[0119] num_train_epochs: The number of iterations for all training data

[0120] output_dir: model save path

[0121] 2) Prediction part:

[0122] Run the shell command through the command line or other means to call it. The command format is as follows:

[0123] python test_joint_nre.py (main program script) [call parameters]

[0124] Parameter Description:

[0125] data_type: prediction or test data format, supports txt text files and json files, the corresponding values ​​are [txt,json]

[0126] test_file: The location of the prediction or test data, which can be specific to the file name or the path name of the file

[0127] test_file_encode: data file encoding format, [gb18030,utf-8]

[0128] model_dir: The trained model path

[0129] topk: The maximum number of relationship categories predicted between each pair of entities. Only the number of relationships less than or equal to this value is returned.

[0130] threshold: The predicted relationship threshold between each pair of entities [0, 1], only relationships greater than or equal to this value are returned

[0131] result_file: The file name where the results are saved.

[0132] It can be understood by those skilled in the art that the above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC, FPGA or SoC). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the processing method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the processing shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the processing shown herein.

[0133] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention.

[0134] Finally, it should be noted that the above description is only the best embodiment of the present invention and does not limit the present invention in any form. Any technician familiar with the art can make many possible changes and simple replacements to the technical solution of the present invention by using the above disclosed practices and technical contents without departing from the scope of the technical solution of the present invention, which all belong to the scope of protection of the technical solution of the present invention.

Claims

1. A method for joint extraction of entities and relations based on deep neural networks, characterized in that: include: Perform text segmentation on the input text to obtain word segmentation after text processing; The word segmentation after text processing is vectorized and input into the long short-term memory neural network. The text was forward coded and reverse coded; Performing text feature concatenation processing on the forward coding and the reverse coding to obtain features of each word after integrating context information; The conditional random field algorithm is used to obtain the conditional transition probability between entity tags and the probability distribution of each word on the entity tag, and the entity tag with the largest probability value for each word is vectorized. Merge the features of each word in the text after integrating the context information with the corresponding label vector representation; Traverse each word in the text in turn, and compare the vector features corresponding to each word with the vector features corresponding to other words in the text, and perform relationship classification according to the deep neural network model corresponding to the text processing process, including word segmentation, text vectorization, forward and reverse encoding of long short-term memory neural network, feature fusion, conditional random field algorithm, conditional transition probability and probability distribution processing of each word on entity label, and attention operation between features. Based on the relationship classification processing results, extract the entities contained in the text and the corresponding relationships between entities; The relationship classification process uses a joint extraction method of entities and relationships based on a deep neural network to annotate entity labels using a BIO annotation method; the BIO annotation includes: an entity's starting position label, an entity's non-starting position label, and a label for a non-entity part; and a multi-classification method is used to extract relationship labels; The entity labels are annotated by using the BIO annotation method and the relationship labels are extracted by using the multi-classification method, specifically including: The obtained word vector is sent to a k-layer bidirectional long short-term memory neural network composed of forward and reverse directions for learning, and finally the obtained forward and reverse outputs are concatenated to obtain a text composed of a matrix Ml; The output of the bidirectional long short-term memory neural network is sent to the conditional random field algorithm layer for learning to obtain the conditional probability transfer matrix Mt and the entity label matrix Mb, where Mb is the result of taking the maximum probability value of each word in the text T on the entity label probability distribution; In the BIO annotation processing layer, the entity label matrix Mb is vectorized to obtain the vectorized matrix Me; Concatenate the matrix M1 and the matrix Me row by row to obtain a matrix Mr; Traverse the vector corresponding to each word in Mr, perform attention calculation based on the vector corresponding to each word and the vectors corresponding to other words, and obtain the relationship probability distribution R; Based on the entity label matrix Mb and the relationship probability distribution R, the entity labels and corresponding relationships contained in the text are counted, and according to the system parameters and thresholds, the relationships with low probability values ​​or invalid are filtered out to extract the entities contained in the text and the corresponding relationships between entities.

2. The method according to claim 1, characterized in that The relationship classification processing includes: performing attention operations on the vector corresponding to each word and the vectors corresponding to other words in the text, and using a multi-classification method to determine whether there is a relationship or multiple relationships between the two words; based on the judgment result between the two words, extracting the entities contained in the text and the corresponding relationships between the entities.

3. The method according to claim 1, characterized in that Also includes: Read the data, segment the text, and obtain the segmented text T; send the segmented text to the word embedding layer for word embedding operation, and each word will be represented as a D-dimensional vector; the text T can be represented as an L×D matrix, where L is the maximum length of the text after segmentation.

4. The method according to claim 1, characterized in that: Also includes: The long short-term memory neural network, forward encoding and reverse encoding are processed by text feature splicing, conditional random field algorithm, conditional transition probability and probability distribution of each word on the entity label, and the features of each word in the text after integrating contextual information are merged with the corresponding label vector representation. Model training is performed and model parameters are obtained through convergence method or training method with maximum number of iterations.

5. The method according to claim 4, characterized in that Based on the trained model parameters, entity and relationship joint extraction is performed on the text to be processed to extract the entities contained in the text to be processed and the corresponding relationships between the entities.

6. The method according to claim 1, characterized in that The entity and relationship joint extraction method based on deep neural network is applied in python3 and tensorflow environment, and is written in python language, and the application medium is python script.

7. A non-volatile storage medium, characterized in that: A computer program is stored thereon; the computer program is executed by a processor to implement the entity and relationship joint extraction method based on a deep neural network as described in any one of claims 1-6.

8. A data processing system, characterized in that: include: Memory, processor, and Computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the entity and relationship joint extraction method based on a deep neural network as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Text corpus processing method and device

    CN111160035A