MedGen: A Python Natural Language Processing Toolkit for Medical Text Processing

Rui Yang, Qingcheng Zeng, Keen You, Yujie Qiao, Lucas Huang, Chiachun Hsieh, Benjamin Rosand, Jeremy Goldwasser, Amisha D. Dave, Tiarnan D. L. Keenan, Emily Y. Chew, Dragomir Radev, Zhiyong Lu, Hua Xu, Qingyu Chen, Irene LiarXiv 2023 · DOI

Introduction

The rapid advancement of Natural Language Processing (NLP) in the medical domain often remains inaccessible to healthcare professionals due to high technical barriers. While extractive NLP tasks—such as identifying symptoms or drug names—are well-supported by existing toolkits like scispaCy, generative tasks like medical text summarization, simplification, and question-answering lack a unified, user-friendly framework. This paper introduces Ascle, an all-in-one Python toolkit designed to bridge this gap by providing a low-code interface for state-of-the-art medical text generation.

Methods

The Ascle toolkit is structured around three primary modules designed to handle a wide range of clinical NLP requirements:

  1. Generative Functions: The core of the toolkit, supporting Question-Answering (QA), Text Summarization, Text Simplification, and Machine Translation.
  2. Basic NLP Functions: Integration of 12 utility tasks, including negation detection, abbreviation extraction, and named entity recognition (NER), leveraging libraries like scispaCy and Stanza.
  3. Query and Search Module: Facilitates interaction with clinical databases (e.g., MIMIC-III) through SQL and keyword search capabilities.
Overview of the Ascle toolkit architecture, highlighting the Generative, Basic NLP, and Query/Search modules.

To ensure high performance, the researchers fine-tuned 32 domain-specific language models, optimizing architectures such as BART, T5, and PubMedBERT specifically for medical nuances rather than relying on general-purpose models.

Datasets and Evaluation

The toolkit's efficacy was validated across 24 established benchmarks. Key datasets included Head-QA and MedMCQA for question-answering; PubMed and MIMIC-CXR for summarization; and eLife, PLOS, and MedLane for text simplification. Translation capabilities were tested using the UFAL Medical Corpus across 17 languages.

Results

Evaluation results demonstrate significant improvements across multiple generative tasks. In machine translation, fine-tuning resulted in BLEU score increases of up to 20.27 points. Manual clinician reviews further validated the toolkit, with high scores for readability (4.95/5) and relevancy (4.43/5).

Performance comparison of various models on summarization (ROUGE scores) and text simplification (FKGL scores) across eLife, PLOS, and MedLane datasets.

As shown in the results, BART-based models consistently excelled in summarization tasks. Furthermore, the toolkit successfully reduced the reading grade level of complex medical texts, as evidenced by the Flesch-Kincaid Grade Level (FKGL) scores, making professional medical information more accessible to patients.

Discussion and Limitations

Ascle emphasizes the importance of synthesis in medical NLP. By utilizing smaller, fine-tuned models like BioBART, the toolkit offers a cost-efficient alternative to massive Large Language Models (LLMs) that can be run locally, preserving patient data privacy.

However, challenges remain. While generated outputs are highly readable, they occasionally lack "Completeness" (scoring 3.31/5 in clinician reviews), missing specific nuances present in ground-truth data. Additionally, the risk of "hallucinations" or unfaithful content necessitates that the toolkit be used as a clinical aid rather than a replacement for professional judgment. Future work will focus on integrating larger medical LLMs while maintaining factual grounding and mitigating bias.

Conclusion

The Ascle toolkit provides a comprehensive, accessible framework for medical text generation, empowering clinical researchers with advanced NLP capabilities. The toolkit and its fine-tuned models are publicly available to foster further innovation in the field.

Summary updated

BibTeX
@misc{yang2023medgen,
  author = {Rui Yang and Qingcheng Zeng and Keen You and Yujie Qiao and Lucas Huang and Chiachun Hsieh and Benjamin Rosand and Jeremy Goldwasser and Amisha D. Dave and Tiarnan D. L. Keenan and Emily Y. Chew and Dragomir Radev and Zhiyong Lu and Hua Xu and Qingyu Chen and Irene Li},
  title = {{MedGen: A Python Natural Language Processing Toolkit for Medical Text Processing}},
  year = {2023},
  eprint = {2311.16588},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.16588},
}
Figure