Spaces:
Running
Running
| """Compute wow_filter hit-rate from a seeds JSON and write a markdown report.""" | |
| from __future__ import annotations | |
| import argparse | |
| import json | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) | |
| from aether_ad.cli.commands import hit_rate_report # noqa: E402 | |
| def main() -> int: | |
| p = argparse.ArgumentParser() | |
| p.add_argument("--input", type=Path, required=True) | |
| p.add_argument("--report", type=Path, default=Path("outputs/hit_rate_report.md")) | |
| p.add_argument("--threshold", type=float, default=0.5) | |
| args = p.parse_args() | |
| data = json.loads(args.input.read_text(encoding="utf-8")) | |
| md = hit_rate_report(data, threshold=args.threshold) | |
| args.report.parent.mkdir(parents=True, exist_ok=True) | |
| args.report.write_text(md, encoding="utf-8") | |
| print(f"Wrote {args.report}") | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |