Oncology data extraction with large language models from real-world breast cancer electronic health records in Spanish
Julio Montes-Torres, Francisco J. Moreno-Barea, Leonardo Franco, Nuria Ribelles, Emilio Alba, José M. Jerez
Machine Learning with Applications · 2026 · Vol. 23 · pp. 100837
Autores
Julio Montes TorresCorrespondenciaDepartamento de Lenguajes y Ciencias de la Computación, Escuela Técnica Superior de Ingeniería Informática, Universidad de Málaga, Málaga, Spain
José Jerez AragonésDepartamento de Lenguajes y Ciencias de la Computación, Escuela Técnica Superior de Ingeniería Informática, Universidad de Málaga, Málaga, Spain
Leonardo Franco RuizDepartamento de Lenguajes y Ciencias de la Computación, Escuela Técnica Superior de Ingeniería Informática, Universidad de Málaga, Málaga, Spain
Fco. Javier Moreno-BareaDepartamento de Lenguajes y Ciencias de la Computación, Escuela Técnica Superior de Ingeniería Informática, Universidad de Málaga, Málaga, Spain
Nuria RibellesUnidad de Gestión Clínica Intercentros de Oncología, Hospitales Universitarios Regional y Virgen de la Victoria, Málaga, Spain
Emilio AlbaUnidad de Gestión Clínica Intercentros de Oncología, Hospitales Universitarios Regional y Virgen de la Victoria, Málaga, Spain
Resumen
The integration of Artificial Intelligence (AI) in healthcare systems has the potential to significantly enhance patient care and streamline clinical processes. This research investigates the utilisation of generative AI and large language models (LLMs) for oncological information extraction (IE) from Spanish real electronic health records (EHRs) to enhance clinical decision-making and research. We conducted a comparative analysis of GPT-4.5 and 11 state-of-the-art, locally executable LLM-based chatbots, including Llama 3.2, Mistral-Small 3.2, and Phi-4, to extract specific clinical entities from real EHR narratives. Our evaluation workflow aimed to assess the performance of these models in contexts with computational constraints, specifically targeting the extraction of breast cancer prognostic factors. Initial findings indicate that while open-source LLM models are improving, they are not yet equivalent to human specialists in terms of Named Entity Recognition (NER) accuracy. The language of the clinical records notably influences performance, revealing that smaller models particularly struggle with Spanish text. However, with careful model selection and output post-processing, Mistral-Small 3.2 achieved a detection F1 score of over 74.7% for critical TNM information. This study highlights significant potential for generative AI in clinical IE but underscores the need for ongoing improvements, particularly in handling linguistic diversity. Locally managed open source models are still far from performing like a human specialist, but addressing common model shortcomings can facilitate the integration of AI-driven solutions into public healthcare systems, thereby improving patient outcomes and fostering efficient data utilisation.
Palabras clave
- Information extraction
- Natural language processing
- Electronic health records
- Oncology
- Spanish
Cómo citar
Montes-Torres, J., Moreno-Barea, F. J., Franco, L., Ribelles, N., Alba, E., & Jerez, J. M. (2026). Oncology data extraction with large language models from real-world breast cancer electronic health records in Spanish. Machine Learning with Applications, 23, 100837.