## 4 Method
#### 4.1.1 Partition and Recombination Module of Continuous Casting Quality Sequence  
The partition and recombination module consists of three steps: partition, self-attention mechanism, and recombination. In this module, each token is first divided into three partitions: entity partition, relation partition and shared partition. Then, based on the features required by specific tasks, certain partition can be selected and combined to filter specific tasks. * Partition of Continuous Casting Quality Sequence  
This step divides tokens into three parts: entities, relations, and common parts. For an input sequence \(T=\{t_{1},t_{2},\ldots,t_{n}\}\), we leverage entity gate \(\widetilde{e}\) and relation gate \(\widetilde{r}\), and then the sequence is segmented into three partitions based on their relevance to specific tasks. For example, entity gate \(\widetilde{e}\) separates neurons into two partitions: NER-related and NER-unrelated. The shared partition is formed by combining partition results from both gates and information in the shared partition can be regarded as valuable to both tasks. The partition result of token \(t_{i}\) is shown in Equation (1). \[ \begin{array}{l}e_{i}=\text{cummax}(\text{Linear}([t_{i};h]))\\ r_{i}=1-\text{cummax}(\text{Linear}([t_{i};h]))\end{array}  \tag{1}\]  
As shown in Equation (1), \(e_{i}\) and \(r_{i}\) are the results partitioned by entity gate \(\widetilde{e}\) and relation gate \(\widetilde{r}\), \(t_{i}\) is the current continuous casting quality token, \(h\) is the hidden layer's output from last epoch, and \(\text{cummax}(\cdot)\) is defined by Equation (2). \[ \begin{array}{l}\text{cummax}(x)=\text{cumsum}(\text{softmax}(x))\\ \text{cumsum}(x_{1},x_{2},\ldots,x_{n})=(x_{1},x_{1}+x_{2},\ldots,x_{1}+x_{2} +\ldots+x_{n})\end{array}  \tag{2}\]  
The output of \(e_{i}\) and \(r_{i}\) can be seen as an approximation of a binary gate with the form of (0,...,0,1,...,1), thereby identifying a segmentation point within the sequence. Subsequently, the input data are divided into three parts, namely the entity partition \(\rho_{e}\), the relation partition \(\rho_{r}\), and the shared partition \(\rho_{s}\), as shown in Equation (3). The first two partitions store intra-task information, which only contain specific features for the NER task or the RE task. It can improve our model's focus on the two tasks. The third stores inter-task information, which can provide global information on the sentence level, concerning the dependencies on the context. \[ \begin{array}{l}\rho_{s}^{i}=(t_{i}\cdot e_{i})\oplus(t_{i}\cdot r_{i})\\ \rho_{s}=\sum\limits_{i}\rho_{s}^{i}\\ \rho_{e}=\sum\limits_{i}(t_{i}\cdot e_{i})\otimes\rho_{s}^{i}\\ \rho_{r}=\sum\limits_{i}(t_{i}\cdot r_{i})\otimes\rho_{s}^{i}\end{array}  \tag{3}\]  
As shown in Equation (3), \(\rho_{s},\rho_{e},\rho_{r}\) are the shared sequence, NER-related sequence and RE-related sequence. \(t_{i}\cdot e_{i}\) is part of the token concerned with NER, \(t_{i}\cdot r_{i}\) is part of the token concerned with RE, and \(\rho_{s}^{i}\) is the shared part of the current token. Additionally, \(\oplus\) is operator that takes the intersection of two operands, and \(\otimes\) is operator that takes the difference between two operands. * Self-Attention Mechanism  
Successively, we input the aforementioned three partitions \(\rho_{s},\rho_{e},\rho_{r}\) into the self-attention component. Take the NER-related partition \(\rho_{e}\) as an example: we leverage the NER-related partition in query matrix, combine the NER-related partition and theshared partition for key and value matrix in self-attention mechanism, which is shown in Equation (4). \[Q_{e}=\rho_{e}W^{q},K_{e}=[\rho_{e},\rho_{s}]W^{k},V_{e}=[\rho_{e},\rho_{s}]W^{v} \tag{4}\]  
The output of self-attention module for the NER-related partition is shown in Equation (5). \[o_{e}=(\text{softmax}(K_{e}^{T}Q_{e}))\cdot V_{e} \tag{5}\]  
In this way, we can calculate the output of self-attention module for the RE-related partition \(o_{r}\) and the shared partition \(o_{s}\) as well.