An adaptive prompt learning and constraint enhanced low-resource biomedical relation extraction method

By using an adaptive prompt generation module and a constraint-enhanced decoding module, task-related soft prompt vectors are generated, solving the technical problem of biomedical relation extraction under low-resource conditions. An adaptive generation model is realized, significantly improving the application of adaptive generation technology in the biomedical field. This solves the problem of performance degradation of adaptive generation models in existing technologies and achieves efficient relation extraction under low-resource conditions.

CN122366436APending Publication Date: 2026-07-10CHINA THREE GORGES UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610548243.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-23
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing biomedical relation extraction methods cannot effectively cope with scarce annotations in low-resource scenarios. Especially in the biomedical field, existing technologies cannot adaptively generate prompt words, leading to a decline in model performance. Furthermore, they cannot effectively handle semantic ambiguity and long-distance dependencies, and are prone to outputting illegal triples and nested entity errors.

Method used

An adaptive cue learning and constraint enhancement approach is adopted. The adaptive cue generation module generates task-related soft cue vectors, and the context representation learning is performed by combining a gating mechanism and a pre-trained encoder. Relation type constraints and entity matching scores are introduced into a weighted fusion, and a pruning strategy is used to generate the final relation triples.

Benefits of technology

It significantly improves the model's semantic awareness and output structural consistency under low resource conditions, effectively solves semantic ambiguity and long-distance dependency problems, and improves the accuracy and robustness of relation extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122366436A_ABST
    Figure CN122366436A_ABST
Patent Text Reader

Abstract

The application discloses a low-resource biomedical relation extraction method based on adaptive prompt learning and constraint enhancement, aiming at problems of low-resource annotation scarcity, poor adaptability of artificial prompts, and illegal output triplets, and constructs a double-branch training architecture of few-shot and full-shot; a VAE is used to realize soft prompt vector coding, compression and reconstruction through an adaptive prompt generation module, a gate mechanism is used to dynamically adjust the fusion proportion of prompts and texts, and context representation learning is completed through SciBERT; an entity extraction is realized through a span extraction based on a relation recognition module, a multi-label relation classification is used to predict the relation probability of entities; and a constraint enhancement decoding module filters illegal combinations and removes redundant triplets through a relation type constraint mask, entity-relation score weighted fusion, relation number prediction and pruning strategy. The application significantly improves the extraction accuracy in a low-resource scene, the output triplet structure is legal and consistent, and the application is suitable for biomedical professional texts and small-area field data scarce scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of biomedical natural language processing technology, specifically to a low-resource biomedical relation extraction method with adaptive prompting learning and constraint enhancement. Background Technology

[0002] The rapid growth of biomedical literature has made extracting useful information from this unstructured text increasingly important. Biomedical relation extraction aims to automatically identify entities (such as drugs, diseases, and genes) and their relationships from large volumes of literature, supporting medical research, clinical decision-making, and knowledge graph construction. However, in resource-constrained scenarios, the lack of labeled data makes existing models ineffective in handling this task, leading to unstable extraction results and severely hindering the development of automated data processing in the biomedical field. This involves identifying biomedical entities and their relationships from plain text; this structured data can be applied to downstream tasks and real-world environments in academia and industry.

[0003] Currently, methods represented by pre-trained language models (such as BERT and SciBERT) have made significant progress in biomedical relation extraction tasks. These methods are typically trained on large-scale labeled data and exhibit strong semantic understanding and relation modeling capabilities when resources are abundant. However, in real-world applications, especially in low-resource or even low-sample environments, the performance of these methods significantly degrades. This is mainly because the models heavily rely on labeled samples during training. When labels are scarce or the class distribution is imbalanced, the models struggle to fully learn the task-specific semantic patterns and relational structures, thus limiting their generalization ability. Furthermore, existing methods mostly focus on two independent or joint sub-tasks: entity recognition and relation classification, while paying insufficient attention to semantic ambiguity, multi-level interactions between entities, and long-distance dependencies in biomedical texts. For example, the same entity may assume different semantic roles in different contexts, and determining some relations may require cross-sentence or cross-paragraph understanding. These factors collectively constrain the effectiveness and stability of existing models under low-resource conditions.

[0004] In the prior art, patent CN121009198A provides a biomedical relation extraction method and system based on a large language model. Its process involves constructing a biomedical-specific prompt word strategy, calling a large language model to generate external knowledge of entity / relation descriptions, designing three feature fusion strategies (entity description fusion, independent encoding of relation descriptions, and joint encoding of relation descriptions), modifying the MT-ScBERT model to complete training, and outputting structured biomedical relation triples. It primarily leverages a large language model to introduce domain-specific external knowledge, achieves deep interaction between the original text and knowledge through multi-strategy feature fusion, and optimizes the model input layer to adapt to knowledge injection, thus addressing the problems of insufficient utilization of external knowledge and limited model structure optimization in traditional methods.

[0005] Patent CN111222338A provides a biomedical relation extraction method based on a pre-trained model and self-attention mechanism. It employs corpus preprocessing and entity location feature construction, ELMO pre-trained model for semantic feature extraction, BiLSTM for learning contextual information, multi-head self-attention for capturing internal textual associations, and fully connected layers for relation prediction. It primarily uses ELMO to address the polysemy problem in biomedical texts, incorporates location features to strengthen entity association modeling, and combines BiLSTM with multi-head self-attention to enhance complex semantic extraction capabilities, adapting to both formal and informal biomedical texts.

[0006] However, the existing technology has the following drawbacks:

[0007] Designed only for scenarios with sufficient annotations, it lacks a training branch with few samples. When low-resource annotations are scarce, the model performance drops sharply, making it unsuitable for addressing the pain point of data scarcity in niche biomedical fields.

[0008] The prompts are fixed templates designed manually, lacking adaptive generation capabilities and the ability to dynamically adjust their contribution based on context, resulting in poor adaptability between the prompts and the task.

[0009] Simply performing feature fusion without adding entity type constraints, relation quantity prediction, or redundancy pruning can easily result in outputting illegal triples, nested entity errors, and chaotic overlapping relations.

[0010] The method employs simple splicing / independent encoding fusion without a dynamic weight adjustment mechanism, resulting in the inability of prompt signals to accurately guide the model and low feature utilization efficiency.

[0011] Therefore, developing a biomedical relation extraction method that is resource-efficient, highly adaptive, and provides accurate output has become a pressing technical problem in this field. Summary of the Invention

[0012] To address the above problems, this invention proposes a low-resource biomedical relation extraction method based on adaptive cue learning and constraint enhancement, the method comprising the following steps: S1 involves constructing the training set, including: S101, construct a training set for a few-sample branch; S102, Construct the full sample branch training set; In step S1, three datasets were used for the validation of relation extraction, including Drugvar, DrugProt, and BC5CDR. When conducting low-resource experiments, the datasets were divided into DrugVar-200, DrugVar-500, DrugProt-200, and DrugProt-500 low-resource datasets according to a fixed number.

[0013] S2, the construction, training, and validation of the relation extraction model. The model structure includes an adaptive prompt generation module, a gating mechanism, a pre-trained encoder, a relation recognition module, and a constraint-enhanced decoding module. Training includes: S201, few-sample branch training; S202, full-sample branch training; In step S2, the adaptive prompt generation module initializes the trainable prompt vector and encodes and reconstructs the prompt vector related to the generation task through VAE (Variational Autoencoder). Then, the fusion ratio between the prompt vector and the original text is dynamically adjusted through a gating mechanism, and the fused sequence is input into the pre-trained encoder (SciBERT) for context representation learning.

[0014] In step S2, the relationship identification module extracts candidate entities and classifies relationships in the input sequence, and outputs the relationship probability of each pair of entities. The constraint enhancement decoding module applies relation type constraint masks (T). re The final relation triplet is generated by weighted fusion of entity matching score and relation score, combined with relation quantity prediction and pruning strategy.

[0015] The operations of the adaptive prompt generation module and the gating mechanism in step S2 include: A. Generate hidden representations by performing linear transformation and ReLU activation on the cue vector P. ; B. Generating latent variables through VAE And decoded into a cue vector R p ; C. R p Concatenate with the original text X to form the input sequence ; through gating mechanism Adjusted contribution prompts: .

[0016] In step S2, the constraint-enhanced decoding module calculates the final candidate entity pair score using the following formula: ; in, This represents the entity pair matching score. w represents the probability of predicting the relationship. rel The weighting coefficients are used to output the set of relational triples that satisfy the constraints.

[0017] The training of the relation extraction model in step S2 includes: A. Adaptive suggestion generation: Input text sequence Generate soft cue vectors using the adaptive cue generation module. The original cue vector P is encoded, and its hidden representation is obtained through linear transformation and nonlinear activation function. A compact cue vector R is generated through VAE encoding and reconstruction. p Hint vector R p With the original text splicing to form a fusion sequence To better adapt the model to the task objectives, a gating mechanism is used to dynamically adjust the cue contribution and output the adjusted input. ; for fusion sequences Input is fed into the SciBERT encoder for contextual representation learning. .

[0018] B. The relationship identification module predicts the relationship type of candidate entity pairs: To address the multi-label classification problem in biomedical relation extraction, a SciBERT-based relation classifier was employed. This classifier predicts the existence of a specific relation between each pair of entities by extracting sentence-level contextual representations.

[0019] The input sentence (including the cue vector) is encoded using a SciBERT encoder to obtain a contextual representation. ,use To represent the semantic information of the sentence. Output relation classification probability ( ) represents the predicted probability of the relationship type between each pair of entities in the input.

[0020] In the entity extraction stage, entity recognition is modeled as a span-based extraction problem. For the input original sentence (X), an adaptive prompt generation module is first used to generate prompt vectors. This guides the model to focus on entity information relevant to the current task and enhances its ability to model key semantic cues.

[0021] C. Constraint-enhanced decoding module selection and triple generation: To improve the reliability and structural consistency of relation triple generation, this invention proposes a constraint-enhanced decoding layer that filters and optimizes candidate relations by fusing multiple structural and semantic constraints. Specifically, this module enhances the decoding process in three aspects: First, a relation type constraint mask is introduced to ensure the structural legality of entity type combinations; Secondly, semantic matching capabilities are improved through a weighted fusion mechanism of entity pair scores and relation scores; Finally, candidate entities are screened by combining relation instance number prediction and pruning strategies, thereby reducing redundant triples and improving decoding efficiency.

[0022] This layer is particularly crucial in low-resource scenarios because insufficient samples can easily lead to unstable or conflicting local predictions. Structured constraints can significantly improve the consistency and reliability of the model output. In relation extraction tasks, the input sequence represents a specific relation. The calculated span *s* represents the relation type. Permitted The probability of a type of subject or object entity .

[0023] S3, tested using a relation extraction model, includes: S301 was tested on a public biomedical text dataset and compared with existing relation extraction models. S302, Validating the model's performance under low-resource conditions in a few-sample setting; S303, conduct ablation experiments to evaluate the independent contributions of the adaptive prompt generation module, relation recognition module, and constraint enhancement decoding module; In step S3, the test set is used to perform full-sample testing and few-sample testing, and the final test result is a combination of the few-sample test result and the full-sample test result.

[0024] Compared with the prior art, the beneficial effects of the present invention include: (1) Construct a dual-branch training architecture with few samples and full samples, which is designed for niche fields in biomedicine and scenarios with insufficient labeled data. The model can still converge quickly and make stable predictions even with extremely low resources, solving the defect that existing technologies are only applicable to scenarios with sufficient labeled data. The extraction accuracy is greatly improved under low resource conditions.

[0025] (2) The soft cue vector is encoded, compressed and reconstructed through VAE to generate task-specific, compact and efficient cue vectors without the need for manual design of static cue templates; the gating mechanism is used to dynamically adjust the fusion ratio of cue and text, and the cue contribution is accurately allocated according to the context, which significantly improves semantic guidance capability and task adaptability.

[0026] (3) By using relation type constraint mask, entity-relation score weighted fusion, and quantity prediction + pruning strategy to form triple constraints, illegal entity combinations are filtered out from the root and redundant triples are eliminated, effectively solving problems such as nested entities, overlapping relationships, and entity type misjudgment, and greatly improving the structural consistency and credibility of the output triples.

[0027] (4) The biomedical-specific pre-trained encoder SciBERT is used to enhance the modeling ability of professional terms and complex medical semantics; the VAE compresses prompt features and removes redundant information to reduce computational overhead, improve feature compactness and inference efficiency, and perfectly adapt to biomedical long texts and professional vocabulary-intensive scenarios.

[0028] (5) By integrating adaptive prompting, dynamic fusion, and constraint decoding, the model can cope with the challenges of semantic ambiguity, long-distance dependence, and multi-label classification in medical texts. It maintains stable performance in both formal literature and complex professional texts, and its generalization ability and robustness are significantly better than existing technologies. Attached Figure Description

[0029] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0030] Figure 1 This is a schematic diagram of the low-resource biomedical relation extraction method based on adaptive cue learning and constraint enhancement according to the present invention. Figure 2 This is an illustrative diagram illustrating the extraction of biomedical terminology using the method of this invention. Figure 3 This is a diagram of the method model architecture of the present invention; Figure 4 This is a structural diagram of the adaptive prompt generator of the present invention; Figure 5 This is a comparison result diagram of the method of the present invention under extremely low resource conditions. Detailed Implementation

[0031] The overall flowchart of the low-resource biomedical relation extraction method based on adaptive cue learning and constraint enhancement described in this invention is as follows: Figure 1 As shown, the specific implementation is as follows: Example 1: This invention relates to a biomedical low-resource relation extraction method based on adaptive cue learning and constraint enhancement, such as... Figure 3 The diagram shows the model architecture of the method of this invention. First, starting from biomedical text, a soft prompting mechanism is used to enhance the model's semantic perception ability in low-resource scenarios. Then, a relation extraction module is used to identify semantic relationships between entities, and structural constraints are introduced to screen the validity of candidate triples. Finally, structured data is generated for knowledge graph construction, thereby serving as an auxiliary task in biomedical research.

[0032] Specifically, the following steps are included: S1 involves constructing the training set, including: S101, construct a training set for a few-sample branch; S102, Construct the full sample branch training set; S2, the construction, training, and validation of the relation extraction model. The model structure includes an adaptive prompt generation module, a gating mechanism, a pre-trained encoder, a relation recognition module, and a constraint-enhanced decoding module. Training includes: S201, few-sample branch training; S202, full-sample branch training; S3, tested using a relation extraction model, includes: S301 was tested on a public biomedical text dataset and compared with existing relation extraction models. S302, Validating the model's performance under low-resource conditions in a few-sample setting; S303, conduct ablation experiments to evaluate the independent contributions of the adaptive prompt generation module, relation recognition module, and constraint enhancement decoding module; Preferably, in step S1, three datasets are used for the validation of relation extraction, including Drugvar, DrugProt and BC5CDR. When conducting low-resource experiments, the datasets are divided into DrugVar-200, DrugVar-500, DrugProt-200 and DrugProt-500 low-resource datasets according to a fixed number.

[0033] Preferably, in step S2, such as Figure 4 The diagram shows the structure of the adaptive prompt generator of the present invention. The adaptive prompt generation module initializes the trainable prompt vector and encodes and reconstructs the prompt vector related to the generation task through VAE (Variational Autoencoder). Then, the fusion ratio between the prompt vector and the original text is dynamically adjusted through a gating mechanism, and the fused sequence is input into the pre-trained encoder (SciBERT) for context representation learning.

[0034] Preferably, in step S3, a full-sample test and a few-sample test are performed using a test set, and the final test result combines the few-sample test result and the full-sample test result.

[0035] Preferably, in step S2, the relationship identification module extracts candidate entities and classifies relationships in the input sequence, outputting the relationship probability of each pair of entities. The constraint enhancement decoding module applies a relation type constraint mask (T). reThe final relation triplet is generated by weighted fusion of entity matching score and relation score, combined with relation quantity prediction and pruning strategy.

[0036] Preferably, the operations of the adaptive prompt generation module and the gating mechanism in step S2 include: A. Generate hidden representations by performing linear transformation and ReLU activation on the cue vector P. ; B. Generating latent variables through VAE And decoded into a cue vector R p ; C. R p Concatenate with the original text X to form the input sequence ; through gating mechanism Adjusted contribution prompts: .

[0037] Preferably, in step S2, the constraint-enhanced decoding module calculates the final candidate entity pair score using the following formula: ,in This represents the entity pair matching score. w represents the probability of predicting the relationship. rel The weighting coefficients are used to output the set of relational triples that satisfy the constraints.

[0038] Preferably, step S2, training the relation extraction model includes: A. Adaptive suggestion generation: The input text sequence X is used to generate soft cue vectors using the adaptive cue generation module. First, the original prompt vector... Encode the hidden representation using linear transformations and nonlinear activation functions. Where W1 and b1 are trainable parameters. Then, the mean in the latent space is obtained through a single linear layer mapping. and variance The sampling calculation process, performed using reparameterization techniques, is shown in the formula:

[0039] ; in, This represents random noise sampled from a standard normal distribution. Finally, the latent variables... The input decoder generates the reconstructed cue vector. Through this process, the reconstructed cue vector R can be obtained. p This means that key information related to the task can be effectively retained.

[0040] After obtaining the reconstruction hint vector R p Then, it is concatenated with the original input sentence to construct a new input sequence; the cue vector R p Combined with the original text X to form a fused sequence ; To better adapt the model to the task objective, gating mechanisms are used to dynamically adjust the contribution of cues, and the influence of cues changes at different training stages: ; in, When it is the t-th training step, input The hidden state representation of the cue vector and the text is concatenated. and These are learning parameters. It is the sigmoid activation function, output Control prompts contribute to the model input; output adjusted input. ; for fusion sequences Input is fed into the SciBERT encoder for contextual representation learning. .

[0041] To ensure that the cue vectors can be learned effectively, independent learning rates are designed for the cue vectors: and ; in, It is a loss function. and These are the gradients of the cue vector and the encoder output, respectively. and These refer to the learning rates for the cue vector and the encoder output, respectively. Adaptive cue generation itself does not involve the specific extraction of entities or the direct classification of relationships; it merely provides a guiding signal for the model. Therefore, two modules—relation classification and entity extraction—are needed to actually perform the relation extraction task, further analyzing and identifying entities and their relationships in the sentence.

[0042] B. The relationship identification module predicts the relationship type of candidate entity pairs: To address the multi-label classification problem in biomedical relation extraction, a SciBERT-based relation classifier was employed. This classifier predicts the existence of a specific relation between each pair of entities by extracting sentence-level contextual representations. The input sentences (including cue vectors) are encoded using a SciBERT encoder to obtain the contextual representations. Then use To represent the semantic information of the sentence. Output relation classification probability ( ), representing the predicted probability of the relationship type between each pair of entities in the input. Entity recognition is modeled as a span-based extraction problem during the entity extraction stage.

[0043] For the input original sentence (X), the adaptive prompt generation module first generates a prompt vector. This guides the model to focus on entity information relevant to the current task and enhances its ability to model key semantic cues. Let FFNN represent a feedforward neural network. The token representation matrix is ​​the output of the encoder, where Let N represent the context representation vector of the t-th token in the sequence, where N is the sequence length. Based on these context representations, the model further utilizes an attention mechanism to perform feature aggregation and representation computation for each potential entity span.

[0044] Considering the strong structural constraints between entity types and relation types, this invention introduces relation type conditions during entity extraction, specifying the problem to each possible relation type that may appear in a sentence. The construction of question templates depends on the relation type and its corresponding entity type. For example, when extracting the "activate" relation between a drug and a gene, the question could be designed as: "What gene does the chemical activate?", where "chemical" and "gene" correspond to the entity types in the sentence. In the actual input construction phase, the relation question q... r The input sequence of the model is formed by concatenating the input sequence with the original sentence X. During forward propagation, the input sequence The data is fed into the SciBERT encoder to obtain a contextual representation. Subsequently, all candidate spans in the sentence are processed. Perform representation learning. Let... This represents a feedforward neural network. The token representation matrix is ​​the output of the encoder, where Indicates the first in the sequence A context representation vector for each token. Where is the sequence length. Based on these contextual representations, the model further utilizes an attention mechanism to perform feature aggregation and representation calculation for each potential entity span, as shown in the formula: ; Among them, weight This represents the normalized attention score. , The starting and ending positions of the span s are represented respectively. This represents the concatenation of all tokens within a span s. This represents the feature representation of the t-th token within a span s. For token indices used for normalization within the same span, attention weights are guaranteed. The sum within the span is 1. It is an attention-weighted sum within the span, used to capture the overall semantics within. and These are the start and end tokens of the span, used to emphasize boundary information. It is a learnable embedding of the span length, used to provide width information. The attention mechanism can weighted aggregate of key token information within the span, improving representation capabilities.

[0045] C. Constraint-enhanced decoding module selection and triple generation: To improve the reliability and structural consistency of relation triple generation, this invention proposes a constraint-enhanced decoding layer that filters and optimizes candidate relations by fusing multiple structural and semantic constraints. Specifically, this module enhances the decoding process in three ways: First, it introduces a relation type constraint mask to ensure the structural legality of entity type combinations; second, it improves semantic matching capabilities through a weighted fusion mechanism of entity pair scores and relation scores; and finally, it combines relation instance count prediction and pruning strategies to filter candidate entities, thereby reducing redundant triples and improving decoding efficiency. This layer is particularly crucial in low-resource scenarios, as insufficient samples can easily lead to unstable or conflicting local predictions. Structured constraints can significantly improve the consistency and credibility of the model output.

[0046] Entity candidate pairs are obtained through the entity extraction module. This represents each possible pair of subject and object entities in the sentence. The relation classification module outputs a relation score. This represents the probability that a certain relationship exists between any two pairs of entities. Each relationship type... Each corresponds to an entity type constraint mask. This is used to explicitly mark the legal main entity – guest entity type combinations under this relationship. The decoding phase only occurs if the candidate entity pair satisfies… Only when the entity pair is selected is it retained, thus filtering out candidate triples that do not conform to the biomedical semantic structure. To further improve the reliability of relation prediction, this invention introduces entity pair matching scores in the decoding stage and weights them with relation prediction probabilities, thereby jointly evaluating candidate triples from both entity semantic matching and relation semantic perspectives, as shown in the formula: ; in, It is the entity pair score, indicating whether they match. W rel It is a weighting coefficient, representing the relative importance of the control relationship score and the entity score.

[0047] To further optimize the generated relation triples and improve inference efficiency, a pruning algorithm (text-NMS) is introduced to remove redundant and low-confidence entities. Unlike traditional Text-NMS methods, this invention incorporates an entity confidence function during the pruning process. The candidate spans are sorted and combined with the entity count output by the quantity prediction module. This serves as a termination condition, thereby reducing redundant entities while ensuring entity coverage. First, for each candidate entity... Calculate its confidence level , representing the probability that the entity is not empty. Then, candidate entities are evaluated across all spans based on their confidence scores. Sort in descending order and add to the new final span set. In the middle. For the span with the highest confidence level. Add it to and from the original set Remove any related to Overlapping span At the same time from Remove from As shown in the formula: ; This process will continue until the final set of entities is reached. Size reaches the predicted number of entities or candidate set Empty. When generating the final relation triples, a graph matching reasoning method is used. By establishing a graph structure between entity pairs, and comprehensively considering all possible main and guest entity pairs, the optimal relation triples are generated to address the overlapping triples problem in biomedical texts. The entity set is optimized through quantity prediction and pruning. Used to generate the final relation triples Each relation triple is generated based on the optimized set of entities. The model then uses weighted score calculations to evaluate the quality of each generated triple, ultimately selecting the triple with the highest score for output.

[0048] Example 2: In step S3, the low-resource relation extraction model is used to test the text in the dataset, as follows: Figure 2This paper presents examples of common error types in low-resource biomedical relation extraction. Taking the sentence "The antimicrobial properties of synthetic fatty acids were assessed against two human pathogens: Pseudomonas aeruginosa and Klebsiella pneumoniae" as an example, the correct relation triples should be: (synthetic fatty acids: DRUG, exhibit, Pseudomonas aeruginosa: MICROORGANISM) and (synthetic fatty acids: DRUG, exhibit, Klebsiellapneumoniae: MICROORGANISM). However, existing models are prone to generating type-incorrect triples under low-resource conditions, such as incorrectly identifying "human" as "PHENOTYPE" and establishing an "exhibit" relation with "DRUG". These errors demonstrate the model's inadequacy in entity type constraints and semantic matching capabilities, further illustrating the necessity of introducing adaptive prompt generation and constraint-enhancing decoding modules.

[0049] Comparative experiments were conducted on publicly available datasets with existing relation extraction methods, such as... Figure 5 The figure shows the comparison results of the method of the present invention under extremely low resource conditions. To ensure that the model obtains optimal performance in the biomedical relation extraction task, AdamW with a preheating ratio of 0.1 was used. The experimental results are shown in Tables 1 and 2.

[0050] Table 1 Comparison results of the models under low resource conditions.

[0051] As shown in Table 1, the proposed model achieves excellent extraction performance on the DrugVar-200, DrugVar-500, DrugProt-200, and DrugProt-500 datasets, with varying degrees of improvement in F1 scores. Specifically, APCE achieves F1 scores of 66.67% and 61.93% on the DrugVar-200 and DrugProt-200 test sets, respectively, demonstrating a significant advantage over other existing models. Particularly on the DrugVar-200 dataset, APCE's F1 score is 7.29 percentage points higher than TPLinker-Plus and 7.44 percentage points higher than KECI. On DrugProt-200, APCE also significantly outperformed other models, with an F1 score 10.91 percentage points higher than SpanBioER, 8.63 percentage points higher than REBEL, and 8.28 percentage points higher than Bio-RFX. The generative model GPT-4 performed poorly on the relation extraction task because the generative model linearizes triples into sequential sequences, while relation extraction aims to identify the interaction relationships between entities, which may not be suitable as a direct sequence generation task.

[0052] Table 2 shows the comparison results of the models with the full dataset.

[0053] As shown in Table 2, APCE outperforms most benchmark models on the full dataset, especially on the DrugVar dataset, where APCE achieves an F1 score of 76.75%, a difference of 17.05 percentage points compared to other models. On the BC5CDR dataset, the difference in F1 score is as high as 15.09 percentage points. Compared to other models, APCE demonstrates stable performance on the full dataset, proving its strong adaptability and robustness under different data conditions.

[0054] Ablation experiments were conducted on the relation extraction model, as detailed below: (1) Baseline (B): Baseline model (2) B-RAB: indicates that the APRL module is subtracted from the baseline model.

[0055] (3) B-CAT: indicates that the COEM module is removed from the baseline model.

[0056] (4) B-RAB-CAT: indicates that the APRL module and COEM module are subtracted from the baseline model at the same time.

[0057] The experimental results under low resource conditions are shown in Table 3, and those under full resource conditions are shown in Table 4.

[0058] Table 3 Ablation experiments under low resource conditions

[0059] As shown in Table 3, under low-resource conditions, removing the Adaptive Hint Learning module (w / o APRL) resulted in a decrease in the F1 score of the APCE model across all four datasets, particularly a 10.09 percentage point drop on DrugVar-200. This indicates that the Adaptive Hint Learning module makes a significant contribution to relation extraction under low-resource conditions. This module enhances the model's learning ability on low-resource data by dynamically generating task-relevant hint vectors. Secondly, removing the Constraint Augmentation module (w / o COEM) also led to a decline in model performance, with F1 scores decreasing by 7.85 and 5.36 percentage points on the DrugVar-200 and DrugProt-200 datasets, respectively. This demonstrates that the Structural Constraint Augmentation module, by introducing type constraints between entities, effectively reduces misprediction and improves the accuracy of relation extraction. The performance of the APCE model deteriorated most significantly after removing both the adaptive prompting learning and constraint enhancement modules (without APRL+COEM), particularly on DrugVar-200 where the F1 score dropped by 14.66 percentage points and on DrugProt-200 by 7.01 percentage points. This indicates that the combination of the two modules is crucial for relation extraction tasks, and removing either module will significantly impact the model's performance.

[0060] Table 4 Ablation experiments under full volume conditions

[0061] As shown in Table 4, after removing the Adaptive Hints Learning (w / o APRL) module on the full dataset, the model's F1 score on the DrugVar and BC5CDR datasets decreased by 4.62 and 2.36 percentage points, respectively, indicating the important role of this module in improving relation extraction performance on the full dataset. After removing the Constraint Augmentation (w / o COEM) module, the model performance decreased by 8.42 and 1.71 percentage points on the DrugVar and BC5CDR datasets, respectively, further demonstrating the module's contribution to constraint relation extraction.

[0062] When both adaptive prompting learning and constraint enhancement modules (w / o APRL+COEM) were removed, the model performance deteriorated more significantly, with F1 scores dropping by 8.98 and 4.38 percentage points on the DrugVar and BC5CDR datasets, respectively. This indicates that the combination of the two is crucial for maintaining the model's high performance.

[0063] In summary, this invention provides a low-resource relation extraction method based on adaptive cue learning and constraint enhancement. This method generates soft cue vectors through an adaptive cue generation module, and encodes, compresses, and reconstructs them using a variational autoencoder, making the cue vectors compact and task-relevant, thereby enhancing the model's ability to perceive relation types. Then, the original text is directly encoded to extract sentence context features, and the two branches of features are dynamically fused through a gating mechanism to generate candidate entity and relation features. Subsequently, the fused features are input into a relation recognition module for candidate entity pair modeling and relation classification. A constraint enhancement decoding module combines relation type constraints, entity matching scores, and quantity prediction for filtering and optimization, generating the final high-precision relation triples. Compared to existing low-resource relation extraction methods, this invention effectively alleviates the impact of scarce annotations and text complexity on model performance, significantly improving the accuracy and robustness of biomedical relation extraction.

[0064] The embodiments described above are merely illustrative of implementation methods of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A low-resource biomedical relation extraction method based on adaptive cue learning and constraint reinforcement, characterized in that, include: S1. Construct training sets for both the few-sample and full-sample branches; S2. Construction, training, and validation of the relation extraction model; The model consists of an adaptive prompt generation module, a gating mechanism, a pre-trained encoder, a relationship recognition module, and a constraint enhancement decoding module. S3. Test on a publicly available biomedical text dataset and compare it with existing relation extraction models.

2. The low-resource biomedical relation extraction method based on adaptive cue learning and constraint enhancement according to claim 1, characterized in that, In step S2, the adaptive prompt generation module initializes the trainable prompt vector and generates task-related prompt vectors through VAE encoding and reconstruction. Subsequently, the fusion ratio between the cue vector and the original text is dynamically adjusted through a gating mechanism, and the fused sequence is input into a pre-trained encoder for context representation learning.

3. The low-resource biomedical relation extraction method with adaptive cueing learning and constraint enhancement according to claim 1, characterized in that, In step S2, the relationship identification module extracts candidate entities and classifies relationships in the input sequence, and outputs the relationship probability of each pair of entities. The constraint-enhanced decoding module applies a weighted fusion of relation type constraint masks, entity matching scores, and relation scores, and combines relation quantity prediction and pruning strategies to generate the final relation triplet.

4. The low-resource biomedical relation extraction method with adaptive cue learning and constraint enhancement according to claim 1, characterized in that, The training of the relation extraction model in step S2 includes: adaptive prompt generation, relation identification module predicting the relation type of candidate entity pairs, and constraint enhancement decoding module filtering and triple generation.

5. The low-resource biomedical relation extraction method with adaptive cue learning and constraint enhancement according to claim 4, characterized in that, The adaptive prompt generation method is as follows: [The original prompt vector is then processed...] Encode the hidden representation using linear transformations and nonlinear activation functions. , where W1 and b1 are trainable parameters; The mean in the latent space is obtained through mapping using a single linear layer. and variance The sampling calculation process, performed using reparameterization techniques, is shown in the formula: ; in, Let z represent random noise sampled from a standard normal distribution, and z be a latent variable. latent variables The input decoder generates the reconstructed cue vector. Through this process, the reconstructed cue vector R can be obtained. p ; The prompt vector R p Combined with the original text X to form a fused sequence .

6. The low-resource biomedical relation extraction method based on adaptive cue learning and constraint enhancement according to claim 5, characterized in that, To ensure that the cue vectors can be learned effectively, independent learning rates are designed for the cue vectors: and ; in, It is a loss function. and These are the gradients of the cue vector and the encoder output, respectively. and These are the learning rates for the cue vector and the encoder output, respectively.

7. The low-resource biomedical relation extraction method based on adaptive cue learning and constraint enhancement according to claim 4, characterized in that, The relation recognition module predicts the relation type of candidate entity pairs by employing a SciBERT-based relation classifier, which encodes the input sentence using a SciBERT encoder to obtain a contextual representation. Then use To represent the semantic information of a sentence; output the probability of relation classification. , which represents the predicted probability of the relationship type between each pair of entities in the input.

8. The low-resource biomedical relation extraction method with adaptive cue learning and constraint enhancement according to claim 4, characterized in that, The constraint-enhanced decoding module uses the following method for filtering: First, a relation type constraint mask is introduced to ensure the structural legality of entity type combinations; second, the semantic matching capability is improved through a weighted fusion mechanism of entity pair scores and relation scores; finally, candidate entities are filtered by combining relation instance number prediction and pruning strategies, thereby reducing redundant triples and improving decoding efficiency.

9. The low-resource biomedical relation extraction method based on adaptive cue learning and constraint enhancement according to claim 1, characterized in that, In step S2, the constraint-enhanced decoding module calculates the final candidate entity pair score using the following formula: ; in, This indicates the entity pair matching score. w represents the probability of predicting the relationship. rel The weighting coefficients are used to output the set of relational triples that satisfy the constraints.

10. The low-resource biomedical relation extraction method with adaptive cue learning and constraint enhancement according to claim 9, characterized in that, The triplet set is used to remove redundant and low-confidence entities using an optimized pruning algorithm; The optimization involves introducing an entity confidence function to sort candidate spans and using the number of entities output by the quantity prediction module as a termination condition, thereby reducing redundant entities while ensuring entity coverage.

Citation Information

Patent Citations

  • Biomedical relationship extraction method based on pre-training model and self-attention mechanism

    CN111222338A

  • Big language model-based biomedical relationship extraction method and system

    CN121009198A