Abstract
This paper describes a deep learning-based system developed for the MEDDOCAN 2019 challenge, focusing on the de-identification of Spanish clinical documents. The system utilizes a pre-trained multilingual BERT model combined with a Conditional Random Field (CRF) layer and a post-processing module to handle tokenization artifacts. Evaluation on the MEDDOCAN synthetic corpus demonstrates high accuracy, achieving a strict span-level F1-score of 0.97, highlighting the effectiveness of contextual embeddings and robust preprocessing in medical NLP tasks.
Introduction
Before clinical records can be shared for secondary research, they must be strictly de-identified to protect patient privacy. This involves identifying and removing all Protected Health Information (PHI), such as names, addresses, and professions. While natural language processing (NLP) challenges like i2b2 have significantly advanced English medical text de-identification, other languages have historically lagged behind. This study addresses the Medical Document Anonymization (MEDDOCAN) task, a challenge specifically organized to automate the anonymization of medical documents in Spanish.
Methodology
The system treats de-identification as a sequence labeling (Named Entity Recognition) problem, tagging words using the standard "BIO" (Beginning, Inside, Outside) format. The pipeline consists of three primary stages: preprocessing, deep learning modeling, and post-processing.
- Preprocessing: A rule-based system splits raw Spanish text into sentences and tokenizes words.
- Deep Learning Models: Two state-of-the-art architectures were evaluated: a pre-trained multilingual BERT model topped with a CRF layer, and the Flair sequence labeling method based on contextual string embeddings.
- Post-processing: To mitigate errors where the sentence splitter aggressively broke single entities (e.g., addresses containing periods), a module was implemented to map split sentences back to the original text and merge neighboring PHI mentions of the same type.
Datasets
The system was trained and evaluated on the MEDDOCAN synthetic corpus, consisting of discharge summaries and medical genetics records manually annotated with 22 types of PHI. The dataset is divided into a training set (500 records), a development set (250 records), and a test set (250 records). The test set was hidden within a larger "background" set of 3,751 unannotated records to ensure a robust evaluation.
Key Results and Insights
The BERT+CRF architecture consistently outperformed the Flair-based approach, primarily due to higher recall. A critical insight was the impact of the post-processing step; correcting sentence-splitting errors that fragmented valid entities led to a significant F1-score improvement of approximately 0.024. This demonstrates that even advanced deep learning models are highly dependent on the quality of upstream preprocessing.
Additional findings revealed that adding manual Part-of-Speech (POS) features to BERT actually decreased performance slightly, suggesting that BERT's internal representations already capture necessary syntactic information. However, the model struggled with rare categories, such as OTROS_SUJETO_ASISTENCIA, due to extreme data scarcity in the training set.
Conclusion and Future Work
The final BERT+CRF system achieved a strict entity-level F1-score of 0.9646 and a merged span-level F1-score of 0.9821. While highly effective, the system's reliance on rule-based tokenization remains a limitation. Future work will explore the concatenation of BERT and Flair embeddings to leverage their complementary strengths in sub-word and character-level contextual modeling for even higher accuracy.
Summary updated