(stats_by_category: Dict[str, Dict[str, Any]])
| 187 | |
| 188 | def _build_accuracy_explanations(stats_by_category: Dict[str, Dict[str, Any]]) -> List[str]: |
| 189 | if not stats_by_category: |
| 190 | return ["当前样本不足,暂时无法形成稳定的推荐准确率解释。"] |
| 191 | |
| 192 | high = float((stats_by_category.get("high_relevant") or {}).get("selection_rate", 0.0) or 0.0) |
| 193 | maybe = float((stats_by_category.get("maybe_interested") or {}).get("selection_rate", 0.0) or 0.0) |
| 194 | edge = float((stats_by_category.get("edge_relevant") or {}).get("selection_rate", 0.0) or 0.0) |
| 195 | must_read = float((stats_by_category.get("must_read") or {}).get("selection_rate", 0.0) or 0.0) |
| 196 | |
| 197 | explanations: List[str] = [] |
| 198 | if high >= maybe >= edge and high > 0: |
| 199 | explanations.append("高相关分组的选择率高于中低相关分组,说明当前排序主链路整体有效。") |
| 200 | if edge >= maybe and edge > 0.05: |
| 201 | explanations.append("边缘相关分组的选择率偏高,说明系统仍存在一定的漏排空间。") |
| 202 | if maybe > high and maybe > 0: |
| 203 | explanations.append("你更常从“可能感兴趣”中选文,说明系统对中间层候选的排序还可以继续优化。") |
| 204 | if must_read > 0 and high > 0 and must_read < high: |
| 205 | explanations.append("必读命中率低于高相关分组,说明当前 must_read 更适合作为软加分而非硬优先级。") |
| 206 | |
| 207 | return explanations[:3] or ["当前分组之间的选择率差异不明显,建议继续积累更多反馈后再观察。"] |
| 208 | |
| 209 | |
| 210 | def _build_trend_explanations(direction_changes: List[Dict[str, Any]], drift_summary: Dict[str, Any]) -> List[str]: |
| 211 | explanations: List[str] = [] |
no test coverage detected