生成画像调整建议 Args: report: 周报字典 Returns: 建议列表
(report: Dict)
| 377 | |
| 378 | def _generate_suggestions(report: Dict) -> List[str]: |
| 379 | """ |
| 380 | 生成画像调整建议 |
| 381 | |
| 382 | Args: |
| 383 | report: 周报字典 |
| 384 | |
| 385 | Returns: |
| 386 | 建议列表 |
| 387 | """ |
| 388 | suggestions = [] |
| 389 | direction_changes = report.get("direction_changes", []) |
| 390 | |
| 391 | # 检测持续下降的方向 |
| 392 | for change in direction_changes: |
| 393 | if change["trend"] == "down" and change["delta"] < -0.1: |
| 394 | direction_cn = translate_direction(change["direction"]) |
| 395 | suggestions.append(f"{direction_cn}权重持续下降,是否还保留?") |
| 396 | |
| 397 | # 检测新增方向 |
| 398 | for change in direction_changes: |
| 399 | if change["previous_weight"] == 0 and change["current_weight"] > 0.3: |
| 400 | direction_cn = translate_direction(change["direction"]) |
| 401 | suggestions.append(f"建议将\"{direction_cn}\"正式加入关注方向") |
| 402 | |
| 403 | return suggestions |
| 404 | |
| 405 | |
| 406 | def _build_drift_summary(profile: Dict[str, Any], drift_updates: List[Dict[str, Any]]) -> Dict[str, Any]: |
| 407 | """Aggregate current and recent drift signals for the weekly report.""" |
no test coverage detected