Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

docs(evals): dataset format and the CI gate

Emiliano Gandini Outedacf4ba69eab67
diff --git a/research/evals/README.md b/research/evals/README.md
new file mode 100644
index 00000000..16f65593
--- /dev/null
+++ b/research/evals/README.md
@@ -0,0 +1,48 @@
+# research/evals
+
+Datasets, baselines and thresholds for the `laya-eval` harness and its CI gate.
+
+- `fixture.jsonl`: a tiny hand-written set that exercises `choice`, `score` and `noul`
+ across a few tags. It exists to prove the format and to run the harness in tests. It is
+ **not** a quality claim and its accuracy has no meaning.
+- `dataset.template.jsonl`: the format, with comments. Start here.
+- `thresholds.json`: the tolerances the scheduled gate allows against the committed
+ baselines in `research/results/`.
+- `check_regression.py`: adapts a `research/eval/laya_eval.py` report into
+ `laya.evals.EvalReport` and compares it to a committed baseline.
+
+## Format
+
+One JSON object per line (JSONL). Blank lines and lines starting with `#` are ignored.
+
+| field | required | meaning |
+|---|---|---|
+| `state` | yes | the text, email, ticket or JSON document to decide on |
+| `questions` | yes | a Laya question dict, exactly as `Router.predict` accepts |
+| `expected` | yes | ground truth keyed by question id: a label for `choice`, a number for `score`, `true`/`false` for `noul` |
+| `tags` | no | strings to slice by |
+| `language` | no | BCP-47-ish code, to slice by language |
+| `model` | no | force a checkpoint for this row; `--model` overrides it |
+
+## Use
+
+```bash
+laya-eval validate research/evals/fixture.jsonl
+laya-eval run data.jsonl --model english --min-accuracy 0.8 --max-ece 0.05 --slice language
+laya-eval run data.jsonl --baseline baseline.json --tolerance choice_accuracy=0.02 --json out.json
+```
+
+`run` exits non-zero when a threshold or a baseline tolerance fails, so it drops into CI
+unchanged. `laya eval ...` is the same thing through the main CLI.
+
+Adding a dataset: point `--baseline` at a report you have reviewed, keep the tolerances in
+`thresholds.json`, and commit both beside the dataset, so a quality change is a reviewable
+diff.
+
+## The real labelled set
+
+The maintainer's 396-decision English set and the 51-language sweep are the authoritative
+numbers. They are not committed here yet; drop a JSONL in this directory and a baseline
+report beside it and the gate will pick both up. The scheduled workflow currently runs the
+MASSIVE English suite through `research/eval/laya_eval.py` against
+`research/results/eval_english_51_languages.json`.