Urdatorn commited on
Commit
bf6f94a
·
1 Parent(s): 5d33478

Replace broken Gradio Lite runtime with static leaderboard

Browse files
Files changed (2) hide show
  1. README.md +4 -4
  2. index.html +197 -81
README.md CHANGED
@@ -15,12 +15,12 @@ tags:
15
 
16
  # Sphragis Leaderboard
17
 
18
- A serverless Gradio-Lite leaderboard for the nine Sphragis Ancient Greek
19
  authorship-attribution tasks. It runs entirely in the visitor's browser and
20
- does not require CPU or GPU Space hardware.
21
 
22
- Scores are embedded as `results.csv` in `index.html` and are test macro-F1
23
- percentages. Add one row per reproducible model configuration. If validation
24
  produces statistically or numerically tied candidates, report every tied test
25
  result (or a range); never select a winner using the test split.
26
 
 
15
 
16
  # Sphragis Leaderboard
17
 
18
+ A serverless HTML leaderboard for the nine Sphragis Ancient Greek
19
  authorship-attribution tasks. It runs entirely in the visitor's browser and
20
+ does not require Python, Pyodide, CPU, or GPU Space hardware.
21
 
22
+ Scores are embedded in `index.html` and are test macro-F1 percentages. Add one
23
+ row per reproducible model configuration. If validation
24
  produces statistically or numerically tied candidates, report every tied test
25
  result (or a range); never select a winner using the test split.
26
 
index.html CHANGED
@@ -5,90 +5,206 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
  <title>Sphragis benchmark leaderboard</title>
7
  <meta name="description" content="Leaderboard for the Sphragis Ancient Greek authorship-attribution benchmark." />
8
- <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script>
9
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" />
10
  <style>
11
- html, body { margin: 0; min-height: 100%; }
12
- gradio-lite { display: block; min-height: 100vh; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  </style>
14
  </head>
15
  <body>
16
- <gradio-lite>
17
- <gradio-file name="app.py" entrypoint>
18
- import csv
19
-
20
- import gradio as gr
21
-
22
-
23
- def load_results():
24
- with open("results.csv", encoding="utf-8", newline="") as source:
25
- rows = [
26
- row
27
- for row in csv.reader(source)
28
- if any(cell.strip() for cell in row)
29
- ]
30
- if len(rows) &lt; 2:
31
- raise ValueError("No leaderboard rows found in results.csv")
32
- return rows[0], rows[1:]
33
-
34
-
35
- INTRODUCTION = """
36
- # Sphragis benchmark leaderboard
37
-
38
- Author attribution for Ancient Greek prose, sentence-aligned verse, and
39
- metrical lines. Every score is **test macro-F1 (%)**. The suffix is the number
40
- of sentences—or lines for `verse_metre`—in each evaluation example.
41
-
42
- Models are compared on the fixed, provenance-preserving Sphragis splits.
43
- Validation selects checkpoints and hyperparameters; test results are reported
44
- without using test performance to break validation ties.
45
- """
46
-
47
- METHODOLOGY = """
48
- ### Notes
49
-
50
- † Four GreBerta heads tied at validation macro-F1 1.0000 for
51
- `verse_sentence_100`. Their test macro-F1 scores were **92.82, 100.00, 100.00,
52
- and 92.51**, so the table reports the full **92.51–100.00** range rather than
53
- choosing the best test result.
54
-
55
- Four GreBerta heads tied at validation macro-F1 1.0000 for
56
- `verse_metre_100`; all four obtained test macro-F1 **96.10**.
57
-
58
- The variable-chunk GreBerta `_100` repair experiment is marked exploratory
59
- because its design followed inspection of an earlier `_100` test failure.
60
-
61
- ### Benchmark resources
62
-
63
- - [Dataset](https://huggingface.co/datasets/Urdatorn/sphragis)
64
- - [Model implementations](https://github.com/Urdatorn/sphragis_models)
65
- """
66
-
67
-
68
- headers, values = load_results()
69
-
70
- with gr.Blocks(title="Sphragis Leaderboard") as demo:
71
- gr.Markdown(INTRODUCTION)
72
- gr.Dataframe(
73
- headers=headers,
74
- value=values,
75
- datatype=["str"] * len(headers),
76
- interactive=False,
77
- show_search="filter",
78
- show_row_numbers=False,
79
- wrap=True,
80
- elem_id="sphragis-leaderboard",
81
- )
82
- gr.Markdown(METHODOLOGY)
83
-
84
-
85
- demo.launch()
86
- </gradio-file>
87
-
88
- <gradio-file name="results.csv">
89
- Model,Representation / classifier,Prose 1,Prose 10,Prose 100,Verse sentence 1,Verse sentence 10,Verse sentence 100,Verse metre 1,Verse metre 10,Verse metre 100,Status
90
- bowphs/GreBerta,"Frozen mean-pooled embeddings + MLP",83.50,96.36,97.69,74.63,80.77,92.51–100.00†,78.85,92.52,96.10‡,"Verse 100 exploratory"
91
- </gradio-file>
92
- </gradio-lite>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  </body>
94
  </html>
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
  <title>Sphragis benchmark leaderboard</title>
7
  <meta name="description" content="Leaderboard for the Sphragis Ancient Greek authorship-attribution benchmark." />
 
 
8
  <style>
9
+ :root {
10
+ color-scheme: light dark;
11
+ --background: #ffffff;
12
+ --panel: #ffffff;
13
+ --text: #171717;
14
+ --muted: #656565;
15
+ --border: #e5e7eb;
16
+ --header: #f7f7f8;
17
+ --input: #ffffff;
18
+ --focus: #2563eb;
19
+ --shadow: 0 1px 2px rgb(0 0 0 / 5%);
20
+ }
21
+
22
+ @media (prefers-color-scheme: dark) {
23
+ :root {
24
+ --background: #0b0f19;
25
+ --panel: #111827;
26
+ --text: #f3f4f6;
27
+ --muted: #a1a1aa;
28
+ --border: #303744;
29
+ --header: #1b2432;
30
+ --input: #111827;
31
+ --focus: #60a5fa;
32
+ --shadow: none;
33
+ }
34
+ }
35
+
36
+ * { box-sizing: border-box; }
37
+
38
+ body {
39
+ margin: 0;
40
+ background: var(--background);
41
+ color: var(--text);
42
+ font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
43
+ }
44
+
45
+ main {
46
+ width: min(100% - 32px, 1440px);
47
+ margin: 0 auto;
48
+ padding: 40px 0 64px;
49
+ }
50
+
51
+ h1 { margin: 0 0 14px; font-size: clamp(1.8rem, 4vw, 2.35rem); line-height: 1.2; }
52
+ h2 { margin: 34px 0 12px; font-size: 1.2rem; }
53
+ p { max-width: 880px; margin: 10px 0; }
54
+ a { color: var(--focus); }
55
+ code { font-size: 0.92em; }
56
+
57
+ .toolbar {
58
+ display: flex;
59
+ align-items: center;
60
+ justify-content: flex-end;
61
+ margin: 28px 0 10px;
62
+ }
63
+
64
+ label {
65
+ position: absolute;
66
+ width: 1px;
67
+ height: 1px;
68
+ padding: 0;
69
+ margin: -1px;
70
+ overflow: hidden;
71
+ clip: rect(0, 0, 0, 0);
72
+ white-space: nowrap;
73
+ border: 0;
74
+ }
75
+
76
+ input[type="search"] {
77
+ width: min(100%, 320px);
78
+ border: 1px solid var(--border);
79
+ border-radius: 8px;
80
+ background: var(--input);
81
+ color: var(--text);
82
+ padding: 9px 12px;
83
+ font: inherit;
84
+ box-shadow: var(--shadow);
85
+ }
86
+
87
+ input[type="search"]:focus {
88
+ outline: 2px solid var(--focus);
89
+ outline-offset: 1px;
90
+ }
91
+
92
+ .table-wrap {
93
+ overflow-x: auto;
94
+ border: 1px solid var(--border);
95
+ border-radius: 9px;
96
+ background: var(--panel);
97
+ box-shadow: var(--shadow);
98
+ }
99
+
100
+ table { width: 100%; border-collapse: collapse; white-space: nowrap; }
101
+ th, td { padding: 11px 13px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: left; }
102
+ th:last-child, td:last-child { border-right: 0; }
103
+ tbody tr:last-child td { border-bottom: 0; }
104
+ th { background: var(--header); font-size: 0.86rem; font-weight: 650; }
105
+ td { font-size: 0.9rem; }
106
+ tbody tr:hover { background: color-mix(in srgb, var(--focus) 5%, transparent); }
107
+ .empty { display: none; padding: 18px; color: var(--muted); text-align: center; }
108
+ .resource-list { margin: 8px 0; padding-left: 22px; }
109
  </style>
110
  </head>
111
  <body>
112
+ <main>
113
+ <h1>Sphragis benchmark leaderboard</h1>
114
+ <p>
115
+ Author attribution for Ancient Greek prose, sentence-aligned verse, and
116
+ metrical lines. Every score is <strong>test macro-F1 (%)</strong>. The suffix is the
117
+ number of sentences—or lines for <code>verse_metre</code>—in each evaluation example.
118
+ </p>
119
+ <p>
120
+ Models are compared on the fixed, provenance-preserving Sphragis splits.
121
+ Validation selects checkpoints and hyperparameters; test results are reported
122
+ without using test performance to break validation ties.
123
+ </p>
124
+
125
+ <div class="toolbar">
126
+ <label for="table-search">Filter leaderboard</label>
127
+ <input id="table-search" type="search" placeholder="Filter leaderboard…" autocomplete="off" />
128
+ </div>
129
+
130
+ <div class="table-wrap">
131
+ <table id="leaderboard">
132
+ <thead>
133
+ <tr>
134
+ <th>Model</th>
135
+ <th>Representation / classifier</th>
136
+ <th>Prose 1</th>
137
+ <th>Prose 10</th>
138
+ <th>Prose 100</th>
139
+ <th>Verse sentence 1</th>
140
+ <th>Verse sentence 10</th>
141
+ <th>Verse sentence 100</th>
142
+ <th>Verse metre 1</th>
143
+ <th>Verse metre 10</th>
144
+ <th>Verse metre 100</th>
145
+ <th>Status</th>
146
+ </tr>
147
+ </thead>
148
+ <tbody>
149
+ <tr>
150
+ <td>bowphs/GreBerta</td>
151
+ <td>Frozen mean-pooled embeddings + MLP</td>
152
+ <td>83.50</td>
153
+ <td>96.36</td>
154
+ <td>97.69</td>
155
+ <td>74.63</td>
156
+ <td>80.77</td>
157
+ <td>92.51–100.00†</td>
158
+ <td>78.85</td>
159
+ <td>92.52</td>
160
+ <td>96.10‡</td>
161
+ <td>Verse 100 exploratory</td>
162
+ </tr>
163
+ </tbody>
164
+ </table>
165
+ <div id="empty-message" class="empty">No leaderboard rows match this filter.</div>
166
+ </div>
167
+
168
+ <h2>Notes</h2>
169
+ <p>
170
+ † Four GreBerta heads tied at validation macro-F1 1.0000 for
171
+ <code>verse_sentence_100</code>. Their test macro-F1 scores were
172
+ <strong>92.82, 100.00, 100.00, and 92.51</strong>, so the table reports the full
173
+ <strong>92.51–100.00</strong> range rather than choosing the best test result.
174
+ </p>
175
+ <p>
176
+ ‡ Four GreBerta heads tied at validation macro-F1 1.0000 for
177
+ <code>verse_metre_100</code>; all four obtained test macro-F1 <strong>96.10</strong>.
178
+ </p>
179
+ <p>
180
+ The variable-chunk GreBerta <code>_100</code> repair experiment is marked exploratory
181
+ because its design followed inspection of an earlier <code>_100</code> test failure.
182
+ </p>
183
+
184
+ <h2>Benchmark resources</h2>
185
+ <ul class="resource-list">
186
+ <li><a href="https://huggingface.co/datasets/Urdatorn/sphragis">Dataset</a></li>
187
+ <li><a href="https://github.com/Urdatorn/sphragis_models">Model implementations</a></li>
188
+ </ul>
189
+ </main>
190
+
191
+ <script>
192
+ const search = document.querySelector("#table-search");
193
+ const rows = [...document.querySelectorAll("#leaderboard tbody tr")];
194
+ const empty = document.querySelector("#empty-message");
195
+
196
+ search.addEventListener("input", () => {
197
+ const query = search.value.trim().toLocaleLowerCase();
198
+ let visible = 0;
199
+
200
+ for (const row of rows) {
201
+ const matches = row.textContent.toLocaleLowerCase().includes(query);
202
+ row.hidden = !matches;
203
+ visible += Number(matches);
204
+ }
205
+
206
+ empty.style.display = visible ? "none" : "block";
207
+ });
208
+ </script>
209
  </body>
210
  </html>