Abstract
BACKGROUND: Pathological reports provide comprehensive insights into the clinical and pathological features of different cancer types. However, extraction of this semi-structured data for research is challenging. To better utilize pathology reports in cancer studies, we developed an efficient natural language processing (NLP) system to automate the extraction of items from pathology reports, facilitating streamlined storage, retrieval, and analysis of clinical data in a centralized database. METHODS: To determine the optimal model for our study, we conducted a comparative analysis of various deep learning architectures, including long short-term memory, convolutional neural network, and transformer-based models such as bidirectional encoder representations from transformers (BERT), BioBERT, and ClinicalBERT. The proficiency of the ClinicalBERT model in medical terminology and context significantly enhanced the accuracy and efficiency of data extraction from these reports. RESULTS: Among the aforementioned models, ClinicalBERT exhibited the best performance and was selected as the base model. The ClinicalBERT model demonstrated an exceptional performance in accurately classifying variables across multiple cancer types. Regarding stomach cancer, F1 scores (F1 = 1.0) were achieved for variables such as angiolymphatic invasion, and operation name (F1 = 1.0); however, a lower performance was observed for distant metastasis (F1 = 0.3889). Regarding liver cancer, high performance was consistently observed for most variables, with F1 scores above 0.99. Regarding colorectal cancer, F1 scores were achieved for variables such as Dworak's grade, lymph node, operation name, and total mesorectal excision (F1 = 1.0), while slightly lower but acceptable performance was noted for surgical margin (F1 = 0.9259). Regarding breast cancer, F1 scores were achieved for several variables including nipple margin, organ, and superficial margin (F1 = 1.0), while strong performances were noted for lateral and medial margins (F1 > 0.94). CONCLUSION: This study underscores the efficacy of NLP systems, specifically the ClinicalBERT model, in automating the extraction of important clinical data from pathology reports across various cancer types. This approach can not only simplify the process but also enhance the accuracy of the extracted information.