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

Function score_row

experiments/baselines/citation_enhanced/runner.py:460–489  ·  view source on GitHub ↗
(
    row: Dict[str, Any],
    row_vector: Dict[str, float],
    state: UserCitationState,
    *,
    max_log_citations: float,
)

Source from the content-addressed store, hash-verified

458
459
460def score_row(
461 row: Dict[str, Any],
462 row_vector: Dict[str, float],
463 state: UserCitationState,
464 *,
465 max_log_citations: float,
466) -> Dict[str, Any]:
467 content = content_score(row_vector, state)
468 relation, direct_link, bibliographic_overlap = citation_relation_score(row, state)
469 impact, has_citation_count = impact_score(row, max_log_citations)
470 source = source_prior(row)
471 final_score = clamp(
472 SCORE_WEIGHTS["content"] * content
473 + SCORE_WEIGHTS["citation_relation"] * relation
474 + SCORE_WEIGHTS["impact"] * impact
475 + SCORE_WEIGHTS["source_prior"] * source
476 )
477 return {
478 "system_score": final_score,
479 "system_label": label_for_score(final_score),
480 "content_score": content,
481 "citation_relation_score": relation,
482 "citation_direct_link": direct_link,
483 "bibliographic_overlap": bibliographic_overlap,
484 "impact_score": impact,
485 "has_citation_count": has_citation_count,
486 "citation_count": citation_count(row),
487 "source_prior": source,
488 "training_selected_count": state.selected_count,
489 }
490
491
492def load_user_metadata(input_dir: Path) -> Dict[str, Dict[str, Any]]:

Callers 1

rerank_episodesFunction · 0.70

Calls 7

citation_relation_scoreFunction · 0.85
impact_scoreFunction · 0.85
content_scoreFunction · 0.70
source_priorFunction · 0.70
clampFunction · 0.70
label_for_scoreFunction · 0.70
citation_countFunction · 0.70

Tested by

no test coverage detected