Download predictor.py from dougdotcon/douvras-lead-qualification-model: direct link, hf CLI and curl.
- Browser
- Download file 827 Bytes
-
https://huggingface.co/dougdotcon/douvras-lead-qualification-model/resolve/main/predictor.py
- Command line
-
hf download hf://dougdotcon/douvras-lead-qualification-model/predictor.py
-
curl -L -o predictor.py https://huggingface.co/dougdotcon/douvras-lead-qualification-model/resolve/main/predictor.py
827 Bytes
| from __future__ import annotations | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| def classify(row: dict) -> dict: | |
| if not row["opt_in"]: | |
| decision = "DISQUALIFY" | |
| elif row["urgency"] >= 2 and row["fit_score"] >= 0.70 and row["budget_band"] in {"medium", "high"}: | |
| decision = "PRIORITIZE" | |
| elif row["fit_score"] >= 0.50: | |
| decision = "NURTURE" | |
| else: | |
| decision = "DISQUALIFY" | |
| return {"classification": decision, "human_review_required": True, "no_automatic_contact": True} | |
| def main() -> None: | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("record_json", type=Path) | |
| args = parser.parse_args() | |
| print(json.dumps(classify(json.loads(args.record_json.read_text(encoding="utf-8"))), ensure_ascii=False, indent=2)) | |
| if __name__ == "__main__": | |
| main() | |