(items: list[dict])
| 2105 | |
| 2106 | |
| 2107 | def fmt_relation_balance(items: list[dict]): |
| 2108 | if not items: |
| 2109 | print("✅ 关系词频次均衡(无单一关系词占比 > 30%)") |
| 2110 | return |
| 2111 | print(f"⚠️ 发现 {len(items)} 个关系词占比过高(> 30% 阈值):\n") |
| 2112 | print(f" (标准关系白名单:{sorted(RELATION_TYPES)})\n") |
| 2113 | for it in items: |
| 2114 | pct = it["ratio"] * 100 |
| 2115 | print(f" {it['relation']}: {it['count']}/{it['total_relations']} = {pct:.0f}% (阈值 {it['threshold']:.0%})") |
| 2116 | print(f" 建议: {it['suggestion']}") |
| 2117 | print() |
| 2118 | |
| 2119 | |
| 2120 | def fmt_implicit_relations(items: list[dict]): |