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
417
418def load_scoring_weights() -> Dict:
419 """加载排序权重配置"""
420 import yaml
421 config_file = os.path.join(CONFIG_PATH, "scoring_weights.yaml")
422 if os.path.exists(config_file):
423 with open(config_file, 'r', encoding='utf-8') as f:
424 return apply_relevance_threshold_override(yaml.safe_load(f) or {})
425 # 默认配置
426 return apply_relevance_threshold_override({
427 "w1_interest_vector": 0.35,
428 "w2_topic_weight": 0.25,
429 "w3_author_institution": 0.20,
430 "w4_quality_signal": 0.20,
431 "bonus_must_read": 0.15,
432 "threshold_high_relevant": 0.75,
433 "threshold_maybe_interested": 0.50,
434 "drift_bonus_shifting": 0.08,
435 "drift_bonus_recovered": 0.04,
436 "drift_short_topic_bonus": 0.03,
437 "reading_signal_short_term_bonus": 0.05,
438 })
439
440
441def apply_relevance_threshold_override(weights: Dict) -> Dict:

Callers 1

daily_pushFunction · 0.85

Calls 1

Tested by

no test coverage detected