Spaces:
Sleeping
Sleeping
Download root/graders.py from MalharOrganization/RL-Doc-Parser: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/spaces/MalharOrganization/RL-Doc-Parser/resolve/main/root/graders.py
- Command line
-
hf download hf://spaces/MalharOrganization/RL-Doc-Parser/root/graders.py
-
curl -L -o graders.py https://huggingface.co/spaces/MalharOrganization/RL-Doc-Parser/resolve/main/root/graders.py
666 Bytes
| """Task graders returning strict (0, 1) scores.""" | |
| from typing import Any | |
| def _bounded_exact_match(prediction: Any, expected: Any) -> float: | |
| pred = str(prediction or "").strip().lower() | |
| exp = str(expected or "").strip().lower() | |
| return 0.99 if pred == exp and exp else 0.01 | |
| def grade_find_ssl_config(prediction: Any, expected: Any) -> float: | |
| return _bounded_exact_match(prediction, expected) | |
| def grade_find_postgres_setup(prediction: Any, expected: Any) -> float: | |
| return _bounded_exact_match(prediction, expected) | |
| def grade_find_oauth_guide(prediction: Any, expected: Any) -> float: | |
| return _bounded_exact_match(prediction, expected) | |