Spaces:
Sleeping
Sleeping
Delete templates
Browse files- templates/dashboard.html +0 -128
- templates/index.html +0 -75
- templates/results.html +0 -153
templates/dashboard.html
DELETED
|
@@ -1,128 +0,0 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Evaluation Dashboard</title>
|
| 7 |
-
<link rel="stylesheet" href="/static/style.css">
|
| 8 |
-
</head>
|
| 9 |
-
<body>
|
| 10 |
-
|
| 11 |
-
<nav>
|
| 12 |
-
<a href="/" class="brand">🔍 Semantic Search</a>
|
| 13 |
-
<a href="/">Search</a>
|
| 14 |
-
<a href="/dashboard">Dashboard</a>
|
| 15 |
-
</nav>
|
| 16 |
-
|
| 17 |
-
<div class="container">
|
| 18 |
-
|
| 19 |
-
<div style="margin-top:1.5rem;">
|
| 20 |
-
<div class="dash-title">Evaluation Dashboard</div>
|
| 21 |
-
<div class="dash-sub">
|
| 22 |
-
BEIR Benchmark — Full pipeline (Dense + BM25 + RRF + Cross-Encoder)
|
| 23 |
-
</div>
|
| 24 |
-
</div>
|
| 25 |
-
|
| 26 |
-
{% if datasets %}
|
| 27 |
-
|
| 28 |
-
<!-- metric cards -->
|
| 29 |
-
<div class="dash-grid">
|
| 30 |
-
{% for d in datasets %}
|
| 31 |
-
<div class="metric-card">
|
| 32 |
-
<h3>
|
| 33 |
-
{% if d.name == "scifact" %}🔬{% else %}🏥{% endif %}
|
| 34 |
-
{{ d.name | title }}
|
| 35 |
-
<span style="font-size:0.76rem;color:#999;font-weight:400;">
|
| 36 |
-
— {{ d.queries }} queries
|
| 37 |
-
</span>
|
| 38 |
-
</h3>
|
| 39 |
-
|
| 40 |
-
<div class="metric-row">
|
| 41 |
-
<span class="metric-label">NDCG@10</span>
|
| 42 |
-
<div class="bar-wrap">
|
| 43 |
-
<div class="bar green" style="width:{{ (d.ndcg * 100) | round(1) }}%"></div>
|
| 44 |
-
</div>
|
| 45 |
-
<span class="metric-val">{{ "%.4f" | format(d.ndcg) }}</span>
|
| 46 |
-
</div>
|
| 47 |
-
|
| 48 |
-
<div class="metric-row">
|
| 49 |
-
<span class="metric-label">MRR</span>
|
| 50 |
-
<div class="bar-wrap">
|
| 51 |
-
<div class="bar" style="width:{{ (d.mrr * 100) | round(1) }}%"></div>
|
| 52 |
-
</div>
|
| 53 |
-
<span class="metric-val">{{ "%.4f" | format(d.mrr) }}</span>
|
| 54 |
-
</div>
|
| 55 |
-
|
| 56 |
-
<div class="metric-row">
|
| 57 |
-
<span class="metric-label">MAP@100</span>
|
| 58 |
-
<div class="bar-wrap">
|
| 59 |
-
<div class="bar amber" style="width:{{ (d.map * 100) | round(1) }}%"></div>
|
| 60 |
-
</div>
|
| 61 |
-
<span class="metric-val">{{ "%.4f" | format(d.map) }}</span>
|
| 62 |
-
</div>
|
| 63 |
-
|
| 64 |
-
<div class="metric-row">
|
| 65 |
-
<span class="metric-label">Recall@100</span>
|
| 66 |
-
<div class="bar-wrap">
|
| 67 |
-
<div class="bar" style="width:{{ (d.recall * 100) | round(1) }}%"></div>
|
| 68 |
-
</div>
|
| 69 |
-
<span class="metric-val">{{ "%.4f" | format(d.recall) }}</span>
|
| 70 |
-
</div>
|
| 71 |
-
|
| 72 |
-
<div class="metric-row">
|
| 73 |
-
<span class="metric-label">P@10</span>
|
| 74 |
-
<div class="bar-wrap">
|
| 75 |
-
<div class="bar amber" style="width:{{ (d.precision * 100) | round(1) }}%"></div>
|
| 76 |
-
</div>
|
| 77 |
-
<span class="metric-val">{{ "%.4f" | format(d.precision) }}</span>
|
| 78 |
-
</div>
|
| 79 |
-
</div>
|
| 80 |
-
{% endfor %}
|
| 81 |
-
</div>
|
| 82 |
-
|
| 83 |
-
<!-- ablation tables -->
|
| 84 |
-
{% for d in datasets %}
|
| 85 |
-
<div class="section-label">
|
| 86 |
-
Ablation Table — {{ d.name | title }}
|
| 87 |
-
</div>
|
| 88 |
-
<div class="table-card">
|
| 89 |
-
<table>
|
| 90 |
-
<thead>
|
| 91 |
-
<tr>
|
| 92 |
-
<th>Mode</th>
|
| 93 |
-
<th>NDCG@10</th>
|
| 94 |
-
<th>MAP@100</th>
|
| 95 |
-
<th>MRR</th>
|
| 96 |
-
<th>Recall@100</th>
|
| 97 |
-
<th>P@10</th>
|
| 98 |
-
</tr>
|
| 99 |
-
</thead>
|
| 100 |
-
<tbody>
|
| 101 |
-
{% for mode_name, m in d.modes.items() %}
|
| 102 |
-
<tr {% if mode_name == "full" %}class="best"{% endif %}>
|
| 103 |
-
<td>{{ mode_name }}</td>
|
| 104 |
-
<td>{{ "%.4f" | format(m.get("NDCG@10", 0)) }}</td>
|
| 105 |
-
<td>{{ "%.4f" | format(m.get("MAP@100", 0)) }}</td>
|
| 106 |
-
<td>{{ "%.4f" | format(m.get("MRR", 0)) }}</td>
|
| 107 |
-
<td>{{ "%.4f" | format(m.get("Recall@100", 0)) }}</td>
|
| 108 |
-
<td>{{ "%.4f" | format(m.get("P@10", 0)) }}</td>
|
| 109 |
-
</tr>
|
| 110 |
-
{% endfor %}
|
| 111 |
-
</tbody>
|
| 112 |
-
</table>
|
| 113 |
-
</div>
|
| 114 |
-
{% endfor %}
|
| 115 |
-
|
| 116 |
-
{% else %}
|
| 117 |
-
<div class="no-results">
|
| 118 |
-
<p>No evaluation results found.</p>
|
| 119 |
-
<p style="margin-top:0.5rem;font-size:0.85rem;">
|
| 120 |
-
Run:
|
| 121 |
-
<code>python -m evaluation.run_eval --datasets scifact nfcorpus --mode all</code>
|
| 122 |
-
</p>
|
| 123 |
-
</div>
|
| 124 |
-
{% endif %}
|
| 125 |
-
|
| 126 |
-
</div>
|
| 127 |
-
</body>
|
| 128 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/index.html
DELETED
|
@@ -1,75 +0,0 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Semantic Search Engine</title>
|
| 7 |
-
<link rel="stylesheet" href="/static/style.css">
|
| 8 |
-
</head>
|
| 9 |
-
<body>
|
| 10 |
-
|
| 11 |
-
<nav>
|
| 12 |
-
<a href="/" class="brand">🔍 Semantic Search</a>
|
| 13 |
-
<a href="/">Search</a>
|
| 14 |
-
<a href="/dashboard">Dashboard</a>
|
| 15 |
-
</nav>
|
| 16 |
-
|
| 17 |
-
<div class="container">
|
| 18 |
-
<div class="hero">
|
| 19 |
-
<h1>Semantic File Search Engine</h1>
|
| 20 |
-
<p>AI-powered search across SciFact and NFCorpus using Dense + BM25 + RRF + Cross-Encoder</p>
|
| 21 |
-
|
| 22 |
-
<div class="stats">
|
| 23 |
-
<span class="stat-pill">🔬 SciFact — {{ scifact_count }} queries</span>
|
| 24 |
-
<span class="stat-pill">🏥 NFCorpus — {{ nfcorpus_count }} queries</span>
|
| 25 |
-
</div>
|
| 26 |
-
</div>
|
| 27 |
-
|
| 28 |
-
{% if error %}
|
| 29 |
-
<div class="error-box">{{ error }}</div>
|
| 30 |
-
{% endif %}
|
| 31 |
-
|
| 32 |
-
<div class="search-card">
|
| 33 |
-
<form action="/search" method="post">
|
| 34 |
-
<div class="search-row">
|
| 35 |
-
<input
|
| 36 |
-
class="search-input"
|
| 37 |
-
type="text"
|
| 38 |
-
name="query"
|
| 39 |
-
placeholder="e.g. vitamin D deficiency cancer risk"
|
| 40 |
-
autofocus
|
| 41 |
-
required
|
| 42 |
-
/>
|
| 43 |
-
<button class="btn-search" type="submit">Search</button>
|
| 44 |
-
</div>
|
| 45 |
-
<div class="filters">
|
| 46 |
-
<label>Top results:</label>
|
| 47 |
-
<select name="top_k">
|
| 48 |
-
<option value="5">5</option>
|
| 49 |
-
<option value="10" selected>10</option>
|
| 50 |
-
<option value="20">20</option>
|
| 51 |
-
</select>
|
| 52 |
-
</div>
|
| 53 |
-
</form>
|
| 54 |
-
</div>
|
| 55 |
-
|
| 56 |
-
<div class="sample-queries">
|
| 57 |
-
<p>Try a sample query:</p>
|
| 58 |
-
{% for q in [
|
| 59 |
-
"vitamin D cancer",
|
| 60 |
-
"BRCA1 breast cancer",
|
| 61 |
-
"smoking lung disease",
|
| 62 |
-
"mRNA vaccine immune",
|
| 63 |
-
"diabetes insulin resistance",
|
| 64 |
-
"protein folding structure"
|
| 65 |
-
] %}
|
| 66 |
-
<button class="sample-btn"
|
| 67 |
-
onclick="document.querySelector('.search-input').value='{{ q }}'">
|
| 68 |
-
{{ q }}
|
| 69 |
-
</button>
|
| 70 |
-
{% endfor %}
|
| 71 |
-
</div>
|
| 72 |
-
</div>
|
| 73 |
-
|
| 74 |
-
</body>
|
| 75 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/results.html
DELETED
|
@@ -1,153 +0,0 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Results — {{ query }}</title>
|
| 7 |
-
<link rel="stylesheet" href="/static/style.css">
|
| 8 |
-
</head>
|
| 9 |
-
<body>
|
| 10 |
-
|
| 11 |
-
<nav>
|
| 12 |
-
<a href="/" class="brand">🔍 Semantic Search</a>
|
| 13 |
-
<a href="/">Search</a>
|
| 14 |
-
<a href="/dashboard">Dashboard</a>
|
| 15 |
-
</nav>
|
| 16 |
-
|
| 17 |
-
<div class="container">
|
| 18 |
-
|
| 19 |
-
<!-- search bar stays on results page -->
|
| 20 |
-
<div class="search-card" style="margin-top:1.5rem; max-width:100%;">
|
| 21 |
-
<form action="/search" method="post">
|
| 22 |
-
<div class="search-row">
|
| 23 |
-
<input
|
| 24 |
-
class="search-input"
|
| 25 |
-
type="text"
|
| 26 |
-
name="query"
|
| 27 |
-
value="{{ query }}"
|
| 28 |
-
required
|
| 29 |
-
/>
|
| 30 |
-
<button class="btn-search" type="submit">Search</button>
|
| 31 |
-
</div>
|
| 32 |
-
<div class="filters">
|
| 33 |
-
<label>Top results:</label>
|
| 34 |
-
<select name="top_k">
|
| 35 |
-
<option value="5" {% if top_k==5 %}selected{% endif %}>5</option>
|
| 36 |
-
<option value="10" {% if top_k==10 %}selected{% endif %}>10</option>
|
| 37 |
-
<option value="20" {% if top_k==20 %}selected{% endif %}>20</option>
|
| 38 |
-
</select>
|
| 39 |
-
</div>
|
| 40 |
-
</form>
|
| 41 |
-
</div>
|
| 42 |
-
|
| 43 |
-
<div class="results-layout">
|
| 44 |
-
|
| 45 |
-
<!-- LEFT — ranked results -->
|
| 46 |
-
<div>
|
| 47 |
-
<div class="results-header">
|
| 48 |
-
<h2>Results for "{{ query }}"</h2>
|
| 49 |
-
<div class="results-meta">
|
| 50 |
-
{{ total }} result{{ "s" if total != 1 else "" }}
|
| 51 |
-
· {{ elapsed }}s
|
| 52 |
-
· Full pipeline
|
| 53 |
-
</div>
|
| 54 |
-
</div>
|
| 55 |
-
|
| 56 |
-
{% if expanded_query and expanded_query != query %}
|
| 57 |
-
<div class="expanded-tag">
|
| 58 |
-
<strong>Expanded:</strong> {{ expanded_query }}
|
| 59 |
-
</div>
|
| 60 |
-
{% endif %}
|
| 61 |
-
|
| 62 |
-
{% if results %}
|
| 63 |
-
{% for r in results %}
|
| 64 |
-
<div class="result-card">
|
| 65 |
-
<div class="result-top">
|
| 66 |
-
<div class="result-title">
|
| 67 |
-
{{ r.icon }} {{ r.doc_id }}
|
| 68 |
-
</div>
|
| 69 |
-
<div class="result-score">{{ r.score }}</div>
|
| 70 |
-
</div>
|
| 71 |
-
|
| 72 |
-
<div class="result-snippet">{{ r.snippet }}</div>
|
| 73 |
-
|
| 74 |
-
<div class="result-footer">
|
| 75 |
-
{% if r.dataset == "scifact" %}
|
| 76 |
-
<span class="badge badge-scifact">🔬 SciFact</span>
|
| 77 |
-
{% elif r.dataset == "nfcorpus" %}
|
| 78 |
-
<span class="badge badge-nfcorpus">🏥 NFCorpus</span>
|
| 79 |
-
{% else %}
|
| 80 |
-
<span class="badge badge-file">📁 File</span>
|
| 81 |
-
{% endif %}
|
| 82 |
-
</div>
|
| 83 |
-
</div>
|
| 84 |
-
{% endfor %}
|
| 85 |
-
|
| 86 |
-
{% else %}
|
| 87 |
-
<div class="no-results">
|
| 88 |
-
<p>No results found for "<strong>{{ query }}</strong>"</p>
|
| 89 |
-
<p style="margin-top:0.5rem; font-size:0.85rem; color:#bbb;">
|
| 90 |
-
Try shorter or different keywords.
|
| 91 |
-
</p>
|
| 92 |
-
</div>
|
| 93 |
-
{% endif %}
|
| 94 |
-
</div>
|
| 95 |
-
|
| 96 |
-
<!-- RIGHT — matched dataset queries -->
|
| 97 |
-
<div>
|
| 98 |
-
|
| 99 |
-
<!-- SciFact panel -->
|
| 100 |
-
<div class="query-panel">
|
| 101 |
-
<div class="panel-header scifact">
|
| 102 |
-
🔬 SciFact Queries
|
| 103 |
-
<span class="panel-count">{{ scifact_matches | length }}</span>
|
| 104 |
-
</div>
|
| 105 |
-
{% if scifact_matches %}
|
| 106 |
-
{% for q in scifact_matches %}
|
| 107 |
-
<div class="query-item">
|
| 108 |
-
<div class="query-id">Query #{{ q.query_id }}</div>
|
| 109 |
-
<div class="query-text">{{ q.query_text }}</div>
|
| 110 |
-
</div>
|
| 111 |
-
{% endfor %}
|
| 112 |
-
{% else %}
|
| 113 |
-
<div class="panel-empty">
|
| 114 |
-
No SciFact queries matched "{{ query }}"
|
| 115 |
-
</div>
|
| 116 |
-
{% endif %}
|
| 117 |
-
</div>
|
| 118 |
-
|
| 119 |
-
<!-- NFCorpus panel -->
|
| 120 |
-
<div class="query-panel">
|
| 121 |
-
<div class="panel-header nfcorpus">
|
| 122 |
-
🏥 NFCorpus Queries
|
| 123 |
-
<span class="panel-count">{{ nfcorpus_matches | length }}</span>
|
| 124 |
-
</div>
|
| 125 |
-
{% if nfcorpus_matches %}
|
| 126 |
-
{% for q in nfcorpus_matches %}
|
| 127 |
-
<div class="query-item">
|
| 128 |
-
<div class="query-id">Query #{{ q.query_id }}</div>
|
| 129 |
-
<div class="query-text">{{ q.query_text }}</div>
|
| 130 |
-
</div>
|
| 131 |
-
{% endfor %}
|
| 132 |
-
{% else %}
|
| 133 |
-
<div class="panel-empty">
|
| 134 |
-
No NFCorpus queries matched "{{ query }}"
|
| 135 |
-
</div>
|
| 136 |
-
{% endif %}
|
| 137 |
-
</div>
|
| 138 |
-
|
| 139 |
-
<!-- info box -->
|
| 140 |
-
<div class="panel-info">
|
| 141 |
-
These are actual evaluation queries from the BEIR benchmark
|
| 142 |
-
that share keywords with your search.
|
| 143 |
-
<br><br>
|
| 144 |
-
<strong>300</strong> SciFact queries ·
|
| 145 |
-
<strong>323</strong> NFCorpus queries loaded.
|
| 146 |
-
</div>
|
| 147 |
-
|
| 148 |
-
</div>
|
| 149 |
-
</div>
|
| 150 |
-
</div>
|
| 151 |
-
|
| 152 |
-
</body>
|
| 153 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|