asa / scripts /lib /chat_eval /misconceptions.py
defenestrate's picture
ASA Space: squashed history (instructions and settings live in the private pack)
526950e
Raw History Blame Contribute Delete
928 Bytes
"""Faculty-maintained misconception list loader.
The file lives at content/chat-eval/misconceptions.yaml and is editable in
place; the judge re-loads fresh each batch so changes pick up without rebuild.
"""
from __future__ import annotations
from pathlib import Path
import yaml
def load_misconceptions(path: Path) -> list[dict]:
"""Load the misconception list from a YAML file.
Each entry is a dict with id, name, technical, colloquial,
faculty_displacement_target, example_queries.
Raises FileNotFoundError if the file doesn't exist.
"""
if not path.is_file():
raise FileNotFoundError(f"misconceptions file not found: {path}")
with open(path, "r", encoding="utf-8") as f:
data = yaml.safe_load(f)
if not isinstance(data, list):
raise ValueError(
f"misconceptions file at {path} must be a YAML list, got {type(data).__name__}"
)
return data