CoolFace
Apppublic

josephrw/doctor-verify-institutional

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
App README

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

bash
huggingface-cli repo create doctor-verify-institutional --type space --sdk docker

2. Push Code

bash
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 push

3. Configure Secrets (Optional)

The system works without any secrets. For enhanced functionality, you may add:

SecretDescriptionEffect
GOOGLE_API_KEYGoogle Places API keyEnables Google Places source
BING_SEARCH_KEYBing Web Search API keyEnables Bing search source
OLLAMA_HOSTOllama endpoint URLEnables LLM-powered web crawl
OLLAMA_MODELOllama model nameUses specified model (default: llama3.2)
APP_PASSWORDAccess password for the UIAdds password protection
MAX_BATCH_SIZEMax records per batchAdjusts batch limit (default: 100)

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 checksums

Security

  • —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.