Elamur: **Mova** · [Parse](https://mova.elamur.ai/free/en/parse/) · [Research](https://md.research.elamur.ai/free/en/) · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Mova](https://md.mova.elamur.ai/free/en/) · [this page in HTML](https://mova.elamur.ai/free/en/docs/tools/witness-sweep/)

[Mova](https://md.mova.elamur.ai/free/en/) / [docs](https://md.mova.elamur.ai/free/en/docs/) / [tools](https://md.mova.elamur.ai/free/en/docs/tools/) / witness-sweep — open GPU parsers over seeded samples, and the agreer

# witness-sweep — open GPU parsers over seeded samples, and the agreer

`witness-sweep` runs the open neural parsers ([Open parsers: witnesses and tests](https://md.mova.elamur.ai/free/en/docs/repo-docs/parsers/)) over seeded random samples of many languages, one bounded group at a time, and turns their outputs into witnesses for Mova's multilingual parser: per-group measurements, label profiles against UD 2.19, and the agreer with two outputs kept apart (agreement for measurement over all parsers, silver CoNLL-U for training over the licence-clean parsers only).

```
cargo build --release -p witness-sweep
witness-sweep sweep PLAN [--langs a,b] [--parsers x,y]   # samples, then every group not yet done
witness-sweep score PLAN                                  # measure/: throughput, GPU, UAS/LAS, pairwise agreement
witness-sweep profile PLAN                                # labels/: each parser's labels against UD 2.19
witness-sweep evidence PLAN                               # labels/evidence.tsv: gold labels behind each parser label (even dev sentences)
witness-sweep agree PLAN [--langs a,b]                    # agree/: measurement and silver outputs, controls
witness-sweep report PLAN                                 # measure/report.tsv: one row per parser and language
```

## The plan

A JSON file: `run_dir`, `stop` (the STOP file), `seed`, `parsers_dir`, `ud_dir` (the UD 2.19 release), `inventory` (the multilingual pilot's `inventory-treebanks.tsv`: language, treebank, licence, role, sizes), `wiki_pages` (the wikimd seeded page samples, `<code>/pages/*.wiki`), `wikimd` (its binary), `dialects_dir`, `distcheck`, `langs` (the order: more popular languages first), `tiers` (sample sizes by rank in that order: `below_rank`, `wiki`, `dev`, `dev_treebanks`), `tokenizer` (the wiki tokenizer, a parser entry) and `parsers`.

A parser entry: `id`, `python` (its environment), `bridge`, `arg` (the bridge's parser name; `{lang}`, `{name}` and the entry's `vars` are filled in), `langs` (language → model name), `requires` (a path that must exist for the language to be served: the model is downloaded), `model_paths` (hashed into the manifest), `package` (its version is read from the environment), `style` (the label map, below), `mem_max`, `timeout_s`, and the licence: either `licence_rule: "stanza"` (Apache-2.0 weights by the model cards; the depparse package's training treebank looked up in the inventory) or `licence_class` (`clean`, `nc`, `gpl`, `unclear`) with `licence` (the text).

The bridge interface is the one of the runner behind `CYCLE_NEURAL`: `python -I BRIDGE <arg> <work dir>` reads `in/ids.txt` and `in/tokens.txt` (a sentence per line, tokens separated by a space, a space inside a token as U+00A0) and writes `out/<arg>.conllu`, token for token. The multilingual bridge is `peta/tools/treeagree/bridge/multi_neural.py` (internal, with the language bridges of the agreer); it also prints one `witness_stats` JSON line (load and parse seconds, the torch peak) and has the modes `tokenize-<lang>` (Stanza tokenizer and MWT for the wiki samples), `fetch-stanza` and `fetch-trankit`.

## Samples

Seeded and reproducible: a sentence is kept when SHA-256(seed, sample id, sentence id) is among the `n` lowest; the kept sentences stay in source order. `samples/<lang>/<sample>/` holds `ids.txt`, `tokens.txt`, `sample.json` (seed, source and its SHA-256, selection rule, the ids and their hash) and, for dev samples, `gold.conllu.zst`.

- `ud-<treebank>-dev`: UD 2.19 dev sets, gold syntactic words (multiword tokens split, empty nodes out), so the parsers' trees align with gold; the up to `dev_treebanks` largest dev sets of the language. A test file is refused.
- `wiki-w2c4`: Wikipedia prose. The wikimd page sample of each wiki (200 pages, seed 1) is written as Markdown by `wikimd md`, links unwrapped; prose lines are kept when most characters are letters, they are not list items, numbered notes or table rows, and they end in a sentence mark; up to `wiki_max_paragraphs` paragraphs by key go through Stanza's tokenizer (and MWT expansion where the language has it) on the GPU; sentences of 3 to `wiki_max_words` words are sampled. `wiki-w2c`, `wiki-w2c2` and `wiki-w2c3` are earlier filters, kept apart.
- `wiki_pages_from: views` (round 2, `wiki-v2`): the page set is drawn from the wiki's page-view list instead: the `wiki_pages_n` titles with the lowest SHA-256(`wiki_seed`, `pages-<lang>`, title) among those with at least `wiki_min_views` views in a year, read raw (templates not expanded) from the packed dump with `wikipack get`, only for the languages in `wiki_langs`; `pages/<lang>/pages.tsv` lists file, title and views. The sample and tokenizer names come from the plan (`wiki_sample`, `wiki_tok`), so a new page set never mixes with an old one.

## Groups

With `wiki_voters_extra` in the plan, wiki samples are parsed only by the licence-clean parsers and the listed extra ones (round 2: Trankit), so short GPU time goes to silver first; the others stay for a later round.

A group is one parser × one language × one sample. Before every group the STOP file is read; a group runs its bridge under `systemd-run --user --scope -p MemoryMax=…`, killed after `timeout_s`; GPU memory is sampled every 0.5 s from `nvidia-smi` for the bridge's process tree. The output is checked (same ids and forms, heads in range) and written as `<parser>/<lang>/<sample>.conllu.zst` with `<sample>.manifest.json`: parser, bridge and its SHA-256, package version, model name, model hash (SHA-256 over every model file), licence text and class, `training_labels_allowed`, `use`, seed, sample ids and their hash, start and end, wall seconds, parse sentences per second (model load and warm-up excluded) and wall sentences per second, GPU peak of the process and of the card. A group with a manifest is done; a failed group writes `<sample>.failed.json` and is not retried. Every step is appended to `groups.jsonl`.

## Labels and normalisation

The UD side of a language is counted from its UD 2.19 train and dev files (test files are not read). A parser label in that profile is kept; any other is looked up in the style's label map `dialects/witness-<style>/labelmap.tsv` (`lang from to reason`; `*` for every language; `to` = `!` records a label as unmappable); without a rule the label is **unmappable**: it is counted, it votes on the head but not on the relation, and it is never guessed. `profile` writes `labels/profile.tsv` (every label each parser emits per language, with counts and whether UD 2.19 of the language has it), `labels/diff.tsv` (labels outside UD 2.19, mapped or unmappable, and frequent UD labels the parser never emits) and `labels/summary.tsv`. `evidence` writes `labels/evidence.tsv`: per parser label, on the even sentences of the dev samples, the gold labels of the words whose head is right, with shares. A rule goes into a label map only with that evidence (share at least 0.95, at least 50 words); `score` measures LAS before and after the map on the odd sentences (`las_raw_odd`, `las_norm_odd`), which the rules were not derived from, beside the whole-sample numbers, the round trip through the map's unique reverse (`converted_words`, `roundtrip_restored`) and the converter's negative control: one deliberately wrong rule (the parser's most frequent relation → `dep`) must lower LAS (`control_red`). The `convert` rule language of [The Mova dialect: a UD metadialect, treebanks and converters](https://md.mova.elamur.ai/free/en/docs/repo-docs/dialect/) cannot hold these rules yet: `en::convert` checks relations against the English relation set.

## The agreer

A voter that could not parse a sentence wrote the abstain mark (every word `_abstain`) and does not vote on it. Voters are the parsers with an output for the sample, in plan order; any number of them (Mova's own parser joins as one more voter by writing the same files). Per word, after normalisation: the head with the most votes (a tie goes to the voter listed first), the relation with the most votes among the voters of that head whose label is mappable, the UPOS with the most votes. When the plurality heads are not a tree (a cycle, no root or several roots), the heads come from the maximum spanning tree over the votes (Chu–Liu–Edmonds, one root), and each word's relation and UPOS are agreed again at its new head; `# agree_tree` says `valid` or `decoded`.

- `agree/measure/<lang>/<sample>.conllu.zst`: every voter, NC, GPL and unclear ones included; MISC `AgreeH=k/n|AgreeR=k/m|AgreeU=k/m|Dissent=<voter>:H<head>R<rel>U<upos>,…` (`R!x`: the voter's label `x` is unmappable); `# voters`, `# agree_tree`. For measurement only, never training data.
- `agree/silver/<lang>/<sample>.conllu.zst`: **the silver format** for Mova's multilingual training. Only the voters whose manifest says `training_labels_allowed` (licence class `clean`); only wiki samples (dev sentences never become training data); only sentences whose agreed tree is valid and every relation agreed. Columns: ID, FORM (the sample's tokens: syntactic words), LEMMA (voted), UPOS (UD 2.19), XPOS `_`, FEATS (voted; only the Name=Value pairs UD 2.19 of the language has), HEAD, DEPREL (UD 2.19 labels of the language, after normalisation), DEPS `_`, MISC `AgreeH=k/n|AgreeR=k/m|AgreeU=k/m|AgreeL=k/m|AgreeF=k/m|Indep=k` (Indep: clean voters with disjoint training treebanks that give the word's head and relation, so a trainer can keep single words) with n the number of clean voters; comments `# sent_id`, `# source = witness-sweep <date> <lang> <sample>`, `# silver_voters`, `# use`, `# agree_tree = valid`. With one clean voter (most languages today) every level is 1/1: the silver tree is that parser's tree, normalised; the trainer should weigh it accordingly.
- `agree/silver2/<lang>/<sample>.conllu.zst`: **the independent tier** of silver, the same format with `# silver_tier = independent-2`: the silver sentences in which every word's agreed head and relation come from at least two clean voters whose training treebanks are disjoint (two Stanza packages trained on the same treebank count once). Voters carry their training treebanks: an explicit Stanza package its own, a combined package the plan's `stanza_combined` list, other parsers the plan's `treebanks` or else only themselves. `levels.tsv` adds the set `clean-independent` (clean voters, independent voters giving the head and relation).
- `agree/levels.tsv`: on dev samples, the agreed tree against gold per agreement level (voters, head votes: words, UAS, LAS), for all voters and for the clean ones.
- The shuffle control (`agree/report.jsonl`, `shuffle_control`): the share of words where all voters give the same head, real against shuffled (every voter after the first reads another sentence of the same length); `control_failed` when the shuffled share is more than half the real one. The unit test feeds identical voters and requires the shuffled share to fall (the control's own negative control).

## Licences

A clean parser can still be kept out of the silver output for a language by the plan's `no_silver` (its convention does not fit the samples: Stanza ja `gsdluw` parses long-unit words, the samples are short-unit tokens); it then votes in the measurement output only.

Stanza's `combined` packages are reviewed in the plan's `stanza_combined` from Stanza 1.15's own dataset builders (`stanza/utils/datasets/prepare_tokenizer_treebank.py`): de GSD + Wiktionary lemmas, fi TDT (+ tokenizer-only fixes), sl SSJ + SST (+ SUK, CC BY-SA 4.0, for lemma and POS), sq STAF: clean; ja GSD + handparsed verb patterns and es AnCora + GSD + handparsed silver: unclear (Stanza's handparsed-treebank repository states no licence); it ISDT, VIT, TWITTIRO, PoSTWITA and he IAHLTwiki, IAHLTknesset, HTB: NC. The agreer takes the licence decision from the plan as it stands, so a reviewed package counts as clean in outputs agreed later; the manifests keep the decision of their run.

Only `clean` parsers give training labels: permissive weights trained on CC BY or CC BY-SA data, the data licence checked. NC, GPL and unclear models (UDPipe, UDify, COMBO, Trankit, spaCy on unchecked silver data, Stanza packages trained on NC treebanks or on several treebanks) are measured and vote in the measurement output only. Every manifest says which. The sweep's outputs and the agreer's measurement output are internal tests and measurements.

## Checks

`cargo test --release -p witness-sweep`: seeded selection, the prose filter, CoNLL-U reading, plurality and ties, unmappable labels, tree validity, and the shuffle control's negative control.

## Limits

The Wikipedia text comes from the wikimd page samples, so small wikis give few sentences; the tokenizer is Stanza's, so its errors are every parser's input. Stanza is both tokenizer and voter on wiki samples. Voters are not weighted (a better parser counts as much as a weaker one). LEMMA and FEATS are voted whole (no per-feature vote); Trankit gives no lemma; round-1 outputs have neither (`_`). Agreement of parsers that share a training treebank is not independent evidence.

- [← previous wikt-page — raw wikitext of pages by exact title](https://md.mova.elamur.ai/free/en/docs/tools/wikt-page/)
- [↑ back to tools](https://md.mova.elamur.ai/free/en/docs/tools/)

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://mova.elamur.ai/sitemap.xml) · [llms.txt](https://mova.elamur.ai/llms.txt)
