Alloy triple continuous relation extraction method
By combining the continuous learning method of cross-entropy loss and supervised contrast loss, the catastrophic forgetting and overfitting problems in the construction of knowledge graphs in the alloy field are alleviated, and the continuous relationship extraction of alloy triplets is achieved, which improves the prediction accuracy and learning efficiency of the model.
Patent Information
- Application Number
- CN202510584263.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-15
AI Technical Summary
Existing alloy field knowledge graph construction methods are prone to catastrophic forgetting and overfitting problems when facing dynamic data updates, resulting in degradation of model performance and difficulty in meeting the needs of continuous relationship extraction.
Using a continuous learning method combining cross entropy loss and supervised contrast loss, through memory enhancement strategies and embed consistency loss, catastrophic forgetting and overfitting problems were alleviated, and the alloy triple-continuous relationship extraction model was constructed, and memory samples were selected using clustering algorithms and feature space representations were performed.
The continuous relationship extraction of alloy triplets in a dynamic data environment is realized, which improves prediction accuracy and learning efficiency, avoids the model's forgetting and overfitting old tasks, and ensures the efficient and stable model.
Smart Images

Figure CN120494080A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for extracting continuous relations of alloy triples, and belongs to the interdisciplinary technical field of metallurgical engineering and artificial intelligence. Background Art
[0002] Constructing a knowledge graph in the alloy domain requires extracting entities and their relationships from a vast amount of information to form a structured knowledge system. In practice, as information continues to grow, new relationship categories and related data are often continuously added, resulting in an ongoing expansion and iteration process. Traditional relationship extraction models extract entities and relationships from static datasets, typically assuming that all relationship types are predefined and fixed. The model is learned once and then applied without considering dynamic changes in data or tasks. However, this approach requires significant time and resources, and its efficiency and reliability struggle to meet the design demands of a growing professional domain. In contrast, continuous relationship extraction tasks can gradually learn new relationship types from dynamic, constantly updating data while maintaining the ability to recognize existing relationships. However, a major challenge facing continuous relationship extraction is catastrophic forgetting: in continuous learning scenarios, the model tends to forget previously learned knowledge. This is particularly true in deep learning models, where new tasks overwrite the weights of old tasks, leading to significant performance degradation. Most existing solutions fail to consider the consistency of the feature space representation of memory samples between previous and subsequent tasks, resulting in poor performance in continuous relationship extraction. At the same time, the small number of memory playback samples was not considered, which led to the overfitting problem of the model.
[0003] For the task of continuous entity relationship extraction, the continuous learning method based on memory replay has been proven to be the most effective and outperforms other methods. This method effectively alleviates the problem of catastrophic forgetting by moderately storing some representative sample data and training the model on a combination of prior relationship memory samples and new relationship samples. The core issue of continuous relationship learning is to alleviate the model's forgetfulness of old tasks when learning new tasks. Since neural network training relies on the continuous and repeated optimization of fixed parameters, the most direct solution is to store all historical data and model parameters and retrain the model when new relationship instances appear. Although this solution is the best in theory, it requires a lot of computing resources and time in actual applications, making it difficult to be widely adopted in practice.
[0004] To address these issues, this paper proposes a continuous relation extraction framework that combines classification loss with contrastive loss to solve the problem of classifying complex semantic relationships. In the memory selection phase, a memory enhancement strategy is proposed to address the overfitting problem caused by reusing memory sample data. In the memory playback phase, an embedding consistency loss is combined to address the problem of inconsistent embeddings of memory samples. Summary of the Invention
[0005] The technical problem to be solved by this invention is to provide a method for extracting continuous relationships from alloy triples. Because alloy data often suffers from triple overlap and constant data updates, this method, based on the concept of continuous learning, performs prototype-based continuous relationship extraction on alloy data. This method can provide high-quality structured data for downstream tasks such as knowledge graph construction. In subsequent applications, this method can be applied not only to the specific field of alloys but also to other fields with appropriate adjustments.
[0006] The technical solution of the present invention is: a method for extracting continuous relations of alloy triples, the specific steps of which are:
[0007] Step 1: Obtain the title, abstract, and text content from the alloy literature for entity and relationship annotation to obtain an entity relationship extraction dataset. The dataset is then preprocessed and divided into several tasks, each of which represents a relationship extraction task.
[0008] Step 2: Initialize the training module and use the pre-trained language model to extract features from the pre-processed data. The cross entropy loss is combined with the supervised contrast loss to obtain feature representations of different types of data.
[0009] Step 3: Construct a memory sample selection strategy. Based on the obtained feature representation of different types of data, use a clustering algorithm to cluster each relationship in the current training set during the current task training phase. Select several samples closest to the cluster center and store them in the memory space as memory samples.
[0010] Step 4: Design a memory enhancement strategy to expand the memory sample data in the memory space;
[0011] Step 5: Build a memory replay training module, introduce embedding consistency loss, classify the expanded memory sample data and new task data, obtain feature space representation, and ensure the decision boundaries of different tasks;
[0012] Step 6: In the prediction stage, for a given test sample, the nearest class mean classifier is used to calculate the distance between the embedding of the test sample and the feature space of all relationship prototypes, and assign the test sample to the prototype label with the nearest distance, thereby realizing the extraction of relationships of different classes.
[0013] The Step 1 is specifically as follows:
[0014] Step 1.1: kth task T k Contains independent training sets Validation set Test set and the corresponding relation set Rk , R k Contains at least one relationship category, for the sample x i is the input text, which contains the entity pair information in the triple, y i ∈R k Represents the relationship category of triple entity pairs, and N is the number of relationships;
[0015] Step 1.2: After the relation extraction model completes the learning of the kth task, use the union of the first k task test sets Evaluate the performance of the model to make it recognize all learned relationship categories
[0016] The Step 2 is specifically as follows:
[0017] Step 2.1: Use special characters [E11], [E12], [E21] and [E22] to mark the entities, where [E11] and [E21] represent the start tags of the head entity and the tail entity, and [E12] and [E22] represent the end tags of the head entity and the tail entity. Use the pre-trained language model to train the input sample x. i Perform feature extraction and obtain feature representation:
[0018]
[0019] Among them, z x is the feature representation, E is the vectorization processing of the pre-training model, denote the head entity and the tail entity respectively, d is the dimension of the hidden layer in the pre-trained model, is a trainable parameter;
[0020] Step 2.2: Use the classification head of the classifier to transform z x Embedded into f(z x ) In the classification function, a linear Softmax classifier is used to calculate the input sample x i The classification probability and the cross entropy loss L are used ce1 Optimize the model;
[0021] Step 2.3: Use the comparison head of the classifier to convert z x Embedded into h(z x ) In the comparison function, supervised contrast loss L is used SupCon Optimize the model;
[0022] Step 2.4: Use a combination of cross entropy loss and supervised contrastive learning loss to reduce the distance between similar relationship samples in the embedding space, thereby obtaining feature representations of different types of data. For each new task, repeat Step 2.2-Step 2.3 until all tasks complete initialization training.
[0023] The Step 3 is specifically as follows:
[0024] Step 3.1: Use the clustering algorithm to classify each relation r=R in the current training set during the current task training phase. k Perform clustering, calculate the distance between each sample vector encoding and the k cluster centers, then select the m samples closest to the cluster center for each relationship category, and store the m samples as memory samples in the memory space M r middle;
[0025] Step 3.2: Record the proportion of each cluster to all samples as the weight information w of the memory sample r,i , so that samples with high weights are replayed first in the memory replay phase.
[0026] The Step 4 is specifically as follows:
[0027] Step 4.1: Use memory enhancement strategy to increase the number of memory samples;
[0028] Step 4.2: Use the increased number of memory samples to store the memory space M r All typical samples in are expanded, and the expanded memory sample set is expressed as
[0029] The memory enhancement strategy is specifically:
[0030] For the memory space M r Samples with relation category r From M r Select samples of the same category
[0031] Will and The head entity and tail entity are swapped, and the rest of the text content remains unchanged. To represent the newly expanded sample data, as an additional expanded sample of relation r;
[0032] From M r Randomly select a sample x from m , add it to At the end of the text, we get a new extended sample of relation r, expressed as Among them, xm Not a typical sample of relation r.
[0033] The Step 5 is specifically as follows:
[0034] Step 5.1: The training set of the new task The memory space M of the first k tasks r and expanded memory sample set Mixing
[0035] Step 5.2: Repeat Step 2 with the mixed data and add the embedding consistency loss when calculating the loss. By limiting the changes in the embedding of old samples, the model is ensured to maintain the structural information of the embedding space when processing new tasks, and continuously review and consolidate the key features of the old tasks, thereby obtaining the feature space representation of the new and old data samples and ensuring the task-specific decision boundary.
[0036] The beneficial effects of the present invention are:
[0037] (1) Dynamic and continuous extraction: Compared with the existing static extraction method, this invention combines the idea of continuous learning to achieve a significant distinction between new and old tasks as the number of tasks increases, and can continuously extract the relationship between alloy triplets;
[0038] (2) Accurate modeling by integrating multiple loss functions: Different from traditional models, this paper introduces supervised contrast loss, cross entropy loss and consistency loss to accurately capture the dynamic changes of key parameters and improve prediction accuracy and reliability;
[0039] (3) Efficient memory playback construction: The present invention adopts a memory sample selection strategy, performs feature extraction on the memory samples and performs an enhancement strategy on the memory samples, so as to avoid the problems of high space requirements due to the large memory samples and overfitting caused by the accumulation of model parameter changes, thereby improving learning efficiency and optimization performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is the overall framework diagram of the present invention;
[0041] Figure 2 is a graph of the number of class instances;
[0042] Figure 3 This is a performance chart of different models. DETAILED DESCRIPTION
[0043] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0044] Example 1: To verify the effect of the model of the present invention in the continuous extraction of triple relations, this example actually constructs an alloy Chinese entity relationship extraction dataset based on PDF documents. By simulating the extraction ability of the Chinese continuous relation extraction model (PBCRE-Net) in a real environment and comparing it with the baseline model, the accuracy of the model is evaluated, indicating that the PBCRE-Net model has higher applicability and robustness. Figure 1 As shown in Figure 1, a method for extracting continuous relations of alloy triples is described. The specific steps are as follows:
[0045] Step 1: Obtain the title, abstract and text content from the alloy literature for entity and relationship annotation to obtain an entity relationship extraction dataset. Preprocess the dataset and divide it into several tasks, each of which represents a relationship extraction task.
[0046] Step 1.1: Divide the data into a series of tasks T = {T1, T2, T3, ..., T k}, the kth task T k Contains independent training sets Validation set Test set and the corresponding relation set R k , R k Contains at least one relationship category, for the sample x i is the input text, which contains the entity pair information in the triple, y i ∈R k Represents the relationship category of triple entity pairs, and N is the number of relationships;
[0047] Step 1.2: As the number of tasks increases, the evaluation of model performance will become more challenging. After the relation extraction model completes the learning of the kth task, the union of the first k task test sets is used. Evaluate the model's performance to ensure it can accurately identify all learned relationship categories Maintain good performance on both the kth task and the first k-1 tasks.
[0048] Specifically, under the guidance of experts in the field of materials, 60 high-quality Chinese scientific research papers were selected for analysis and discussion. The abstracts, titles, and experimental sections of the papers were selected as the main content of the dataset annotation. After data preprocessing and detailed manual annotation, a total of 2517 entity relationship triples were finally obtained. On this basis, a dataset CMeIE with the same structure in different fields was added to simulate the incremental learning scenario. In this way, an incremental learning scenario with 10 tasks was constructed. Each task contains 6 relationship categories. This can maximize the simulation of unknown data of different relationship categories. The examples of different categories are shown in the figure below. Figure 2 shown.
[0049] Step 2: Initialize the training module, use the pre-trained language model to extract features from the pre-processed data, and use a combination of cross entropy loss and supervised contrast loss to obtain feature representations of different types of data.
[0050] Step 2.1: When a new task appears, since the extracted relation categories are related to the sample data entity pairs, special characters [E11], [E12], [E21] and [E22] are used to mark the entities, where [E11] and [E21] represent the start tags of the head entity and the tail entity, and [E12] and [E22] represent the end tags of the head entity and the tail entity. The pre-trained language model is used to train the input sample x. i Perform feature extraction and obtain feature representation:
[0051]
[0052] Among them, z x is the feature representation, E is the vectorization processing of the pre-training model, denote the head entity and the tail entity respectively, d is the dimension of the hidden layer in the pre-trained model, As a trainable parameter, the pre-trained language model of the present invention adopts the BERT pre-trained language model;
[0053] Step 2.2: Use the classification head of the classifier to transform z x Embedded into f(z x ) In the classification function, a linear Softmax classifier is used to calculate the input sample x i The classification probability and the cross entropy loss L are used ce1 Optimizing the model helps to classify features;
[0054] Step 2.3: Use the comparison head of the classifier to convert z x Embedded into h(z x ) In the comparison function, supervised contrast loss L is used SupCon Optimizing the model, the comparison method helps to obtain a better feature space. It can maximize the similarity of samples of the same category and minimize the similarity of samples of different categories, thereby improving the separability of samples in the feature space;
[0055] Specifically, the classifier layer includes a comparison head and a classification head. x Embedded into f(z x ). Then, a linear Softmax classifier is used to calculate the input sample x i The classification probability of:
[0056] f(zx )=W2(z x )+b2 (2)
[0057] P(x;θ k )=softmax(f(z x )) (3)
[0058] in, Calculate the eigenvector representation, are all trainable parameters, P(x;θ k ) is the distribution probability represented by the feature vector. In the model training process, the present invention uses the cross entropy loss function L ce1 The model is optimized and its calculation formula is as follows:
[0059]
[0060] Among them, P(r j |x i θ k ) represents the input sample x i Classification into relation category r j The probability of y i Represents the input sample x i The true label of y i =r j hour, Otherwise 0.
[0061] Through the comparison head of the classifier, z x Embedded into h(z x ):
[0062] h(z x )=W4(ReLU(W3(z x )+b3))+b4 (5)
[0063] Among them, W3, W4, b3, b4, are all trainable parameters, and ReLU is the activation function. In this process, the present invention uses the supervised contrast loss function to train the model. For each anchor point sample, one is randomly selected from the same relationship category as a positive sample, and a different relationship category sample is randomly selected from the same batch as a negative sample. The supervised contrast loss L is calculated. SupCon :
[0064]
[0065] Where τ is the temperature coefficient. Similarly, when y i =r j hour, Otherwise 0.
[0066] In the new task Tk When it arrives, use the new training set To train the model and acquire new knowledge. At the same time, use the cross entropy loss L ce1 and supervised contrastive learning loss L SupCon To reduce the distance between similar relationship samples in the embedding space.
[0067] L initial =L ce1 +L SupCon (7)
[0068] Among them, L initial Denotes the cross entropy loss L ce1 and supervised contrastive learning loss L SupCon sum.
[0069] Step 2.4: Use a combination of cross entropy loss and supervised contrastive learning loss to reduce the distance between similar relationship samples in the embedding space, thereby obtaining feature representations of different types of data. For each new task, repeat Step 2.2-Step 2.3 until all tasks complete initialization training.
[0070] Step 3: Construct a memory sample selection strategy. Based on the obtained feature representation of different types of data, use a clustering algorithm to cluster each relationship in the current training set during the current task training phase, and select several samples closest to the cluster center as memory samples and store them in the memory space.
[0071] Step 3.1: The present invention uses the K-means algorithm to train each relationship category r=R in the current training set during the current task training phase. k Perform clustering and calculate the distance between each sample vector encoding and the k cluster centers. Then, select the m samples closest to the cluster center for each relationship category and store them as memory samples in the memory space M. r In the memory replay phase, the model is trained to help the model effectively consolidate the knowledge of previous tasks and alleviate the problem of catastrophic forgetting. The number of memory samples is set to m. The cumulative memory space is expressed as
[0072] Step 3.2: In order to calculate the prototype representation of each relationship category more accurately, the present invention records the proportion of each cluster to all samples as the weight information w of the memory sample r,i , the calculation formula is as follows:
[0073]
[0074] Among them, |C r,i| is the number of cluster centers, that is, the number of relationship categories in the training set. Afterwards, for each relationship category in the current task, the memory space M r , calculate the relationship category r = R k The prototype representation P r :
[0075]
[0076] where z i,r For the input sample x i The embedding vector of .
[0077] Step 4: Design a memory enhancement strategy to expand the memory sample data in the memory space to avoid the risk of overfitting of the model due to repeated training of samples during continuous learning.
[0078] Step 4.1: Due to limited memory space, a memory enhancement strategy is used to increase the number of memory samples according to the characteristics of the data samples, while avoiding overfitting of the model.
[0079] Step 4.2: Although the entire input contains an irrelevant sentence, the model is still expected to recognize the relationship r of the entity pair. Using the increased number of memory samples, the memory space M r All typical samples in are expanded, and the expanded memory sample set is expressed as It is worth noting that the sentences augmented by the memory enhancement strategy are only used for model training in the memory replay phase and learning the relationship representation between entity pairs, but not for the generation of relationship prototypes.
[0080] Step 5: Construct a memory replay training module, introduce embedding consistency loss, classify the expanded memory sample data and new task data, obtain feature space representation, and ensure the decision boundaries of different tasks.
[0081] Specifically, in the memory replay phase, the primary goal of model learning is to acquire new knowledge without forgetting old knowledge. The memory space M of the first k tasks r and expanded memory sample set Mix them to train the model. Consistent with the initialization training, the separated classifier model is still used, and the cross entropy loss and contrast loss are used for training. The calculation formula is as follows:
[0082]
[0083] Among them, L ce2 is the mixed sample cross entropy loss. Similarly, when y i =rj hour, Otherwise 0.
[0084] Excessive training on memorized samples can lead to information loss. At the same time, the model may risk overfitting. During this process, new task data and memorized sample data are separated, and only the new task data is used to calculate the contrast loss. The calculation formula is as follows:
[0085]
[0086] Among them, L con is the contrast loss function for new data samples. After separating the new task samples, contrastive learning reduces the distance between the new task samples, and the memory samples are only used as negative anchor points, L con It does not focus on reducing the distance between similar samples in the memory samples. Therefore, this part is a separate new knowledge acquisition.
[0087] In order to enable the model to maintain its ability to learn old tasks during continuous learning while maintaining the consistency of the memory samples in the embedding space, an embedding consistency loss constraint mechanism is introduced in the memory replay phase. After the training of the previous task is completed, the embedding of the memory samples of the previous task is saved as a reference for the current task. By limiting the changes in the embedding of these old samples, the model can still maintain the structural information of the embedding space when processing new tasks. The objective function is defined as:
[0088]
[0089] Among them, L ecl is the consistency loss function, z k-1 , h k-1 It is the embedding of the encoding layer and classifier layer of the previous task.
[0090] Through the above method, the model can continuously review and consolidate the key features of the old tasks while learning the new tasks, ensuring the task-specific decision boundary. This approach not only effectively balances the learning ability of the old tasks, but also avoids forgetting the old tasks due to learning the new tasks. The objective function of the memory replay phase is defined as:
[0091] L replay =L ce2 +L con +L ecl (13)
[0092] Among them, L replay It is the sum of the loss function calculations in the replay phase.
[0093] Step 6: In the prediction stage, for a given test sample, the nearest class mean classifier is used to calculate the distance between the embedding of the test sample and the feature space of all relationship prototypes, and assign the test sample to the prototype label with the nearest distance, thereby realizing the extraction of relationships of different classes.
[0094] Furthermore, the present invention further improves the prediction accuracy of the model by utilizing memory samples, thereby enhancing the model's performance in complex relationship extraction tasks. The calculation formula is as follows:
[0095]
[0096] Among them, z i , P r , z j,r The test set Prototype feature representation and memory sample M r Sample x i The embedding representation of y * is the predicted class label. By calculating the distance between the feature representation and the memory sample, the test sample is classified into the class label closest to it, avoiding the catastrophic forgetting problem.
[0097] Furthermore, to measure the effectiveness of the model across all test sets, we used accuracy (%) as the primary evaluation metric. To ensure fair comparison with the baseline model, the data was divided into 10 tasks. We continuously learned and classified the feature representations of each of these tasks, and repeated the experiment five times. The results of each experiment were calculated separately. Finally, the average of the five experimental results was used as the final performance metric for the model to eliminate the random effects of changes in the task sequence. A related line chart was also plotted. The formula is as follows:
[0098]
[0099] Among them, ACC represents the accuracy, A T,i It represents the accuracy of the model on the test set for the i-th task after learning the T-th task.
[0100] The present invention also selected two baseline models for comparison, namely, prototype representation based continuous relation extraction (CRL) and contrast and memory enhancement based continuous relation extraction (DPCRE), and the memory size of both models was set to 20. Overall, the present invention has shown strong practical application value in dealing with complex and dynamic task situations. The specific effects are shown in the attached Figure 3 shown.
[0101] from Figure 3The experimental results of the line comparison chart show that the performance of the proposed model on mixed datasets in different fields is higher than that of other baseline models in all tasks, verifying its effectiveness and superiority in handling complex relationship extraction tasks.
[0102] The above describes the specific embodiments of the present invention in detail with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in this field without departing from the scope of the present invention.
Claims
1. A method for extracting continuous relations of alloy triples, characterized in that: The method specifically includes: Step 1: Obtain the title, abstract, and text content from the alloy literature for entity and relationship annotation to obtain an entity relationship extraction dataset. The dataset is then preprocessed and divided into several tasks, each of which represents a relationship extraction task. Step 2: Initialize the training module and use the pre-trained language model to extract features from the pre-processed data. The cross entropy loss is combined with the supervised contrast loss to obtain feature representations of different types of data. Step 3: Construct a memory sample selection strategy. Based on the obtained feature representation of different types of data, use a clustering algorithm to cluster each relationship in the current training set during the current task training phase. Select several samples closest to the cluster center and store them in the memory space as memory samples. Step 4: Design a memory enhancement strategy to expand the memory sample data in the memory space; Step 5: Build a memory replay training module, introduce embedding consistency loss, classify the expanded memory sample data and new task data, obtain feature space representation, and ensure the decision boundaries of different tasks; Step 6: In the prediction stage, for a given test sample, the nearest class mean classifier is used to calculate the distance between the embedding of the test sample and the feature space of all relationship prototypes, and assign the test sample to the prototype label with the nearest distance, thereby realizing the extraction of relationships of different classes.
2. The method for extracting continuous relations of alloy triples according to claim 1, characterized in that: The Step 1 is specifically as follows: Step 1.1: kth task T k Contains independent training sets Validation set Test set and the corresponding relation set R k , R k Contains at least one relationship category, for the sample x i is the input text, which contains the entity pair information in the triple, y i ∈R k Represents the relationship category of the triple entity pair, and N is the number of relationships; Step 1.2: After the relation extraction model completes the learning of the kth task, use the union of the first k task test sets Evaluate the performance of the model to make it recognize all learned relationship categories 3. The method for extracting continuous relations of alloy triples according to claim 1, characterized in that: The Step 2 is specifically as follows: Step 2.1: Use special characters [E11], [E12], [E21] and [E22] to mark the entities, where [E11] and [E21] represent the start tags of the head entity and the tail entity, and [E12] and [E22] represent the end tags of the head entity and the tail entity. Use the pre-trained language model to train the input sample x. i Perform feature extraction and obtain feature representation: Among them, z x is the feature representation, E is the vectorization processing of the pre-training model, denote the head entity and the tail entity respectively, d is the dimension of the hidden layer in the pre-trained model, is a trainable parameter; Step 2.2: Use the classification head of the classifier to transform z x Embedded into f(z x ) In the classification function, a linear Softmax classifier is used to calculate the input sample x i The classification probability and the cross entropy loss L are used ce1 Optimize the model; Step 2.3: Use the comparison head of the classifier to convert z x Embedded into h(z x ) In the comparison function, supervised contrast loss L is used SupCon Optimize the model; Step 2.4: Use a combination of cross entropy loss and supervised contrastive learning loss to reduce the distance between similar relationship samples in the embedding space, thereby obtaining feature representations of different types of data. For each new task, repeat Step 2.2-Step 2.3 until all tasks complete initialization training.
4. The method for extracting continuous relations of alloy triples according to claim 1, characterized in that: The Step 3 is specifically as follows: Step 3.1: Use the clustering algorithm to classify each relation r=R in the current training set during the current task training phase. k Perform clustering, calculate the distance between each sample vector encoding and the k cluster centers, then select the m samples closest to the cluster center for each relationship category, and store the m samples as memory samples in the memory space M r middle; Step 3.2: Record the proportion of each cluster to all samples as the weight information w of the memory sample r,i , so that samples with high weights are replayed first in the memory replay phase.
5. The method for extracting continuous relations of alloy triples according to claim 1, characterized in that: The Step 4 is specifically as follows: Step 4.1: Use memory enhancement strategy to increase the number of memory samples; Step 4.2: Use the increased number of memory samples to store the memory space M r All typical samples in are expanded, and the expanded memory sample set is expressed as 6. The method for extracting continuous relations of alloy triples according to claim 1, characterized in that: The Step 5 is specifically as follows: Step 5.1: The training set of the new task The memory space M of the first k tasks r and expanded memory sample set Mixing Step 5.2: Repeat Step 2 with the mixed data and add the embedding consistency loss when calculating the loss. By limiting the changes in the embedding of old samples, the model is ensured to maintain the structural information of the embedding space when processing new tasks, and continuously review and consolidate the key features of the old tasks, thereby obtaining the feature space representation of the new and old data samples and ensuring the task-specific decision boundary.
7. The method for extracting continuous relations of alloy triples according to claim 5, characterized in that: The memory enhancement strategy is specifically: For the memory space M r Samples with relation category r From M r Select samples of the same category Will and The head entity and tail entity are swapped, and the rest of the text content remains unchanged. To represent the newly expanded sample data, as an additional expanded sample of relation r; From M r Randomly select a sample x from m , add it to At the end of the text, we get a new extended sample of relation r, expressed as Among them, x m Not a typical sample of relation r.
Citation Information
Patent Citations
Prompt-based adversarial data enhanced continuous learning relation extraction method
CN116882400A
Multi-sample enhancement-based unstructured text persistence relation extraction method and device, medium and product
CN118674035A