## 3 Method Design  
### Dependency Tree Pruning Strategy  
Relation extraction is usually performed as a typical classification task. Specifically, given an unstructured input sentence with n words, \(X=x_{1}\), \(x_{2}\),..., \(x_{n}\), let \(E_{1}\) and \(E_{2}\) be two entities in X. The goal is to predict the relation r between \(E_{1}\) and \(E_{2}\), where \(r\in R\) and R is the set of relation types.  
In this paper, we study from the perspective of dependency syntax tree, which first needs to process the dependency tree of each input sentence. The complete dependency syntax tree of a sentence is shown in Figure 1.  
As shown in the figure, the sentence is from the biomedical dataset DDI, the bolded **Thiazides** and **norepinephrine** are two entities in it, and the relation between the entity pairs is \"effect\". After obtaining the complete dependency syntax tree, the initial task is to prune the dependency tree to filter out the external structural interfering information. In this paper, we propose a pruning strategy that includes two kinds of dependency connections: local dependency connections and global dependency connections.  
Local dependency connections refer to all dependency relations including those directly connected to the head of two entities. This pruning method is to preserve only the master-slave relations related to the entities and remove the rest of the irrelevant dependency connections. This is shown in Figure 2.  
Global dependency connections refer to all dependency relations between two entities along the shortest path. This pruning method preserves the information describing the relation between two entities. The shortest path between entities condenses the most enlightening information of entity relations, providing a strong hint for the classification of relations. As shown in Figure 3.  
The combination of these two pruning methods is the pruning strategy in this paper, as shown in Figure 4. The intra-entity and inter-entity information is utilized to remove some irrelevant information and weaken the impact of noise information. Especially when the input sentences are long and the dependency information is complex. As in the biomedical dataset used in this paper, many of the sentences have more words, the semantics of describing interactions are more complex, and the generated dependency tree has many dependency connections, which requires further optimization.  
The detailed pruning operation is shown in Figure 5 below:  
Figure 5 shows the detailed illustration of dependency tree pruning. Firstly, the tree is represented with the central word of a sentence (ROOT verb) as the root node, and the pruning strategy of L+G is clearly seen from the figure. Local Pruning (local pruning strategy around entities) strategy is to take two entity word nodes as the main ones, preserving the edges(dependencies) with their parent nodes, and then traverse their child nodes, leaving the edges(dependencies) with the child nodes if there are any. Global  
Figure 4: Pruned dependency tree.  
Figure 3: Global dependency connection.  
Figure 2: Local dependency connection.  
Pruning (global retention strategy around central word) strategy is to obtain the path from one entity word node through the central word node to another entity word node, leaving the dependencies of this path. The pruning strategy of designing L+G covers more completely the structure of syntactic relation related to and between entities, which contains enough dependency information to characterize the main information of a sentence. The word-to-word dependencies that are not related to entity words are removed to reduce the interference of irrelevant information in predicting entity-to-entity relations.  
Figure 6 shows the construction of the dependency type matrix D. It is obtained from the L+G Tree obtained by pruning the sentence dependency tree according to Figure 5 and the dependency type dictionary. It is used in the model below to demonstrate how this paper utilizes the external structural information of sentences.