Do clinical guidelines consider sex and gender? A text-analysis workflow to find out

Python-Based Text and Data Analysis of European Clinical Practice Guidelines Using Automated Keyword Extraction, Contextual Analysis, Quality Assurance, and Interactive Data Exploration.

Role
Python Development · Text & Data Analysis · Workflow Automation · Quality Assurance · Data Visualization · Interactive Application Development · AI-Assisted Development · Interdisciplinary Collaboration

Built with
Python · RegEx · NLTK · Streamlit

Research Context and Project Overview

Clinical practice guidelines provide an important foundation for evidence-based diagnostic and treatment decisions. An interdisciplinary research project at Bielefeld University investigated the extent to which biological and sociocultural aspects of sex and gender are considered in European clinical practice guidelines for internal medicine.

For this systematic investigation, I developed a Python-based workflow to automate the processing and analysis of clinical practice guidelines. Another key part of my work was developing a quality assurance procedure to support the verification of automated results and their subsequent expert assessment.

I have since revised the original analysis workflow and developed an interactive Streamlit application that demonstrates the processing steps and analysis results using selected clinical practice guidelines.

Detail page of a single initiative, showing its description, the host university and contact details
Detail page of a single initiative, showing its description, the host university and contact details
Interactive map of North Rhine-Westphalia with the participating universities marked as selectable points
Interactive map of North Rhine-Westphalia with the participating universities marked as selectable points
Two complementary entry points. The detail page presents a single initiative with its description, host university and contact details, while the interactive map opens the same content geographically across the participating universities in North Rhine-Westphalia.

Automated Text and Data Analysis

The study required the systematic processing of extensive clinical practice guidelines in PDF format.

To address this, I developed a Python-based analysis workflow to search the documents for predefined sex- and gender-related terms and identify relevant passages.

The implementation comprised three main steps:

  • Keyword extraction: Automated identification of sex- and gender-related terms using regular expressions (RegEx).
  • Contextualization: Segmentation of extracted text into individual sentences using NLTK (sentence tokenization), allowing identified terms to be placed in their surrounding linguistic context.
  • Data analysis: Structured processing of identified matches, calculation of keyword frequencies, and compilation of relevant text passages for subsequent scientific analysis.

Quality Assurance and Expert Contextualization

A key challenge was determining the meaning of automatically identified terms within their medical context. The presence of a keyword alone does not indicate whether or how sex- and gender-related differences are addressed in a clinical practice guideline.

I therefore developed an additional procedure to support the verification and expert contextualization of the automated results.

The procedure combined two complementary forms of presentation:

  • Contextual text excerpts: For each identified match, the corresponding sentence was presented together with the immediately preceding and following sentences.
  • Visual highlighting in the original documents: Identified terms were highlighted directly in the source PDF documents.

These complementary views allowed the medical researchers to compare the extracted information with the original documents, identify potential errors, and assess the meaning of the terms in their respective medical contexts.

The medical assessment and interpretation were carried out by the researchers involved in the project. The procedure supported their work by providing structured and traceable access to the analysis results.

Technical Development and Interactive Application

Following the original research project, I revised the analysis workflow with the assistance of Claude Code and developed an interactive application using Streamlit.

The application demonstrates the analysis process using selected clinical practice guidelines. It provides access to the results of keyword extraction, the corresponding text contexts, and the visually highlighted matches in the original PDF documents.

This makes the individual processing steps and the relationship between automated text analysis and expert quality assurance directly accessible and easier to understand.

Systematic validation of the keyword detection process is planned as a further development step.

Interactive Demo: Explore the Streamlit Application

Research Contribution

The research project combined automated document processing and quantitative text analysis with expert assessment of medical guidelines.

My technical contribution included the development of the Python-based analysis workflow, the structured preparation and quantitative analysis of the data, and the design and implementation of the quality assurance procedure.

The work was carried out in interdisciplinary collaboration with the Sex- and Gender-Sensitive Medicine research group at the Faculty of Medicine, Bielefeld University.

The research led to two publications on which I am a co-author: a systematic review protocol published in 2023 outlining the research design, and a subsequent publication in 2025 addressing the implementation and broader implications of the research.

Publications

  • Designing clinical practice guidelines for equitable, inclusive, and contextualised care. Oertelt-Prigione, S., Naghipour, A., Becher, E. & Gemander, M. (2025). The BMJ, 391, e085684. doi:10.1136/bmj-2025-085684
  • Consideration of sex and gender in European clinical practice guidelines in internal medicine: a systematic review protocol. Naghipour, A., Gemander, M., Becher, E. & Oertelt-Prigione, S. (2023). BMJ Open, 13, e071388. doi:10.1136/bmjopen-2022-071388