Skip to content

Commit 4682920

Browse files
committed
site: OpenAPI matches production; About gains the results section
The OpenAPI document advertised the retired server URL (interscript.org/api) and documented a GET form the live API does not implement. Now: server https://api.interscript.org/v1, POST-only /transliterate, and the missing /infer (neural models) and /info endpoints - every path verified against production before documenting. About gains a 'What the measurements show' section in plain user language: the benchmark outcome for our Arabic model, the frontier- model comparison (including the one figure we could not reproduce, stated as such), the browser-size model, and a link to the full tables on /ml.
1 parent 98c63ed commit 4682920

2 files changed

Lines changed: 94 additions & 60 deletions

File tree

src/pages/about.astro

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,25 @@ const partners: Partner[] = [
123123
</p>
124124
</section>
125125

126+
<section>
127+
<h2>What the measurements show</h2>
128+
<p>
129+
For conversions no authority document covers — restoring the diacritics a scribe left out,
130+
or reading unwritten Thai as phonemes — we train neural models and measure them the same
131+
way we test maps. On the public Arabic benchmark SadeedDiac-25, our Arabic model scores
132+
2.29% error with 580 million parameters: better than every general-purpose language model
133+
we measured it against (one vendor-published figure is lower; we could not reproduce it),
134+
and about three times better than the 1.5-billion-parameter system the benchmark was
135+
published with. The newest general-purpose models we tested were three to five times
136+
worse than their predecessor on this task. One of our models is small enough (95 MB) to
137+
run in a web browser.
138+
</p>
139+
<p>
140+
Every score, the method used to produce it, and the full results table are on
141+
<a href="/ml">the neural layer page</a>.
142+
</p>
143+
</section>
144+
126145
<section>
127146
<h2>History</h2>
128147
<p>

src/pages/openapi.json.ts

Lines changed: 75 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -32,77 +32,20 @@ const spec = {
3232
url: "https://opensource.org/license/bsd-2-clause",
3333
},
3434
},
35-
servers: [{ url: `${SITE}/api` }],
35+
servers: [{ url: "https://api.interscript.org/v1" }],
3636
tags: [
3737
{ name: "transliterate", description: "Run a transliteration system" },
3838
{ name: "systems", description: "Browse the system catalogue" },
3939
{ name: "detect", description: "Find a matching system" },
40+
{ name: "infer", description: "Run a neural model" },
4041
],
4142
paths: {
4243
"/transliterate": {
43-
get: {
44-
tags: ["transliterate"],
45-
summary: "Transliterate a single string",
46-
description:
47-
"Translates non-Latin text into Latin (or another script) using the named authority system. Idempotent, cacheable for the lifetime of a system version.",
48-
operationId: "transliterateGet",
49-
parameters: [
50-
{
51-
name: "system",
52-
in: "query",
53-
required: true,
54-
description: "Interscript system code (e.g. `bgnpcgn-ukr-Cyrl-Latn-2019`).",
55-
schema: { type: "string", maxLength: 200 },
56-
example: "bgnpcgn-ukr-Cyrl-Latn-2019",
57-
},
58-
{
59-
name: "input",
60-
in: "query",
61-
required: true,
62-
description: "Source text to transliterate.",
63-
schema: { type: "string", maxLength: 10_000 },
64-
example: "Антон",
65-
},
66-
{
67-
name: "stage",
68-
in: "query",
69-
required: false,
70-
description: "Stage to execute (default: `main`).",
71-
schema: { type: "string", default: "main" },
72-
},
73-
],
74-
responses: {
75-
"200": {
76-
description: "Successful transliteration.",
77-
content: {
78-
"application/json": {
79-
schema: { $ref: "#/components/schemas/TransliterationResult" },
80-
},
81-
},
82-
},
83-
"400": {
84-
description: "Missing or invalid parameters.",
85-
content: {
86-
"application/json": {
87-
schema: { $ref: "#/components/schemas/Error" },
88-
},
89-
},
90-
},
91-
"404": {
92-
description: "System not found.",
93-
content: {
94-
"application/json": {
95-
schema: { $ref: "#/components/schemas/Error" },
96-
},
97-
},
98-
},
99-
},
100-
},
10144
post: {
10245
tags: ["transliterate"],
10346
summary: "Transliterate via JSON body",
10447
description:
105-
"Same as GET /transliterate but accepts a JSON body — useful when input is large, contains newlines, or you prefer POST semantics.",
48+
"Accepts a JSON body. The only request form this endpoint supports — query-parameter GET requests are not implemented.",
10649
operationId: "transliteratePost",
10750
requestBody: {
10851
required: true,
@@ -233,6 +176,78 @@ const spec = {
233176
},
234177
},
235178
},
179+
"/infer": {
180+
post: {
181+
tags: ["infer"],
182+
summary: "Run a neural model",
183+
description:
184+
"Runs a neural model from the model index (diacritization, grapheme-to-phoneme). Model ids and their measured scores are listed in the models.yaml index; see interscript.org/ml for the catalogue.",
185+
operationId: "inferPost",
186+
requestBody: {
187+
required: true,
188+
content: {
189+
"application/json": {
190+
schema: {
191+
type: "object",
192+
required: ["model", "input"],
193+
properties: {
194+
model: { type: "string", example: "ara-diac-small-2.1" },
195+
input: { type: "string", example: "كتاب" },
196+
},
197+
},
198+
},
199+
},
200+
},
201+
responses: {
202+
"200": {
203+
description: "Successful inference.",
204+
content: {
205+
"application/json": {
206+
schema: {
207+
type: "object",
208+
properties: {
209+
model: { type: "string" },
210+
task: { type: "string" },
211+
input: { type: "string" },
212+
output: { type: "string", example: "كِتَابٍ" },
213+
},
214+
},
215+
},
216+
},
217+
},
218+
},
219+
},
220+
options: {
221+
tags: ["infer"],
222+
summary: "CORS preflight",
223+
responses: { "204": { description: "No content" } },
224+
},
225+
},
226+
"/info": {
227+
get: {
228+
tags: ["systems"],
229+
summary: "API version and catalogue counts",
230+
description: "Returns the API version, the map count, and the model count.",
231+
operationId: "infoGet",
232+
responses: {
233+
"200": {
234+
description: "API metadata.",
235+
content: {
236+
"application/json": {
237+
schema: {
238+
type: "object",
239+
properties: {
240+
api_version: { type: "string" },
241+
maps: { type: "integer" },
242+
models: { type: "integer" },
243+
},
244+
},
245+
},
246+
},
247+
},
248+
},
249+
},
250+
},
236251
"/detect": {
237252
get: {
238253
tags: ["detect"],

0 commit comments

Comments
 (0)