Ascle—A Python Natural Language Processing Toolkit for Medical Text Generation: Development and Evaluation Study

Rui Yang, Qingcheng Zeng, Keen You, Yujie Qiao, Lucas Huang, Chia-Chun Hsieh, Benjamin Rosand, Jeremy Goldwasser, Amisha Dave, Tiarnán D L Keenan, Yuhe Ke, Chuan Hong, Nan Liu, Emily Y. Chew, Dragomir Radev, Zhiyong Lu, Hua Xu, Qingyu Chen, Irene LiJournal of Medical Internet Research 2024

Abstract

This study introduces the development and evaluation of Ascle, a user-friendly NLP toolkit designed for medical text generation. All code is publicly available through the Ascle GitHub repository. All fine-tuned language models can be accessed through Hugging Face.

Introduction

The biomedical field has seen a surge in Natural Language Processing (NLP) tools, yet a significant gap remains. Most existing libraries, such as ScispaCy or MedspaCy, focus primarily on extractive tasks—identifying entities, detecting negation, or linking terms to databases. There is a notable "void" in generative capabilities, such as creating clinical note summaries, simplifying medical jargon for patients, or providing reliable long-form answers to medical queries.

Ascle is a new, all-in-one Python toolkit designed to bridge this gap. It brings advanced medical text generation to researchers and clinicians with minimal coding experience. By integrating 32 fine-tuned models and a novel Retrieval-Augmented Generation (RAG) framework, Ascle democratizes complex "black-box" Large Language Models (LLMs) for practical clinical applications.

Comparison of Ascle with existing medical NLP toolkits, highlighting its unique focus on generative tasks.

System Architecture and Methods

Ascle is built as a modular toolkit consisting of three primary components:

  1. Generative Functions: The core of the toolkit includes 32 domain-specific language models (based on BART, T5, and LLaMA) fine-tuned for four key tasks: Question-Answering (QA), Text Summarization, Text Simplification, and Machine Translation.
  2. RAG Framework (KG-Rank): To enhance the QA module, the authors implemented a Retrieval-Augmented Generation pipeline. This system extracts medical entities from queries, retrieves relevant "triplets" (concept-relation-concept) from the Unified Medical Language System (UMLS), and uses ranking techniques to provide the model with pertinent context, reducing hallucinations.
  3. Basic NLP & Database Modules: Ascle maintains "all-in-one" utility by including 12 standard NLP functions (e.g., abbreviation extraction, POS tagging) and a module for querying clinical databases like MIMIC-III via MySQL.
The modular architecture of Ascle, featuring Generative Functions, a Query and Search Module, and Basic NLP Functions.

Evaluation and Results

The researchers evaluated Ascle across 27 established benchmarks, including LiveQA and ExpertQA for question answering, PubMed and MIMIC-CXR for summarization, and the UFAL Medical Corpus for translation.

Key Performance Metrics

  • QA Performance: The RAG framework achieved an 18% increase in ROUGE-L scores over vanilla models on the ExpertQA-Bio dataset.
  • Translation: Fine-tuned models improved machine translation tasks by an average of 20.27 BLEU points. Specifically, English-to-French translation scores improved by over 61% compared to general-purpose models.
  • Physician Validation: In a blind test of 50 QA pairs, medical professionals rated the outputs highly for Readability (4.95/5) and Relevancy (4.43/5). While Completeness (3.31/5) showed room for improvement, the results demonstrate high clinical utility.
  • Usability: Clinicians with varying technical backgrounds successfully deployed the toolkit in approximately 10 minutes.

Discussion: Insights and Limitations

A critical finding was the "ROUGE Paradox" in summarization. While extractive models like TextRank sometimes score higher on automated ROUGE metrics, qualitative analysis revealed they often produce "noisy" text fragments. In contrast, Ascle's generative models (like BART) created coherent, readable summaries, emphasizing the need for human-centric evaluation in medicine. Furthermore, the use of UMLS knowledge graphs proved essential as "reliability anchors," significantly reducing the risk of model hallucinations.

Despite these successes, the study acknowledges limitations. Automated metrics (ROUGE/BLEU) do not always capture factual correctness. Additionally, human evaluation was restricted to a subset of the QA task due to resource constraints.

Conclusion

Ascle represents a significant step toward making advanced generative NLP accessible in the medical domain. Future work will focus on incorporating larger LLMs, expanding real-world clinical dataset evaluations, and undergoing rigorous ethical reviews to ensure safety and lack of bias in clinical decision support.

Summary updated

BibTeX
@article{yang2024asclea,
  author = {Rui Yang and Qingcheng Zeng and Keen You and Yujie Qiao and Lucas Huang and Chia-Chun Hsieh and Benjamin Rosand and Jeremy Goldwasser and Amisha Dave and Tiarnán D L Keenan and Yuhe Ke and Chuan Hong and Nan Liu and Emily Y. Chew and Dragomir Radev and Zhiyong Lu and Hua Xu and Qingyu Chen and Irene Li},
  title = {{Ascle—A Python Natural Language Processing Toolkit for Medical Text Generation: Development and Evaluation Study}},
  journal = {Journal of Medical Internet Research},
  year = {2024},
  doi = {10.2196/60601},
}
Figure