Download evaluate.py from jwcalendar/calendar-query-intent-classifier: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/jwcalendar/calendar-query-intent-classifier/resolve/main/evaluate.py
- Command line
-
hf download hf://jwcalendar/calendar-query-intent-classifier/evaluate.py
-
curl -L -o evaluate.py https://huggingface.co/jwcalendar/calendar-query-intent-classifier/resolve/main/evaluate.py
413 Bytes
| #!/usr/bin/env python3 | |
| """Recompute held-out metrics from the released test examples.""" | |
| import json | |
| from pathlib import Path | |
| from train import evaluate | |
| ROOT=Path(__file__).resolve().parent | |
| model=json.loads((ROOT/"model.json").read_text(encoding="utf-8"));rows=[json.loads(line) for line in (ROOT/"queries.jsonl").read_text(encoding="utf-8").splitlines()] | |
| print(json.dumps(evaluate(model,rows,"test"),indent=2)) | |