Case studies›Real-world data

From clinic letters to a real-world cancer dataset: AI extracts head and neck cancer data

How Guy’s and St Thomas’ NHS Foundation Trust taught CogStack AI to read oncology notes, for real-world cancer research.

Guy’s and St Thomas’ NHS Foundation Trust4 min read

Executive Summary

The problem

Every cancer centre holds years of diagnosis, treatment and outcome data in clinic letters and pathology reports. Most of it never reaches a research dataset unless someone reads and transcribes the data manually. What if it could be extracted at scale, with accuracy you can check?

What they did

Head and neck cancer care leaves a rich trail of letters, notes and histopathology reports covering diagnosis, treatment and outcome. Clinicians at Guy’s and St Thomas’ put CogStack to the test: could a clinical NLP tool be trained to be accurate enough to do this?

The result

2,895Head and neck cancer patients in a new real-world dataset
~150,000Data points extracted from free-text records
96%Median accuracy of validated concepts on unseen patients
500Annotated documents for the first big leap in performance

The Challenge

Real-world data could transform cancer research. But in oncology, most of the detail that matters, such as stage, histology, treatment and outcome, is written in prose rather than coded.

  • Manual curation doesn’t scale. Expert chart review is the gold standard, but it is resource-intensive, error-prone and takes clinicians away from other work.
  • Cancer language is tricky. Spelling variations, inconsistent formats and ambiguous terms are common, and a treatment that is discussed is not always the treatment that is given.
  • Little proof in NHS real world cancer data. Clinical NLP has seen limited use in oncology, with few published studies in a UK or NHS setting.

At Guy’s Cancer Centre, the team carefully hand-curated a subset of letters about cancers in the oral cavity, larynx and oropharynx cancers, to act as a benchmark.

The Solution

The team used CogStack AI’s pre-trained MedCAT to read head and neck cancer patients’ records and identify 109 SNOMED CT concepts across five areas: patient and comorbidities, disease, histopathology, treatment and outcomes. Every result was checked against the hand-curated datasets, and the model was improved in stages:

  • Out of the box: the base model was run with no local training to set a baseline.
  • First training round: clinicians reviewed 500 documents in the MedCATTrainer tool, marking the initial performance.
  • Second training round: a further 1,500 clinic letters, notes and histopathology reports were annotated as the list of concepts grew. Thresholds were set to reduce false positives.
  • Unseen test: the final model was tested on 81 new patients whose records it had never seen.

Results & Impact

Localised fine-tuning paid off quickly. Out of the box, the model couldn’t produce a usable score for almost 1 in 5 concepts. After a single round of 500 annotated documents, every concept could be measured, and median performance (F1 score) with concept-specific thresholds rose from 0.62 to 0.83.

Crucially, performance held up on the 81 unseen patients, with no significant drop, and no significant difference in performance between men and women or between ethnic groups. 50 of the 109 concepts met the team’s pre-set bar for validation. For those, median accuracy on unseen patients was 96%, with precision of 0.96 and recall of 0.94.

The team then ran the model across their entire retrospective cohort, generating almost 150,000 data points for 2,895 head and neck cancer patients treated since 2010, ready to combine with structured and imaging data for clinical and research use.

0.62 → 0.83Median F1 score after one round of 500 annotated documents
81Unseen patients tested, with no significant drop in performance

Why CogStack

This study shows what a lightweight clinical NLP tool can do with modest local effort. A few hundred annotated documents made a substantial difference, compared with the very large volumes typically needed to fine-tune a large language model. Every annotation was also fed back into the MedCAT parent model, so the next oncology team starts from a stronger base. CogStack is already established within NHS infrastructure, and can be paired with AnonCAT de-identification where a project calls for it.

Read the full study: Young T, Au Yeung J, Sambasivan K, Adjogatse D, Kong A, Petkar I, Reis Ferreira M, Lei M, King A, Teo J, Guerrero Urbano T. Natural Language Processing to Extract Head and Neck Cancer Data From Unstructured Electronic Health Records. Clin Oncol (R Coll Radiol). 2025 May;41:103805. doi: 10.1016/j.clon.2025.103805. Epub 2025 Mar 20. PMID: 40188745.

Topics
Cancer research datasetsClinical data curationClinical NLPHead and neck cancerOncology real-world dataUnstructured data to outcomes
Find more like this
Validating Waiting Lists at Scale with Clinical NLP: 40,000+ Referrals Safely Closed
Guy’s and St Thomas’ NHS Foundation Trust
Flagging 9 in 10 unplanned intensive care admissions before elective neurosurgery at UCLH
University College London Hospitals NHS Foundation Trust
Mental Health Records Made Usable: Medication Reviews Cut from Hours to Minutes
South London and Maudsley NHS Foundation Trust

Next steps

Sitting on years of cancer notes?

If your cancer centre or research team wants to build real-world datasets from free text, and validate them against your own ground truth, talk to us about how CogStack can help.