Context-aware Reasoning with Large Language Models for Medical Entity Linking in Spanish

Fernando Gallego, Alberto Becerra, Leticia Fernández-López, Laura Vigil, Martin Krallinger, Francisco J. Veredas · 2025

The digitalization of healthcare has spurred widespread adoption of electronic health records (EHRs) containing valuable patient information in unstructured formats. To exploit this data at scale, natural language processing (NLP)-specifically named entity recognition (NER) and medical entity linking (MEL)-is essential, enabling the extraction and normalization of clinical mentions under standardized terminologies to ensure semantic interoperability. However, clinical language poses inherent challenges-lexical variability, specialized jargon, abbreviations, and context-dependent polysemy-demanding models with strong generalization and contextual disambiguation. Furthermore, reliance on biomedical expert annotations, which are scarce, forces these models into few-shot and, especially, zero-shot scenarios. Despite advances, current approaches largely operate as black boxes: after NER, they retrieve a set of candidates based on similarity metrics without providing criteria or explanations for their ranking, undermining trust, validation, and real-world integration. In this paper, we introduce a hybrid retrievalaugmented generation (RAG) framework that addresses these limitations by combining a bi-encoder with a generative large language model (Gen LLM). Our pipeline not only ranks candidate entities but also justifies their ordering. Experimental results demonstrate that our pipeline achieves top-5 accuracies of 0.66, 0.60, and 0.68 on Dis-TEMIST, MedProcNER, and SympTEMIST, respectively. In a blind comparison against gold-standard (GS) annotations, two independent clinical experts preferred our model's topranked candidate in 76.7% and 80% of cases, respectively.

Read the paper · More papers on PaperTik