From Free Text to Clusters of Content in Health Records: An Unsupervised Graph Partitioning Approach

M. Tarik Altuncu, Erik Mayer, Sophia N. Yaliraki, Mauricio Barahona

Abstract

Electronic Healthcare records contain large volumes of unstructured data in different forms. Free text constitutes a large portion of such data, yet this source of richly detailed information often remains under-used in practice because of a lack of suitable methodologies to extract interpretable content in a timely manner. Here we apply network-theoretical tools to the analysis of free text in Hospital Patient Incident reports in the English National Health Service, to find clusters of reports in an unsupervised manner and at different levels of resolution based directly on the free text descriptions contained within them. To do so, we combine recently developed deep neural network text-embedding methodologies based on paragraph vectors with multi-scale Markov Stability community detection applied to a similarity graph of documents obtained from sparsified text vector similarities. We showcase the approach with the analysis of incident reports submitted in Imperial College Healthcare NHS Trust, London. The multiscale community structure reveals levels of meaning with different resolution in the topics of the dataset, as shown by relevant descriptive terms extracted from the groups of records, as well as by comparing a posteriori against hand-coded categories assigned by healthcare personnel. Our content communities exhibit good correspondence with well-defined hand-coded categories, yet our results also provide further medical detail in certain areas as well as revealing complementary descriptors of incidents beyond the external classification. We also discuss how the method can be used to monitor reports over time and across different healthcare providers, and to detect emerging trends that fall outside of pre-existing categories.

Introduction

Modern healthcare generates mountains of data, but a significant portion is "dark data": unstructured free text found in Electronic Healthcare Records (EHRs). In the UK’s National Health Service (NHS), staff submit millions of Patient Incident reports annually. While these reports contain rich, "front-line" details, they are often under-utilized because manual analysis is too slow and human-coded categories are often too generic or prone to error. Traditional text analysis often forces documents into a "flat" list of topics, failing to capture the hierarchical nature of medical incidents—where a broad "Medication Error" might specifically involve "Insulin" or "Chemotherapy."

Methodology

The researchers developed a multi-stage unsupervised pipeline that treats text analysis as a problem of community detection on a graph. This approach allows for the discovery of topics at multiple levels of resolution directly from the text, bypassing the limitations of rigid, pre-defined classification systems.

Schematic overview of the proposed pipeline, illustrating the transition from raw incident data to multiscale community detection through text embedding and graph construction.

Text Embedding and Graph Construction

  1. Doc2Vec Embedding: Each report is mapped into a high-dimensional vector space using a deep neural network model (Doc2Vec). This captures semantic meaning, ensuring documents with similar clinical contexts are physically close in the vector space.
  2. Sparsified Similarity Graph: To manage the data, the team calculated similarities between all document vectors and "sparsified" the resulting network using a combination of a Minimum Spanning Tree (MST) and k-Nearest Neighbors (kNN). This ensures the graph remains globally connected while highlighting local clusters.
Comparison of graph construction methods: from the dense full adjacency matrix to various levels of sparsification using MST+kNN, which helps reveal the underlying community structure.

Markov Stability (MS)

MS is the core graph partitioning framework used to find communities. By varying a "Markov time" parameter (simulating a diffusion process), the algorithm acts like a zoom lens, identifying broad themes at long time scales and granular sub-topics at short time scales.

Datasets and Validation

The model was trained on a massive dataset of over 13 million anonymized incident reports from the National Reporting and Learning System (NRLS). For detailed analysis, the study focused on 3,229 records from St Mary’s Hospital, London. Validation was performed using Normalized Mutual Information (NMI) to compare unsupervised clusters against human labels, and Pointwise Mutual Information (PMI) to measure topic coherence.

Key Insights and Results

  • Granularity and Clinical Relevance: The unsupervised model frequently outperformed manual human coding in clinical specificity. For example, reports labeled under the generic "Treatment/Procedure" category were automatically grouped into highly specific clusters like "Radiotherapy," "Blood Transfusions," or "Labour Ward."
  • Multiscale Discovery: Markov Stability revealed how 44 specific sub-topics (e.g., "Insulin errors") naturally merged into 12 intermediate themes and finally into 3 broad categories: "Accidents," "Procedural Matters," and "Labour Ward."
  • Superior Performance: The Doc2Vec + Markov Stability approach produced more coherent topics than the industry-standard Latent Dirichlet Allocation (LDA) and showed strong alignment with human logic (NMI ~0.4) without requiring labeled training data.

Conclusion

This research demonstrates that combining deep learning embeddings with graph-theoretical community detection can unlock the value of unstructured medical text. The methodology provides a scalable way to monitor healthcare reports, detect emerging trends, and provide clinical insights that traditional, rigid classification systems might miss. Future work will explore real-time implementation to assist staff in categorizing reports at the point of entry.

Summary updated

Abstract

Electronic Healthcare records contain large volumes of unstructured data in different forms. Free text constitutes a large portion of such data, yet this source of richly detailed information often remains under-used in practice because of a lack of suitable methodologies to extract interpretable content in a timely manner. Here we apply network-theoretical tools to the analysis of free text in Hospital Patient Incident reports in the English National Health Service, to find clusters of reports in an unsupervised manner and at different levels of resolution based directly on the free text descriptions contained within them. To do so, we combine recently developed deep neural network text-embedding methodologies based on paragraph vectors with multi-scale Markov Stability community detection applied to a similarity graph of documents obtained from sparsified text vector similarities. We showcase the approach with the analysis of incident reports submitted in Imperial College Healthcare NHS Trust, London. The multiscale community structure reveals levels of meaning with different resolution in the topics of the dataset, as shown by relevant descriptive terms extracted from the groups of records, as well as by comparing a posteriori against hand-coded categories assigned by healthcare personnel. Our content communities exhibit good correspondence with well-defined hand-coded categories, yet our results also provide further medical detail in certain areas as well as revealing complementary descriptors of incidents beyond the external classification. We also discuss how the method can be used to monitor reports over time and across different healthcare providers, and to detect emerging trends that fall outside of pre-existing categories.
BibTeX
@article{altuncu2019from,
  author = {M. Tarik Altuncu and Erik Mayer and Sophia N. Yaliraki and Mauricio Barahona},
  title = {{From Free Text to Clusters of Content in Health Records: An Unsupervised Graph Partitioning Approach}},
  journal = {Appl. Netw. Sci.},
  year = {2019},
  doi = {10.1007/s41109-018-0109-9},
}
Figure