Spaces:
Running
Running
Build static Sphragis leaderboard
Browse files- README.md +26 -6
- index.html +81 -48
README.md
CHANGED
|
@@ -1,11 +1,31 @@
|
|
| 1 |
---
|
| 2 |
title: Sphragis Leaderboard
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
-
pinned:
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Sphragis Leaderboard
|
| 3 |
+
emoji: 🥇
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: static
|
| 7 |
+
pinned: true
|
| 8 |
+
license: apache-2.0
|
| 9 |
+
short_description: Leaderboard for Ancient Greek author attribution
|
| 10 |
+
tags:
|
| 11 |
+
- leaderboard
|
| 12 |
+
- authorship-attribution
|
| 13 |
+
- ancient-greek
|
| 14 |
---
|
| 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 |
+
|
| 27 |
+
To test locally, serve the repository over HTTP and open the displayed URL:
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
python3 -m http.server 8000
|
| 31 |
+
```
|
index.html
CHANGED
|
@@ -1,57 +1,90 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
<body>
|
| 21 |
-
<gradio-lite>
|
| 22 |
-
<gradio-file name="app.py" entrypoint>
|
| 23 |
import gradio as gr
|
| 24 |
|
| 25 |
-
from filters import as_gray
|
| 26 |
|
| 27 |
-
def
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
demo = gr.Interface(
|
| 32 |
-
process,
|
| 33 |
-
"image",
|
| 34 |
-
"image",
|
| 35 |
-
examples=["lion.jpg", "logo.png"],
|
| 36 |
-
)
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
| 45 |
-
return rgb2gray(image)
|
| 46 |
-
</gradio-file>
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
</html>
|
|
|
|
| 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" />
|
| 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 = list(csv.reader(source))
|
| 26 |
+
if len(rows) < 2:
|
| 27 |
+
raise ValueError("No leaderboard rows found in results.csv")
|
| 28 |
+
return rows[0], rows[1:]
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
INTRODUCTION = """
|
| 32 |
+
# Sphragis benchmark leaderboard
|
| 33 |
+
|
| 34 |
+
Author attribution for Ancient Greek prose, sentence-aligned verse, and
|
| 35 |
+
metrical lines. Every score is **test macro-F1 (%)**. The suffix is the number
|
| 36 |
+
of sentences—or lines for `verse_metre`—in each evaluation example.
|
| 37 |
+
|
| 38 |
+
Models are compared on the fixed, provenance-preserving Sphragis splits.
|
| 39 |
+
Validation selects checkpoints and hyperparameters; test results are reported
|
| 40 |
+
without using test performance to break validation ties.
|
| 41 |
+
"""
|
| 42 |
+
|
| 43 |
+
METHODOLOGY = """
|
| 44 |
+
### Notes
|
| 45 |
+
|
| 46 |
+
† Four GreBerta heads tied at validation macro-F1 1.0000 for
|
| 47 |
+
`verse_sentence_100`. Their test macro-F1 scores were **92.82, 100.00, 100.00,
|
| 48 |
+
and 92.51**, so the table reports the full **92.51–100.00** range rather than
|
| 49 |
+
choosing the best test result.
|
| 50 |
+
|
| 51 |
+
‡ Four GreBerta heads tied at validation macro-F1 1.0000 for
|
| 52 |
+
`verse_metre_100`; all four obtained test macro-F1 **96.10**.
|
| 53 |
|
| 54 |
+
The variable-chunk GreBerta `_100` repair experiment is marked exploratory
|
| 55 |
+
because its design followed inspection of an earlier `_100` test failure.
|
| 56 |
|
| 57 |
+
### Benchmark resources
|
|
|
|
|
|
|
| 58 |
|
| 59 |
+
- [Dataset](https://huggingface.co/datasets/Urdatorn/sphragis)
|
| 60 |
+
- [Model implementations](https://github.com/Urdatorn/sphragis_models)
|
| 61 |
+
"""
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
headers, values = load_results()
|
| 65 |
+
|
| 66 |
+
with gr.Blocks(title="Sphragis Leaderboard") as demo:
|
| 67 |
+
gr.Markdown(INTRODUCTION)
|
| 68 |
+
gr.Dataframe(
|
| 69 |
+
headers=headers,
|
| 70 |
+
value=values,
|
| 71 |
+
datatype=["str"] * len(headers),
|
| 72 |
+
interactive=False,
|
| 73 |
+
show_search="filter",
|
| 74 |
+
show_row_numbers=False,
|
| 75 |
+
wrap=True,
|
| 76 |
+
elem_id="sphragis-leaderboard",
|
| 77 |
+
)
|
| 78 |
+
gr.Markdown(METHODOLOGY)
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
demo.launch()
|
| 82 |
+
</gradio-file>
|
| 83 |
|
| 84 |
+
<gradio-file name="results.csv">
|
| 85 |
+
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
|
| 86 |
+
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"
|
| 87 |
+
</gradio-file>
|
| 88 |
+
</gradio-lite>
|
| 89 |
+
</body>
|
| 90 |
+
</html>
|