[96a5a0]: / README.md

Download this file

112 lines (83 with data), 3.3 kB

ClearMatch

A Python tool for the structured analysis of clinical trial eligibility criteria by extracting and organizing atomic criteria into logical structures.

πŸš€ Overview

ClearMatch processes clinical trial data from ClinicalTrials.gov, extracting structured information about eligibility criteria. It performs three key steps:

  1. Identification – Extracts atomic criteria from raw text.
  2. Logical Structuring – Organizes these criteria using logical relationships (AND, OR, NOT, XOR, CONDITIONAL).
  3. Matching Patients to Oncological Clinical Trials – (Planned but not yet implemented).

βœ… Features

  • βœ… Fetches clinical trial data from the ClinicalTrials.gov API.
  • βœ… Extracts and structures eligibility criteria into logical expressions.
  • βœ… Persists processed data as JSON files for further analysis.
  • 🚧 Upcoming: Automated patient matching system.
  • 🚧 Upcoming: UI.

πŸ“‹ Requirements

  • Python 3.13+
  • OpenAI API key (for GPT-4o access)
    πŸ“Œ Get your API key here: OpenAI API Keys

πŸ’Ύ Installation

1️⃣ Clone the repository

   gh repo clone judacas/Clinical-Trial-Prompts
   ```

   _This uses [GitHub CLI](https://cli.github.com/). If you don’t have it, use:_

   ```sh
   git clone https://github.com/judacas/Clinical-Trial-Prompts.git
   ```
make sure to then cd into the root directory
```sh
cd Clinical-Trial-Prompts

2️⃣ **Set up a virtual environment (Optional but Recommended) **

python -m venv .venv
source .venv/bin/activate  # macOS/Linux
.venv\Scripts\activate     # Windows

3️⃣ Install dependencies

pip install -r requirements.txt

4️⃣ Set up environment variables
Copy the example sample.env file and rename it to proper .env naming convention:

cp src/sample.env src/.env  # macOS/Linux
copy src\sample.env src\.env  # Windows

To edit the .env file in the terminal, use:

nano src/.env  # Linux/macOS
notepad src\.env  # Windows

Then, add your OpenAI API key:

OPENAI_API_KEY="your-api-key-here"

πŸ“Œ Note: The .env file is ignored by Git to prevent accidental key exposure.


πŸ›  Usage

Run ClearMatch using:

python -m src.main

Follow the command-line instructions to process and structure clinical trial data.


πŸ“Š Data Flow

  1. Fetch raw trial data from ClinicalTrials.gov.
  2. Identify the atomic eligibility criteria in the selected trials.
  3. Structure criteria using logical operators (AND, OR, etc.).
  4. Store results as structured JSON files in output/ subdirectory for further use.

πŸ’‘ Future Plans

  • πŸ”Ή Add automated patient-trial matching.
  • πŸ”Ή Implement an API to allow external applications to query structured trial data.
  • πŸ”Ή Optimize logical structuring for better accuracy.

🀝 Contributions

Contributions are welcome! Please open an issue or submit a pull request.


πŸ“œ License

This project is licensed under the MIT License.