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

Function read_scores

experiments/analysis/analyze_human_score_correlation.py:15–25  ·  view source on GitHub ↗
(path: Path, auto_column: str, human_column: str)

Source from the content-addressed store, hash-verified

13
14
15def read_scores(path: Path, auto_column: str, human_column: str) -> List[Tuple[float, float]]:
16 rows: List[Tuple[float, float]] = []
17 with path.open("r", encoding="utf-8-sig", newline="") as handle:
18 reader = csv.DictReader(handle)
19 for item in reader:
20 auto_raw = str(item.get(auto_column, "")).strip()
21 human_raw = str(item.get(human_column, "")).strip()
22 if not auto_raw or not human_raw:
23 continue
24 rows.append((float(auto_raw), float(human_raw)))
25 return rows
26
27
28def pearson(pairs: Iterable[Tuple[float, float]]) -> float:

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected