A co-adaptive duality-aware framework for biomedical relation extraction

Abstract Motivation Biomedical relation extraction is a vital task for electronic health record mining and biomedical knowledge base construction. Previous work often adopts pipeline methods or joint methods to extract subject, relation, and object while ignoring the interaction of subject–object entity pair and relation within the triplet structure. However, we observe that entity pair and relation within a triplet are highly related, which motivates us to build a framework to extract triplets that can capture the rich interactions among the elements in a triplet. Results We propose a novel co-adaptive biomedical relation extraction framework based on a duality-aware mechanism. This framework is designed as a bidirectional extraction structure that fully takes interdependence into account in the duality-aware extraction process of subject–object entity pair and relation. Based on the framework, we design a co-adaptive training strategy and a co-adaptive tuning algorithm as collaborative optimization methods between modules to promote better mining framework performance gain. The experiments on two public datasets show that our method achieves the best F1 among all state-of-the-art baselines and provides strong performance gain on complex scenarios of various overlapping patterns, multiple triplets, and cross-sentence triplets. Availability and implementation Code is available at https://github.com/11101028/CADA-BioRE.


Introduction
The Relation Extraction (RE) task refers to extracting structured information from natural language texts, which has many downstream applications, e.g. automatic knowledge base construction , information retrieval (Luo et al. 2022b) and recommendation (Zhang et al. 2022a). In the biomedical domain, the broad application of electronic health record (EHR) systems causes an exponential increase of EHRs that cover the phenotypes description and patient treatment (Zhao et al. 2022). Biomedical relation extraction (BioRE) aims to automatically identify medical terminologies and mines the interrelation between diseases and drugs/symptoms . It is a significant text mining and knowledge discovery task for exploring research in clinical therapy, pathology, drug discovery, etc. (Luo et al. 2022c). For instance, in Fig. 1, given the sentence "利福平在降低与麻风病患者接触的人 员年发病率方面有效˚(Rifampicin reduces annual morbidity in contacts of leprosy patients.)," the entity recognition subtask first identifies the subject "利福平 (Rifampicin)" and the object "麻风 病 (leprosy)," then the purpose of the relation classification (RC) subtask is to recognize the relation "预防 (prevention)" to the entity pair, and finally the triplet [利福平 (Rifampicin)," "预防 (prevention)," "麻风病 (leprosy)"] is extracted.
In this article, we mainly focus on the BioRE task of extracting (subject, relation, object) triplets for a given biomedical text. Compared to the general news domain, BioRE requires much broader and more specialized domain knowledge. In other words, BioRE has more domain-specific difficulties.
Specifically, (i) most of the benchmark datasets for BioRE task are imbalanced, e.g. the ChemProt dataset whose more than 79.2% entity pairs are negative instances (i.e. no relations). Furthermore, there is a data imbalance between entity pairs and relation types, i.e. a long-tail problem for relation types. As shown in Figs 2 and 3, regardless of the number of relation types, the BioRE datasets have the long-tail phenomenon, and the difference is only in the degree of severity. It is a prominent challenge to model the interdependence between entity pair and relation within a triplet. (ii) Compared to the general RE task, BioRE has more complex problems of nested entities and overlapping relations due to the unique text structure of biomedical texts and the professional recording habits of EHRs. As shown in Fig. 1, relation overlap is divided into entity pair overlap (EPO) and single entity overlap (SEO) (Luo et al. 2022a). In addition, cross-sentence triplets and multiple relations in a single sentence are more significant difficulties in BioRE . (iii) Compared to English texts, Chinese BioRE is more challenging since Chinese EHRs are recorded without explicit word delimiters (Cai et al. 2021). The motivation for studying the BioRE task is accurately identifying biomedical concepts and knowledge, which can provide effective decision support for patient treatment.
Existing methods on the BioRE, in general, can be roughly divided into pipeline methods and joint methods. The former transforms the BioRE task into two subtasks, i.e. entity recognition (ER) (Fei et al. 2021) and RC . They first employ a sequence labeling model to extract all potential subjects and objects from the text and then adopt a classifier to identify the reasonable relation type from the extracted subject-object entity pairs (Zhong and Chen 2021). However, pipeline methods ignore additional joint features between entities and relations, which causes two issues: (i) error propagation, as the mistakes in early steps cannot be corrected in later steps ) and (ii) insufficient interaction of entity pairs and relations within the triplet structure (Shang et al. 2022). To alleviate the above issues, they design joint methods to identify entities and extract relations between them simultaneously. Nevertheless, these joint methods focus on various joint algorithms but ignore that they are essentially based on separate label spaces (Ye et al. 2022).
To address the above difficulties, in this article, we propose a Co-Adaptive Duality-Aware framework (CADA) for BioRE.
As shown in Fig. 4, compared to the conventional pipelinebased RE process, our approach enables bidirectional extraction triplets by adding two steps, i.e. duality module (DL) and matching module. The core idea of CADA is to introduce the duality-aware task into the pipeline BioRE paradigm, to improve the correlation between entity pairs and relations, correct the errors in the early steps and alleviate the limitation of data imbalance through duality mechanism self-checking of entity pairs. Specifically, in this method, we first utilize the spanbased entity model to identify the subject-object entity pairs, i. e. ER module. Then, we adopt a classification model combined with entity marker techniques to classify the subject-object entity pairs, i.e. RC module. Afterward, we design the duality task into CADA, i.e. DL, which employs relation types by prompt learning techniques to obtain subject-object entity pairs. Finally, we design a matching module to filter error triplets by inter-checking subject-object entity pairs. In addition, we design a co-adaptive training strategy and a co-adaptive tuning algorithm (CA algorithm), which aim to deliver a consistent and valid performance gain for the overall CADA framework. An illustrative example of BioRE subtasks using the CADA is shown in Fig. 5.
Our contributions are summarized as follows: • To the best of our knowledge, we are the first to fully consider the interaction of subject-object entity pairs and relations in the BioRE task. We further propose a novel extraction framework based on the duality-aware mechanism (DA).    . Illustration of the differences between the proposed CADA framework and the existing pipeline-based framework. Left: pipelinebased framework employs an ER module to extract entity, then an RC module to identify relation for obtaining triplets. Right: CADA framework leverages a duality module for inverse extracting triplets and a matching module to correct errors generated in early steps 39.  Zhang et al.
• We design a co-adaptive training strategy and a CA algorithm that aim to co-optimize all modules in the framework, to bring a consistent and valid performance gain for CADA. • Our proposed method achieves outstanding performance gains even in complex scenarios involving various overlapping patterns, multiple triplets, and cross-sentence triplets.
The experimental results unequivocally demonstrate that the CADA outperforms state-of-the-art (SoTA) BioRE methods.

Materials and methods
In this section, we first outline task definitions and solutions. Then, we introduce four modules of CADA: ER module, RC module, duality module, and matching module. Finally, we present the training and inference strategies of the CADA framework.

Overview
In this subsection, we first define the task of BioRE and then outline the framework of solution.

Task formulation
In this article, our BioRE task is to extract sentence-level entities and relations in fixed-domain. Given a biomedical text C ¼ fc 1 ; . . . ; c n g with n tokens, we aim to output a set of triplets t 2 T : where s, r, o, and E refer to the subject, relation, object, and the set of entities e ¼ fc h ; c hþ1 ; . . . ; c t g, h and t are the begin and the end of e, respectively. Note that s and o could be an entity extracted from C, and S ¼ fs 1 ; . . . ; s i g denotes i subject in a C, and O ¼ fo 1 ; . . . ; o j g denotes j objects in the same C. Therefore, there are N different combinations of e to form subject-object entity pairs ðs; oÞ, where N ¼ i Â j. Besides, R ¼ fr 1 ; . . . ; r l g denotes l predefined relations. For instance, given "Positive occult blood test indicates granulomatous colitis or ulcerative colitis.", the BioRE task ideal output is ("granulomatous colitis, laboratory test, occult blood test") and ("ulcerative colitis, laboratory test, occult blood test").

Framework
To deal with the BioRE task, we propose a novel framework named CADA, as shown in Fig. 6. Hence, given a biomedical text C, our solution to extract a triplet ðs; r; oÞ in two directions: (i) from ðs; oÞ to r (denoted as SO2R) and (ii) from r to ðs; oÞ (denoted as R2SO). In other words, we exploit the DA to model the BioRE task in two directions, aiming to correct errors in earlier steps by inter-checking the twice results of entity boundary recognition. SO2R. This direction is to first obtain ðs; oÞ and then identify r with the help of s and o, respectively. Furthermore, identifying r is modeled as a classification problem since the r is derived from a predefined R. As shown in Fig. 6, the modeling modules for this direction are ER and RC.
R2SO. This direction is to first obtain r and then extract ðs; oÞ with the help of r, respectively. In fact, r is a benefit for extracting ðs; oÞ. This direction is modeled as the DL module shown in Fig. 6.
Matching. Ideally, the triplets extracted by modeling two directions are the same. Nevertheless, error propagation makes the triplets extracted in the two directions often differ. Therefore, we design the matching module to inter-checking and filter error triplets.

Entity recognition module
The ER module aims to take biomedical texts C as input and obtain entity mentions of subject s and object o, not needing to obtain entity types. To exploit the model's ability, we transform NER into an entity boundary detection task (Su et al. 2022). To acquire entity e, we adopt a standard span-based model (e.g. global pointer network denote as GP) following prior work (Zhong and Chen 2021;Su et al. 2022). The GP's core idea is to employ a global matrix to record the probabilities of all spans, which effectively alleviates particularly prominent in BioRE, i.e. nested entity extraction and overlapping RE.
Formally, given the input C, we first utilize a contextsensitive pre-trained language model (pre-trained language model (PLM), e.g., BERT) to output context-sensitive representations for each input token c. Hence, we have v er C ¼ PLMð½CLS½c 1 ; c 2 ; . . . ; c n ½SEPÞ; (2) where [CLS] and [SEP] are the special tokens in the BERT model. Then, we define the matrix as M 2 R nÂn , and n is the number of tokens in the input C. Each element M h;t ð1 h; h tÞ in the matrix refers to the probability of the span starting at the h-th token and ending at the t-th token, i.e.
where W 1 ; W 2 and b 1 ; b 2 are the trainable weights, R h ; R t are the rotary matrices  used to add relative position information into v h and v t , respectively. Thus, the span detection is modeled as a binary problem, where the input is M h;t , and the output is true or false. After getting the S and O from a biomedical text, the s and o are combined in full permutation to form the subject-object entity pairs ðs; oÞ, removing the ðs; oÞ when s and o are the same entity.

Relation classification module
The RC module aims to take the subject-object pair ðs; oÞ as input and predicts a relation r from predefined R or none. Given the output of ER module, we process every pair of the ðs; oÞ set in each text C independently in the RC module. Specifically, we employ the Entity Marker Technique (Zhang et al. 2017) to highlight the ðs; oÞ in text C. Namely, we mark the position of s by inserting special tokens [s] and ½=s at the starting and ending, respectively. Note that the o follows the same process, using special tokens [o] and ½=o. Subsequently, we take the marked text with insert four special tokens as input to the context-sensitive PLM and obtain the text representation from the output. That is: Figure 6. The framework of BioRE via co-adaptive duality-aware.
where v rc k ðk ¼ 1; . . . ; n þ 4Þ. Then, we adopt the representation of the special token v rc s and v rc o as the contextual embedding vectors of s and o, respectively. Finally, concatenate v rc s and v rc o as the input of the relation classifier (e.g. MLP) to get a r or none.

Duality module
The DL module aims to take the relation r rc p 2 R rc obtained by the RC module as input and predicts subject set S 0 and object set O 0 . Thus, the model employed is called R2SO, as shown in Fig. 7. In other words, the inputs and outputs of the R2SO task are the opposite of the SO2R task, forming duality tasks. The core idea is to design the DL module to correct the errors in early modules.
Concretely, given a text C and a relation r rc p , we aim at extracting the corresponding multiple subject-object pairs ðs 0 ; o 0 Þ. Similar to the ER module, the output of subject-object pair ðs; oÞ also employs the span-based entity model. Inspired by prompt learning (Li and Liang 2021), we design prompt templates to concatenate r and C as input to the span-based entity model. To fully utilize the semantic information of labels and combine the experimental results of Section 3.4.2, we adopt the relation type, subject type, and object type as the prompt template, which is used as prefixes to the text. That is: where P is the prompt template and v dl C is the output vector of PLM. r type , s type , and o type are separated by the special tokens ½=s1, ½=s2, and ½=s3, which are the sequences of type names for r, s, and o. Finally, we obtain each text's s 0 and o 0 sets through the DL module.

Matching module
The matching module aims to take the entity pairs ðs 0 ; o 0 Þ obtained by the DL module and ðs; oÞ obtained by the ER module, matching them to get final triplet results. Specifically, two filtering rules are designed for matching triplets. Namely, (i) based on the top-1 relation type score c RC by RC module, we design a threshold c r . When c RC is higher than c r , the current triplet ðs; r; oÞ is retained regardless of DL module results. (ii) Based on the ðs; r; oÞ, we retrieve whether s and o are contained in the S 0 and O 0 sets, respectively. We keep the current triplet ðs; r; oÞ if they both do. Otherwise, we delete it. In other words, the DL module acts as a dual self-checking. Finally, the BioRE results are obtained after matching the filtering rules.

Training and inference
To maximize the performance of the CADA, we optimize the framework in two parts: training phase and inference phase. In this subsection, we first introduce the training details and then describe the inference process.

Co-adaptive training strategy
During the training phase, the co-adaptive training strategy is used for the entire CADA framework. The core idea is to get more candidate triplets in ER and RC modules, aiming to prevent to loss of correct triplets, i.e. ensuring high recall. Specifically, make the ER and RC modules train according to high recall and the DL module train according to high F1 scores. In addition, we adopt a data enhancement [i.e. rdrop (Wu et al. 2021)] for the DL module. Formally, to learn the parameters of the above modules, we exploit a cross-entropy loss function: where H is the parameters to be learned by the model, and Score is a scoring function, i.e. the sigmoid function. H denotes the hidden vector, which is the final output of each model.

Co-adaptive tuning algorithm
During the inference phase, the CA algorithm is employed for the entire CADA framework. The core idea is to ensure high F1-score results to provide a stronger filtering performance in final matching. The CA algorithm is a heuristic algorithm that utilizes our collective experience to effectively narrow down the search space and provide an optimal feasible solution within the defined range, to deliver a consistent and valid performance gain for the framework. Specifically, we exploit four parameters to control the inference process of CADA, including inference thresholds of three core modules and a matching threshold, i.e. ER inference threshold, RC inference threshold, DL inference threshold, and matching threshold. Each of the four thresholds mentioned above is assigned a value range based on prior experience. Algorithm 1 demonstrates the procedure of the co-adaptive algorithm (CA) based on the heuristic. First, ER inference threshold and RC inference threshold are appropriately lower, and their combination is determined by recall. The purpose is to allow more candidate triplets to enter the DL module by properly expanding the prediction range. Afterward, by adjusting the DL inference threshold and matching threshold, the threshold combination is determined by the highest F1-score to moderate the filtering strength and avoid mistakenly deleting the correct samples.

Experiments
In this section, we describe the experimental setup. Then, we conduct extensive experiments to evaluate the effectiveness of the proposed CADA framework and analyze its properties. Furthermore, we also design experiments to validate performance gain on complex scenarios. Finally, we perform some detailed analysis.   (Krallinger et al. 2017), the vast majority of them being at the sentence level. The detailed statistics of ChemProt are shown in Table 2. In the dataset, both chemical and protein mentions are pre-annotated.

Evaluation metrics
In the following experiments, we first tune our model and run the CA algorithm on the validation set that is separate from the test set, and then make predictions on the test set to determine the final outputs. To evaluate the results of BioRE, we employ three standard evaluation metrics, i.e. precision (P), recall (R), and strict F1 score (F1). As the CMeIE test labels are not released, the final evaluation scores are obtained by submitting the entire prediction file to the official website, which requires the ðs; r; oÞ results to be accurately matched. In other words, the extracted triplet can only be considered correct when the triplet elements extracted by the model exactly match the answer.

Compared methods
Since the CMeIE is a Chinese BioRE dataset and ChemProt is an English BioRE dataset, we need to compare the baselines, respectively. We compare our method with SoTA methods as follows on the CMeIE. We compare CADA with SoTA methods as follows on the ChemProt.  We count CMeIE based on overlapping patterns, noting that a sample can belong to both EPO and SEO. "-" denotes none. Additionally, we consider the number of triplets in a sample and whether triplets is crosssentence, respectively. Algorithm 1 The Co-adaptive Tuning Algorithm

Parameter setting
We utilize the Chinese version of PLMs [e.g. RoBERTa (https://huggingface.co/clue/roberta_chinese_base)] and the English version of PLMs [e.g. RoBERTa (https://huggingface. co/roberta-base)] released by Huggingface as the text encoder in CMeIE and ChemProt, respectively, which the hidden size is 768. We tune our model on the validation set and use grid search to adjust important hyper-parameters. Specifically, the maximum text length is set to 256, the single input batch size during training in CMeIE is set to 24, the training epoch is set to 10, the Adam optimizer is used for model optimization, the learning rate is set to 4e-5, and the weight decay is set to 0.01. Besides, the single input batch size, epoch, learning rate, and weight decay during training in ChemProt are set to 24, 5, 3e-5, and 0.01, respectively, and the Adam optimizer is used for model optimization. In ER, RC, and DL modules, the drop rate in CMeIE and ChemProt is set to 0.3, 0.4, and 0.3, respectively. The method in this article is completed on a workstation with Ubuntu 20.04.5 LTS, Intel(R) Xeon(R) E5-2678 v3 CPU, GeForce RTX 3090, and 128 GB memory.

Overall results
As mentioned in the introduction, BioRE has two subtasks. To fully verify the effectiveness of CADA, we conduct experiments not only on BioRE task and subtasks, but also on Chinese and English datasets, respectively.

Results of the main experiment
First, we compare CADA for BioRE on Chinse CMeIE. Table 3 shows the results for the different methods. From the table, we conclude that: (i) our method outperforms the competitors on F1, demonstrating the effectiveness of CADA. The best performance on BioRE task of CMeIE is 63.13%. (ii) Among all the baselines, the Global Pointer and PURE perform best in pipeline methods, and the BTCAMS-Syn and GPLinker perform best in joint methods. But our method still outperforms pipeline methods by 2.34% and 5.03% on F1 and outperforms joint methods by 2.18% and 2.56%, respectively. The reason may be that introducing the DL module into the pipeline method effectively enhances the connection between entity pairs and relations, and adding the matching module corrects the errors in the early steps. (iii) Comparing GPLinkerþCADA with GPLinker, adding DL and matching modules behind the joint method increases F1 by 1.14%, which shows that introducing the DA also affects joint methods. (iv) Comparing CADA À and CADA with joint methods shows that a reasonable solution to the drawbacks of pipeline methods can defeat joint methods.
Second, we compare CADA for BioRE on English ChemProt. The results are listed in Table 4. From the table, we observe that: (i) our method outperforms all baselines in terms of P and F1, reaching 78.30% and 77.75%, respectively, which proves the effectiveness of the proposed method. (ii) Comparing deep neural network-based methods, CADA outperforms 8.31% on F1, 5.29% on R, and 10.29% on P, because BERT-based methods (i.e. PLMs) have a powerful transformer structure and is pre-trained on large-scale corpora. (iii) Comparing PLMs in the general domain, our method outperforms 1.19% on F1, 2.24% on R, and 0.22% on P, further proving the effectiveness of our method. The reason is that the performance improvement here is mainly attributed to the superiority of the CADA framework. (iv) Comparing PLMs in the biomedical domain, our method still improves 0.18% on F1, 2.40% on R, and 0.28% on P. It shows that the superior performance of our framework can compensate for the gap caused by the domain corpus to some extent.

Results of the subtasks experiment
We continue to explore the performance of CADA on various BioRE subtasks, i.e. entity pair extraction and RC. Table 5 shows that CADA gains around 2% performance improvement over SoTA baseline on all subtasks on the CMeIE validation set. Besides, on the ChemProt test set, our method improves by 7.40% and 4.45% on entity pair extraction and RC subtasks, respectively. These encouraging results once again verify our effectiveness. We conclude that introducing the DA can effectively enhance the association of entity pairs and relations within triplets.

Detailed results on complex scenarios
Chinese BioRE is more challenging than English because Chinese biomedical texts have no clear word separator (Cai et al. 2021). Therefore, subsequent performance experiments and analyses are performed on Chinese CMeIE. In addition, as the CMeIE test labels are not released, experiments in this section are conducted on validation set.

Results of various overlapping patterns
We further explore complex samples containing various overlapping patterns on the CMeIE to verify the ability of the CADA. For the three experiments, we choose to compare them with the SoTA methods of published papers. Figure 8 shows that our CADA outperforms all the baselines in SPO and EPO patterns, and CADA exhibits excellent performance in dealing with overlapping problems. It is because the DA handles complex overlap problems in the biomedical domain and the data imbalance between entity pairs and relations, i.e. triplet overlap problem.

Results of multiple triplets in a sample
When addressing the issues of multiple triplets, an N!5 sample may contain SEO and EPO patterns simultaneously, which brings multiple challenges to extraction methods. Table 6 shows that CADA outperforms the baseline and exhibits encouraging capabilities in multiple triples. Attributable to CADA having the ability of DA, SO2R, and R2SO match triplets in two directions.

Results of cross-sentence triplets
We further verified the ability of CADA in the cross-sentence triplets scenario. The results are displayed in Fig. 9. Among them, CADA also exceeds the baseline in both single sentence and cross sentence, which shows that CADA reduce the damage caused by the distance of triplet elements during the extraction process.

Detailed analysis
In this section, we aim to detail an ablation analysis of our method. Besides, we study the impact of various prompts and thresholds, respectively. Eventually, we present a case analysis of the CADA.

Ablation study
We propose a novel framework for BioRE with two additional parts over traditional pipeline methods: DA (i.e. DL and matching modules) and CA. Therefore, we design four sets of ablation experiments better to illustrate the contribution of the additional modules in CADA to model performance. The results are presented in Table 7. From the table, we conclude that: (i) for pipeline-based models, compared with "ERþRC," the "ERþRCþDA" achieves better results in both the validation set and test set of the CMeIE and ChemProt. In particular, the "ERþRCþDA" increases F1 by 1.60% in the CMeIE validation set, and increases F1 by 1.76% in the ChemProt test set. For joint-based models, Figure 8. F1 of various overlapping patterns. Table 6. F1 of multiple triplets in a sample.

CADA-BioRE
compared "jointþDA" with "joint," the former achieves better results in four sets. Especially, the "jointþDA" increases F1 by 1.78% and 3.63% in the validation set of both CMeIE and ChemProt. This is because introducing DA in pipeline methods can play the role of checking, extracting the reverse thinking of entity pairs through relation information, and enhancing the connection between entity pairs and relations. (ii) The "ERþRCþDAþCA" are better than the "ERþRCþDA" on both pipeline-based and joint-based methods. The reason is that designing the CA algorithm can reasonably optimize the data flow propagation of CADA. As a result, our method effectively reduces the effect of pipeline-based process error propagation and intuitively reduces redundant entity extraction. (iii) The two additional parts have enhancements for both pipeline methods and joint methods, indicating that our method is not limited by the method types. We observe that with the superposition of the additional parts, precision score keeps increasing in all datasets and models. In other words, our method corrects errors generated by the previous steps, e. g. entity pairs without relations may be incorrectly assigned relations, shown in Section 3.4.5.

The impact of prompts
To extract the entity pair ðs; oÞ when the relation r is known, we use prompt technique to concatenate the r with text C as the input. Note that the design of prompt template is not unique, and comparative experiments are done to demonstrate that the current template works better. Thus, we design five prompt templates, as shown in Table 8. Among them, [/s1], [/s2], and [/s3] denote separation tokens, fr type g, fs type g, and fo type g denote relation type, subject type, and object type, respectively.
Specifically, to verify the difference between the five prompt templates, we use the consistent results of the ER and RC modules on the CMeIE validation set, and the parameters of the DL module keep the same without the CA tuning algorithm. Comparing the results of the DL module, it can be seen from Table 8 that the No. 5 prompt template has the best effect. The one reason may be that there are 53 schemas in the CMeIE, including 10 synonymous relations and 43 other relations, where the relation types of the synonymous relations are the same, but the s and o entity types are different. So No.1 prompt template, which contains only the relation types, does not work well. The another reason may be that the subject entity types of CMeIE are all diseases, only introducing subject types is equivalent to introducing noise. Thus, No.3 prompt templates, which contain the subject entity types, perform worse than No.1 prompt template. No.2,No.4,and No.5 prompt templates have little difference in performance, and finally we choose No.5 based on the best performance.

The impact of various thresholds
To explore the effectiveness of the CA algorithm, we design experiments from two aspects to aim to study the impact of various module thresholds on framework performance. First, we show the performance variation of each module under different threshold settings to illustrate that each selected threshold impacts the overall framework performance. Second, the effectiveness of our threshold combination strategy is validated by showing the variation in results for interval sampling of thresholds. From Table 9, we observe that: (i) all four selected thresholds modulate the performance of the entire framework, with the matching threshold having the most obvious impact. (ii) With the CA algorithm, we have the ability to continue improving the performance of the framework.
3.4.4 The impact of random seeds As shown in Table 10, we conduct experiments with five different random seeds, and the results and their improvements are rather robust. We get an averaged performance of 63.14 6 0.03/77.76 6 0.2 on CMeIE/ChemProt with five runs in total, which outperforms the previous SoTA methods.

Case study
To show the effectiveness of our proposed DA and CA algorithm, we visualize the attention weights between subject-object entity pair and relation. In Fig. 10, we present the attention weight results for the ER and RC modules. Specifically, we compute the attention weight between the subject-object entity pair and relation using the output layer of the RC model. To aggregate attention scores, we calculate the average of multiple attention heads. Figure 11 shows the result of CADA. Comparing the above two diagrams, we observe that CADA enhances the connections between entity pairs and relations within the target triplets and excludes the wrong triplets. Besides, to analyze the advantages of our proposed method, we compare the prediction results of ER module þ RC module (i.e. traditional pipeline method) and GPLinker. The example of prediction results is shown in Fig. 12. The case involves eight relations. The "ER module þ RC module" method employs a span-based ER model and a classifier to extract these triplets, resulting in redundant RE. GPLinker extracts the entities and relations by joint learning model, whose result is that the prediction misses two triplets. The results of CADA are correct, correcting the previous error with the DL and matching modules and predicting the two triplets missed by GPLinker.

Error analysis
We further analyze the errors and present the distribution of five errors in Table 11. For the CMeIE, a total of 3585    Example prediction results on the CMeIE. The serial number denotes the results of the relation triplet extracted by each method, in the form: subject_object_relation. Among them, the black denotes the correct answer, the green strikethrough (i.e. crossed-out row) denotes the wrong answer, and the blue denotes the correct answer that our method can extract but GPLinker cannot.  samples are used for error analysis. The number of samples that GPLinker do wrong but our method do right is 312, accounting for 8.70%. For the ChemProt, a total of 1392 samples are used.
The number of samples that BioLinkerBERT do wrong but our method do right is 179, accounting for 12.86%.

Robustness analysis
We further analyze the robustness of our method on BioRE task. Due to CADA achieves SoTA performance on ChemProt from BioCreative VI competition, we select to use the DrugProt from BioCreative VII competition. Now that the competition has ended, it is worth noting that released DrugProt dataset only consists of a training set and a validation set. Our findings are presented in Table 12, CADA outperforms all baselines in terms of P and F1, reaching 83.33% and 82.78%, respectively, which proves the robustness of the CADA.

Conclusion
In this article, we propose a novel co-adaptive framework with duality-aware for BioRE. Unlike previous methods, the CADA utilizes the duality mechanism to transform the BioRE task into dual tasks, achieving entity boundary identification twice and aiming to correct the errors in the early steps. Specifically, our proposed CADA first employs a span-based entity model to identify subject-object entity pairs. Then, we train a classifier with entity marker techniques for RC. Besides, we design the duality module with prompt learning techniques to extract the corresponding entity pairs based on relation type. Finally, match the RC results and DL results to the final result. In addition, a co-adaptive training strategy and a CA algorithm are designed to further improve CADA performance. Compared to existing methods, extensive experimental results on the CMeIE and ChemProt datasets show that CADA extract the entities and relations more accurately. CADA also mitigates to some extent the domain-specific problems of BioRE, including overlapping relations, multiple triplets in a single sentence, and crosssentence triplets.