ashesborn6 commited on
Commit
ba822bb
·
verified ·
1 Parent(s): 28e0fc9

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +28 -3
  2. index.html +160 -17
README.md CHANGED
@@ -1,10 +1,35 @@
1
  ---
2
  title: Retraction Status
3
- emoji: 💻
4
- colorFrom: indigo
5
  colorTo: purple
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: Retraction Status
3
+ emoji: 📚
4
+ colorFrom: blue
5
  colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ license: cc0-1.0
9
+ short_description: Source-attributed retraction status for a DOI
10
  ---
11
 
12
+ # Retraction status — citation provenance demo
13
+
14
+ Free lookup against a citation graph built from OpenAlex, Crossref and
15
+ Retraction Watch: paste a DOI (or an OpenAlex paper ID) and see which sources
16
+ report a retraction, at which source tier, with which date.
17
+
18
+ - **Every row is a source-attributed fact, not a verdict.** The verdict
19
+ (`CONTESTED` / `SUPPORTED` / `INSUFFICIENT_EVIDENCE`), the confidence and the
20
+ hop-by-hop evidence path come from the paid endpoint
21
+ `https://pay.ashesborn.cloud/api/v1/judge` ($0.02 per judgment, $0.10 with the
22
+ full evidence audit, settled per call over x402).
23
+ - Source tiers: **A** = publisher/registry retraction notice or Retraction Watch
24
+ record (weight 1.0), **B** = peer-reviewed citing text (0.6),
25
+ **C** = aggregator flags and citation lists (0.3).
26
+ - Underlying dataset (CC0): [ashesborn6/integrity-citation-retraction-graph](https://huggingface.co/datasets/ashesborn6/integrity-citation-retraction-graph)
27
+ - Code: [github.com/sadofriod/graphrag-ts](https://github.com/sadofriod/graphrag-ts)
28
+
29
+ This Space is a static page: it calls the public, CORS-enabled status endpoint
30
+ directly from your browser and stores nothing.
31
+
32
+ The MCP-compatible Gradio variant lives in the repository at
33
+ `deploy/hf-space/` and can be published as a Gradio Space once the account has
34
+ a PRO plan (Hugging Face requires PRO for Gradio/Docker Spaces on free
35
+ `cpu-basic` hardware).
index.html CHANGED
@@ -1,19 +1,162 @@
1
  <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </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>Retraction status — citation provenance</title>
7
+ <style>
8
+ :root { color-scheme: dark; }
9
+ * { box-sizing: border-box; }
10
+ body {
11
+ margin: 0; min-height: 100vh; padding: 40px 20px;
12
+ font: 16px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
13
+ background: radial-gradient(1200px 600px at 20% -10%, #1e293b 0%, #0b1120 55%, #070b14 100%);
14
+ color: #e2e8f0;
15
+ }
16
+ main { max-width: 860px; margin: 0 auto; }
17
+ h1 { font-size: 1.6rem; margin: 0 0 6px; letter-spacing: -0.01em; }
18
+ .sub { color: #94a3b8; margin: 0 0 26px; font-size: 0.95rem; }
19
+ .card {
20
+ background: rgba(148,163,184,0.07); border: 1px solid rgba(148,163,184,0.18);
21
+ border-radius: 14px; padding: 20px; margin-bottom: 18px;
22
+ }
23
+ label { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; margin-bottom: 6px; }
24
+ input {
25
+ width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid rgba(148,163,184,0.3);
26
+ background: #0b1120; color: #e2e8f0; font-size: 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
27
+ }
28
+ input:focus { outline: 2px solid #38bdf8; outline-offset: 1px; }
29
+ .row { display: flex; gap: 12px; flex-wrap: wrap; }
30
+ .row > div { flex: 1 1 260px; }
31
+ button {
32
+ margin-top: 16px; padding: 11px 20px; border-radius: 9px; border: 0; cursor: pointer;
33
+ background: linear-gradient(180deg,#38bdf8,#0ea5e9); color: #06202b; font-weight: 650; font-size: 0.98rem;
34
+ }
35
+ button:disabled { opacity: .55; cursor: progress; }
36
+ .hint { color: #64748b; font-size: 0.82rem; margin-top: 10px; }
37
+ #out { display: none; }
38
+ .paper-title { font-size: 1.12rem; font-weight: 600; margin: 0 0 4px; }
39
+ .meta { color: #94a3b8; font-size: 0.86rem; font-family: ui-monospace, Menlo, monospace; }
40
+ table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.92rem; }
41
+ th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(148,163,184,0.15); }
42
+ th { color: #94a3b8; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
43
+ .yes { color: #fca5a5; font-weight: 650; }
44
+ .no { color: #86efac; }
45
+ .tier { display: inline-block; min-width: 1.6em; text-align: center; padding: 1px 7px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
46
+ .tier.A { background: rgba(56,189,248,.18); color: #7dd3fc; }
47
+ .tier.B { background: rgba(167,139,250,.18); color: #c4b5fd; }
48
+ .tier.C { background: rgba(148,163,184,.18); color: #cbd5e1; }
49
+ .summary { margin-top: 14px; font-weight: 600; }
50
+ .err { color: #fca5a5; margin-top: 14px; }
51
+ footer { color: #64748b; font-size: 0.85rem; line-height: 1.6; margin-top: 6px; }
52
+ footer a { color: #7dd3fc; text-decoration: none; }
53
+ .pill { display:inline-block; padding:2px 8px; border-radius:999px; background:rgba(148,163,184,.16); font-size:.75rem; color:#cbd5e1; margin-left:6px; }
54
+ </style>
55
+ </head>
56
+ <body>
57
+ <main>
58
+ <h1>Retraction status <span class="pill">free</span></h1>
59
+ <p class="sub">Look a paper up in a citation graph built from OpenAlex, Crossref and Retraction&nbsp;Watch.
60
+ Every row is a source-attributed fact, not a verdict.</p>
61
+
62
+ <section class="card">
63
+ <div class="row">
64
+ <div>
65
+ <label for="doi">DOI</label>
66
+ <input id="doi" placeholder="10.1016/S0140-6736(97)11096-0" autocomplete="off" spellcheck="false">
67
+ </div>
68
+ <div>
69
+ <label for="pid">or OpenAlex paper ID</label>
70
+ <input id="pid" placeholder="W2117847125" autocomplete="off" spellcheck="false">
71
+ </div>
72
+ </div>
73
+ <button id="go">Check status</button>
74
+ <p class="hint">Exactly one field. Try Wakefield 1998 with the DOI above.</p>
75
+ </section>
76
+
77
+ <section class="card" id="out">
78
+ <div class="paper-title" id="ptitle"></div>
79
+ <div class="meta" id="pmeta"></div>
80
+ <div id="tableWrap"></div>
81
+ <div class="summary" id="summary"></div>
82
+ <div class="err" id="err"></div>
83
+ </section>
84
+
85
+ <footer>
86
+ Full verdict (<code>CONTESTED</code> / <code>SUPPORTED</code> / <code>INSUFFICIENT_EVIDENCE</code>),
87
+ confidence and the hop-by-hop evidence path come from the paid endpoint
88
+ <a href="https://pay.ashesborn.cloud/api/v1/judge">/api/v1/judge</a> — $0.02 per judgment,
89
+ $0.10 with the full evidence audit, settled per call over x402.<br>
90
+ Underlying dataset: <a href="https://huggingface.co/datasets/ashesborn6/integrity-citation-retraction-graph">ashesborn6/integrity-citation-retraction-graph</a> ·
91
+ Code: <a href="https://github.com/sadofriod/graphrag-ts">graphrag-ts</a>
92
+ </footer>
93
+ </main>
94
+ <script>
95
+ const API = "https://pay-hk.ashesborn.cloud/api/v1/judge/paper";
96
+ const $ = (id) => document.getElementById(id);
97
+ const esc = (s) => String(s ?? "").replace(/[&<>"']/g, (c) => ({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[c]));
98
+
99
+ function reset() {
100
+ $("out").style.display = "block";
101
+ $("ptitle").textContent = "";
102
+ $("pmeta").textContent = "";
103
+ $("tableWrap").innerHTML = "";
104
+ $("summary").textContent = "";
105
+ $("err").textContent = "";
106
+ }
107
+
108
+ function renderTable(statuses) {
109
+ const order = { A: 0, B: 1, C: 2, D: 3 };
110
+ const rows = statuses
111
+ .filter((s) => s && typeof s === "object")
112
+ .sort((a, b) => (order[a.source_tier] ?? 4) - (order[b.source_tier] ?? 4) || String(a.source).localeCompare(String(b.source)));
113
+ if (!rows.length) { $("tableWrap").innerHTML = '<p class="hint">No source reports a status for this paper.</p>'; return []; }
114
+ const body = rows.map((s) => {
115
+ const tier = esc(s.source_tier || "?");
116
+ return `<tr>
117
+ <td>${esc(s.source)}</td>
118
+ <td><span class="tier ${tier}">${tier}</span></td>
119
+ <td class="${s.is_retracted ? "yes" : "no"}">${s.is_retracted ? "retracted" : "no retraction"}</td>
120
+ <td>${esc(s.retraction_date || "—")}</td>
121
+ </tr>`;
122
+ }).join("");
123
+ $("tableWrap").innerHTML = `<table><thead><tr><th>Source</th><th>Tier</th><th>Status</th><th>Date</th></tr></thead><tbody>${body}</tbody></table>`;
124
+ return rows;
125
+ }
126
+
127
+ async function lookup() {
128
+ const doi = $("doi").value.trim();
129
+ const pid = $("pid").value.trim();
130
+ reset();
131
+ if (Boolean(doi) === Boolean(pid)) { $("err").textContent = "Enter exactly one: a DOI or an OpenAlex paper ID."; return; }
132
+ const url = `${API}?${doi ? "doi=" + encodeURIComponent(doi) : "paper_id=" + encodeURIComponent(pid)}`;
133
+ $("go").disabled = true;
134
+ try {
135
+ const res = await fetch(url, { headers: { accept: "application/json" } });
136
+ if (res.status === 404) { $("err").textContent = "This paper is not in the published snapshot."; return; }
137
+ if (res.status === 503) { $("err").textContent = "No snapshot is active right now — try again later."; return; }
138
+ if (!res.ok) { $("err").textContent = `Unexpected response (${res.status}).`; return; }
139
+ const data = await res.json();
140
+ const p = data.paper || {};
141
+ if (!p.paper_id) { $("err").textContent = "This paper is not in the published snapshot."; return; }
142
+ $("ptitle").textContent = p.title || "Untitled";
143
+ $("pmeta").textContent = [p.year, p.doi].filter(Boolean).join(" · ");
144
+ const statuses = Array.isArray(data.statuses) ? data.statuses : [];
145
+ const rows = renderTable(statuses);
146
+ const sources = new Set(rows.map((r) => r.source));
147
+ const asserting = new Set(rows.filter((r) => r.is_retracted).map((r) => r.source));
148
+ $("summary").textContent = rows.length
149
+ ? `${asserting.size} of ${sources.size} independent sources assert a retraction.`
150
+ : "";
151
+ } catch (e) {
152
+ $("err").textContent = "The status service could not be reached. Try again in a moment.";
153
+ } finally {
154
+ $("go").disabled = false;
155
+ }
156
+ }
157
+
158
+ $("go").addEventListener("click", lookup);
159
+ ["doi", "pid"].forEach((id) => $(id).addEventListener("keydown", (e) => { if (e.key === "Enter") lookup(); }));
160
+ </script>
161
+ </body>
162
  </html>