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

Function load_scoring_weights

deployments/feishu/daily-push-agent/main.py:418–438  ·  view source on GitHub ↗

加载排序权重配置

()

Source from the content-addressed store, hash-verified

416 config_file = os.path.join(CONFIG_PATH, "scoring_weights.yaml")
417 if os.path.exists(config_file):
418 with open(config_file, 'r', encoding='utf-8') as f:
419 return apply_relevance_threshold_override(yaml.safe_load(f) or {})
420 # 默认配置
421 return apply_relevance_threshold_override({
422 "w1_interest_vector": 0.35,
423 "w2_topic_weight": 0.25,
424 "w3_author_institution": 0.20,
425 "w4_quality_signal": 0.20,
426 "bonus_must_read": 0.15,
427 "threshold_high_relevant": 0.75,
428 "threshold_maybe_interested": 0.50,
429 "drift_bonus_shifting": 0.08,
430 "drift_bonus_recovered": 0.04,
431 "drift_short_topic_bonus": 0.03,
432 "reading_signal_short_term_bonus": 0.05,
433 })
434
435
436def apply_relevance_threshold_override(weights: Dict) -> Dict:
437 """Apply the desktop relevance slider to ranking thresholds."""
438 adjusted = dict(weights or {})
439 raw = str(os.environ.get("PAPERFLOW_RELEVANCE_THRESHOLD", "") or "").strip()
440 if raw:
441 try:

Callers 1

daily_pushFunction · 0.85

Calls 1

Tested by

no test coverage detected