## 2 Materials and Methods
### Preprocessing  
Four types of preprocessing were performed (Figure 1) to effectively analyze the data. First, for data cleansing, data with missing values and special characters, such as +, -, -, >, <, <, and >--that is, content-wise insignificant information--were removed. Additionally, specific numbering symbols, such as [1] and 1, used only in specific institutions, were removed. Second, we removed grammatically appropriate but contextually meaningless stop words using the Natural Language Toolkit [11], which is a text-processing library available in Python. Third, we created an input by combining the operative report and diagnosis. Finally, duplicate data from the same final input data and ICD-9 code were removed. After preprocessing, the number of data points obtained was 45,853. About 46% of the data in the dataset consisted of data with the exact same operative report and ICD-9 code. Therefore, if the data were used as it is, it could be biased to a specific value, so duplicate data were considered a single sample.  
In a unique case, which has only one data point with a specific label (ICD-9 codes such as 45.72, 48.63, and 54.21), the data cannot be divided into training and test sets, making it difficult to accurately measure performance. Therefore, we used data obtained after removing a small number of labels. In addition, multilabel data were used in the proposed model. Multilabel refers to the existence of one or multiple labels coexisting in a single dataset. In the D2 SBERT [12] study, this problem was eliminated by using only the top 50 labels. In this study, we identified the removal rate that could be equally divided  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**ID** & **Date** & **Division** & **Postoperative** & **Operative Report** & **Operative Report (ICD-9)** & **Code** \\  & & & **Diagnosis** & **(Original)** & **Operative Report (ICD-9)** & **(ICD-9)** \\ \hline
1 & 6 August 2019 & Hepatobilary & GB stone & lap. cholecystectomy & Cholecystectomy; & 51.23 \\
2 & 21 May 2012 & Colorectal & rectal ca. (AV 4 cm) & ULAR & Resection; rectum, other & 48.63 \\
3 & 29 January 2020 & Colorectal & r/o appendiceal & Lap. RHC & Hematolectomy; right & 45.73 \\  & & & cancer & Laparoscopy & 54.21 \\
4 & 22 June 2018 & Endocrine and & & THYROIDECTOMY, & Thyroidectomy; complete & 06.4 \\  & & Breast & RT. PTC & TOTAL & dissection; neck, not & 40.40 \\  & & & & central LN dissection & LDLT & Transplant; liver, other & 50.59 \\
5 & 19 August 2020 & Transplantation and Vascular & HBV LC with HCC & LDLT & & \\ \hline \multicolumn{6}{c}{ICD = International Classification of Diseases.} \\ \hline \hline \end{tabular}
\end{table}
Table 1: Surgical records in the dataset.  
Figure 1: Preprocessing workflow.  
into training and test sets through empirical experiments. Consequently, the data were removed for ICD-9 codes that appeared 11 or fewer times. The removed data, containing uncommon terms, accounted for 3% of the total data. After removal, 44,341 data points and 353 ICD-9 codes were obtained. The data were used in the multilabel classification library to ensure that the multilabel ICD-9 codes were balanced in the training and test sets. The multilabel classification library was used in scikit-learn [13], which is an open-source machine learning tool available in Python, and the training and test datasets were divided in an 8:2 ratio.