## 3 Method  
### Model Description  
In this section, this paper introduces a character-word information interaction framework (CWIIF) for natural language understanding in the Chinese medical dialogue domain. The general framework of the method is shown in Figure 3, which is mainly composed of an encoder-decoder channel with characters as inputs and an encoder-decoder channel with words as inputs, which are referred to as the character information extraction channel and the word information extraction channel, respectively, in this paper. Firstly, in the character information extraction channel, the medical text is transformed into the character input form \(C=\{c_{1},c_{2},c_{3},\cdots,c_{n}\}\), which is encoded by the pre-trained model to output the character information vector \(H^{t}=\left\{H^{ct}_{cls},H^{ct}_{1},H^{ct}_{2},\cdots,H^{ct}_{n}\right\}\) for predicting the intent label, and in the word information extraction channel, the medical text is transformed into the word input form \(W=\{w_{1},w_{2},w_{3},\cdots,w_{n}\}\), which is encoded by the pre-trained model to output the word information vector \(H^{wt}=\left\{H^{wt}_{cls},H^{wt}_{1},H^{wt}_{2},\cdots,H^{wt}_{n}\right\}\) for predicting the intent label. Second, in the character information extraction channel, the character information hidden state \(h^{c,s}_{t}\) for slot filling is outputted by the decoder, and in the word information extraction channel, the word information hidden state \(h^{w,s}_{t}\) for slot filling is outputted by the decoder. Finally, the character information and word information are extracted by the model, merged to the intent information adapter to predict the intent label \(O^{l}\) for the intent detection task, and merged to the bi-level association label extractor to identify the slot label \(O^{S}_{t}\) for the slot filling task. This paper chooses to use RoBERTa as the encoder, which is a pre-trained model consisting of several stacked transformer blocks that capture a rich representation of the contextual discourse. Given a medical text, the text is transformed into the form of character \(C=\{c_{1},c_{2},c_{3},\cdots,c_{n}\}\) and word \(W=\{w_{1},w_{2},w_{3},\cdots,w_{n}\}\) as input, where \(n\) is the sequence length of the medical text. The context is encoded using RoBERTa to obtain a vector representation of all its tokens. Firstly, the virtual token (CLS) is placed at the beginning of the sentence. Secondly, add the three embeddings of token, segment, and position to RoBERTa. Finally, the output of the last transformer block in RoBERTa is represented as vectors, character \(H^{ct}=\{H^{ct}_{cls},H^{ct}_{1},H^{ct}_{2},\cdots,H^{ct}_{n}\}\) for medical text, and word vector \(H^{wt}=\{H^{wt}_{cls},H^{wt}_{1},H^{wt}_{2},\cdots,H^{wt}_{n}\}\) for medical text, respectively. The character C and word W are trained through the encoder RoBERTa to increase the generalization ability with the following formula:  
\[H^{ct}=RoBERTa(c1,c2,\cdots,cn) \tag{1}\]  
\[H^{wt}=RoBERTa(w1,w2,\cdots,wn) \tag{2}\]  
When performing the Chinese medical dialogue intent detection task, in the character information extraction channel part, the entire medical text representation is obtained by using MLP attention to improve the processing of complex data for the obtained pre-trained vector representation with the following formula:  
\[S^{c}=\sum_{i}\alpha iH^{ct}_{i} \tag{3}\]  
\[\alpha_{i}=\frac{exp(uH^{ct}_{i})}{\sum_{j}exp(uH^{ct}_{j})} \tag{4}\]  
Similarly, the word information extraction channel part operates in the same way. Where \(S^{c}\) is the weighted sum of all hidden states while \(u\in R^{d}\) is the learnable model parameters. Then, the overall vector is taken, and the probability \(P\) is obtained by the _softmax_ function, and then \(P\) is calculated by the argmax function to determine the highest predicted probability category for Chinese medical dialogue intention detection.