{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,1,9]],"date-time":"2026-01-09T18:08:55Z","timestamp":1767982135244,"version":"3.49.0"},"reference-count":49,"publisher":"BMJ","issue":"1","license":[{"start":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T00:00:00Z","timestamp":1760054400000},"content-version":"unspecified","delay-in-days":9,"URL":"http:\/\/creativecommons.org\/licenses\/by-nc\/4.0\/"}],"content-domain":{"domain":["bmj.com"],"crossmark-restriction":true},"short-container-title":["BMJ Open Gastroenterol"],"accepted":{"date-parts":[[2025,8,26]]},"published-print":{"date-parts":[[2025,10]]},"abstract":"<jats:sec>\n                    <jats:title>Objective<\/jats:title>\n                    <jats:p>Natural language processing (NLP) can identify cohorts of patients with inflammatory bowel disease (IBD) from free text. However, limited sharing of code, models, and data sets continues to hinder progress. The aim of this study was to evaluate multiple open-source NLP models for identifying IBD cohorts, reporting on document-to-patient-level classification, while exploring explainability, generalisability, fairness and cost.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec>\n                    <jats:title>Methods<\/jats:title>\n                    <jats:p>15 algorithms were assessed, covering all types of NLP spanning over 50 years of NLP development. Rule-based (regular expressions, spaCy with negation), and vector-based (bag-of-words (BoW), term frequency inverse document frequency (TF IDF), word-2-vector), to transformers: (two sentence-based sBERT models, three bidirectional encoder representations from transformers (BERT) models (distilBERT, BioclinicalBERT, RoBERTa), and five large language models (LLMs): (Mistral-Instruct-v0.3-7B, M42-Health\/Llama-v3-8B, Deepseek-R1-Distill-Qwen-v2.5-32B, Qwen-v3-32B, and Deepseek-R1-Distill-Llama-v3-70B). Models were comparatively evaluated based on full confusion matrices, time\/environmental costs, fairness, and explainability.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec>\n                    <jats:title>Results<\/jats:title>\n                    <jats:p>A total of 9311 labelled documents were evaluated. The fine-tuned DistilBERT_IBD model achieved the best performance overall (micro F1: 93.54%), followed by sBERT-Base (micro F1: 93.05%); however, specificity was an issue for both: (67.80\u201364.41%) respectively. LLMs performed well, given that they had never seen the training data (micro F1: 86.47\u201392.20%), but were comparatively slow (18\u2013300\u2009hours) and expensive. Bias was a significant issue for all effective model types.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec>\n                    <jats:title>Conclusion<\/jats:title>\n                    <jats:p>NLP has undergone significant advancements over the last 50 years. LLMs appear likely to solve the problem of re-identifying patients with IBD from clinical free text sources in the future. Once cost, performance and bias issues are addressed, they and their successors are likely to become the primary method of data retrieval for clinical data warehousing.<\/jats:p>\n                  <\/jats:sec>","DOI":"10.1136\/bmjgast-2025-001977","type":"journal-article","created":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T10:45:27Z","timestamp":1760093127000},"page":"e001977","update-policy":"https:\/\/doi.org\/10.1136\/crossmarkpolicy","source":"Crossref","is-referenced-by-count":1,"title":["Robust comparative evaluation of 15 natural language processing algorithms to positively identify patients with inflammatory bowel disease from secondary care records"],"prefix":"10.1136","volume":"12","author":[{"ORCID":"https:\/\/orcid.org\/0000-0003-3850-3116","authenticated-orcid":false,"given":"Matt","family":"Stammers","sequence":"first","affiliation":[{"name":"Department of Gastroenterology and The Southampton Emerging Therapies and Technologies (SETT) Centre, University Hospital Southampton NHS Foundation Trust, Southampton, UK"},{"name":"University of Southampton Faculty of Medicine, Clinical Informatics Research Unit (CIRU), University of Southampton, Southampton, NHSBT, Southampton General Hospital, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Markus","family":"Gwiggner","sequence":"additional","affiliation":[{"name":"University Hospital Southampton NHS Foundation Trust, Southampton, UK"},{"name":"University of Southampton, Southampton, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Reza","family":"Nouraei","sequence":"additional","affiliation":[{"name":"University of Southampton Faculty of Medicine, Clinical Informatics Research Unit (CIRU), University of Southampton, Southampton, NHSBT, Southampton General Hospital, UK"},{"name":"Queen\u2019s Medical Centre, Nottingham, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Cheryl","family":"Metcalf","sequence":"additional","affiliation":[{"name":"University of Southampton School of Healthcare Enterprise and Innovation, Southampton, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"James","family":"Batchelor","sequence":"additional","affiliation":[{"name":"University of Southampton Faculty of Medicine, Clinical Informatics Research Unit (CIRU), University of Southampton, Southampton, NHSBT, Southampton General Hospital, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"239","published-online":{"date-parts":[[2025,10,10]]},"reference":[{"key":"2026010701055676000_12.1.e001977.1","doi-asserted-by":"publisher","DOI":"10.1016\/S0140-6736(07)60751-X"},{"key":"2026010701055676000_12.1.e001977.2","doi-asserted-by":"publisher","DOI":"10.1053\/j.gastro.2007.09.001"},{"key":"2026010701055676000_12.1.e001977.3","first-page":"1","article-title":"Identification of Cohorts with Inflammatory Bowel Disease Amidst Fragmented Clinical Databases via Machine Learning","volume":"13","author":"Stammers","year":"2025","journal-title":"Dig Dis Sci"},{"key":"2026010701055676000_12.1.e001977.4","doi-asserted-by":"crossref","DOI":"10.1056\/AIcs2400360","article-title":"Zero-Shot Clinical Trial Patient Matching with LLMs","volume":"2","author":"Wornow","year":"2025","journal-title":"NEJM AI"},{"key":"2026010701055676000_12.1.e001977.5","doi-asserted-by":"crossref","DOI":"10.1186\/s12876-025-03608-5","article-title":"A foundation systematic review of natural language processing applied to gastroenterology & hepatology","volume":"25","author":"Stammers","year":"2025","journal-title":"BMC Gastroenterol"},{"key":"2026010701055676000_12.1.e001977.6","doi-asserted-by":"publisher","DOI":"10.1145\/361219.361220"},{"key":"2026010701055676000_12.1.e001977.7","unstructured":"McCallum A , Nigam K . A comparison of event models for naive bayes text classification. 1998. Available: https:\/\/www.semanticscholar.org\/paper\/A-comparison-of-event-models-for-naive-bayes-text-McCallum-Nigam\/04ce064505b1635583fa0d9cc07cac7e9ea993cc"},{"key":"2026010701055676000_12.1.e001977.8","doi-asserted-by":"publisher","DOI":"10.1016\/0306-4573(88)90021-0"},{"key":"2026010701055676000_12.1.e001977.9","doi-asserted-by":"publisher","DOI":"10.1613\/jair.2934"},{"key":"2026010701055676000_12.1.e001977.10","doi-asserted-by":"publisher","DOI":"10.1002\/(SICI)1097-4571(199009)41:6<391::AID-ASI1>3.0.CO;2-9"},{"key":"2026010701055676000_12.1.e001977.11","unstructured":"Vaswani A , Shazeer N , Parmar N , et al . Attention is all you need. Adv Neural Inf Proc Syst, Curran Associates, Inc; 2017. Available: https:\/\/proceedings.neurips.cc\/paper_files\/paper\/2017\/hash\/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html"},{"key":"2026010701055676000_12.1.e001977.12","unstructured":"Devlin J , Chang MW , Lee K , et al . BERT: pre-training of deep bidirectional transformers for language understanding. arXiv 2019. Available: http:\/\/arxiv.org\/abs\/1810.04805"},{"key":"2026010701055676000_12.1.e001977.13","unstructured":"Radford A , Narasimhan K , Salimans T , et al . Improving language understanding by generative pre-training. Comp Sci Linguistics 2018."},{"key":"2026010701055676000_12.1.e001977.14","unstructured":"Sanh V , Debut L , Chaumond J , et al . DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv 2020. Available: http:\/\/arxiv.org\/abs\/1910.01108 https:\/\/www.semanticscholar.org\/paper\/Improving-Language-Understanding-by-Generative-Radford-Narasimhan\/cd18800a0fe0b668a1cc19f2ec95b5003d0a5035"},{"key":"2026010701055676000_12.1.e001977.15","unstructured":"Liu Y , Ott M , Goyal N , et al . RoBERTa: a robustly optimized BERT pretraining approach. arXiv 2019. Available: http:\/\/arxiv.org\/abs\/1907.11692"},{"key":"2026010701055676000_12.1.e001977.16","doi-asserted-by":"crossref","unstructured":"Alsentzer E , Murphy JR , Boag W , et al . Publicly available clinical BERT embeddings. arXiv 2019. Available: http:\/\/arxiv.org\/abs\/1904.03323","DOI":"10.18653\/v1\/W19-1909"},{"key":"2026010701055676000_12.1.e001977.17","doi-asserted-by":"publisher","DOI":"10.1007\/s11023-020-09548-1"},{"key":"2026010701055676000_12.1.e001977.18","unstructured":"Nori H , Lee YT , Zhang S , et al . Can generalist foundation models outcompete special-purpose tuning? Case study in medicine. arXiv 2023. Available: http:\/\/arxiv.org\/abs\/2311.16452"},{"key":"2026010701055676000_12.1.e001977.19","unstructured":"Jiang AQ , Sablayrolles A , Roux A , et al . Mixtral of experts. arXiv 2024. Available: http:\/\/arxiv.org\/abs\/2401.04088"},{"key":"2026010701055676000_12.1.e001977.20","unstructured":"Christophe C , Kanithi PK , Raha T , et al . Med42-v2: a suite of clinical LLMs. arXiv 2024. Available: http:\/\/arxiv.org\/abs\/2408.06142"},{"key":"2026010701055676000_12.1.e001977.21","unstructured":"DeepSeek-AI GD , Yang D , Zhang H , et al . DeepSeek-R1: incentivizing reasoning capability in LLMs via reinforcement learning. arXiv 2025. Available: http:\/\/arxiv.org\/abs\/2501.12948"},{"key":"2026010701055676000_12.1.e001977.22","unstructured":"Zheng X , Li Y , Chu H , et al . An empirical study of Qwen3 quantization. arXiv 2025. Available: http:\/\/arxiv.org\/abs\/2505.02214"},{"key":"2026010701055676000_12.1.e001977.23","doi-asserted-by":"crossref","DOI":"10.1136\/bmj-2023-078378","article-title":"TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods","volume":"385","author":"Collins","year":"2024","journal-title":"BMJ"},{"key":"2026010701055676000_12.1.e001977.24","doi-asserted-by":"publisher","DOI":"10.7326\/M14-0697"},{"key":"2026010701055676000_12.1.e001977.25","doi-asserted-by":"crossref","unstructured":"Sun X , Li X , Li J , et al . Text classification via large language models. arXiv 2023. Available: http:\/\/arxiv.org\/abs\/2305.08377","DOI":"10.18653\/v1\/2023.findings-emnlp.603"},{"key":"2026010701055676000_12.1.e001977.26","doi-asserted-by":"crossref","first-page":"555","DOI":"10.1177\/09622802231151220","article-title":"Minimum sample size for developing a multivariable prediction model using multinomial logistic regression","volume":"32","author":"Pate","year":"2023","journal-title":"Stat Methods Med Res"},{"key":"2026010701055676000_12.1.e001977.27","doi-asserted-by":"publisher","DOI":"10.1016\/j.jbi.2011.12.010"},{"key":"2026010701055676000_12.1.e001977.28","doi-asserted-by":"publisher","DOI":"10.1016\/j.jclinepi.2009.11.009"},{"key":"2026010701055676000_12.1.e001977.29","unstructured":"Goel N , Yaghini M , Faltings B . Non-discriminatory machine learning through convex fairness criteria. AAAI Conf Art Int. Available: https:\/\/ojs.aaai.org\/index.php\/AAAI\/article\/view\/11662"},{"key":"2026010701055676000_12.1.e001977.30","unstructured":"Hardt M , Price E , Price E , et al . Equality of opportunity in supervised learning. Adv Neural Inf Proc Syst, Curran Associates, Inc; 2016. Available: https:\/\/proceedings.neurips.cc\/paper_files\/paper\/2016\/hash\/9d2682367c3935defcb1f9e247a97c0d-Abstract.html"},{"key":"2026010701055676000_12.1.e001977.31","doi-asserted-by":"crossref","unstructured":"Zafar MB , Valera I , Gomez Rodriguez M , et al . Fairness beyond disparate treatment & disparate impact: learning classification without disparate mistreatment. Proceedings of the 26th international conference on world wide web. Republic and Canton of Geneva, CHE: International world wide web conferences steering committee, (WWW \u201917); 2017:1171\u201380. Available: https:\/\/doi.org\/10.1145\/3038912.3052660","DOI":"10.1145\/3038912.3052660"},{"key":"2026010701055676000_12.1.e001977.32","unstructured":"CodeCarbon \u2014 CodeCarbon 3.0.1 documentation. Available: https:\/\/mlco2.github.io\/codecarbon\/ [Accessed 12 May 2025]."},{"key":"2026010701055676000_12.1.e001977.33","unstructured":"GOV.UK . Greenhouse gas reporting: conversion factors 2024. 2024. Available: https:\/\/www.gov.uk\/government\/publications\/greenhouse-gas-reporting-conversion-factors-2024 [Accessed 13 May 2025]."},{"key":"2026010701055676000_12.1.e001977.34","unstructured":"Mosca E , Szigeti F , Tragianni S , et al . SHAP-based explanation methods: a review for NLP interpretability. In: Calzolari N , Huang CR , Kim H , et al , eds. Proc 29th Int Conf Comp Ling. Gyeongju, Republic of Korea: international committee on computational linguistics. 2022: 4593\u2013603. Available: https:\/\/aclanthology.org\/2022.coling-1.406\/"},{"key":"2026010701055676000_12.1.e001977.35","doi-asserted-by":"publisher","DOI":"10.1007\/s10115-013-0679-x"},{"key":"2026010701055676000_12.1.e001977.36","doi-asserted-by":"crossref","unstructured":"Ribeiro MT , Singh S , Guestrin C . \u2018Why should I trust you?\u2019: explaining the predictions of any classifier. arXiv 2016. Available: http:\/\/arxiv.org\/abs\/1602.04938","DOI":"10.1145\/2939672.2939778"},{"key":"2026010701055676000_12.1.e001977.37","doi-asserted-by":"crossref","first-page":"2400304","DOI":"10.1002\/aisy.202400304","article-title":"A Perspective on Explainable Artificial Intelligence Methods: SHAP and LIME","volume":"7","author":"Salih","year":"2025","journal-title":"Adv Intell Syst"},{"key":"2026010701055676000_12.1.e001977.38","doi-asserted-by":"crossref","unstructured":"Reimers N , Gurevych I . Sentence-BERT: sentence embeddings using siamese BERT-Networks. arXiv 2019. Available: http:\/\/arxiv.org\/abs\/1908.10084","DOI":"10.18653\/v1\/D19-1410"},{"key":"2026010701055676000_12.1.e001977.39","doi-asserted-by":"crossref","unstructured":"Deka P , Jurek-Loughrey A , Deepak P . Evidence extraction to validate medical claims in fake news detection. In: Traina A , Wang H , Zhang Y , et al ., eds. Health Inf Sci. Cham: Springer Nature Switzerland, 2022: 3\u201315.","DOI":"10.1007\/978-3-031-20627-6_1"},{"key":"2026010701055676000_12.1.e001977.40","doi-asserted-by":"crossref","unstructured":"Gururangan S , Marasovi\u0107 A , Swayamdipta S , et al . Don\u2019t stop pretraining: adapt language models to domains and tasks. arXiv 2020. Available: http:\/\/arxiv.org\/abs\/2004.10964","DOI":"10.18653\/v1\/2020.acl-main.740"},{"key":"2026010701055676000_12.1.e001977.41","doi-asserted-by":"crossref","unstructured":"Schmidt L , Ibing S , Borchert F , et al . Automating clinical phenotyping using natural language processing: an application for crohn\u2019s disease. medRxiv 2024. doi:10.1101\/2023.10.16.23297099","DOI":"10.1101\/2023.10.16.23297099"},{"key":"2026010701055676000_12.1.e001977.42","doi-asserted-by":"publisher","DOI":"10.1136\/amiajnl-2013-001935"},{"key":"2026010701055676000_12.1.e001977.43","unstructured":"NHS Transformation Directorate . Secure data environments (SDEs). Available: https:\/\/transform.england.nhs.uk\/key-tools-and-info\/data-saves-lives\/secure-data-environments\/ [Accessed 22 Sep 2023]."},{"key":"2026010701055676000_12.1.e001977.44","doi-asserted-by":"crossref","unstructured":"Mahapatra J , Garain U . Impact of model size on fine-tuned LLM performance in data-to-text generation: a state-of-the-art investigation. arXiv 2024. Available: http:\/\/arxiv.org\/abs\/2407.14088","DOI":"10.2139\/ssrn.4916435"},{"key":"2026010701055676000_12.1.e001977.45","unstructured":"Hugging Face . mistralai\/Mistral-7B-Instruct-v0.3, Available: https:\/\/huggingface.co\/mistralai\/Mistral-7B-Instruct-v0.3 [Accessed 21 May 2025]."},{"key":"2026010701055676000_12.1.e001977.46","unstructured":"Hugging Face . m42-health\/Llama3-Med42-8B, 2024. Available: https:\/\/huggingface.co\/m42-health\/Llama3-Med42-8B [Accessed 21 May 2025]."},{"key":"2026010701055676000_12.1.e001977.47","unstructured":"Hugging Facecc . deepseek-ai\/DeepSeek-R1-Distill-Qwen-32B. 2025. Available: https:\/\/huggingface.co\/deepseek-ai\/DeepSeek-R1-Distill-Qwen-32B [Accessed 21 May 2025]."},{"key":"2026010701055676000_12.1.e001977.48","unstructured":"Hugging Face . Qwen\/Qwen3-32B. 2025. Available: https:\/\/huggingface.co\/Qwen\/Qwen3-32B [Accessed 21 May 2025]."},{"key":"2026010701055676000_12.1.e001977.49","unstructured":"Hugging Face . deepseek-ai\/DeepSeek-R1-Distill-Llama-70B, 2025. Available: https:\/\/huggingface.co\/deepseek-ai\/DeepSeek-R1-Distill-Llama-70B [Accessed 21 May 2025]."}],"container-title":["BMJ Open Gastroenterology"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/syndication.highwire.org\/content\/doi\/10.1136\/bmjgast-2025-001977","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,1,7]],"date-time":"2026-01-07T09:06:38Z","timestamp":1767776798000},"score":1,"resource":{"primary":{"URL":"https:\/\/bmjopengastro.bmj.com\/lookup\/doi\/10.1136\/bmjgast-2025-001977"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,10]]},"references-count":49,"journal-issue":{"issue":"1","published-online":{"date-parts":[[2025,10,10]]},"published-print":{"date-parts":[[2025,10]]}},"alternative-id":["10.1136\/bmjgast-2025-001977"],"URL":"https:\/\/doi.org\/10.1136\/bmjgast-2025-001977","relation":{},"ISSN":["2054-4774"],"issn-type":[{"value":"2054-4774","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,10]]}}}