A remote supervision relation extraction method based on dynamic soft prompt and diffusion purification

By employing dynamic soft hints and diffusion cleanup, the problems of personalized entity pair understanding and noise interference in remote supervised relation extraction are solved, achieving higher recognition accuracy and generalization performance. This approach is applicable to fields such as knowledge graph construction, knowledge question answering, and information retrieval.

CN123178633APending Publication Date: 2026-11-27XINJIANG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611064820.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In remote supervised relation extraction, the pre-trained model lacks a personalized understanding of entity pairs, and the deterministic relation representation is susceptible to noise labels, resulting in low recognition accuracy and reduced generalization performance.

Method used

We employ dynamic soft prompting and diffusion cleanup methods to construct an end-to-end relation extraction model through entity-aware input sequence processing, pre-trained language model encoding, diffusion model cleanup, and multi-instance attention aggregation. We then optimize the model using a joint loss function.

Benefits of technology

It improves the robustness and generalization ability of relation extraction, significantly enhances the recognition accuracy in noisy environments, provides uncertainty estimation, and offers a reference for downstream applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178633A_ABST
    Figure CN123178633A_ABST
Patent Text Reader

Abstract

The application provides a remote supervision relationship extraction method based on dynamic soft prompt and diffusion purification, comprising: obtaining remote supervision relationship extraction data in a knowledge base to obtain an entity perception input sequence; processing the entity perception input sequence by using a pre-training language model and a pooling method to obtain a fusion soft prompt; processing the fusion soft prompt and the entity perception input sequence by using an intelligent insertion and recoding method to obtain an enhanced sentence representation and a diffusion initial latent representation; purifying the diffusion initial latent representation by using a diffusion model to obtain a purified relationship representation and a relationship bag level representation; classifying the relationship bag level representation by using a classifier to complete construction of a relationship extraction model, obtain a final relationship prediction result, and perform model optimization. The application improves the robustness, generalization ability and recognition accuracy in a noise scene of relationship extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing and knowledge graph construction, and in particular to a method for extracting remote supervised relationships based on dynamic soft prompting and diffusion cleansing. Background Technology

[0002] Relation extraction aims to identify semantic relationships between entity pairs from unstructured text, and is a crucial foundational step in knowledge graph construction, question answering, information retrieval, and intelligent analysis systems. Traditional relation extraction relies on manually annotated corpora, which is costly and struggles to cover long-tail relationships in open-domain scenarios. Remotely supervised relation extraction, by automatically aligning text corpora with entity relation triples in a knowledge base, can quickly construct large-scale training data and is therefore widely used in low-cost relation extraction systems.

[0003] However, remote supervision is typically based on the heuristic assumption that "if a sentence contains two entities that have a relationship in the knowledge base, then the sentence expresses that relationship." This assumption does not always hold true in real text and is prone to generating a large number of mislabeled sentences. While existing multi-instance learning methods relax the sentence-level assumption to the relation-packet assumption, they still include mislabeled sentences in the training packet. Attention-based multi-instance methods can assign different weights to sentences within a packet, but their relation representations are mostly deterministic vectors, which are prone to learning incorrect text-relation mappings when faced with noisy labels.

[0004] In recent years, pre-trained language models have significantly improved the ability to understand text semantics, but there are still two prominent problems in remote supervised relation extraction: First, general pre-training objectives are difficult to form personalized understandings for specific entity pairs, resulting in sentences with similar structures but large differences in entity semantics being confused; Second, traditional relation representations lack uncertainty modeling and noise removal mechanisms, which easily lead to blurred relation boundaries and decreased generalization performance in high-noise remote supervised data. Summary of the Invention

[0005] To overcome the shortcomings of existing technologies, the purpose of this invention is to provide a remote supervised relation extraction method based on dynamic soft hints and diffusion cleanup. This method solves the problems of pre-trained models lacking personalized understanding of entity pairs and deterministic relation representations being susceptible to noise labels in remote supervised relation extraction, thereby improving the robustness, generalization ability, and recognition accuracy of relation extraction in noisy scenarios.

[0006] To achieve the above objectives, the present invention provides the following solution: a method for extracting remote supervision relationships based on dynamic soft hints and diffusion cleanup, comprising: Remote supervision relation extraction data is obtained from the knowledge base. Entity tagging and query sequence construction methods are used to process each sentence instance in the remote supervision relation extraction data to obtain an entity-aware input sequence. The entity-aware input sequence is encoded and extracted using a pre-trained language model and pooling method to obtain head entity representation and tail entity representation. Then, the head entity representation and tail entity representation are processed using a prompt generator and fusion method to obtain fused soft prompts. The fused soft prompts and the entity-aware input sequence are processed using intelligent insertion and recoding methods to obtain an enhanced sentence representation. Then, the enhanced sentence representation is processed using a relation tagging localization and parameter estimation network to obtain a diffusion initial latent representation. The initial latent representation of the diffusion model is purified by forward noise addition and backward noise reduction to obtain a purified relation representation. Then, the purified relation representation is processed by a multi-instance attention aggregation method to obtain a relation package-level representation. The relation package-level representation is classified using a classifier to complete the construction of the relation extraction model and obtain the final relation prediction result. Then, the relation extraction model is trained end-to-end using a joint loss function to complete the model optimization.

[0007] Optionally, remote supervision relation extraction data is obtained from a knowledge base. Entity tagging and query sequence construction methods are used to process each sentence in the remote supervision relation extraction data to obtain an entity-aware input sequence, including: Entity pairs and their corresponding relation tags are extracted from the knowledge base, and sentence instances containing entity pairs and their corresponding relation tags are retrieved from unstructured text corpus to obtain relation packages. The entity pairs and their corresponding relation tags are then used as candidate relation tags for the relation packages to obtain remote supervised relation extraction data. For each sentence instance, the boundaries of the head entity and the tail entity are explicitly marked in the original sentence using start and end markers to obtain a structured sentence sequence. A structured query sequence containing the head entity name, the tail entity name, and relation markers is then constructed. The structured sentence sequence and the structured query sequence are then concatenated to obtain the entity-aware input sequence.

[0008] Optionally, the entity-aware input sequence is encoded and extracted using a pre-trained language model and pooling methods to obtain head entity representations and tail entity representations. Then, a cue generator and fusion methods are used to process the head entity representations and tail entity representations to obtain fused soft cueing, including: The entity-aware input sequence is fed into a pre-trained language model to obtain the hidden state matrix output by the last layer of the model. Based on the entity start and end markers, the first position set of the head entity and the second position set of the tail entity in the entity-aware input sequence are determined. Then, based on the hidden state matrix, the hidden state vectors corresponding to the first position set and the second position set are subjected to average pooling to obtain the head entity representation and the tail entity representation. The head entity representation and the tail entity representation are concatenated to form a joint entity pair representation. The joint entity pair representation is input into a cue generator to output an entity-aware dynamic soft cue. The entity-aware dynamic soft cue is then summed with a learnable baseline soft cue to obtain a fused soft cue that includes general semantics and specific semantics of the current entity pair. The cue generator is configured as a multilayer perceptron containing a nonlinear activation function.

[0009] Optionally, the computational expression representing the head entity is: ; The calculation expression for the tail entity is: ; in, For head entity representation, Represented as a tail entity, For the set of head entity locations, For the set of tail entity locations, For the first The hidden state corresponding to each position.

[0010] Optionally, the fused soft prompts and the entity-aware input sequence are processed using intelligent insertion and recoding methods to obtain an enhanced sentence representation. Then, a relation tagging and parameter estimation network is used to process the enhanced sentence representation to obtain a diffusion initial latent representation, including: Based on the relative positions of the head entity and the tail entity in the entity-aware input sequence, the insertion point of the fusion soft prompt is obtained. It is determined whether there is a sequential order between the head entity position and the tail entity position. If so, the fusion soft prompt is inserted after the entity position that is later. It is also determined whether the head entity position and the tail entity position overlap, cross sentences, or have an unclear relationship. If so, the fusion soft prompt is inserted in the middle position of the entity-aware input sequence or near the position of the relationship marker to obtain the enhanced input sequence. The enhanced input sequence is fed into the pre-trained language model for recoding to obtain an enhanced sentence representation. Based on the position of the relation marker in the enhanced input sequence, the corresponding hidden state is read from the enhanced sentence representation to obtain a relation representation. The relation representation is input into a parameter estimation network to obtain mean and variance parameters. The mean and variance parameters are then concatenated along the feature dimension to obtain the initial latent representation of the diffusion. The parameter estimation network includes mean parameters and variance parameters for outputting a Gaussian distribution.

[0011] Optionally, the computational expression for the initial potential representation of diffusion is: ; ; in, Represented as a relation, For the first parameter estimation network, For the second parameter estimation network, The mean parameter, For variance parameter, This represents the initial potential representation of diffusion.

[0012] Optionally, the initial latent representation of the diffusion model is purified using forward noise addition and backward denoising to obtain a purified relation representation. Then, a multi-instance attention aggregation method is used to process the purified relation representation to obtain a relation-packet level representation, including: Set the total number of diffusion steps and linear noise scheduling parameters for the diffusion model. During the forward noise addition process, sample the initial potential representation of diffusion at any diffusion step and add standard Gaussian noise to obtain the noise relationship representation of that diffusion step. In the reverse denoising process, the noise relation representation and the normalized time step are embedded into a reverse denoising network to predict the noise components contained in the current noise relation representation. The predicted noise components are then used to denoise and gradually restore the noise relation representation to obtain the cleaned relation representation for each sentence instance. Calculate the relevance weights between the purified relation representation and the candidate relation labels, and then use the relevance weights to perform a weighted summation on the purified relation representation to obtain the relation package-level representation.

[0013] Optionally, the calculation expressions for forward noise addition and backward noise reduction are as follows: ; ; in, For the first The noise relationship of the step is represented as follows: From step 1 to step 2 The cumulative signal retention rate of the step It is Gaussian noise. It is a reverse denoising network. This represents the total number of diffusion steps.

[0014] Optionally, a classifier is used to classify the relation package-level representation to complete the construction of the relation extraction model, obtaining the final remote supervised relation extraction prediction result. Then, the joint loss function is used to perform end-to-end training on the relation extraction model to complete model optimization, including: The relation package-level representation is input into a classifier, which outputs the probability value of each predefined relation type. The relation category with the highest probability value is set as the final remote supervised relation extraction prediction result of the relation package, thus completing the construction of the relation extraction model. The design incorporates relation classification cross-loss, KL divergence regularization loss, semantic reconstruction loss, and diffusion denoising loss to obtain a total loss function. This total loss function is then used to perform end-to-end training on the relation extraction model, thereby optimizing the model. Specifically, the relation classification cross-loss is used to supervise relation category prediction, the KL divergence regularization loss is used to constrain the latent Gaussian distribution to approximate a standard normal distribution, the semantic reconstruction loss is used to preserve semantic information in the cleaned representation, and the diffusion denoising loss is used to train the inverse denoising network.

[0015] This invention discloses the following technical effects by providing a remote supervision relationship extraction method based on dynamic soft hints and diffusion cleanup: 1. Significantly improved robustness in noisy environments: Through the diffusion cleanup mechanism, the model can effectively mitigate the negative impact of erroneous labels on relation representations. In real-world scenarios with many erroneous labels, the recognition accuracy is much higher than that of traditional deterministic models.

[0016] 2. Enhanced personalized understanding of entity pairs: Through dynamic soft cues based on entity perception, the model no longer understands sentences in a general way, but can dynamically adjust its semantic focus according to different entity pairs, thereby better distinguishing sentences with similar structures but different relationships.

[0017] 3. Improved generalization ability: The smooth semantic manifold and dynamic cueing mechanism learned during the diffusion process make the model less prone to overfitting to specific noise patterns in the training set, thus exhibiting better generalization performance when testing across datasets or handling long-tail relationships.

[0018] 4. Provides uncertainty estimation: The variance parameter output by the Gaussian parameterization step can be used as a measure of the confidence of the model prediction, providing valuable reference information for downstream applications, such as decision-making systems that require manual review.

[0019] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the method flow provided in an embodiment of the present invention; Figure 2 A comparison diagram of the dynamic soft hinting and diffusion cleanup method provided in the embodiments of the present invention and the traditional BERT relation extraction method; Figure 3 This is a schematic diagram of the overall structure of the purification module based on the dynamic soft prompting enhancement module and the diffusion-driven relationship, provided in an embodiment of the present invention. Detailed Implementation

[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] like Figure 1 As shown, this invention provides a method for extracting remote supervision relationships based on dynamic soft hints and diffusion cleanup, comprising: Step 1: Obtain remote supervision relation extraction data from the knowledge base. Using entity tagging and query sequence construction methods, process each sentence instance in the remote supervision relation extraction data to obtain an entity-aware input sequence. Step 1 includes: 1.1 Extract entity pairs and their corresponding relation tags from the knowledge base, and retrieve sentence instances containing entity pairs and their corresponding relation tags from the unstructured text corpus to obtain a relation package. Then, use the entity pairs and their corresponding relation tags as candidate relation tags for the relation package to obtain remote supervised relation extraction data; specifically: Remote supervised relation extraction data is obtained. This data is obtained by aligning a knowledge base with an unstructured text corpus. In a preferred embodiment, entity pairs and their relation tags are first read from the knowledge base. Then, sentence instances containing the same entity pair are retrieved from the text corpus. Multiple sentence instances with the same entity pair are grouped into a relation package, and the relation tags from the knowledge base are used as candidate relation tags for this package. The relation package can be represented as follows: ,in For the first Example sentences, For the head entity, It is a tail entity.

[0025] 1.2 For each sentence instance, the boundaries of the head and tail entities are explicitly marked in the original sentence using start and end markers to obtain a structured sentence sequence. A structured query sequence containing the head entity name, tail entity name, and relation markers is then constructed. Finally, the structured sentence sequence and the structured query sequence are concatenated to obtain the entity-aware input sequence. Specifically: Construct an entity-aware input sequence. For each sentence instance, explicitly label entity boundaries in the original sentence using head entity start markers, head entity end markers, tail entity start markers, and tail entity end markers to obtain a structured sentence sequence S. Further construct a structured query sequence Q, which includes head entities, tail entities, and relation markers [REL], to provide implicit relation inference cues to the model. The final input sequence can be represented as I=S⊕Q, where ⊕ represents sequence concatenation. This design allows the model to simultaneously obtain the original sentence context, entity location signals, and relation query cues.

[0026] Step 2, as follows Figure 2 , Figure 3 As shown, the entity-aware input sequence is encoded and extracted using a pre-trained language model and pooling method to obtain head entity representation and tail entity representation. Then, the head entity representation and tail entity representation are processed using a cue generator and fusion method to obtain fused soft cue. Step 2 includes: 2.1 The entity-aware input sequence is fed into a pre-trained language model to obtain the hidden state matrix output by the last layer of the model. Based on the entity start and end markers, the first position set of the head entity and the second position set of the tail entity in the entity-aware input sequence are determined. Then, based on the hidden state matrix, the hidden state vectors corresponding to the first position set and the second position set are subjected to average pooling to obtain the head entity representation and the tail entity representation. 2.2 The head entity representation and the tail entity representation are concatenated to form a joint entity pair representation. The joint entity pair representation is input into a prompt generator to output an entity-aware dynamic soft prompt. The entity-aware dynamic soft prompt is then summed with a learnable baseline soft prompt to obtain a fused soft prompt that includes general semantics and specific semantics of the current entity pair. The prompt generator is set as a multilayer perceptron containing a nonlinear activation function.

[0027] Step 2 in detail: Generate entity-aware dynamic soft cues. For example... Figure 3 As shown, the entity-aware input sequence I is input into the pre-trained language model to obtain the hidden state matrix H. Based on the entity labels, the head entity location set Ih and the tail entity location set It are determined, and average pooling is performed to obtain the head entity representation hh and the tail entity representation ht, respectively.

[0028] The formulas for calculating the head entity representation and the tail entity representation are as follows: Represent the head entity End-to-end entity representation After concatenation, input into the prompt generator Get entity perception dynamic soft prompts The prompt generator can employ a two-layer multilayer perceptron and use... The function is used as a non-linear activation function.

[0029] Furthermore, set up learnable benchmark soft tips. This is used to maintain the ability to model common language patterns and general task-related relational cues. and Perform summation or concatenation mapping to obtain fused soft suggestions. In this way, soft prompts can be integrated to include both general prompts and personalized prompts for the current entity pair.

[0030] Step 3: Process the fused soft prompts and the entity-aware input sequence using intelligent insertion and recoding methods to obtain an enhanced sentence representation. Then, process the enhanced sentence representation using a relation tagging and parameter estimation network to obtain a diffused initial latent representation. Step 3 includes: 3.1 Based on the relative positions of the head and tail entities in the entity-aware input sequence, the insertion point of the fused soft prompt is obtained. It is determined whether there is a sequential order between the head and tail entity positions. If so, the fused soft prompt is inserted after the entity position that is later in the sequence. It is also determined whether the head and tail entity positions overlap, cross sentences, or have an unclear relationship. If so, the fused soft prompt is inserted in the middle of the entity-aware input sequence or near a relationship marker, thus obtaining an enhanced input sequence. Specifically: Dynamic insertion of soft suggestions and recoding: To avoid soft suggestions disrupting the grammatical structure and entity proximity semantics of the original sentence, this invention employs an intelligent insertion strategy based on the relative position of entities. When the order of the head and tail entities is clear, the fused soft suggestion is inserted after the entity that appears later in the sentence, ensuring the suggestion is close to the key entity without interrupting its expression. When two entities cross sentences, are nested, or have unclear positional relationships, the fused soft suggestion is inserted near the midpoint of the input sequence or the relation marker [REL]. The enhanced input sequence after inserting the fused soft suggestion is then fed back into the pre-trained language model to obtain the enhanced sentence representation.

[0031] 3.2 The enhanced input sequence is fed into the pre-trained language model for recoding to obtain an enhanced sentence representation. Based on the position of the relation marker in the enhanced input sequence, the corresponding hidden state is read from the enhanced sentence representation to obtain a relation representation. This relation representation is then input into a parameter estimation network to obtain mean and variance parameters. The mean and variance parameters are then concatenated along the feature dimension to obtain the initial latent representation of the diffusion distribution. Specifically: Extract the relation representation and perform Gaussian parameterization. For the enhanced sentence representation, read the relation-related hidden states based on the position of the relation tag [REL] to obtain the relation representation. To transform traditional deterministic relation representations into probabilistic representations capable of expressing uncertainty, a first-parameter estimation network is used. Second parameter estimation network Mapping the relational representation yields the mean parameters of the Gaussian distribution. and variance parameter And splice them together to obtain the initial potential representation of diffusion. .

[0032] The Gaussian parameter estimation process can be expressed as: Step 4: The initial latent representation of the diffusion model is purified using forward noise addition and backward denoising to obtain a purified relation representation. Then, a multi-instance attention aggregation method is used to process the purified relation representation to obtain a relation-level representation. Step 4 includes: 4.1 Set the total number of diffusion steps and linear noise scheduling parameters for the diffusion model. During the forward noise addition process, sample the initial potential representation of diffusion at any diffusion step and add standard Gaussian noise to obtain the noise relationship representation of that diffusion step. 4.2 In the reverse denoising process, the noise relation representation and the normalized time step are embedded into a reverse denoising network to predict the noise components contained in the current noise relation representation. The predicted noise components are then used to denoise and gradually restore the noise relation representation to obtain the cleaned relation representation of each sentence instance. Specifically: Purification is represented by diffusion-driven relationships. For example... Figure 3 As shown, this invention models the influence of noise labels in remote supervision relation extraction as a perturbation accumulation process in the relation latent representation. Let the total number of diffusion steps be... The noise scheduling parameters are , , Indicates from step 1 to step 2. The cumulative signal retention rate at each step. Through reparameterization, this can be directly obtained from any diffusion step t. Sampling yields noise relationship representation .

[0033] The forward diffusion process can be represented as: In the reverse denoising stage, a parameterized denoising network εθ is constructed. This denoising network can be implemented using a multilayer perceptron, with its input being a noise relation representation. and normalized time step embedding The output is the noise component. The predicted value.

[0034] A denoising network can be represented as: Based on the predicted noise components, the noisy relation representation is reverse-recovered to obtain a cleaned relation representation. This process gradually restores the relation representation from the noise-contaminated latent space to a cleaner and more stable semantic manifold, thereby mitigating the impact of mislabeling and ambiguous context on the classification boundary.

[0035] 4.3 Calculate the relevance weights between the purified relation representation and the candidate relation labels, and then use these relevance weights to perform a weighted summation of the purified relation representation to obtain a relation package-level representation. Specifically: Multi-instance attention aggregation and relation classification are performed. For a relation package consisting of the same entity pair, a cleaned relation representation for each sentence instance within the package is obtained. Then, the relevance weights between each sentence instance and the candidate relation labels are calculated, and a weighted sum is obtained based on these relevance weights to obtain a relation package-level representation. This relation package-level representation is input into a classifier, which outputs the predicted probability for each relation type. The relation category with the highest probability is selected as the final relation extraction result.

[0036] Step 5: Classify the relation packet-level representation using a classifier to complete the construction of the relation extraction model, obtain the final relation prediction result, and then perform end-to-end training on the relation extraction model using a joint loss function to complete model optimization. Step 5 includes: 5.1 Input the relation package-level representation into a classifier, output the probability value of each predefined relation type, and set the relation category with the highest probability value as the final remote supervised relation extraction prediction result of the relation package, thus completing the construction of the relation extraction model; 5.2 Design relation classification cross loss, KL divergence regularization loss, semantic reconstruction loss, and diffusion denoising loss to obtain the total loss function. Use the total loss function to perform end-to-end training on the relation extraction model to complete model optimization. Among them, the relation classification cross loss is used to supervise relation category prediction, the KL divergence regularization loss is used to constrain the latent Gaussian distribution to be close to the standard normal distribution, the semantic reconstruction loss is used to keep the purified representation retaining semantic information, and the diffusion denoising loss is used to train the inverse denoising network.

[0037] Step 5 in detail: End-to-end training is performed using a joint loss function. To simultaneously optimize relation classification ability, latent distribution structure, semantic preservation ability, and diffusion denoising ability, this invention designs a multi-task joint loss function. This joint loss function includes relation classification cross-entropy loss. KL regularization loss Semantic reconstruction loss and diffusion denoising loss .

[0038] The joint loss function can be expressed as: in, Used to supervise the model's ability to discriminate entity relationship categories; LKL is used to constrain the latent Gaussian distribution. It approximates the standard normal distribution, avoiding potential space overfitting; To constrain the purification of latent variables to retain their original global semantic information, the SmoothL1 distance can be used for calculation. Used to train a reverse denoising network to accurately predict and remove Gaussian noise introduced during forward diffusion; , , and This is the loss weight.

[0039] In one optional embodiment, the pre-trained language model uses a BERT-based model; the cue generator uses a two-layer multilayer perceptron; the total number of diffusion steps T is set to 500; and the noise scheduling parameter... Linear scheduling is employed, varying within the range of [10^-4, 0.02]; the optimizer used is Adam or AdamW. The above parameters are merely examples and can be adjusted by those skilled in the art based on corpus size, number of relation categories, and computational resources.

[0040] Specifically, this invention differs from the traditional approach of directly using BERT sentence encoding for relation classification: traditional methods typically obtain overall, contextual, and relational representations from sentences or pseudo-paragraphs and then classify them directly. In contrast, this invention introduces entity-aware dynamic soft cues at the input layer, enabling the model to generate differentiated semantic cues based on specific entity pairs; and introduces a diffusion purification mechanism at the representation layer, allowing relational representations to undergo noise injection and reverse recovery processes to obtain more stable and pure relational features. These two mechanisms work synergistically: the former improves the accuracy of entity semantic understanding, while the latter enhances the robustness of representation learning under noisy label conditions.

[0041] This invention can be applied to scenarios requiring the automatic extraction of entity relationships from large-scale unstructured text, such as automatic knowledge graph construction, open domain information extraction, financial public opinion relationship identification, medical literature relationship mining, and government document entity relationship discovery. For common issues in remote supervision data, such as false positive labels, sentence semantic ambiguity, and long-tailed relationship expressions, this invention can obtain more stable relationship discrimination results through entity perception enhancement and diffusion purification.

[0042] Therefore, this invention provides a remote supervised relation extraction method based on dynamic soft hints and diffusion cleanup, which solves the problems of pre-trained models lacking personalized understanding of entity pairs and deterministic relation representations being easily interfered with by noise labels in remote supervised relation extraction, thereby improving the robustness, generalization ability and recognition accuracy of relation extraction in noisy scenarios.

[0043] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0044] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for extracting remote supervisory relationships based on dynamic soft hints and diffusion cleanup, characterized in that, include: Remote supervision relation extraction data is obtained from the knowledge base. Entity tagging and query sequence construction methods are used to process each sentence instance in the remote supervision relation extraction data to obtain an entity-aware input sequence. The entity-aware input sequence is encoded and extracted using a pre-trained language model and pooling method to obtain head entity representation and tail entity representation. Then, the head entity representation and tail entity representation are processed using a prompt generator and fusion method to obtain fused soft prompts. The fused soft prompts and the entity-aware input sequence are processed using intelligent insertion and recoding methods to obtain an enhanced sentence representation. Then, the enhanced sentence representation is processed using a relation tagging localization and parameter estimation network to obtain a diffusion initial latent representation. The initial latent representation of the diffusion model is purified by forward noise addition and backward noise reduction to obtain a purified relation representation. Then, the purified relation representation is processed by a multi-instance attention aggregation method to obtain a relation package-level representation. The relation package-level representation is classified using a classifier to complete the construction of the relation extraction model and obtain the final relation prediction result. Then, the relation extraction model is trained end-to-end using a joint loss function to complete the model optimization.

2. The remote monitoring relationship extraction method based on dynamic soft hints and diffusion cleanup according to claim 1, characterized in that, Remote supervision relation extraction data is obtained from the knowledge base. Entity tagging and query sequence construction methods are used to process each sentence entity in the remote supervision relation extraction data to obtain an entity-aware input sequence, including: Entity pairs and their corresponding relation tags are extracted from the knowledge base, and sentence instances containing entity pairs and their corresponding relation tags are retrieved from unstructured text corpus to obtain relation packages. The entity pairs and their corresponding relation tags are then used as candidate relation tags for the relation packages to obtain remote supervised relation extraction data. For each sentence instance, the boundaries of the head entity and the tail entity are explicitly marked in the original sentence using start and end markers to obtain a structured sentence sequence. A structured query sequence containing the head entity name, the tail entity name, and relation markers is then constructed. The structured sentence sequence and the structured query sequence are then concatenated to obtain the entity-aware input sequence.

3. The remote monitoring relationship extraction method based on dynamic soft hints and diffusion purification according to claim 2, characterized in that, The entity-aware input sequence is encoded and extracted using a pre-trained language model and pooling method to obtain head entity representation and tail entity representation. Then, a cue generator and fusion method are used to process the head entity representation and tail entity representation to obtain fused soft cue, including: The entity-aware input sequence is fed into a pre-trained language model to obtain the hidden state matrix output by the last layer of the model. Based on the entity start and end markers, the first position set of the head entity and the second position set of the tail entity in the entity-aware input sequence are determined. Then, based on the hidden state matrix, the hidden state vectors corresponding to the first position set and the second position set are subjected to average pooling to obtain the head entity representation and the tail entity representation. The head entity representation and the tail entity representation are concatenated to form a joint entity pair representation. The joint entity pair representation is input into a cue generator to output an entity-aware dynamic soft cue. The entity-aware dynamic soft cue is then summed with a learnable baseline soft cue to obtain a fused soft cue that includes general semantics and specific semantics of the current entity pair. The cue generator is configured as a multilayer perceptron containing a nonlinear activation function.

4. The remote monitoring relationship extraction method based on dynamic soft hints and diffusion cleanup according to claim 3, characterized in that: The computational expression represented by the head entity is: ; The calculation expression for the tail entity is: ; in, For head entity representation, Represented as a tail entity, For the set of head entity locations, For the set of tail entity locations, For the first The hidden state corresponding to each position.

5. The remote monitoring relationship extraction method based on dynamic soft hints and diffusion purification according to claim 4, characterized in that, The fused soft prompts and the entity-aware input sequence are processed using intelligent insertion and recoding methods to obtain an enhanced sentence representation. This enhanced sentence representation is then processed using a relation tagging and parameter estimation network to obtain a diffusion initial latent representation, including: Based on the relative positions of the head entity and the tail entity in the entity-aware input sequence, the insertion point of the fusion soft prompt is obtained. It is determined whether there is a sequential order between the head entity position and the tail entity position. If so, the fusion soft prompt is inserted after the entity position that is later. It is also determined whether the head entity position and the tail entity position overlap, cross sentences, or have an unclear relationship. If so, the fusion soft prompt is inserted in the middle position of the entity-aware input sequence or near the position of the relationship marker to obtain the enhanced input sequence. The enhanced input sequence is fed into the pre-trained language model for recoding to obtain an enhanced sentence representation. Based on the position of the relation marker in the enhanced input sequence, the corresponding hidden state is read from the enhanced sentence representation to obtain a relation representation. The relation representation is input into a parameter estimation network to obtain mean and variance parameters. The mean and variance parameters are then concatenated along the feature dimension to obtain the initial latent representation of the diffusion. The parameter estimation network includes mean parameters and variance parameters for outputting a Gaussian distribution.

6. The remote monitoring relationship extraction method based on dynamic soft hints and diffusion cleanup according to claim 5, characterized in that, The computational expression for the initial potential representation of diffusion is: ; ; in, Represented as a relation, For the first parameter estimation network, For the second parameter estimation network, The mean parameter, For variance parameter, This represents the initial potential representation of diffusion.

7. The remote monitoring relationship extraction method based on dynamic soft hints and diffusion cleanup according to claim 6, characterized in that, The initial latent representation of the diffusion model is purified using forward noise addition and backward denoising to obtain a purified relation representation. Then, a multi-instance attention aggregation method is used to process the purified relation representation to obtain a relation packet-level representation, including: Set the total number of diffusion steps and linear noise scheduling parameters for the diffusion model. During the forward noise addition process, sample the initial potential representation of diffusion at any diffusion step and add standard Gaussian noise to obtain the noise relationship representation of that diffusion step. In the reverse denoising process, the noise relation representation and the normalized time step are embedded into a reverse denoising network to predict the noise components contained in the current noise relation representation. The predicted noise components are then used to denoise and gradually restore the noise relation representation to obtain the cleaned relation representation for each sentence instance. Calculate the relevance weights between the purified relation representation and the candidate relation labels, and then use the relevance weights to perform a weighted summation on the purified relation representation to obtain the relation package-level representation.

8. The remote monitoring relationship extraction method based on dynamic soft hints and diffusion cleanup according to claim 7, characterized in that, The calculation expressions for forward noise addition and backward noise reduction are: ; ; in, For the first The noise relationship of the step is represented as follows: From step 1 to step 2 The cumulative signal retention rate of the step It is Gaussian noise. It is a reverse denoising network. This represents the total number of diffusion steps.

9. The remote monitoring relationship extraction method based on dynamic soft hints and diffusion cleanup according to claim 8, characterized in that, The relation packet-level representation is classified using a classifier to construct the relation extraction model, obtaining the final remote supervised relation extraction prediction result. Then, the relation extraction model is trained end-to-end using a joint loss function to optimize the model, including: The relation package-level representation is input into a classifier, which outputs the probability value of each predefined relation type. The relation category with the highest probability value is set as the final remote supervised relation extraction prediction result of the relation package, thus completing the construction of the relation extraction model. The design incorporates relation classification cross-loss, KL divergence regularization loss, semantic reconstruction loss, and diffusion denoising loss to obtain a total loss function. This total loss function is then used to perform end-to-end training on the relation extraction model, thereby optimizing the model. Specifically, the relation classification cross-loss is used to supervise relation category prediction, the KL divergence regularization loss is used to constrain the latent Gaussian distribution to approximate a standard normal distribution, the semantic reconstruction loss is used to preserve semantic information in the cleaned representation, and the diffusion denoising loss is used to train the inverse denoising network.