Automated Phenotype Annotation in Spanish Clinical Text: A Large Language Model Approach with Retrieval-Augmented Generation

This work addresses the challenge of automatically annotating phenotypes from unstructured Spanish clinical text. Phenotype coding from free text is essential for standardizing health information and improving interoperability between health information systems. Currently, this task is often done manually by geneticists, increasing workload and delaying patient care. The objective of this work is to optimize the current annotation process by developping an Articial Intelligencebased platform that automates phenotype extraction and mapping. The system analyzes Spanish clinical notes, identifies relevant phenotypes, and links them to corresponding codes from the Human Phenotype Ontology (HPO). The proposed approach combines Large Language Model (LLM) with Retrieval Augmented Generation (RAG), as this method has shown high accuracy in similar tasks in English. Additional benefits include adaptability to ontology updates and easy scalability to other codification systems. The methodology followed in this work involves translating the HPO into Spanish, building a reference vector database, testing prompt strategies, and creating a user interface for the validation and annotation of clinical notes. The entire solution is built on an open-source, microservice-based architecture. In addition, the results of different RAG and LLMs configurations are compared, revealing their effect on accuracy and computational cost. Results show that the LLMs alone (i.e. OpenAI’s o4-mini) performs poorly (F1-score of 0.2), often generating incorrect or unrelated codes. Integrating RAG significantly improves results. The highest-performing configuration achieved reaches an F1-score of 0.64 (0.68 precision and 0.62 recall) on the RAGHPO dataset.

Authors

Publication Details

Journal
O2 - Repositori Institucional (Universitat Oberta de Catalunya)
Published
2025-07-11
Primary Topic
Biomedical Text Mining and Ontologies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Automated Phenotype Annotation in Spanish Clinical Text: A Large Language Model Approach with Retrieval-Augmented Generation

Malena Díaz Río
O2 - Repositori Institucional (Universitat Oberta de Catalunya)
Biomedical Text Mining and Ontologies
article

Automated Phenotype Annotation in Spanish Clinical Text: A Large Language Model Approach with Retrieval-Augmented Generation

Malena Díaz Río
article en

Abstract

This work addresses the challenge of automatically annotating phenotypes from unstructured Spanish clinical text. Phenotype coding from free text is essential for standardizing health information and improving interoperability between health information systems. Currently, this task is often done manually by geneticists, increasing workload and delaying patient care. The objective of this work is to optimize the current annotation process by developping an Articial Intelligencebased platform that automates phenotype extraction and mapping. The system analyzes Spanish clinical notes, identifies relevant phenotypes, and links them to corresponding codes from the Human Phenotype Ontology (HPO). The proposed approach combines Large Language Model (LLM) with Retrieval Augmented Generation (RAG), as this method has shown high accuracy in similar tasks in English. Additional benefits include adaptability to ontology updates and easy scalability to other codification systems. The methodology followed in this work involves translating the HPO into Spanish, building a reference vector database, testing prompt strategies, and creating a user interface for the validation and annotation of clinical notes. The entire solution is built on an open-source, microservice-based architecture. In addition, the results of different RAG and LLMs configurations are compared, revealing their effect on accuracy and computational cost. Results show that the LLMs alone (i.e. OpenAI’s o4-mini) performs poorly (F1-score of 0.2), often generating incorrect or unrelated codes. Integrating RAG significantly improves results. The highest-performing configuration achieved reaches an F1-score of 0.64 (0.68 precision and 0.62 recall) on the RAGHPO dataset.

O2 - Repositori Institucional (Universitat Oberta de Catalunya)
Quality Education
Openalex Percentile: Top 33%
Biomedical Text Mining and Ontologies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Automated Phenotype Annotation in Spanish Clinical Text: A Large Language Model Approach with Retrieval-Augmented Generation — Malena Díaz Río · O2 - Repositori Institucional (Universitat Oberta de Catalunya) (2025) | TGRS Research Map | TGRS