## 3 Model
### Input Layer  
#### 3.1.1 Corpus Pre-Processing  
How to transform unstructured medical texts into graph structures is the basis for learning using graph convolutional neural networks. The model requires pre-processing of the experimental corpus. First, the Chinese Language Technology Platform (LTP) [33] developed by the Harbin Institute of Technology was used for analysis and processing of the input sentences. The tool provides Chinese language processing modules such as Chinese word separation, lexical tagging, syntax, and semantics. The model input in this  
Figure 1: BAGCN model diagram. paper consists of a character vector, a lexical feature vector, and a type feature vector. The character vectors are obtained by training from Chinese dictionaries. The lexical feature vectors are obtained by word tagging of the input sentences by the LTP tool. Since there are different types of relations in the corpus, we added type features to improve classification. The type feature vector is set according to the entity type. If a character belongs to a certain entity after Chinese word segmentation, it is set to that entity label; otherwise, it is set to UNK. Syntactic information contains important grammatical information in a sentence. Especially in the medical field, there are pairs of entities in a sentence that are closely connected, and some pairs of entities that are distant from each other. The dependency relation tree constructed by syntactic analysis can provide long-distance connections between words and can also build a graph structure of all entity relations in a sentence. When converting the input text into a graph structure, this paper constructs a dependency relation tree of the sentences by syntactically parsing the input sentences with the LTP tool. Dependency trees focus on the grammatical relations between words in a sentence. In addition, dependency trees can constrain grammatical relations into a tree structure. In a sentence, if a word modifies another word, the modifier is called dependent, the modified word is called head, and the grammatical relationship between the two is called dependency relation. In the dependency tree, the direction of the arrow is from the head to the dependent. The dependency tree is obtained by representing all word dependencies in a sentence in the form of directed edges. The graph convolutional neural network can learn the syntactic information of sentences from the dependency relations. Syntactic analysis can learn well the grammatical structure of sentences and the dependency between words according to the content of sentences. The dependency tree obtained by parsing a given sentence is shown in Figure 2:  
After obtaining the dependency relation tree, the model needs to transform the tree structure into a form that can be computed by a graph convolutional neural network. Usually, standard graph convolutional neural networks are constructed based on word dependencies and are represented by adjacency matrices. The adjacency matrix can represent the relations between vertices in the graph and also store edge information. If a dependency diagram, \(G=(V,E)\), where \(V=v_{1},v_{2},...,v_{n}\) denotes the vertices in the graph, and \(E=e_{v_{1},v_{2}},e_{v_{2},v_{3}},...,e_{v_{n},v_{n}}\) denotes the set of edges in the graph. We use the adjacency matrix \(A=(a_{ij})_{n\times n}\) to represent the dependency graph. As shown in Equation (1), when \(i=j\) or when there is a connection between nodes \(V_{i}\) and \(V_{j}\) in the dependency tree, \(a_{ij}=1\), otherwise \(a_{ij}=0\). \[a_{ij}= \begin{cases}1&i=j\quad\text{or}\quad e_{v_{i},v_{j}}\in E\quad\text{or} \quad e_{v_{j},v_{j}}\in E\\ 0&\text{otherwise}\end{cases}  \tag{1}\]  
where \(e_{v_{i},v_{j}}\) denotes the edge between node \(v_{i}\) and \(v_{j}\) in the dependency tree or 0 if no edge exists. According to Equation (1), we can transform the dependency tree of Figure 2 into an adjacency matrix, as shown in Figure 3.  
Figure 2: Dependency tree.