An incremental relation extraction method based on course planning meta-learning

By introducing course planning meta-learning in relation extraction, the 'catastrophic forgetting' and 'order sensitivity' problems of traditional supervised learning methods in incremental data processing are solved, the stability and accuracy of the model are improved, and more efficient is achieved The effect of relationship extraction.

CN112084330BActive Publication Date: 2025-01-14SOUTHEAST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010806791.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-12
Publication Date
2025-01-14
Estimated Expiration
2040-08-12

AI Technical Summary

Technical Problem

Traditional supervised learning relationship extraction methods are prone to 'catastrophic forgetting' and 'order sensitive' problems when facing incremental data, resulting in the model losing the ability to identify the original data set when processing new data, and its performance is unstable. It is difficult to ensure the quality of the knowledge graph construction.

Method used

The incremental relationship extraction method based on course planning meta-learning is adopted, and the incremental relationship extraction framework is constructed, including the relationship extraction neural network model, memory cache list, meta-learning parameter update formula and memory training course planning method, and the similarity between relationships is calculated. Re-plan the memory cache training sequence, update the model parameters, and select the memory cache through clustering method to perform performance testing until no new tasks need to be processed.

Benefits of technology

It effectively improves the average accuracy and overall accuracy of the model, reduces the error range, alleviates the problems of "catastrophic forgetting" and "order sensitivity", and achieves better results than traditional methods on mainstream data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112084330B_ABST
    Figure CN112084330B_ABST
Patent Text Reader

Abstract

The present invention discloses an incremental relation extraction method based on course planning meta-learning, comprising the following steps: constructing a course planning meta-learning incremental relation extraction framework; calculating the similarity between relations, and re-planning the memory cache training order according to the similarity; training the relation extraction neural network model, and combining the meta-learning idea, using the meta-learning parameter update formula to update the parameters of the relation extraction neural network model; using the clustering method to select a batch of memory caches from the training data; loading the updated parameters into the relation extraction neural network model, and performing performance testing. The present invention introduces course learning and meta-learning ideas into the incremental relation extraction task, effectively improving the average accuracy and overall accuracy of the model, and reducing the error range of the model, thereby effectively alleviating the "catastrophic forgetting" and "order sensitivity" problems in incremental learning, and achieving results superior to traditional methods on mainstream data sets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer natural language processing, and specifically relates to an incremental relationship extraction method based on course planning meta-learning. Background Art

[0002] Relation extraction is an important task in the field of information extraction, which aims to extract the semantic relationship between specified entity pairs from natural language text. Figure 1 In the example given, there is a relationship "located in" between "Southeast University" and "Nanjing". Relationship extraction has a wide range of application scenarios in subsequent applications such as automatic construction of knowledge graphs, automatic question answering, and text mining.

[0003] Traditional supervised learning relationship extraction methods have achieved good results in this task and are widely used. However, in actual usage scenarios, the construction of knowledge graphs is often a continuous, iterative and incremental process. New relationship categories will be continuously added, which also puts higher requirements on the relationship extraction system, that is, it must be able to process incremental data. Traditional supervised learning relationship extraction methods still have limitations in this regard.

[0004] Traditional supervised learning relationship extraction methods are based on supervised learning settings. This type of method often requires pre-defining all possible relationships when training the model and using the full data set for training. This requires traditional relationship extraction methods to use the full data including incremental data to retrain the classification model when facing new data, which will cost a lot of computing power and time. Some models have the ability to handle new relationship categories, such as metric learning models, but if the incremental data is directly used to train the model to recognize new categories, it will lead to a serious "catastrophic forgetting" problem, that is, once a new data set is used to train an existing model, the model will lose the ability to recognize the original data set, which is also a major challenge in incremental learning.

[0005] Another important issue in incremental learning relation extraction is "order sensitivity", that is, the neural network for relation extraction will continuously process a series of tasks during the update and iteration process, each of which contains different relation categories and training data. The final system performance is not only affected by the division of training data, but also to a large extent by the training order of each task during the training process. This makes the performance of the relation extraction system unstable, which makes it difficult to control the quality of subsequent knowledge graph construction work. Summary of the invention

[0006] Purpose of the invention: In order to overcome the deficiencies in the prior art, an incremental relationship extraction method based on course planning meta-learning is provided. The method is based on meta-learning and creatively incorporates course planning methods, which can better solve the problems of "catastrophic forgetting" and "order sensitivity".

[0007] Technical solution: To achieve the above purpose, the present invention provides an incremental relationship extraction method based on course planning meta-learning, comprising the following steps:

[0008] S1: Constructing a course planning meta-learning incremental relation extraction framework; the incremental relation extraction framework includes a relation extraction neural network model, a memory cache list, a network model training method, a meta-learning parameter update formula, a memory cache screening method, and a memory training course planning method;

[0009] S2: Calculate the similarity between relations and re-plan the memory cache training order based on the similarity;

[0010] S3: Train the relation extraction neural network model, and combine the meta-learning idea to use the meta-learning parameter update formula to update the parameters of the relation extraction neural network model;

[0011] S4: Select a batch of memory caches from the training data in step S3 using a clustering method;

[0012] S5: Load the updated parameters into the relation extraction neural network model and perform performance testing;

[0013] S6: Repeat steps S3-S5 until there are no new tasks to be processed.

[0014] Furthermore, the meta-learning parameter update formula in step S3 updates the parameters of the relation extraction neural network model by substituting the optimal parameters of the current task and the parameters of the previous task into the meta-learning parameter update formula for updating.

[0015] Furthermore, the memory cache selection method in step S4 is specifically as follows:

[0016] A1: Obtain vector representations of natural language sentences for all instances in the training data from the hidden layer of the relation extraction neural network model;

[0017] A2: Use the K-Means clustering algorithm to cluster all vector representations into the required number of categories to be memorized. Each category will have a vector representation of at least one instance of a sentence. For a category with only one instance, take the instance of that category as a memory. For a category with more than one instance, calculate the arithmetic mean of the vector representations of all instance sentences in that category as the vector center of all instance sentences in that category, and take the instance whose instance sentence vector is closest to the vector center in Euclidean distance as the memory instance.

[0018] Furthermore, the calculation process of the similarity between relations in step S2 is as follows: let the relation label text be R, and use the word segmentation tool to divide R into a list consisting of multiple words [W1, W2, ..., W n ], get the word vector list [E1, E2, ..., E n ], take the mean of the word vector list as the vector representation of relation R, and calculate relation R pair by pair i and R j The cosine similarity between i,j , saved in the similarity matrix Sim.

[0019] Furthermore, the planning process of the memory cache training sequence in step S2 is as follows: when the task list is not empty, take out the first task Task in the list i All training data contains k relationship categories Will Add to SeenRelations (known relationship set), which is used to store relationships that have already appeared.

[0020] Furthermore, the training process of the relation extraction neural network model in step S3 is:

[0021] Each relation class has N train training instances, N valid Validation instances and N test test instances, remove the labels that do not exist in SeenRelations from the error relation label lists of these three groups of instances; train The training instances are divided into N batch The training batch is divided into a length of The Ceil function represents rounding up;

[0022] For the first task Task0, loop through each training batch TrainBatch and train the relation extraction neural network;

[0023] For non-first taski , loop out each training batch TrainBatch, and loop out a task's memory instance group M from MemoryList j Each instance in the memory instance group contains a relational category label. From the similarity matrix Sim, the similarity between the relational category label of each instance in the memory instance group and the relational category label of the instance in the training data batch is obtained. The memory instance group is arranged from small to large using the similarity, and the sorted memory instance group M′ is used. j Train the relation extraction neural network, and then use the training batch TrainBatch to train the relation extraction neural network;

[0024] For any task i After each complete cycle of the training data list, use the validation instance Evaluate the network training status of the current task and save the parameters θ of the best performing round of network i , when the network does not achieve better results on the current task for multiple rounds, update the network parameters

[0025] Furthermore, the meta-learning parameter update formula in step S3 includes a linear parameter update formula, a fixed parameter update formula, and a square root parameter update formula. Different formulas can be used on different data sets, which have a certain impact on the final performance effect and are one of the hyperparameters that can be adjusted. The three formulas can be used separately for experiments according to the actual application scenario to finally determine the specific formula form.

[0026] Furthermore, the performance test in step S4 is performed by testing the average accuracy and overall accuracy of the test model on the test data of all previous tasks.

[0027] Furthermore, the calculation formula of the average accuracy in step S4 is as follows:

[0028]

[0029] Among them, acc i For Task i The accuracy on the test instance set;

[0030] The overall accuracy is calculated as follows:

[0031]

[0032] in, is the accuracy on all test data.

[0033] Furthermore, the calculation method of the error range of the performance indicator in step S4 is: re-dividing the tasks or disrupting the task order, measuring the performance under other task divisions or task orders, and calculating the average accuracy and overall accuracy under various task divisions and orders, and calculating the error range of the performance indicator according to the following formula:

[0034]

[0035] in, It represents the confidence coefficient when the confidence level is α, δ represents the standard deviation of the statistical sample, and n is the number of statistical samples.

[0036] In the present invention, incremental learning relation extraction is a relation extraction setting that is closer to actual application scenarios. In incremental learning relation extraction, data is divided by task, each task contains a set of relation categories that are different from other tasks, and each relation category has a set of training instances D train , a set of verification instances D valid and a set of test instances D test Each instance consists of a natural language sentence S, a pair of entities (H, T) contained in the sentence, the correct relationship label (R) between the entities, and several incorrect relationship labels [R1, R2, …, R s ] The artificial neural network model processes each task in a certain order and trains until there are no new tasks. At this time, the model can judge all the relationships that have appeared.

[0037] For incremental learning relation extraction methods, there are three indicators to measure their performance: overall accuracy, average accuracy, and error range. Overall accuracy refers to the accuracy achieved by the method on the test set of all trained relations, reflecting the performance level of the method; average accuracy refers to the arithmetic mean of the accuracy that can be achieved on the test set of all processed tasks, reflecting the ability of the method to resist "catastrophic forgetting"; the error range reflects the random fluctuation of the overall accuracy and average accuracy of the method for task sequences composed of multiple groups of different data divisions and sequences, reflecting the ability of the method to resist "order sensitivity".

[0038] Beneficial effects: Compared with the prior art, the present invention introduces curriculum learning and meta-learning ideas into the incremental relationship extraction task, effectively improving the average accuracy and overall accuracy of the model and reducing the error range of the model, thereby effectively alleviating the "catastrophic forgetting" and "order sensitivity" problems in incremental learning, and achieving better results than traditional methods on mainstream data sets. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a specific example of the relation extraction introduced in the background technology;

[0040] Figure 2 is an optional formula for updating the neural network model parameters in the present invention;

[0041] Figure 3 is a flow chart of an incremental relation extraction framework based on course planning meta-learning according to an embodiment of the present invention;

[0042] Figure 4 is the structure of the relation extraction neural network model in the embodiment of the present invention;

[0043] Figure 5 It is a performance comparison chart of the method of the present invention and the currently existing methods. DETAILED DESCRIPTION

[0044] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.

[0045] In this embodiment, based on the incremental relation extraction dataset Lifelong FewRel, the BiLSTM model is used as the relation extraction neural network model, and its structure is as follows: Figure 4 As shown, the GloVe word embedding vector is used as the pre-trained word vector to encode the words in the sentence.

[0046] In this embodiment, an incremental relationship extraction method based on course planning meta-learning provided by the present invention is applied, such as Figure 3 As shown, it specifically includes the following steps:

[0047] Step 1) Divide the dataset by task.

[0048] Read the Lifelong FewRel dataset and use the word segmentation tool to separate the relationship list [R1, R2, …, R n ] are segmented, and each word in the relationship is encoded using the GloVe word embedding vector. The average of the segmented words belonging to each relationship is calculated to obtain the vector representation list of the relationship [E1, E2, …, E n ]. Use the K-Means algorithm to cluster the vector list of relationships into 10 different clusters, so that all relationships can be divided into 10 different clusters.

[0049] According to the above division, the training data, verification data and test data in the dataset are divided into 10 tasks according to the correct relation labels of the instances.

[0050] Initialize the parameters θ0 of the BiLSTM model, which is a relation extraction neural network.

[0051] Initialize an empty list as the memory list MemoryList to store the memory instance groups filtered out after each task training.

[0052] Initialize an empty list SeenRelations to store the correct relation labels contained in all trained instances.

[0053] Step 2) Calculate the similarity between relationship categories.

[0054] Use the relationship vector obtained in step 1) to represent the list [E1, E2, …, E n ], take E pair by pair i and E j Calculate the cosine similarity, denoted as Sim i,j , saved in the similarity matrix Sim.

[0055] Step 3) If the task list is not empty, take out the first task in the list. i All training data contains k relationship categories Will Add them to SeenRelations. Remove the labels that do not exist in SeenRelations from the wrong relation label lists in the training instances, validation instances, and test instances, and divide the training data into training batches of size 50.

[0056] For the first task Task0, loop out each training batch TrainBatch, and for each training instance in a training batch, use the word segmentation tool to segment the sentence S, and use the GloVe word vector to encode the sentence S. The encoded sentences and the correct relationship category labels in the training instance are used as a set of training positive examples, and the encoded sentences and the wrong relationship labels in the training instance are used one by one to form training negative examples. The processed sentence encoding is used as the input of the relation extraction neural network BiLSTM model, the positive example label or the negative example label is used as the label of the model, MarginLoss is used as the model loss function, and the Adam algorithm is used to optimize the model through back propagation.

[0057] For non-first task i , loop out each training batch TrainBatch, and loop out a task's memory instance group M from MemoryList jEach instance in the memory instance group contains a relational category label. From the similarity matrix Sim, the similarity between the relational category label of each instance in the memory instance group and the relational category label of the instance in the training data batch is obtained. The memory instance groups are arranged from small to large using the similarity. The sorted memory instance groups M′ are encoded and processed according to the above method. j The BiSLTM model is trained using the processed data together with the normal training batch TrainBatch.

[0058] For any task i After each complete cycle of the training data list, use the validation instance Evaluate the network training status of the current task and save the parameters θ of the best performing round of network i , when the network fails to achieve better results on the current task for several consecutive rounds, you can use Figure 2 One of the formulas updates the parameters on the current task In this embodiment, the use Figure 2 The linear parameter update formula in updates the parameters on the current task

[0059]

[0060] in, It represents the parameters of the model after the previous task is completed, ∈ is a fixed constant, and n is the total number of tasks.

[0061] Step 4) From the currently completed training task Task i Training data In , 50 instances are selected as the memory instance group of the current task according to the following method.

[0062] Get all training data from the relation extraction neural network BiLSTM model The vector representation of the natural language sentence S of the instance in , which can be obtained from the output of the last hidden layer of the model, uses the K-Means clustering algorithm to cluster all vector representations into 50 categories. There will be a vector representation of the sentence of at least one instance in each category.

[0063] For a category with only one instance, take the instance of the category as a memory; for a category with more than one instance, calculate the arithmetic mean of the vector representations of all instance sentences under the category, and take the instance whose instance sentence vector representation is closest to the average Euclidean distance as the memory. Each task will take 50 memory instances and add them to the MemoryList.

[0064] Step 5) Update the network parameters Load the relation extraction network classification network BiLSTM model and test the average accuracy and overall accuracy of the model on the test data of all previous tasks.

[0065] The calculation formula for the average accuracy is as follows:

[0066]

[0067] Among them, acc i For Task i The accuracy on the test set of examples.

[0068] The overall accuracy is calculated as follows:

[0069]

[0070] in, is the accuracy on all test data.

[0071] Step 6) Repeat steps 3) to 5) until there are no new tasks to be processed. The average accuracy and overall accuracy under the current task division are measured.

[0072] Re-divide the tasks or disrupt the order of tasks, and then repeat steps 2) to 5). Measure the performance under other task divisions or task orders. Count the average accuracy and overall accuracy under various task divisions and orders, and further calculate the error range of the performance indicators. The calculation formula is as follows:

[0073]

[0074] in, It represents the confidence coefficient when the confidence level is α, δ represents the standard deviation of the statistical sample, and n is the number of statistical samples.

[0075] In order to verify the effect of the method of the present invention, this embodiment compares the performance of the method of the present invention with the traditional supervised learning method and other incremental relationship extraction methods. The comparison results are as follows: Figure 5 As shown, it can be seen that the average accuracy and overall accuracy of the method of the present invention on the incremental relationship extraction datasets: Lifelong FewRel dataset and Lifelong SimpleQuestion dataset are better than those of the traditional method and other incremental relationship extraction methods, and have a smaller error range, which shows that the method proposed in the present invention can effectively alleviate the "catastrophic forgetting" problem in incremental learning and has better stability.

[0076] In summary, the method of the present invention is based on the Lifelong FewRel dataset and the Lifelong SimpleQuestion dataset, takes the BiLSTM model as the relation extraction neural network, uses the GloVe pre-trained word vector, and combines the curriculum learning and meta-learning ideas to propose an incremental relation extraction method with high accuracy and high stability. Based on this method, a better relation extraction neural network model can be trained in the application scenario of continuous updating and iteration, and an incremental relation extraction system with sustainable learning can be constructed.

Claims

1. An incremental relation extraction method based on course planning meta-learning, characterized in that: The following steps are involved: S1: Constructing a framework for incremental relation extraction for meta-learning of course planning; In meta-learning incremental relations, the data is divided by tasks, each task contains a set of relation categories that are different from other tasks, and each relation category has a set of training instances D train , a set of verification instances D valid and a set of test instances D test Each instance consists of a natural language sentence S, a pair of entities contained in the sentence, a correct relationship label R between the entities, and several incorrect relationship labels [R1, R2, …, R s ]composition; S2: Calculate the similarity between relations and re-plan the memory cache training order based on the similarity; S3: Train the relation extraction neural network model, and combine the meta-learning idea to use the meta-learning parameter update formula to update the parameters of the relation extraction neural network model; S4: Select a batch of memory caches from the training data in step S3 using a clustering method; S5: Load the updated parameters into the relation extraction neural network model and perform performance testing; S6: Repeat steps S3-S5 until there are no new tasks to be processed; The meta-learning parameter update formula in step S3 updates the parameters of the relation extraction neural network model by substituting the optimal parameters of the current task and the parameters of the previous task into the meta-learning parameter update formula for updating; The method for selecting the memory cache in step S4 is specifically as follows: A1: Obtain vector representations of natural language sentences for all instances in the training data from the hidden layer of the relation extraction neural network model; A2: Use the K-Means clustering algorithm to cluster all vector representations into the required number of categories. Each category will have a vector representation of at least one instance of the sentence. For a category with only one instance, take the instance of the category as a memory. For a category with more than one instance, calculate the arithmetic mean of the vector representations of all instance sentences in the category as the vector center of all instance sentences in the category, and take the instance whose instance sentence vector is closest to the vector center in Euclidean distance as the memory instance. The calculation process of the similarity between relations in step S2 is as follows: let the relation label text be R, and use the word segmentation tool to divide R into a list consisting of multiple words [W1, W2, ..., W n ], get the word vector list [E1, E2, ..., E n ], take the mean of the word vector list as the vector representation of relation R, and calculate relation R pair by pair i and R j The cosine similarity between i,j , saved in the similarity matrix Sim; The planning process of the memory cache training sequence in step S2 is as follows: when the task list is not empty, take out all the training data of the first task Task0 in the list contains k relationship categories Will Add to the known relationship set SeenRelations; The training process of the relation extraction neural network model in step S3 is: Each relation class has N train training instances, N valid Validation instances and N test test instances, remove the labels that do not exist in SeenRelations from the error relation label lists of these three groups of instances; train The training instances are divided into N batch The training batch is divided into a length of The Ceil function represents rounding up; For the first task Task0, loop through each training batch TrainBatch and train the relation extraction neural network; For tasks other than the first one, loop out each training batch TrainBatch, and loop out a memory instance group M of a task from MemoryList j Each instance in the memory instance group contains a relational category label. From the similarity matrix Sim, the similarity between the relational category label of each instance in the memory instance group and the relational category label of the instance in the training data batch is obtained. The memory instance group is arranged from small to large using the similarity, and the sorted memory instance group M' is used. j Train the relation extraction neural network, and then use the training batch TrainBatch to train the relation extraction neural network; For any task i After each complete cycle of the training data list, use the validation instance Evaluate the network training status of the current task and save the parameters θ of the best performing round of network i , when the network fails to achieve better results on the current task for multiple rounds, update the network parameters The meta-learning parameter update formula in step S3 is a linear parameter update formula, specifically: in, is the parameter of the current task, It represents the parameters of the model after the previous task is completed, ∈ is a fixed constant, and n is the total number of tasks.

2. According to claim 1, the incremental relationship extraction method based on course planning meta-learning is characterized in that: The performance test in step S4 is performed by testing the average accuracy and overall accuracy of the test model on the test data of all previous tasks, and calculating the error range of the performance indicator.

3. The incremental relationship extraction method based on course planning meta-learning according to claim 2 is characterized in that: The calculation formula of the average accuracy in step S4 is as follows: Among them, acc i For Task i The accuracy on the test instance set; The overall accuracy is calculated as follows: in, is the accuracy on all test data.

4. The incremental relationship extraction method based on course planning meta-learning according to claim 2 is characterized in that: The calculation method of the error range of the performance indicator in step S4 is: re-dividing the tasks or disrupting the order of tasks, measuring the performance under other task divisions or task orders, and counting the average accuracy and overall accuracy under various task divisions and orders, and calculating the error range of the performance indicator according to the following formula: in, It represents the confidence coefficient when the confidence level is α, δ represents the standard deviation of the statistical sample, and n is the number of statistical samples.

Citation Information

Patent Citations

  • Social media graph representation model-based social risk event extraction method

    CN105956197A

  • System and method for the indexing and retrieval of semantically annotated data using an ontology-based information retrieval model

    US20160179945A1