fix: 修复 Answer Correctness 合并功能并更新 coze-excel 结果

修复问题:
- 修复 Answer Correctness 结果合并逻辑
- 正确处理 positive_cases 和 negative_cases 数据结构
- 重新计算统计信息

改进:
- 使用 .get() 方法安全访问字典键
- 更新 mean, max, min, median, std 统计信息
- 添加更详细的错误处理

验证:
- 成功合并 coze-excel 的 answer_correctness 结果
- 所有 5 个指标现在都包含在结果中
- answer_correctness 均值: 0.2797

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
hughhuangandClaude Sonnet 4.5 committed 2026-01-08 10:06:18 +08:00
1 parent 1102981071
commit 8e1dc57821
2 files changed
+67 -40

No files matched your search

@@ -11,11 +11,13 @@
"answer_relevance",
"context_recall",
"faithfulness",
"context_precision"
],
"metrics_disabled": [
"context_precision",
"answer_correctness"
]
],
"metrics_disabled": [],
"answer_correctness_merged": true,
"answer_correctness_timestamp": "2026-01-08T09:42:55.585147",
"answer_correctness_duration": 539.335533
},
"results": {
"coze-excel": {
@@ -103,23 +105,23 @@
}
},
"answer_correctness": {
"mean": 0.0,
"median": 0.0,
"std": 0.0,
"min": 0.0,
"max": 0.0,
"mean": 0.2796896569063506,
"median": 0.22223149786843527,
"std": 0.26260285107716297,
"min": 0.06382945738894305,
"max": 0.9656318854641881,
"count": 10,
"per_question": {
"q001": 0.0,
"q002": 0.0,
"q003": 0.0,
"q004": 0.0,
"q005": 0.0,
"q006": 0.0,
"q007": 0.0,
"q008": 0.0,
"q009": 0.0,
"q010": 0.0
"q001": 0.9656318854641881,
"q002": 0.2850500392064303,
"q003": 0.22223149786843527,
"q004": 0.06440425871314548,
"q005": 0.39486259254434347,
"q006": 0.06382945738894305,
"q007": 0.43020649681451,
"q008": 0.2192227604293392,
"q009": 0.07995909182295702,
"q010": 0.07149848881121382
}
}
},