feat(classify): tighten scoring with reaction co-occurrence and date negatives

强正向 reaction 需标题同时含 require_title;移除听/看等宽泛词,新增弱正向组;charge 命中>=2 记+3、==1 记+1;负向补充录播/录像并新增标题带日期强负向;时长仅在已命中 reaction/charge 时加权;discover 关键词改为单个咻咻满、pages=3、window_days=7,notify.min_score=4;同步示例配置、project.md/README 与相关测试。
This commit is contained in:
kairee committed 2026-11-01 19:00:48 +08:00
1 parent e04908ccad
commit 742c67a1c3
9 files changed
+210 -107

No files matched your search

+14 -11
View File
@@ -25,12 +25,11 @@ from .client_ip import (
DEFAULT_CLASSIFY: dict[str, Any] = {
"require_title": "咻咻满",
"self_mid": 37754047,
"positive": [
"reaction", "re", "反应", "看", "听", "初听", "首次",
"点评", "锐评", "路人", "震惊", "双人",
],
"charge": ["充电", "加急", "专场"],
"negative": ["歌切", "切片", "纯享", "搬运", "完整版"],
"reaction": ["reaction", "反应"],
"charge": ["加急", "特急", "充电", "专场", "转场"],
"weak_positive": ["双人", "路人", "第一次", "首次"],
"negative": ["歌切", "切片", "纯享", "搬运", "完整版", "录播", "录像"],
"date_negative": True,
"duration_boost": {"gt_30min": 1, "gt_60min": 2},
}
@@ -87,11 +86,11 @@ DEFAULT_CONFIG: dict[str, Any] = {
"candidate_ttl_days": 7,
},
"discover": {
"keywords": ["咻咻满 reaction", "咻咻满 充电"],
"pages": 2,
"window_days": 14,
"keywords": ["咻咻满"],
"pages": 3,
"window_days": 7,
},
"notify": {"min_score": 2, "max_items_per_message": 10},
"notify": {"min_score": 4, "max_items_per_message": 10},
"classify": DEFAULT_CLASSIFY,
"heat_weights": DEFAULT_HEAT_WEIGHTS,
"analytics": DEFAULT_ANALYTICS,
@@ -500,8 +499,12 @@ def _build_config(data: Mapping[str, Any], path: Path) -> AppConfig:
classify["self_mid"] = _as_int(
classify.get("self_mid", 37754047), "classify.self_mid", minimum=1
)
for key in ("positive", "charge", "negative"):
for key in ("reaction", "charge", "weak_positive", "negative"):
classify[key] = _as_str_list(classify.get(key, []), f"classify.{key}")
date_negative = classify.get("date_negative", True)
if not isinstance(date_negative, bool):
raise ConfigError("classify.date_negative 必须是布尔值")
classify["date_negative"] = date_negative
boost = classify.get("duration_boost", {})
if not isinstance(boost, Mapping):
raise ConfigError("classify.duration_boost 必须是对象")