Clinical named entity recognition in the Portuguese language: a benchmark of modern BERT models and LLMs
DOI:
https://doi.org/10.59681/2175-4411.v18.iEspecial.2026.1781Keywords:
machine learning, natural language processing, neural networks, computerAbstract
Objective: To evaluate BERT models and large language models (LLMs) for named entity recognition (NER) in Portuguese clinical text and assess strategies to address multilabel imbalance. Method: We compared BioBERTpt, BERTimbau, ModernBERT, and mmBERT with LLMs (GPT-5 and Gemini-2.5) using the SemClinBr corpus and a private breast cancer dataset. Models were trained under standardized conditions and evaluated using precision, recall, and F1-score. Iterative stratification, weighted loss, and oversampling were explored. Results: mmBERT-base achieved the best performance (micro F1 = 0.76), outperforming all other models. Iterative stratification improved class balance and overall results. Conclusion: Multilingual BERT models, particularly mmBERT, are effective for Portuguese clinical NER and can run locally with limited resources. Data balancing strategies further enhance performance.
Downloads
References
1. Sedlakova J, Daniore P, Horn Wintsch A, Wolf M, Stanikic M, Haag C, et al. Challenges and best practices for digital unstructured data enrichment in health research: A systematic narrative review. PLOS Digit Health. 2023;2(10):e0000347. doi: https://doi.org/10.1371/journal.pdig.0000347
2. Nesca M, Katz A, Leung CK, Lix LM. A scoping review of preprocessing methods for unstructured text data to assess data quality. Int J Popul Data Sci. 2022;7(1):1757. doi: https://doi.org/10.23889/ijpds.v7i1.1757
3. Alafari F, Driss M, Cherif A. Advances in natural language processing for healthcare: A comprehensive review of techniques, applications, and future directions. Comput Sci Rev. 2025;56:100725. doi: https://doi.org/10.1016/j.cosrev.2025.100725
4. Kocaman V, Talby D. Accurate Clinical and Biomedical Named Entity Recognition at Scale. Softw Impacts. 2022;13:100373. doi: https://doi.org/10.1016/j.simpa.2022.100373
5. Monajatipoor M, Yang J, Stremmel J, Emami M, Mohaghegh F, Rouhsedaghat M, et al. LLMs in Biomedicine: A study on clinical Named Entity Recognition. arXiv [Preprint]. 2024. doi: https://doi.org/10.48550/arXiv.2404.07376
6. Liu S, McCoy AB, Wright A. Improving large language model applications in biomedicine with retrieval-augmented generation: a systematic review, meta-analysis, and clinical development guidelines. J Am Med Inform Assoc. 2025;32(4):605-15. doi: https://doi.org/10.1093/jamia/ocaf008
7. Kell G, Roberts A, Umansky S, Qian L, Ferrari D, Soboczenski F, et al. Question answering systems for health professionals at the point of care-a systematic review. J Am Med Inform Assoc. 2024;31(4):1009-24. doi: https://doi.org/10.1093/jamia/ocae015
8. Nunes RO, Balreira DG, Spritzer AS, Freitas CMDS. A Named Entity Recognition Approach for Portuguese Legislative Texts Using Self-Learning. In: Proceedings of the 16th International Conference on Computational Processing of Portuguese (PROPOR 2024), Vol. 1; 2024 Mar; Santiago de Compostela, Spain. Stroudsburg (PA): Association for Computational Linguistics; 2024. p. 290-300. [cited 2026 Oct 13]. Available from: https://aclanthology.org/2024.propor-1.30
9. Abilio R, Coelho GP, da Silva AEA. Evaluating Named Entity Recognition: A comparative analysis of mono- and multilingual transformer models on a novel Brazilian corporate earnings call transcripts dataset. Appl Soft Comput. 2024;166:112158. doi: https://doi.org/10.1016/j.asoc.2024.112158
10. Monteiro M, Zanchettin C. Optimization Strategies for BERT-Based Named Entity Recognition. In: Anais da XII Brazilian Conference on Intelligent Systems (BRACIS); 2023; Belo Horizonte, Brazil. Porto Alegre: Sociedade Brasileira de Computação; 2023. p. 80-94. [cited 2026 Oct 13]. Available from: https://sol.sbc.org.br/index.php/bracis/article/view/28408
11. Marone M, Weller O, Fleshman W, Yang E, Lawrie D, Van Durme B. mmBERT: A Modern Multilingual Encoder with Annealed Language Learning. arXiv [Preprint]. 2025. doi: https://doi.org/10.48550/arXiv.2509.06888
12. Deng C, Zhao Y, Tang X, Gerstein M, Cohan A. Investigating Data Contamination in Modern Benchmarks for Large Language Models. In: Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers); 2024 Jun; Mexico City, Mexico. Stroudsburg (PA): Association for Computational Linguistics; 2024. p. 8706-19. doi: https://doi.org/10.18653/v1/2024.naacl-long.482
13. Dong Y, Jiang X, Liu H, Jin Z, Gu B, Yang M, et al. Generalization or Memorization: Data Contamination and Trustworthy Evaluation for Large Language Models. In: Findings of the Association for Computational Linguistics: ACL 2024; 2024 Aug; Bangkok, Thailand. Stroudsburg (PA): Association for Computational Linguistics; 2024. p. 12039-50. doi: https://doi.org/10.18653/v1/2024.findings-acl.716
14. Oliveira LESE, Peters AC, da Silva AMP, Gebeluca CP, Gumiel YB, Cintho LMM, et al. SemClinBr - a multi-institutional and multi-specialty semantically annotated corpus for Portuguese clinical NLP tasks. J Biomed Semantics. 2022;13(1):13. doi: https://doi.org/10.1186/s13326-022-00269-1
15. Lindberg DA, Humphreys BL, McCray AT. The Unified Medical Language System. Methods Inf Med. 1993;32(4):281-91. doi: https://doi.org/10.1055/s-0038-1634945
16. scikit-learn developers. sklearn.metrics: scikit-learn 1.9.1 documentation [Internet]. 2026 [cited 2026 Oct 13]. Available from: https://scikit-learn.org/stable/api/sklearn.metrics.html
17. Devlin J, Chang MW, Lee K, Toutanova K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In: Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers); 2019 Jun; Minneapolis, Minnesota. Stroudsburg (PA): Association for Computational Linguistics; 2019. p. 4171-86. doi: https://doi.org/10.18653/v1/N19-1423
18. Schneider ETR, de Souza JVA, Knafou J, Oliveira LESE, Copara J, Gumiel YB, et al. BioBERTpt - A Portuguese Neural Language Model for Clinical Named Entity Recognition. In: Proceedings of the 3rd Clinical Natural Language Processing Workshop; 2020 Nov; Online. Stroudsburg (PA): Association for Computational Linguistics; 2020. p. 65-72. doi: https://doi.org/10.18653/v1/2020.clinicalnlp-1.7
19. Danu MD, Marica G, Suciu C, Itu LM, Farri O. Multilingual Clinical NER for Diseases and Medications Recognition in Cardiology Texts using BERT Embeddings. arXiv [Preprint]. 2025. doi: https://doi.org/10.48550/arXiv.2510.17437
20. Tiwari SS, Goyal HR, Adnan MM, Shrivastava A, Yadav K, Rao ALN. Clinical Text Analysis with Natural Language Processing: A BERT-based Approach. In: 2024 International Conference on Communication, Computer Sciences and Engineering (IC3SE); 2024 May 9; Gautam Buddha Nagar, India. [place unknown]: IEEE; 2024. p. 1382-8. doi: https://doi.org/10.1109/IC3SE62002.2024.10593504
21. Warner B, Chaffin A, Clavié B, Weller O, Hallström O, Taghadouini S, et al. Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference. In: Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers); 2025 Jul; Vienna, Austria. Stroudsburg (PA): Association for Computational Linguistics; 2025. p. 2526-47. doi: https://doi.org/10.18653/v1/2025.acl-long.127
22. Souza F, Nogueira R, Lotufo R. BERTimbau: Pretrained BERT Models for Brazilian Portuguese. In: Cerri R, Prati RC, editors. Intelligent Systems. BRACIS 2020. Lecture Notes in Computer Science, vol. 12319. Cham: Springer; 2020. p. 403-17. doi: https://doi.org/10.1007/978-3-030-61377-8_28
23. Agrawal LA, Tan S, Soylu D, Ziems N, Khare R, Opsahl-Ong K, et al. GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning. arXiv [Preprint]. 2026. doi: https://doi.org/10.48550/arXiv.2507.19457
24. Belcak P, Heinrich G, Diao S, Fu Y, Dong X, Muralidharan S, et al. Small Language Models are the Future of Agentic AI. arXiv [Preprint]. 2025. doi: https://doi.org/10.48550/arXiv.2506.02153
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Vinicius Anjos de Almeida, Sandro Saorin da Silva, Nicolas Henrique Borges, Leonardo Vicenzi, Helena Kociolek, Sarah Miriã de Castro Rocha, Frederico Nassif Gomes, Julia Cristina Ferreira, Oge Marques, Lucas Emanuel Silva e Oliveira

This work is licensed under a Creative Commons Attribution 4.0 International License.