看板升级: GT v0.5.0(20期叙事结构全覆盖) + schema加字段方案 + git清理
- ground-truth v0.5.0: 补完10期narrative_structure标注(MiMo跑批+制片人审定) - summarize.py: 修复无标注期次格式化崩溃 - 003_add_ai_labels.sql: episodes表加7列(6打标+1置信度)迁移文件 - episode.py: Model同步加7个Optional字段 - CLAUDE.md: 项目主控文件入库 - doco/deliverables: 20期终版文稿md入库 - doco/programs: 中间产物从git移除(本地保留), .gitignore统一管理 - note/寄存条: 两个子项目寄存条入库 - .gitignore: 补充doco中间产物/Excel锁文件/临时文件规则 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -94,11 +94,14 @@ def run(model, field="narrative"):
|
||||
hit = pred_val == gt_val if pred_val is not None else False
|
||||
rows.append({"ep": ep, "title": title, "gt": gt_val, "pred": pred_val or "解析失败", "hit": hit, "conf": conf})
|
||||
elif field == "narrative":
|
||||
gt_val = gt.get("narrative_structure", "?")
|
||||
gt_val = gt.get("narrative_structure")
|
||||
pred_val = result.get("narrative_structure") if result else None
|
||||
conf = result.get("confidence", "?") if result else "?"
|
||||
hit = pred_val == gt_val if pred_val is not None else False
|
||||
rows.append({"ep": ep, "title": title, "gt": gt_val, "pred": pred_val or "解析失败", "hit": hit, "conf": conf})
|
||||
if gt_val is None:
|
||||
rows.append({"ep": ep, "title": title, "gt": "(无标注)", "pred": pred_val or "解析失败", "hit": None, "conf": conf})
|
||||
else:
|
||||
hit = pred_val == gt_val if pred_val is not None else False
|
||||
rows.append({"ep": ep, "title": title, "gt": gt_val, "pred": pred_val or "解析失败", "hit": hit, "conf": conf})
|
||||
elif field == "classification":
|
||||
conf = result.get("confidence", "?") if result else "?"
|
||||
sub = {}
|
||||
@@ -134,22 +137,28 @@ def run(model, field="narrative"):
|
||||
elif field == "narrative":
|
||||
# 打印每行
|
||||
for r in rows:
|
||||
mark = "✓" if r["hit"] else "✗"
|
||||
if r["hit"] is None:
|
||||
mark = "-"
|
||||
else:
|
||||
mark = "✓" if r["hit"] else "✗"
|
||||
conf_str = f'置信度:{r["conf"]}' if r["conf"] != "?" else ""
|
||||
print(f' ep{r["ep"]:02d} {r["title"]:<10} | 标准:{r["gt"]:<8} | {model}:{r["pred"]:<8} | {mark} {conf_str}')
|
||||
print(f' ep{r["ep"]:03d} {r["title"]:<12} | 标准:{r["gt"]:<6} | {model}:{r["pred"]:<6} | {mark} {conf_str}')
|
||||
|
||||
# 汇总
|
||||
total = len(rows)
|
||||
hits = sum(1 for r in rows if r["hit"])
|
||||
hi_conf = [r for r in rows if r["conf"] == "高"]
|
||||
mid_low = [r for r in rows if r["conf"] in ("中", "低")]
|
||||
# 汇总(跳过无标注)
|
||||
scored = [r for r in rows if r["hit"] is not None]
|
||||
hits = sum(1 for r in scored if r["hit"])
|
||||
total = len(scored)
|
||||
unlabeled = sum(1 for r in rows if r["hit"] is None)
|
||||
hi_conf = [r for r in scored if r["conf"] == "高"]
|
||||
mid_low = [r for r in scored if r["conf"] in ("中", "低")]
|
||||
hi_hit = sum(1 for r in hi_conf if r["hit"])
|
||||
ml_hit = sum(1 for r in mid_low if r["hit"])
|
||||
|
||||
print(f"\n ===== {model} 命中情况 =====")
|
||||
print(f" narrative_structure 命中: {hits}/{total} = {hits*100//total}%")
|
||||
print(f" narrative_structure 命中: {hits}/{total} = {hits*100//total if total else 0}%")
|
||||
print(f" 自评\"高\"置信的命中率: {hi_hit}/{len(hi_conf)}")
|
||||
print(f" 自评\"中/低\"置信的命中率: {ml_hit}/{len(mid_low)}")
|
||||
print(f" 无标注(跳过): {unlabeled} 期")
|
||||
print(f" 解析失败: {parse_fail} 期")
|
||||
elif field == "classification":
|
||||
field_names = ["program_format", "equipment_domain", "scene_tags", "tech_tags"]
|
||||
|
||||
Reference in New Issue
Block a user