65 lines
2.1 KiB
Python
65 lines
2.1 KiB
Python
"""
|
|
显示批量测试结果摘要
|
|
"""
|
|
import json
|
|
|
|
# 读取测试结果
|
|
with open('test_reports_full/test_report.json', 'r', encoding='utf-8') as f:
|
|
data = json.load(f)
|
|
|
|
summary = data['summary']
|
|
results = data['results']
|
|
|
|
print("=" * 80)
|
|
print("批量测试结果摘要")
|
|
print("=" * 80)
|
|
|
|
print(f"\n总体统计:")
|
|
print(f" 处理PDF数量: {summary['total_processed']}")
|
|
print(f" 平均处理时间: {summary['avg_processing_time']:.1f}秒")
|
|
|
|
print(f"\nCMA提取结果:")
|
|
print(f" 精确匹配: {summary['cma']['exact']}")
|
|
print(f" 部分匹配: {summary['cma']['partial']}")
|
|
print(f" 可接受: {summary['cma']['acceptable']}")
|
|
print(f" 未匹配: {summary['cma']['no_match']}")
|
|
print(f" 准确率: {summary['cma']['accuracy']*100:.1f}%")
|
|
|
|
print(f"\n机构提取结果:")
|
|
print(f" 精确匹配: {summary['institution']['exact']}")
|
|
print(f" 部分匹配: {summary['institution']['partial']}")
|
|
print(f" 可接受: {summary['institution']['acceptable']}")
|
|
print(f" 未匹配: {summary['institution']['no_match']}")
|
|
print(f" 准确率: {summary['institution']['accuracy']*100:.1f}%")
|
|
|
|
print(f"\n详细结果 (前10个):")
|
|
print("-" * 80)
|
|
for i, r in enumerate(results[:10], 1):
|
|
pdf_name = r['pdf_name'][:40]
|
|
cma = r['extracted'].get('cma', 'N/A')
|
|
expected_cma = r['expected'].get('cma', 'N/A')
|
|
inst = r['extracted'].get('institution', 'N/A')[:30]
|
|
cma_match = r['comparison']['cma'].get('match_type', 'unknown')
|
|
|
|
print(f"{i}. {pdf_name}")
|
|
print(f" CMA: {cma} (期望: {expected_cma}) [{cma_match}]")
|
|
print(f" 机构: {inst}...")
|
|
|
|
# 显示失败的PDF
|
|
print(f"\n失败的PDF:")
|
|
print("-" * 80)
|
|
failed = [r for r in results if r['comparison']['cma'].get('match_type') == 'no_match']
|
|
if failed:
|
|
for r in failed:
|
|
pdf_name = r['pdf_name'][:40]
|
|
expected_cma = r['expected'].get('cma', 'N/A')
|
|
extracted_cma = r['extracted'].get('cma', 'N/A')
|
|
print(f"- {pdf_name}")
|
|
print(f" 期望: {expected_cma}, 提取: {extracted_cma}")
|
|
else:
|
|
print("无")
|
|
|
|
print("\n" + "=" * 80)
|
|
print("提示: 在浏览器中打开 test_reports_full/summary.html 查看详细的可视化报告")
|
|
print("=" * 80)
|