Map a paper into a source bucket for diversity balancing.
(paper: Dict)
| 712 | |
| 713 | if source == "journal": |
| 714 | journal = str(paper.get("journal") or "").lower().strip() |
| 715 | return journal or "journal" |
| 716 | |
| 717 | if source == "openreview": |
| 718 | return infer_conference_key(paper) or "openreview" |
| 719 | |
| 720 | return source or "unknown" |
| 721 | |
| 722 | |
| 723 | def apply_source_diversity_quota( |
| 724 | scored_papers: List[PaperWithScore], |
| 725 | weights: Dict |
| 726 | ) -> List[PaperWithScore]: |
| 727 | """Soft-cap dominant sources while preserving must-read inclusions.""" |
| 728 | if not scored_papers: |
no test coverage detected