Andrey Kormilitzin
Current Organizations / Institutes
The organizations/institutes from the scholar's latest article
Previous Organizations / Institutes
The organizations / institutes from the scholar's other articles in the past ten years
Andrey Kormilitzin has a total of 141 co-authors. Here are the top co-authors by number of shared publications:
- Alejo J. Nevado Holgado
Department of Psychiatry, University of Oxford, Oxford, UK
11 shared publications - Dan W. Joyce
University of Liverpool
8 shared publications - Niall Taylor
Department of Psychiatry, University of Oxford, Oxford, United Kingdom
5 shared publications Alejo Nevado-Holgado
Department of Psychiatry, University of Oxford, Oxford, United Kingdom
4 shared publications- En-Nien Tu
Department of Psychiatry and Experimental Psychology, University of Oxford, Oxford, UK
4 shared publications - Huilin Chen
University of Oxford
4 shared publications
Latest Publications
- Open Access
- 26 October 2026
- Published by JMIR Publications Inc. in JMIR Medical Informatics
- Vol. 14, e96370
Integrating Natural Language Processing in Child and Adolescent Mental Health Services Research Using Normalization Process Theory: Implementation Report
Background: Anxiety problems are prevalent among autistic children and adolescents and those with attention-deficit/hyperactivity disorder (ADHD). Natural language processing (NLP) is increasingly used to structure information from electronic health records (EHRs), but its implementation within secure child and adolescent mental health services (CAMHS) research environments is less frequently reported. Objective: This study documented the specification, governance, integration, and evaluation of an NLP-enabled information extraction workflow within the Oxford Health National Health Service (NHS) Foundation Trust CAMHS research setting for extracting documented anxiety treatment information and outcome-related text from the EHRs of autistic young people and those with ADHD and examined implementation using normalization process theory (NPT). Methods: A multidisciplinary team developed a locally deployed NLP pipeline to identify labeled text spans describing presenting problems, medication attributes, psychological therapies, and treatment outcomes in pseudonymized EHR notes. Implementation followed an iterative seven-phase road map: (1) defining research questions, (2) identifying key constructs, (3) codeveloping an annotation schema, (4) training human annotators, (5) resolving annotation discrepancies, (6) large-scale annotation of EHR data, and (7) developing and evaluating the NLP model. NPT was applied throughout to guide implementation and evaluate progress. Quantitative outcomes (data volume processed, annotation reliability, and model performance) and qualitative feedback were collected to assess implementation success. Implementation (Results): The source cohort comprised 454,127 notes from 5906 patients; 697 (0.2%) randomly selected, manually annotated notes from 302 (5.1%) patients were used for model development and held-out evaluation. Category-specific position-based Krippendorff α values ranged from 0.325 to 0.579 for problem, psychological therapy, and outcome spans and from 0.665 to 0.967 for medication spans. Agreement was highest for medication names, doses, and frequencies and lowest for cognitive problems and treatment outcomes. Held-out macroaveraged F1-score was 0.87 (95% CI 0.86-0.89) across the 4 medication labels and 0.71 (95% CI 0.68-0.73) across the 5 problem labels, psychological therapy labels, and outcome labels; label-specific F1-score ranged from 0.60 to 0.98. Team-generated implementation records indicated that multidisciplinary schema development and clear protocols supported shared understanding and engagement, whereas annotation burden, documentation variability, data access delays, and computing constraints impeded implementation. No major adverse events or harms were reported. Conclusions: This report demonstrates the feasibility of integrating NLP tools into NHS CAMHS research workflows to extract structured information on anxiety treatments from routine clinical records. The NPT framework provided a structured approach for documenting the organizational work, barriers, and adaptations involved. External validation, refinement of less reliable labels, and further evaluation are required before broader use. International Registered Report Identifier (IRRID): RR2-10.31234/osf.io/r4gyw
- 26 October 2026
- Published by JMIR Publications Inc. in JMIR Medical Informatics
- Vol. 14, e96370
Open AccessIntegrating Natural Language Processing in Child and Adolescent Mental Health Services Research Using Normalization Process Theory: Implementation Report
Background: Anxiety problems are prevalent among autistic children and adolescents and those with attention-deficit/hyperactivity disorder (ADHD). Natural language processing (NLP) is increasingly used to structure information from electronic health records (EHRs), but its implementation within secure child and adolescent mental health services (CAMHS) research environments is less frequently reported. Objective: This study documented the specification, governance, integration, and evaluation of an NLP-enabled information extraction workflow within the Oxford Health National Health Service (NHS) Foundation Trust CAMHS research setting for extracting documented anxiety treatment information and outcome-related text from the EHRs of autistic young people and those with ADHD and examined implementation using normalization process theory (NPT). Methods: A multidisciplinary team developed a locally deployed NLP pipeline to identify labeled text spans describing presenting problems, medication attributes, psychological therapies, and treatment outcomes in pseudonymized EHR notes. Implementation followed an iterative seven-phase road map: (1) defining research questions, (2) identifying key constructs, (3) codeveloping an annotation schema, (4) training human annotators, (5) resolving annotation discrepancies, (6) large-scale annotation of EHR data, and (7) developing and evaluating the NLP model. NPT was applied throughout to guide implementation and evaluate progress. Quantitative outcomes (data volume processed, annotation reliability, and model performance) and qualitative feedback were collected to assess implementation success. Implementation (Results): The source cohort comprised 454,127 notes from 5906 patients; 697 (0.2%) randomly selected, manually annotated notes from 302 (5.1%) patients were used for model development and held-out evaluation. Category-specific position-based Krippendorff α values ranged from 0.325 to 0.579 for problem, psychological therapy, and outcome spans and from 0.665 to 0.967 for medication spans. Agreement was highest for medication names, doses, and frequencies and lowest for cognitive problems and treatment outcomes. Held-out macroaveraged F1-score was 0.87 (95% CI 0.86-0.89) across the 4 medication labels and 0.71 (95% CI 0.68-0.73) across the 5 problem labels, psychological therapy labels, and outcome labels; label-specific F1-score ranged from 0.60 to 0.98. Team-generated implementation records indicated that multidisciplinary schema development and clear protocols supported shared understanding and engagement, whereas annotation burden, documentation variability, data access delays, and computing constraints impeded implementation. No major adverse events or harms were reported. Conclusions: This report demonstrates the feasibility of integrating NLP tools into NHS CAMHS research workflows to extract structured information on anxiety treatments from routine clinical records. The NPT framework provided a structured approach for documenting the organizational work, barriers, and adaptations involved. External validation, refinement of less reliable labels, and further evaluation are required before broader use. International Registered Report Identifier (IRRID): RR2-10.31234/osf.io/r4gyw
- Open Access
- 12 October 2026
- Published by Taylor & Francis in Patient Related Outcome Measures
- Vol. 17 (1) , 149-161
Digital patient-reported outcomes to evaluate treatment response to filgotinib in patients with ulcerative colitis
Patient-reported outcomes (PROs) are clinical tools based on validated, patient-completed questionnaires and assessments.1 They are used to illustrate a person’s subjective view on health status, s...
- 12 October 2026
- Published by Taylor & Francis in Patient Related Outcome Measures
- Vol. 17 (1) , 149-161
Open AccessDigital patient-reported outcomes to evaluate treatment response to filgotinib in patients with ulcerative colitis
Patient-reported outcomes (PROs) are clinical tools based on validated, patient-completed questionnaires and assessments.1 They are used to illustrate a person’s subjective view on health status, s...
- Open Access
- 2 June 2026
- Published by JMIR Publications Inc. in JMIR Mental Health
- Vol. 13 (1) , e87586
Detection of Self-Harm in Electronic Mental Health Records Using Privacy-Preserving Local Language Models: Methodological Study
Background: Self-harm is the strongest risk factor for suicide and an important outcome for mental health care. Although prevalent in clinical populations, it is often imprecisely captured in routinely collected clinical data, where it is often recorded and stored as unstructured free text. Contemporary language models, such as GPT (OpenAI) and Gemini (Google), can analyze free-text clinical notes, but such models may violate data governance of processing sensitive patient data. Objective: This study aimed to evaluate whether a privacy-preserving language model running entirely within an institution’s secure computing infrastructure (here, the UK National Health Service [NHS]) could accurately identify the presence and timing of self-harm using electronic health records from secondary mental health care. Methods: Clinical notes were drawn from Oxford Health NHS Foundation Trust using a multistage workflow: (1) a random sample of 1000 patients with a psychiatric diagnosis, defined according to the ICD-10 ( International Statistical Classification of Diseases, Tenth Revision ; codes F00–F99); (2) candidate-note identification using a Gemma3-4b language model to flag notes containing self-harm content; and (3) from those candidates, 1352 randomly sampled notes were selected for expert annotation, resulting in gold-standard corpus enriched for self-harm content. Clinical notes were annotated for the presence of self-harm and its timing (≤90 days, >90 days, or unknown). A privacy-preserving locally served 27-billion-parameter Gemma 3 language model (“Gemma3-27b”) was used as the core model. Prompts were systematically developed and refined using a labeled development set to identify self-harm and generate a structured output per clinical record. Gemma3-27b performance was compared against a strong baseline multilabel text classification model based on robustly optimized BERT pretraining approach (RoBERTa), a transformer-based language model architecture. Model performance was evaluated using precision, recall, and the F 1 -score (harmonic mean of precision and recall), with 95% CIs estimated from 1000 bootstrap samples with replacement. Results: Gemma3-27b outperformed the RoBERTa classifier across all categories, achieving Precision=0.92, Recall=0.92 (sensitivity), and F 1 -score=0.92 for notes containing self-harm, and Precision=0.97, Recall=0.97 (specificity), and F 1 -score=0.97 for notes without self-harm. For the 51 notes labeled as recent self-harm in the held-out test set, Gemma3-27b achieved Precision=0.84, Recall=0.75, and F 1 -score=0.79. The global weighted F 1 -score of Gemma3-27b across all categories was 0.88, compared to 0.85 for RoBERTa. Conclusions: With systematic prompt development on a labeled development set, but no gradient-based fine-tuning, the current Gemma3-27b language model matched or exceeded a fine-tuned RoBERTa classifier for ascertaining self-harm events and their timing. Aggregate gains were modest, while improvements were largest in the most challenging, lower-frequency timing categories. On a simplified binary recent-versus-other task, RoBERTa performed marginally better, indicating that supervised classifiers remain highly effective when the task is simplified and sufficient labeled data exist. This work demonstrates the technical feasibility of privacy-preserving self-harm detection within a secure NHS research environment.
- 2 June 2026
- Published by JMIR Publications Inc. in JMIR Mental Health
- Vol. 13 (1) , e87586
Open AccessDetection of Self-Harm in Electronic Mental Health Records Using Privacy-Preserving Local Language Models: Methodological Study
Background: Self-harm is the strongest risk factor for suicide and an important outcome for mental health care. Although prevalent in clinical populations, it is often imprecisely captured in routinely collected clinical data, where it is often recorded and stored as unstructured free text. Contemporary language models, such as GPT (OpenAI) and Gemini (Google), can analyze free-text clinical notes, but such models may violate data governance of processing sensitive patient data. Objective: This study aimed to evaluate whether a privacy-preserving language model running entirely within an institution’s secure computing infrastructure (here, the UK National Health Service [NHS]) could accurately identify the presence and timing of self-harm using electronic health records from secondary mental health care. Methods: Clinical notes were drawn from Oxford Health NHS Foundation Trust using a multistage workflow: (1) a random sample of 1000 patients with a psychiatric diagnosis, defined according to the ICD-10 ( International Statistical Classification of Diseases, Tenth Revision ; codes F00–F99); (2) candidate-note identification using a Gemma3-4b language model to flag notes containing self-harm content; and (3) from those candidates, 1352 randomly sampled notes were selected for expert annotation, resulting in gold-standard corpus enriched for self-harm content. Clinical notes were annotated for the presence of self-harm and its timing (≤90 days, >90 days, or unknown). A privacy-preserving locally served 27-billion-parameter Gemma 3 language model (“Gemma3-27b”) was used as the core model. Prompts were systematically developed and refined using a labeled development set to identify self-harm and generate a structured output per clinical record. Gemma3-27b performance was compared against a strong baseline multilabel text classification model based on robustly optimized BERT pretraining approach (RoBERTa), a transformer-based language model architecture. Model performance was evaluated using precision, recall, and the F 1 -score (harmonic mean of precision and recall), with 95% CIs estimated from 1000 bootstrap samples with replacement. Results: Gemma3-27b outperformed the RoBERTa classifier across all categories, achieving Precision=0.92, Recall=0.92 (sensitivity), and F 1 -score=0.92 for notes containing self-harm, and Precision=0.97, Recall=0.97 (specificity), and F 1 -score=0.97 for notes without self-harm. For the 51 notes labeled as recent self-harm in the held-out test set, Gemma3-27b achieved Precision=0.84, Recall=0.75, and F 1 -score=0.79. The global weighted F 1 -score of Gemma3-27b across all categories was 0.88, compared to 0.85 for RoBERTa. Conclusions: With systematic prompt development on a labeled development set, but no gradient-based fine-tuning, the current Gemma3-27b language model matched or exceeded a fine-tuned RoBERTa classifier for ascertaining self-harm events and their timing. Aggregate gains were modest, while improvements were largest in the most challenging, lower-frequency timing categories. On a simplified binary recent-versus-other task, RoBERTa performed marginally better, indicating that supervised classifiers remain highly effective when the task is simplified and sufficient labeled data exist. This work demonstrates the technical feasibility of privacy-preserving self-harm detection within a secure NHS research environment.
- Open Access
- 28 March 2026
- Published by JMIR Publications Inc. in JMIR Preprints
Integrating Natural Language Processing in Child and Adolescent Mental Health Services Research Using Normalization Process Theory: Implementation Report (Preprint)
BACKGROUND Anxiety problems are prevalent among autistic children and adolescents and those with attention-deficit/hyperactivity disorder (ADHD). Natural language processing (NLP) is increasingly used to structure information from electronic health records (EHRs), but its implementation within secure child and adolescent mental health services (CAMHS) research environments is less frequently reported. OBJECTIVE This study documented the specification, governance, integration, and evaluation of an NLP-enabled information extraction workflow within the Oxford Health National Health Service (NHS) Foundation Trust CAMHS research setting for extracting documented anxiety treatment information and outcome-related text from the EHRs of autistic young people and those with ADHD and examined implementation using normalization process theory (NPT). METHODS A multidisciplinary team developed a locally deployed NLP pipeline to identify labeled text spans describing presenting problems, medication attributes, psychological therapies, and treatment outcomes in pseudonymized EHR notes. Implementation followed an iterative seven-phase road map: (1) defining research questions, (2) identifying key constructs, (3) codeveloping an annotation schema, (4) training human annotators, (5) resolving annotation discrepancies, (6) large-scale annotation of EHR data, and (7) developing and evaluating the NLP model. NPT was applied throughout to guide implementation and evaluate progress. Quantitative outcomes (data volume processed, annotation reliability, and model performance) and qualitative feedback were collected to assess implementation success. RESULTS The source cohort comprised 454,127 notes from 5906 patients; 697 (0.2%) randomly selected, manually annotated notes from 302 (5.1%) patients were used for model development and held-out evaluation. Category-specific position-based Krippendorff α values ranged from 0.325 to 0.579 for problem, psychological therapy, and outcome spans and from 0.665 to 0.967 for medication spans. Agreement was highest for medication names, doses, and frequencies and lowest for cognitive problems and treatment outcomes. Held-out macroaveraged F1-score was 0.87 (95% CI 0.86-0.89) across the 4 medication labels and 0.71 (95% CI 0.68-0.73) across the 5 problem labels, psychological therapy labels, and outcome labels; label-specific F1-score ranged from 0.60 to 0.98. Team-generated implementation records indicated that multidisciplinary schema development and clear protocols supported shared understanding and engagement, whereas annotation burden, documentation variability, data access delays, and computing constraints impeded implementation. No major adverse events or harms were reported. CONCLUSIONS This report demonstrates the feasibility of integrating NLP tools into NHS CAMHS research workflows to extract structured information on anxiety treatments from routine clinical records. The NPT framework provided a structured approach for documenting the organizational work, barriers, and adaptations involved. External validation, refinement of less reliable labels, and further evaluation are required before broader use. INTERNATIONAL REGISTERED REPORT RR2-10.31234/osf.io/r4gyw
- 28 March 2026
- Published by JMIR Publications Inc. in JMIR Preprints
Open AccessIntegrating Natural Language Processing in Child and Adolescent Mental Health Services Research Using Normalization Process Theory: Implementation Report (Preprint)
BACKGROUND Anxiety problems are prevalent among autistic children and adolescents and those with attention-deficit/hyperactivity disorder (ADHD). Natural language processing (NLP) is increasingly used to structure information from electronic health records (EHRs), but its implementation within secure child and adolescent mental health services (CAMHS) research environments is less frequently reported. OBJECTIVE This study documented the specification, governance, integration, and evaluation of an NLP-enabled information extraction workflow within the Oxford Health National Health Service (NHS) Foundation Trust CAMHS research setting for extracting documented anxiety treatment information and outcome-related text from the EHRs of autistic young people and those with ADHD and examined implementation using normalization process theory (NPT). METHODS A multidisciplinary team developed a locally deployed NLP pipeline to identify labeled text spans describing presenting problems, medication attributes, psychological therapies, and treatment outcomes in pseudonymized EHR notes. Implementation followed an iterative seven-phase road map: (1) defining research questions, (2) identifying key constructs, (3) codeveloping an annotation schema, (4) training human annotators, (5) resolving annotation discrepancies, (6) large-scale annotation of EHR data, and (7) developing and evaluating the NLP model. NPT was applied throughout to guide implementation and evaluate progress. Quantitative outcomes (data volume processed, annotation reliability, and model performance) and qualitative feedback were collected to assess implementation success. RESULTS The source cohort comprised 454,127 notes from 5906 patients; 697 (0.2%) randomly selected, manually annotated notes from 302 (5.1%) patients were used for model development and held-out evaluation. Category-specific position-based Krippendorff α values ranged from 0.325 to 0.579 for problem, psychological therapy, and outcome spans and from 0.665 to 0.967 for medication spans. Agreement was highest for medication names, doses, and frequencies and lowest for cognitive problems and treatment outcomes. Held-out macroaveraged F1-score was 0.87 (95% CI 0.86-0.89) across the 4 medication labels and 0.71 (95% CI 0.68-0.73) across the 5 problem labels, psychological therapy labels, and outcome labels; label-specific F1-score ranged from 0.60 to 0.98. Team-generated implementation records indicated that multidisciplinary schema development and clear protocols supported shared understanding and engagement, whereas annotation burden, documentation variability, data access delays, and computing constraints impeded implementation. No major adverse events or harms were reported. CONCLUSIONS This report demonstrates the feasibility of integrating NLP tools into NHS CAMHS research workflows to extract structured information on anxiety treatments from routine clinical records. The NPT framework provided a structured approach for documenting the organizational work, barriers, and adaptations involved. External validation, refinement of less reliable labels, and further evaluation are required before broader use. INTERNATIONAL REGISTERED REPORT RR2-10.31234/osf.io/r4gyw
- Open Access
- 13 January 2026
- Published by Springer Nature in BMC Psychiatry
- Vol. 26 (1) , 35
AI assisted triage of UK patients in mental health care services: a qualitative focus group study of patients’ attitudes
Background: The referral process between healthcare services can be complex, especially in psychiatry, leading to significant delays and ‘hidden waiting lists’. Digital approaches may be helpful. The CHRONOSIG (CHRONOlogical SIGnature) project aims to improve the referral and triage process by applying machine learning (ML) technology to information in electronic health records. We used a focus group methodology to ascertain the views of patients and participants on using CHRONOSIG and similar digital approaches to support decision making in triaging referrals in difficult to treat depression, and the potential benefits and disadvantages of such an approach. Methods: A lived experience participant focus group ( N = 16) was held on 25th September, 2024, with a lived experience chair. Participants were recruited by convenience sampling. Data were analysed thematically and managed using the Framework method, with double coding of transcripts, and reported using COREQ guidelines. Results: Main themes from the analysis were: (i) the complexity of mental health needs assessments; (ii) challenges in the current mental health system; (iii) general challenges of using a computer/artificial intelligence based tool for risk prediction and clinical decision support; (iv) differences and similarities in using a computer-based prediction tool in mental health vs. in physical health; (v) possible benefits and harms; (vi) factors to consider in the future. Conclusions: Patient engagement is a key challenge for digital tools in mental health, but previous studies in digital decision support tools have focussed on clinician feedback. In this study we ascertained the views of lived experience participants in mental healthcare triage and referral in difficult to treat depression. Participants identified delays, errors and confusion in the referral process and expressed positive views on the ability of the CHRONOSIG tool to help to improve waiting times and time spent between services, particularly when used as an addition to a high-quality clinical consultation. In many countries there are shortfalls in mental health care provision with increasing waits in both recorded and unrecorded waiting lists. This study supports a potential route to improve these processes; by more accurately and efficiently identifying the needs of patients and matching these to suitable services and research opportunities.
- 13 January 2026
- Published by Springer Nature in BMC Psychiatry
- Vol. 26 (1) , 35
Open AccessAI assisted triage of UK patients in mental health care services: a qualitative focus group study of patients’ attitudes
Background: The referral process between healthcare services can be complex, especially in psychiatry, leading to significant delays and ‘hidden waiting lists’. Digital approaches may be helpful. The CHRONOSIG (CHRONOlogical SIGnature) project aims to improve the referral and triage process by applying machine learning (ML) technology to information in electronic health records. We used a focus group methodology to ascertain the views of patients and participants on using CHRONOSIG and similar digital approaches to support decision making in triaging referrals in difficult to treat depression, and the potential benefits and disadvantages of such an approach. Methods: A lived experience participant focus group ( N = 16) was held on 25th September, 2024, with a lived experience chair. Participants were recruited by convenience sampling. Data were analysed thematically and managed using the Framework method, with double coding of transcripts, and reported using COREQ guidelines. Results: Main themes from the analysis were: (i) the complexity of mental health needs assessments; (ii) challenges in the current mental health system; (iii) general challenges of using a computer/artificial intelligence based tool for risk prediction and clinical decision support; (iv) differences and similarities in using a computer-based prediction tool in mental health vs. in physical health; (v) possible benefits and harms; (vi) factors to consider in the future. Conclusions: Patient engagement is a key challenge for digital tools in mental health, but previous studies in digital decision support tools have focussed on clinician feedback. In this study we ascertained the views of lived experience participants in mental healthcare triage and referral in difficult to treat depression. Participants identified delays, errors and confusion in the referral process and expressed positive views on the ability of the CHRONOSIG tool to help to improve waiting times and time spent between services, particularly when used as an addition to a high-quality clinical consultation. In many countries there are shortfalls in mental health care provision with increasing waits in both recorded and unrecorded waiting lists. This study supports a potential route to improve these processes; by more accurately and efficiently identifying the needs of patients and matching these to suitable services and research opportunities.
- Open Access
- 12 November 2025
- Published by JMIR Publications Inc. in JMIR Preprints
Privacy-preserving local language models accurately identify the presence and timing of self-harm in electronic mental health records (Preprint)
BACKGROUND Self-harm, defined as intentional self-injury or self-poisoning irrespective of motivation, is the strongest risk factor for suicide and an important outcome for mental health care. Although highly prevalent in clinical populations, it is often imprecisely captured in routinely collected clinical data, where it is typically recorded and stored in unstructured, free-text format. Contemporary language models, such as GPT (OpenAI), Gemini (Google) and Claude (Anthropic) can analyse free-text clinical notes, but such cloud-based commercial and closed-source models may violate data governance of processing sensitive patient data. OBJECTIVE We evaluated whether a privacy-preserving language model running entirely within an institution’s secure computing infrastructure (here, the UK National Health Service) could accurately identify the presence and timing of self-harm using electronic health records (EHRs) from secondary mental healthcare. METHODS A random sample of 1,352 clinical notes from the EHRs of people with a confirmed diagnosis of a psychiatric disorder, according to the International Classification of Diseases (ICD-10), was selected from Oxford Health NHS Foundation Trust. Each clinical note was annotated for (i) presence or absence of self-harm and (ii) its recency (≤90 days vs. >90 days vs. unknown), constituting the gold-standard data set for model development and validation. Privacy-preserving locally served 27-billion-parameter Gemma 3 language model (‘Gemma3-27b’) was used as a core language model to identify self-harm along with its timing to generate a structured output per clinical record. The performance of Gemma3-27b model was compared against a strong baseline multi-label text classification model based on RoBERTa (Robustly Optimized BERT Pretraining Approach, a transformer-based language model) architecture. Model performance was evaluated using precision, recall, and the F1-score (harmonic mean of precision and recall), with 95% confidence intervals estimated from 1,000 bootstrap samples with replacement. RESULTS The Gemma3-27b model outperformed the RoBERTa classifier across all categories. Gemma3-27b achieved Precision = 0.92, Recall = 0.92 (sensitivity), and F1-score of 0.92 for notes containing self-harm, and Precision = 0.97, Recall = 0.97 (specificity), and F1-score of 0.97 for notes without self-harm. The performance of Gemma3-27b for recent self-harm was Precision = 0.84, Recall = 0.75, and F1-score of 0.79. The global weighted F1-score of Gemma3-27b across all categories was 0.88, compared to 0.85 for RoBERTa. CONCLUSIONS The prompt-engineered local language model outperformed the multi-label text classification RoBERTa model on the task of ascertaining self-harm events and their timing, while requiring significantly fewer high-fidelity annotated data. This approach offers a practical solution for improving self-harm case ascertainment whilst adhering to strict data governance rules to potentially transform clinical monitoring and response to this critical public health challenge. CLINICALTRIAL None
- 12 November 2025
- Published by JMIR Publications Inc. in JMIR Preprints
Open AccessPrivacy-preserving local language models accurately identify the presence and timing of self-harm in electronic mental health records (Preprint)
BACKGROUND Self-harm, defined as intentional self-injury or self-poisoning irrespective of motivation, is the strongest risk factor for suicide and an important outcome for mental health care. Although highly prevalent in clinical populations, it is often imprecisely captured in routinely collected clinical data, where it is typically recorded and stored in unstructured, free-text format. Contemporary language models, such as GPT (OpenAI), Gemini (Google) and Claude (Anthropic) can analyse free-text clinical notes, but such cloud-based commercial and closed-source models may violate data governance of processing sensitive patient data. OBJECTIVE We evaluated whether a privacy-preserving language model running entirely within an institution’s secure computing infrastructure (here, the UK National Health Service) could accurately identify the presence and timing of self-harm using electronic health records (EHRs) from secondary mental healthcare. METHODS A random sample of 1,352 clinical notes from the EHRs of people with a confirmed diagnosis of a psychiatric disorder, according to the International Classification of Diseases (ICD-10), was selected from Oxford Health NHS Foundation Trust. Each clinical note was annotated for (i) presence or absence of self-harm and (ii) its recency (≤90 days vs. >90 days vs. unknown), constituting the gold-standard data set for model development and validation. Privacy-preserving locally served 27-billion-parameter Gemma 3 language model (‘Gemma3-27b’) was used as a core language model to identify self-harm along with its timing to generate a structured output per clinical record. The performance of Gemma3-27b model was compared against a strong baseline multi-label text classification model based on RoBERTa (Robustly Optimized BERT Pretraining Approach, a transformer-based language model) architecture. Model performance was evaluated using precision, recall, and the F1-score (harmonic mean of precision and recall), with 95% confidence intervals estimated from 1,000 bootstrap samples with replacement. RESULTS The Gemma3-27b model outperformed the RoBERTa classifier across all categories. Gemma3-27b achieved Precision = 0.92, Recall = 0.92 (sensitivity), and F1-score of 0.92 for notes containing self-harm, and Precision = 0.97, Recall = 0.97 (specificity), and F1-score of 0.97 for notes without self-harm. The performance of Gemma3-27b for recent self-harm was Precision = 0.84, Recall = 0.75, and F1-score of 0.79. The global weighted F1-score of Gemma3-27b across all categories was 0.88, compared to 0.85 for RoBERTa. CONCLUSIONS The prompt-engineered local language model outperformed the multi-label text classification RoBERTa model on the task of ascertaining self-harm events and their timing, while requiring significantly fewer high-fidelity annotated data. This approach offers a practical solution for improving self-harm case ascertainment whilst adhering to strict data governance rules to potentially transform clinical monitoring and response to this critical public health challenge. CLINICALTRIAL None
- Open Access
- 31 October 2025
- Published by Center for Open Science in PsyArXiv
Implementation Report: Integrating Natural Language Processing Approaches in Child and Adolescent Mental Health Services Research Using Normalisation Process Theory
Objective: This implementation report documents the integration of an NLP-based data extraction tool within the Oxford Health NHS Foundation Trust’s Child and Adolescent Mental Health Services (CAMHS) to identify and analyse treatment options and outcomes for anxiety in autistic and ADHD youth using electronic health records (EHRs). We evaluate the implementation process through the lens of Normalisation Process Theory (NPT) to understand how the documented interventions were adopted and to identify factors influencing its normalisation into routine research practice.Methods: A multidisciplinary team implemented an NLP pipeline to automatically extract information on presenting problems, treatments, and outcomes (e.g., engagement, clinical outcomes, side effects) from pseudonymised EHR free-text notes. The implementation followed an iterative seven-phase roadmap: (1) defining research questions; (2) identifying key constructs; (3) co-developing an annotation schema; (4) training human annotators; (5) resolving annotation discrepancies; (6) large-scale annotation of EHR data; and (7) NLP model development and evaluation. Throughout, we applied NPT to guide implementation and evaluate progress. Quantitative outcomes (such as volume of data processed, annotation reliability, and NLP model performance) and qualitative feedback were collected to assess implementation success.Results: The NLP intervention was successfully deployed in a real-world clinical research setting, extracted data from 454,127 clinical notes across 5,906 patients. The annotation process achieved a high inter-annotator agreement (Krippendorff’s α = 0.86; 95% CI 0.83–0.88) after iterative schema refinement, and the trained NLP model demonstrated acceptable accuracy in identifying medications (F1-score = 0.9; 95% CI 0.89, 0.91) and anxiety-related information (F1-score = 0.79; 95% CI 0.77, 0.8). The NPT-based evaluation revealed that coherence of a shared understanding of the NLP tool’s purpose and value was established among the team. Cognitive participation was generally strong, clinicians and researchers showed growing interest and involvement in the NLP-enabled research workflow. Collective action was facilitated by clear protocols, though challenges such as variability in data quality and the learning curve for new technology impeded smooth operation at times. Through reflective monitoring, the team identified needs for ongoing training and infrastructure improvements. No major adverse event or harm was reported, though additional time was required for data access and computational setup, which considerably extended the project timeline.
- 31 October 2025
- Published by Center for Open Science in PsyArXiv
Open AccessImplementation Report: Integrating Natural Language Processing Approaches in Child and Adolescent Mental Health Services Research Using Normalisation Process Theory
Objective: This implementation report documents the integration of an NLP-based data extraction tool within the Oxford Health NHS Foundation Trust’s Child and Adolescent Mental Health Services (CAMHS) to identify and analyse treatment options and outcomes for anxiety in autistic and ADHD youth using electronic health records (EHRs). We evaluate the implementation process through the lens of Normalisation Process Theory (NPT) to understand how the documented interventions were adopted and to identify factors influencing its normalisation into routine research practice.Methods: A multidisciplinary team implemented an NLP pipeline to automatically extract information on presenting problems, treatments, and outcomes (e.g., engagement, clinical outcomes, side effects) from pseudonymised EHR free-text notes. The implementation followed an iterative seven-phase roadmap: (1) defining research questions; (2) identifying key constructs; (3) co-developing an annotation schema; (4) training human annotators; (5) resolving annotation discrepancies; (6) large-scale annotation of EHR data; and (7) NLP model development and evaluation. Throughout, we applied NPT to guide implementation and evaluate progress. Quantitative outcomes (such as volume of data processed, annotation reliability, and NLP model performance) and qualitative feedback were collected to assess implementation success.Results: The NLP intervention was successfully deployed in a real-world clinical research setting, extracted data from 454,127 clinical notes across 5,906 patients. The annotation process achieved a high inter-annotator agreement (Krippendorff’s α = 0.86; 95% CI 0.83–0.88) after iterative schema refinement, and the trained NLP model demonstrated acceptable accuracy in identifying medications (F1-score = 0.9; 95% CI 0.89, 0.91) and anxiety-related information (F1-score = 0.79; 95% CI 0.77, 0.8). The NPT-based evaluation revealed that coherence of a shared understanding of the NLP tool’s purpose and value was established among the team. Cognitive participation was generally strong, clinicians and researchers showed growing interest and involvement in the NLP-enabled research workflow. Collective action was facilitated by clear protocols, though challenges such as variability in data quality and the learning curve for new technology impeded smooth operation at times. Through reflective monitoring, the team identified needs for ongoing training and infrastructure improvements. No major adverse event or harm was reported, though additional time was required for data access and computational setup, which considerably extended the project timeline.
- Open Access
Identifying the Presence and Timing of Self-harm in Electronic Mental Health Records Using Privacy-Preserving Local Language Models: Methodological Study
Background: Self-harm is the strongest risk factor for suicide and an important outcome for mental health care. Although prevalent in clinical populations, it is often imprecisely captured in routinely collected clinical data, where it is often recorded and stored as unstructured free text. Contemporary language models, such as GPT (OpenAI) and Gemini (Google), can analyse free-text clinical notes, but such cloud-based commercial and closed-source models may violate data governance of processing sensitive patient data. Objectives: We evaluated whether a privacy-preserving language model running entirely within an institution’s secure computing infrastructure (here, the UK National Health Service; NHS) could accurately identify the presence and timing of self-harm using electronic health records (EHRs) from secondary mental healthcare. Methods: Clinical notes were drawn from Oxford Health NHS Foundation Trust using a multi-stage workflow: (1) a random sample of 1,000 patients with a psychiatric diagnosis (ICD-10 F00–F99); (2) candidate-note identification using a Gemma3-4b language model to flag notes containing self-harm content; (3) from those candidates, 1,352 randomly sampled notes were selected for expert annotation. The resulting gold-standard corpus is therefore enriched for self-harm content. Each clinical note was annotated for the presence/absence of self-harm and its timing (≤90 days/>90 days/unknown). A privacy-preserving locally served 27-billion-parameter Gemma3 language model (’Gemma3-27b’) was used as the core model. Prompts were systematically developed and refined using a labelled development set to identify self-harm and generate a structured output per clinical record. The performance of Gemma3-27b model was compared against a strong baseline multi-label text classification model based on RoBERTa (Robustly Optimized BERT Pretraining Approach, a transformer-based language model) architecture. Model performance was evaluated using precision, recall, and the F1-score (harmonic mean of precision and recall), with 95% confidence intervals estimated from 1,000 bootstrap samples with replacement. Results: Gemma3-27b outperformed the RoBERTa classifier across all categories, achieving Precision=0.92, Recall=0.92, and F1-score=0.92 for notes containing self-harm, and Precision=0.97, Recall=0.97, and F1-score=0.97 for notes without self-harm. For the 51 notes labelled as recent self-harm in the held-out test set, Gemma3-27b achieved Precision=0.84, Recall=0.75, and F1-score=0.79. The global weighted F1-score of Gemma3-27b across all categories was 0.88, compared to 0.85 for RoBERTa. Conclusions: With systematic prompt development on a labelled development set, but no gradient-based fine-tuning, the current Gemma3-27b language model matched or exceeded a fine-tuned RoBERTa classifier for ascertaining self-harm events and their timing. Aggregate gains were modest, while improvements were largest in the most challenging, lower-frequency timing categories. On a simplified binary recent-versus-other task, RoBERTa performed marginally better, indicating that supervised classifiers remain highly effective when the task is simplified and sufficient labelled data exist. This work demonstrates the technical feasibility of privacy-preserving self-harm detection within a secure NHS research environment.
Open AccessIdentifying the Presence and Timing of Self-harm in Electronic Mental Health Records Using Privacy-Preserving Local Language Models: Methodological Study
Background: Self-harm is the strongest risk factor for suicide and an important outcome for mental health care. Although prevalent in clinical populations, it is often imprecisely captured in routinely collected clinical data, where it is often recorded and stored as unstructured free text. Contemporary language models, such as GPT (OpenAI) and Gemini (Google), can analyse free-text clinical notes, but such cloud-based commercial and closed-source models may violate data governance of processing sensitive patient data. Objectives: We evaluated whether a privacy-preserving language model running entirely within an institution’s secure computing infrastructure (here, the UK National Health Service; NHS) could accurately identify the presence and timing of self-harm using electronic health records (EHRs) from secondary mental healthcare. Methods: Clinical notes were drawn from Oxford Health NHS Foundation Trust using a multi-stage workflow: (1) a random sample of 1,000 patients with a psychiatric diagnosis (ICD-10 F00–F99); (2) candidate-note identification using a Gemma3-4b language model to flag notes containing self-harm content; (3) from those candidates, 1,352 randomly sampled notes were selected for expert annotation. The resulting gold-standard corpus is therefore enriched for self-harm content. Each clinical note was annotated for the presence/absence of self-harm and its timing (≤90 days/>90 days/unknown). A privacy-preserving locally served 27-billion-parameter Gemma3 language model (’Gemma3-27b’) was used as the core model. Prompts were systematically developed and refined using a labelled development set to identify self-harm and generate a structured output per clinical record. The performance of Gemma3-27b model was compared against a strong baseline multi-label text classification model based on RoBERTa (Robustly Optimized BERT Pretraining Approach, a transformer-based language model) architecture. Model performance was evaluated using precision, recall, and the F1-score (harmonic mean of precision and recall), with 95% confidence intervals estimated from 1,000 bootstrap samples with replacement. Results: Gemma3-27b outperformed the RoBERTa classifier across all categories, achieving Precision=0.92, Recall=0.92, and F1-score=0.92 for notes containing self-harm, and Precision=0.97, Recall=0.97, and F1-score=0.97 for notes without self-harm. For the 51 notes labelled as recent self-harm in the held-out test set, Gemma3-27b achieved Precision=0.84, Recall=0.75, and F1-score=0.79. The global weighted F1-score of Gemma3-27b across all categories was 0.88, compared to 0.85 for RoBERTa. Conclusions: With systematic prompt development on a labelled development set, but no gradient-based fine-tuning, the current Gemma3-27b language model matched or exceeded a fine-tuned RoBERTa classifier for ascertaining self-harm events and their timing. Aggregate gains were modest, while improvements were largest in the most challenging, lower-frequency timing categories. On a simplified binary recent-versus-other task, RoBERTa performed marginally better, indicating that supervised classifiers remain highly effective when the task is simplified and sufficient labelled data exist. This work demonstrates the technical feasibility of privacy-preserving self-harm detection within a secure NHS research environment.
- Open Access
- 10 June 2025
- Published by Elsevier in Computers in Biology and Medicine
- Vol. 194, 110246
Detecting the clinical features of difficult-to-treat depression using synthetic data from large language models
- 10 June 2025
- Published by Elsevier in Computers in Biology and Medicine
- Vol. 194, 110246
Open AccessDetecting the clinical features of difficult-to-treat depression using synthetic data from large language models
- Open Access
- 1 November 2024
- Published by Elsevier in Artificial Intelligence in Medicine
- Vol. 158, 103009
Developing healthcare language model embedding spaces
- 1 November 2024
- Published by Elsevier in Artificial Intelligence in Medicine
- Vol. 158, 103009
Open AccessDeveloping healthcare language model embedding spaces