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

Function aspect_coverage_score

experiments/baselines/nl_profile/runner.py:347–356  ·  view source on GitHub ↗
(text: str, directions: Sequence[str])

Source from the content-addressed store, hash-verified

345
346
347def aspect_coverage_score(text: str, directions: Sequence[str]) -> float:
348 if not directions:
349 return 0.0
350 normalized_text = normalize_phrase_text(text)
351 covered = 0
352 for direction in directions:
353 direction_terms = _direction_terms(direction)
354 if any(contains_phrase(normalized_text, term) for term in direction_terms):
355 covered += 1
356 return clamp(covered / min(len(directions), 3))
357
358
359def label_for_score(score: float) -> str:

Callers 1

score_rowFunction · 0.85

Calls 4

normalize_phrase_textFunction · 0.70
_direction_termsFunction · 0.70
contains_phraseFunction · 0.70
clampFunction · 0.70

Tested by

no test coverage detected