359 lines
11 KiB
HTML
359 lines
11 KiB
HTML
|
|||
|
|
<!DOCTYPE html>
|
||
|
|
<html lang="zh-CN">
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
|
<title>RAG评估报告 - eval-demo-001</title>
|
||
|
|
<script src="https://cdn.plot.ly/plotly-2.27.0.min.js"></script>
|
||
|
|
<style>
|
||
|
|
|
||
|
|
* {
|
||
|
|
margin: 0;
|
||
|
|
padding: 0;
|
||
|
|
box-sizing: border-box;
|
||
|
|
}
|
||
|
|
|
||
|
|
body {
|
||
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||
|
|
line-height: 1.6;
|
||
|
|
color: #333;
|
||
|
|
background-color: #f5f5f5;
|
||
|
|
}
|
||
|
|
|
||
|
|
.container {
|
||
|
|
max-width: 1200px;
|
||
|
|
margin: 0 auto;
|
||
|
|
padding: 20px;
|
||
|
|
}
|
||
|
|
|
||
|
|
header {
|
||
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
|
|
color: white;
|
||
|
|
padding: 30px;
|
||
|
|
border-radius: 10px;
|
||
|
|
margin-bottom: 30px;
|
||
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||
|
|
}
|
||
|
|
|
||
|
|
header h1 {
|
||
|
|
font-size: 2.5em;
|
||
|
|
margin-bottom: 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.subtitle {
|
||
|
|
font-size: 1.1em;
|
||
|
|
opacity: 0.9;
|
||
|
|
}
|
||
|
|
|
||
|
|
.timestamp {
|
||
|
|
font-size: 0.9em;
|
||
|
|
opacity: 0.8;
|
||
|
|
margin-top: 5px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.section {
|
||
|
|
background: white;
|
||
|
|
padding: 25px;
|
||
|
|
margin-bottom: 25px;
|
||
|
|
border-radius: 10px;
|
||
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||
|
|
}
|
||
|
|
|
||
|
|
.section h2 {
|
||
|
|
color: #667eea;
|
||
|
|
margin-bottom: 20px;
|
||
|
|
font-size: 1.8em;
|
||
|
|
border-bottom: 2px solid #667eea;
|
||
|
|
padding-bottom: 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.summary-grid {
|
||
|
|
display: grid;
|
||
|
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||
|
|
gap: 20px;
|
||
|
|
margin-bottom: 20px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.summary-card {
|
||
|
|
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||
|
|
padding: 20px;
|
||
|
|
border-radius: 8px;
|
||
|
|
text-align: center;
|
||
|
|
}
|
||
|
|
|
||
|
|
.summary-card.score {
|
||
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
|
|
color: white;
|
||
|
|
}
|
||
|
|
|
||
|
|
.summary-card h3 {
|
||
|
|
font-size: 0.9em;
|
||
|
|
margin-bottom: 10px;
|
||
|
|
opacity: 0.8;
|
||
|
|
}
|
||
|
|
|
||
|
|
.summary-card .value {
|
||
|
|
font-size: 2.5em;
|
||
|
|
font-weight: bold;
|
||
|
|
margin-bottom: 5px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.summary-card .label {
|
||
|
|
font-size: 0.9em;
|
||
|
|
opacity: 0.7;
|
||
|
|
}
|
||
|
|
|
||
|
|
.grade {
|
||
|
|
display: inline-block;
|
||
|
|
padding: 5px 15px;
|
||
|
|
border-radius: 20px;
|
||
|
|
font-weight: bold;
|
||
|
|
margin-top: 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.grade-A { background-color: #10b981; color: white; }
|
||
|
|
.grade-B { background-color: #3b82f6; color: white; }
|
||
|
|
.grade-C { background-color: #f59e0b; color: white; }
|
||
|
|
.grade-D { background-color: #ef4444; color: white; }
|
||
|
|
.grade-F { background-color: #991b1b; color: white; }
|
||
|
|
|
||
|
|
.recommendations {
|
||
|
|
background-color: #fef3c7;
|
||
|
|
border-left: 4px solid #f59e0b;
|
||
|
|
padding: 15px;
|
||
|
|
margin-top: 20px;
|
||
|
|
border-radius: 5px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.recommendations h3 {
|
||
|
|
color: #92400e;
|
||
|
|
margin-bottom: 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.recommendations ul {
|
||
|
|
list-style-position: inside;
|
||
|
|
color: #78350f;
|
||
|
|
}
|
||
|
|
|
||
|
|
.recommendations li {
|
||
|
|
margin-bottom: 8px;
|
||
|
|
}
|
||
|
|
|
||
|
|
table {
|
||
|
|
width: 100%;
|
||
|
|
border-collapse: collapse;
|
||
|
|
margin-top: 15px;
|
||
|
|
}
|
||
|
|
|
||
|
|
th, td {
|
||
|
|
padding: 12px;
|
||
|
|
text-align: left;
|
||
|
|
border-bottom: 1px solid #e5e7eb;
|
||
|
|
}
|
||
|
|
|
||
|
|
th {
|
||
|
|
background-color: #f9fafb;
|
||
|
|
font-weight: 600;
|
||
|
|
color: #374151;
|
||
|
|
}
|
||
|
|
|
||
|
|
tr:hover {
|
||
|
|
background-color: #f9fafb;
|
||
|
|
}
|
||
|
|
|
||
|
|
.status-badge {
|
||
|
|
display: inline-block;
|
||
|
|
padding: 4px 12px;
|
||
|
|
border-radius: 12px;
|
||
|
|
font-size: 0.85em;
|
||
|
|
font-weight: 600;
|
||
|
|
}
|
||
|
|
|
||
|
|
.status-good { background-color: #d1fae5; color: #065f46; }
|
||
|
|
.status-warning { background-color: #fed7aa; color: #92400e; }
|
||
|
|
.status-poor { background-color: #fee2e2; color: #991b1b; }
|
||
|
|
|
||
|
|
.chart-container {
|
||
|
|
margin: 20px 0;
|
||
|
|
padding: 15px;
|
||
|
|
background: white;
|
||
|
|
border-radius: 8px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.failed-case {
|
||
|
|
background-color: #fef2f2;
|
||
|
|
border-left: 4px solid #ef4444;
|
||
|
|
padding: 15px;
|
||
|
|
margin-bottom: 15px;
|
||
|
|
border-radius: 5px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.failed-case h4 {
|
||
|
|
color: #991b1b;
|
||
|
|
margin-bottom: 8px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.failed-case .question {
|
||
|
|
font-weight: 600;
|
||
|
|
margin-bottom: 8px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.failed-case .metrics {
|
||
|
|
font-size: 0.9em;
|
||
|
|
color: #7f1d1d;
|
||
|
|
}
|
||
|
|
|
||
|
|
</style>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="container">
|
||
|
|
<header>
|
||
|
|
<h1>RAG评估报告</h1>
|
||
|
|
<p class="subtitle">评估ID: eval-demo-001</p>
|
||
|
|
<p class="timestamp">生成时间: 2026-01-15 21:49:35</p>
|
||
|
|
</header>
|
||
|
|
|
||
|
|
|
||
|
|
<div class="section">
|
||
|
|
<h2>执行摘要</h2>
|
||
|
|
<div class="summary-grid">
|
||
|
|
<div class="summary-card score">
|
||
|
|
<h3>整体评分</h3>
|
||
|
|
<div class="value">82.5</div>
|
||
|
|
<div class="grade grade-B">B (良好)</div>
|
||
|
|
</div>
|
||
|
|
<div class="summary-card">
|
||
|
|
<h3>总问题数</h3>
|
||
|
|
<div class="value">20</div>
|
||
|
|
<div class="label">评估问题</div>
|
||
|
|
</div>
|
||
|
|
<div class="summary-card">
|
||
|
|
<h3>成功率</h3>
|
||
|
|
<div class="value">90.0%</div>
|
||
|
|
<div class="label">18/20 成功</div>
|
||
|
|
</div>
|
||
|
|
<div class="summary-card">
|
||
|
|
<h3>平均响应时间</h3>
|
||
|
|
<div class="value">1031ms</div>
|
||
|
|
<div class="label">检索+生成</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<div class="section">
|
||
|
|
<h2>指标雷达图</h2>
|
||
|
|
<div id="radar-chart" class="chart-container"></div>
|
||
|
|
<script>
|
||
|
|
|
||
|
|
var data = [{"type": "scatterpolar", "r": [0.85, 0.82, 0.88, 0.8, 0.85], "theta": ["\u4e0a\u4e0b\u6587\u53ec\u56de\u7387", "\u4e0a\u4e0b\u6587\u7cbe\u786e\u7387", "\u5fe0\u5b9e\u5ea6", "\u7b54\u6848\u76f8\u5173\u6027", "\u4e0a\u4e0b\u6587\u53ec\u56de\u7387"], "fill": "toself", "name": "\u6307\u6807\u5f97\u5206"}];
|
||
|
|
var layout = {"polar": {"radialaxis": {"visible": true, "range": [0, 1]}}, "showlegend": false};
|
||
|
|
Plotly.newPlot('radar-chart', data, layout);
|
||
|
|
|
||
|
|
</script>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<div class="section">
|
||
|
|
<h2>指标对比</h2>
|
||
|
|
<div id="bar-chart" class="chart-container"></div>
|
||
|
|
<script>
|
||
|
|
|
||
|
|
var data = [{"x": ["\u4e0a\u4e0b\u6587\u53ec\u56de\u7387", "\u4e0a\u4e0b\u6587\u7cbe\u786e\u7387", "\u5fe0\u5b9e\u5ea6", "\u7b54\u6848\u76f8\u5173\u6027"], "y": [0.85, 0.82, 0.88, 0.8], "name": "\u5e73\u5747\u5f97\u5206", "type": "bar", "marker": {"color": "#667eea"}}, {"x": ["\u4e0a\u4e0b\u6587\u53ec\u56de\u7387", "\u4e0a\u4e0b\u6587\u7cbe\u786e\u7387", "\u5fe0\u5b9e\u5ea6", "\u7b54\u6848\u76f8\u5173\u6027"], "y": [0.83, 0.78, 0.89, 0.72], "name": "\u901a\u8fc7\u7387", "type": "bar", "marker": {"color": "#764ba2"}}];
|
||
|
|
var layout = {"barmode": "group", "yaxis": {"range": [0, 1], "title": "\u5f97\u5206"}, "xaxis": {"title": "\u6307\u6807"}};
|
||
|
|
Plotly.newPlot('bar-chart', data, layout);
|
||
|
|
|
||
|
|
</script>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<div class="section">
|
||
|
|
<h2>整体通过率</h2>
|
||
|
|
<div id="pie-chart" class="chart-container"></div>
|
||
|
|
<script>
|
||
|
|
|
||
|
|
var data = [{"values": [18, 2], "labels": ["\u6210\u529f", "\u5931\u8d25"], "type": "pie", "marker": {"colors": ["#10b981", "#ef4444"]}}];
|
||
|
|
var layout = {"showlegend": true};
|
||
|
|
Plotly.newPlot('pie-chart', data, layout);
|
||
|
|
|
||
|
|
</script>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<div class="section">
|
||
|
|
<h2>指标详情</h2>
|
||
|
|
<table>
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th>指标</th>
|
||
|
|
<th>平均值</th>
|
||
|
|
<th>中位数</th>
|
||
|
|
<th>标准差</th>
|
||
|
|
<th>通过率</th>
|
||
|
|
<th>状态</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
|
||
|
|
<tr>
|
||
|
|
<td>上下文召回率</td>
|
||
|
|
<td>0.850</td>
|
||
|
|
<td>0.870</td>
|
||
|
|
<td>0.120</td>
|
||
|
|
<td>83.0%</td>
|
||
|
|
<td><span class="status-badge status-good">优秀</span></td>
|
||
|
|
</tr>
|
||
|
|
|
||
|
|
<tr>
|
||
|
|
<td>上下文精确率</td>
|
||
|
|
<td>0.820</td>
|
||
|
|
<td>0.840</td>
|
||
|
|
<td>0.100</td>
|
||
|
|
<td>78.0%</td>
|
||
|
|
<td><span class="status-badge status-warning">警告</span></td>
|
||
|
|
</tr>
|
||
|
|
|
||
|
|
<tr>
|
||
|
|
<td>忠实度</td>
|
||
|
|
<td>0.880</td>
|
||
|
|
<td>0.900</td>
|
||
|
|
<td>0.080</td>
|
||
|
|
<td>89.0%</td>
|
||
|
|
<td><span class="status-badge status-good">优秀</span></td>
|
||
|
|
</tr>
|
||
|
|
|
||
|
|
<tr>
|
||
|
|
<td>答案相关性</td>
|
||
|
|
<td>0.800</td>
|
||
|
|
<td>0.820</td>
|
||
|
|
<td>0.110</td>
|
||
|
|
<td>72.0%</td>
|
||
|
|
<td><span class="status-badge status-warning">警告</span></td>
|
||
|
|
</tr>
|
||
|
|
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
<div class="section">
|
||
|
|
<h2>失败案例 (前10个)</h2>
|
||
|
|
|
||
|
|
<div class="failed-case">
|
||
|
|
<h4>问题 #18</h4>
|
||
|
|
<div class="question">失败问题 1</div>
|
||
|
|
<div class="metrics">错误: Evaluation timeout</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="failed-case">
|
||
|
|
<h4>问题 #19</h4>
|
||
|
|
<div class="question">失败问题 2</div>
|
||
|
|
<div class="metrics">低分指标: context_recall: 0.300, context_precision: 0.350, faithfulness: 0.400, answer_relevancy: 0.380</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|