(
state: UserFeedbackState,
source_rows: List[Dict[str, Any]],
label_map: Dict[Tuple[str, str], Dict[str, Any]],
*,
background_negatives_per_day: int,
)
| 573 | |
| 574 | |
| 575 | def update_feedback_state( |
| 576 | state: UserFeedbackState, |
| 577 | source_rows: List[Dict[str, Any]], |
| 578 | label_map: Dict[Tuple[str, str], Dict[str, Any]], |
| 579 | *, |
| 580 | background_negatives_per_day: int, |
| 581 | ) -> None: |
| 582 | for row in source_rows: |
| 583 | label = label_map.get((str(row.get("episode_id") or ""), paper_identity(row)), {}) |
| 584 | if not label.get("selected"): |
| 585 | continue |
| 586 | state.update_positive_text(paper_text(row), weight=1.0) |
| 587 | |
| 588 | for row in stable_background_rows(source_rows, label_map, background_negatives_per_day): |
| 589 | state.update_negative_text(paper_text(row), weight=0.10) |
| 590 | |
| 591 | |
| 592 | def load_user_metadata(input_dir: Path) -> Dict[str, Dict[str, Any]]: |
no test coverage detected