## 4 Discussion  
The purpose of this study was to develop an information retrieval system to find similar accidents to a specific medical accident with high accuracy and high speed for a Japanese database of 1165 closed medical malpractice claims. In the database, we manually created a short text summarizing each accident and assigned each a category and a process (e.g., orthopedics and surgery or plastic surgery and follow-up). We developed the semantic search engines based on SBERT, which was reported to have excellent speed and accuracy in extracting similar texts [14]. The search engines extracted 10 similar summary texts that were close to a given query in the Euclidean distance of the embedding. To train SBERT, we conducted iterative optimization to efficiently expand the training dataset and gradually increase the retrieval accuracy. We defined three evaluation metrics that indicated how well the labels of the 10 extracted similar instances matched the labels of the query: averaged exact match ratio, averaged Hamming score, and averaged Hamming loss. For the SBERT encoder, we employed UTH-BERT, the medical BERT model pretrained on clinical records, and NICT-BERT, a generic BERT model pretrained on Japanese Wikipedia articles, and we compared the results from these models. We also built search engines based on lexical similarity using Okapi BM25 for comparison. In the early stages of the iterative optimization, the number of label-matched pairs increased with the number of iterations, and the search accuracy improved as expected. This could mean that the SBERT model gradually adapted to the style of texts in our database through the iterative optimization while updating the dataset. The evaluation metrics were highest around the middle five of the ten iterations, after which there was a gradual decline. The reason the search accuracy did not monotonically increase with  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multicolumn{1}{c}{ \begin{tabular}{c} **Summary Text of Medical Accident** \\ **Upper Row: Japanese Original Text**, Lower Row: English Translation \\ \end{tabular}  } & \begin{tabular}{c} **Euclidean** \\ **Distance** \\ \end{tabular}  & \begin{tabular}{c} **Category** \\ **Process** \\ \end{tabular}  \\ \hline Ninth hit & \begin{tabular}{c} A girl patient with [PERSON]’s disease was admitted to a hospital for liver transplantation. The right subclavian artery was punctured during the insertion of a central venous line. She also suffered massive bleeding from the right subclavian artery during extubation after living donor liver transplantation. The patient’s family claimed damages for hempneumothorax, brain parenchymal disorder, and higher brain dysfunction caused by the above procedure. The causal relationship between the higher brain dysfunction and the massive hemorrhage became an issue. This case went to arbitration. The case was liable. Settlement was completed. \\ \end{tabular}  & \begin{tabular}{c} 5.1120 Unknown Surgery \\ \end{tabular}  \\ \hline Tenth hit & \begin{tabular}{c} A male patient in his 70s with suspected cholelithiasis was referred to a hospital for close examination and treatment. Endoscopic cholodolithotomy was performed, \\ and bleeding occurred during the procedure. The next day, the underwent a \\ vascular embolization procedure and was referred to another hospital after \\ discharge. The patient’s attorney filed a motion for the preservation of evidence for tortorious behavior or breach of duty in relation to the treatment. The question arose \\ as to whether there was negligence during treatment. The specialist determined \\ that there was no procedural error, but rather a complication, and that there was no problem. After the no-fault answer, the case went away without any motion. This \\ case was not liable. Settlement was completed. No compensation was paid. \\ \end{tabular}  & \ \begin{tabular}{c} 5.1246 Internal Medicine \\ \end{tabular}