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

Function score_row

experiments/baselines/knowledge_entity/runner.py:554–586  ·  view source on GitHub ↗
(
    row: Dict[str, Any],
    rep: PaperRepresentation,
    state: UserKnowledgeEntityState,
    *,
    max_log_citations: float,
)

Source from the content-addressed store, hash-verified

552
553
554def score_row(
555 row: Dict[str, Any],
556 rep: PaperRepresentation,
557 state: UserKnowledgeEntityState,
558 *,
559 max_log_citations: float,
560) -> Dict[str, Any]:
561 profile_entity = profile_entity_score(rep, state)
562 history_entity = history_entity_score(rep, state)
563 multifacet = multifacet_similarity(rep, state)
564 metadata_signal, has_citation_count = metadata_signal_score(row, rep, max_log_citations)
565 density = entity_density_score(rep)
566 final_score = clamp(
567 SCORE_WEIGHTS["profile_entity"] * profile_entity
568 + SCORE_WEIGHTS["history_entity"] * history_entity
569 + SCORE_WEIGHTS["multifacet_similarity"] * multifacet
570 + SCORE_WEIGHTS["metadata_signal"] * metadata_signal
571 + SCORE_WEIGHTS["entity_density"] * density
572 )
573 return {
574 "system_score": final_score,
575 "system_label": label_for_score(final_score),
576 "profile_entity_score": profile_entity,
577 "history_entity_score": history_entity,
578 "multifacet_similarity_score": multifacet,
579 "metadata_signal_score": metadata_signal,
580 "entity_density_score": density,
581 "entity_count": len(rep.entities),
582 "top_entities": rep.entities[:10],
583 "has_citation_count": has_citation_count,
584 "citation_count": citation_count(row),
585 "training_selected_count": state.selected_count,
586 }
587
588
589def load_user_metadata(input_dir: Path) -> Dict[str, Dict[str, Any]]:

Callers 1

rerank_episodesFunction · 0.70

Calls 8

profile_entity_scoreFunction · 0.85
history_entity_scoreFunction · 0.85
multifacet_similarityFunction · 0.85
metadata_signal_scoreFunction · 0.85
entity_density_scoreFunction · 0.85
clampFunction · 0.70
label_for_scoreFunction · 0.70
citation_countFunction · 0.70

Tested by

no test coverage detected