contractscrub-repro / tests /test_docs.py
arthrod's picture
Unofficial re-implementation on a synthetic stand-in: disclaimer, results not comparable to the paper, known defects of the gold, SCORING corrections, re-scoring without a GPU (publicize plan 10, steps 1-5, 7-9, 11)
62a2b99 verified
Raw History Blame Contribute Delete
1.38 kB
"""The card and SCORING.md must not repeat the claims plan 10 found false."""
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
SCORING = (ROOT / "SCORING.md").read_text()
README = (ROOT / "README.md").read_text()
PROMPTS = (ROOT / "scrub" / "prompts.py").read_text()
RUN = (ROOT / "scrub" / "run_eval.py").read_text()
def test_scoring_corrections():
for stale in ["Inconsistent Language has 13", "2,599", "has 5 gold items", "dominant failure mode",
"never annotated", "never emits them"]:
assert stale not in SCORING, stale
for fact in ["Inconsistent Language has 87", "41 gold items", "2,678", "no Inconsistent Language row",
"23 of the 44"]:
assert fact in SCORING, fact
def test_readme_disclaims_and_does_not_claim_reproduction():
head = "\n".join(README.splitlines()[:20])
assert "not the ContractScrub dataset" in head
for stale in ["reproduces", "F1 well under 0.5", "accompanying report", "unsupported on SM86"]:
assert stale not in README, stale
for fact in ["0.472", "0.365", "0.642", "Known defects of the synthetic gold", "python scrub/score.py"]:
assert fact in README, fact
def test_no_fidelity_or_report_claims_in_code():
assert "exactly as the paper describes" not in PROMPTS
assert "report" not in RUN.lower().replace("reported", "")