# MSA K-BERT: A Method for Medical Text Intent Classification
## 5 Results  
### Dataset  
In this work, we evaluate our method using the IMCS-21 [61] dataset, a benchmark corpus for automated medical consultation systems. It gathers authentic online doctor-patient dialogs and provides multi-level manual annotations, including named entities, dialog intents, symptom labels, medical reports, and more. The IMCS-21 dataset contains 4116 samples of doctor-patient conversations with fine-grained annotations. Thespecific categories are divided into 16 types, as shown in Table 1, covering 10 pediatric diseases such as pediatric bronchitis, pediatric fever, and pediatric diarrhea. The purpose of the IMCS-21 dataset is to facilitate the advancement of intelligent medical consultation systems and utilize human-computer dialog to assist the consultation process. In the experiment, we carry out the following operations on the data. We split the dataset samples into training, validation, and testing sets in a 6:2:2 ratio, resulting in 2472, 811, and 833 samples, respectively. The training set is used to train the model, the validation set guides optimization decisions, and the test set is employed to evaluate the model's performance and obtain the reported results. Subsequently, the text data undergoes preprocessing, including tokenization, cleaning, and encoding, to generate formats suitable for various model inputs. For Chinese text, we use the Jieba library for tokenization, while for English text, we utilize the NLTK library to ensure consistency in multilingual data processing. The text-cleaning process involves removing special characters, extra spaces, and HTML tags, as well as filtering out stop words. During the input encoding stage, for Transformer-based models such as BERT, we use HuggingFace Tokenizers to encode the text into token IDs and generate attention masks. For traditional models, we employ a vocabulary-based indexing method to ensure compatibility with different architectures. Regarding the class imbalance in the dataset, no additional balancing operations are performed; we directly use the standard cross-entropy loss function. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Intent Category** & **Abbreviation** & **Example** \\ \hline Request Symptom & R\_SX & Patient: Why do I keep coughing? \\ Inform Symptom & I\_SX & Patient: I have a slight fever and \\  & & sore throat. \\ Request Etiology & R\_ETIOL & Patient: Is the fever due to \\  & & catching a cold? \\ Inform etiology & I\_ETIOL & Doctor: It is likely caused by \\  & & a viral infection. \\ Request Basic Information & R\_BI & Doctor: What is your age? \\ Inform Basic Information & I\_BI & Patient: I am 19 years old. \\ Request Existing Exam & R\_EET & Doctor: Did you handle the wound \\  & and Treatment & before coming to the hospital? \\ Inform Existing Exam & I\_EET & Patient: I did some basic \\  & and Treatment & bandaging. \\  & Request Drug & Patient: What medicine \\ Recommendation & R\_DR & should I take? \\  & Inform Drug & Doctor: Just take some Lianhua \\  & Recommendation & Qingwen capsules. \\ Request Medical Advice & R\_MA & Patient: Do I need to go to the \\  & & hospital for tests? \\ Inform Medical Advice & I\_MA & Doctor: If the fever lasts more than \\  & & three days, get a blood test. \\ Request Precautions & R\_PRCTN & Patient: What else should I \\  & & be aware of? \\ Inform Precautions & I\_PRCTN & Doctor: Rest adequately and \\  & & avoid catching a chill. \\ Diagnose & DIAG & Doctor: You have gastritis. \\ Other & OTR & Patient: Thank you, doctor. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Intent categories and examples in the IMCS-21 medical dialog dataset. To improve transparency and support the interpretation of model performance, we analyzed the distribution of dialog acts in the IMCS-21 dataset. Table 2 presents the number of samples per class across the training, validation, and test sets. Figure 4 illustrates the class distribution of the IMCS-21 database.