mwmathis/ClinicalTrialMatcher_HF
4
๐ฌ 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
- Enter search keywords (e.g., "cancer", "diabetes", "PDAC")
- Optionally filter by country (default: Germany)
- Optionally filter by recruitment status
- Click "Search Clinical Trials"
- 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
- app.py - Main Gradio application (already provided)
- llm_service.py - LLM service for ranking (copy from
backend/llm_service.py) - 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 totrueto use Hugging Face Inference APIDEEPSEEK_MODEL- Model to use (default:deepseek-ai/DeepSeek-V3.2)
Getting a Hugging Face API Token
- Go to Hugging Face Settings
- Create a new token with "Read" permissions
- 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:
- Open this Space in Safari (not Chrome)
- Tap the Share button (square with arrow) at the bottom
- Scroll down and tap "Add to Home Screen"
- Tap "Add"
Android:
- Open this Space in Chrome
- Tap the menu (three dots) โ "Add to Home screen"
- 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
