The Primary Care Diagnostic Gap: Most lung cancer patients are diagnosed at advanced stages when curative treatment is rarely possible. Patients typically visit their general practitioner (GP) multiple times with symptoms like cough, dyspnea, and fatigue in the months or years before a cancer diagnosis - yet these subtle, non-specific symptoms rarely trigger immediate lung cancer investigation.
Hidden Signals in Clinical Notes: GP clinical notes contain rich unstructured text documenting patient symptoms, examination findings, prescriptions, and follow-up plans. These notes may contain patterns of symptom combinations, consultation frequencies, and evolving complaint profiles that collectively signal increased lung cancer risk, even when no single entry is alarming enough to prompt action.
NLP for Early Warning: This Dutch study applied a natural language processing (NLP) technique called phrase skip-gram to extract predictive features from the full text of GP clinical notes. The model analyzed symptoms, diagnoses, and treatments recorded in the electronic health records of over 525,000 patients across four Dutch GP networks.
Objective: To develop and validate an AI model that could identify patients at elevated lung cancer risk from their GP notes - ideally detecting risk 4 or more months before the GP referral that led to diagnosis, potentially enabling earlier investigation and diagnosis.
Study Population: The cohort comprised 525,526 patients from 4 Dutch general practice networks, including 2,386 patients who received a lung cancer diagnosis during the study period. The cohort covered primary care records spanning multiple years before diagnosis, allowing analysis of symptom trajectories leading up to cancer detection.
Phrase Skip-Gram Model: Unlike standard bag-of-words NLP that treats individual words independently, the phrase skip-gram model captures relationships between nearby words (phrases) within a contextual window. Applied to GP notes, it learns that 'persistent cough' and 'shortness of breath' co-occurring with 'weight loss' represents a different risk pattern than any of these phrases alone.
Feature Extraction from Unstructured Text: The model processed the full free-text of GP consultation notes, extracting phrase embeddings that encode symptom combinations, temporal patterns, and clinical context. Features included symptom frequency, the sequence of different complaint types, and combinations of ICPC (International Classification of Primary Care) codes with free-text phrases.
Validation Design: Internal validation was performed on a held-out subset of the same networks. External validation used a separate, geographically distinct GP network to assess generalizability. Both validations measured AUROC (Area Under the Receiver Operating Characteristic curve) as the primary performance metric.
Excellent Internal Discrimination: The phrase skip-gram NLP model achieved an internal validation AUROC of 0.88, indicating strong ability to distinguish patients who would develop lung cancer from those who would not, based on the pattern of their GP notes at a point before referral.
External Validation Performance: On the external validation network (geographically and organizationally distinct from the training networks), the model achieved AUROC of 0.79. While lower than internal performance, an AUROC of 0.79 still represents clinically meaningful discriminative ability and demonstrates that the model generalizes across different GP practices.
Detection Lead Time: The model identified elevated risk an average of 4 months before the GP referral that ultimately led to lung cancer diagnosis. This represents a substantial opportunity window in which additional investigation (low-dose CT screening, chest X-ray, or specialist referral) could potentially detect cancer at earlier, more treatable stages.
Key Predictive Features: Analysis of the most important NLP features revealed that combinations of respiratory symptoms (cough, dyspnea), constitutional symptoms (fatigue, weight loss), and repeated GP consultations for overlapping complaints were strongly predictive. The model captured the pattern of escalating multi-symptom burden rather than relying on any single diagnostic code.
Population-Level Screening Enhancement: Current lung cancer screening programs target high-risk populations defined by age and smoking history for annual low-dose CT screening. An AI GP-notes analyzer could continuously monitor all patients regardless of smoking status, providing dynamic risk stratification that evolves with each new consultation.
Actionable Alerts Without Disrupting Workflow: The NLP model could run passively in the background of the GP electronic health record system, generating a risk alert when a patient's consultation pattern crosses a threshold. GPs would receive a notification suggesting consideration of chest imaging or specialist referral - a low-friction intervention that works within existing clinical workflows.
Catching Never-Smokers: Never-smokers account for approximately 10-15% of lung cancer cases and are generally excluded from CT screening programs. Because the NLP model does not rely on smoking history, it could flag symptom-based risk in never-smokers who would otherwise have no pathway to screening.
Data Privacy and Governance: Implementing this system requires careful attention to data privacy regulations (GDPR in Europe), appropriate patient consent frameworks for using clinical notes in AI models, and clinical governance processes to define how GP alerts should be acted upon without causing unnecessary anxiety or over-investigation.
Prospective Validation Required: This study retrospectively analyzed notes from patients already diagnosed with lung cancer. The model must now be tested prospectively - applied in real time to active patients and followed to see whether alerted patients who receive earlier investigation are diagnosed at earlier stages.
Calibration and Alert Threshold Setting: Clinical deployment requires defining an alert threshold that balances sensitivity (catching true lung cancer cases early) against specificity (avoiding excessive false alarms that burden GPs and cause patient anxiety). This threshold optimization depends on healthcare system capacity and risk tolerance.
Integration with Other Risk Factors: Combining NLP-derived note features with structured data such as smoking pack-years, age, prior lung disease history, and imaging results into a hybrid model could further improve performance and produce a more comprehensive lung cancer risk score.
Extension to Other Cancers: The phrase skip-gram approach to mining GP notes is not specific to lung cancer. Future work could adapt and validate similar models for other cancers with primary care symptom trajectories - such as colorectal cancer, pancreatic cancer, or ovarian cancer - where early detection significantly improves outcomes.