Large language models (LLMs) are increasingly used to structure free-text clinical data. However, many practical approaches rely on rigid schema-based outputs, which limit semantic flexibility and downstream reuse. In this study, we propose an alternative representation: prompting an open-weight LLM to directly extract knowledge graph triples. Unlike findings in pre-defined field-based outputs such as JSON, graph-based outputs naturally capture relationships between entities, supporting more flexible querying, integration, and visualization. We apply our method to a curated subset of Dutch soft tissue tumor pathology reports and compare the graph-based extractions with structured JSON outputs. Across 20 reports for 24 specimens, both formats achieved high macro-averaged F1 scores (≥0.9) for most fields, with JSON marginally outperforming in certain categories. In addition to their competitive accuracy, graph outputs offer improved structural consistency and semantic clarity, making them a promising foundation for generating ground-truth labels in downstream tasks such as imaging-based AI applications. These findings support the use of knowledge graph-based outputs as a solution for structuring complex medical narratives.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

From Reports to Relations: Large Language Models for Knowledge Graph Extraction in Digital Pathology

  • Karthik Prathaban,
  • Farhan Akram,
  • Stefan Klein,
  • Martijn P. A. Starmans

摘要

Large language models (LLMs) are increasingly used to structure free-text clinical data. However, many practical approaches rely on rigid schema-based outputs, which limit semantic flexibility and downstream reuse. In this study, we propose an alternative representation: prompting an open-weight LLM to directly extract knowledge graph triples. Unlike findings in pre-defined field-based outputs such as JSON, graph-based outputs naturally capture relationships between entities, supporting more flexible querying, integration, and visualization. We apply our method to a curated subset of Dutch soft tissue tumor pathology reports and compare the graph-based extractions with structured JSON outputs. Across 20 reports for 24 specimens, both formats achieved high macro-averaged F1 scores (≥0.9) for most fields, with JSON marginally outperforming in certain categories. In addition to their competitive accuracy, graph outputs offer improved structural consistency and semantic clarity, making them a promising foundation for generating ground-truth labels in downstream tasks such as imaging-based AI applications. These findings support the use of knowledge graph-based outputs as a solution for structuring complex medical narratives.