Remote supervision relation extraction method based on positive-negative joint learning and prototype representation
The PNPRE model, which employs joint positive and negative learning and prototype representation, addresses the noise problem in remote supervised relation extraction, improves the accuracy and data utilization of sentence-level relation extraction, and achieves efficient denoising and performance enhancement of the model.
Patent Information
- Application Number
- CN202211258264.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-10-14
AI Technical Summary
There is a lot of noise in remote supervision relation extraction, which leads to poor model performance. Existing methods are difficult to effectively identify sentence-level relation labels, and noisy data resources are wasted.
We employ a method based on joint positive and negative learning and prototype representation. By constructing a PNPRE model, using a constraint graph encoder and a relation classifier, and combining noise filtering and relabeling strategies, we can identify and correct noisy instances, thereby improving data utilization.
It effectively reduces the impact of noise, improves the accuracy and data utilization of the model in sentence-level relation extraction, enhances the interpretability and convergence speed of the model, and significantly improves the F1 score of relation extraction.
Smart Images

Figure CN115630164B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of relation extraction, and particularly relates to a distant supervision relation extraction method based on positive-negative joint learning and prototype representation. BACKGROUND
[0002] Relation Extraction (RE) aims to predict the semantic relationship between the labeled entity pairs from unstructured text. Since the relation extraction dataset is very time-consuming to label, it cannot meet the requirements of supervised learning on the size of the dataset, so the distant supervision relation extraction (DSRE) method emerges as the times require. The distant supervision assumes that if two entities have a certain relationship in the knowledge base, all sentences co-occurring with the two entities express this relationship. According to this assumption, the corpus text is aligned with the existing knowledge base, which can automatically label large-scale data in a short time, such as Figure 1 As shown in the figure. Figure 1 Three sentences in the corpus are aligned with the knowledge base, only one sentence is correctly labeled, and the other two sentences are incorrectly labeled.
[0003] However, the strong assumption of distant supervision can lead to incorrect labeling, which may incorrectly label the entity pairs in a sentence as a certain relationship, or may incorrectly label as the "no relationship" category due to the incompleteness of the knowledge base. As shown in Figure 1 The knowledge graph records a triple knowledge (McCormick, place_of_birth, Lakewood), the first two sentences of the corpus are automatically aligned to this knowledge and are labeled as "place_of_birth", wherein the first sentence is correctly labeled, but the second sentence does not express this relationship and is incorrectly labeled, and the third sentence expresses the relationship triple (Naguib Mahfouz, place_of_birth, Cairo) but is incorrectly labeled as no relationship due to the non-existence in the knowledge base. Such cases are very common in the distant supervision labeling process, which seriously affects the performance of the relation extraction model, so the noise problem has become the focus of researchers.
[0004] A large amount of work is based on the Multi-instance Learning (MIL) framework to denoise. In Multi-instance Learning, the dataset is divided into several sentence bags according to entity pairs, the sentence instances in a sentence bag jointly contain a certain entity pair, and the sentence bag label is the relationship of the entity pair in the knowledge base. The model classifies the relationship at the level of the sentence bag. In order to effectively denoise, Zeng et al. only select the sentence with the highest prediction probability in each bag as the representation of the bag [Zeng, D., Liu, K., Chen, Y., Zhao, J.: Distant supervision for relation extraction via piecewise convolutional neural networks. In: Proceedings of the 2015 conference on empirical methods in natural language processing. pp. 1753-1762. Association for Computational Linguistics, Lisbon, Portugal (2015)], Lin et al. assign different weights to each sentence in the sentence bag through the sentence-level attention mechanism [Lin, Y., Shen, S., Liu, Z., Luan, H., Sun, M.: Neural relation extraction with selective attention over instances. In: Proceedings of the 54th annual meeting of the association for computational linguistics (volume 1: Long papers). pp. 2124-2133. Association for Computational Linguistics, Berlin, Germany (2016)], and Ye et al. use attention mechanisms at the sentence level (intra-bag) and the sentence bag level (inter-bag) respectively [Ye, Z.-X., Ling, Z.-H.: Distant supervision relation extraction with intra-bag and inter-bag attentions.In: Proceedings of the 2019 conference of the north American chapter of the association for computational linguistics: Human language technologies, volume 1 (long and short papers). pp. 2810-2819. Association for Computational Linguistics, Minneapolis, Minnesota (2019)]. As the mainstream framework of distant supervision relation extraction, many relation extraction models based on MIL framework have achieved good results in noise reduction.
[0005] MIL-based relation extraction is performed at the sentence-pair level, which plays a role in noise reduction, but cannot identify the one-to-one mapping of sentences and relations. That is, the model cannot classify at the sentence level and cannot meet the requirements of many downstream tasks that require sentence relation labels. To alleviate the noise of sentence-level prediction, researchers use reinforcement learning and adversarial training to select reliable data. Jia et al. focus on making the model pay attention to the relationship pattern itself, using an initial set of relationship patterns to constantly discover more effective relationship patterns through bootstrap[Jia, W., Dai, D., Xiao, X., Wu, H.: ARNOR: Attention regularization based noise reduction for distant supervision relation classification. In: Proceedings of the 57th annual meeting of the association for computational linguistics. pp. 1399-1408. Association for Computational Linguistics, Florence, Italy (2019)]. However, these methods ignore the fact that the noise problem is caused by the lack of correct relationship labels. SUMMARY
[0006] The present application focuses on sentence-level relation extraction on distant supervision dataset, and proposes a distant supervision relation extraction method based on joint positive and negative learning and prototype representation, namely PNPRE (Jointly Positive and Negative Learning with Prototypical Representation for Sentence-level DSRE), which is committed to identifying noise instances in the dataset and correcting their labels, improving data utilization while reducing noise, and avoiding waste of a large amount of data resources. The present application uses the training method of joint positive and negative learning to ensure the convergence speed while enabling the model to separate reliable instances and noise data, designs a noise filtering strategy and relabeling strategy to identify noise and convert it into usable instances, and continuously improves the quality of the dataset in iterations. In view of the long tail problem, the present application constructs a constraint graph and encodes by means of “entity-relation” constraint, and then designs an auxiliary loss to promote the model to optimize towards the relation prototype, on the one hand to promote the transmission of information between head relations and tail relations, and on the other hand to improve the explainability of the model.
[0007] The technical scheme of the present application:
[0008] The distant supervision relation extraction method based on joint positive and negative learning and prototype representation constructs a PNPRE model, first initializes a sentence encoder, a constraint graph encoder and a relation classifier, then uses joint positive and negative learning and relation prototype-oriented learning for training, and then uses a noise filtering strategy and a relabeling strategy to correct the original dataset; the specific steps are as follows:
[0009] 1) Count the relationship and entity type corresponding relationship in the training set, and construct a constraint graph;
[0010] 2) input the dataset into the model, denoted as D, each instance in the dataset contains a sentence, an entity pair, an entity type and a distant supervision label y, let the input sentence be s={w1,w2,...,w n}, the head entity position is p1, the tail entity position is p2, the head entity type is t1, and the tail entity type is t2;
[0011] 3) perform Embedding coding on the words;
[0012] 4) perform Embedding coding on the relative positions of the words and the head and tail entities;
[0013] 5) splice the Embedding coding of steps 3) and 4) to obtain sentence Embedding coding;
[0014] 6) using PCNN to extract sentence features by taking the sentence Embedding obtained in step 5) as input, to obtain sentence representation;
[0015] 7) using two-layer GCN to encode the constraint graph in step 1) to obtain constraint graph Embedding, and the Embedding of the constraint graph node is the Embedding of the relation and entity type;
[0016] 8) obtaining the Embedding of the head and tail entity types according to the constraint graph Embedding and using ReLU activation;
[0017] 9) concatenating the sentence representation in step 6) and the entity type representation in step 8);
[0018] 10) inputting the representation obtained in step 9) into two-layer fully connected layers and the final softmax function to obtain the probability distribution prediction of each category, and the category corresponding to the maximum probability is the classification result;
[0019] 11) calculating the loss of the prediction value in step 10) and the true value by using the positive and negative joint learning loss function;
[0020] 12) obtaining the Embedding of the relation corresponding to the label y according to the constraint graph Embedding, and calculating the loss of the sentence representation obtained in step 6) and the Embedding of the relation corresponding to the label y by using the relation prototype-oriented learning loss function;
[0021] 13) training the model by using the loss calculated in steps 11) and 12) through the Adam optimizer;
[0022] 14) filtering out possible noise instances in the data set by using a noise filtering strategy to form a noise instance set, denoted as N, and the remaining instances form a reliable instance set D-N;
[0023] 15) reassigning the label to the noise instances filtered out in step 14) by using a relabeling strategy, denoted as N';
[0024] 16) combining D-N in step 14) and N' in step 15) to form a new data set D';
[0025] 17) taking the new data set obtained in step 16) as input, repeating steps 2) to 16) until the training stopping condition is reached.
[0026] The beneficial effects of the present application are as follows:
[0027] (1) The application uses positive and negative joint learning to train the model, which improves the robustness of the model to noise data and speeds up the convergence, and iteratively improves the data set quality and model performance through noise filtering strategy and re-labeling strategy;
[0028] (2) The application uses GCN to encode the constraints between entity types and relationships, which promotes the transmission of information between different relationships and to some extent alleviates the long tail problem;
[0029] (3) The application designs an auxiliary loss to make the model face the prototype learning, which promotes the model to learn the essential semantics of the sentence and improves the explainability of the sentence encoder;
[0030] (4) Experiments on the benchmark dataset NYT10 of remote supervision relation extraction show that the method proposed in the application outperforms the previous SOTA method. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 : Remote supervision labeling process.
[0032] Figure 2 : PNPRE framework.
[0033] Figure 3 : Constraint graph part example.
[0034] Figure 4 : Cross-entropy loss in the last iteration on the training set.
[0035] Figure 5 : Threshold comparison of the application method and the SENT method on long tail relationships (left) and head relationships (right). DETAILED DESCRIPTION
[0036] Remote supervision relation extraction
[0037] In order to solve the problem of too expensive data set labeling in traditional supervised relation extraction method, Mintz et al. proposed remote supervision relation extraction method in 2009, based on the assumption that "if a pair of entities has a certain relationship, then the sentence containing the pair of entities will express the meaning of the relationship", and the existing knowledge base is used to complete the automatic labeling of large-scale corpus. However, due to the over-intense assumption, there is a lot of noise in the remote supervision data set, so how to reduce noise has become the focus of researchers.
[0038] Riedel improved the hypothesis proposed by Mintz, proposed at least once hypothesis, pointed out that "if there is a certain relationship between two entities, then in all the co-occurrence of the two entities in the sentence, at least one sentence expresses this relationship", and applied multiple instance learning to distant supervision relation extraction, defined the sentence set containing the same entity pair as a sentence bag, and did relation classification at the sentence bag level. Zeng et al. first applied piecewise convolutional neural network to the extraction of sentence features in the distant supervision relation extraction method, and only selected the instance with the highest confidence in the sentence bag when calculating the loss, discarded other instances [Zeng, D., Liu, K., Chen, Y., Zhao, J.: Distant supervision for relation extraction via piecewise convolutional neural networks. In: Proceedings of the 2015 conference on empirical methods in natural language processing. pp. 1753-1762. Association for Computational Linguistics, Lisbon, Portugal (2015)]. Lin et al. introduced attention mechanism on the basis of Zeng, gave different weights to the sentences in the sentence bag according to the similarity between the sentence semantics and the relationship semantics, and selected a soft method to deal with noise relative to the hard method of Zeng [Lin, Y., Shen, S., Liu, Z., Luan, H., Sun, M.: Neural relation extraction with selective attention over instances. In: Proceedings of the 54th annual meeting of the association for computational linguistics (volume 1: Long papers). pp. 2124-2133. Association for Computational Linguistics, Berlin, Germany (2016)].To enable the multi-instance learning framework to effectively utilize all instances, Chen et al. applied the method of contrastive instance learning to the distant supervision relation extraction task, taking the mainstream multi-instance learning framework as the encoder of the sentence package, and then using contrastive instance learning to utilize each sentence instance in an unsupervised manner [Chen, T., Shi, H., Tang, S., Chen, Z., Wu, F., Zhuang, Y.: CIL: Contrastive instance learning framework for distantly supervised relation extraction. In: Proceedings of the 59th annual meeting of the association for computational linguistics and the 11th international joint conference on natural language processing (volume 1: Long papers). pp. 6191-6200. Association for Computational Linguistics, Online (2021)]. Shang et al. proposed relation extraction based on deep clustering, filtered out the noise data in the sentence package according to the attention score, and then corrected the relation label of the noise sample through the method of deep clustering, and proposed a scaling loss function so that the label obtained by clustering is proportional to the influence of the clustering confidence on the model [Shang, Y., Huang, H.-Y., Mao, X.-L., Sun, X., Wei, W.: Are noisy sentences useless for distant supervised relation extraction? Proceedings of the AAAI Conference on Artificial Intelligence. 34, 8799-8806 (2020). https: / / doi.org / 10.1609 / aaai.v34i05.6407].
[0039] Most of the research on distant supervision relation extraction is based on the multiple instance learning framework. Some other methods have also been explored. Feng tried to solve the problem of a large amount of noise in the distant supervision corpus through reinforcement learning, using an instance selector to provide high-quality samples for the training of the subsequent sentence-level relation classifier [Feng, J., Huang, M., Zhao, L., Yang, Y., Zhu, X.: Reinforcement learning for relation classification from noisy data. Proceedings of the AAAI Conference on Artificial Intelligence. 32, (2018). https: / / doi.org / 10.1609 / aaai.v32i1.12063]. Jia et al. proposed a noise reduction framework based on attention regularization to make the model focus on the patterns that can explain the relation label [Jia, W., Dai, D., Xiao, X., Wu, H.: ARNOR: Attention regularization based noise reduction for distant supervision relation classification. In: Proceedings of the 57th annual meeting of the association for computational linguistics. pp. 1399-1408. Association for Computational Linguistics, Florence, Italy (2019)].
[0040] Negative learning
[0041] To cope with the risk that the model memorizes the contaminated labels in the noisy data, negative learning as an indirect learning method is proposed to train the CNN. Negative learning trains the model using randomly selected complementary labels, which means that "the instance does not belong to this label", and thus reduces the risk of providing false information, since the probability of incorrectly selecting a complementary label is much lower than the probability of a label being noisy. This training method not only avoids overfitting to noisy data, but also separates noisy data from clean data during training. Ma et al. first introduced negative learning into distant supervision relation extraction and proved the effectiveness of the method [Ma, R., Gui, T., Li, L., Zhang, Q., Huang, X., Zhou, Y.: SENT: Sentence-level distant relation extraction via negative training. In: Proceedings of the 59th annual meeting of the association for computational linguistics and the 11th international joint conference on natural language processing (volume 1: Long papers). pp. 6201-6213. Association for Computational Linguistics, Online (2021)].
[0042] Prototype representation learning
[0043] In distant supervision relation extraction, prototypes are embeddings in a representation space that capture the essence of different sentence statements of a given relation, acting as centers of clusters of data representations surrounded by sentences expressing the same relation. Ding et al. robustly learn relation representations using prototype-level classification on large-scale distant-labeled data [Ding, N., Wang, X., Fu, Y., Xu, G., Wang, R., Xie, P., Shen, Y., Huang, F., Zheng, H.-T., Zhang, R.: Prototypical Representation Learning for Relation Extraction. arXiv e-prints. arXiv:2103.11647 (2021)], different from ProtoNet that computes prototypes as the average of all instance embeddings, they use three loss functions to train the sentence encoder, including contrastive loss between statements, contrastive loss between prototypes and statements, and classification loss at the prototype level, thus generating meaningful, interpretable relation representations.
[0044] Long tail problem
[0045] Compared with the noise problem, the long-tail problem of distant supervision relation extraction, which has received less attention. Early studies based on rules to increase information of long-tail relations, which need a lot of time cost. Since there is a certain semantic dependency relationship between relation categories, Han et al. proposed a relation hierarchical tree structure according to the hierarchical relationship between relations [Han, X., Liu, Z., Sun, M.: Denoising Distant Supervision for Relation Extraction via Instance-Level Adversarial Training. arXiv e-prints. arXiv: 1805.10959 (2018)]. Zhang et al. used graph convolutional neural network to encode the relation hierarchical tree, trying to promote the information propagation between relation nodes through the neighbor aggregation mechanism of graph convolution network (GCN) [Zhang, N., Deng, S., Sun, Z., Wang, G., Chen, X., Zhang, W., Chen, H.: Long-tail relation extraction via knowledge graph embeddings and graph convolution networks. In: Proceedings of the 2019 conference of the North American chapter of the Association for Computational Linguistics: Human Language Technologies, volume 1 (long and short papers). pp. 3016-3025. Association for Computational Linguistics, Minneapolis, Minnesota (2019)]. Liang et al. thought that the relation hierarchical tree should not be the only choice for studying the long-tail problem, and they realized the information transfer to the long-tail relation by constraining the graph, which provided a new idea for dealing with the long-tail problem.
[0046] Distant supervision relation extraction method based on positive and negative joint learning and prototype representation
[0047] The present application proposes a sentence-level distant supervision relation extraction framework, such as Figure 2As shown, the framework consists of a sentence encoder, a constraint graph encoder, and a relation classifier, and is optimized by positive-negative joint learning and prototype-oriented learning. In addition, the framework is also equipped with a noise filtering mechanism and a re-labeling mechanism to iteratively generate cleaner datasets.
[0048] PNPRE framework: in each iteration, first initialize the sentence encoder, constraint graph encoder and relation classifier, then train using positive-negative joint learning and prototype-oriented learning, and then use noise filtering strategy and re-labeling strategy to correct the original dataset
[0049] Task definition and symbol explanation
[0050] Sentence-level relation extraction aims to extract semantic relations y i ∈ R from a word sequence s n ={w1, w2,..., w i} marked with head entity e1 and tail entity e2 k R = {r1, r2,..., r} is a predefined set of relation labels. The present invention regards relation extraction as a classification task.
[0051] Sentence encoder
[0052] The role of the sentence encoder is to convert the sentence into an embedding representation that contains the features of the input text. Like Zeng et al. [Zeng, D., Liu, K., Chen, Y., Zhao, J.: Distant supervision for relation extraction via piecewise convolutional neural networks. In: Proceedings of the 2015 conference on empirical methods in natural language processing. pp. 1753-1762. Association for Computational Linguistics, Lisbon, Portugal (2015)], the present invention concatenates word embeddings and position embeddings as input, then uses PCNN to encode them. The sentence si is converted into a feature vector
[0053] x i = SE φ (s i ) (1)
[0054] It is worth mentioning that any network architecture can be used as the sentence encoder in this framework, as PNPRE is model-agnostic. The invention is implemented using the most commonly used PCNN, as it achieves satisfactory precision with fewer parameters.
[0055] Constraint graph encoder
[0056] Considering the restrictions between entity types and relation labels, such as the relation "child" restricts its head entity type and tail entity type should be "person" (as shown in Figure 3 The invention uses constraint graphs to model the semantic dependencies that exist between different relation labels. A constraint graph consists of a set of entity types T = {t1, t2,..., t l}, a set of relations R, and a set of constraints C, where each constraint represents that the head entity type of relation r is the tail entity type is where Constraint graphs can be obtained from the constraint information given by the knowledge base, or by statistically training the relation labels and entity types of the instances, the invention uses the latter to construct constraint graphs. Constraint graph part: head entity type and tail entity type are the predecessors and successors of the corresponding relation, respectively.
[0057] Given a constraint graph, define the node set as V = T ∪ R, for each add and to the edge set E. In order to use the information of the constraint graph, it is first necessary to convert it into a vector representation, the i-th node v i ∈ V is represented as a d v dimensional embedding. The edge set is represented by an adjacency matrix :
[0058]
[0059] So far, the constraint graph can be represented by an embedding matrix V = {v1, v2,..., v m} and an adjacency matrix A. Next, through a two-layer GCN, the relation representation R = [r1, r2,..., r k ] and the entity type representation T = [t1, t2,..., t l ] can be obtained, where
[0060] R, T = CGE σ (V, E) (3)
[0061] σ is the parameter set of the constraint graph encoder CGE σ (·).
[0062] Relation classifier
[0063] Studies have shown that entity type information plays an important role in relation extraction. Then it is spliced with the sentence vector output by the sentence encoder as input to predict the probability distribution of the sentence on each relation through two fully connected layers of the classifier:
[0064]
[0065] Where xi is the sentence vector, and are the head entity type vector and the tail entity type vector respectively, and the symbol represents the splicing operation.
[0066] Positive and negative joint learning
[0067] Positive learning
[0068] Let y represent the label obtained by remote supervision, y∈{0,1} k is the k-hot vector of y. Positive learning, as a kind of target label-oriented learning method, is widely used in training models, and the target label is "the input instance belongs to this relation label":
[0069]
[0070] Where p i is the probability score of relation r i .
[0071] Negative learning
[0072] Unlike positive learning, negative learning proposes to let the model learn from complementary labels Complementary labels mean that the input instance does not belong to this label. Through negative learning, the model can have better performance in a noisy environment. Its cross-entropy loss function becomes:
[0073]
[0074] Positive and negative joint learning
[0075] The present application trains the model through positive and negative joint learning, and benefits from the faster convergence speed of positive learning and the good learning ability of negative learning in noise. The present application uses L NT The loss of negative learning is calculated for each instance, and considering the huge impact of noisy instances on training, only the expected reliable instances are selected as effective instances to calculate the loss of positive learning. The standard for selecting effective instances is: (1) the maximum probability p max(2) the probability of the rest of the categories except the category with the maximum probability k is the number of relation labels. The reason why the present invention does not directly select the distant supervision label to determine whether it satisfies (1) is that the distant supervision label can be noise. In summary, the loss function of the positive-negative joint learning is:
[0076] L JPNL = λ1L PL+ + L NL (7)
[0077] where λ1is a coefficient used to scale the range of positive learning so that it does not overwhelm the amplitude of negative learning. In the experiments of the present invention, λ1= 0.1.
[0078] Focusing on prototypical learning
[0079] According to Ding et al. [Ding, N., Wang, X., Fu, Y., Xu, G., Wang, R., Xie, P., Shen, Y., Huang, F., Zheng, H.-T., Zhang, R.: Prototypical Representation Learning for Relation Extraction. arXiv e-prints. arXiv: 2103.11647 (2021)], the relation prototype z e Z extracts the most essential semantics of the relation r, and the embedding z of z is in the same semantic space as the embedding of the sentence expressing the relation. In the present invention, the embedding of the relation prototype is obtained by a linear mapping after the relation is encoded by CGE σ (·):
[0080] z = MAP1(r) (8)
[0081] Similarly, the sentence embedding x output by the sentence encoder is also mapped to the same space as z by a linear transformation:
[0082] s = MAP2(x) (9)
[0083] The sentence expressing the relation r is also called the statement of the relation r. Based on the view that "the statement of the relation r should be as close to the prototype of r as possible, and as far away from other relation prototypes as possible", in the training process, the present invention adds an auxiliary loss to formula (7) to train the prototype-oriented model:
[0084] L proto = L z + L z′ + βL z_cls (10)
[0085] where L z and L z′ reflects the deviation between the statement and the prototype, which is calculated by:
[0086] L z = logd(z, s) (11)
[0087]
[0088] The similarity measure in equation (12) is defined as:
[0089]
[0090] To further regularize the semantics of the prototype, the present invention uses an additional classifier at the prototype level, whose parameter γ is optimized by:
[0091]
[0092] Overall, the final loss function consists of two parts:
[0093] L = L JPNL + λ2· L proto (15)
[0094] where λ2determines the proportion of L proto , which is set to 0.1 in the experiments of the present invention.
[0095] It is worth noting that, as the prototype is very sensitive to noisy data, as in forward learning, the present invention only calculates the loss for the relation-oriented prototype for valid instances.
[0096] Noise filtering mechanism and re-labeling mechanism
[0097] Noise filtering mechanism
[0098] After several rounds of training, the model will assign a low probability score to the remote supervision label of noisy data, while the remote supervision label of clean data will usually be assigned a probability score of medium or above. Instead of setting a specific threshold to separate noisy data from training data, the present invention calculates a unique threshold Thfor each relation r of the training sample according to the characteristics of the OTSU algorithm [Otsu, N.: A threshold selection method from gray-level histograms. IEEE Transactions on Systems, Man, and Cybernetics. 9, 62-66 (1979). https: / / doi.org / 10.1109 / TSMC.1979.4310076] that can maximize the inter-class variance.r This noise filtering strategy avoids the trouble of setting a fixed threshold manually and can dynamically change according to the probability score distribution of each relationship category. The threshold calculated by this method not only can adapt to the convergence degree of each relationship category, but also can automatically change dynamically, avoiding the trouble of manually setting a fixed threshold, and is friendly to long-tail data.
[0099] Relabeling mechanism
[0100] The present application believes that the root cause of the noise problem is not the lack of useful information, but the correct relationship label. Therefore, the present application re-labels the noise instances separated by the noise filtering mechanism. If a sentence is predicted as relationship r * , and the corresponding probability P(r * |s) is greater than the relabeling threshold of relationship r * , then the instance will be relabeled as r * , otherwise, it will be relabeled as the "NA" category. The present application sets the relabeling threshold to the same value as the noise filtering threshold.
[0101] Model training algorithm
[0102] In order to make the best use of each part, the present application iteratively trains the model, gradually forms a clean data set, and finally stops iteration with the best F1 score on the validation set. The algorithm steps of model training are shown in Algorithm 1.
[0103]
[0104]
[0105]
[0106] Experiment
[0107] Dataset and evaluation index
[0108] The method proposed in the present application is evaluated on a widely used distant supervision relation extraction dataset, i.e. the NYT dataset initially implemented by Riedel et al. [Riedel, S., Yao, L., McCallum, A.: Modeling relations and their mentions without labeled text. In: Balcázar, J. L., Bonchi, F., Gionis, A., and Sebag, M. (eds.) Machine learning and knowledge discovery in databases. pp. 148-163. Springer Berlin Heidelberg, Berlin, Heidelberg (2010)]. In the training phase of sentence-level relation extraction, the present application follows the setup of Jia et al. [Jia, W., Dai, D., Xiao, X., Wu, H.: ARNOR: Attention regularization based noise reduction for distant supervision relation classification. In: Proceedings of the 57th annual meeting of the association for computational linguistics. pp. 1399-1408. Association for Computational Linguistics, Florence, Italy (2019)] and tests on the artificially labeled sentence-level test set they released and the test set used to evaluate the algorithm’s noise reduction capability. The data set used in this experiment is shown in Table 1.
[0109]
[0110] Table 1: Dataset statistics, quoted from [Jia, W., Dai, D., Xiao, X., Wu, H.: ARNOR: Attention regularization based noise reduction for distant supervision relation classification. In: Proceedings of the 57th annual meeting of the association for computational linguistics. pp. 1399-1408. Association for Computational Linguistics, Florence, Italy (2019)]. “Positive instances” denotes positive instances that are not labeled as “NA”.
[0111] Following previous literature, the present invention computes precision (PREC), recall (rec) and F1 score on all instances to perform sentence-level evaluation.
[0112] Baseline models
[0113] Experiments compare the performance of the framework of the present invention with several strong baseline models for distant supervision relation extraction, including:
[0114] CNN [Zeng, D., Liu, K., Lai, S., Zhou, G., Zhao, J.: Relation classification via convolutional deep neural network. In: Proceedings of COLING 2014, the 25th international conference on computational linguistics: Technical papers. pp. 2335-2344. Dublin City University; Association for Computational Linguistics, Dublin, Ireland (2014)] is a classic model for relation extraction, which introduces position embeddings to represent the relative position between word and entity pairs.
[0115] PCNN [Zeng, D., Liu, K., Chen, Y., Zhao, J.: Distant supervision for relation extraction via piecewise convolutional neural networks. In: Proceedings of the 2015 conference on empirical methods in natural language processing. pp. 1753-1762. Association for Computational Linguistics, Lisbon, Portugal (2015)] is an improvement of CNN, using piecewise max-pooling operation to extract more relation features, which is widely used in relation extraction task.
[0116] PCNN+SelATT [Lin, Y., Shen, S., Liu, Z., Luan, H., Sun, M.: Neural relation extraction with selective attention over instances. In: Proceedings of the 54th annual meeting of the association for computational linguistics (volume 1 : Long papers). pp. 2124-2133. Association for Computational Linguistics, Berlin, Germany (2016)] is a sentence-pair level relation extraction model, using sentence-level attention mechanism to reduce the weight of noisy instances.
[0117] PCNN+ATT RA+BAG ATT [Ye, Z.-X., Ling, Z.-H.: Distant supervision relation extraction with intra-bag and inter-bag attentions. In: Proceedings of the 2019 conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, volume 1 (long and short papers). pp. 2810-2819. Association for Computational Linguistics, Minneapolis, Minnesota (2019)] is a sentence-bag level relation extraction model that deals with noise through intra-bag and inter-bag attention mechanisms.
[0118] CNN+RL1 [Qin, P., Xu, W., Wang, W.Y.: Robust distant supervision relation extraction via deep reinforcement learning. In: Proceedings of the 56th annual meeting of the Association for Computational Linguistics, volume 1: Long papers. pp. 2137-2147. Association for Computational Linguistics, Melbourne, Australia (2018)] is a sentence-bag level relation extraction method based on reinforcement learning that identifies false positive instances and reassigns them to negative samples.
[0119] CNN+RL2 [Feng, J., Huang, M., Zhao, L., Yang, Y., Zhu, X.: Reinforcement learning for relation classification from noisy data. Proceedings of the AAAI Conference on Artificial Intelligence. 32, (2018). https: / / doi.org / 10.1609 / aaai.v32i1.12063] is a sentence-level relation extraction model that jointly trains a CNN classifier and an instance selector to remove invalid samples.
[0120] ARNOR [Jia, W., Dai, D., Xiao, X., Wu, H.: ARNOR: Attention regularization based noise reduction for distant supervision relation classification. In: Proceedings of the 57th annual meeting of the association for computational linguistics. pp. 1399-1408. Association for Computational Linguistics, Florence, Italy (2019)] designs attention regularization to make the model focus on the pattern of the relation, selects instances with high confidence according to the attention score, and trains a sentence-level distant supervision relation extraction model.
[0121] SENT [Ma, R., Gui, T., Li, L., Zhang, Q., Huang, X., Zhou, Y.: SENT: Sentence-level distant relation extraction via negative training. In: Proceedings of the 59th annual meeting of the association for computational linguistics and the 11th international joint conference on natural language processing (volume 1 : Long papers). pp. 6201-6213. Association for Computational Linguistics, Online (2021)] performs noise filtering and re-labeling operations iteratively based on negative learning, which is the SOTA model for sentence-level relation extraction.
[0122] Parameter settings
[0123] Since the remote supervision relation extraction method and model based on positive and negative joint learning and prototype representation proposed by the present application are model-independent, after considering the time and computing power consumption required for training, the present experiment selects to use PCNN to realize the model. Like ARNOR, the present experiment randomly initializes 50-dimensional word embeddings and 50-dimensional position embeddings. Referring to previous work, the number of convolution kernels in PCNN is set to 230, and the window size is set to 3. A two-layer graph convolution network is used to encode the constraint graph, and the input of the network is set to 50 dimensions. For positive and negative joint learning, let λ1=0.1, and like SENT, 10 supplementary labels are randomly selected for each instance. For relation prototype-oriented learning, the proportion of reliable instances in a batch to all instances is used to scale the prototype-level classification loss in the experiment. During training, the Adam optimizer is used for optimization, and the dropout strategy is used before the classifier to avoid overfitting. Table 2 shows all the hyperparameters used in the present experiment.
[0124]
[0125]
[0126] Table 2: Hyperparameter settings
[0127] Experimental results
[0128] The results of PNPRE are compared with other baseline models in the sentence-level evaluation as shown in Table 3. The method of the present application is significantly better than the baseline models in terms of precision and F1 score. From the results, it can be observed that: (1) all the baseline models perform poorly in the sentence-level evaluation, which indicates that the noise data has a huge destructive effect on the training of the sentence-level relation extraction model. (2) The sentence bag-level models, including PCNN+SelATT, PCNN+ATT_RA+Bag_ATT and CNN+RL1, do not perform well in the sentence-level relation extraction, which indicates that the noise reduction method of the sentence bag-level is not suitable for the sentence-level evaluation. (3) The method of the present application proposed PNPRE can effectively reduce the impact of noise data, while keeping the recall rate almost flat, and significantly improves the precision, so that the F1 score is higher than the previous noise reduction method, which indicates that the method of the present application can effectively reduce the impact of noise data.
[0129] To further prove the noise reduction ability of PNPRE, the method of the present application is tested on the noise-labeled test set published by ARNOR with reference to SENT. As shown in Table 4, the method of the present application is better than other test methods in terms of F1 score, and significantly improves the recall rate while keeping the precision similar to that of SENT. It is worth noting that although the noise filtering strategy in SENT can adapt to different relationships, it still needs to set a global data filtering threshold and a re-labeling threshold, which is very troublesome to set. In contrast, the present application unifies the noise filtering threshold and the re-labeling threshold, which are automatically calculated by the OTSU algorithm, and maintains the adaptability to different relationships. In addition, ARNOR performs the worst among the three methods, which may be because the initial pattern set constructed by it hinders the model from inducing various correct data.
[0130]
[0131]
[0132] Table 3: Performance of all comparison models in the sentence-level evaluation. The results of previous models are cited from [Zeng, X., He, S., Liu, K., Zhao, J.: Large scaled relation extraction with reinforcement learning. In: AAAI (2018)] except PNPRE.
[0133]
[0134] Table 4: Comparison of noise reduction ability on the noise-labeled NYT-10 test set.
[0135] Ablation experiment
[0136] The present application also conducts ablation experiments to show the role of different components in the PNPRE: (1) In “-CGE”, the constraint graph encoder is removed and replaced by random entity type and relation embeddings. (2) In “-L proto ”, L proto is not used, that is, the prototype-oriented learning is not used in the training stage. (3) “-CGE-L proto ” means that both the constraint graph encoder and L proto are not used. (4) In “PL”, the positive learning is removed from the joint positive-negative learning, and the relation classifier is only optimized by negative learning as in SENT. (5) In “-OTSU”, the noise filtering strategy and the relabeling strategy are replaced by the settings in the SENT paper, specifically, the global threshold for filtering data is set to 0.25, and the relabeling threshold is set to 0.7.
[0137] The experimental results are shown in Table 5. Obviously, removing the constraint graph encoder and L proto will impair the final performance of the model, because information can be effectively propagated through the nodes and edges in the constraint graph, while L proto can make the model more easily understand the essential semantics of the relationship. However, the performance of simultaneously removing the constraint graph encoder and L proto is better than independently removing each part. For this result, one guess is that the constraint graph encoder without L Proto cannot be fully optimized, and not using the constraint graph encoder can make the relation prototype embedding biased towards the sentence embedding with noise.
[0138]
[0139] Table 5: Ablation experiments on the NYT-10 test set.
[0140] The experimental results are shown in Table 5. Obviously, removing the constraint graph encoder and L proto will impair the final performance of the model, because information can be effectively propagated through the nodes and edges in the constraint graph, while L proto can make the model more easily understand the essential semantics of the relationship. However, the performance of simultaneously removing the constraint graph encoder and L proto is better than independently removing each part. For this result, one guess is that the constraint graph encoder without L Proto cannot be fully optimized, and not using the constraint graph encoder can make the relation prototype embedding biased towards the sentence embedding with noise.
[0141] When the positive learning is removed, the training of the model mainly relies on the complementary labels used in SENT, and the performance is greatly reduced. Figure 4The cross-entropy loss of training using positive-negative joint learning and negative learning respectively on the training set is plotted, and it can be seen that the method of removing positive learning shows poor convergence, thereby proving the superiority of positive-negative joint learning.
[0142] When the replacement OTSU algorithm of SENT is used to determine the noise filtering threshold, the final classification performance and denoising ability of the model are greatly reduced (as shown in Tables 5 and 6). In addition, Figure 5 The effectiveness of two different threshold setting methods, namely the method of SENT and the method proposed in the application, is compared on data of one long tail relationship and one head relationship. Obviously, the filtering threshold of the application is more stringent than that of SENT, which explains why PNPRE performs well in recall rate, because it tends to filter as much noise data as possible compared to mistakenly considering clean data as noise.
[0143]
[0144] Table 6: Ablation experiment on the noise-labeled test set.
[0145] Conclusion
[0146] The application proposes a sentence-level distant supervision relation extraction framework-PNPRE. On the one hand, the model is trained using positive-negative joint learning, which not only alleviates the influence of noise and separates noise from clean data, but also improves convergence and training speed, thereby improving model performance. On the other hand, the application uses a constraint graph to model the dependency relationship between relationship labels by limiting the relationship between entity types and relationship labels, thereby promoting the propagation of information between different relationships. In addition, the application designs a prototype-oriented learning to provide assistance for learning the essential representation of a sentence. PNPRE helps to improve the quality of distant supervision data and the performance of the model by iteratively performing noise filtering and correcting labels. Experiments on the NYT-10 dataset prove the advantages of PNPRE in sentence-level relation extraction and noise reduction.
Claims
1. A method for extracting remote supervised relations based on positive and negative joint learning and prototype representation, characterized in that, To construct the PNPRE model, the sentence encoder, constraint graph encoder, and relation classifier are first initialized. Then, they are trained using joint positive and negative learning and relation prototype-oriented learning. Finally, noise filtering and relabeling strategies are used to refine the original dataset. The specific steps are as follows: 1) Analyze the relationships and entity type correspondences in the training set, and construct a constraint graph; 2) Input the dataset into the model, denoted as D. Each instance in the dataset contains a sentence, entity pairs, entity types, and a distant supervision label y. Let the input sentence be s={w 1, w 2, … , w n The head entity is located at p1, the tail entity is located at p2, the head entity type is t1, and the tail entity type is t2. 3) Embedding encoding is performed on the words; 4) Embedding encoding is performed on the relative positions of words and their beginning and ending entities; 5) Concatenate the embedding codes from steps 3) and 4) to obtain the sentence embedding code; 6) Using the sentence embedding obtained in step 5) as input, extract sentence features using PCNN to obtain the sentence representation; 7) Encode the constraint graph in step 1) using two layers of GCN to obtain the constraint graph embedding. The embedding of the constraint graph node is the embedding of the relation and entity type. 8) Obtain the embeddings of the head and tail entity types from the constraint graph embedding, and activate them using ReLU; 9) Concatenate the sentence representation from step 6) and the entity type representation from step 8); 10) Input the representation obtained in step 9) into two fully connected layers and the final softmax function to obtain the probability distribution prediction of each category. The category corresponding to the highest probability is the classification result. 11) Calculate the loss between the predicted and true values from step 10) using the positive and negative joint learning loss function; 12) Obtain the embedding of the relation corresponding to label y based on the constraint graph embedding. Calculate the loss using the sentence representation obtained in step 6) and the embedding of the relation corresponding to label y through a relation prototype-oriented learning loss function. 13) Train the model using the loss calculated in steps 11) and 12) through the Adam optimizer; 14) Use a noise filtering strategy to filter out possible noisy instances in the dataset and form a set of noisy instances, denoted as N. The remaining instances form a set of reliable instances, DN. 15) Re-label the noise instances filtered out in step 14) using a relabeling strategy, denoted as N'; 16) The DN in step 14) and the N' in step 15) together form a new dataset D'; 17) Using the new dataset obtained in step 16) as input, repeat steps 2) to 16) until the training stopping condition is met; The aforementioned learning oriented towards relational prototypes: relational prototypes Relationships were extracted The most essential semantics, and Embedded The embedding of the sentence expressing the relation resides in the same semantic space; in the remotely supervised relation extraction method, the relation prototype... The embedding is by After encoding the relation, it is obtained through a linear mapping: ; Similarly, the sentence embedding output by the sentence encoder It is also mapped to through a linear transformation. Consistent space: ; Expressed relationship Sentences with a relational structure are also called relational sentences. The statement is based on "relationship" The statement should be as close as possible to The idea is to "obtain the prototype of the model and keep it as far away from other relation prototypes as possible." Therefore, during training, an auxiliary loss is added to equation (7) in the remote supervised relation extraction method to train the prototype-oriented model. ; in and This reflects the discrepancy between the statement and the prototype, calculated using the following formula: ; The similarity metric in equation (12) is defined as follows: ; The remote supervised relation extraction method uses an additional classifier at the prototype level, whose parameters... Optimize using the following formula: ; Overall, the final loss function consists of two parts: ; in Decision made The proportion of.
2. The remote supervision relation extraction method based on positive and negative joint learning and prototype representation according to claim 1, characterized in that, The constraint diagram consists of a set of entity types. Relation sets and constraint set Composition, constraint set Each constraint in Representing relations The head entity type is The tail entity type is ,in ; Given a constraint graph, define the set of nodes as follows: For each ,Will and Add to edge set ; First, it needs to be converted into a vector representation. Nodes Represented as Dimensional embedding; edge set uses a proximity matrix To indicate: ; At this point, the constraint graph uses an embedding matrix. and a neighbor matrix To indicate; Next, the relational representation is obtained through a two-layer GCN. and entity type representation ,in , : ; For constraint graph encoder The parameter set.
3. The remote supervision relation extraction method based on positive and negative joint learning and prototype representation according to claim 1, characterized in that, The sentence encoder transforms a sentence into an embedded representation that contains the features of the input text; in the remote supervised relation extraction method, word embeddings and position embeddings are concatenated as input and then encoded. sentence By sentence encoder Convert to feature vector : 。 4. The remote supervision relation extraction method based on positive and negative joint learning and prototype representation according to claim 1, characterized in that, The relation classifier: classifies entity types After linear transformation, we obtain Then, it is concatenated with the sentence vector output by the sentence encoder as input, and a two-layer fully connected classifier is used to predict the probability distribution of the sentence on each relation: ; in It is a sentence vector. and These are the head entity type and tail entity type vectors, respectively, with symbols... This indicates a splicing operation.
5. The remote supervision relation extraction method based on positive and negative joint learning and prototype representation according to claim 1, characterized in that, The aforementioned positive and negative joint learning: 1) Positive learning use This indicates a label obtained through remote supervision. for of One-dimensional hot vector; the target label is "the label of the input instance belonging to this relation": ; in For relationship The probability fraction; 2) Negative learning Negative learning proposes that the model learns from the complementary labels. Adding labels means that the input instance does not belong to this label; negative learning allows the model to perform better in noisy environments; Its cross-entropy loss function becomes: ; In the remote supervision relationship extraction method The loss for negative learning is calculated for each instance, while only instances that are expected to be reliable are selected as valid instances for which the loss for positive learning is calculated. The criteria for selecting valid instances are: (1) Maximum probability , (2) The probabilities of all categories except the category with the highest probability. , This represents the number of relation labels; The reason why the remote supervision relation extraction method does not directly select remote supervision labels to determine whether (1) is satisfied is that remote supervision labels may be noise; in summary, the loss function for joint positive and negative learning is: ; in It is a coefficient used to scale the range of positive learning so that it does not overwhelm the magnitude of negative learning.
6. The remote supervision relation extraction method based on positive and negative joint learning and prototype representation according to claim 1, characterized in that, The noise filtering strategy described: In the remote supervision relation extraction method, each relation is assigned a specific parameter. Calculate its unique threshold from the training samples Relabeling strategy: A sentence is predicted as a relation And the corresponding probability Greater than relation Relabeling threshold Then the instance will be re-labeled as Otherwise, relabel it as "NA" category; in the remote supervision relation extraction method, the relabeling threshold is set to the same value as the noise filtering threshold;