site-ranking
SKILL.md
Site Ranking (standalone)
This skill provides a deterministic implementation of ds_ai_platform-style site ranking:
- Search ClinicalTrials.gov API v2 for studies.
- (Optional, default) Standardize facility names via OpenAlex to help deduplicate.
- Build a site co-participation network (two sites are connected if they appear in the same trial).
- Rank sites by either:
frequency(most trials)- network centrality (
degree,pagerank,betweenness,closeness,eigenvector)
- Apply optional filters after ranking (country/state/city/etc.).
Dependencies
Install on your server:
pip install -r site-ranking/requirements.txt
Prompt conventions (critical)
Location vs filters
- If the user asks for trials in a location (e.g., “trials in California”), put that in
search.location. - If the user asks for top sites in a location (e.g., “top US sites for breast cancer”), do NOT constrain the initial search with
search.location; instead applyranking.filtersafter ranking (e.g.,{ "country": "United States" }).
Rationale: centrality rankings are more informative with a broader network; filtering is safer after ranking.
Metric choice
- Use
frequencyfor “most trials” / footprint. - Use
degree(default) orpagerankfor collaboration hubs / influence.
How to run
- Create a payload file
payload.json. - Run:
python site-ranking/scripts/run_site_ranking.py --file payload.json --pretty
Payload schema
Provide exactly one of:
search: run full pipeline (search → optional standardize → rank)trial_data: skip search and rank the provided ClinicalTrials-like JSON
Fields:
search: object with keyscondition,intervention,other_terms,sponsor,status,location,max_resultsranking: object with keys:metric:frequency|degree|betweenness|closeness|eigenvector|pageranktop_n: integerfilters: object (applied after ranking). Common keys:country,state,city,facility,openalex_id.standardize_openalex: boolean (default true)
Optional:
email_for_api: passed as OpenAlexmailto(or set env varEMAIL_FOR_API).
Example payload
{
"search": {
"condition": "breast cancer",
"other_terms": "AREA[Phase]Phase 3",
"status": "RECRUITING",
"location": "",
"max_results": 100
},
"ranking": {
"metric": "degree",
"top_n": 10,
"filters": {"country": "United States"},
"standardize_openalex": true
}
}
Weekly Installs
3
Repository
jujae/trial-optimizerFirst Seen
8 days ago
Security Audits
Installed on
opencode3
gemini-cli3
github-copilot3
codex3
amp3
cline3