MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / parse_score

Function parse_score

experiments/human_eval/aggregate_main_human_eval.py:31–38  ·  view source on GitHub ↗
(value: str, field: str, sample_id: str)

Source from the content-addressed store, hash-verified

29
30
31def parse_score(value: str, field: str, sample_id: str) -> float:
32 text = str(value or "").strip()
33 if not text:
34 raise ValueError(f"Missing {field} for sample {sample_id}")
35 score = float(text)
36 if score < 1 or score > 5:
37 raise ValueError(f"{field} for sample {sample_id} must be in [1, 5], got {score}")
38 return score
39
40
41def index_by_sample(rows: Iterable[Dict[str, str]]) -> Dict[str, Dict[str, str]]:

Callers 1

build_scored_papersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected