D Ф m i И i q ц e L Ф y e r
commited on
Commit
·
f19f3b4
1
Parent(s):
3700c55
�� Add TREC IR metrics section to dashboard (Precision, Recall, MAP, NDCG, TF-IDF, MRR)
Browse files- syscred/static/index.html +78 -0
syscred/static/index.html
CHANGED
|
@@ -853,6 +853,42 @@
|
|
| 853 |
</div>
|
| 854 |
</div>
|
| 855 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 856 |
<!-- GOOGLE-STYLE EXPLANATION -->
|
| 857 |
<div class="why-section" id="whySection" style="display: none;">
|
| 858 |
<div class="summary-title" style="margin-bottom: 1rem; color: #f59e0b;">
|
|
@@ -1210,6 +1246,48 @@
|
|
| 1210 |
eeatSection.style.display = 'none';
|
| 1211 |
}
|
| 1212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1213 |
// ========================================
|
| 1214 |
// DISPLAY "WHY THIS RESULT?" EXPLANATION
|
| 1215 |
// ========================================
|
|
|
|
| 853 |
</div>
|
| 854 |
</div>
|
| 855 |
|
| 856 |
+
<!-- TREC IR METRICS SECTION -->
|
| 857 |
+
<div class="trec-section" id="trecSection" style="display: none; background: rgba(139, 92, 246, 0.05); border: 1px solid rgba(139, 92, 246, 0.2); border-radius: 16px; padding: 1.5rem; margin-bottom: 2rem;">
|
| 858 |
+
<div class="summary-title" style="margin-bottom: 1rem; color: #8b5cf6;">
|
| 859 |
+
📈 Métriques IR (TREC)
|
| 860 |
+
<span class="help-icon" onclick="event.stopPropagation(); showTRECExplainer()" title="Information Retrieval metrics from TREC evaluation">?</span>
|
| 861 |
+
</div>
|
| 862 |
+
<p style="color: #8b8ba7; font-size: 0.9rem; margin-bottom: 1rem;">Métriques d'évaluation de recherche d'information</p>
|
| 863 |
+
|
| 864 |
+
<div class="trec-metrics-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem;">
|
| 865 |
+
<div class="trec-metric-card" style="background: rgba(255,255,255,0.02); border-radius: 10px; padding: 1rem; text-align: center;">
|
| 866 |
+
<div style="font-size: 0.8rem; color: #8b8ba7; margin-bottom: 0.5rem;">Precision</div>
|
| 867 |
+
<div id="trecPrecision" style="font-size: 1.5rem; font-weight: 700; color: #a78bfa;">--</div>
|
| 868 |
+
</div>
|
| 869 |
+
<div class="trec-metric-card" style="background: rgba(255,255,255,0.02); border-radius: 10px; padding: 1rem; text-align: center;">
|
| 870 |
+
<div style="font-size: 0.8rem; color: #8b8ba7; margin-bottom: 0.5rem;">Recall</div>
|
| 871 |
+
<div id="trecRecall" style="font-size: 1.5rem; font-weight: 700; color: #a78bfa;">--</div>
|
| 872 |
+
</div>
|
| 873 |
+
<div class="trec-metric-card" style="background: rgba(255,255,255,0.02); border-radius: 10px; padding: 1rem; text-align: center;">
|
| 874 |
+
<div style="font-size: 0.8rem; color: #8b8ba7; margin-bottom: 0.5rem;">MAP</div>
|
| 875 |
+
<div id="trecMAP" style="font-size: 1.5rem; font-weight: 700; color: #a78bfa;">--</div>
|
| 876 |
+
</div>
|
| 877 |
+
<div class="trec-metric-card" style="background: rgba(255,255,255,0.02); border-radius: 10px; padding: 1rem; text-align: center;">
|
| 878 |
+
<div style="font-size: 0.8rem; color: #8b8ba7; margin-bottom: 0.5rem;">NDCG</div>
|
| 879 |
+
<div id="trecNDCG" style="font-size: 1.5rem; font-weight: 700; color: #a78bfa;">--</div>
|
| 880 |
+
</div>
|
| 881 |
+
<div class="trec-metric-card" style="background: rgba(255,255,255,0.02); border-radius: 10px; padding: 1rem; text-align: center;">
|
| 882 |
+
<div style="font-size: 0.8rem; color: #8b8ba7; margin-bottom: 0.5rem;">TF-IDF Score</div>
|
| 883 |
+
<div id="trecTFIDF" style="font-size: 1.5rem; font-weight: 700; color: #a78bfa;">--</div>
|
| 884 |
+
</div>
|
| 885 |
+
<div class="trec-metric-card" style="background: rgba(255,255,255,0.02); border-radius: 10px; padding: 1rem; text-align: center;">
|
| 886 |
+
<div style="font-size: 0.8rem; color: #8b8ba7; margin-bottom: 0.5rem;">MRR</div>
|
| 887 |
+
<div id="trecMRR" style="font-size: 1.5rem; font-weight: 700; color: #a78bfa;">--</div>
|
| 888 |
+
</div>
|
| 889 |
+
</div>
|
| 890 |
+
</div>
|
| 891 |
+
|
| 892 |
<!-- GOOGLE-STYLE EXPLANATION -->
|
| 893 |
<div class="why-section" id="whySection" style="display: none;">
|
| 894 |
<div class="summary-title" style="margin-bottom: 1rem; color: #f59e0b;">
|
|
|
|
| 1246 |
eeatSection.style.display = 'none';
|
| 1247 |
}
|
| 1248 |
|
| 1249 |
+
// ========================================
|
| 1250 |
+
// DISPLAY TREC IR METRICS
|
| 1251 |
+
// ========================================
|
| 1252 |
+
const trecSection = document.getElementById('trecSection');
|
| 1253 |
+
const trecData = data.trec_metrics || data.ir_metrics || nlpAnalysis.ir_metrics || null;
|
| 1254 |
+
|
| 1255 |
+
if (trecData) {
|
| 1256 |
+
trecSection.style.display = 'block';
|
| 1257 |
+
|
| 1258 |
+
// Precision
|
| 1259 |
+
const precision = trecData.precision || trecData.P_10 || 0;
|
| 1260 |
+
document.getElementById('trecPrecision').textContent =
|
| 1261 |
+
typeof precision === 'number' ? (precision * 100).toFixed(1) + '%' : '--';
|
| 1262 |
+
|
| 1263 |
+
// Recall
|
| 1264 |
+
const recall = trecData.recall || trecData.recall_100 || 0;
|
| 1265 |
+
document.getElementById('trecRecall').textContent =
|
| 1266 |
+
typeof recall === 'number' ? (recall * 100).toFixed(1) + '%' : '--';
|
| 1267 |
+
|
| 1268 |
+
// MAP
|
| 1269 |
+
const map = trecData.map || trecData.MAP || 0;
|
| 1270 |
+
document.getElementById('trecMAP').textContent =
|
| 1271 |
+
typeof map === 'number' ? map.toFixed(3) : '--';
|
| 1272 |
+
|
| 1273 |
+
// NDCG
|
| 1274 |
+
const ndcg = trecData.ndcg || trecData.NDCG || 0;
|
| 1275 |
+
document.getElementById('trecNDCG').textContent =
|
| 1276 |
+
typeof ndcg === 'number' ? ndcg.toFixed(3) : '--';
|
| 1277 |
+
|
| 1278 |
+
// TF-IDF
|
| 1279 |
+
const tfidf = trecData.tfidf || trecData.tfidf_score || trecData.TF_IDF || 0;
|
| 1280 |
+
document.getElementById('trecTFIDF').textContent =
|
| 1281 |
+
typeof tfidf === 'number' ? tfidf.toFixed(3) : '--';
|
| 1282 |
+
|
| 1283 |
+
// MRR (Mean Reciprocal Rank)
|
| 1284 |
+
const mrr = trecData.mrr || trecData.recip_rank || trecData.MRR || 0;
|
| 1285 |
+
document.getElementById('trecMRR').textContent =
|
| 1286 |
+
typeof mrr === 'number' ? mrr.toFixed(3) : '--';
|
| 1287 |
+
} else {
|
| 1288 |
+
trecSection.style.display = 'none';
|
| 1289 |
+
}
|
| 1290 |
+
|
| 1291 |
// ========================================
|
| 1292 |
// DISPLAY "WHY THIS RESULT?" EXPLANATION
|
| 1293 |
// ========================================
|