josephrw/doctor-verify-institutional
0
Doctor Address Verifier — Institutional Edition
Hugging Face Spaces deployment of a production-grade, multi-source doctor address verification system.
Features
- 10 Verification Sources: NPI Registry, CMS Physician Compare, Google Places, Bing, Yelp, RateMDs, Healthgrades, SAMHSA, NY OPD, LLM Web Crawl
- LLM-Powered Web Crawl: Ollama analyzes actual web pages via DuckDuckGo search (falls back to keyword matching if unavailable)
- Parallel Source Fetching: ThreadPoolExecutor runs sources concurrently
- Pydantic v2 Models: Strict validation at all boundaries
- Immutable Audit Logging: SHA-256 checksums on every event
- SQLite Cache: 24hr TTL for scraped results
- Phone Extraction: Automatically extracts US phone numbers from all sources
- Consensus Engine: Weighted scoring by source importance
- Streamlit UI: Single verify, batch verify (Excel), system status, audit log
- Zero Configuration: Works out of the box with no API keys or environment variables required
Deployment
1. Create HF Space
huggingface-cli repo create doctor-verify-institutional --type space --sdk docker2. Push Code
git clone https://huggingface.co/spaces/YOUR_USERNAME/doctor-verify-institutional
cd doctor-verify-institutional
# Copy all files from hf_institutional/
cp /path/to/hf_institutional/* .
git add .
git commit -m "Initial institutional deployment"
git push3. Configure Secrets (Optional)
The system works without any secrets. For enhanced functionality, you may add:
Default behavior without secrets:
- NPI Registry, CMS Compare, Yelp, RateMDs, Healthgrades, SAMHSA, NY OPD: Fully functional
- Web crawl: Uses keyword matching (no LLM required)
- Google Places, Bing: Disabled (optional enhancements)
- Authentication: Disabled (public access)
Architecture
app_hf.py → Gradio UI (tabs: Single, Batch, Status, Audit)
engine.py → Consensus engine + batch orchestrator
sources.py → 9 independent source runners (each retry-wrapped)
llm_crawler.py → DuckDuckGo search + Ollama page analysis + cache
models.py → Pydantic v2 models for all data boundaries
config.py → Environment-backed config with security constants
audit.py → Immutable JSONL audit log with SHA-256 checksumsSecurity
- Input Validation: All inputs validated via Pydantic models
- Audit Trail: Every verification logged with checksums
- Privacy: IP addresses hashed (SHA-256) before logging
- Rate Limiting: Configurable per-minute rate limits (default: 30/min)
- Least Privilege: No
chmod 777, no wide-open CORS
License
Proprietary — Internal use only.
