CoolFace
Apppublic

mwmathis/ClinicalTrialMatcher_HF

sourceHugging Facemitupdated 3mo agoView on Hugging Face
4likes
App README

๐Ÿ”ฌ Clinical Trial Matcher

Search and filter clinical trials from ClinicalTrials.gov with AI-powered ranking.

Features

  • โ€”๐Ÿ” Keyword Search: Search clinical trials by disease, condition, or treatment
  • โ€”๐ŸŒ Country Filter: Filter trials by country/location
  • โ€”๐Ÿ“Š Status Filter: Filter by recruitment status (Recruiting, Completed, etc.)
  • โ€”๐Ÿค– AI-Powered Ranking: Use Hugging Face LLMs (like DeepSeek-V3.2) to intelligently rank results by relevance
  • โ€”๐Ÿ“‹ Detailed Results: View inclusion/exclusion criteria, sponsor information, and more

How to Use

  1. 1.Enter search keywords (e.g., "cancer", "diabetes", "PDAC")
  2. 2.Optionally filter by country (default: Germany)
  3. 3.Optionally filter by recruitment status
  4. 4.Click "Search Clinical Trials"
  5. 5.After results appear, optionally enter ranking terms and click "Rank Results" for AI-powered relevance ranking

AI-Powered Ranking

After your initial search, you can use AI to rank results by relevance:

  • โ€”Enter specific terms you want to prioritize (e.g., "KRAS mutation", "immunotherapy")
  • โ€”Click "Rank Results" to reorder studies by AI-determined relevance
  • โ€”The model analyzes each study's title, summary, conditions, and inclusion criteria

Setup for Hugging Face Spaces

Required Files

  1. 1.app.py - Main Gradio application (already provided)
  2. 2.llm_service.py - LLM service for ranking (copy from backend/llm_service.py)
  3. 3.requirements.txt - Python dependencies (use requirements_gradio.txt)

Environment Variables (Secrets)

Add these in your Space settings โ†’ Secrets:

  • โ€”HUGGINGFACE_API_TOKEN - Your Hugging Face API token (required for ranking)
  • โ€”USE_HF_API - Set to true to use Hugging Face Inference API
  • โ€”DEEPSEEK_MODEL - Model to use (default: deepseek-ai/DeepSeek-V3.2)

Getting a Hugging Face API Token

  1. 1.Go to Hugging Face Settings
  2. 2.Create a new token with "Read" permissions
  3. 3.Add it as a secret in your Space settings

๐Ÿ“ฑ Install on Your iPhone/Android

This app can be installed on your phone as a Progressive Web App (PWA)!

iPhone:

  1. 1.Open this Space in Safari (not Chrome)
  2. 2.Tap the Share button (square with arrow) at the bottom
  3. 3.Scroll down and tap "Add to Home Screen"
  4. 4.Tap "Add"

Android:

  1. 1.Open this Space in Chrome
  2. 2.Tap the menu (three dots) โ†’ "Add to Home screen"
  3. 3.Confirm installation

The app will appear on your home screen and open like a native app! See PWA_HF_SPACES.md for detailed instructions.

Data Source

All data is sourced from ClinicalTrials.gov, the official database of clinical trials worldwide.

Developer

Dev. by Mackenzie ๐Ÿงก | mackenzie@post.harvard.edu for Qs

License

MIT License