## 3 Methods
### Continuous Casting Triple-Embedding Module Based on GAT
#### 3.2.2 GAT Embedding Module  
In this module, we input the relations obtained by the continuous casting classification module and the feature vectors of its neighborhood into the GAT. Then, we capture the hidden neighborhood information between the entities and relations through the two-layer GAT. Finally, we obtain the updated embedding vectors of head entity, tail entity and relation. Figure 1 shows the structural diagram of this module.  
For a continuous casting triple \(\tau=(h,r,t)\), similar to [PERSON] et al. [35], we first obtain the representation of each continuous casting triple associated with the continuous casting head entity \(h\), tail entity \(t\) and relation \(r\) by performing a linear transformation on the cascade of its three feature vectors, as shown in Equation (1).  
\[\overrightarrow{M_{Intr}}=W_{1}\Big{[}\overrightarrow{v_{h}}\Big{|} \overrightarrow{v_{r}}\Big{|}\overrightarrow{v_{t}}\Big{]}, \tag{1}\]  
where \(\overrightarrow{v_{h}},\overrightarrow{v_{r}},\overrightarrow{v_{t}}\) denote the embeddings of head entity \(h\), tail entity \(t\) and relation \(r\), respectively; \(\overrightarrow{M_{Intr}}\) is the embedding vector representation of a continuous casting triple \(\tau\); and \(W_{1}\) denotes the linear transformation matrix.  
We perform a linear transformation on \(\overset{\rightarrow}{M}_{hrt}\), and the attention coefficient \(b_{hrt}\) of a specific triple \(\tau\) is obtained through the nonlinear activation function LeakyReLU. \(b_{hrt}\) represents the importance of the continuous casting triple in the cast product defect reasoning task, as shown in Equation (2). LeakyReLU is determined based on common practice in the existing literature and empirical performance during preliminary experiments. Then, we perform the normalization operation on \(b_{hrt}\) and get the normalized attention coefficient \(a_{hrt}\), as shown in Equation (3).  
\[b_{hrt}=LeakyReLU(W_{2}\overset{\rightarrow}{M}_{hrt}), \tag{2}\]  
\[a_{hrt}=softmax(b_{hrt})=\frac{exp(b_{hrt})}{\sum\limits_{e\in E_{\tau}}\sum \limits_{r\in E_{\tau}}exp(b_{hrt})}, \tag{3}\]  
where \(E_{\tau}\) denotes the set of all neighborhood of the head entity \(h\) and \(R_{\tau}\) represents the set of relations \(r\) connecting the entity in \(E_{\tau}\) and head entity \(h\).  
After obtaining the normalized attention coefficient \(a_{hrt}\), the new head entity embedding vector \(\overset{\rightarrow}{h^{\prime}}\) is calculated by weighting, as shown in Equation (4). The attention values of each head are averaged and updated to obtain the final head entity embedding vector \(\overset{\rightarrow}{h^{\prime}}\), as shown in Equation (5).  
\[\overset{\rightarrow}{h^{\prime}}=\sigma(\sum\limits_{t\in E_{\tau}}\sum \limits_{r\in R_{\tau}}a_{hrt}\overset{\rightarrow}{M}_{hrt}). \tag{4}\]  
Figure 1: The embedding module structure of the two-layer GAT.  
\[\overset{\rightarrow}{h^{\prime\prime}}=\sigma(\frac{1}{N}\sum_{n=1}^{N}\sum_{t\in E_{ r}}\sum_{r\in R_{r}}a_{ntr}^{n}M_{ntr}^{n}). \tag{5}\]  
Similarly, the same update method is used to obtain the final tail embedding vector \(\overset{\rightarrow}{t^{\prime\prime}}\).  
This module uses \(N\) independent attention mechanisms to calculate the embedding vectors of continuous casting triples and concatenates these embedding results to obtain a more expressive continuous casting triple-embedding representation.