Spaces:
Running
Running
portal: data page of repository commit 5b2c299894d9
Browse filesFiles of catalog/portal/ (29), digest 92cf7d2e1df52c87f209e31b8f497d006a119083ed0d96d8a2483e843732df60.
Files changed (12)
- README.md+58-30
- app.js+387-185
- data.js+109-31
- first.js+131-37
- first.json+85-85
- index.html+40-15
- linked.js+39-17
- llms.txt+5-5
- locales/en.json+61-24
- locales/zh.json+56-16
- portal.json+3-3
- style.css+4-2
16 unmodified lines1718192021222369 unmodified lines9394959697989910085 unmodified lines18618718818919019119219319419519619719819920020120220320442 unmodified lines2472482492502512522532541 unmodified line25625725825926026126226326433 unmodified lines29829930030130230330430530630730871 unmodified lines3803813823833843853863 unmodified lines39039139239339439539635 unmodified lines43243343443543643743843944044162 unmodified lines50450550650750850951051151229 unmodified lines54254354454554654754854955055155255377 unmodified lines63163263363463563663763863964016 unmodified linesreal public data for pre-training, mid-training and post-training, each file with its address, size, hashes and license, fetched with one command.#2422: the dataset card is the overview;this page is where data is picked and taken, in three parts.Its first screen is a working screen (second round, "Strata"; section The working screen): the field, a WebGL scene with every source of the index as one point, is the ground, and on it float the name, that sentence and the training stages of the stage table `catalog/stages.yaml` as a column, each with what it can use (the release's `meta/stage_figures.json`; a click on one sets the filter by stage), the filters (the domain, the form, the size, the training permit, the personal-data mark and the file type), the count of the selection with its largest sources, and the one command that takes it.The sources follow: the material sets or corpora of the selection with their fit, their details and a preview of their rows, then the domain × form map with the bars by domain and by form for one layer at a time (linked: a click on one filters the others, the list and the field).Get the data gives the selection's one command, what it writes, what the default profile of the fetch tool leaves out with the flag that takes each back, and the selection file.The Space card says the first sentence in short (`short_description`, at most 60 characters, https://huggingface.co/docs/hub/spaces-config-reference).69 unmodified linesOne pair of names is used everywhere: "corpus" and "corpora", "material set" and "material sets"(in Chinese the two names that `locales/zh.json` has for them, `kind.corpus` and `kind.material_set`).#1577: one word per concept in each language, the same as in the index's docs: a source is "source" (in Chinese theword of `col.title`; never "data source"), its card the card (`cards/<source>.yaml`, never a second word for thesource itself), a domain "domain" (in Chinese the word of `filter.domain`; never"category"), and the redistribution permit "redistribution" (in Chinese the word of `chip.redistribution`; never"shipping", which names the card field `license.ship`).No number and no heading counts "sources" over both layers.85 unmodified lines| File | Read | Fields used ||---|---|---|| `meta/catalog.parquet` | at load; then loaded whole into DuckDB-WASM as the table `catalog` | `source`, `title`, `summary`, `description`, `status`, `status_reasons`, `kind` (when published), `collection` (when published), `domain`, `form` (when published), `license` (`spdx`, `tier`, `note`, `ship`), `contamination` (`level`, `benchmark`, `scope`; level `not scanned` reads as not known), `pii` (`level`, `evidence`), `files`, `license_counts` (when published: per material set `kind`, `upstream` or `index` for the files the index wrote under `campaign_files/`, `spdx`, `training_ok`, `redistribution_ok` and `files`, counted by the projection over all its rows), `bytes`, `distinct_bytes` (when published), `unsized_rows`, `fetch_check` (when published, #1577: `level`, `rows`, `fetched`, `read_at`; #2006: named `fetch` up to `release-2026-11-09.1`, which the page reads when the commit has no `fetch_check`), `unit`, `top_types`, `needs_auth`, `data_files` (when published, #1746: the selection's SQL takes the data files from it; a commit without it names its files nowhere but in their paths, which the query does not read), `batch_files` (when published, #1769: the data files that hold each batch of a source, the page's list of a source's files and batches; #1792: with `first` and `last`, the source's first and last row in that file, the row range the page reads; without it, `data_files` with no batches), `released_in` (when published, #1928: the release tag of the release whose record of the source its rows come from; the source's page names it), `held_back` (when published, #1928: why a newer batch of the source is held back, in the words of the release notes, while it keeps its newest version that passed every check; the source's page shows it, #2674: as one sentence in the page's language, what waits and what stays published, with those words in a closed block), `upstream_kind`, `upstream_agent`, `upstream_entry` (when published, #2588: the source's declared upstream, a dataset or a catalog with its agent and entry address, the values joined by ` \| ` while it reads several; the source's page shows each upstream on a line of its own) || `meta/attribution.parquet` | when the attribution file is made, when the commit has it (#1577) | `source`, `publisher`, `license`, `license_url`, `files` || `meta/size_figures.json` | at load, when the commit has it | per layer (`layers`) and per source (`sources`): `distinct_bytes` (#2422: the one size the page shows), `unsized_rows`, `check` (`rows`, `compared`, `match`, `unreachable`, `gone`, `needs_auth`, `no_length`, `error`), `estimate` (`bytes`, `low`, `high`, `readings`, `rows`) || `meta/sources.json` | at load | per source: `license_rows` (training and redistribution, rows per value), `license` (`name`, `statement`, `attribution`, `url`), `by_ext`, `size_quantiles_upper_bytes` || `meta/coverage.json` | at load | `by_license.training_ok` (rows per value); `projections.leaves.by_leaf` (per leaf `domain`, `name`, `zh`, `material_sets`, `units`: the leaves with the fewest units under the map) || `meta/batches.parquet` | at load | `source`, `batch`, `rows`, `status` || `meta/vocabulary.json` | at load, when the commit has it | `domains[].code`, `name`, `zh`, `parent`; `forms[].id`, `zh`; `layers[].kind`, `name`, `zh`; `relation.about`, `zh`; `collections[].code`, `name`, `zh`, `about`, `campaigns` || the data files the catalog names for a source (`batch_files`) | on demand | `source`, `batch`, `uri`, `range_offset`, `range_length`, `member_path`, `size_bytes`, `sha256`; only the source's row range in each file (#1792: `first` to `last` of `batch_files`, the whole file when the catalog has none), of which only the rows whose `source` (and `batch`, for the row count of a batch that `meta/batches.parquet` does not list) is the source's, since a file may hold rows of other sources || `@huggingface/hub`: `datasetInfo` of the revision and `pathsInfo` of a source's data files at the commit | at load, on demand | the file list of the commit; the date of the last commit of each batch, the latest among the files that hold it || `meta/preview.parquet` | the first time a row's "Preview" or a material set's detail opens; then loaded whole into DuckDB-WASM as the table `preview` | the rows of that source (`source` = its id), every column that has a value in one of them; in the detail, the first file of a unit of a material set (`extra` `source_meta.unit_group`, or a row of no collection) || `meta/projection.json` | at load, when the commit has it | `tag`, the release tag the page's commands name and (#2422), with `date`, the release line of the first screen || `meta/stage_figures.json` (#2006, #2518: of the commit the page reads, written by the release's projection) | at load, when the commit has it | `counted` (whether the release has counted its stage fields), `version` (of the stage table), `stages` (`id`, `name`, `zh`, `status`, `about`, `counted_by`, `counts`, `funnel`, the first screen's tiles), #2629 `no_stage` (per layer what no stage counts by reason, the band under the tiles; a release before #2629 has none), `sources` (per source the ids of the stages one of its units passes; a release before #2518 has none) || `meta/stage_figures.json` (#2066) | #2422: as soon as the commit is known (`first.js`), and at load, when the commit has it | per stage of `stages`, in the stage table's order: `id`, `name`, `zh`, `status`, `counted_by`, `counts` and (#2629) `funnel` (each null before the release counted the stage fields), what the first screen says it can use and its funnel; `release` and `date`, the release line until the index is read || `meta/translations.parquet` (#2066: the table of Chinese names #2065 writes with the release) | at load, when the commit has it | `en` (an English text the index shows: a collection's name, a source's title or description as the catalog holds them) and `zh` (its Chinese text) || `meta/labels.json` (the labels of corpus units) | at load, when the commit has it | `model`; per leaf (`leaves`) `threshold`, `units` (the units at or above the threshold) and `by_class` (those units by class), the table of units by leaf; per source (`sources`) its units at or above each leaf's threshold, its detail || `labels/<source>/*.parquet` (found in the commit's file list, no folder listed) | when the detail of a labelled corpus opens | `unit_id`, `leaf`, `score`, `class` of the first 200 rows of its first file: the labels of its first units |42 unmodified lines| `rev=<sha or branch>` | read another commit of the dataset || `catalog=<url>` | read the catalog from this URL (parquet, or JSON: a list of rows) instead of `meta/catalog.parquet` || `vocabulary=<url>` | read the names of domains and forms, and the requirements of the not-included categories, from this URL instead of `meta/vocabulary.json` || `kind` | the layer Pick shows: `material_set` (the default) or `corpus`; #2422: a `stage` takes its own || `domain`, `leaf`, `form`, `collection`, `train`, `redist`, `tier`, `size`, `status`, `q`, `ext`, `stage`, `pii` | the filters (`collection`: a line code of `admit_collections.tsv`, material sets only; `train` and `redist`: `yes` for every row allowed, `cond` for allowed or with conditions; `size`: the class of the deduplicated size, `lt1g`, `1g1t`, `ge1t` or `unknown`; `status`: a catalog status, such as `flagged`; `ext`: the selected file types, joined by commas; `stage`: the id of a training stage of the stage table, such as `post-training`; #2422: `pii`, the personal-data mark, `none`, `marked` or `unknown`) || `pick` | the picked sources, their ids joined by commas (#1286); while any is picked, "Get the data" takes exactly them || `sample` | how many units "Get the data" takes from each source: `1`, `3`, `10`, `30` or `all` (#1524); #2629: without it, `all` when the command takes material sets and `3` when it takes corpora || `metric`, `sort`, `dir`, `open` | what the charts of material sets count (`sets`, the default, or `units`; corpora are counted in rows), the sort of the list (default: fit), the open source |1 unmodified line| `lng=<en or zh>` | open the page in English or in Simplified Chinese (and keep that choice) |#2422: the filters are in the left panel of the working screen: the training stage is set by its band of the columnabove them (its select stays in the page, out of sight), then the search box, the domain, the form, the size, thetraining permit, the personal-data mark and the file type (an HTML `details` element, closed at first and opened whena type is checked, its summary saying how many are).The training permit and the personal-data mark are labels every source carries (what all its rows allow for training,`license_rows` of `meta/sources.json`; the `pii.level` of its card in the catalog, present or suspected, none found, ornot judged yet):33 unmodified lineson hover, the selected stage's condition (#2066: in Chinese its text in the table of Chinese names, once the release has it) and the version of the table the stages were computed with.A selection by stage takes its sources by `--source`, under the default profile, and the SQL tab names them by id.#2422: the first screen is the stages of the release's `meta/stage_figures.json`, in the stage table's order, each a tile (`first.js` `drawStages`) drawn as the dataset card's stage figure: its pictogram, its name in the page's language, the mark of a provisional stage (by its status in the figures; pre-training and mid-training while the stage table says so), and what it can use, one large number and one line under it:a stage counted in bytes says its size (the size after deduplication, so the page's one size) over its corpus rows, one counted in units its units over its material sets (`stageWhat`).#2629: under them each tile has its funnel (`funnel` of the stage's figures) in the measure of its large number: what meets the stage's condition, then what each rule of `rules` removes (a rule that removes nothing left out), which ends at that number (`first.js` `funnelSteps`).The last band, "In no stage" (`strata.rest`; no button), gives for the layer shown what no stage counts (`app.js` `restWhat`, from `no_stage` of the figures, which the release counts, `artpool.stages`): its material sets or corpora as the large number, its units or corpus rows in the line under it, and the material sets or corpora by reason under them (did not meet the condition, each rule, not counted yet: in the catalog but not in the stage fields the release counted over an earlier release's files; a reason of none left out), with the units or rows by reason on hover;so the post-training tile's units and material sets plus those of the band are the units and material sets the selection counts with no filter on.Figures written before #2629 give the band the sources of the layer shown that have no stage, without units, rows or reasons.A tile is a button once the page has the stages of its commit: it sets the filter by stage to its stage (and Pick to its layer) and goes to Pick, or clears it when it holds it already;what is missing is one short line under the tiles (no stage figures, no stage fields counted, or figures without the sources' stages).Before the index is read, `first.js` draws the tiles from the figures it read on its own, and `app.js` draws them again with the clicks once it has read the index.71 unmodified linesthe `@fontsource` packages (5.3.0) on jsDelivr, each under the SIL Open Font License 1.1 (`OFL-IBM-Plex.txt`,`OFL-Big-Shoulders.txt`).- `first.js`: the first screen before the index is read: the pictograms and (#2422) the column of the training stagesand the release line, from the commit's `meta/stage_figures.json`, read as soon as `commit.js` names the commit(`drawStages`, `drawRelease`, which `app.js` calls again once it has read the index; `stageColor`, a stage's colortoken, and `stageWhat`, what it can use, which the field's labels say too).It also has the words of a level's size (`sizeOf`, the deduplicated size, `sizeParts`, `sizeLine`, `checkText`) that3 unmodified linesfor DuckDB, and the size figures of the whole index and of each layer (`sizes`, from `meta/size_figures.json`);#2066: the table of Chinese names (`TRANSLATIONS`, the map `zh`), the release's stage figures (`stageFigures`) and whythe page has no stages of its commit (`stagesWhy`); #2422: each source's deduplicated size (`distinct`) and therelease's date (`releaseDate`).- `i18n.js`: the page's languages (i18next with its browser language detector, the words from `locales/en.json` and`locales/zh.json`), the words of `index.html` (`data-i18n` sets an element's text, `data-i18n-attr` its attributes)and the language switch; the other modules draw their text again on i18next's `languageChanged`.35 unmodified linesThe counts are material sets or their units, or the rows of corpora, never both layers; the table behind each charthas the layer's sources and its measure.The charts are drawn again for a new layer, count, language, width or theme.Under the map, a table of the leaves of the domain grid whose material sets hold the fewest units, the fewest first, in the order the funnel takes them (`03_data_line/v2/funnel_propose.py` `pick`): each leaf's name, its domain, its material sets and their units, from `projections.leaves.by_leaf` of the commit's `meta/coverage.json`, the grid's order among equals, the first five of that order, the order the upstream search also takes its leaves in after those it has not searched for a day (`app.js` `FEWEST_LEAVES`, `renderFewest`);it is not filtered, and a commit without the projection leaves it out.Under it, a table of every leaf of the grid with its units by method, in the grid's order (`app.js` `leafRows`, `renderLeaves`): agent, the units of the material sets whose domain holds the leaf, each chosen by an agent (`projections.leaves.by_leaf` of `meta/coverage.json`, as the table above), and classifier, the corpus units scored by a classifier at or above the leaf's threshold (`leaves` of the commit's `meta/labels.json`: `units`, `threshold`), then one column per class of the classifier's units (`by_class`, the classes with the most units first), the leaf's threshold, and for a leaf with classifier units the command that takes them straight from the corpora (`--kind corpus --leaf <code>`, with the units choice in force);a line above it names the labels' model, and a commit without `meta/labels.json` says it carries no labels yet and shows a dash for the classifier's counts.One crossfilter selection holds the filters, one clause per filter; a click on a bar or a cell picks through thechart's toggle and the page sets the clause, so the panel and the charts set the same clauses.A chart's tooltips (Observable Plot's pointer) stop the other listeners of a mouse press on the chart to pin the tip,62 unmodified linesfiles, the permit classes for training and redistribution as "x / y files" and the licenses behind each, or onephrase when all its files allow both, read from the catalog column `license_counts`; without the column, as before)and, for a material set, an example unit file.A corpus whose units the commit labels (files under `labels/<source>/`) has a line "Labels" (`app.js` `labelItem`): the labels' model and its units at or above each leaf's threshold (`sources` of `meta/labels.json`), the most first;the labels of its first units, one line per `unit_id` of the first 200 rows of its first label file with each leaf's score, in bold at or above that leaf's threshold, and its class;and the command that takes its units of the leaf it holds the most of (`--kind corpus --source <id> --leaf <code>`, with the units choice in force).#2629: its line "Take it" is the command that takes the source alone: a material set whole (no `--sample`), with itsunits and its size beside the command; a corpus, whose whole can be petabytes, by the units choice below (thereader's, else 3 per source).29 unmodified linesclears the choice, so the other layer takes its own default again;#1891: "all" leaves `--sample` out, so the command takes every unit of the selected sources and the default profile stays on;it never gives `fetch.py --all` (which turns off the profile's criteria other than benchmark and not compared), and the folder tree lists what the profile leaves out under every choice:#2397: the criteria `tools/fetch.py` applies by default, in its order, as the release lists them in `meta/vocabulary.json` (`profile`, from `public_fetch.CRITERIA` less `OPT_IN`, the two that #2441 applies only when asked: license and personal data), each by its words in the page's language (`profile.<criterion>` of the locales), so the page and the tool show one list; a vocabulary without that list shows none;#2422: each with the flag of `tools/fetch.py` that takes it back (the criterion's `option` in that list, from`public_fetch.RELAX`: duplicates `--keep-duplicates`, benchmark copies `--allow-benchmark`, rows not compared withthe benchmark list `--allow-not-compared`, not English `--any-language`, over 20 MB `--any-size`; #2674: refused byits site when the release's fetch check read it `--allow-refused`), and #2441 under it the two flags that leave outrows by license or personal data, `--training-only` and `--no-personal-data`.The link beside the selection chips reads "Change filters" and goes to the filter panel.#1498, #1524: below it, the usage example video block (id `usage-video`, which the dataset card and the project pagelink to) plays the video of the page's language from `media/` of the dataset, `usage-example.zh.mp4` in Chinese and77 unmodified lines`{{ tut.fetched }}` those of them the tutorial's take uses: each whose every row the release's fetch check read andfetched (catalog column `fetch_check`, level `all` over as many rows as its column `files`), so that the take completes.#2442: `{{ parts.en.* }}` and `{{ parts.zh.* }}` are the parts of the dataset card the manual holds, in the words ofeach text (the tables of every stage's funnel, of personal information, of known limits and of release days, thefields used most, the line of the release's own counts and checks, and the card's addresses), computed by theprojection's code (`artpool.index_projection.manual_parts`) from `meta/size_figures.json`, `meta/stage_figures.json`and `meta/translations.parquet` of that commit, so they say what the release's card would.`{{ out.<name> }}` is the output of a command the manual shows, run for real against that release in the deploy'stemporary directory, within a time limit, and cut as the manual shows it;`03_data_line/steps/portal.py` (`manual_outputs`) holds each command and SQL file, the exit code the manual shows and16 unmodified lines1718192021222369 unmodified lines9394959697989910085 unmodified lines18618718818919019119219319419519619719819920020120220320442 unmodified lines2472482492502512522532542552561 unmodified line25825926026126226326426526626726826927027127227327427527627727827928028128228333 unmodified lines31731831932032132232332432532632732832971 unmodified lines4014024034044054064074084094103 unmodified lines41441541641741841942035 unmodified lines45645745845946046146246346446546646746862 unmodified lines53153253353453553653753853929 unmodified lines56957057157257357457557657757857958077 unmodified lines65865966066166266366466566666766816 unmodified linesreal public data for pre-training, mid-training and post-training, each file with its address, size, hashes and license, fetched with one command.#2422: the dataset card is the overview;this page is where data is picked and taken, in three parts.Its first screen is a working screen (second round, "Strata"; section The working screen): the field, a WebGL scene with every source of the index as one point, is the ground, and on it float the name, that sentence and the training stages of the stage table `catalog/stages.yaml` as a column, each with what it can use and its units by status (the release's `meta/stage_figures.json`; a click on one sets the filter by stage), the filters (the domain, the form, the six facets, the size, the training permit, the personal-data mark and the file type), the count of the selection with its largest sources, and the one command that takes it.The sources follow: the material sets or corpora of the selection with their fit, their details and a preview of their rows, then the domain × form map with the bars by domain and by form for one layer at a time (linked: a click on one filters the others, the list and the field).Get the data gives the selection's one command, what it writes, what the default profile of the fetch tool leaves out with the flag that takes each back, and the selection file.The Space card says the first sentence in short (`short_description`, at most 60 characters, https://huggingface.co/docs/hub/spaces-config-reference).69 unmodified linesOne pair of names is used everywhere: "corpus" and "corpora", "material set" and "material sets"(in Chinese the two names that `locales/zh.json` has for them, `kind.corpus` and `kind.material_set`).#1577: one word per concept in each language, the same as in the index's docs: a source is "source" (in Chinese theword of `col.title`; never "data source"), its card the card (its md and yaml cards under `cards/`, never a secondword for the source itself), a domain "domain" (in Chinese the word of `filter.domain`; never"category"), and the redistribution permit "redistribution" (in Chinese the word of `chip.redistribution`; never"shipping", which names the card field `license.ship`).No number and no heading counts "sources" over both layers.85 unmodified lines| File | Read | Fields used ||---|---|---|| `meta/catalog.parquet` | at load; then loaded whole into DuckDB-WASM as the table `catalog` | `source`, `title`, `summary`, `description`, `status`, `status_reasons`, `kind` (when published), `collection` (when published), `domain`, `form` (when published), `license` (`spdx`, `tier`, `note`, `ship`), `contamination` (`level`, `benchmark`, `scope`; level `not scanned` reads as not known), `pii` (`level`, `evidence`), `files`, `license_counts` (when published: per material set `kind`, `upstream` or `index` for the files the index wrote under `campaign_files/`, `spdx`, `training_ok`, `redistribution_ok` and `files`, counted by the projection over all its rows), `bytes`, `distinct_bytes` (when published), `unsized_rows`, `fetch_check` (when published, #1577: `level`, `rows`, `fetched`, `read_at`; #2006: named `fetch` up to `release-2026-11-09.1`, which the page reads when the commit has no `fetch_check`), `unit`, `top_types`, `needs_auth`, `data_files` (when published, #1746: the selection's SQL takes the data files from it; a commit without it names its files nowhere but in their paths, which the query does not read), `batch_files` (when published, #1769: the data files that hold each batch of a source, the page's list of a source's files and batches; #1792: with `first` and `last`, the source's first and last row in that file, the row range the page reads; without it, `data_files` with no batches), `released_in` (when published, #1928: the release tag of the release whose record of the source its rows come from; the source's page names it), `held_back` (when published, #1928: why a newer batch of the source is held back, in the words of the release notes, while it keeps its newest version that passed every check; the source's page shows it, #2674: as one sentence in the page's language, what waits and what stays published, with those words in a closed block), `upstream_kind`, `upstream_agent`, `upstream_entry` (when published, #2588: the source's declared upstream, a dataset or a catalog with its agent and entry address, the values joined by ` \| ` while it reads several; the source's page shows each upstream on a line of its own), `card` (when published, #4406: the address of the source's card, its section of the card file of its upstream's protocol, `<path>#<anchor>`; the source's page links it on the Hub at the page's commit), `campaign_part` (when published: the zip that holds the files the index stores for the source, `campaign_files/<protocol>/<part>.zip`; the example file of the source's page, when it is one of them, links that part), `subject`, `industry`, `occupation`, `business_process`, `resource_type`, `file_format` (when published: the source's codes on each facet, which the filters by facet read) || `meta/attribution.parquet` | when the attribution file is made, when the commit has it (#1577) | `source`, `publisher`, `license`, `license_url`, `files` || `meta/size_figures.json` | at load, when the commit has it | per layer (`layers`) and per source (`sources`): `distinct_bytes` (#2422: the one size the page shows), `unsized_rows`, `check` (`rows`, `compared`, `match`, `unreachable`, `gone`, `needs_auth`, `no_length`, `error`), `estimate` (`bytes`, `low`, `high`, `readings`, `rows`) || `meta/sources.json` | at load | per source: `license_rows` (training and redistribution, rows per value), `license` (`name`, `statement`, `attribution`, `url`), `by_ext`, `size_quantiles_upper_bytes` || `meta/coverage.json` | at load | `by_license.training_ok` (rows per value); `projections.leaves.by_leaf` (per leaf `domain`, `name`, `zh`, `material_sets`, `units`: the leaves with the fewest units under the map); `projections.source_kinds.by_kind` and `projections.classes.by_class` (per kind of source and per class `zh`, `sources`, `material_sets`, `units`, `corpora`, `corpus_units`: the tables by kind of source and by class) || `meta/batches.parquet` | at load | `source`, `batch`, `rows`, `status` || `meta/vocabulary.json` | at load, when the commit has it | `domains[].code`, `name`, `zh`, `parent`; `forms[].id`, `zh`; `layers[].kind`, `name`, `zh`; `relation.about`, `zh`; `collections[].code`, `name`, `zh`, `about`, `campaigns`; `facets[].id`, `standard`, `version`, `codes` (`code`, `level`, `parent`, `name`: the hierarchy the filters by facet list) || the data files the catalog names for a source (`batch_files`) | on demand | `source`, `batch`, `uri`, `range_offset`, `range_length`, `member_path`, `size_bytes`, `sha256`; only the source's row range in each file (#1792: `first` to `last` of `batch_files`, the whole file when the catalog has none), of which only the rows whose `source` (and `batch`, for the row count of a batch that `meta/batches.parquet` does not list) is the source's, since a file may hold rows of other sources || `@huggingface/hub`: `datasetInfo` of the revision and `pathsInfo` of a source's data files at the commit | at load, on demand | the file list of the commit; the date of the last commit of each batch, the latest among the files that hold it || `meta/preview.parquet` | the first time a row's "Preview" or a material set's detail opens; then loaded whole into DuckDB-WASM as the table `preview` | the rows of that source (`source` = its id), every column that has a value in one of them; in the detail, the first file of a unit of a material set (`extra` `source_meta.unit_group`, or a row of no collection) || `meta/projection.json` | at load, when the commit has it | `tag`, the release tag the page's commands name and (#2422), with `date`, the release line of the first screen || `meta/stage_figures.json` (#2006, #2518: of the commit the page reads, written by the release's projection) | at load, when the commit has it | `counted` (whether the release has counted its stage fields), `version` (of the stage table), `stages` (`id`, `name`, `zh`, `status`, `about`, `counted_by`, `counts`, `funnel`, `statuses`, the first screen's bands), `sources` (per source the ids of the stages one of its units is counted on; a release before #2518 has none) || `meta/stage_figures.json` (#2066) | #2422: as soon as the commit is known (`first.js`), and at load, when the commit has it | per stage of `stages`, in the stage table's order: `id`, `name`, `zh`, `status`, `counted_by`, `counts`, `funnel` and `statuses` (each count null before the release counted the stage fields), what the first screen says it can use and its units by status; `release` and `date`, the release line until the index is read; `counted` and `counted_on`, the release tag or publish (`<tag>.p<n>`) the release line says its figures were counted on, or that they are not counted yet || `meta/translations.parquet` (#2066: the table of Chinese names #2065 writes with the release) | at load, when the commit has it | `en` (an English text the index shows: a collection's name, a source's title or description as the catalog holds them) and `zh` (its Chinese text) || `meta/labels.json` (the labels of corpus units) | at load, when the commit has it | `model`; per leaf (`leaves`) `threshold`, `units` (the units at or above the threshold) and `by_class` (those units by class), the table of units by leaf; per source (`sources`) its units at or above each leaf's threshold, its detail || `labels/<source>/*.parquet` (found in the commit's file list, no folder listed) | when the detail of a labelled corpus opens | `unit_id`, `leaf`, `score`, `class` of the first 200 rows of its first file: the labels of its first units |42 unmodified lines| `rev=<sha or branch>` | read another commit of the dataset || `catalog=<url>` | read the catalog from this URL (parquet, or JSON: a list of rows) instead of `meta/catalog.parquet` || `vocabulary=<url>` | read the names of domains and forms, and the requirements of the not-included categories, from this URL instead of `meta/vocabulary.json` || `figures=<url>` | read the stage figures from this URL instead of `meta/stage_figures.json`, as the first screen and the filter by stage use them || `kind` | the layer Pick shows: `material_set` (the default) or `corpus`; #2422: a `stage` takes its own || `domain`, `leaf`, `form`, `collection`, `train`, `redist`, `tier`, `size`, `status`, `q`, `ext`, `stage`, `pii` | the filters (`collection`: a line code of `admit_collections.tsv`, material sets only; `train` and `redist`: `yes` for every row allowed, `cond` for allowed or with conditions; `size`: the class of the deduplicated size, `lt1g`, `1g1t`, `ge1t` or `unknown`; `status`: a catalog status, such as `flagged`; `ext`: the selected file types, joined by commas; `stage`: the id of a training stage of the stage table, such as `post-training`; #2422: `pii`, the personal-data mark, `none`, `marked` or `unknown`) || `subject`, `industry`, `occupation`, `business_process`, `resource_type`, `file_format` | the filters by facet: a code of the facet of the catalog column of that name (such as `subject=1.2`, `industry=62`, `resource_type=Software`), `multi` or `unclassified`; a code keeps the sources of that code and of every code under it in the facet's hierarchy || `pick` | the picked sources, their ids joined by commas (#1286); while any is picked, "Get the data" takes exactly them || `sample` | how many units "Get the data" takes from each source: `1`, `3`, `10`, `30` or `all` (#1524); #2629: without it, `all` when the command takes material sets and `3` when it takes corpora || `metric`, `sort`, `dir`, `open` | what the charts of material sets count (`sets`, the default, or `units`; corpora are counted in rows), the sort of the list (default: fit), the open source |1 unmodified line| `lng=<en or zh>` | open the page in English or in Simplified Chinese (and keep that choice) |#2422: the filters are in the left panel of the working screen: the training stage is set by its band of the columnabove them (its select stays in the page, out of sight), then the search box, the domain, the form, the six facetsunder the heading "By standard", the size, the training permit, the personal-data mark and the file type (an HTML`details` element, closed at first and opened when a type is checked, its summary saying how many are).The facets are the catalog's columns `subject`, `industry`, `occupation`, `business_process`, `resource_type` and`file_format`, each a recognised standard (`catalog/facets.yaml` of the code repository), and each filter a select ofits standard's codes in their hierarchy, from `facets` of the commit's `meta/vocabulary.json` (`data.js` `facetsOf`):a code is indented under its parent, named by its code and the name its standard gives it (a standard whose names arewithheld, ISIC, by its level and code, with the title another standard gives it: NACE Rev. 2.1's headings of thesections and divisions), with the sources it keeps under the other filters, and a code that keeps noneis left out, so each list is the part of its hierarchy the selection has;`multi` and `unclassified` come last.Under a facet that links its codes' pages or takes titles from another standard (`code_page` and `titles` of thefacet), a line links the selected code's page at its standard's source and gives the attribution of the titles, linkedto their source (`app.js` `facetNote`).A code keeps the sources of that code and of every code under it: each source carries its codes with every code abovethem (`data.js` `facetKeys`, the page's columns `fc_<facet>`).A facet whose column the commit's catalog lacks has no select, and the heading goes when none has;a vocabulary without facets lists the codes the sources carry, unindented.A selection by facet takes its sources by `--source`, under the default profile, and the SQL tab names them by id;a chart's table in the SQL Console reads the facet's column with the codes the sources carry at or under the code.The training permit and the personal-data mark are labels every source carries (what all its rows allow for training,`license_rows` of `meta/sources.json`; the `pii.level` of its card in the catalog, present or suspected, none found, ornot judged yet):33 unmodified lineson hover, the selected stage's condition (#2066: in Chinese its text in the table of Chinese names, once the release has it) and the version of the table the stages were computed with.A selection by stage takes its sources by `--source`, under the default profile, and the SQL tab names them by id.#2422: the first screen is the stages of the release's `meta/stage_figures.json`, in the stage table's order, each a tile (`first.js` `drawStages`) drawn as the dataset card's stage figure: its pictogram, its name in the page's language, the mark of a provisional stage (by its status in the figures; pre-training and mid-training while the stage table says so), and what it can use, one large number and one line under it:a stage counted in bytes says its size (the size after deduplication, so the page's one size) over its corpus rows, one counted in units its units over its units by each label method its count takes (agent, classifier; `methods`, `headline` and `agent_by_layer` of the stage's figures, `first.js` `methodsLine`), joined by plus signs so that they add up to the large number, the agent's with its units of material sets and of corpus units an agent judged, where the figures give them, else over its material sets (`stageWhat`).Under them each tile gives its units by status (`statuses` of the stage's figures, `first.js` `stageStatuses`), a corpus counting its rows as units: one line with the units its other methods place, given beside its count and not in it (post-training: the rules' placements), or, for a stage whose count takes every method it has, its counted units by each of them (rules), and one with its units not yet judged, judged below threshold, duplicate of a counted unit, overlapping a benchmark, of a size not recorded and archives of recorded members, so that the large number and the two lines add up to every unit of the catalog, as the dataset card's table of statuses does;between the two, a stage with the classifier says what its classifier units stand on (`scoring` of the stage's figures, `first.js` `scoringLines`): the data files the classifier has scored so far of those it scores, with its model, and its precision at its leaves' thresholds on the held-out judgments with its 95% interval, so that while the labels are scored the large number grows with each release;each number is short on the tile and whole on hover, with the stage's condition.Figures written before the stages gave each unit a status (format `stage-figures/7` and older) give each tile its funnel (`funnel` of the stage's figures) instead, in the measure of its large number: what meets the stage's condition, then what each rule of `rules` removes (a rule that removes nothing left out), which ends at that number (`first.js` `funnelSteps`).No band counts what no stage counts: every unit has a status on each stage.In the field, the sources none of whose units a stage counts stand on the last plane, "In no stage" (`strata.rest`), its figure the number of them in the layer shown, or of one kind of source among every source (`app.js` `restWhat`).A tile is a button once the page has the stages of its commit: it sets the filter by stage to its stage (and Pick to its layer) and goes to Pick, or clears it when it holds it already;what is missing is one short line under the tiles (no stage figures, no stage fields counted, or figures without the sources' stages).Before the index is read, `first.js` draws the tiles from the figures it read on its own, and `app.js` draws them again with the clicks once it has read the index.71 unmodified linesthe `@fontsource` packages (5.3.0) on jsDelivr, each under the SIL Open Font License 1.1 (`OFL-IBM-Plex.txt`,`OFL-Big-Shoulders.txt`).- `first.js`: the first screen before the index is read: the pictograms and (#2422) the column of the training stagesand the release line (the release tag, its day and the release tag or publish its figures were counted on,`counted_on`, linked to the dataset at that tag or at `main` for a publish, or that they are not counted yet;`countedOf`), from the commit's `meta/stage_figures.json`, read as soon as`commit.js` names the commit(`drawStages`, `drawRelease`, which `app.js` calls again once it has read the index; `stageColor`, a stage's colortoken, and `stageWhat`, what it can use, which the field's labels say too).It also has the words of a level's size (`sizeOf`, the deduplicated size, `sizeParts`, `sizeLine`, `checkText`) that3 unmodified linesfor DuckDB, and the size figures of the whole index and of each layer (`sizes`, from `meta/size_figures.json`);#2066: the table of Chinese names (`TRANSLATIONS`, the map `zh`), the release's stage figures (`stageFigures`) and whythe page has no stages of its commit (`stagesWhy`); #2422: each source's deduplicated size (`distinct`) and therelease's date (`releaseDate`); the release tag the stage figures were counted on (`countedOn`).- `i18n.js`: the page's languages (i18next with its browser language detector, the words from `locales/en.json` and`locales/zh.json`), the words of `index.html` (`data-i18n` sets an element's text, `data-i18n-attr` its attributes)and the language switch; the other modules draw their text again on i18next's `languageChanged`.35 unmodified linesThe counts are material sets or their units, or the rows of corpora, never both layers; the table behind each charthas the layer's sources and its measure.The charts are drawn again for a new layer, count, language, width or theme.Under the map, a table of the leaves of the domain grid with the fewest units, the fewest first, in the order the funnel takes them (`03_data_line/v2/funnel_propose.py` `pick`): each leaf's name, its domain and its units labelled by any method (`leaves` of the commit's `meta/labels.json` of format `training-data-foundation-labels/3`; of an older commit, its material sets and their units, from `projections.leaves.by_leaf` of the commit's `meta/coverage.json`), the grid's order among equals, the first five of that order, the order the upstream search also takes its leaves in after those it has not searched for a day (`app.js` `FEWEST_LEAVES`, `renderFewest`);it is not filtered, and a commit without the projection leaves it out.Under it, a table of every leaf of the grid with its units, in the grid's order (`app.js` `leafRows`, `renderLeaves`): with labels of format `training-data-foundation-labels/3`, its units labelled by any method and by each method, agent and classifier (`leaves` of the commit's `meta/labels.json`: `units`, `by_method`), one column per class (`by_class`, the classes with the most units first), the leaf's threshold, and the command that takes its labelled units from every source (`--leaf <code>`, with `--method` for the method chosen in the switch above the table, kept in the address, and the units choice in force);of an older commit, agent, the units of the material sets whose domain holds the leaf (`projections.leaves.by_leaf` of `meta/coverage.json`), and classifier, the corpus units scored at or above the leaf's threshold, then its classes and threshold, and for a leaf with classifier units the command that takes them from the corpora (`--kind corpus --leaf <code>`), as that commit's fetch tool takes them;a line above it names the labels' model, and a commit without `meta/labels.json` says it carries no labels yet and shows a dash for the classifier's counts.Under it, two tables of every source of the commit, whatever its status: by its kind of source (`catalog/source_kinds.tsv`) and by the class of its form (`catalog/stages.yaml`), each row in its table's order with its sources, its material sets and their units and its corpora and their units (`app.js` `renderKinds`, from `projections.source_kinds.by_kind` and `projections.classes.by_class` of the commit's `meta/coverage.json`, `index_projection.kind_coverage`);a commit whose projection gives neither says so in one line.One crossfilter selection holds the filters, one clause per filter; a click on a bar or a cell picks through thechart's toggle and the page sets the clause, so the panel and the charts set the same clauses.A chart's tooltips (Observable Plot's pointer) stop the other listeners of a mouse press on the chart to pin the tip,62 unmodified linesfiles, the permit classes for training and redistribution as "x / y files" and the licenses behind each, or onephrase when all its files allow both, read from the catalog column `license_counts`; without the column, as before)and, for a material set, an example unit file.A source whose units the commit labels (files under `labels/<source>/`) has a line "Labels" (`app.js` `labelItem`): the labels' model, its units by method (`by_method` of `meta/labels.json`, format /3) and its units of each leaf (`sources`), the most first;the labels of its first units, one line per `unit_id` of the first 200 rows of its first label file with each leaf's label, a classifier's score in bold at or above that leaf's threshold or the method agent, and its class;and the command that takes its units of the leaf it holds the most of (`--source <id> --leaf <code>`, with `--method` for the method chosen and the units choice in force; `--kind corpus` before it at a commit whose catalog has the column `kind`).#2629: its line "Take it" is the command that takes the source alone: a material set whole (no `--sample`), with itsunits and its size beside the command; a corpus, whose whole can be petabytes, by the units choice below (thereader's, else 3 per source).29 unmodified linesclears the choice, so the other layer takes its own default again;#1891: "all" leaves `--sample` out, so the command takes every unit of the selected sources and the default profile stays on;it never gives `fetch.py --all` (which turns off the profile's criteria other than benchmark and not compared), and the folder tree lists what the profile leaves out under every choice:#2397: the criteria `tools/fetch.py` applies by default, in its order, as the release lists them in `meta/vocabulary.json` (`profile`, from `public_fetch.CRITERIA` less `OPT_IN`, the three that #2441 applies only when asked: license, personal data and refused), each by its words in the page's language (`profile.<criterion>` of the locales), so the page and the tool show one list; a vocabulary without that list shows none;#2422: each with the flag of `tools/fetch.py` that takes it back (the criterion's `option` in that list, from`public_fetch.RELAX`: duplicates `--keep-duplicates`, benchmark copies `--allow-benchmark`, rows not compared withthe benchmark list `--allow-not-compared`, not English `--any-language`, over 20 MB `--any-size`), and #2441 under itthe three flags that leave out rows by license, personal data or the fetch check's reading, `--training-only`,`--no-personal-data` and `--no-refused`.The link beside the selection chips reads "Change filters" and goes to the filter panel.#1498, #1524: below it, the usage example video block (id `usage-video`, which the dataset card and the project pagelink to) plays the video of the page's language from `media/` of the dataset, `usage-example.zh.mp4` in Chinese and77 unmodified lines`{{ tut.fetched }}` those of them the tutorial's take uses: each whose every row the release's fetch check read andfetched (catalog column `fetch_check`, level `all` over as many rows as its column `files`), so that the take completes.#2442: `{{ parts.en.* }}` and `{{ parts.zh.* }}` are the parts of the dataset card the manual holds, in the words ofeach text (the tables of every stage's funnel, of personal information, of known limits, of release days and of what iskept out by law with what is collected instead, the fields used most, the line of the release's own counts and checks,and the card's addresses), computed by theprojection's code (`artpool.index_projection.manual_parts`) from `meta/size_figures.json`, `meta/stage_figures.json`and `meta/translations.parquet` of that commit and the deploy's `catalog/blocked.tsv`, so they say what the release's card would.`{{ out.<name> }}` is the output of a command the manual shows, run for real against that release in the deploy'stemporary directory, within a time limit, and cut as the manual shows it;`03_data_line/steps/portal.py` (`manual_outputs`) holds each command and SQL file, the exit code the manual shows and
3 unmodified lines456789101112131415161718192021221 unmodified line2425262728293031323334353637383969 unmodified lines10911011111211311411516 unmodified lines13213313413513613713813914014114214314414514614714814915015115215315415515615715815916055 unmodified lines21621721821922022168 unmodified lines2902912922932942952962975 unmodified lines3033043053063073083093103113123132 unmodified lines3163173183193203218 unmodified lines33033133233333433533633733833934034134234334432 unmodified lines3773783793803813823833843 unmodified lines3883893903913923933943951 unmodified line39739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742830 unmodified lines45946046146246346446546646724 unmodified lines49249349449549649749816 unmodified lines5155165175185195205215225235245255 unmodified lines53153253353453553628 unmodified lines56556656756856957057116 unmodified lines588589590591592593594595596597598599112 unmodified lines7127137147157167177187197201 unmodified line7227237247257267277287297307317323 unmodified lines7367377387397407417427434 unmodified lines74874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781830 unmodified lines84985085185285385485585625 unmodified lines88288388488588688788888912 unmodified lines90290390490590690790813 unmodified lines9229239249259269279289299309319329339341 unmodified line93693793893994094194218 unmodified lines9619629639649659669678 unmodified lines97697797897998098198216 unmodified lines9991000100110021003100410059 unmodified lines101510161017101810191020102195 unmodified lines111711181119112011211122112311241125112640 unmodified lines116711681169117011711172117311741175117611771178117911805 unmodified lines11861187118811891190119111921193119411951196119711981199120012011202120311 unmodified lines121512161217121812191220122132 unmodified lines12541255125612571258125912601 unmodified line12621263126412651266126712681269127012711272127312741275127612771 unmodified line12791280128112821283128412851286128712881289129025 unmodified lines1316131713181319132013211322132313241325132615 unmodified lines13421343134413451346134713485 unmodified lines1354135513561357135813591360136113621363136418 unmodified lines13831384138513861387138813891390139113921393139413951396139764 unmodified lines1462146314641465146614671468146963 unmodified lines15331534153515361537153815396 unmodified lines1546154715481549155015511552155315541555155615571558155948 unmodified lines1608160916101611161216131614161534 unmodified lines165016511652165316541655165617 unmodified lines167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170113 unmodified lines171517161717171817191720172120 unmodified lines17421743174417451746174717481749175033 unmodified lines178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181158 unmodified lines187018711872187318741875187627 unmodified lines1904190519061907190819091910191119121913191419151916191719181919192019215 unmodified lines192719281929193019311932193314 unmodified lines19481949195019511952195319541955195682 unmodified lines20392040204120422043204420452046204720482049205097 unmodified lines21482149215021512152215377 unmodified lines2231223222332234223522367 unmodified lines2244224522462247224822493 unmodified lines// charts) and Get the data (the one command and the selection file). The dataset card is the overview; this page is// where data is picked and taken.// Figures first, few words; every chart keeps a short label and a table view. The charts of Pick, its filter counts and// the list of selected sources come from one crossfilter selection (linked.js). The two layers stay apart everywhere// and are never added together (#1083): material sets, grouped into collections and counted in sets and units, in the// main color; corpora, counted in rows, in gray. Pick shows one layer at a time (F.kind, material sets by default; a// training stage takes the layer it counts).import {CORPUS, DATASET_URL, fileUrl, KINDS, loadBatchDates, loadIndex, MATERIAL_SET, num, readColumns, REPO, summed, topOf,wholeFile,} from './data.js';import {clear, el, figureWithToggle, fmtAnd, fmtBytes, fmtCompact, fmtDate, fmtInt, fmtOr, fmtPct, fmtShare, fmtShort,segmented, table, tableShown, vt,} from './charts.js';import { decorate, drawRelease, drawStages, markFromIndex, RULE_KEY, sizeLine, sizeOf, sizeParts, stageColor, stageWhat } from './first.js';import { lang, onLanguage, setUpSwitch, t, tEn, translatePage } from './i18n.js';import { formIcon, icon } from './icons.js';1 unmodified lineconst ROW_COLUMNS = ['source', 'batch', 'uri', 'range_offset', 'range_length', 'member_path', 'size_bytes', 'sha256'];const FIRST_ROWS = 20;// the columns of a source's label files (labels/<source>/*.parquet) its detail reads, and how many of the first file's// rows (one per unit and leaf labelled)const LABEL_COLUMNS = ['unit_id', 'leaf', 'score', 'class'];const LABEL_ROWS = 200;const HEAT_FORMS = 8;const FORM_BARS = 10;// #1524: how many units Get the data takes from each source (--sample N; all: no --sample, #1891); #2629: when the// reader has not chosen (sample in the address), every unit of material sets, whose whole is small, and 3 of each// corpus, whose whole can be petabytes (DEFAULT_SAMPLE by the layer the command takes, sampleNow)const SAMPLES = ['1', '3', '10', '30', 'all'];const DEFAULT_SAMPLE = { [MATERIAL_SET]: 'all', [CORPUS]: '3' };const MAX_FILE = 20e6;const MAX_LISTED = 30;// the phone layout of style.css69 unmodified linesconst unitsText = (n, missing = 0) => (n == null ? t('n.unitsNotCounted') : plural('n.unit', n) + uncounted(missing));const unitsNum = (n) => (n == null ? t('n.notCounted') : fmtInt(n));const unitsOfSets = (S) => { const u = summed(S.map((s) => s.readyUnits)); return unitsText(u.sum, u.missing); };const notCountedOf = (S) => summed(S.filter((s) => s.isTask).map((s) => s.readyUnits)).missing;/** #2066: a chart of plots.js, draw(); until the module is loaded a skeleton of class sk, and the reason in its place* when it could not be loaded (each figure's Table view has the same numbers). */function plotted(draw, sk = 'sk sk-block') {16 unmodified lines// across: the ids the filters keep in either layer (linked.js startAcross)const UI = { across: null, allForms: false, showAll: false, detail: new Map(), preview: new Set(), previewRows: new Map(), csv: null, tab: 'cmd', fitKeyOpen: false, ids: null, facets: {},tables: { dom: [], form: [], heat: [] }, charts: null };// kind: the layer the browse section shows (material_set, the default, or corpus); metric: what the charts of material// sets count (sets or units; corpora are counted in rows); pick: the ids of the picked sources, joined by commas; ext:// the file types selected, joined by commas; sample: how many units Get the data takes from each source (SAMPLES);// stage (#2006): the id of a training stage of the stage table (the commit's stage figures); pii (#2422): the personal-data mark (none,// marked or unknown, piiMark). The panel shows no control for collection, leaf, tier, redist and status (#2422): from// the address they still filter, each a chip that removes it// view (#2422, second round): the arrangement of the field (VIEWS), strata by defaultconst KEYS = ['domain', 'leaf', 'form', 'collection', 'kind', 'train', 'redist', 'tier', 'size', 'status', 'q', 'ext', 'stage', 'pii', 'metric', 'sort', 'dir', 'open', 'pick', 'sample', 'view'];function readUrl() {const p = new URLSearchParams(location.search);for (const k of KEYS) F[k] = p.get(k) || '';if (F.kind !== CORPUS) F.kind = MATERIAL_SET;if (F.metric !== 'units') F.metric = 'sets';if (!F.sort) { F.sort = 'fit'; F.dir = 'desc'; }if (!SAMPLES.includes(F.sample)) F.sample = '';if (!VIEWS.includes(F.view)) F.view = VIEWS[0];}function writeUrl() {const p = new URLSearchParams(location.search);for (const k of KEYS) {const v = F[k];const dflt = (k === 'kind' && v === MATERIAL_SET) || (k === 'metric' && v === 'sets') || (k === 'sort' && v === 'fit') || (k === 'dir' && v === 'desc')|| (k === 'view' && v === VIEWS[0]);if (v && !dflt) p.set(k, v); else p.delete(k);}55 unmodified lines}const domainKeysOf = (s) => (s.domainKind === 'codes' ? s.tops : [s.domainKind === 'multi' ? MULTI : NONE]);const formKeyOf = (s) => s.form ?? NONE;// #2422: a source's personal-data mark, a label the page filters on and counts and never leaves a source out of a count// for: its catalog pii.level present or suspected (marked), none_known (none), else not judged yet (unknown)const PII_MARKED = ['present', 'suspected'];68 unmodified lines// answer (the ids of the selected sources) is what every part below the filters showsconst sizeBucket = (b) => (b == null ? 'unknown' : b < 1e9 ? 'lt1g' : b < 1e12 ? '1g1t' : 'ge1t');/** One row of the page's DuckDB table src (linked.js): what the filters and the charts read of a source; n_units are* the units of a material set (#2065: null, which SQL's sum leaves out, while not counted yet) and n_rows the rows of a* corpus, 0 for the other kind; collection is that of a material* set or (#1633) of a corpus a collection lists, '' otherwise; exts its file types and ext_rows the rows of each* (data.js exts); #2006: stages the ids of the training stages one of its units passes (data.js stages); #2422: sizeb* the size class of its deduplicated size, the one size the page shows, and pii its personal-data mark (piiMark). */5 unmodified lines// #2066: the search reads the title and description in both languagesqtext: [s.title, s.description, IX.zh.get(s.title), IX.zh.get(s.description), s.id].filter(Boolean).join('\n').toLowerCase(),exts: s.exts.map(([e]) => e), ext_rows: s.exts.map(([, n]) => n), stages: s.stages,};}const selected = () => (UI.ids ? IX.sources.filter((s) => UI.ids.has(s.id)) : []);const FILTER_KEYS = ['domain', 'leaf', 'form', 'collection', 'train', 'redist', 'tier', 'size', 'status', 'q', 'ext', 'stage', 'pii'];// the clauses of the selection: the filters and the layer shown (kind, always one of the two)const SEL_KEYS = [...FILTER_KEYS, 'kind'];const activeFilters = () => FILTER_KEYS.filter((k) => F[k]);/** The filters that are on, as [label, value, key] in the page's language. */2 unmodified linesconst word = (key) => t(key, { defaultValue: '' });if (F.domain) out.push([t('chip.domain'), F.leaf ? domainName(F.leaf) : domainName(F.domain), 'domain']);if (F.form) out.push([t('chip.form'), formName(F.form), 'form']);if (F.collection) out.push([t('chip.collection'), collectionName(F.collection), 'collection']);if (F.stage) out.push([t('chip.stage'), stageName(F.stage), 'stage']);if (F.train) out.push([t('chip.training'), word(`filter.permit.${F.train}`), 'train']);8 unmodified lines}/** #1524: the file types selected (F.ext), in the order of the address. */const extList = () => (F.ext ? F.ext.split(',').filter(Boolean) : []);/** What the charts count, in the layer shown: material sets in sets or units (F.metric), corpora in rows. */const metricNow = () => (F.kind === CORPUS ? 'rows' : F.metric);function metricOf(s, m = metricNow()) { return m === 'sets' ? 1 : m === 'units' ? s.readyUnits : s.rawRows; }const metricFmt = () => (v) => fmtInt(v);const metricWord = (m) => t(`metric.${m}`);/** #2422: the layer a training stage counts: that of the sources one of whose units passes it (a stage's condition names* one kind), else by its measures (a stage counted in units counts material sets). */function stageKind(id) {const s = IX.sources.find((x) => x.stages.includes(id));if (s) return s.kind;return IX.stageList.find((x) => x.id === id)?.counted_by?.includes('units') ? MATERIAL_SET : CORPUS;32 unmodified lines// script reads the main branch as it is when it starts)const fetchUrl = () => fileUrl(IX.pin, 'tools/fetch.py');/** #2629: the layer a command takes: the picked sources' while there are picks (corpora when one of them is a corpus),* else the layer shown. */function takenKind() {const picks = IX ? picked() : [];return picks.length ? (picks.some((s) => !s.isTask) ? CORPUS : MATERIAL_SET) : F.kind;}3 unmodified lines* which turns the default profile's other criteria off: "all" is a choice of how many units, and the profile stays on. */const sampleArgs = (v = sampleNow()) => (v === 'all' ? [] : [`--sample ${v}`]);/** The options of a command, one string each; exts: one --ext per file type (#1524); sample: the units choice it takes* (#2629: the one in force unless given); leaf: the leaf whose labelled corpus units it takes (--leaf). */function commandArgs({ domain, form, sources, tags, kind, exts, sample, leaf } = {}) {const a = [`--revision ${IX.pin}`];if (kind) a.push(`--kind ${kind}`);if (sources) for (const s of sources) a.push(`--source ${s}`);1 unmodified lineif (domain) a.push(`--domain ${domain}`);if (form) a.push(`--form ${form}`);if (leaf) a.push(`--leaf ${leaf}`);if (exts) for (const e of exts) a.push(`--ext ${e}`);a.push(...sampleArgs(sample), '--out ./data');return a;}// #1216: one option per line, continuation lines indented four spaces and every line but the last ending in " \", so// the text shown is the text copied and runs as it isconst command = (args) => [`uv run ${fetchUrl()}`, ...args].join(' \\\n ');/** The options that take exactly S, sources of one layer, within domain and form (#1083: one command per layer).* whole: S is every source of its layer within domain and form, taken by fetch.py's --kind (#1216). Otherwise material* sets are taken through the campaign tags of their collections (--tag campaign:<name>, any of them; a collection's* material sets carry the campaign of the collection or of one of its earlier names, vocabulary* collections[].campaigns), within --domain and --form; corpora, and material sets without a collection, one --source* each. exts: the file types selected, one --ext each (#1524). */function layerArgs(S, { domain, form, whole = false, exts } = {}) {if (whole) return { args: commandArgs({ kind: S[0]?.isTask ? MATERIAL_SET : CORPUS, domain, form, exts }), listed: false };const colls = new Set(S.map((s) => s.collection));if (!S[0]?.isTask || colls.has(null)) return { args: commandArgs({ sources: S.map((s) => s.id), exts }), listed: true };const tags = IX.vocab.collections.filter((c) => colls.has(c.code)).flatMap((c) => c.campaigns);return { args: commandArgs({ tags, domain, form, exts }), listed: false };}/** The options that select exactly the page's selection (one layer). fetch.py's --domain matches a top-level code with* its leaves, a leaf only itself, and multi and unclassified only themselves, as the page's domain filter does; --form* matches one form id. So the layer's options within domain and form when only those filters and the collection are* set (and the form is a classified one; without a collection the whole layer there, --kind), else one --source per* selected source. #1524: the file types selected narrow the rows of either, one --ext each (fetch.py keeps the rows* of any of them, so a source without such rows gives none). */function selectionArgs(sel) {const exts = extList();const other = activeFilters().some((k) => !['domain', 'leaf', 'form', 'collection', 'ext'].includes(k)) || F.form === NONE;30 unmodified lines// button that opened it. A commit whose vocabulary has no term table shows no such line. #2614: the start of the// manual has the same line ([data-terms]), drawn again with the manual's text (showView).const TERMS = ['material set', 'corpus', 'unit', 'domain'];function renderTerms() {const terms = IX?.vocab.terms;const have = TERMS.filter((k) => terms?.get(k)?.about);for (const line of document.querySelectorAll('#terms, .manual-text [data-terms]')) {line.hidden = !have.length;if (!have.length) continue;24 unmodified linesfunction renderStageFig() {if (!IX) return;const why = IX.stages ? [] : [stageWhy()];drawStages(stageFigList(), { pick: F.stage, onPick: IX.stages ? pickStage : null, onPoint: (g) => FIELD?.front(g), why, rest: restWhat() });}/** A stage's band: the filter by stage set to it (with its layer), or cleared when it holds it already; the field and* the panels of the screen show the result. */16 unmodified linescase 'size': return words('filter.size', ['lt1g', '1g1t', 'ge1t', 'unknown']);case 'train': return words('filter.permit', ['yes', 'cond']);case 'pii': return words('filter.pii', ['none', 'marked', 'unknown']);default: return [];}}// #2422: the filters of the panel, each a select (the file types are checkboxes, fillExt), in the panel's orderconst SELECTS = { stage: 'f-stage', domain: 'f-domain', form: 'f-form', size: 'f-size', train: 'f-train', pii: 'f-pii' };const ANY = new Set(['size', 'train', 'pii']);function fillSelect(key) {if (key === 'ext') { fillExt(); return; }5 unmodified linesclear(s).append(option('', text(t(ANY.has(key) ? 'filter.any' : 'filter.all'), key === 'stage' ? null : f?.total)),...opts.map(([v, name]) => option(v, text(name, f ? f.m.get(v) || 0 : null))));s.value = F[key] || '';if (key === 'stage') {// #2006: the selected stage's condition (#2066: in Chinese its text in the table of Chinese names, once the release// has it) and the version of the stage table on hover; without stages of the commit the page reads, the filter is28 unmodified lines// #2422: the fold's summary says how many types are checked$('ext-on').textContent = on.length ? t('filter.on', { count: on.length, n: fmtInt(on.length) }) : '';}const fillFilterOptions = () => { Object.keys(SELECTS).forEach(fillSelect); fillExt(); };function fillFilterRow() {fillFilterOptions();for (const [key, id] of Object.entries(SELECTS)) {16 unmodified lines* the selection. */function syncFilterRow() {for (const [key, id] of Object.entries(SELECTS)) if ($(id).value !== F[key]) $(id).value = F[key];fillExt();if (document.activeElement !== $('f-q')) $('f-q').value = F.q;if (F.ext) $('ext-fold').open = true;const n = activeFilters().length;$('f-clear').disabled = !n;const count = UI.ids ? plural(F.kind === CORPUS ? 'n.corpus' : 'n.materialSet', UI.ids.size) : '';$('filter-state').textContent = n ? [t('filter.on', { count: n, n: fmtInt(n) }), count].filter(Boolean).join(' · ') : t('filter.noneOn');$('f-count').textContent = count;}112 unmodified linesonclick: () => { UI.allForms = !UI.allForms; drawCharts(); } }, UI.allForms ? t('common.fewer') : t('common.all', { n: fmtInt(forms.length) })): null;figureWithToggle($(FIGS[k]), k, title, {// the layer the chart draws, in its color, above the chart; the table holds that layer's columns onlychart: () => el('div', {}, kindKey([F.kind]), el('div', { class: 'plot-wrap' }, UI.charts[k])),table: () => (F.kind === CORPUS? table([...keyHeads, { label: t('th.corpora'), r: true }, { label: t('th.corpusRows'), r: true }],UI.tables[k].map((r) => [...keyCells(r), fmtInt(num(r.n)), fmtInt(num(r.rows))])): table([...keyHeads, { label: t('th.materialSets'), r: true }, { label: t('th.readyUnits'), r: true }],1 unmodified linesql: () => consoleSql(k),}, more);}// ---- the leaves whose material sets hold the fewest units, in the order the funnel takes them (03_data_line/v2/// funnel_propose.py pick): by the units of the material sets whose domain holds the leaf (projections.leaves of the// commit's meta/coverage.json, index_projection.leaf_coverage, which counts them as the funnel does), the grid's order// among equals, the first FEWEST_LEAVES of them (the upstream search takes every leaf in the same order, after those it// has not searched for a day)const FEWEST_LEAVES = 5;const leafOrder = (code) => String(code).replace(/^D/, '').split('.').map(Number);function byGrid(a, b) {3 unmodified lines}function fewestLeaves() {const byLeaf = IX?.coverage?.projections?.leaves?.by_leaf || {};return Object.entries(byLeaf).map(([leaf, v]) => ({ ...v, leaf, units: num(v.units) || 0 })).sort((a, b) => a.units - b.units || byGrid(a.leaf, b.leaf)).slice(0, FEWEST_LEAVES);}/** A leaf's name in the page's language: the vocabulary's, else the one projections.leaves gives. */function leafName(r) {4 unmodified linesconst rows = fewestLeaves();$('fewest').hidden = !rows.length;if (!rows.length) return;clear($('fewest-body')).append(table([t('th.leaf'), t('th.domain'), { label: t('th.materialSets'), r: true }, { label: t('th.readyUnits'), r: true }],rows.map((r) => [leafName(r), domainName(r.domain), fmtInt(num(r.material_sets) || 0), fmtInt(r.units)])));}// ---- every leaf's units by method, in the grid's order: agent, the units of the material sets whose domain holds the// leaf, each chosen by an agent (projections.leaves of the commit's meta/coverage.json, as above), and classifier, the// corpus units a classifier scored at or above the leaf's threshold (leaves of the commit's meta/labels.json: units,// threshold), then the classifier's units by class (by_class), the classes with the most units first; a row with// classifier units has the command that takes them from the corpora (--kind corpus --leaf)function leafRows() {const byLeaf = IX?.coverage?.projections?.leaves?.by_leaf || {};const lab = IX?.labels?.leaves || {};return [...new Set([...Object.keys(byLeaf), ...Object.keys(lab)])].sort(byGrid).map((leaf) => {const c = byLeaf[leaf] || {};const l = lab[leaf] || {};return { ...c, leaf, domain: c.domain || leaf.split('.')[0], agent: num(c.units) || 0,classifier: l.units == null ? null : num(l.units), threshold: l.threshold ?? null, byClass: l.by_class || {} };});}function renderLeaves() {const rows = leafRows();$('leaves').hidden = !rows.length;if (!rows.length) return;const totals = new Map();for (const r of rows) for (const [k, v] of Object.entries(r.byClass)) totals.set(k, (totals.get(k) || 0) + (num(v) || 0));const classes = [...totals].sort((a, b) => b[1] - a[1]).map(([k]) => k);const none = IX.labels ? fmtInt(0) : '\u2014';const take = (r) => (r.classifier ? copyButton(t('copy.button'), command(commandArgs({ kind: CORPUS, leaf: r.leaf, sample: F.sample || DEFAULT_SAMPLE[CORPUS] }))) : '');clear($('leaves-body')).append(el('p', { class: 'small' }, IX.labels ? t('leaves.model', { model: IX.labels.model ?? t('common.unknown') }) : t('leaves.noLabels')),el('div', { class: 'table-wrap' }, table([t('th.leaf'), t('th.domain'), { label: t('th.agent'), r: true }, { label: t('th.classifier'), r: true },...classes.map((k) => ({ label: sentence(k), r: true })), { label: t('th.threshold'), r: true }, t('th.command')],rows.map((r) => [leafName(r), domainName(r.domain), fmtInt(r.agent), r.classifier == null ? none : fmtInt(r.classifier),...classes.map((k) => (r.byClass[k] == null ? none : fmtInt(num(r.byClass[k])))),r.threshold == null ? '' : String(r.threshold), take(r)]))));}/** The heading of the map: what the selection holds, by the map's count, and the domains it covers. */function renderMapHead(sel) {const m = metricNow();for (const b of $('layer-seg').querySelectorAll('button')) b.setAttribute('aria-pressed', String(b.dataset.kind === F.kind));for (const b of $('metric-seg').querySelectorAll('button')) b.setAttribute('aria-pressed', String(b.dataset.metric === m));$('metric-wrap').hidden = F.kind === CORPUS;if (!UI.ids) return;const total = sum(sel, (s) => metricOf(s, m));const covered = new Set(sel.flatMap((s) => s.tops)).size;const amount = m === 'sets' ? plural('n.materialSet', total): m === 'units' ? t('map.units', { count: total, n: fmtCompact(total) }) + uncounted(notCountedOf(sel)): t('map.rows', { count: total, n: fmtCompact(total) });$('map-h').textContent = !sel.length ? t('map.nothing') : covered ? t('map.head', { amount, domains: plural('n.domain', covered) }) : amount;}// ---- the queries behind the tables, for the dataset's SQL Console: over the catalog of the commit the page reads,// filtered by the filters that filter that table (linked.js filtersOf), written over the catalog's own columns; the// domain keys and the kind are those of data.js, in the catalog's words (unclassified, multi; the column kind, or the// rule it is written by when the commit's catalog has none). A query counts the layer shown only, in its own measure:// material sets and their units, or corpora and their rows. The licence filters read meta/sources.json, which is no// table, so they name their sources by id (or the ids they leave out, whichever list is shorter).const READY_SQL = 'coalesce(units < files, false)';const kindSql = () => (IX.hasKind ? 'kind' : `CASE WHEN ${READY_SQL} THEN '${MATERIAL_SET}' ELSE '${CORPUS}' END`);const DOMAIN_KEYS_SQL = "CASE WHEN domain IS NULL OR len(domain) = 0 OR list_contains(domain, 'unclassified') THEN ['unclassified'] "+ "WHEN list_contains(domain, 'multi') THEN ['multi'] ELSE list_distinct([split_part(code, '.', 1) FOR code IN domain]) END";const FORM_SQL = "coalesce(nullif(form, ''), 'unclassified')";const sumsSql = () => (F.kind === CORPUS ? 'count(*) AS corpora, sum(files) AS corpus_rows' : 'count(*) AS material_sets, sum(units) AS units');// #2422: the size classes of the deduplicated size, the one size the page shows (catalog column distinct_bytes)const SIZE_SQL = { lt1g: 'distinct_bytes > 0 AND distinct_bytes < 1e9', '1g1t': 'distinct_bytes >= 1e9 AND distinct_bytes < 1e12',ge1t: 'distinct_bytes >= 1e12', unknown: 'coalesce(distinct_bytes, 0) <= 0' };30 unmodified lines// #2006: a source's stages are computed from the stage table (the commit's stage figures), no column of the catalog, so the// sources are named by idstage: (v) => idsSql(new Set(IX.sources.filter((s) => s.stages.includes(v)).map((s) => s.id))),};const parts = keys.filter((k) => F[k]).map((k) => `(${sqlOf[k](F[k])})`);return parts.length ? `WHERE ${parts.join('\n AND ')}` : '';}25 unmodified linescase 'title': return titleOf(s).toLowerCase();case 'domain': return sourceDomainText(s).toLowerCase();case 'form': return formName(formKeyOf(s)).toLowerCase();// units of material sets above rows of corpora (never compared as one count): a corpus has fewer than 1e12 rowscase 'units': return s.isTask ? 1e12 + s.readyUnits : s.rawRows;case 'size': return s.distinct ?? -1;case 'tier': return tierName(s.tier).toLowerCase();case 'fit': return fitScore(s);12 unmodified lines// #364, #1158: the same words as docs/sources.md of the index (artpool/projection_templates/text.json, size_text), in// the locale files as size.*/** The size note under the list: the size of the layer shown (meta/size_figures.json, IX.sizes; #2422: its deduplicated* size), with the estimate for its rows without a recorded size. */function sizeNote() {const g = IX.sizes?.[F.kind];if (!g) return t('size.none');13 unmodified linesconst i = IX.vocab.collections.findIndex((c) => c.code === s.collection);return i < 0 ? IX.vocab.collections.length : i;}/** The list of the selection, one layer: material sets grouped by collection (a header row per collection, in the* vocabulary's order), corpora as one list, or (#1633) grouped the same way when a collection lists some of them;* the heading names the layer shown only. */function renderSources(sel) {if (!UI.ids) return;const dir = F.dir === 'asc' ? 1 : -1;const sets = F.kind !== CORPUS;const grouped = sets || sel.some((s) => s.collection);const byColl = (a, b) => (grouped ? collectionRank(a) - collectionRank(b) : 0);const list = [...sel].sort((a, b) => {1 unmodified lineconst y = sortValue(b, F.sort);return byColl(a, b) || (x < y ? -1 : x > y ? 1 : 0) * dir || titleOf(a).localeCompare(titleOf(b));});$('sources-h').textContent = !sel.length ? t('sources.none'): sets ? t('sources.headSets', { sets: plural('n.materialSet', sel.length) }) : t('sources.headCorpora', { corpora: plural('n.corpus', sel.length) });const body = clear($('sources-body'));if (!sel.length) return;18 unmodified linesel('button', { type: 'button', onclick: () => {const d = on ? (F.dir === 'asc' ? 'desc' : 'asc') : (c.r || c.key === 'fit' ? 'desc' : 'asc');F.sort = c.key; F.dir = d; writeUrl(); renderSources(selected());} }, t(c.key === 'units' && !sets ? 'col.rows' : `col.${c.key}`), on ? (F.dir === 'asc' ? ' ↑' : ' ↓') : ''),c.key === 'fit' ? fitHeads() : null);}));const tbody = el('tbody');8 unmodified linestbody.append(el('tr', { class: 'group-row' }, el('th', { colspan: String(COLS.length), scope: 'colgroup' },sets && group ? el('button', { type: 'button', class: 'group-btn', 'aria-pressed': String(cur), title: t(cur ? 'coll.showing' : 'coll.open'),onclick: () => setFilter({ collection: cur ? '' : group }) }, cur ? icon('check', { size: 16 }) : null, name) : name,el('span', { class: 'small' }, plural(sets ? 'n.materialSet' : 'n.corpus', inColl.get(group))))));}const open = F.open === s.id;const toggle = () => openSource(open ? '' : s.id);16 unmodified linesel('td', { 'data-label': label(t('col.domain')), class: 'cat-cell' }, sourceDomainText(s)),oneForm(s) ? el('td', { class: 'form-cell form-same' }): el('td', { 'data-label': label(t('col.form')), class: 'form-cell' }, formIcon(formKeyOf(s), { size: 16 }), formName(formKeyOf(s))),el('td', { class: 'r num', 'data-label': label(s.isTask ? t('sources.unitsLabel') : t('sources.rowsLabel')) }, s.isTask? (s.readyUnits == null ? t('n.notCounted') : [fmtInt(s.readyUnits), el('span', { class: 'unit-word' }, t('sources.unitWord', { count: s.readyUnits }))]): el('span', { class: 'muted' }, fmtCompact(s.rawRows), el('span', { class: 'unit-word' }, t('sources.corpusWord', { count: s.rawRows })))),el('td', { class: 'r num size-cell', 'data-label': label(t('col.size')), title: s.size ? sizeLine(s.size, false) : null }, sizeCell(s)),9 unmodified linesconst wide = !matchMedia(PHONE).matches;body.append(el('details', { class: 'list-key-fold', open: wide || UI.fitKeyOpen, ontoggle: (e) => { if (!wide) UI.fitKeyOpen = e.currentTarget.open; } },el('summary', {}, t('sources.aboutFit')),el('div', { class: 'list-key' }, kindKey([F.kind]), el('span', { class: 'small' }, t('sources.fitKey')), FIT.map((x) => el('span', { class: 'fit-name' }, icon(x.icon, { size: 14 }), fitLabel(x.k))), fitKey())));body.append(el('table', { class: 'src-table' }, el('caption', { class: 'visually-hidden' }, kindName(F.kind)), el('thead', {}, head), tbody));body.append(el('div', { class: 'small size-note' }, el('p', {}, sizeNote()), sizeHow()));if (list.length > FIRST_ROWS) {95 unmodified linesif (!site) return [];return publishers > 1 ? [`${t('detail.publishers', { count: publishers, n: fmtInt(publishers) })} `, site] : [site];}function upstream(uri) {if (!uri) return null;if (/^https?:\/\//.test(uri)) return uri;if (uri.startsWith('campaign_files/')) return fileUrl(IX.sha, uri);const s3 = uri.match(/^s3:\/\/([^/]+)\/(.*)$/);if (s3) return `https://${s3[1]}.s3.amazonaws.com/${s3[2]}`;return null;40 unmodified linesfunction item(iconName, label, ...value) {return el('div', { class: 'd-item' }, el('dt', {}, icon(iconName, { size: 18 }), label), el('dd', {}, ...value));}/** The labels of corpus s: the labels' model and its units at or above each leaf's threshold (meta/labels.json* sources), the most first; the labels of its first units (got: the first rows of its first label file, 'loading' until* read, {error} when they could not be), one line per unit with each leaf's score, in bold at or above that leaf's* threshold, and its class; and the command that takes its units of the leaf it holds the most of. */function labelItem(s, got) {const leaves = IX.labels?.leaves || {};const held = Object.entries(s.labelled || {}).map(([leaf, n]) => [leaf, num(n) || 0]).sort((a, b) => b[1] - a[1]);const out = [el('span', { class: 'small' }, t('detail.labelModel', { model: IX.labels?.model ?? t('common.unknown') })),el('span', { class: 'chips' }, held.map(([leaf, n]) => el('span', { class: 'chip' }, `${leafName({ leaf })} ${fmtInt(n)}`)))];if (got === 'loading') out.push('\u2026');else if (got?.error) out.push(el('span', { class: 'problem-text' }, got.error));5 unmodified lines}const label = (r) => {const bar = leaves[r.leaf]?.threshold;const text = `${r.leaf} ${num(r.score).toFixed(2)}`;return el('span', { class: 'chip', title: leafName({ leaf: r.leaf }) },bar != null && num(r.score) >= num(bar) ? el('b', {}, text) : text, r.class ? ` \u00b7 ${r.class}` : '');};const shown = [...units].slice(0, FIRST_ROWS);out.push(el('div', { class: 'table-wrap sample' }, table([t('th.unit'), t('th.labels')],shown.map(([u, ls]) => [el('span', { class: 'mono', title: String(u) }, shortUri(String(u))),el('span', { class: 'chips' }, [...ls].sort((a, b) => num(b.score) - num(a.score)).map(label))]),t('detail.labelsFirst', { n: fmtInt(shown.length) }))));}if (held.length) {const cmd = command(commandArgs({ kind: CORPUS, sources: [s.id], leaf: held[0][0], sample: F.sample || DEFAULT_SAMPLE[CORPUS] }));out.push(el('span', { class: 'small' }, t('detail.takeLeaf', { leaf: leafName({ leaf: held[0][0] }) })),el('code', { class: 'cmd-inline' }, cmd), copyButton(t('copy.button'), cmd));}11 unmodified linesconst ownRows = (rows) => rows.filter((r) => r.source === s.id);if (!st.sample && s.files.length) {st.sample = 'loading';const cols = s.isTask ? [...ROW_COLUMNS, 'extra'] : ROW_COLUMNS;const unitFile = s.files[0];readColumns(fileUrl(IX.sha, unitFile.path), cols, rowsOf(unitFile, FIRST_ROWS)).then((r) => { st.sample = ownRows(r.rows); st.file = unitFile.path; redraw(); }, (e) => { st.sample = { error: e.message }; redraw(); });32 unmodified linesconst ups = upstreamsOfRows(metas);const names = publisherNames(metas);const allRead = rows.length >= s.rows;const counted = s.isTask ? t('n.unitsFiles', { units: unitsText(s.readyUnits), files: plural('n.file', s.rows) }) : plural('n.corpusRow', s.rawRows);// #2066: in the page's language (descriptionOf); the sentence admission writes (ADMIT_WHAT) is recognized in Englishconst own = s.description && !ADMIT_WHAT.test(s.description) ? descriptionOf(s) : '';const text = own1 unmodified line: s.publishers ? t('detail.countsFrom', { what: counted, publishers: plural('n.publisher', s.publishers) }): t('detail.counts', { what: counted }));dl.append(item('doc', t('detail.what'), text.length > 160 ? el('details', {}, el('summary', {}, firstSentence(text)), el('p', {}, text)) : text));// 2 a material set's units and files, what each row of a corpus points to (#2065: a corpus is counted in rows)const kindCount = (k) => {const n = num(s.info.unit[k]);return t(UNIT_KIND[k] ? `unitCount.${UNIT_KIND[k]}` : 'unitCount.code', { count: n, n: fmtCompact(n), kind: k });};const unitWhat = s.isTask? [el('span', { class: 'chips' }, el('span', { class: 'chip' }, unitsText(s.readyUnits)), el('span', { class: 'chip' }, plural('n.file', s.rows)))]: [el('span', {}, sentence(fmtOr(s.kinds.map((k) => (UNIT_KIND[k] ? t(`unitKind.${UNIT_KIND[k]}`) : k))))),el('span', { class: 'chips' }, s.kinds.map((k) => el('span', { class: 'chip' }, kindCount(k))))];dl.append(item('rows', t(s.isTask ? 'detail.files' : 'detail.oneUnit'), ...unitWhat));// 3 where it comes from (#1197: in words): the number of its publishers (#1256: the catalog's) and the main site of// its upstreams, else of the addresses of its rowsconst from = ups.length ? fromWords(ups, true, s.publishers) : fromWords(rows.map((r) => r.uri), false, s.publishers);1 unmodified line// #2588: the upstream it declares, one dataset or one catalog with its agent and entry address (each of them while// it still reads several)if (s.upstream) dl.append(item('pin', t('detail.upstream'), upstreamLines(s.upstream)));// 4 self-contained; #1216: the fit chip's answer (fit.alone), with the files of the source a material set of a// collection comes with (a license and a readme leave a unit usable alone): its rows read without a unitconst comps = [...new Set(rows.filter((r, i) => !isUnit(metas[i])).map((r) => r.uri.split('/').pop()))];const compChips = () => el('span', { class: 'chips' }, (comps.length ? comps : ['LICENSE', 'README.md']).map((c) => el('span', { class: 'chip mono-chip' }, c)));const ofCollection = !!(info.campaign || info.extended_by);dl.append(item('layers', t('detail.alone'), s.isTask? (fit.alone !== 'yes' ? [el('span', {}, t('detail.withCompanions')), compChips()]: ofCollection ? [el('span', {}, t('detail.alsoWith')), compChips()] : t('detail.yes')): fit.alone === 'yes' ? t('detail.eachFile') : t('detail.container')));25 unmodified linesconst permit = (field) => PERMIT_ORDER.map((k) => {const names = behind(field, k);return { k, value: num(lr[field]?.[k]?.rows) || 0, color: PERMIT_COLOR[k], label: permitLabel(k, names),note: t(`detail.shareOf${s.isTask ? 'Set' : 'Corpus'}${names.length ? '' : 'Only'}`, { licences: names.join(', ') }) };});// #1197: one line when every row allows both, the two bars when its rows differconst allAllowed = (field) => permit(field).every((x) => (x.k === 'yes' ? x.value > 0 : !x.value));// #1266: a material set's licence by kind of file, as the projection counted it (license_counts): per kind its// files, the permit classes for training and for redistribution as "x / y files" with the licences behind each, or// one phrase when all its files allow bothconst spdxOf = (xs) => [...new Set(xs.map((x) => x.spdx).filter(Boolean))].sort();15 unmodified linesreturn el('span', { class: 'lic-kind' }, head, classes('training_ok', t('detail.training')), classes('redistribution_ok', t('detail.shipping')));};dl.append(item('training', t('detail.licence'), el('span', { class: 'lic' }, el('b', {}, tierName(s.tier)), el('span', { class: 'small' }, lic.name || s.spdx || '')),s.isTask && s.licenceCounts ? el('span', { class: 'lic-kinds' }, FILE_KINDS.map(kindLine)): allAllowed('training_ok') && allAllowed('redistribution_ok') ? el('span', { class: 'small' }, t('detail.allAllowed')): el('span', { class: 'lic-bars' },el('span', { class: 'mini-title' }, t('detail.training')), shareBar(permit('training_ok'), s.rows),5 unmodified lines? el('span', { class: 'chips' }, s.stages.map((id) => el('span', { class: 'chip' }, stageName(id)))): t('detail.stagesNone'), el('span', { class: 'small' }, t('stage.version', { v: IX.stages.version }))));}// its labels, for a corpus whose units the commit labels (labelItem)if (s.labelFiles.length) dl.append(item('layers', t('detail.labels'), ...labelItem(s, st.labels)));// 7 size and unitsconst q = info.size_quantiles_upper_bytes || {};const amounts = s.isTask ? `${unitsText(s.readyUnits)} · ${plural('n.file', s.rows)}` : plural('n.corpusRow', s.rawRows);// #1158: the source's figures of meta/size_figures.json; #2422: its size first, the deduplicated onedl.append(item('size', t('detail.size'), el('span', { class: 'lic' }, el('b', {}, s.size ? sizeOf(s.size) : t('size.none')),el('span', { class: 'small' }, amounts), s.size ? el('span', { class: 'small size-parts' }, sizeParts(s.size, false).join(' \u00b7 ')) : null),18 unmodified linesif (pv === 'loading') dl.append(item('link', t('detail.example'), '…'));else if (pv.error) dl.append(item('link', t('detail.example'), el('span', { class: 'problem-text' }, pv.error)));else if (r) {const href = upstream(r.uri);const name = r.member_path || r.uri.split('/').pop() || r.uri;dl.append(item('link', t('detail.example'), el('span', { class: 'example' },href ? el('a', { href, rel: 'noopener', class: 'mono' }, name) : el('span', { class: 'mono' }, name),r.size_bytes != null ? el('span', { class: 'small' }, ` · ${fmtBytes(num(r.size_bytes))}`) : null)));}// 9 the command that takes this source: #2629: a material set whole, with its units and its size beside it; a corpus,// whose whole can be petabytes, by the units choice (the reader's, else 3 per source)const cmd = command(commandArgs({ sources: [s.id], sample: s.isTask ? 'all' : F.sample || DEFAULT_SAMPLE[CORPUS] }));dl.append(item('run', t('detail.take'), el('code', { class: 'cmd-inline' }, cmd), copyButton(t('copy.button'), cmd),s.isTask ? el('span', { class: 'small' }, s.size ? t('detail.takeWhole', { units: unitsText(s.readyUnits), size: sizeOf(s.size) }): t('detail.takeWholeNoSize', { units: unitsText(s.readyUnits) })) : null));64 unmodified linesconst chips = filterChips();const exts = extList();const where = [`source IN (${ids})`, ...(exts.length ? [`ext IN (${exts.map(sqlStr).join(', ')})`] : [])];// the selection is one layer: its sources in that layer's measureconst head = F.kind === CORPUS? t('sql.headCorpora', { sha: IX.sha.slice(0, 7), corpora: plural('n.corpus', sel.length), rows: plural('n.corpusRow', sum(sel, (s) => s.rawRows)) }): t('sql.headSets', { sha: IX.sha.slice(0, 7), sets: plural('n.materialSet', sel.length), units: unitsOfSets(sel) });return [63 unmodified lines...(IX.vocab.profile.length ? [el('p', { class: 'chart-title profile-title' }, t('tree.leftOut')),el('ul', { class: 'profile' }, IX.vocab.profile.map(({ criterion, option }) => el('li', {}, el('span', {}, t(`profile.${criterion}`)), el('code', {}, option)))),el('p', { class: 'small tree-note' }, t('tree.flagNote'))] : []),el('p', { class: 'small tree-note' }, t('tree.labelNote'), ' ', el('code', {}, '--training-only'), ' ', el('code', {}, '--no-personal-data')),el('p', { class: 'small agent-links' }, icon('robot', { size: 16 }),el('a', { href: t('url.forAgents') }, t('agents.readme')), ' · ', el('a', { href: 'llms.txt' }, 'llms.txt')));}6 unmodified lines// command beside it names too; tools/fetch.py --selection reads it, so the same file gives the same files later) and// the attribution file (per source its title, licence and attribution statement from meta/sources.json; #1577: and// its files by publisher, licence and licence URL from meta/attribution.parquet, each file's own, else its source's;// in English, the language of the dataset)const selectionName = () => `training-data-foundation-selection-${IX.sha.slice(0, 7)}.json`;const ATTRIBUTION = 'meta/attribution.parquet';const ATTRIBUTION_COLUMNS = ['source', 'publisher', 'license', 'license_url', 'files'];function selectionFile(sel, picks) {return `${JSON.stringify({format: 'training-data-foundation-selection/1', dataset: REPO, revision: IX.pin,filters: picks ? {} : Object.fromEntries([...activeFilters(), 'kind'].map((k) => [k, F[k]])), sources: sel.map((s) => s.id).sort(),}, null, 1)}\n`;}async function attributionFile(sel) {48 unmodified linesel('p', { class: 'small' }, el('code', {}, selectionName()), ' ', t('keep.selectionNote', { sources: plural(picks ? 'n.picked' : layerCount(), sel.length), sha: IX.sha.slice(0, 7) }))),codeCard('run', t('keep.again'), selectionCommand(picks), 2));}/** The key of the count word of the layer shown: n.materialSet or n.corpus. */const layerCount = () => (F.kind === CORPUS ? 'n.corpus' : 'n.materialSet');function codeCard(iconName, title, code, n) {return el('div', { class: 'code-card' },el('div', { class: 'code-head' }, el('span', { class: 'code-ico' }, icon(iconName, { size: 20 })),34 unmodified linesfunction chooseSample(v) {F.sample = v === DEFAULT_SAMPLE[takenKind()] ? '' : v;writeUrl();vt(() => { renderGet(selected()); renderSources(selected()); });}function unitsChoice() {return el('div', { class: 'units-row' }, segmented(t('get.units'), SAMPLES.map((v) => [v, v === 'all' ? t('get.unitsAll') : v]), sampleNow(), chooseSample));17 unmodified linesbody.append(...commandSteps(commandArgs({ sources: picks.map((s) => s.id) }), picks));body.append(keepCard(picks, true));}/** Get the data: the selection is one layer, so one command takes it (#1083); the other layer is one switch away.* Picked sources, when there are any, take its place (renderPicks). */function renderGet(sel) {if (!UI.ids) return;const picks = picked();renderDock(sel, picks);if (picks.length) { renderPicks(picks); return; }const ready = sum(sel, (s) => s.readyUnits);const raw = sum(sel, (s) => s.rawRows);const other = F.kind === CORPUS ? MATERIAL_SET : CORPUS;$('get-h').textContent = !sel.length ? t('get.nothing') : takeHeading(sel.length === 1 ? null : plural(layerCount(), sel.length));const body = clear($('get-body'));const switchOther = el('button', { type: 'button', class: 'link', onclick: () => setLayer(other) }, t('get.otherLayer', { name: kindName(other) }));if (!sel.length) { body.append(el('p', { class: 'small' }, switchOther)); return; }const chips = filterChips();const tabs = segmented('', [['cmd', t('get.command')], ['sql', 'SQL'], ['csv', 'CSV']], UI.tab, (v) => { UI.tab = v; vt(() => renderGet(selected())); });const pickRow = el('div', { class: 'pick-row' },el('span', { class: 'fact-line' }, icon('sources', { size: 18 }), el('b', {}, fmtInt(sel.length)), t(F.kind === CORPUS ? 'get.corpusWord' : 'get.setWord', { count: sel.length })),F.kind === CORPUS? el('span', { class: 'fact-line muted' }, icon('rows', { size: 18 }), el('b', {}, fmtCompact(raw)), t('cat.lead.raw', { count: raw })): el('span', { class: 'fact-line' }, icon('check', { size: 18 }), el('b', {}, fmtInt(ready)), t('cat.lead.ready', { count: ready }) + uncounted(notCountedOf(sel))),el('span', { class: 'chips' }, el('span', { class: 'chip' }, kindName(F.kind)), ...chips.map(([k, v]) => el('span', { class: 'chip', title: k }, v))),el('a', { class: 'small', href: '#filters' }, t('get.change')), switchOther, tabs);body.append(pickRow);if (UI.tab === 'cmd') {13 unmodified linesconst say = (text) => { csvState.textContent = text; UI.csv = { key, text }; };try {const csv = await buildCsv(sel, (d, n) => say(t('csv.progress', { count: n, done: fmtInt(d), n: fmtInt(n) })));download(`${REPO.split('/')[1]}-${IX.sha.slice(0, 7)}-${sel.length === 1 ? sel[0].id : `${sel.length}-${F.kind === CORPUS ? 'corpora' : 'material-sets'}`}.csv`, csv, 'text/csv');say(plural('n.pointerRow', csv.split('\n').length - 2));} catch (e) { say(e.message); }btn.disabled = false;20 unmodified lines/** The stage group of a source among the stages ids (the stage table's order): its first stage, else the last group,* in no stage. */const groupOf = (s, ids) => { const g = ids.findIndex((id) => s.stages.includes(id)); return g < 0 ? ids.length : g; };// #2629: why something is in no stage (artpool.stages.NO_STAGE, the keys of no_stage of the stage figures), each by the// key of its words; a reason the page does not know is said by its nameconst WHY_KEY = { condition: 'condition', ...RULE_KEY, 'not counted': 'notCounted' };// the color of a source's dot in the list: the picked stage's while the source feeds it, else its first stage'sconst groupColor = (s, ids) => stageColor(F.stage && s.stages.includes(F.stage) ? F.stage : ids[groupOf(s, ids)]);/** The points of the field: one per source and stage it feeds (a corpus that feeds two stages stands on both planes33 unmodified linesreturn picked >= 0 && p.g !== picked ? HALF : 1;});}/** #1083: what no stage counts, said per layer and never as one number: that of the layer shown. #2629: from the* release's figures (no_stage of meta/stage_figures.json, data.js noStage): its sources as the figure, its units or* corpus rows in the line under it, and its sources by reason as the steps (the condition, each rule, not counted yet;* a reason of none left out), its units or rows by reason on hover; so post-training's figure plus these is what the* selection of every material set counts. Figures written before #2629 give the sources of the layer shown in no* stage, without reasons. */function restWhat() {const sets = F.kind !== CORPUS;const head = { name: t('strata.rest'), title: t('strata.restTitle') };const sourcesWord = (n) => t(sets ? 'get.setWord' : 'get.corpusWord', { count: n });const reasons = Object.entries(IX.stageFigures?.noStage?.[F.kind] || {});if (!reasons.length || reasons.some(([, c]) => Object.values(c).some((v) => v == null))) {const here = IX.sources.filter((s) => !s.stages.length && s.kind === F.kind).length;return { ...head, num: fmtInt(here), word: sourcesWord(here), line: '', steps: [] };}const [many, amount] = sets ? ['material_sets', 'units'] : ['corpora', 'rows'];const fmt = sets ? fmtInt : fmtCompact;const said = (m, f) => reasons.filter(([, c]) => c[m]).map(([why, c]) => t(`strata.why.${WHY_KEY[why] || 'other'}`, { count: c[m], n: f(c[m]), why }));const n = sum(reasons, ([, c]) => c[many]);const left = sum(reasons, ([, c]) => c[amount]);return { ...head, title: `${head.title}\n${t(sets ? 'strata.whyUnits' : 'strata.whyRows', { list: said(amount, fmt).join(t('size.listSep')) })}`,num: fmtInt(n), word: sourcesWord(n), line: t(sets ? 'strata.restUnits' : 'strata.restRows', { count: left, n: fmt(left) }), steps: said(many, fmtInt) };}/** The labels of the field in the page's language: per stage group its figure and name at its plane and its name at* its lane, the domains' names, and the marks of the size axis. */58 unmodified linesFIELD = await mod.createField(host, {points: fieldPts, colors: [...ids.map(stageColor), '--none'], cells: doms.length, view: F.view,room: fieldRoom,tip: (i) => { const s = at(i); return [titleOf(s), [sourceDomainText(s), kindOne(s.kind), s.size ? sizeOf(s.size) : null].filter(Boolean).join(' · ')]; },onHover: (i) => { const id = i < 0 ? null : at(i).id; for (const b of $('sel-list').querySelectorAll('.src')) b.classList.toggle('hot', b.dataset.id === id); },onPick: (i) => focusSource(at(i)),onTouch: () => $('top').classList.add('touched'),27 unmodified lines};requestAnimationFrame(step);}/** The right panel: how many sources of the layer shown the selection holds, with their units or rows and the domains* they cover; its largest sources, each with its stage group's dot, its domain, its units and its size (a bar on a* logarithmic scale); and the light of the field's points. */function renderWork(sel) {if (!UI.ids) return;const sets = F.kind !== CORPUS;countTo($('sel-n'), sel.length);$('sel-word').textContent = t(sets ? 'get.setWord' : 'get.corpusWord', { count: sel.length });const ready = sum(sel, (s) => s.readyUnits);const raw = sum(sel, (s) => s.rawRows);const covered = new Set(sel.flatMap((s) => s.tops)).size;const meta = [sets ? [fmtInt(ready), t('cat.lead.ready', { count: ready }) + uncounted(notCountedOf(sel))] : [fmtCompact(raw), t('cat.lead.raw', { count: raw })],[fmtInt(covered), t('strata.domains', { count: covered })]];clear($('sel-meta')).append(...meta.map(([n, word]) => el('span', {}, el('b', {}, n), ' ', word)));const ids = stageFigList().map((s) => s.id);5 unmodified linesonclick: () => focusSource(s), onpointerenter: () => FIELD?.hover(pointOf(s.id)), onpointerleave: () => FIELD?.hover(-1) },el('span', { class: 'dot', 'aria-hidden': 'true' }),el('span', { style: 'min-width: 0' }, el('span', { class: 't' }, titleOf(s)),el('span', { class: 's' }, [sourceDomainText(s), s.isTask ? unitsText(s.readyUnits) : plural('n.corpusRow', s.rawRows)].join(' · '))),el('span', { class: 'sz' }, s.size ? sizeOf(s.size) : ''),el('span', { class: 'barw', 'aria-hidden': 'true' }, el('u', { style: `width: ${Math.max(2, (lg(s) / most) * 100).toFixed(0)}%` }))))));if (!sel.length) list.append(el('li', {}, el('p', { class: 'src-none' }, t('sources.none'))));14 unmodified linesclear(box);if (!s) return;const stages = s.stages.length ? s.stages.map(stageName).join(t('size.listSep')) : t('strata.rest');const rows = [[t('col.domain'), sourceDomainText(s)], [t('strata.layer'), kindOne(s.kind)], [t('col.form'), formName(formKeyOf(s))],s.isTask ? [t('col.units'), unitsNum(s.readyUnits)] : [t('col.rows'), fmtCompact(s.rawRows)],[t('col.size'), s.size ? sizeOf(s.size) : t('common.unknown')], [t('col.tier'), tierName(s.tier)], [t('filter.stage'), stages]];const isPicked = pickIds().includes(s.id);box.append(el('div', { class: 'card-s' },el('button', { type: 'button', class: 'x', 'aria-label': t('strata.close'), title: t('strata.close'), onclick: () => openSource('') }, '×'),82 unmodified linesmarkFromIndex();renderStageFig();renderTerms();drawRelease(IX.pin, IX.releaseDate);$('foot-pin').textContent = t('foot.index', { sha: IX.sha.slice(0, 7), date: fmtDate(IX.date) });if (IX.overrides.catalog || IX.overrides.vocabulary) {const chip = $('preview-chip');clear(chip).append(el('span', { class: 'dot other', 'aria-hidden': 'true' }), t('hero.preview'));chip.title = [IX.overrides.catalog, IX.overrides.vocabulary].filter(Boolean).join(' ');chip.hidden = false;}}97 unmodified linesrenderHeader();renderFewest();renderLeaves();fillFilterOptions();drawDockSample();FIELD?.setLabels(fieldLabels());77 unmodified lines// without stages every source is in one stage group, so the field starts by domain unless the address names an// arrangementif (!IX.stages && !new URLSearchParams(location.search).get('view')) F.view = 'domains';if (F.stage && stageKind(F.stage) !== F.kind) {F.kind = stageKind(F.stage);if (F.kind === CORPUS) F.collection = '';7 unmodified linesrenderMapHead([]);renderFewest();renderLeaves();for (const b of $('layer-seg').querySelectorAll('button')) b.addEventListener('click', () => setLayer(b.dataset.kind));for (const b of $('metric-seg').querySelectorAll('button')) {b.addEventListener('click', () => { F.metric = b.dataset.metric; writeUrl(); drawCharts(); renderMapHead(selected()); });3 unmodified lines4567891011121314151617181920212223241 unmodified line262728293031323334353637383940414269 unmodified lines11211311411511611711811912012112216 unmodified lines13914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417555 unmodified lines23123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128268 unmodified lines3513523533543553563573583595 unmodified lines3653663673683693703713723733743753763772 unmodified lines3803813823833843853868 unmodified lines39539639739839940040140240340440540640740840941041141232 unmodified lines4454464474484494504514524533 unmodified lines4574584594604614624634644654661 unmodified line46846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550630 unmodified lines53753853954054154254354454554654724 unmodified lines57257357457557657757816 unmodified lines5955965975985996006016026036046056066076086096106116126136146156165 unmodified lines62262362462562662762862963063163263363463528 unmodified lines66466566666766866967016 unmodified lines687688689690691692693694695696697698699112 unmodified lines8128138148158168178188198208218228238241 unmodified line8268278288298308318328338348358363 unmodified lines8408418428438448458468478488498508514 unmodified lines85685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999030 unmodified lines102110221023102410251026102710281029103025 unmodified lines10561057105810591060106110621063106412 unmodified lines107710781079108010811082108313 unmodified lines1097109810991100110111021103110411051106110711081109111011111 unmodified line111311141115111611171118111918 unmodified lines11381139114011411142114311448 unmodified lines115311541155115611571158115916 unmodified lines1176117711781179118011811182118311841185118611879 unmodified lines119711981199120012011202120395 unmodified lines12991300130113021303130413051306130713081309131040 unmodified lines1351135213531354135513561357135813591360136113621363136413651366136713685 unmodified lines137413751376137713781379138013811382138313841385138613871388138913901391139211 unmodified lines14041405140614071408140914101411141232 unmodified lines144514461447144814491450145114521 unmodified line1454145514561457145814591460146114621463146414651466146714681469147014711472147314741 unmodified line14761477147814791480148114821483148414851486148714881489149025 unmodified lines15161517151815191520152115221523152415251526152715 unmodified lines15431544154515461547154815495 unmodified lines155515561557155815591560156115621563156415651566156718 unmodified lines15861587158815891590159115921593159415951596159715981599160064 unmodified lines1665166616671668166916701671167216731674167563 unmodified lines17391740174117421743174417456 unmodified lines17521753175417551756175717581759176017611762176317641765176648 unmodified lines1815181618171818181918201821182234 unmodified lines185718581859186018611862186317 unmodified lines18811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191013 unmodified lines192419251926192719281929193020 unmodified lines19511952195319541955195633 unmodified lines199019911992199319941995199619971998199920002001200258 unmodified lines206120622063206420652066206727 unmodified lines209520962097209820992100210121022103210421052106210721082109211021112112211321145 unmodified lines212021212122212321242125212614 unmodified lines21412142214321442145214621472148214921502151215282 unmodified lines22352236223722382239224022412242224322442245224697 unmodified lines234423452346234723482349235077 unmodified lines24282429243024312432243324342435243624377 unmodified lines24452446244724482449245024513 unmodified lines// charts) and Get the data (the one command and the selection file). The dataset card is the overview; this page is// where data is picked and taken.// Figures first, few words; every chart keeps a short label and a table view. The charts of Pick, its filter counts and// the list of selected sources come from one crossfilter selection (linked.js). An index commit of one kind of source// (data.js oneKind: its catalog has no column kind, or its labels are labels by method) shows every source in one list,// counted in units and rows, and takes task material by label (--leaf, --method). On an older commit the two layers// stay apart everywhere and are never added together (#1083): material sets, grouped into collections and counted in// sets and units, in the main color; corpora, counted in rows, in gray. Pick then shows one layer at a time (F.kind,// material sets by default; a training stage takes the layer it counts).import {CORPUS, DATASET_URL, FACET_FORMAL, FACET_IDS, fileUrl, KINDS, LABEL_METHODS, loadBatchDates, loadIndex, MATERIAL_SET, num,readColumns, REPO, SOURCE, summed, topOf, wholeFile,} from './data.js';import {clear, el, figureWithToggle, fmtAnd, fmtBytes, fmtCompact, fmtDate, fmtInt, fmtOr, fmtPct, fmtShare, fmtShort,segmented, table, tableShown, vt,} from './charts.js';import { decorate, drawRelease, drawStages, markFromIndex, sizeLine, sizeOf, sizeParts, stageColor, stageWhat } from './first.js';import { lang, onLanguage, setUpSwitch, t, tEn, translatePage } from './i18n.js';import { formIcon, icon } from './icons.js';1 unmodified lineconst ROW_COLUMNS = ['source', 'batch', 'uri', 'range_offset', 'range_length', 'member_path', 'size_bytes', 'sha256'];const FIRST_ROWS = 20;// the columns of a source's label files (labels/<source>/*.parquet) its detail reads, and how many of the first file's// rows (one per unit, leaf and method labelled; a file of meta/labels.json format /1 has no method)const LABEL_COLUMNS = ['unit_id', 'leaf', 'method', 'score', 'class'];const LABEL_ROWS = 200;const HEAT_FORMS = 8;const FORM_BARS = 10;// #1524: how many units Get the data takes from each source (--sample N; all: no --sample, #1891); #2629: when the// reader has not chosen (sample in the address), every unit of material sets, whose whole is small, and 3 of each// corpus, whose whole can be petabytes (DEFAULT_SAMPLE by the layer the command takes, sampleNow); of one kind, 3 of// each source, as any of them can be a whole upstreamconst SAMPLES = ['1', '3', '10', '30', 'all'];const DEFAULT_SAMPLE = { [MATERIAL_SET]: 'all', [CORPUS]: '3', [SOURCE]: '3' };const MAX_FILE = 20e6;const MAX_LISTED = 30;// the phone layout of style.css69 unmodified linesconst unitsText = (n, missing = 0) => (n == null ? t('n.unitsNotCounted') : plural('n.unit', n) + uncounted(missing));const unitsNum = (n) => (n == null ? t('n.notCounted') : fmtInt(n));const unitsOfSets = (S) => { const u = summed(S.map((s) => s.readyUnits)); return unitsText(u.sum, u.missing); };// an index commit of one kind of source (data.js oneKind), where every source is counted in units and rowsconst oneKind = () => !!IX?.oneKind;const notCountedOf = (S) => summed(S.filter((s) => s.isTask || oneKind()).map((s) => s.readyUnits)).missing;/** Of one kind, a source's units and rows in words. */const unitsRowsText = (s) => t('n.unitsFiles', { units: unitsText(s.units), files: plural('n.rowsCompact', s.rows) });/** #2066: a chart of plots.js, draw(); until the module is loaded a skeleton of class sk, and the reason in its place* when it could not be loaded (each figure's Table view has the same numbers). */function plotted(draw, sk = 'sk sk-block') {16 unmodified lines// across: the ids the filters keep in either layer (linked.js startAcross)const UI = { across: null, allForms: false, showAll: false, detail: new Map(), preview: new Set(), previewRows: new Map(), csv: null, tab: 'cmd', fitKeyOpen: false, ids: null, facets: {},tables: { dom: [], form: [], heat: [] }, charts: null };// kind: the layer the browse section shows (material_set, the default, or corpus; of one kind, SOURCE, never in the// address); metric: what the charts count (sets or units of material sets, corpora in rows; of one kind, sources, units// or rows); pick: the ids of the picked sources, joined by commas; ext:// the file types selected, joined by commas; sample: how many units Get the data takes from each source (SAMPLES);// stage (#2006): the id of a training stage of the stage table (the commit's stage figures); pii (#2422): the personal-data mark (none,// marked or unknown, piiMark); method: the label method the commands that take a leaf's units by label take (one of// LABEL_METHODS, '' for every one; with labels by method). The panel shows no control for collection, leaf, tier,// redist and status (#2422): from the address they still filter, each a chip that removes it// view (#2422, second round): the arrangement of the field (VIEWS), strata by default// subject, industry, occupation, business_process, resource_type, file_format: a code of that facet (FACET_IDS), which// keeps the sources of that code and of the codes under it in the facet's hierarchyconst KEYS = ['domain', 'leaf', 'form', 'collection', 'kind', 'train', 'redist', 'tier', 'size', 'status', 'q', 'ext', 'stage', 'pii', ...FACET_IDS,'metric', 'sort', 'dir', 'open', 'pick', 'sample', 'view', 'method'];// what the charts can count: sets (material sets, or of one kind sources), units and (of one kind) rowsconst METRICS = ['sets', 'units', 'rows'];function readUrl() {const p = new URLSearchParams(location.search);for (const k of KEYS) F[k] = p.get(k) || '';if (F.kind !== CORPUS) F.kind = MATERIAL_SET;if (!METRICS.includes(F.metric)) F.metric = 'sets';if (!F.sort) { F.sort = 'fit'; F.dir = 'desc'; }if (!SAMPLES.includes(F.sample)) F.sample = '';if (!VIEWS.includes(F.view)) F.view = VIEWS[0];if (!LABEL_METHODS.includes(F.method)) F.method = '';}function writeUrl() {const p = new URLSearchParams(location.search);for (const k of KEYS) {const v = F[k];const dflt = (k === 'kind' && (v === MATERIAL_SET || v === SOURCE)) || (k === 'metric' && v === 'sets') || (k === 'sort' && v === 'fit') || (k === 'dir' && v === 'desc')|| (k === 'view' && v === VIEWS[0]);if (v && !dflt) p.set(k, v); else p.delete(k);}55 unmodified lines}const domainKeysOf = (s) => (s.domainKind === 'codes' ? s.tops : [s.domainKind === 'multi' ? MULTI : NONE]);const formKeyOf = (s) => s.form ?? NONE;// ---- the facets (catalog/facets.yaml): a facet's name in the page's language, with its standard and version on hover// (meta/vocabulary.json facets), and a code's name: the code with the name its standard gives it where the code does// not already spell it, else (a standard whose names are withheld) its level and code, with the title another standard// gives it where the facet takes titles from oneconst facetName = (fid) => t(`facet.${fid}`);function facetTitle(fid) {const f = IX.vocab.facets.get(fid);return f ? `${f.standard}, ${f.version}` : '';}function facetCodeName(fid, code) {if (code === 'multi') return t('facet.multi');if (code === 'unclassified') return t('name.notClassified');const x = IX.vocab.facets.get(fid)?.codes.get(code);if (!x) return code;if (!x.name) return [x.level, code, x.title].filter(Boolean).join(' ');return code === x.name || code.endsWith(`/${x.name}`) ? code : `${code} ${x.name}`;}/** The line under a facet's filter, for a facet that links its codes' pages or takes its titles from another* standard: a link to the selected code's page at the standard's source, and the attribution of the titles, linked to* their source; hidden for the other facets. */function facetNote(label, fid) {const fac = IX?.vocab.facets.get(fid);let note = label.querySelector('.facet-note');if (!fac?.titles && !fac?.codePage) {if (note) note.hidden = true;return;}if (!note) label.append(note = el('span', { class: 'facet-note small muted' }));const code = F[fid];const page = fac.codePage && fac.codes.has(code)? el('a', { href: fac.codePage.replace('{code}', encodeURIComponent(code)), target: '_blank', rel: 'noopener' }, t('facet.codePage', { code })): null;const credit = fac.titles ? el('a', { href: fac.titles.source, target: '_blank', rel: 'noopener' }, fac.titles.attribution) : null;clear(note).append(...[page, credit].filter(Boolean).flatMap((a, i) => (i ? [' \u00b7 ', a] : [a])));note.hidden = false;}/** The codes of a facet the sources carry that are code or under it in the facet's hierarchy: the codes a filter by* code keeps the sources of, which a query names. */const facetCodesUnder = (fid, code) => [...new Set(IX.sources.filter((s) => s.facetKeys[fid]?.includes(code)).flatMap((s) => s.facets[fid].filter((c) => c === code || withUpOf(fid, c).includes(code))))].sort();function withUpOf(fid, code) {const out = [];const codes = IX.vocab.facets.get(fid)?.codes;for (let x = codes?.get(code)?.parent; x != null && !out.includes(x); x = codes.get(x)?.parent) out.push(x);return out;}// #2422: a source's personal-data mark, a label the page filters on and counts and never leaves a source out of a count// for: its catalog pii.level present or suspected (marked), none_known (none), else not judged yet (unknown)const PII_MARKED = ['present', 'suspected'];68 unmodified lines// answer (the ids of the selected sources) is what every part below the filters showsconst sizeBucket = (b) => (b == null ? 'unknown' : b < 1e9 ? 'lt1g' : b < 1e12 ? '1g1t' : 'ge1t');/** One row of the page's DuckDB table src (linked.js): what the filters and the charts read of a source; n_units are* the units of a material set, of one kind of every source (#2065: null, which SQL's sum leaves out, while not counted* yet) and n_rows the rows of a corpus, of one kind of every source (0 for the other kind of two layers); kind is its* layer (of one kind SOURCE); collection is that of a material* set or (#1633) of a corpus a collection lists, '' otherwise; exts its file types and ext_rows the rows of each* (data.js exts); #2006: stages the ids of the training stages one of its units passes (data.js stages); #2422: sizeb* the size class of its deduplicated size, the one size the page shows, and pii its personal-data mark (piiMark). */5 unmodified lines// #2066: the search reads the title and description in both languagesqtext: [s.title, s.description, IX.zh.get(s.title), IX.zh.get(s.description), s.id].filter(Boolean).join('\n').toLowerCase(),exts: s.exts.map(([e]) => e), ext_rows: s.exts.map(([, n]) => n), stages: s.stages,// its codes on each facet with the codes above them (data.js facetKeys), [] for a catalog without the facet...Object.fromEntries(FACET_IDS.map((f) => [`fc_${f}`, s.facetKeys[f] || []])),};}const selected = () => (UI.ids ? IX.sources.filter((s) => UI.ids.has(s.id)) : []);const FILTER_KEYS = ['domain', 'leaf', 'form', 'collection', 'train', 'redist', 'tier', 'size', 'status', 'q', 'ext', 'stage', 'pii', ...FACET_IDS];// the clauses of the selection: the filters and the layer shown (kind: one of the two layers, or of one kind SOURCE)const SEL_KEYS = [...FILTER_KEYS, 'kind'];const activeFilters = () => FILTER_KEYS.filter((k) => F[k]);/** The filters that are on, as [label, value, key] in the page's language. */2 unmodified linesconst word = (key) => t(key, { defaultValue: '' });if (F.domain) out.push([t('chip.domain'), F.leaf ? domainName(F.leaf) : domainName(F.domain), 'domain']);if (F.form) out.push([t('chip.form'), formName(F.form), 'form']);for (const f of FACET_IDS) if (F[f]) out.push([facetName(f), facetCodeName(f, F[f]), f]);if (F.collection) out.push([t('chip.collection'), collectionName(F.collection), 'collection']);if (F.stage) out.push([t('chip.stage'), stageName(F.stage), 'stage']);if (F.train) out.push([t('chip.training'), word(`filter.permit.${F.train}`), 'train']);8 unmodified lines}/** #1524: the file types selected (F.ext), in the order of the address. */const extList = () => (F.ext ? F.ext.split(',').filter(Boolean) : []);/** What the charts count: of one kind, sources (sets), units or rows (F.metric); else in the layer shown, material sets* in sets or units (F.metric), corpora in rows. */const metricNow = () => (oneKind() ? F.metric : F.kind === CORPUS ? 'rows' : F.metric === 'rows' ? 'sets' : F.metric);function metricOf(s, m = metricNow()) { return m === 'sets' ? 1 : m === 'units' ? s.readyUnits : s.rawRows; }const metricFmt = () => (v) => fmtInt(v);// of one kind, sets counts sources and rows the rows of every source (metric.sources, metric.allRows)const metricWord = (m) => t(oneKind() && m === 'sets' ? 'metric.sources' : oneKind() && m === 'rows' ? 'metric.allRows' : `metric.${m}`);/** #2422: the layer a training stage counts: that of the sources one of whose units passes it (a stage's condition names* one kind), else by its measures (a stage counted in units counts material sets); of one kind, the one kind. */function stageKind(id) {if (oneKind()) return SOURCE;const s = IX.sources.find((x) => x.stages.includes(id));if (s) return s.kind;return IX.stageList.find((x) => x.id === id)?.counted_by?.includes('units') ? MATERIAL_SET : CORPUS;32 unmodified lines// script reads the main branch as it is when it starts)const fetchUrl = () => fileUrl(IX.pin, 'tools/fetch.py');/** #2629: the layer a command takes: the picked sources' while there are picks (corpora when one of them is a corpus),* else the layer shown; of one kind, the one kind. */function takenKind() {if (oneKind()) return SOURCE;const picks = IX ? picked() : [];return picks.length ? (picks.some((s) => !s.isTask) ? CORPUS : MATERIAL_SET) : F.kind;}3 unmodified lines* which turns the default profile's other criteria off: "all" is a choice of how many units, and the profile stays on. */const sampleArgs = (v = sampleNow()) => (v === 'all' ? [] : [`--sample ${v}`]);/** The options of a command, one string each; exts: one --ext per file type (#1524); sample: the units choice it takes* (#2629: the one in force unless given); kind: --kind, only on a commit of two layers (on a commit of one kind the* page takes task material by label, and fetch.py keeps --kind only for a passage); leaf: the leaf whose labelled units it takes (--leaf; on a commit of two layers with kind corpus);* methods: the label methods it takes them by (--method each, with labels by method). */function commandArgs({ domain, form, sources, tags, kind, exts, sample, leaf, methods } = {}) {const a = [`--revision ${IX.pin}`];if (kind) a.push(`--kind ${kind}`);if (sources) for (const s of sources) a.push(`--source ${s}`);1 unmodified lineif (domain) a.push(`--domain ${domain}`);if (form) a.push(`--form ${form}`);if (leaf) a.push(`--leaf ${leaf}`);if (methods) for (const m of methods) a.push(`--method ${m}`);if (exts) for (const e of exts) a.push(`--ext ${e}`);a.push(...sampleArgs(sample), '--out ./data');return a;}/** The options that take the units labelled for leaf, of the sources given or of every source: --leaf, and with labels* by method the method the page names (F.method, --method), on a commit of two layers --kind corpus. */const leafArgs = (leaf, sources) => commandArgs({ leaf, sources, kind: oneKind() ? null : CORPUS,methods: IX.labelsByMethod && F.method ? [F.method] : null, sample: F.sample || DEFAULT_SAMPLE[oneKind() ? SOURCE : CORPUS] });// #1216: one option per line, continuation lines indented four spaces and every line but the last ending in " \", so// the text shown is the text copied and runs as it isconst command = (args) => [`uv run ${fetchUrl()}`, ...args].join(' \\\n ');/** The options that take exactly S within domain and form: of one kind, the sources of the selection; else sources of* one layer (#1083: one command per layer).* whole: S is every source (of its layer) within domain and form, taken by fetch.py's --domain and --form (of two layers* with its --kind, #1216). Otherwise, of two layers, material sets are taken through the campaign tags of their* collections (--tag campaign:<name>, any of them; a collection's material sets carry the campaign of the collection or* of one of its earlier names, vocabulary collections[].campaigns), within --domain and --form; corpora, material sets* without a collection and every source of one kind, one --source each. exts: the file types selected, one --ext each* (#1524). */function layerArgs(S, { domain, form, whole = false, exts } = {}) {if (whole) return { args: commandArgs({ kind: oneKind() ? null : S[0]?.isTask ? MATERIAL_SET : CORPUS, domain, form, exts }), listed: false };const colls = new Set(S.map((s) => s.collection));if (oneKind() || !S[0]?.isTask || colls.has(null)) return { args: commandArgs({ sources: S.map((s) => s.id), exts }), listed: true };const tags = IX.vocab.collections.filter((c) => colls.has(c.code)).flatMap((c) => c.campaigns);return { args: commandArgs({ tags, domain, form, exts }), listed: false };}/** The options that select exactly the page's selection (of two layers, one layer). fetch.py's --domain matches a* top-level code with its leaves, a leaf only itself, and multi and unclassified only themselves, as the page's domain* filter does; --form matches one form id. So the options within domain and form when only those filters and the* collection are set (and the form is a classified one; without a collection every source there, of two layers the* whole layer with --kind), else one --source per selected source. #1524: the file types selected narrow the rows of* either, one --ext each (fetch.py keeps the rows of any of them, so a source without such rows gives none). */function selectionArgs(sel) {const exts = extList();const other = activeFilters().some((k) => !['domain', 'leaf', 'form', 'collection', 'ext'].includes(k)) || F.form === NONE;30 unmodified lines// button that opened it. A commit whose vocabulary has no term table shows no such line. #2614: the start of the// manual has the same line ([data-terms]), drawn again with the manual's text (showView).const TERMS = ['material set', 'corpus', 'unit', 'domain'];// of one kind: the words of one kind of source and its labels, those the term table hasconst TERMS_ONE = ['source', 'unit', 'row', 'label', 'domain'];function renderTerms() {const terms = IX?.vocab.terms;const have = (oneKind() ? TERMS_ONE : TERMS).filter((k) => terms?.get(k)?.about);for (const line of document.querySelectorAll('#terms, .manual-text [data-terms]')) {line.hidden = !have.length;if (!have.length) continue;24 unmodified linesfunction renderStageFig() {if (!IX) return;const why = IX.stages ? [] : [stageWhy()];drawStages(stageFigList(), { pick: F.stage, onPick: IX.stages ? pickStage : null, onPoint: (g) => FIELD?.front(g), why });}/** A stage's band: the filter by stage set to it (with its layer), or cleared when it holds it already; the field and* the panels of the screen show the result. */16 unmodified linescase 'size': return words('filter.size', ['lt1g', '1g1t', 'ge1t', 'unknown']);case 'train': return words('filter.permit', ['yes', 'cond']);case 'pii': return words('filter.pii', ['none', 'marked', 'unknown']);default: return FACET_IDS.includes(key) ? facetOptions(key) : [];}}/** A facet's options: its codes in its standard's hierarchy (meta/vocabulary.json facets; data.js facetsOf), each* indented by its depth, then multi and unclassified; without the facet in the vocabulary, the codes the sources carry,* in order. fillSelect leaves out a code that keeps no source, so the list is the part of the hierarchy the selection* has. */function facetOptions(fid) {const fac = IX.vocab.facets.get(fid);const tree = fac ? fac.tree : [...new Set(IX.sources.flatMap((s) => s.facets[fid] || []))].filter((c) => !FACET_FORMAL.includes(c)).sort().map((c) => [c, 0]);return [...tree, ...FACET_FORMAL.map((c) => [c, 0])].map(([c, depth]) => [c, '\u2002\u2002'.repeat(depth) + facetCodeName(fid, c)]);}// #2422: the filters of the panel, each a select (the file types are checkboxes, fillExt), in the panel's order; a// facet's select is shown while the catalog has the facet's columnconst SELECTS = { stage: 'f-stage', domain: 'f-domain', form: 'f-form', ...Object.fromEntries(FACET_IDS.map((f) => [f, `f-${f}`])),size: 'f-size', train: 'f-train', pii: 'f-pii' };const ANY = new Set(['size', 'train', 'pii']);function fillSelect(key) {if (key === 'ext') { fillExt(); return; }5 unmodified linesclear(s).append(option('', text(t(ANY.has(key) ? 'filter.any' : 'filter.all'), key === 'stage' ? null : f?.total)),...opts.map(([v, name]) => option(v, text(name, f ? f.m.get(v) || 0 : null))));s.value = F[key] || '';if (FACET_IDS.includes(key)) {// the facet's name in the page's language, its standard and version on hover, and its note (facetNote)const label = s.closest('label');label.hidden = !IX.facetIds.includes(key);label.querySelector('span').textContent = facetName(key);label.title = facetTitle(key);facetNote(label, key);}if (key === 'stage') {// #2006: the selected stage's condition (#2066: in Chinese its text in the table of Chinese names, once the release// has it) and the version of the stage table on hover; without stages of the commit the page reads, the filter is28 unmodified lines// #2422: the fold's summary says how many types are checked$('ext-on').textContent = on.length ? t('filter.on', { count: on.length, n: fmtInt(on.length) }) : '';}const fillFilterOptions = () => { Object.keys(SELECTS).forEach(fillSelect); fillExt(); $('facet-title').hidden = !IX.facetIds.length; };function fillFilterRow() {fillFilterOptions();for (const [key, id] of Object.entries(SELECTS)) {16 unmodified lines* the selection. */function syncFilterRow() {for (const [key, id] of Object.entries(SELECTS)) if ($(id).value !== F[key]) $(id).value = F[key];for (const f of FACET_IDS) facetNote($(SELECTS[f]).closest('label'), f);fillExt();if (document.activeElement !== $('f-q')) $('f-q').value = F.q;if (F.ext) $('ext-fold').open = true;const n = activeFilters().length;$('f-clear').disabled = !n;const count = UI.ids ? plural(layerCount(), UI.ids.size) : '';$('filter-state').textContent = n ? [t('filter.on', { count: n, n: fmtInt(n) }), count].filter(Boolean).join(' · ') : t('filter.noneOn');$('f-count').textContent = count;}112 unmodified linesonclick: () => { UI.allForms = !UI.allForms; drawCharts(); } }, UI.allForms ? t('common.fewer') : t('common.all', { n: fmtInt(forms.length) })): null;figureWithToggle($(FIGS[k]), k, title, {// the layer the chart draws, in its color, above the chart (none of one kind); the table holds that layer's// columns only, of one kind the sources, their units and their rowschart: () => el('div', {}, oneKind() ? null : kindKey([F.kind]), el('div', { class: 'plot-wrap' }, UI.charts[k])),table: () => (oneKind()? table([...keyHeads, { label: t('th.sources'), r: true }, { label: t('th.readyUnits'), r: true }, { label: t('th.rows'), r: true }],UI.tables[k].map((r) => [...keyCells(r), fmtInt(num(r.n)), fmtInt(num(r.units)), fmtInt(num(r.rows))])): F.kind === CORPUS? table([...keyHeads, { label: t('th.corpora'), r: true }, { label: t('th.corpusRows'), r: true }],UI.tables[k].map((r) => [...keyCells(r), fmtInt(num(r.n)), fmtInt(num(r.rows))])): table([...keyHeads, { label: t('th.materialSets'), r: true }, { label: t('th.readyUnits'), r: true }],1 unmodified linesql: () => consoleSql(k),}, more);}// ---- the leaves of the domain grid with the fewest units, the fewest first, the grid's order among equals, the first// FEWEST_LEAVES of them: with labels by method, by the units labelled for the leaf by any method (leaves of the commit's// meta/labels.json: units), every leaf of projections.leaves of the commit's meta/coverage.json counted; else, in the// order the funnel took them (03_data_line/v2/funnel_propose.py pick), by the units of the material sets whose domain// holds the leaf (projections.leaves, index_projection.leaf_coverage)const FEWEST_LEAVES = 5;const leafOrder = (code) => String(code).replace(/^D/, '').split('.').map(Number);function byGrid(a, b) {3 unmodified lines}function fewestLeaves() {const byLeaf = IX?.coverage?.projections?.leaves?.by_leaf || {};const lab = IX?.labelsByMethod ? IX.labels.leaves || {} : null;const rows = lab? [...new Set([...Object.keys(byLeaf), ...Object.keys(lab)])].map((leaf) => ({ ...byLeaf[leaf], leaf,domain: byLeaf[leaf]?.domain || leaf.split('.')[0], units: num(lab[leaf]?.units) || 0 })): Object.entries(byLeaf).map(([leaf, v]) => ({ ...v, leaf, units: num(v.units) || 0 }));return rows.sort((a, b) => a.units - b.units || byGrid(a.leaf, b.leaf)).slice(0, FEWEST_LEAVES);}/** A leaf's name in the page's language: the vocabulary's, else the one projections.leaves gives. */function leafName(r) {4 unmodified linesconst rows = fewestLeaves();$('fewest').hidden = !rows.length;if (!rows.length) return;$('fewest-text').textContent = t(IX.labelsByMethod ? 'fewest.text' : 'fewest.textSets');clear($('fewest-body')).append(IX.labelsByMethod? table([t('th.leaf'), t('th.domain'), { label: t('th.readyUnits'), r: true }],rows.map((r) => [leafName(r), domainName(r.domain), fmtInt(r.units)])): table([t('th.leaf'), t('th.domain'), { label: t('th.materialSets'), r: true }, { label: t('th.readyUnits'), r: true }],rows.map((r) => [leafName(r), domainName(r.domain), fmtInt(num(r.material_sets) || 0), fmtInt(r.units)])));}// ---- every leaf's units, in the grid's order. With labels by method (meta/labels.json format /3): each leaf of its// leaves (and of projections.leaves of the commit's meta/coverage.json) with its units labelled by any method (units),// those of each method (by_method: agent, classifier), the classifier's threshold (null for a leaf without one) and its// units by class (by_class), the classes with the most units first; a row with units of the method the page names// (F.method, every method when none) has the command that takes them, of every source (--leaf, and --method for the// method named). Else by method as format /1 has them: agent, the units of the material sets whose domain holds the// leaf, each chosen by an agent (projections.leaves, as above), and classifier, the corpus units a classifier scored// at or above the leaf's threshold (leaves of meta/labels.json: units, threshold), then the classifier's units by// class; a row with classifier units has the command that takes them from the corpora (--kind corpus --leaf)function leafRows() {const byLeaf = IX?.coverage?.projections?.leaves?.by_leaf || {};const lab = IX?.labels?.leaves || {};return [...new Set([...Object.keys(byLeaf), ...Object.keys(lab)])].sort(byGrid).map((leaf) => {const c = byLeaf[leaf] || {};const l = lab[leaf] || {};const base = { ...c, leaf, domain: c.domain || leaf.split('.')[0], threshold: l.threshold ?? null, byClass: l.by_class || {} };if (IX.labelsByMethod) {return { ...base, units: num(l.units) || 0,byMethod: Object.fromEntries(LABEL_METHODS.map((m) => [m, num(l.by_method?.[m]) || 0])) };}return { ...base, agent: num(c.units) || 0, classifier: l.units == null ? null : num(l.units) };});}/** The label method the commands that take a leaf's units take (F.method, kept in the address; '' every method): the* leaves' commands and those of the sources' details follow it. */function chooseMethod(v) {F.method = v;writeUrl();vt(() => { renderLeaves(); renderSources(selected()); });}function renderLeaves() {const rows = leafRows();$('leaves').hidden = !rows.length;if (!rows.length) return;const byMethod = IX.labelsByMethod;$('leaves-text').textContent = t(byMethod ? 'leaves.text' : 'leaves.textClassifier');const totals = new Map();for (const r of rows) for (const [k, v] of Object.entries(r.byClass)) totals.set(k, (totals.get(k) || 0) + (num(v) || 0));const classes = [...totals].sort((a, b) => b[1] - a[1]).map(([k]) => k);const none = IX.labels ? fmtInt(0) : '\u2014';const classCells = (r) => classes.map((k) => (r.byClass[k] == null ? none : fmtInt(num(r.byClass[k]))));const bar = (r) => (r.threshold == null ? '' : String(r.threshold));const head = el('p', { class: 'small' }, IX.labels ? t('leaves.model', { model: IX.labels.model ?? t('common.unknown') }) : t('leaves.noLabels'));if (byMethod) {// a row's command while the leaf has units of the method named (of any method when none is)const take = (r) => ((F.method ? r.byMethod[F.method] : r.units) ? copyButton(t('copy.button'), command(leafArgs(r.leaf))) : '');const methods = segmented(t('leaves.method'), [['', t('leaves.methodAll')], ...LABEL_METHODS.map((m) => [m, t(`method.${m}`)])], F.method, chooseMethod);clear($('leaves-body')).append(head, methods, el('div', { class: 'table-wrap' }, table([t('th.leaf'), t('th.domain'), { label: t('th.readyUnits'), r: true }, ...LABEL_METHODS.map((m) => ({ label: t(`method.${m}`), r: true })),...classes.map((k) => ({ label: sentence(k), r: true })), { label: t('th.threshold'), r: true }, t('th.command')],rows.map((r) => [leafName(r), domainName(r.domain), fmtInt(r.units), ...LABEL_METHODS.map((m) => fmtInt(r.byMethod[m])),...classCells(r), bar(r), take(r)]))));return;}const take = (r) => (r.classifier ? copyButton(t('copy.button'), command(leafArgs(r.leaf))) : '');clear($('leaves-body')).append(head,el('div', { class: 'table-wrap' }, table([t('th.leaf'), t('th.domain'), { label: t('th.agent'), r: true }, { label: t('th.classifier'), r: true },...classes.map((k) => ({ label: sentence(k), r: true })), { label: t('th.threshold'), r: true }, t('th.command')],rows.map((r) => [leafName(r), domainName(r.domain), fmtInt(r.agent), r.classifier == null ? none : fmtInt(r.classifier),...classCells(r), bar(r), take(r)]))));}// ---- every source of the commit by its kind of source and by the class of its form (projections.source_kinds and// projections.classes of the commit's meta/coverage.json, index_projection.kind_coverage), each in its table's order:// its sources, its material sets with their units and its corpora with theirs; a commit whose projection gives none// says so in one linefunction kindTable(by, head) {return el('div', { class: 'table-wrap' }, table([head, { label: t('th.sources'), r: true }, { label: t('th.materialSets'), r: true }, { label: t('th.readyUnits'), r: true },{ label: t('th.corpora'), r: true }, { label: t('th.corpusUnits'), r: true }],Object.entries(by).map(([k, v]) => [(inChinese() && v.zh) || sentence(k), fmtInt(num(v.sources) || 0),fmtInt(num(v.material_sets) || 0), fmtInt(num(v.units) || 0), fmtInt(num(v.corpora) || 0),fmtInt(num(v.corpus_units) || 0)])));}function renderKinds() {const proj = IX?.coverage?.projections || {};const kinds = proj.source_kinds?.by_kind;const classes = proj.classes?.by_class;$('kinds').hidden = !IX;if (!IX) return;clear($('kinds-body')).append(...(kinds && classes? [kindTable(kinds, t('th.kind')), kindTable(classes, t('th.class'))]: [el('p', { class: 'small' }, t('kinds.none'))]));}/** The heading of the map: what the selection holds, by the map's count, and the domains it covers. Of one kind the* layer switch is hidden and the count offers rows too. */function renderMapHead(sel) {const m = metricNow();const one = oneKind();$('layer-seg').hidden = one;for (const b of $('layer-seg').querySelectorAll('button')) b.setAttribute('aria-pressed', String(b.dataset.kind === F.kind));for (const b of $('metric-seg').querySelectorAll('button')) {b.setAttribute('aria-pressed', String(b.dataset.metric === m));b.hidden = b.dataset.metric === 'rows' && !one;b.textContent = metricWord(b.dataset.metric);}$('metric-wrap').hidden = !one && F.kind === CORPUS;if (!UI.ids) return;const total = sum(sel, (s) => metricOf(s, m));const covered = new Set(sel.flatMap((s) => s.tops)).size;const amount = m === 'sets' ? plural(layerCount(), total): m === 'units' ? t('map.units', { count: total, n: fmtCompact(total) }) + uncounted(notCountedOf(sel)): t(one ? 'map.allRows' : 'map.rows', { count: total, n: fmtCompact(total) });$('map-h').textContent = !sel.length ? t('map.nothing') : covered ? t('map.head', { amount, domains: plural('n.domain', covered) }) : amount;}// ---- the queries behind the tables, for the dataset's SQL Console: over the catalog of the commit the page reads,// filtered by the filters that filter that table (linked.js filtersOf), written over the catalog's own columns; the// domain keys are those of data.js, in the catalog's words (unclassified, multi). Of one kind, a query counts every// source, its units (column units) and its rows (column files), and filters on no kind. Of two layers, a query counts// the layer shown only, in its own measure: material sets and their units, or corpora and their rows, the layer read// from the column kind, or the rule it is written by when the commit's catalog has none. The licence filters read// meta/sources.json, which is no table, so they name their sources by id (or the ids they leave out, whichever list is// shorter).const READY_SQL = 'coalesce(units < files, false)';const kindSql = () => (IX.hasKind ? 'kind' : `CASE WHEN ${READY_SQL} THEN '${MATERIAL_SET}' ELSE '${CORPUS}' END`);const DOMAIN_KEYS_SQL = "CASE WHEN domain IS NULL OR len(domain) = 0 OR list_contains(domain, 'unclassified') THEN ['unclassified'] "+ "WHEN list_contains(domain, 'multi') THEN ['multi'] ELSE list_distinct([split_part(code, '.', 1) FOR code IN domain]) END";const FORM_SQL = "coalesce(nullif(form, ''), 'unclassified')";const sumsSql = () => (oneKind() ? 'count(*) AS sources, sum(units) AS units, sum(files) AS rows': F.kind === CORPUS ? 'count(*) AS corpora, sum(files) AS corpus_rows' : 'count(*) AS material_sets, sum(units) AS units');// #2422: the size classes of the deduplicated size, the one size the page shows (catalog column distinct_bytes)const SIZE_SQL = { lt1g: 'distinct_bytes > 0 AND distinct_bytes < 1e9', '1g1t': 'distinct_bytes >= 1e9 AND distinct_bytes < 1e12',ge1t: 'distinct_bytes >= 1e12', unknown: 'coalesce(distinct_bytes, 0) <= 0' };30 unmodified lines// #2006: a source's stages are computed from the stage table (the commit's stage figures), no column of the catalog, so the// sources are named by idstage: (v) => idsSql(new Set(IX.sources.filter((s) => s.stages.includes(v)).map((s) => s.id))),// a facet's catalog column, by the codes the sources carry at or under the code chosen...Object.fromEntries(FACET_IDS.map((f) => [f, (v) => `list_has_any(${f}, [${facetCodesUnder(f, v).map(sqlStr).join(', ')}]::VARCHAR[])`])),};const parts = keys.filter((k) => F[k] && !(k === 'kind' && oneKind())).map((k) => `(${sqlOf[k](F[k])})`);return parts.length ? `WHERE ${parts.join('\n AND ')}` : '';}25 unmodified linescase 'title': return titleOf(s).toLowerCase();case 'domain': return sourceDomainText(s).toLowerCase();case 'form': return formName(formKeyOf(s)).toLowerCase();// units of material sets above rows of corpora (never compared as one count): a corpus has fewer than 1e12 rows; of// one kind, every source by its units (one not counted yet last)case 'units': return oneKind() ? s.units ?? -1 : s.isTask ? 1e12 + s.readyUnits : s.rawRows;case 'size': return s.distinct ?? -1;case 'tier': return tierName(s.tier).toLowerCase();case 'fit': return fitScore(s);12 unmodified lines// #364, #1158: the same words as docs/sources.md of the index (artpool/projection_templates/text.json, size_text), in// the locale files as size.*/** The size note under the list: the size of the layer shown (meta/size_figures.json, IX.sizes; #2422: its deduplicated* size; of one kind, that of the whole index), with the estimate for its rows without a recorded size. */function sizeNote() {const g = IX.sizes?.[F.kind];if (!g) return t('size.none');13 unmodified linesconst i = IX.vocab.collections.findIndex((c) => c.code === s.collection);return i < 0 ? IX.vocab.collections.length : i;}/** The list of the selection: of one kind every source in one list, grouped by collection when a collection lists some* of them, each with its units and its rows; of two layers one layer: material sets grouped by collection (a header row* per collection, in the vocabulary's order), corpora as one list, or (#1633) grouped the same way when a collection* lists some of them; the heading names the layer shown only. */function renderSources(sel) {if (!UI.ids) return;const dir = F.dir === 'asc' ? 1 : -1;const one = oneKind();const sets = !one && F.kind !== CORPUS;const grouped = sets || sel.some((s) => s.collection);const byColl = (a, b) => (grouped ? collectionRank(a) - collectionRank(b) : 0);const list = [...sel].sort((a, b) => {1 unmodified lineconst y = sortValue(b, F.sort);return byColl(a, b) || (x < y ? -1 : x > y ? 1 : 0) * dir || titleOf(a).localeCompare(titleOf(b));});$('sources-h').textContent = !sel.length ? t('sources.none') : one ? plural('n.source', sel.length): sets ? t('sources.headSets', { sets: plural('n.materialSet', sel.length) }) : t('sources.headCorpora', { corpora: plural('n.corpus', sel.length) });const body = clear($('sources-body'));if (!sel.length) return;18 unmodified linesel('button', { type: 'button', onclick: () => {const d = on ? (F.dir === 'asc' ? 'desc' : 'asc') : (c.r || c.key === 'fit' ? 'desc' : 'asc');F.sort = c.key; F.dir = d; writeUrl(); renderSources(selected());} }, t(c.key === 'units' && !sets && !one ? 'col.rows' : `col.${c.key}`), on ? (F.dir === 'asc' ? ' ↑' : ' ↓') : ''),c.key === 'fit' ? fitHeads() : null);}));const tbody = el('tbody');8 unmodified linestbody.append(el('tr', { class: 'group-row' }, el('th', { colspan: String(COLS.length), scope: 'colgroup' },sets && group ? el('button', { type: 'button', class: 'group-btn', 'aria-pressed': String(cur), title: t(cur ? 'coll.showing' : 'coll.open'),onclick: () => setFilter({ collection: cur ? '' : group }) }, cur ? icon('check', { size: 16 }) : null, name) : name,el('span', { class: 'small' }, plural(one ? 'n.source' : sets ? 'n.materialSet' : 'n.corpus', inColl.get(group))))));}const open = F.open === s.id;const toggle = () => openSource(open ? '' : s.id);16 unmodified linesel('td', { 'data-label': label(t('col.domain')), class: 'cat-cell' }, sourceDomainText(s)),oneForm(s) ? el('td', { class: 'form-cell form-same' }): el('td', { 'data-label': label(t('col.form')), class: 'form-cell' }, formIcon(formKeyOf(s), { size: 16 }), formName(formKeyOf(s))),// the count of a source: of one kind its units with its rows under them, of two layers a material set's units or a// corpus's rowsone ? el('td', { class: 'r num', 'data-label': label(t('sources.unitsLabel')) },s.units == null ? t('n.notCounted') : [fmtInt(s.units), el('span', { class: 'unit-word' }, t('sources.unitWord', { count: s.units }))],el('span', { class: 'size-sub' }, plural('n.rowsCompact', s.rows))): el('td', { class: 'r num', 'data-label': label(s.isTask ? t('sources.unitsLabel') : t('sources.rowsLabel')) }, s.isTask? (s.readyUnits == null ? t('n.notCounted') : [fmtInt(s.readyUnits), el('span', { class: 'unit-word' }, t('sources.unitWord', { count: s.readyUnits }))]): el('span', { class: 'muted' }, fmtCompact(s.rawRows), el('span', { class: 'unit-word' }, t('sources.corpusWord', { count: s.rawRows })))),el('td', { class: 'r num size-cell', 'data-label': label(t('col.size')), title: s.size ? sizeLine(s.size, false) : null }, sizeCell(s)),9 unmodified linesconst wide = !matchMedia(PHONE).matches;body.append(el('details', { class: 'list-key-fold', open: wide || UI.fitKeyOpen, ontoggle: (e) => { if (!wide) UI.fitKeyOpen = e.currentTarget.open; } },el('summary', {}, t('sources.aboutFit')),el('div', { class: 'list-key' }, one ? null : kindKey([F.kind]), el('span', { class: 'small' }, t('sources.fitKey')), FIT.map((x) => el('span', { class: 'fit-name' }, icon(x.icon, { size: 14 }), fitLabel(x.k))), fitKey())));body.append(el('table', { class: 'src-table' }, el('caption', { class: 'visually-hidden' }, kindName(F.kind)), el('thead', {}, head), tbody));body.append(el('div', { class: 'small size-note' }, el('p', {}, sizeNote()), sizeHow()));if (list.length > FIRST_ROWS) {95 unmodified linesif (!site) return [];return publishers > 1 ? [`${t('detail.publishers', { count: publishers, n: fmtInt(publishers) })} `, site] : [site];}// a file the index stores (campaign_files/...) is a member of its source's campaign part where the catalog names one// (part), which the link downloads; else the file at its pathfunction upstream(uri, part) {if (!uri) return null;if (/^https?:\/\//.test(uri)) return uri;if (uri.startsWith('campaign_files/')) return fileUrl(IX.sha, part || uri);const s3 = uri.match(/^s3:\/\/([^/]+)\/(.*)$/);if (s3) return `https://${s3[1]}.s3.amazonaws.com/${s3[2]}`;return null;40 unmodified linesfunction item(iconName, label, ...value) {return el('div', { class: 'd-item' }, el('dt', {}, icon(iconName, { size: 18 }), label), el('dd', {}, ...value));}/** The labels of source s: the labels' model; with labels by method its units by method (meta/labels.json by_method)* and its units of each leaf by any method (sources), else its units at or above each leaf's threshold (sources), the* most first; the labels of its first units (got: the first rows of its first label file, 'loading' until read, {error}* when they could not be), one line per unit with each leaf's label: a classifier's score, in bold at or above that* leaf's threshold, or the method of a label without a score (agent), and its class; and the command that* takes its units of the leaf it holds the most of (leafArgs: by the method the page names). */function labelItem(s, got) {const leaves = IX.labels?.leaves || {};const held = Object.entries(s.labelled || {}).map(([leaf, n]) => [leaf, num(n) || 0]).sort((a, b) => b[1] - a[1]);const methods = LABEL_METHODS.filter((m) => num(s.byMethod?.[m]));const out = [el('span', { class: 'small' }, t('detail.labelModel', { model: IX.labels?.model ?? t('common.unknown') })),methods.length ? el('span', { class: 'chips' }, methods.map((m) => el('span', { class: 'chip' }, `${t(`method.${m}`)} ${fmtInt(num(s.byMethod[m]))}`))) : null,el('span', { class: 'chips' }, held.map(([leaf, n]) => el('span', { class: 'chip' }, `${leafName({ leaf })} ${fmtInt(n)}`)))];if (got === 'loading') out.push('\u2026');else if (got?.error) out.push(el('span', { class: 'problem-text' }, got.error));5 unmodified lines}const label = (r) => {const bar = leaves[r.leaf]?.threshold;const scored = r.score != null;const text = scored ? `${r.leaf} ${num(r.score).toFixed(2)}` : `${r.leaf} ${t(`method.${r.method}`, { defaultValue: String(r.method ?? '') })}`;return el('span', { class: 'chip', title: leafName({ leaf: r.leaf }) },scored && bar != null && num(r.score) >= num(bar) ? el('b', {}, text) : text, r.class ? ` \u00b7 ${r.class}` : '');};const shown = [...units].slice(0, FIRST_ROWS);out.push(el('div', { class: 'table-wrap sample' }, table([t('th.unit'), t('th.labels')],shown.map(([u, ls]) => [el('span', { class: 'mono', title: String(u) }, shortUri(String(u))),el('span', { class: 'chips' }, [...ls].sort((a, b) => (num(b.score) ?? Infinity) - (num(a.score) ?? Infinity)).map(label))]),t(IX.labelsByMethod ? 'detail.labelsFirstMethod' : 'detail.labelsFirst', { n: fmtInt(shown.length) }))));}if (held.length) {const cmd = command(leafArgs(held[0][0], [s.id]));out.push(el('span', { class: 'small' }, t('detail.takeLeaf', { leaf: leafName({ leaf: held[0][0] }) })),el('code', { class: 'cmd-inline' }, cmd), copyButton(t('copy.button'), cmd));}11 unmodified linesconst ownRows = (rows) => rows.filter((r) => r.source === s.id);if (!st.sample && s.files.length) {st.sample = 'loading';// the column extra (the row's source_meta: its upstream, its publishers) of a material set's rows, and of one kind of// any source's rows that have itconst cols = s.isTask || oneKind() ? [...ROW_COLUMNS, 'extra'] : ROW_COLUMNS;const unitFile = s.files[0];readColumns(fileUrl(IX.sha, unitFile.path), cols, rowsOf(unitFile, FIRST_ROWS)).then((r) => { st.sample = ownRows(r.rows); st.file = unitFile.path; redraw(); }, (e) => { st.sample = { error: e.message }; redraw(); });32 unmodified linesconst ups = upstreamsOfRows(metas);const names = publisherNames(metas);const allRead = rows.length >= s.rows;const counted = oneKind() ? unitsRowsText(s): s.isTask ? t('n.unitsFiles', { units: unitsText(s.readyUnits), files: plural('n.file', s.rows) }) : plural('n.corpusRow', s.rawRows);// #2066: in the page's language (descriptionOf); the sentence admission writes (ADMIT_WHAT) is recognized in Englishconst own = s.description && !ADMIT_WHAT.test(s.description) ? descriptionOf(s) : '';const text = own1 unmodified line: s.publishers ? t('detail.countsFrom', { what: counted, publishers: plural('n.publisher', s.publishers) }): t('detail.counts', { what: counted }));dl.append(item('doc', t('detail.what'), text.length > 160 ? el('details', {}, el('summary', {}, firstSentence(text)), el('p', {}, text)) : text));// 2 a material set's units and files, what each row of a corpus points to (#2065: a corpus is counted in rows); of one// kind, a source's units and rows, and what each row points to where its registration saysconst kindCount = (k) => {const n = num(s.info.unit[k]);return t(UNIT_KIND[k] ? `unitCount.${UNIT_KIND[k]}` : 'unitCount.code', { count: n, n: fmtCompact(n), kind: k });};const rowsPoint = () => [el('span', {}, sentence(fmtOr(s.kinds.map((k) => (UNIT_KIND[k] ? t(`unitKind.${UNIT_KIND[k]}`) : k))))),el('span', { class: 'chips' }, s.kinds.map((k) => el('span', { class: 'chip' }, kindCount(k))))];const unitWhat = oneKind()? [el('span', { class: 'chips' }, el('span', { class: 'chip' }, unitsText(s.units)), el('span', { class: 'chip' }, plural('n.rowsCompact', s.rows))),...(s.kinds.length ? rowsPoint() : [])]: s.isTask? [el('span', { class: 'chips' }, el('span', { class: 'chip' }, unitsText(s.readyUnits)), el('span', { class: 'chip' }, plural('n.file', s.rows)))]: rowsPoint();dl.append(item('rows', t(oneKind() ? 'detail.unitsRows' : s.isTask ? 'detail.files' : 'detail.oneUnit'), ...unitWhat));// 3 where it comes from (#1197: in words): the number of its publishers (#1256: the catalog's) and the main site of// its upstreams, else of the addresses of its rowsconst from = ups.length ? fromWords(ups, true, s.publishers) : fromWords(rows.map((r) => r.uri), false, s.publishers);1 unmodified line// #2588: the upstream it declares, one dataset or one catalog with its agent and entry address (each of them while// it still reads several)if (s.upstream) dl.append(item('pin', t('detail.upstream'), upstreamLines(s.upstream)));// #4406: its card, its section of its protocol's card file (catalog column card), on the Hub at the page's commitif (s.card) dl.append(item('doc', t('detail.card'), el('a', { href: `${DATASET_URL}/blob/${IX.sha}/${s.card}`, rel: 'noopener', class: 'mono' }, s.card)));// 4 self-contained; #1216: the fit chip's answer (fit.alone), with the files of the source a material set of a// collection comes with (a license and a readme leave a unit usable alone): its rows read without a unitconst comps = [...new Set(rows.filter((r, i) => !isUnit(metas[i])).map((r) => r.uri.split('/').pop()))];const compChips = () => el('span', { class: 'chips' }, (comps.length ? comps : ['LICENSE', 'README.md']).map((c) => el('span', { class: 'chip mono-chip' }, c)));const ofCollection = !!(info.campaign || info.extended_by);// of one kind, a source of a collection is answered as a material set isdl.append(item('layers', t('detail.alone'), s.isTask || (oneKind() && ofCollection)? (fit.alone !== 'yes' ? [el('span', {}, t('detail.withCompanions')), compChips()]: ofCollection ? [el('span', {}, t('detail.alsoWith')), compChips()] : t('detail.yes')): fit.alone === 'yes' ? t('detail.eachFile') : t('detail.container')));25 unmodified linesconst permit = (field) => PERMIT_ORDER.map((k) => {const names = behind(field, k);return { k, value: num(lr[field]?.[k]?.rows) || 0, color: PERMIT_COLOR[k], label: permitLabel(k, names),note: t(`detail.shareOf${oneKind() ? 'Source' : s.isTask ? 'Set' : 'Corpus'}${names.length ? '' : 'Only'}`, { licences: names.join(', ') }) };});// #1197: one line when every row allows both, the two bars when its rows differconst allAllowed = (field) => permit(field).every((x) => (x.k === 'yes' ? x.value > 0 : !x.value));// #1266: a material set's licence by kind of file, as the projection counted it (license_counts), and of one kind any// source's that has license_counts: per kind its// files, the permit classes for training and for redistribution as "x / y files" with the licences behind each, or// one phrase when all its files allow bothconst spdxOf = (xs) => [...new Set(xs.map((x) => x.spdx).filter(Boolean))].sort();15 unmodified linesreturn el('span', { class: 'lic-kind' }, head, classes('training_ok', t('detail.training')), classes('redistribution_ok', t('detail.shipping')));};dl.append(item('training', t('detail.licence'), el('span', { class: 'lic' }, el('b', {}, tierName(s.tier)), el('span', { class: 'small' }, lic.name || s.spdx || '')),(s.isTask || oneKind()) && s.licenceCounts ? el('span', { class: 'lic-kinds' }, FILE_KINDS.map(kindLine)): allAllowed('training_ok') && allAllowed('redistribution_ok') ? el('span', { class: 'small' }, t('detail.allAllowed')): el('span', { class: 'lic-bars' },el('span', { class: 'mini-title' }, t('detail.training')), shareBar(permit('training_ok'), s.rows),5 unmodified lines? el('span', { class: 'chips' }, s.stages.map((id) => el('span', { class: 'chip' }, stageName(id)))): t('detail.stagesNone'), el('span', { class: 'small' }, t('stage.version', { v: IX.stages.version }))));}// its labels, for a source whose units the commit labels (labelItem): one with label files, or with labels by method// one meta/labels.json counts units of by methodif (s.labelFiles.length || s.byMethod) dl.append(item('layers', t('detail.labels'), ...labelItem(s, st.labels)));// 7 size and unitsconst q = info.size_quantiles_upper_bytes || {};const amounts = oneKind() ? `${unitsText(s.units)} · ${plural('n.rowsCompact', s.rows)}`: s.isTask ? `${unitsText(s.readyUnits)} · ${plural('n.file', s.rows)}` : plural('n.corpusRow', s.rawRows);// #1158: the source's figures of meta/size_figures.json; #2422: its size first, the deduplicated onedl.append(item('size', t('detail.size'), el('span', { class: 'lic' }, el('b', {}, s.size ? sizeOf(s.size) : t('size.none')),el('span', { class: 'small' }, amounts), s.size ? el('span', { class: 'small size-parts' }, sizeParts(s.size, false).join(' \u00b7 ')) : null),18 unmodified linesif (pv === 'loading') dl.append(item('link', t('detail.example'), '…'));else if (pv.error) dl.append(item('link', t('detail.example'), el('span', { class: 'problem-text' }, pv.error)));else if (r) {const href = upstream(r.uri, s.campaignPart);const name = r.member_path || r.uri.split('/').pop() || r.uri;dl.append(item('link', t('detail.example'), el('span', { class: 'example' },href ? el('a', { href, rel: 'noopener', class: 'mono' }, name) : el('span', { class: 'mono' }, name),r.size_bytes != null ? el('span', { class: 'small' }, ` · ${fmtBytes(num(r.size_bytes))}`) : null)));}// 9 the command that takes this source: #2629: a material set whole, with its units and its size beside it; a corpus,// whose whole can be petabytes, and of one kind every source, by the units choice (the reader's, else 3 per source)const cmd = command(commandArgs({ sources: [s.id], sample: s.isTask ? 'all' : F.sample || DEFAULT_SAMPLE[oneKind() ? SOURCE : CORPUS] }));dl.append(item('run', t('detail.take'), el('code', { class: 'cmd-inline' }, cmd), copyButton(t('copy.button'), cmd),s.isTask ? el('span', { class: 'small' }, s.size ? t('detail.takeWhole', { units: unitsText(s.readyUnits), size: sizeOf(s.size) }): t('detail.takeWholeNoSize', { units: unitsText(s.readyUnits) })) : null));64 unmodified linesconst chips = filterChips();const exts = extList();const where = [`source IN (${ids})`, ...(exts.length ? [`ext IN (${exts.map(sqlStr).join(', ')})`] : [])];// the selection's sources in their measure: of one kind their units and rows, else one layer's in that layer'sconst head = oneKind()? t('sql.headSources', { sha: IX.sha.slice(0, 7), sources: plural('n.source', sel.length), units: unitsOfSets(sel),rows: plural('n.rowsCompact', sum(sel, (s) => s.rawRows)) }): F.kind === CORPUS? t('sql.headCorpora', { sha: IX.sha.slice(0, 7), corpora: plural('n.corpus', sel.length), rows: plural('n.corpusRow', sum(sel, (s) => s.rawRows)) }): t('sql.headSets', { sha: IX.sha.slice(0, 7), sets: plural('n.materialSet', sel.length), units: unitsOfSets(sel) });return [63 unmodified lines...(IX.vocab.profile.length ? [el('p', { class: 'chart-title profile-title' }, t('tree.leftOut')),el('ul', { class: 'profile' }, IX.vocab.profile.map(({ criterion, option }) => el('li', {}, el('span', {}, t(`profile.${criterion}`)), el('code', {}, option)))),el('p', { class: 'small tree-note' }, t('tree.flagNote'))] : []),el('p', { class: 'small tree-note' }, t('tree.labelNote'), ' ', el('code', {}, '--training-only'), ' ', el('code', {}, '--no-personal-data'), ' ', el('code', {}, '--no-refused')),el('p', { class: 'small agent-links' }, icon('robot', { size: 16 }),el('a', { href: t('url.forAgents') }, t('agents.readme')), ' · ', el('a', { href: 'llms.txt' }, 'llms.txt')));}6 unmodified lines// command beside it names too; tools/fetch.py --selection reads it, so the same file gives the same files later) and// the attribution file (per source its title, licence and attribution statement from meta/sources.json; #1577: and// its files by publisher, licence and licence URL from meta/attribution.parquet, each file's own, else its source's;// in English, the language of the dataset). Its filters record the page's filters, and of two layers the layer shown// (kind); of one kind no kind, which the catalog and fetch.py of such a commit do not haveconst selectionName = () => `training-data-foundation-selection-${IX.sha.slice(0, 7)}.json`;const ATTRIBUTION = 'meta/attribution.parquet';const ATTRIBUTION_COLUMNS = ['source', 'publisher', 'license', 'license_url', 'files'];function selectionFile(sel, picks) {return `${JSON.stringify({format: 'training-data-foundation-selection/1', dataset: REPO, revision: IX.pin,filters: picks ? {} : Object.fromEntries([...activeFilters(), ...(oneKind() ? [] : ['kind'])].map((k) => [k, F[k]])), sources: sel.map((s) => s.id).sort(),}, null, 1)}\n`;}async function attributionFile(sel) {48 unmodified linesel('p', { class: 'small' }, el('code', {}, selectionName()), ' ', t('keep.selectionNote', { sources: plural(picks ? 'n.picked' : layerCount(), sel.length), sha: IX.sha.slice(0, 7) }))),codeCard('run', t('keep.again'), selectionCommand(picks), 2));}/** The key of the count word of the layer shown: n.materialSet or n.corpus; of one kind n.source. */const layerCount = () => (oneKind() ? 'n.source' : F.kind === CORPUS ? 'n.corpus' : 'n.materialSet');function codeCard(iconName, title, code, n) {return el('div', { class: 'code-card' },el('div', { class: 'code-head' }, el('span', { class: 'code-ico' }, icon(iconName, { size: 20 })),34 unmodified linesfunction chooseSample(v) {F.sample = v === DEFAULT_SAMPLE[takenKind()] ? '' : v;writeUrl();vt(() => { renderGet(selected()); renderSources(selected()); renderLeaves(); });}function unitsChoice() {return el('div', { class: 'units-row' }, segmented(t('get.units'), SAMPLES.map((v) => [v, v === 'all' ? t('get.unitsAll') : v]), sampleNow(), chooseSample));17 unmodified linesbody.append(...commandSteps(commandArgs({ sources: picks.map((s) => s.id) }), picks));body.append(keepCard(picks, true));}/** Get the data: of one kind, one command takes the selection's sources; of two layers the selection is one layer, so* one command takes it (#1083), and the other layer is one switch away. Picked sources, when there are any, take its* place (renderPicks). */function renderGet(sel) {if (!UI.ids) return;const picks = picked();renderDock(sel, picks);if (picks.length) { renderPicks(picks); return; }const one = oneKind();const ready = sum(sel, (s) => s.readyUnits);const raw = sum(sel, (s) => s.rawRows);const other = F.kind === CORPUS ? MATERIAL_SET : CORPUS;$('get-h').textContent = !sel.length ? t('get.nothing') : takeHeading(sel.length === 1 ? null : plural(layerCount(), sel.length));const body = clear($('get-body'));const switchOther = one ? null : el('button', { type: 'button', class: 'link', onclick: () => setLayer(other) }, t('get.otherLayer', { name: kindName(other) }));if (!sel.length) { if (switchOther) body.append(el('p', { class: 'small' }, switchOther)); return; }const chips = filterChips();const tabs = segmented('', [['cmd', t('get.command')], ['sql', 'SQL'], ['csv', 'CSV']], UI.tab, (v) => { UI.tab = v; vt(() => renderGet(selected())); });const unitsLine = el('span', { class: 'fact-line' }, icon('check', { size: 18 }), el('b', {}, fmtInt(ready)), t('cat.lead.ready', { count: ready }) + uncounted(notCountedOf(sel)));const rowsLine = el('span', { class: 'fact-line muted' }, icon('rows', { size: 18 }), el('b', {}, fmtCompact(raw)), t(one ? 'cat.lead.rows' : 'cat.lead.raw', { count: raw }));const pickRow = el('div', { class: 'pick-row' },el('span', { class: 'fact-line' }, icon('sources', { size: 18 }), el('b', {}, fmtInt(sel.length)), t(one ? 'get.sourceWord' : F.kind === CORPUS ? 'get.corpusWord' : 'get.setWord', { count: sel.length })),...(one ? [unitsLine, rowsLine] : [F.kind === CORPUS ? rowsLine : unitsLine]),el('span', { class: 'chips' }, one ? null : el('span', { class: 'chip' }, kindName(F.kind)), ...chips.map(([k, v]) => el('span', { class: 'chip', title: k }, v))),el('a', { class: 'small', href: '#filters' }, t('get.change')), switchOther, tabs);body.append(pickRow);if (UI.tab === 'cmd') {13 unmodified linesconst say = (text) => { csvState.textContent = text; UI.csv = { key, text }; };try {const csv = await buildCsv(sel, (d, n) => say(t('csv.progress', { count: n, done: fmtInt(d), n: fmtInt(n) })));download(`${REPO.split('/')[1]}-${IX.sha.slice(0, 7)}-${sel.length === 1 ? sel[0].id : `${sel.length}-${oneKind() ? 'sources' : F.kind === CORPUS ? 'corpora' : 'material-sets'}`}.csv`, csv, 'text/csv');say(plural('n.pointerRow', csv.split('\n').length - 2));} catch (e) { say(e.message); }btn.disabled = false;20 unmodified lines/** The stage group of a source among the stages ids (the stage table's order): its first stage, else the last group,* in no stage. */const groupOf = (s, ids) => { const g = ids.findIndex((id) => s.stages.includes(id)); return g < 0 ? ids.length : g; };// the color of a source's dot in the list: the picked stage's while the source feeds it, else its first stage'sconst groupColor = (s, ids) => stageColor(F.stage && s.stages.includes(F.stage) ? F.stage : ids[groupOf(s, ids)]);/** The points of the field: one per source and stage it feeds (a corpus that feeds two stages stands on both planes33 unmodified linesreturn picked >= 0 && p.g !== picked ? HALF : 1;});}/** #1083: the field's last group, the sources none of whose units a stage counts, those of the layer shown (of one kind,* every source) and never two layers as one number: their number as its figure. Each stage's band says its units of* every status. */function restWhat() {const here = IX.sources.filter((s) => !s.stages.length && s.kind === F.kind).length;const word = oneKind() ? 'get.sourceWord' : F.kind !== CORPUS ? 'get.setWord' : 'get.corpusWord';return { num: fmtInt(here), word: t(word, { count: here }) };}/** The labels of the field in the page's language: per stage group its figure and name at its plane and its name at* its lane, the domains' names, and the marks of the size axis. */58 unmodified linesFIELD = await mod.createField(host, {points: fieldPts, colors: [...ids.map(stageColor), '--none'], cells: doms.length, view: F.view,room: fieldRoom,tip: (i) => { const s = at(i); return [titleOf(s), [sourceDomainText(s), oneKind() ? null : kindOne(s.kind), s.size ? sizeOf(s.size) : null].filter(Boolean).join(' · ')]; },onHover: (i) => { const id = i < 0 ? null : at(i).id; for (const b of $('sel-list').querySelectorAll('.src')) b.classList.toggle('hot', b.dataset.id === id); },onPick: (i) => focusSource(at(i)),onTouch: () => $('top').classList.add('touched'),27 unmodified lines};requestAnimationFrame(step);}/** The right panel: how many sources (of two layers, of the layer shown) the selection holds, with their units and rows* (of two layers, its layer's measure) and the domains they cover; its largest sources, each with its stage group's* dot, its domain, its units and its size (a bar on a logarithmic scale); and the light of the field's points. */function renderWork(sel) {if (!UI.ids) return;const one = oneKind();const sets = !one && F.kind !== CORPUS;countTo($('sel-n'), sel.length);$('sel-word').textContent = t(one ? 'get.sourceWord' : sets ? 'get.setWord' : 'get.corpusWord', { count: sel.length });const ready = sum(sel, (s) => s.readyUnits);const raw = sum(sel, (s) => s.rawRows);const covered = new Set(sel.flatMap((s) => s.tops)).size;const units = [fmtInt(ready), t('cat.lead.ready', { count: ready }) + uncounted(notCountedOf(sel))];const meta = [...(one ? [units, [fmtCompact(raw), t('cat.lead.rows', { count: raw })]] : [sets ? units : [fmtCompact(raw), t('cat.lead.raw', { count: raw })]]),[fmtInt(covered), t('strata.domains', { count: covered })]];clear($('sel-meta')).append(...meta.map(([n, word]) => el('span', {}, el('b', {}, n), ' ', word)));const ids = stageFigList().map((s) => s.id);5 unmodified linesonclick: () => focusSource(s), onpointerenter: () => FIELD?.hover(pointOf(s.id)), onpointerleave: () => FIELD?.hover(-1) },el('span', { class: 'dot', 'aria-hidden': 'true' }),el('span', { style: 'min-width: 0' }, el('span', { class: 't' }, titleOf(s)),el('span', { class: 's' }, [sourceDomainText(s), oneKind() ? unitsRowsText(s) : s.isTask ? unitsText(s.readyUnits) : plural('n.corpusRow', s.rawRows)].join(' · '))),el('span', { class: 'sz' }, s.size ? sizeOf(s.size) : ''),el('span', { class: 'barw', 'aria-hidden': 'true' }, el('u', { style: `width: ${Math.max(2, (lg(s) / most) * 100).toFixed(0)}%` }))))));if (!sel.length) list.append(el('li', {}, el('p', { class: 'src-none' }, t('sources.none'))));14 unmodified linesclear(box);if (!s) return;const stages = s.stages.length ? s.stages.map(stageName).join(t('size.listSep')) : t('strata.rest');// its domain, its layer (of two layers), its form, its units and rows (of one kind) or its layer's measure, its size,// its license and its stagesconst rows = [[t('col.domain'), sourceDomainText(s)], oneKind() ? null : [t('strata.layer'), kindOne(s.kind)], [t('col.form'), formName(formKeyOf(s))],...(oneKind() ? [[t('col.units'), unitsNum(s.units)], [t('col.rows'), fmtCompact(s.rows)]]: [s.isTask ? [t('col.units'), unitsNum(s.readyUnits)] : [t('col.rows'), fmtCompact(s.rawRows)]]),[t('col.size'), s.size ? sizeOf(s.size) : t('common.unknown')], [t('col.tier'), tierName(s.tier)], [t('filter.stage'), stages]].filter(Boolean);const isPicked = pickIds().includes(s.id);box.append(el('div', { class: 'card-s' },el('button', { type: 'button', class: 'x', 'aria-label': t('strata.close'), title: t('strata.close'), onclick: () => openSource('') }, '×'),82 unmodified linesmarkFromIndex();renderStageFig();renderTerms();drawRelease(IX.pin, IX.releaseDate, IX.countedOn);$('foot-pin').textContent = t('foot.index', { sha: IX.sha.slice(0, 7), date: fmtDate(IX.date) });if (IX.overrides.catalog || IX.overrides.vocabulary || IX.overrides.figures) {const chip = $('preview-chip');clear(chip).append(el('span', { class: 'dot other', 'aria-hidden': 'true' }), t('hero.preview'));chip.title = [IX.overrides.catalog, IX.overrides.vocabulary, IX.overrides.figures].filter(Boolean).join(' ');chip.hidden = false;}}97 unmodified linesrenderHeader();renderFewest();renderLeaves();renderKinds();fillFilterOptions();drawDockSample();FIELD?.setLabels(fieldLabels());77 unmodified lines// without stages every source is in one stage group, so the field starts by domain unless the address names an// arrangementif (!IX.stages && !new URLSearchParams(location.search).get('view')) F.view = 'domains';// of one kind every source is of the kind SOURCE, which the clause kind then keeps whole, and the field's legend has// no other layer; without labels by method the page takes no label methodif (IX.oneKind) { F.kind = SOURCE; $('legend-half').hidden = true; }if (!IX.labelsByMethod) F.method = '';if (F.stage && stageKind(F.stage) !== F.kind) {F.kind = stageKind(F.stage);if (F.kind === CORPUS) F.collection = '';7 unmodified linesrenderMapHead([]);renderFewest();renderLeaves();renderKinds();for (const b of $('layer-seg').querySelectorAll('button')) b.addEventListener('click', () => setLayer(b.dataset.kind));for (const b of $('metric-seg').querySelectorAll('button')) {b.addEventListener('click', () => { F.metric = b.dataset.metric; writeUrl(); drawCharts(); renderMapHead(selected()); });
2 unmodified lines3456782 unmodified lines1112131415161718192021222324252627287 unmodified lines36373839404142101 unmodified lines1441451461471481491506 unmodified lines15715815916016116216316416516616716816917017117217374 unmodified lines2482492502512522532542551 unmodified line25725825926026126210 unmodified lines27327427527627727827920 unmodified lines3003013023033043053063074 unmodified lines3123133143153163173183193203213223233243252 unmodified lines32832933033133233333433533633733833934038 unmodified lines3793803813823833848 unmodified lines3933943953963973983994004014024034044054064 unmodified lines4114124134144154164174184194204214223 unmodified lines4264274284294304314324334344354364374384394404414422 unmodified linesimport { compressors } from 'https://cdn.jsdelivr.net/npm/hyparquet-compressors@1.1.2/+esm';import { downloadFile, pathsInfo } from 'https://cdn.jsdelivr.net/npm/@huggingface/hub@2.17.10/+esm';import { HF, loadRevision as askRevision, REPO } from './commit.js';import { t } from './i18n.js';export { HF, REPO };2 unmodified linesexport const fileUrl = (sha, path) => `${DATASET_URL}/resolve/${sha}/${path}`;export const num = (v) => (v == null ? null : typeof v === 'bigint' ? Number(v) : Number(v));// the two layers, the values of the catalog column kind (#952, #1083): a material set (task material) and a corpusexport const MATERIAL_SET = 'material_set';export const CORPUS = 'corpus';export const KINDS = [MATERIAL_SET, CORPUS];// #2065, #2066: the one table of Chinese names the release writes: per English text the index shows (a collection's// name, a source's title, description or summary, as the catalog holds them) its Chinese text (columns en and zh)const TRANSLATIONS = 'meta/translations.parquet';// #2066: the projection's counts per training stage (artpool.stages FIGURES), with (#2065) each stage's funnelconst STAGE_FIGURES = 'meta/stage_figures.json';// the labels of corpus units: the record of the labelling (its model, and per leaf its threshold, the units at or above// it and those by class; per source the units at or above each leaf's threshold), and each labelled source's files// labels/<source>/*.parquet (one row per unit and leaf labelled: unit_id, leaf, score, class)const LABELS = 'meta/labels.json';const LABEL_FILE = /^labels\/([^/]+)\/[^/]+\.parquet$/;7 unmodified linesreturn blob;}/** A file named by its URL in the page address (catalog=, vocabulary=), which may lie outside the dataset. */async function urlFile(url) {const r = await fetch(url);if (!r.ok) throw new Error(`${url}: HTTP ${r.status}`);101 unmodified lines// lines of admit_collections.tsv, in their order; campaigns: the collection and its earlier names, the campaign tags// of its material sets). terms: Map of the term table by its English term. #2397: profile [{criterion, option}], the// criteria tools/fetch.py's default profile applies, in its order, each with the option that takes back what it// leaves out (what Get the data shows the profile leaves out).export function parseVocabulary(j) {const form = vocabSection(pick(j, ['form', 'forms']));for (const [id, name] of form.names) if (!name) form.names.set(id, id.replace(/[-_]+/g, ' '));6 unmodified lines// means), by the English termconst terms = new Map((Array.isArray(j?.terms) ? j.terms : []).filter((x) => x?.term).map((x) => [String(x.term), x]));const profile = (Array.isArray(j?.profile) ? j.profile : []).map((p) => ({ criterion: String(p.criterion), option: String(p.option) }));return { domain: vocabSection(pick(j, ['domain', 'domains'])), form, layers, relation: j?.relation || null, collections, terms, profile };}/** #2066: meta/stage_figures.json -> {rules, stages: Map id -> stage, noStage}: the rules every stage's material passes,* in their order, and per stage, in the stage table's order, its names, status and measures (counted_by) and its counts* by them (counts, each null before the release counted the stage fields), which (#2422) the first screen's figure says;* #2629: noStage, what no stage counts of each layer by reason ({kind: {reason: {measure: value}}}, null for figures* written before it); null for a commit without the file. */function parseStageFigures(j) {if (!j) return null;return { rules: j.rules || [], stages: new Map((j.stages || []).map((s) => [s.id, s])), noStage: j.no_stage || null };}export const topOf = (code) => String(code).split('.')[0];74 unmodified linesreturn [...by].map(([path, x]) => ({ path, ...x, batches: x.batches.sort() })).sort((a, b) => a.path.localeCompare(b.path));}/** Everything the page shows, from one commit. params: URLSearchParams (rev, catalog, vocabulary); onNote(key, values):* a note for the reader, as a key of the locale files. */export async function loadIndex(params, onNote) {const rev = await loadRevision(params.get('rev'));const at = (p) => wholeFile(rev.sha, p);1 unmodified lineconst has = (p) => rev.files.includes(p);const vocabUrl = params.get('vocabulary');const vocabFile = vocabUrl ? () => urlFile(vocabUrl) : has('meta/vocabulary.json') ? () => at('meta/vocabulary.json') : null;const [cat, sourcesJson, coverage, batches, vocabJson, figures, record, translations, stageFigures, labels] =await Promise.all([10 unmodified lines// #2066: the Chinese names of collections and sources (#2065); #2422: what each training stage can use, the// first screen's figure; #2518: and, in the same file, the stages of each sourcehas(TRANSLATIONS) ? readParquet(at(TRANSLATIONS)) : [],has(STAGE_FIGURES) ? jsonOf(at(STAGE_FIGURES)) : null,has(LABELS) ? jsonOf(at(LABELS)) : null,]);// the files of each labelled source at the commit, from its file list, so that no folder is listed20 unmodified linesif (!batchesBy.has(b.source)) batchesBy.set(b.source, []);batchesBy.get(b.source).push(b);}// the catalog column kind (#952); an index commit before it has none, and the page computes the kind belowconst hasKind = cat.rows.some((r) => r.kind != null && r.kind !== '');const sources = cat.rows.map((r) => {const info = srcInfo.get(r.source) || {};4 unmodified linesconst form = r.form == null || r.form === '' || r.form === 'unclassified' ? null : String(r.form);// The kind is the catalog column kind: material_set (task-ready) or corpus (raw). An index commit without it gets// the rule the index writes it by (#1633): a source that holds rows of a collection (sources.json campaign or// extended_by) or has fewer units than rows is a material set, every other one a corpus.// A unit is one unit_id (a test case, one workbook, one package); files are counted apart. The catalog columns// units (the distinct units of a material set) and files (its rows; a corpus is counted in rows) are read as they// are; #2065: a material set whose catalog row has no count of its units has none here (readyUnits null, not// counted yet), as the figures count it (meta/size_figures.json units_not_counted), never its rows.const roles = info.unit || {};const has = (k) => r[k] != null && r[k] !== '' && Number.isFinite(num(r[k]));const isTask = hasKind ? r.kind === MATERIAL_SET : !!(info.campaign || info.extended_by) || (has('units') && num(r.units) < rows);const units = has('units') ? num(r.units) : null;const lr = info.license_rows?.redistribution_ok || {};const shipRows = (num(lr.yes?.rows) || 0) + (num(lr.conditional?.rows) || 0);2 unmodified lines// release with fetch_check is publishedconst fc = r.fetch_check || r.fetch;return {kind: isTask ? MATERIAL_SET : CORPUS,isTask,// the collection of a material set (#1083): a line of admit_collections.tsv; of a corpus (#1633), the collection// that lists it under corpora in catalog/domains.yaml, else nonecollection: r.collection ? String(r.collection) : null,readyUnits: isTask ? units : 0,rawRows: isTask ? 0 : rows,fromCatalog: has('units'),// what one row of a corpus points at (sources.json unit: file, archive member, ...); a collection's entry counts// its rows as files (#1633: no roles)38 unmodified lines// it is held back, as the release notes give it (catalog column held_back); null for a catalog without themreleasedIn: r.released_in || null,heldBack: r.held_back || null,// #2588: the source's declared upstream (catalog columns upstream_kind, upstream_agent and upstream_entry): a// dataset or a catalog, its agent and its entry address, the values joined by ' | ' while the source reads// several upstreams; null for a catalog without them8 unmodified lines// #2006: the ids of the training stages one of its units passes (#2518: sources of the commit's stage figures),// [] without stagesstages: stagesOk?.sources?.[r.source] || [],info,cov: cov[r.source] || null,batches: batchesBy.get(r.source) || [],files: filesOf(r),// its label files (labels/<source>/*.parquet) and its units at or above each leaf's threshold (meta/labels.json// sources), none for a source the commit carries no labels oflabelFiles: (labelFiles.get(r.source) || []).sort(),labelled: labels?.sources?.[r.source] || null,};});4 unmodified linespin: record?.tag || rev.sha,date: rev.date,releaseDate: record?.date || rev.date,overrides: { catalog: params.get('catalog'), vocabulary: params.get('vocabulary') },hasVocabulary: Boolean(vocabJson),// #1577: who published each file of a material set and under which license, read when the attribution list is// made; a commit before it has nonehasAttribution: has('meta/attribution.parquet'),hasKind,// #2006: the stage table the stages were computed with (version, and each stage with its names, status, about and// counts), null when the commit has no stage of its sources; #2066: stagesWhy, why it has none (noFigures,// notCounted or noSources); stageList, the stages of the release's figures, whose status (#2422) the first3 unmodified linesstagesWhy,stageList: stageFigures?.stages || [],stageFigures: parseStageFigures(stageFigures),// #2066: the Chinese text of each English text the release shows (TRANSLATIONS, #2065): English -> Chinese, empty// for a commit without the tablezh: new Map(translations.map((r) => [r.en, r.zh])),vocab,sources,// #1158: the size figures of the whole index and of each layer (meta/size_figures.json, read as they are; #2422:// the page says their deduplicated size), null for a commit without themsizes: figures ? { index: figures.index, ...figures.layers } : null,catalogFile: cat.file,coverage,// the labels of corpus units (LABELS: model, leaves, sources), null for a commit without themlabels,};}2 unmodified lines34567892 unmodified lines12131415161718192021222324252627282930313233343536377 unmodified lines45464748495051101 unmodified lines1531541551561571581596 unmodified lines16616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022174 unmodified lines2962972982993003013023031 unmodified line30530630730830931031131210 unmodified lines32332432532632732832920 unmodified lines3503513523533543553563573583593603613623634 unmodified lines3683693703713723733743753763773783793803813823833842 unmodified lines38738838939039139239339439539639739839938 unmodified lines4384394404414424434444454464474484498 unmodified lines4584594604614624634644654664674684694704714724734744754764774 unmodified lines4824834844854864874884894904914924934944954964973 unmodified lines5015025035045055065075085095105115125135145155165175185195202 unmodified linesimport { compressors } from 'https://cdn.jsdelivr.net/npm/hyparquet-compressors@1.1.2/+esm';import { downloadFile, pathsInfo } from 'https://cdn.jsdelivr.net/npm/@huggingface/hub@2.17.10/+esm';import { HF, loadRevision as askRevision, REPO } from './commit.js';import { countedOf } from './first.js';import { t } from './i18n.js';export { HF, REPO };2 unmodified linesexport const fileUrl = (sha, path) => `${DATASET_URL}/resolve/${sha}/${path}`;export const num = (v) => (v == null ? null : typeof v === 'bigint' ? Number(v) : Number(v));// the two layers of an index commit whose catalog has the column kind (#952, #1083): a material set (task material) and// a corpus; SOURCE, the one kind of every source of a commit without that column or with labels by method (oneKind)export const MATERIAL_SET = 'material_set';export const CORPUS = 'corpus';export const KINDS = [MATERIAL_SET, CORPUS];export const SOURCE = 'source';// the label methods of meta/labels.json format /3, in its order (agent, classifier)export const LABEL_METHODS = ['agent', 'classifier'];const LABELS_BY_METHOD = 'training-data-foundation-labels/3';// #2065, #2066: the one table of Chinese names the release writes: per English text the index shows (a collection's// name, a source's title, description or summary, as the catalog holds them) its Chinese text (columns en and zh)const TRANSLATIONS = 'meta/translations.parquet';// #2066: the projection's counts per training stage (artpool.stages FIGURES), with (#2065) each stage's funnelconst STAGE_FIGURES = 'meta/stage_figures.json';// the labels of units: the record of the labelling (format /3: its methods and model, per leaf its threshold, null for a// leaf without a classifier threshold, its units by any method, by method and by class; per source its units of each// leaf and its units by method; formats /1 and /2: the classifier's labels of corpus units only, per leaf its// threshold, the units at or above it and those by class, per source the units at or above each leaf's threshold), and// each labelled source's files labels/<source>/*.parquet (one row per unit, leaf and method: unit_id, leaf, method,// score, class, status, threshold; a file of format /1 or /2 has no method)const LABELS = 'meta/labels.json';const LABEL_FILE = /^labels\/([^/]+)\/[^/]+\.parquet$/;7 unmodified linesreturn blob;}/** A file named by its URL in the page address (catalog=, vocabulary=, figures=), which may lie outside the dataset. */async function urlFile(url) {const r = await fetch(url);if (!r.ok) throw new Error(`${url}: HTTP ${r.status}`);101 unmodified lines// lines of admit_collections.tsv, in their order; campaigns: the collection and its earlier names, the campaign tags// of its material sets). terms: Map of the term table by its English term. #2397: profile [{criterion, option}], the// criteria tools/fetch.py's default profile applies, in its order, each with the option that takes back what it// leaves out (what Get the data shows the profile leaves out). facets: the facets of the catalog (facetsOf).export function parseVocabulary(j) {const form = vocabSection(pick(j, ['form', 'forms']));for (const [id, name] of form.names) if (!name) form.names.set(id, id.replace(/[-_]+/g, ' '));6 unmodified lines// means), by the English termconst terms = new Map((Array.isArray(j?.terms) ? j.terms : []).filter((x) => x?.term).map((x) => [String(x.term), x]));const profile = (Array.isArray(j?.profile) ? j.profile : []).map((p) => ({ criterion: String(p.criterion), option: String(p.option) }));return { domain: vocabSection(pick(j, ['domain', 'domains'])), form, layers, relation: j?.relation || null, collections, terms, profile,facets: facetsOf(j?.facets) };}// the facets of the catalog (catalog/facets.yaml of the code repository), in the order of their catalog columns; the// values multi and unclassified are every facet's, as the domain'sexport const FACET_IDS = ['subject', 'industry', 'occupation', 'business_process', 'resource_type', 'file_format'];export const FACET_FORMAL = ['multi', 'unclassified'];/** meta/vocabulary.json facets [{id, name, zh, standard, version, levels, titles?, code_page?, codes: [{code, level,* parent, name, title?}]}] -> Map id -> {name, zh, standard, version, titles, codePage, codes: Map code -> {level,* parent, name, title}, tree: [[code, depth]]}: titles is the standard a facet's codes take their titles from where* its own names are withheld (with its attribution), codePage the address of a code's page with {code} in it, each* '' or null without; tree is the standard's hierarchy, each code after its parent and before its next sibling,* siblings in the vocabulary's order; an empty Map for a vocabulary without facets. */function facetsOf(list) {const out = new Map();for (const f of Array.isArray(list) ? list : []) {const codes = new Map((f.codes || []).map((c) => [String(c.code), { level: c.level || '', parent: c.parent == null ? null : String(c.parent), name: c.name || '', title: c.title || '' }]));const kids = new Map();for (const [c, x] of codes) {const up = x.parent != null && codes.has(x.parent) ? x.parent : null;if (!kids.has(up)) kids.set(up, []);kids.get(up).push(c);}const tree = [];const walk = (up, depth) => { for (const c of kids.get(up) || []) { tree.push([c, depth]); walk(c, depth + 1); } };walk(null, 0);out.set(String(f.id), { name: f.name || String(f.id), zh: f.zh || '', standard: f.standard || '', version: f.version || '',titles: f.titles || null, codePage: f.code_page || '', codes, tree });}return out;}/** A source's codes on a facet with every code above them in the facet's hierarchy (fac, facetsOf; without it the codes* alone), so that a filter by a code keeps the sources of the codes under it. */function withAncestors(codes, fac) {const out = new Set();for (const c of codes) {for (let x = c; x != null && !out.has(x); x = fac?.codes.get(x)?.parent ?? null) out.add(x);}return [...out];}/** #2066: meta/stage_figures.json -> {rules, stages: Map id -> stage}: the rules every stage's material passes, in* their order, and per stage, in the stage table's order, its names, status and measures (counted_by), its counts by* them (counts, each null before the release counted the stage fields), which (#2422) the first screen's figure says,* and (stage-figures/8) its units by status (statuses, its counted ones by method); null for a commit without the* file. */function parseStageFigures(j) {if (!j) return null;return { rules: j.rules || [], stages: new Map((j.stages || []).map((s) => [s.id, s])) };}export const topOf = (code) => String(code).split('.')[0];74 unmodified linesreturn [...by].map(([path, x]) => ({ path, ...x, batches: x.batches.sort() })).sort((a, b) => a.path.localeCompare(b.path));}/** Everything the page shows, from one commit. params: URLSearchParams (rev, catalog, vocabulary, figures); onNote(key,* values): a note for the reader, as a key of the locale files. */export async function loadIndex(params, onNote) {const rev = await loadRevision(params.get('rev'));const at = (p) => wholeFile(rev.sha, p);1 unmodified lineconst has = (p) => rev.files.includes(p);const vocabUrl = params.get('vocabulary');const vocabFile = vocabUrl ? () => urlFile(vocabUrl) : has('meta/vocabulary.json') ? () => at('meta/vocabulary.json') : null;const figuresUrl = params.get('figures');const figuresFile = figuresUrl ? () => urlFile(figuresUrl) : has(STAGE_FIGURES) ? () => at(STAGE_FIGURES) : null;const [cat, sourcesJson, coverage, batches, vocabJson, figures, record, translations, stageFigures, labels] =await Promise.all([10 unmodified lines// #2066: the Chinese names of collections and sources (#2065); #2422: what each training stage can use, the// first screen's figure; #2518: and, in the same file, the stages of each sourcehas(TRANSLATIONS) ? readParquet(at(TRANSLATIONS)) : [],figuresFile ? jsonOf(figuresFile()) : null,has(LABELS) ? jsonOf(at(LABELS)) : null,]);// the files of each labelled source at the commit, from its file list, so that no folder is listed20 unmodified linesif (!batchesBy.has(b.source)) batchesBy.set(b.source, []);batchesBy.get(b.source).push(b);}// the catalog column kind (#952); an index commit before it has none, and the page computes the kind below. The page// shows one kind of source (oneKind) when the catalog has no such column or the labels are labels by method (format// /2): every source is then of the kind SOURCE, counted in units and rows, and task material is taken by labelconst hasKind = cat.rows.some((r) => r.kind != null && r.kind !== '');const labelsByMethod = labels?.format === LABELS_BY_METHOD;const oneKind = !hasKind || labelsByMethod;// the facets the catalog has columns of (a commit before them has none, and the page shows no filter by facet)const facetIds = FACET_IDS.filter((f) => cat.rows.some((r) => r[f] != null));const sources = cat.rows.map((r) => {const info = srcInfo.get(r.source) || {};4 unmodified linesconst form = r.form == null || r.form === '' || r.form === 'unclassified' ? null : String(r.form);// The kind is the catalog column kind: material_set (task-ready) or corpus (raw). An index commit without it gets// the rule the index writes it by (#1633): a source that holds rows of a collection (sources.json campaign or// extended_by) or has fewer units than rows is a material set, every other one a corpus; it is used only where the// page shows two layers (oneKind false).// A unit is one unit_id (a test case, one workbook, one package); files are counted apart. The catalog columns// units (the distinct units of a source) and files (its rows) are read as they are; #2065: a source whose catalog// row has no count of its units has none here (units and, of one kind or a material set, readyUnits null, not// counted yet), as the figures count it (meta/size_figures.json units_not_counted), never its rows. Of one kind,// every source is counted in units (readyUnits) and rows (rawRows); of two layers, a material set in units and a// corpus in rows.const roles = info.unit || {};const has = (k) => r[k] != null && r[k] !== '' && Number.isFinite(num(r[k]));const isTask = !oneKind && (hasKind ? r.kind === MATERIAL_SET : !!(info.campaign || info.extended_by) || (has('units') && num(r.units) < rows));const units = has('units') ? num(r.units) : null;const lr = info.license_rows?.redistribution_ok || {};const shipRows = (num(lr.yes?.rows) || 0) + (num(lr.conditional?.rows) || 0);2 unmodified lines// release with fetch_check is publishedconst fc = r.fetch_check || r.fetch;return {kind: oneKind ? SOURCE : isTask ? MATERIAL_SET : CORPUS,isTask,// the collection of a material set (#1083): a line of admit_collections.tsv; of a corpus (#1633), the collection// that lists it under corpora in catalog/domains.yaml, else nonecollection: r.collection ? String(r.collection) : null,readyUnits: oneKind || isTask ? units : 0,rawRows: oneKind || !isTask ? rows : 0,fromCatalog: has('units'),// what one row of a corpus points at (sources.json unit: file, archive member, ...); a collection's entry counts// its rows as files (#1633: no roles)38 unmodified lines// it is held back, as the release notes give it (catalog column held_back); null for a catalog without themreleasedIn: r.released_in || null,heldBack: r.held_back || null,// #4406: the address of its card, its section of the card file of its upstream's protocol (catalog column card,// path#anchor); null for a catalog without itcard: r.card || null,// the zip that holds the files the index stores for it, campaign_files/<protocol>/<part>.zip (catalog column// campaign_part); null for a catalog without it, whose files lie at their pathscampaignPart: r.campaign_part || null,// #2588: the source's declared upstream (catalog columns upstream_kind, upstream_agent and upstream_entry): a// dataset or a catalog, its agent and its entry address, the values joined by ' | ' while the source reads// several upstreams; null for a catalog without them8 unmodified lines// #2006: the ids of the training stages one of its units passes (#2518: sources of the commit's stage figures),// [] without stagesstages: stagesOk?.sources?.[r.source] || [],// its codes on each facet the catalog has (catalog columns of FACET_IDS), and the same with every code above// them in the facet's hierarchy, which the filters by facet readfacets: Object.fromEntries(facetIds.map((f) => [f, listOf(r[f]).map(String)])),facetKeys: Object.fromEntries(facetIds.map((f) => [f, withAncestors(listOf(r[f]).map(String), vocab.facets.get(f))])),info,cov: cov[r.source] || null,batches: batchesBy.get(r.source) || [],files: filesOf(r),// its label files (labels/<source>/*.parquet), its units of each leaf (meta/labels.json sources: format /3 by any// method, /1 and /2 the classifier's at or above each leaf's threshold) and (format /3) its units by method// (meta/labels.json by_method), none for a source the commit carries no labels oflabelFiles: (labelFiles.get(r.source) || []).sort(),labelled: labels?.sources?.[r.source] || null,byMethod: labelsByMethod ? labels.by_method?.[r.source] || null : null,};});4 unmodified linespin: record?.tag || rev.sha,date: rev.date,releaseDate: record?.date || rev.date,overrides: { catalog: params.get('catalog'), vocabulary: params.get('vocabulary'), figures: figuresUrl },hasVocabulary: Boolean(vocabJson),facetIds,// #1577: who published each file of a material set and under which license, read when the attribution list is// made; a commit before it has nonehasAttribution: has('meta/attribution.parquet'),hasKind,// one kind of source (above), and whether the labels are labels by method (meta/labels.json format /3)oneKind,labelsByMethod,// #2006: the stage table the stages were computed with (version, and each stage with its names, status, about and// counts), null when the commit has no stage of its sources; #2066: stagesWhy, why it has none (noFigures,// notCounted or noSources); stageList, the stages of the release's figures, whose status (#2422) the first3 unmodified linesstagesWhy,stageList: stageFigures?.stages || [],stageFigures: parseStageFigures(stageFigures),// the release tag the stage figures were counted on (counted_on), false while not counted, undefined without them,// which the release line says (first.js drawRelease)countedOn: countedOf(stageFigures),// #2066: the Chinese text of each English text the release shows (TRANSLATIONS, #2065): English -> Chinese, empty// for a commit without the tablezh: new Map(translations.map((r) => [r.en, r.zh])),vocab,sources,// #1158: the size figures of the whole index and of each layer (meta/size_figures.json, read as they are; #2422:// the page says their deduplicated size; of one kind, that of the whole index), null for a commit without themsizes: figures ? { index: figures.index, [SOURCE]: figures.index, ...figures.layers } : null,catalogFile: cat.file,coverage,// the labels of units (LABELS: format, methods, model, leaves, sources, by_method), null for a commit without themlabels,};}
1234567891050 unmodified lines6162636465666 unmodified lines737475767778798081828384853 unmodified lines899091929394952 unmodified lines98991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341353 unmodified lines1391401411421431441451461471481491501511521532 unmodified lines156157158159160161162163164165166167168169170171// The first screen, drawn before the index is read: the pictograms and (#2422) the training stages of the stage table as// a column of bands, each with what it can use and (#2629) its funnel, from the release's meta/stage_figures.json of// the commit the page reads (commit.js), read on its own as soon as that commit is known, with the release line. app.js// draws both again once it has read the index (drawStages, drawRelease): each stage then a button that sets the filter// by stage, with its status from the stage table the page was deployed with, and under them what no stage counts, by// reason. It also has the words of a level's size (#2422: one size, the deduplicated// one; sizeOf, sizeParts, sizeLine, checkText) that app.js writes.import { clear, el, fmtBytes, fmtCompact, fmtDate, fmtInt, fmtShare } from './charts.js';import { HF, loadRevision, REPO } from './commit.js';import { lang, onLanguage, t } from './i18n.js';50 unmodified lines// #2629: the rules every stage's material passes (artpool.stages.RULES, the steps of a funnel), each by the key of its// words; a rule the page does not know is said by its nameexport const RULE_KEY = { benchmark: 'benchmark', 'not compared': 'notCompared', duplicate: 'duplicate' };/** #2629: a stage's funnel (funnel of the stage figures, #2065: its counts before the rules, then after each rule) in* words by the measure m of its figure, each value formatted by fmt: what meets its condition, then what each rule6 unmodified lines...gone.map(([rule, n]) => t(`stage.removed.${RULE_KEY[rule] || 'other'}`, { count: n, n: fmt(n), rule }))];}/** What a stage can use, in the measures it is counted by (counted_by of the stage figures, #2065), as the dataset card's* stage figure says it: the headline is the stage's size where it is counted in bytes (after deduplication, so the* page's one size), else its units, else its rows; the line under it the rows of a stage counted in bytes, the material* sets of one counted in units. #2629: steps, its funnel in the headline's measure (funnelSteps), which ends at the* headline. -> {num, word, line, steps}: the figure, its unit, the line and the funnel; not counted yet while its counts* are null. */export function stageWhat(st) {const c = st.counts || {};const by = st.counted_by || [];const steps = (m, fmt) => funnelSteps(st.funnel || [], m, fmt);3 unmodified lines}if (by.includes('units') && c.units != null) {return { num: fmtInt(c.units), word: t('stage.units', { count: c.units }),line: c.material_sets == null ? '' : t('stage.sets', { count: c.material_sets, n: fmtInt(c.material_sets) }), steps: steps('units', fmtInt) };}if (by.includes('rows') && c.rows != null) {return { num: fmtCompact(c.rows), word: t('stage.rowsWord', { count: c.rows }), line: '', steps: steps('rows', fmtCompact) };2 unmodified lines}let drawn = null;/** #2422: the column: one band per stage of stages ([{id, name, zh, status, counted_by, counts, funnel, title}], in the* stage table's order): the stage's color, its name in the page's language, the mark of a provisional stage, what it* can use (stageWhat) and (#2629) under them its funnel. With onPick (app.js, once the page can filter by stage) each* band is a button that calls onPick(id), pressed for pick, the stage the filter holds, and a band that had the focus* keeps it. rest ({num, word, line, steps, name, title}, from app.js once the index is read): the last band, what no* stage counts, with (#2629) its sources by reason as its steps, which is no button. why: the short lines that say which* input the page misses. */export function drawStages(stages, { pick = '', onPick = null, onPoint = null, why = [], rest = null } = {}) {drawn = { stages, pick, onPick, onPoint, why, rest };// onPoint(g): the band the pointer or the focus is on (its place in the column; -1 for none), which the field brings// forwardconst point = (g) => ({ onpointerenter: () => onPoint?.(g), onpointerleave: () => onPoint?.(-1), onfocus: () => onPoint?.(g), onblur: () => onPoint?.(-1) });const box = document.getElementById('stage-tiles');const focused = box.contains(document.activeElement) ? document.activeElement.dataset.stage : null;const band = (name, mark, what) => [el('span', { class: 'core' }),el('span', {}, el('span', { class: 'nm' }, name, mark ? el('span', { class: 'prov' }, mark) : null), el('span', { class: 'sub' }, what.line)),el('span', { class: 'amount' }, el('b', { class: 'big' }, what.num), what.word ? el('span', { class: 'unit' }, what.word) : null),what.steps?.length ? el('span', { class: 'steps' }, what.steps.join(' \u00b7 ')) : null,];// #2629: a band with a line of steps under its name and its figureconst cls = (what) => (what.steps?.length ? 'stratum has-steps' : 'stratum');const items = stages.map((st, g) => {const on = pick === st.id;const what = stageWhat(st);const kids = band((lang() === 'zh' && st.zh) || st.name, st.status === 'provisional' ? t('stage.provisionalMark') : null, what);const style = `--c: var(${stageColor(st.id)})`;return el('li', {}, onPick? el('button', { type: 'button', class: cls(what), style, 'aria-pressed': String(on), 'data-stage': st.id, title: st.title, onclick: () => onPick(st.id), ...point(g) }, kids): el('div', { class: cls(what), style, ...point(g) }, kids));});if (rest) items.push(el('li', {}, el('div', { class: cls(rest), style: '--c: var(--none)', title: rest.title, ...point(stages.length) }, band(rest.name, null, rest))));clear(box).append(...items);box.classList.toggle('picked', !!pick);if (focused) box.querySelector(`[data-stage="${focused}"]`)?.focus({ preventScroll: true });3 unmodified lines}let release = null;/** #2422: the release the page reads, in one line: its tag (a link to the dataset at that tag, the tag naming it a* release), its day and a link to the list of every release (the dataset's CHANGELOG.md). */export function drawRelease(tag, date) {release = { tag, date };clear(document.getElementById('release-line')).append(el('a', { class: 'mono', href: `${HF}/datasets/${REPO}/tree/${tag}` }, tag), ' \u00b7 ', fmtDate(date), ' \u00b7 ',el('a', { href: `${HF}/datasets/${REPO}/blob/main/CHANGELOG.md` }, t('release.all')));}decorate();let drawnFromIndex = false;/** app.js has drawn the first screen from the index: what this module read early is not drawn again. */2 unmodified linesonLanguage(() => {if (drawnFromIndex) return;if (drawn) drawStages(drawn.stages, drawn);if (release) drawRelease(release.tag, release.date);});// the release's stage figures, read as soon as the commit the page reads is known (?rev= or main as it is now), so the// first screen shows them before the whole index is read; a commit without the file waits for app.jsloadRevision(new URLSearchParams(location.search).get('rev')).then((rev) => (rev.sha && rev.files.includes(STAGE_FIGURES)? fetch(`${HF}/datasets/${REPO}/resolve/${rev.sha}/${STAGE_FIGURES}`).then((r) => (r.ok ? r.json() : null)) : null)).then((doc) => {if (!doc || drawnFromIndex) return;drawStages(doc.stages || []);drawRelease(doc.release, doc.date);}).catch(() => {});12345678950 unmodified lines60616263646566676869707172737475767778798081828384858687886 unmodified lines95969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451463 unmodified lines1501511521531541551561572 unmodified lines1601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102113 unmodified lines2152162172182192202212222232242252262272282292302312322332342352362372382392402412422432 unmodified lines246247248249250251252253254255256257258259260261262263264265// The first screen, drawn before the index is read: the pictograms and (#2422) the training stages of the stage table as// a column of bands, each with what it can use and its units by status (its counted ones by method), from the// release's meta/stage_figures.json of the commit the page reads (commit.js), read on its own as soon as that commit is// known, with the release line. app.js draws both again once it has read the index (drawStages, drawRelease): each// stage then a button that sets the filter by stage. It also has the words of a level's size (#2422: one size, the// deduplicated one; sizeOf, sizeParts, sizeLine, checkText) that app.js writes.import { clear, el, fmtBytes, fmtCompact, fmtDate, fmtInt, fmtShare } from './charts.js';import { HF, loadRevision, REPO } from './commit.js';import { lang, onLanguage, t } from './i18n.js';50 unmodified lines// #2629: the rules every stage's material passes (artpool.stages.RULES, the steps of a funnel), each by the key of its// words; a rule the page does not know is said by its nameexport const RULE_KEY = { benchmark: 'benchmark', 'not compared': 'notCompared', duplicate: 'duplicate' };// the methods that place a unit on a stage (artpool.stages.METHODS), in their order, and the statuses a unit has on a// stage other than counted (artpool.stages.UNIT_STATUSES), in theirs, each by the key of its wordsconst METHODS = ['agent', 'classifier', 'rule'];const STATUS_KEY = { 'not yet judged': 'notJudged', 'judged below threshold': 'below', 'duplicate of a counted unit': 'duplicate','overlapping a benchmark': 'benchmark', 'size not recorded': 'unsized', 'archive of recorded members': 'archive' };/** A stage's units by status (statuses of the stage figures; a corpus counts its rows as units), each formatted by fmt:* methods, its counted units by each method its count takes (headline of the stage figures; the classifier's not* counted yet while the release records no labels), beside, those of its other methods (post-training: the rules'* placements, given beside the count and not in it), and statuses, its units of each other status, so that the three* add up to every unit of the catalog; null for figures written before the stages gave each unit a status. */export function stageStatuses(st, fmt = fmtCompact) {const s = st.statuses;if (!s) return null;const by = s.counted?.methods || {};const head = st.headline?.length ? st.headline : METHODS;const said = (m) => t(`stage.method.${m}`, { n: by[m] == null ? t('n.notCounted') : fmt(by[m].units) });return {methods: METHODS.filter((m) => m in by && head.includes(m)).map(said),beside: METHODS.filter((m) => m in by && !head.includes(m)).map(said),statuses: Object.entries(STATUS_KEY).map(([k, key]) => t(`stage.status.${key}`, { n: fmt(s[k]?.units ?? 0) })),};}/** #2629: a stage's funnel (funnel of the stage figures, #2065: its counts before the rules, then after each rule) in* words by the measure m of its figure, each value formatted by fmt: what meets its condition, then what each rule6 unmodified lines...gone.map(([rule, n]) => t(`stage.removed.${RULE_KEY[rule] || 'other'}`, { count: n, n: fmt(n), rule }))];}// the label methods of a stage that takes the units with a label (methods of the stage figures), in their orderconst LABEL_METHODS = ['agent', 'classifier'];/** The units a stage's count takes by label method in words, one part per method counted (stage.byMethod, the method's* name method.<m>), joined by plus signs so that they add up to its count, the agent's with its units of material sets* and of corpus units an agent judged (agent_by_layer of the stage figures, stage.agentLayers); '' while none is* counted; null for a stage whose count takes no label method (one that takes the units its rules place). */function methodsLine(st) {const m = st.methods;const head = st.headline?.length ? st.headline : LABEL_METHODS;if (!m || !LABEL_METHODS.some((k) => k in m && head.includes(k))) return null;const layers = st.agent_by_layer;const part = (k) => {const said = t('stage.byMethod', { method: t(`method.${k}`), count: m[k].units, n: fmtInt(m[k].units) });if (k !== 'agent' || layers?.material_set?.units == null || layers?.corpus?.units == null) return said;return `${said} ${t('stage.agentLayers', { sets: fmtInt(layers.material_set.units), judged: fmtInt(layers.corpus.units) })}`;};return LABEL_METHODS.filter((k) => head.includes(k) && m[k]?.units != null).map(part).join(' + ');}/** What a stage's classifier units stand on (scoring of the stage figures) in words: the data files the classifier* has scored so far of those it scores, with its model (stage.scored), and its held-out precision at its leaves'* thresholds with its 95% interval (stage.precision; stage.precisionNone while no leaf has a threshold); [] for a* stage without it. */export function scoringLines(st) {const s = st.scoring;if (!s) return [];const p = s.precision || {};return [t('stage.scored', { n: fmtInt(s.files_scored), m: fmtInt(s.files_planned), model: s.model }),p.precision == null ? t('stage.precisionNone'): t('stage.precision', { p: p.precision, low: p.interval[0], high: p.interval[1], above: fmtInt(p.above), leaves: fmtInt(p.leaves) })];}/** What a stage can use, in the measures it is counted by (counted_by of the stage figures, #2065), as the dataset card's* stage figure says it: the headline is the stage's size where it is counted in bytes (after deduplication, so the* page's one size), else its units, else its rows; the line under it the rows of a stage counted in bytes, and of one* counted in units its units by label method (methodsLine), which add up to the headline, where the figures have them,* else its material sets. Under them its units by status (stageStatuses), or for figures without statuses (#2629)* steps, its funnel in the headline's measure (funnelSteps), which ends at the headline, and what its classifier* units stand on (scoringLines). -> {num, word, line, steps, statuses, scoring}: the figure, its unit, the line, the* funnel, the statuses and the scoring; not counted yet while its counts are null. */export function stageWhat(st) {const statuses = stageStatuses(st);const what = { ...headlineOf(st), scoring: scoringLines(st) };return statuses ? { ...what, steps: [], statuses } : { ...what, statuses: null };}function headlineOf(st) {const c = st.counts || {};const by = st.counted_by || [];const steps = (m, fmt) => funnelSteps(st.funnel || [], m, fmt);3 unmodified lines}if (by.includes('units') && c.units != null) {return { num: fmtInt(c.units), word: t('stage.units', { count: c.units }),line: methodsLine(st) ?? (c.material_sets == null ? '' : t('stage.sets', { count: c.material_sets, n: fmtInt(c.material_sets) })),steps: steps('units', fmtInt) };}if (by.includes('rows') && c.rows != null) {return { num: fmtCompact(c.rows), word: t('stage.rowsWord', { count: c.rows }), line: '', steps: steps('rows', fmtCompact) };2 unmodified lines}let drawn = null;/** #2422: the column: one band per stage of stages ([{id, name, zh, status, counted_by, counts, funnel, statuses, title}],* in the stage table's order): the stage's color, its name in the page's language, the mark of a provisional stage, what* it can use (stageWhat) and under them its counted units by method and its units of every other status (or, for* figures without statuses, its funnel). With onPick (app.js, once the page can filter by stage) each band is a button* that calls onPick(id), pressed for pick, the stage the filter holds, and a band that had the focus keeps it. why: the* short lines that say which input the page misses. */export function drawStages(stages, { pick = '', onPick = null, onPoint = null, why = [] } = {}) {drawn = { stages, pick, onPick, onPoint, why };// onPoint(g): the band the pointer or the focus is on (its place in the column; -1 for none), which the field brings// forwardconst point = (g) => ({ onpointerenter: () => onPoint?.(g), onpointerleave: () => onPoint?.(-1), onfocus: () => onPoint?.(g), onblur: () => onPoint?.(-1) });const box = document.getElementById('stage-tiles');const focused = box.contains(document.activeElement) ? document.activeElement.dataset.stage : null;// under the line: the rules' placements beside the count where its count takes the label methods (the line says// those), else what its count takes by method; then what its classifier units stand on; then its units of every// other statusconst scored = (what) => (what.scoring.length ? el('span', { class: 'by' }, what.scoring.join(' \u00b7 ')) : null);const under = (what) => (what.statuses? el('span', { class: 'steps' }, el('span', { class: 'by' }, what.statuses.beside.length? t('stage.beside', { list: what.statuses.beside.join(' \u00b7 ') }): t('stage.countedBy', { list: what.statuses.methods.join(' \u00b7 ') })),scored(what), el('span', {}, what.statuses.statuses.join(' \u00b7 '))): what.steps?.length ? el('span', { class: 'steps' }, what.steps.join(' \u00b7 ')) : null);const band = (name, mark, what) => [el('span', { class: 'core' }),el('span', {}, el('span', { class: 'nm' }, name, mark ? el('span', { class: 'prov' }, mark) : null), el('span', { class: 'sub' }, what.line)),el('span', { class: 'amount' }, el('b', { class: 'big' }, what.num), what.word ? el('span', { class: 'unit' }, what.word) : null),under(what),];// a band with lines under its name and its figureconst cls = (what) => (what.statuses || what.steps?.length ? 'stratum has-steps' : 'stratum');// on hover, beside the stage's condition, its units by status in fullconst title = (st) => {const full = stageStatuses(st, fmtInt);return [st.title, ...(full ? [t('stage.countedBy', { list: full.methods.join(', ') }),...(full.beside.length ? [t('stage.beside', { list: full.beside.join(', ') })] : []), ...scoringLines(st), ...full.statuses] : [])].filter(Boolean).join('\n');};const items = stages.map((st, g) => {const on = pick === st.id;const what = stageWhat(st);const kids = band((lang() === 'zh' && st.zh) || st.name, st.status === 'provisional' ? t('stage.provisionalMark') : null, what);const style = `--c: var(${stageColor(st.id)})`;return el('li', {}, onPick? el('button', { type: 'button', class: cls(what), style, 'aria-pressed': String(on), 'data-stage': st.id, title: title(st), onclick: () => onPick(st.id), ...point(g) }, kids): el('div', { class: cls(what), style, title: title(st), ...point(g) }, kids));});clear(box).append(...items);box.classList.toggle('picked', !!pick);if (focused) box.querySelector(`[data-stage="${focused}"]`)?.focus({ preventScroll: true });3 unmodified lines}let release = null;// a release tag, which names a revision of the dataset; a publish (<tag>.p<n>: main as the publish that brought its// rows to version n after that tag left it) names none, and its link is to mainconst RELEASE_TAG = /^release-\d{4}-\d{2}-\d{2}\.\d+$/;/** #2422: the release the page reads, in one line: its tag (a link to the dataset at that tag, the tag naming it a* release), its day, the release tag or publish its figures were counted on (counted: meta/stage_figures.json* counted_on, a link to the dataset at that tag, or at main for a publish; false while not counted, which the line* says; undefined without the figures, which it leaves out) and a link to the list of every release (the dataset's* CHANGELOG.md). */export function drawRelease(tag, date, counted) {release = { tag, date, counted };const rev = RELEASE_TAG.test(counted || '') ? counted : 'main';const on = counted === false ? [t('release.notCounted'), ' \u00b7 ']: counted ? [t('release.countedOn'), ' ', el('a', { class: 'mono', href: `${HF}/datasets/${REPO}/tree/${rev}` }, counted), ' \u00b7 ']: [];clear(document.getElementById('release-line')).append(el('a', { class: 'mono', href: `${HF}/datasets/${REPO}/tree/${tag}` }, tag), ' \u00b7 ', fmtDate(date), ' \u00b7 ',...on, el('a', { href: `${HF}/datasets/${REPO}/blob/main/CHANGELOG.md` }, t('release.all')));}/** The release tag or publish the stage figures doc was counted on, false while not counted, undefined without one* (drawRelease). */export const countedOf = (doc) => (!doc ? undefined : doc.counted ? doc.counted_on || undefined : false);decorate();let drawnFromIndex = false;/** app.js has drawn the first screen from the index: what this module read early is not drawn again. */2 unmodified linesonLanguage(() => {if (drawnFromIndex) return;if (drawn) drawStages(drawn.stages, drawn);if (release) drawRelease(release.tag, release.date, release.counted);});// the release's stage figures, read as soon as the commit the page reads is known (?rev= or main as it is now), or from// the address's figures=, so the first screen shows them before the whole index is read; a commit without the file// waits for app.jsconst query = new URLSearchParams(location.search);const figuresAt = query.get('figures');(figuresAt ? fetch(figuresAt).then((r) => (r.ok ? r.json() : null)): loadRevision(query.get('rev')).then((rev) => (rev.sha && rev.files.includes(STAGE_FIGURES)? fetch(`${HF}/datasets/${REPO}/resolve/${rev.sha}/${STAGE_FIGURES}`).then((r) => (r.ok ? r.json() : null)) : null))).then((doc) => {if (!doc || drawnFromIndex) return;drawStages(doc.stages || []);drawRelease(doc.release, doc.date, countedOf(doc));}).catch(() => {});
1234567891011121314151617181920212223242526272829303132333435363738394041424344459 unmodified lines55565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114212 unmodified lines1551561571581591601611621631647 unmodified lines1721731741751761771781791803 unmodified lines1841851861871881891901911921931941951961972 unmodified lines200201202203204205206207208209210211212213214215{"collections": 14,"date": "2026-11-21","format": "portal-first/5","index": "e26658c3df0ca7a6871d71cf0e815cb903b254fc","raw_rows": 1206406941,"raw_rows_not_counted": 0,"raw_sources": 139,"ready_sources": 2222,"ready_units": 5582,"ready_units_not_counted": 0,"sizes": {"corpus": {"bytes": 4468489595169130,"check": {"compared": 23907,"error": 2,"gone": 164,"hash_mismatch": 15,"match": 23755,"needs_auth": 516,"no_length": 1851,"rows": 26583,"size_mismatch": 137,"unreachable": 143},"counts": {"corpora": 139,"rows": 1206406941,"rows_not_counted": 0},"distinct_bytes": 4154005797539103,"estimate": {"bytes": 514316309239340,"high": 1050649190969052,"low": 251877418452551,"readings": 4306,"rows": 279904983},"facts": {"collecting": 25,"every_row_sized": 92,"pii": {"dates": ["2026-10-04",9 unmodified lines"present": 14,"suspected": 1},"not_judged": 121},"sources": 139,"summary_read": 0},"shown": {"bytes": "4.47 PB","compared": "23,907","corpora": "139","distinct_bytes": "4.15 PB","estimate": "514 TB","match": "23,755","range": "252 TB to 1.05 PB","read": "26,583","rows": "1,206,406,941","unsized_rows": "291,042,254"},"shown_zh": {"bytes": "4.47 PB","compared": "23,907","corpora": "139","distinct_bytes": "4.15 PB","estimate": "514 TB","match": "23,755","range": "252 TB \u5230 1.05 PB","read": "26,583","rows": "1,206,406,941","unsized_rows": "291,042,254"},"unsized_rows": 291042254},"index": {"bytes": 4468525578656252,"check": {"compared": 35825,"error": 5,"gone": 167,"hash_mismatch": 88,"match": 35579,"needs_auth": 526,"no_length": 1851,"rows": 38519,"size_mismatch": 158,"unreachable": 145},"counts": {"corpora": 139,"material_sets": 2222},"distinct_bytes": 4154041666221130,"estimate": {"bytes": 514316309239340,"high": 1050649190969052,"low": 251877418452551,"readings": 4306,"rows": 279904983},"shown": {"bytes": "4.47 PB","compared": "35,825","corpora": "139","distinct_bytes": "4.15 PB","estimate": "514 TB","match": "35,579","material_sets": "2,222","range": "252 TB to 1.05 PB","read": "38,519","unsized_rows": "291,042,254"},"shown_zh": {"bytes": "4.47 PB","compared": "35,825","corpora": "139","distinct_bytes": "4.15 PB","estimate": "514 TB","match": "35,579","material_sets": "2,222","range": "252 TB \u5230 1.05 PB","read": "38,519","unsized_rows": "291,042,254"},"unsized_rows": 291042254},"material_set": {"bytes": 35983487122,12 unmodified lines"counts": {"collections": 14,"empty_collections": 1,"files": 14340,"files_not_counted": 0,"in_no_collection": 5,"material_sets": 2222,"units": 5582,"units_not_counted": 0},7 unmodified lines"files": null,"judged": 0,"levels": {},"not_judged": 2222},"sources": 2222,"summary_read": 0},"shown": {3 unmodified lines"distinct_bytes": "35.9 GB","empty_collections": "1","estimate": "none","files": "14,340","in_no_collection": "5","match": "11,824","material_sets": "2,222","range": "none","read": "11,936","units": "5,582","unsized_rows": "0"},"shown_zh": {"bytes": "36.0 GB",2 unmodified lines"distinct_bytes": "35.9 GB","empty_collections": "1","estimate": "\u65e0","files": "14,340","in_no_collection": "5","match": "11,824","material_sets": "2,222","range": "\u65e0","read": "11,936","units": "5,582","unsized_rows": "0"},"unsized_rows": 0}}}1234567891011121314151617181920212223242526272829303132333435363738394041424344459 unmodified lines55565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114212 unmodified lines1551561571581591601611621631647 unmodified lines1721731741751761771781791803 unmodified lines1841851861871881891901911921931941951961972 unmodified lines200201202203204205206207208209210211212213214215{"collections": 14,"date": "2026-11-22","format": "portal-first/5","index": "4fc6aaf347b76fb50f02464749b908a5e943f58e","raw_rows": 1275880615,"raw_rows_not_counted": 0,"raw_sources": 173,"ready_sources": 2223,"ready_units": 5582,"ready_units_not_counted": 0,"sizes": {"corpus": {"bytes": 6321773942949163,"check": {"compared": 23971,"error": 2,"gone": 164,"hash_mismatch": 15,"match": 23818,"needs_auth": 516,"no_length": 1876,"rows": 26672,"size_mismatch": 138,"unreachable": 143},"counts": {"corpora": 173,"rows": 1275880615,"rows_not_counted": 0},"distinct_bytes": 5842637891836114,"estimate": {"bytes": 514331975583338,"high": 1050678040383540,"low": 251885642332258,"readings": 4334,"rows": 279904705},"facts": {"collecting": 41,"every_row_sized": 115,"pii": {"dates": ["2026-10-04",9 unmodified lines"present": 14,"suspected": 1},"not_judged": 155},"sources": 173,"summary_read": 0},"shown": {"bytes": "6.32 PB","compared": "23,971","corpora": "173","distinct_bytes": "5.84 PB","estimate": "514 TB","match": "23,818","range": "252 TB to 1.05 PB","read": "26,672","rows": "1,275,880,615","unsized_rows": "298,463,440"},"shown_zh": {"bytes": "6.32 PB","compared": "23,971","corpora": "173","distinct_bytes": "5.84 PB","estimate": "514 TB","match": "23,818","range": "252 TB \u5230 1.05 PB","read": "26,672","rows": "1,275,880,615","unsized_rows": "298,463,440"},"unsized_rows": 298463440},"index": {"bytes": 6321809926436285,"check": {"compared": 35889,"error": 5,"gone": 167,"hash_mismatch": 88,"match": 35642,"needs_auth": 526,"no_length": 1876,"rows": 38608,"size_mismatch": 159,"unreachable": 145},"counts": {"corpora": 173,"material_sets": 2223},"distinct_bytes": 5842673760518141,"estimate": {"bytes": 514331975583338,"high": 1050678040383540,"low": 251885642332258,"readings": 4334,"rows": 279904705},"shown": {"bytes": "6.32 PB","compared": "35,889","corpora": "173","distinct_bytes": "5.84 PB","estimate": "514 TB","match": "35,642","material_sets": "2,223","range": "252 TB to 1.05 PB","read": "38,608","unsized_rows": "298,463,449"},"shown_zh": {"bytes": "6.32 PB","compared": "35,889","corpora": "173","distinct_bytes": "5.84 PB","estimate": "514 TB","match": "35,642","material_sets": "2,223","range": "252 TB \u5230 1.05 PB","read": "38,608","unsized_rows": "298,463,449"},"unsized_rows": 298463449},"material_set": {"bytes": 35983487122,12 unmodified lines"counts": {"collections": 14,"empty_collections": 1,"files": 14349,"files_not_counted": 0,"in_no_collection": 6,"material_sets": 2223,"units": 5582,"units_not_counted": 0},7 unmodified lines"files": null,"judged": 0,"levels": {},"not_judged": 2223},"sources": 2223,"summary_read": 0},"shown": {3 unmodified lines"distinct_bytes": "35.9 GB","empty_collections": "1","estimate": "none","files": "14,349","in_no_collection": "6","match": "11,824","material_sets": "2,223","range": "none","read": "11,936","units": "5,582","unsized_rows": "9"},"shown_zh": {"bytes": "36.0 GB",2 unmodified lines"distinct_bytes": "35.9 GB","empty_collections": "1","estimate": "\u65e0","files": "14,349","in_no_collection": "6","match": "11,824","material_sets": "2,223","range": "\u65e0","read": "11,936","units": "5,582","unsized_rows": "9"},"unsized_rows": 9}}}
63 unmodified lines6465666768697015 unmodified lines868788899091929394959697989910010110210310410510610710 unmodified lines11811912012112212313 unmodified lines13713813914014114214311 unmodified lines15515615715815916016116234 unmodified lines1971981992002012022032042054 unmodified lines21021121221321421521621721821922022122222322422522622722822963 unmodified lines</div><p class="field-empty" id="field-empty" hidden><span data-i18n="sources.none">No source matches</span><button class="link" id="field-clear" type="button" data-i18n="filter.clear">Clear</button></p><!-- what a point's light says --><p class="field-legend" id="field-legend" hidden><span><i class="l1"></i><span data-i18n="field.legendOn">in the selection</span></span><span><i class="l2"></i><span data-i18n="field.legendHalf">kept, in the other layer</span></span><span><i class="l3"></i><span data-i18n="field.legendOff">filtered out</span></span></p><p class="field-off" id="field-off" hidden data-i18n="field.off">The ground of this screen is a field of points, one per source, drawn with WebGL, which this browser does not offer. Everything else on the page works without it.</p><div class="panel views" id="views" hidden>15 unmodified lines<p class="eyebrow" data-i18n="page.eyebrow">The public index</p><h1 data-i18n="page.title">Training Data Foundation</h1><p class="lede" data-i18n="hero.lede">Real public data for pre-training, mid-training and post-training: each file with its address, size, hashes and license, fetched with one command.</p><!-- the release the page reads, in one line: its tag, its day and a link to every release (first.js drawRelease) --><p class="release-line" id="release-line"><span class="sk sk-line"></span></p></div><!-- the stratigraphic column: one band per stage of the stage table, top to bottom as the field stacks them, eachwith its funnel, and under them what no stage counts, by reason --><figure class="stage-fig" aria-labelledby="stage-fig-h"><figcaption class="eyebrow" id="stage-fig-h" data-i18n="stage.figTitle">What each training stage can use</figcaption><ul class="column" id="stage-tiles"><li><div class="stratum sk-tile"></div></li><li><div class="stratum sk-tile"></div></li><li><div class="stratum sk-tile"></div></li></ul><!-- a missing input, one short line each (app.js renderStageFig) --><p class="stage-why" id="stage-why" hidden></p></figure><!-- the words the page counts in and sorts by (material set, corpus, unit, domain): each a button that opens itsmeaning in place, as the index's vocabulary gives it (app.js renderTerms); the manual's glossary has the rest;#2614: the popover they open follows the manual's view, outside the page, as the manual's start has the line too --><p class="terms" id="terms" hidden></p><!-- #2422: the filters: the search, then the domain, the form, the size, the training permit and the personal-datamark (two labels every source carries, which the page filters on and counts and never leaves anything out of acount for) and the file types. The stage is set by its band above, so its select stays out of sight. A filterthe panel does not show (collection, subdomain, license tier, redistribution, status) still holds from the10 unmodified lines<label hidden><span data-i18n="filter.stage">Training stage</span><select id="f-stage"><option value="" data-i18n="filter.all">All</option></select><span id="f-stage-note" hidden></span></label><label><span data-i18n="filter.domain">Domain</span><select id="f-domain"><option value="" data-i18n="filter.all">All</option></select></label><label><span data-i18n="filter.form">Form</span><select id="f-form"><option value="" data-i18n="filter.all">All</option></select></label><label><span data-i18n="filter.size">Size</span><select id="f-size"><option value="" data-i18n="filter.any">Any</option><option value="lt1g" data-i18n="filter.size.lt1g">Under 1 GB</option>13 unmodified lines<option value="marked" data-i18n="filter.pii.marked">Present or suspected</option><option value="unknown" data-i18n="filter.pii.unknown">Not judged yet</option></select></label><!-- #1524: the file types of the layer shown with their rows (app.js fillExt), any number checked; foldedwhile none is checked, its summary saying how many are --><details class="ext-fold" id="ext-fold"><summary><span data-i18n="filter.ext">File type</span><span class="ext-on" id="ext-on"></span></summary>11 unmodified lines<aside class="panel work-right" aria-labelledby="sel-h"><div class="pad"><div class="sel-top"><p class="eyebrow" id="sel-h" data-i18n="chip.selection">Selection</p><!-- the layer switch (#1083): the list, the charts and the command take one layer, material sets by default --><span class="seg" role="group" aria-label="Show" data-i18n-attr="aria-label:layer.label" id="layer-seg"><button type="button" data-kind="material_set" aria-pressed="true" data-i18n="kind.material_set">Material sets</button><button type="button" data-kind="corpus" aria-pressed="false" data-i18n="kind.corpus">Corpora</button></span>34 unmodified lines<div class="band-head row reveal"><h2 id="map-h"><span class="sk sk-line"></span></h2><span class="seg-wrap" id="metric-wrap"><span class="seg-label" id="metric-label" data-i18n="metric.label">Count</span><span class="seg" role="group" aria-labelledby="metric-label" id="metric-seg"><button type="button" data-metric="sets" aria-pressed="true" data-i18n="metric.sets">Material sets</button><button type="button" data-metric="units" aria-pressed="false" data-i18n="metric.units">Units</button></span></span></div>4 unmodified lines<figure class="chart" id="form-fig"></figure></div></div><!-- the leaves whose material sets hold the fewest units, with their counts, as the funnel picks them (app.jsrenderFewest, from projections.leaves of the commit's meta/coverage.json) --><div class="card fewest-card" id="fewest" hidden><h3 data-i18n="fewest.title">Leaves with the fewest units</h3><p class="small" data-i18n="fewest.text">The leaves of the domain grid whose material sets hold the fewest units, the fewest first: the leaves the data foundation promotes corpus rows into material sets for first.</p><div id="fewest-body"></div></div><!-- every leaf with its units by method, agent and classifier, and the classifier's ones by class (app.jsrenderLeaves, from projections.leaves of meta/coverage.json and meta/labels.json of the commit) --><div class="card fewest-card" id="leaves" hidden><h3 data-i18n="leaves.title">Units by leaf</h3><p class="small" data-i18n="leaves.text">Every leaf of the domain grid with its units by method: agent, the units of the material sets whose domain holds the leaf, each chosen by an agent, and classifier, the corpus units scored by a classifier at or above the leaf's threshold, then the classifier's units by class. Each row's command takes the leaf's classifier units straight from the corpora (--kind corpus --leaf).</p><div id="leaves-body"></div></div></section></div></div>63 unmodified lines6465666768697015 unmodified lines868788899091929394959697989910010110210310410510610710810910 unmodified lines12012112212312412512612712812913013113213313413513 unmodified lines14915015115215315415511 unmodified lines16716816917017117217317417534 unmodified lines2102112122132142152162172182192202214 unmodified lines22622722822923023123223323423523623723823924024124224324424524624724824925025125225325463 unmodified lines</div><p class="field-empty" id="field-empty" hidden><span data-i18n="sources.none">No source matches</span><button class="link" id="field-clear" type="button" data-i18n="filter.clear">Clear</button></p><!-- what a point's light says --><p class="field-legend" id="field-legend" hidden><span><i class="l1"></i><span data-i18n="field.legendOn">in the selection</span></span><span id="legend-half"><i class="l2"></i><span data-i18n="field.legendHalf">kept, in the other layer</span></span><span><i class="l3"></i><span data-i18n="field.legendOff">filtered out</span></span></p><p class="field-off" id="field-off" hidden data-i18n="field.off">The ground of this screen is a field of points, one per source, drawn with WebGL, which this browser does not offer. Everything else on the page works without it.</p><div class="panel views" id="views" hidden>15 unmodified lines<p class="eyebrow" data-i18n="page.eyebrow">The public index</p><h1 data-i18n="page.title">Training Data Foundation</h1><p class="lede" data-i18n="hero.lede">Real public data for pre-training, mid-training and post-training: each file with its address, size, hashes and license, fetched with one command.</p><!-- the release the page reads, in one line: its tag, its day, the tag its figures were counted on and a link to every release (first.js drawRelease) --><p class="release-line" id="release-line"><span class="sk sk-line"></span></p></div><!-- the stratigraphic column: one band per stage of the stage table, top to bottom as the field stacks them, eachwith its counted units by method and its units of every other status --><figure class="stage-fig" aria-labelledby="stage-fig-h"><figcaption class="eyebrow" id="stage-fig-h" data-i18n="stage.figTitle">What each training stage can use</figcaption><ul class="column" id="stage-tiles"><li><div class="stratum sk-tile"></div></li><li><div class="stratum sk-tile"></div></li><li><div class="stratum sk-tile"></div></li></ul><!-- a missing input, one short line each (app.js renderStageFig) --><p class="stage-why" id="stage-why" hidden></p></figure><!-- the words the page counts in and sorts by (of one kind of source: source, unit, row, label, domain; of twolayers: material set, corpus, unit, domain): each a button that opens itsmeaning in place, as the index's vocabulary gives it (app.js renderTerms); the manual's glossary has the rest;#2614: the popover they open follows the manual's view, outside the page, as the manual's start has the line too --><p class="terms" id="terms" hidden></p><!-- #2422: the filters: the search, then the domain, the form, the facets, the size, the training permit and thepersonal-datamark (two labels every source carries, which the page filters on and counts and never leaves anything out of acount for) and the file types. The stage is set by its band above, so its select stays out of sight. A filterthe panel does not show (collection, subdomain, license tier, redistribution, status) still holds from the10 unmodified lines<label hidden><span data-i18n="filter.stage">Training stage</span><select id="f-stage"><option value="" data-i18n="filter.all">All</option></select><span id="f-stage-note" hidden></span></label><label><span data-i18n="filter.domain">Domain</span><select id="f-domain"><option value="" data-i18n="filter.all">All</option></select></label><label><span data-i18n="filter.form">Form</span><select id="f-form"><option value="" data-i18n="filter.all">All</option></select></label><!-- the facets of the catalog, each a recognised standard: a select of its codes in the standard's hierarchy,a code keeping the sources of the codes under it (app.js facetOptions); shown while the catalog has thefacet's column --><p class="eyebrow facet-title" id="facet-title" data-i18n="filter.facets" hidden>By standard</p><label hidden><span>Subject</span><select id="f-subject"><option value="" data-i18n="filter.all">All</option></select></label><label hidden><span>Industry</span><select id="f-industry"><option value="" data-i18n="filter.all">All</option></select></label><label hidden><span>Occupation and work</span><select id="f-occupation"><option value="" data-i18n="filter.all">All</option></select></label><label hidden><span>Business process</span><select id="f-business_process"><option value="" data-i18n="filter.all">All</option></select></label><label hidden><span>Resource type</span><select id="f-resource_type"><option value="" data-i18n="filter.all">All</option></select></label><label hidden><span>File format</span><select id="f-file_format"><option value="" data-i18n="filter.all">All</option></select></label><label><span data-i18n="filter.size">Size</span><select id="f-size"><option value="" data-i18n="filter.any">Any</option><option value="lt1g" data-i18n="filter.size.lt1g">Under 1 GB</option>13 unmodified lines<option value="marked" data-i18n="filter.pii.marked">Present or suspected</option><option value="unknown" data-i18n="filter.pii.unknown">Not judged yet</option></select></label><!-- #1524: the file types of the sources shown with their rows (app.js fillExt), any number checked; foldedwhile none is checked, its summary saying how many are --><details class="ext-fold" id="ext-fold"><summary><span data-i18n="filter.ext">File type</span><span class="ext-on" id="ext-on"></span></summary>11 unmodified lines<aside class="panel work-right" aria-labelledby="sel-h"><div class="pad"><div class="sel-top"><p class="eyebrow" id="sel-h" data-i18n="chip.selection">Selection</p><!-- the layer switch (#1083) of an index commit of two layers: the list, the charts and the command take onelayer, material sets by default; hidden on a commit of one kind of source (app.js renderMapHead) --><span class="seg" role="group" aria-label="Show" data-i18n-attr="aria-label:layer.label" id="layer-seg" hidden><button type="button" data-kind="material_set" aria-pressed="true" data-i18n="kind.material_set">Material sets</button><button type="button" data-kind="corpus" aria-pressed="false" data-i18n="kind.corpus">Corpora</button></span>34 unmodified lines<div class="band-head row reveal"><h2 id="map-h"><span class="sk sk-line"></span></h2><span class="seg-wrap" id="metric-wrap"><span class="seg-label" id="metric-label" data-i18n="metric.label">Count</span><!-- of one kind of source: sources, units or rows; of two layers, material sets or units (app.jsrenderMapHead names them and shows the rows of one kind only) --><span class="seg" role="group" aria-labelledby="metric-label" id="metric-seg"><button type="button" data-metric="sets" aria-pressed="true" data-i18n="metric.sources">Sources</button><button type="button" data-metric="units" aria-pressed="false" data-i18n="metric.units">Units</button><button type="button" data-metric="rows" aria-pressed="false" data-i18n="metric.allRows" hidden>Rows</button></span></span></div>4 unmodified lines<figure class="chart" id="form-fig"></figure></div></div><!-- the leaves with the fewest units, with their counts (app.js renderFewest: by the units labelled for eachleaf, meta/labels.json, or on an older commit by the units of the material sets, meta/coverage.json) --><div class="card fewest-card" id="fewest" hidden><h3 data-i18n="fewest.title">Leaves with the fewest units</h3><p class="small" id="fewest-text" data-i18n="fewest.text">The leaves of the domain grid with the fewest units labelled for them by any method, the fewest first.</p><div id="fewest-body"></div></div><!-- every leaf with its units by method (agent, classifier), the classifier's threshold, its units by classand the command that takes its units by label (app.js renderLeaves, from meta/labels.json andprojections.leaves of meta/coverage.json of the commit) --><div class="card fewest-card" id="leaves" hidden><h3 data-i18n="leaves.title">Units by leaf</h3><p class="small" id="leaves-text" data-i18n="leaves.text">Every leaf of the domain grid with its units labelled by any method and by each method: agent (judged one by one usable for the leaf by an agent) and classifier (scored at or above the leaf's threshold, shown beside it); then its units by class. Each row's command takes the leaf's labelled units from every source (--leaf), by the method chosen above the table (--method).</p><div id="leaves-body"></div></div><!-- every source by its kind of source and by the class of its form, the material sets with their units and thecorpora with theirs (app.js renderKinds, from projections.source_kinds and projections.classes of thecommit's meta/coverage.json) --><div class="card fewest-card" id="kinds" hidden><h3 data-i18n="kinds.title">Units by kind of source and by class</h3><p class="small" data-i18n="kinds.text">Every source of this commit, whatever its status, by its kind of source (catalog/source_kinds.tsv) and by the class of its form (catalog/stages.yaml): its material sets with their units, and its corpora with their units, a corpus counting its rows. The units of the two layers are never added together.</p><div id="kinds-body"></div></div></section></div></div>
1 unmodified line23456789101112131415161718192021222324252627282930314 unmodified lines3637383940414232 unmodified lines7576777879808182838485868788899013 unmodified lines10410510610710810911018 unmodified lines1291301311321331344 unmodified lines1391401411421431441 unmodified line// the bars by domain and by form. One crossfilter selection holds the filters: a click on a bar or a map cell// and the filter panel set its clauses; the charts, the counts of the filter options, the tables behind the charts and// the list of selected sources all read it. app.js draws the rest of the page and loads this module after the first// screen has painted. Every chart draws one layer only (#1083), the one the clause kind selects, in its color and its// measure: material sets in the main color, in sets or units; corpora in gray, in rows. The two are never stacked or// added. The same DuckDB-WASM holds meta/preview.parquet once a row's "Preview rows" first opens.// Standard tool: linked charts over one crossfilter selection by Mosaic vgplot (wasmConnector, DuckDB-WASM).import * as vg from 'https://cdn.jsdelivr.net/npm/@uwdata/vgplot@0.34.3/+esm';import { widest as measured } from './charts.js';// #2422: the page's colors in its theme (style.css), read when a chart is drawn, so a new theme draws them again// (app.js): each layer's color (data.js KINDS: --ours for material sets, --other for corpora), the empty part of a map// cell (--map-empty), the low end of a layer's color scale on the map (--map-low-ours, --map-low-other: its color at 20%// over the empty cell's, so a cell with a small count still shows apart from an empty one) and the ink of the labelsconst css = (name) => getComputedStyle(document.documentElement).getPropertyValue(name).trim();const colors = () => ({ kind: { material_set: css('--ours'), corpus: css('--other') }, empty: css('--map-empty'),low: { material_set: css('--map-low-ours'), corpus: css('--map-low-other') }, ink: css('--ink-2') });export const sel = vg.Selection.crossfilter();// The page's own columns of every source (app.js pageRow, from data.js), joined to meta/catalog.parquet of the commit// the page reads. A domain key is a top-level code, _multi or _none (dkeys, a list); codes are the domain codes with// their leaves; hcol is the map's column (a form, _other or _none); kind is the layer, material_set or corpus;// collection is that of a material set ('' for a corpus); n_units counts the units of a material set and n_rows the// rows of a corpus (0 for the other kind); #1524: exts are its file types and ext_rows the rows of each, in the same// order; #2006: stages are the ids of the training stages one of its units passes (the commit's stage figures); #2422: pii is its// personal-data mark (none, marked or unknown), sizeb the size class of its deduplicated size. The view dom holds one// row per source and domain key (dkey): DuckDB does not take UNNEST next to an aggregate// in one SELECT, so the domain charts and their tables group dom by dkey.const SRC = `CREATE OR REPLACE TABLE src AS SELECT p.source, c.title,4 unmodified linesCAST(p.sizeb AS VARCHAR) AS sizeb, CAST(p.tier AS VARCHAR) AS tier,CAST(p.train AS VARCHAR) AS train, CAST(p.redist AS VARCHAR) AS redist, CAST(p.pii AS VARCHAR) AS pii,CAST(p.qtext AS VARCHAR) AS qtext,CAST(p.exts AS VARCHAR[]) AS exts, CAST(p.ext_rows AS DOUBLE[]) AS ext_rows, CAST(p.stages AS VARCHAR[]) AS stagesFROM page p LEFT JOIN catalog c USING (source)`;const DOM = 'CREATE OR REPLACE VIEW dom AS SELECT *, UNNEST(dkeys) AS dkey FROM src';// the page's DuckDB-WASM, once open32 unmodified linesreturn rows.toArray().map((r) => ({ ...r }));}// ---- the metric of the charts, in the layer shown: material sets (sets) or their units, or the rows of corpora; its// sum, and the same sum as text for the labels at the bar endsconst AGG = { sets: () => vg.sum('n_src'), units: () => vg.sum('n_units'), rows: () => vg.sum('n_rows') };const LABEL = {sets: () => vg.sql`format('{:,}', CAST(sum(n_src) AS BIGINT))`,units: () => vg.sql`format('{:,}', CAST(sum(n_units) AS BIGINT))`,rows: () => vg.sql`format('{:,}', CAST(sum(n_rows) AS BIGINT))`,};// the columns of the tables behind the charts, over the layer shown: its sources (n), the units of material sets and// the rows of corpora (0 in the other layer)const SUMS = 'count(*) AS n, sum(n_units) AS units, sum(n_rows) AS rows';const whereOf = (filter) => (filter && filter.length ? `WHERE ${filter.map((p) => `(${p})`).join(' AND ')}` : '');13 unmodified linesconst connect = (client) => { vg.coordinator().connect(client); return client; };// ---- the filters: one clause source per filter, its predicate over srcconst KEYS = ['domain', 'leaf', 'form', 'collection', 'kind', 'status', 'train', 'redist', 'tier', 'size', 'q', 'ext', 'stage', 'pii'];const SOURCES = Object.fromEntries(KEYS.map((k) => [k, { filter: k, reset() {} }]));// a clause that keeps every row, made the active clause last: the next round of queries then gives every client its// own predicate (a client of the active clause would be skipped). A new clause object each time, so the selection emits.18 unmodified linesstage: (v) => vg.sql`list_contains(stages, ${lit(v)})`,// #2422: the personal-data markpii: (v) => vg.sql`pii = ${lit(v)}`,};// what each filter's option counts are over: one value per row, or a list unnested; #2422: the filters the panel shows// (app.js SELECTS), the file types apart (startFacets)4 unmodified linessize: 'sizeb',train: "UNNEST(CASE train WHEN 'yes' THEN ['yes', 'cond'] WHEN 'cond' THEN ['cond'] ELSE []::VARCHAR[] END)",pii: 'pii',};// clients that a filter's clause leaves out: the facet of that filter, and the chart that sets it (its marks and its1 unmodified line2345678910111213141516171819202122232425262728293031323334354 unmodified lines4041424344454647484932 unmodified lines828384858687888990919293949596979813 unmodified lines11211311411511611711811918 unmodified lines1381391401411421431441451461471481491504 unmodified lines1551561571581591601611621631641651661 unmodified line// the bars by domain and by form. One crossfilter selection holds the filters: a click on a bar or a map cell// and the filter panel set its clauses; the charts, the counts of the filter options, the tables behind the charts and// the list of selected sources all read it. app.js draws the rest of the page and loads this module after the first// screen has painted. Every chart draws the sources the clause kind selects, in its color and its measure: of one kind// of source (app.js oneKind) every source, in the main color, in sources, units or rows; of two layers one layer only// (#1083), material sets in the main color, in sets or units, corpora in gray, in rows, the two never stacked or// added. The same DuckDB-WASM holds meta/preview.parquet once a row's "Preview rows" first opens.// Standard tool: linked charts over one crossfilter selection by Mosaic vgplot (wasmConnector, DuckDB-WASM).import * as vg from 'https://cdn.jsdelivr.net/npm/@uwdata/vgplot@0.34.3/+esm';import { widest as measured } from './charts.js';// #2422: the page's colors in its theme (style.css), read when a chart is drawn, so a new theme draws them again// (app.js): each layer's color (data.js KINDS: --ours for material sets, --other for corpora; --ours for the one kind// of source, data.js SOURCE), the empty part of a map cell (--map-empty), the low end of a layer's color scale on the// map (--map-low-ours, --map-low-other: its color at 20% over the empty cell's, so a cell with a small count still// shows apart from an empty one) and the ink of the labelsconst css = (name) => getComputedStyle(document.documentElement).getPropertyValue(name).trim();const colors = () => ({ kind: { material_set: css('--ours'), corpus: css('--other'), source: css('--ours') }, empty: css('--map-empty'),low: { material_set: css('--map-low-ours'), corpus: css('--map-low-other'), source: css('--map-low-ours') }, ink: css('--ink-2') });export const sel = vg.Selection.crossfilter();// The page's own columns of every source (app.js pageRow, from data.js), joined to meta/catalog.parquet of the commit// the page reads. A domain key is a top-level code, _multi or _none (dkeys, a list); codes are the domain codes with// their leaves; hcol is the map's column (a form, _other or _none); kind is the layer, material_set or corpus, or of one// kind source for every source; collection is that of a material set or a source ('' for none); n_units counts the// units of a material set (of one kind, of every source) and n_rows the rows of a corpus (of one kind, of every source;// 0 for the other kind of two layers); #1524: exts are its file types and ext_rows the rows of each, in the same// order; #2006: stages are the ids of the training stages one of its units passes (the commit's stage figures); #2422: pii is its// personal-data mark (none, marked or unknown), sizeb the size class of its deduplicated size; fc_<facet> are its codes// on each facet of the catalog with every code above them in the facet's hierarchy. The view dom holds one// row per source and domain key (dkey): DuckDB does not take UNNEST next to an aggregate// in one SELECT, so the domain charts and their tables group dom by dkey.const SRC = `CREATE OR REPLACE TABLE src AS SELECT p.source, c.title,4 unmodified linesCAST(p.sizeb AS VARCHAR) AS sizeb, CAST(p.tier AS VARCHAR) AS tier,CAST(p.train AS VARCHAR) AS train, CAST(p.redist AS VARCHAR) AS redist, CAST(p.pii AS VARCHAR) AS pii,CAST(p.qtext AS VARCHAR) AS qtext,CAST(p.exts AS VARCHAR[]) AS exts, CAST(p.ext_rows AS DOUBLE[]) AS ext_rows, CAST(p.stages AS VARCHAR[]) AS stages,CAST(p.fc_subject AS VARCHAR[]) AS fc_subject, CAST(p.fc_industry AS VARCHAR[]) AS fc_industry,CAST(p.fc_occupation AS VARCHAR[]) AS fc_occupation, CAST(p.fc_business_process AS VARCHAR[]) AS fc_business_process,CAST(p.fc_resource_type AS VARCHAR[]) AS fc_resource_type, CAST(p.fc_file_format AS VARCHAR[]) AS fc_file_formatFROM page p LEFT JOIN catalog c USING (source)`;const DOM = 'CREATE OR REPLACE VIEW dom AS SELECT *, UNNEST(dkeys) AS dkey FROM src';// the page's DuckDB-WASM, once open32 unmodified linesreturn rows.toArray().map((r) => ({ ...r }));}// ---- the metric of the charts: sources (sets) or their units, or their rows (of two layers, material sets or their// units in the layer of material sets, the rows of corpora in theirs); its sum, and the same sum as text for the labels// at the bar endsconst AGG = { sets: () => vg.sum('n_src'), units: () => vg.sum('n_units'), rows: () => vg.sum('n_rows') };const LABEL = {sets: () => vg.sql`format('{:,}', CAST(sum(n_src) AS BIGINT))`,units: () => vg.sql`format('{:,}', CAST(sum(n_units) AS BIGINT))`,rows: () => vg.sql`format('{:,}', CAST(sum(n_rows) AS BIGINT))`,};// the columns of the tables behind the charts: their sources (n), their units and their rows (of two layers, the units// of material sets and the rows of corpora, 0 in the other layer)const SUMS = 'count(*) AS n, sum(n_units) AS units, sum(n_rows) AS rows';const whereOf = (filter) => (filter && filter.length ? `WHERE ${filter.map((p) => `(${p})`).join(' AND ')}` : '');13 unmodified linesconst connect = (client) => { vg.coordinator().connect(client); return client; };// ---- the filters: one clause source per filter, its predicate over srcconst KEYS = ['domain', 'leaf', 'form', 'collection', 'kind', 'status', 'train', 'redist', 'tier', 'size', 'q', 'ext', 'stage', 'pii','subject', 'industry', 'occupation', 'business_process', 'resource_type', 'file_format'];const SOURCES = Object.fromEntries(KEYS.map((k) => [k, { filter: k, reset() {} }]));// a clause that keeps every row, made the active clause last: the next round of queries then gives every client its// own predicate (a client of the active clause would be skipped). A new clause object each time, so the selection emits.18 unmodified linesstage: (v) => vg.sql`list_contains(stages, ${lit(v)})`,// #2422: the personal-data markpii: (v) => vg.sql`pii = ${lit(v)}`,// a code of a facet: a source with that code or one under itsubject: (v) => vg.sql`list_contains(fc_subject, ${lit(v)})`,industry: (v) => vg.sql`list_contains(fc_industry, ${lit(v)})`,occupation: (v) => vg.sql`list_contains(fc_occupation, ${lit(v)})`,business_process: (v) => vg.sql`list_contains(fc_business_process, ${lit(v)})`,resource_type: (v) => vg.sql`list_contains(fc_resource_type, ${lit(v)})`,file_format: (v) => vg.sql`list_contains(fc_file_format, ${lit(v)})`,};// what each filter's option counts are over: one value per row, or a list unnested; #2422: the filters the panel shows// (app.js SELECTS), the file types apart (startFacets)4 unmodified linessize: 'sizeb',train: "UNNEST(CASE train WHEN 'yes' THEN ['yes', 'cond'] WHEN 'cond' THEN ['cond'] ELSE []::VARCHAR[] END)",pii: 'pii',subject: 'UNNEST(fc_subject)',industry: 'UNNEST(fc_industry)',occupation: 'UNNEST(fc_occupation)',business_process: 'UNNEST(fc_business_process)',resource_type: 'UNNEST(fc_resource_type)',file_format: 'UNNEST(fc_file_format)',};// clients that a filter's clause leaves out: the facet of that filter, and the chart that sets it (its marks and its
1234567891011# Training Data Foundation: for agents- The index holds two layers over the same public web, kept apart and never added together. Each corpus is one whole upstream read in bulk and counted in rows; a material set is admitted for building tasks from works the search found upstream or from a group of corpus rows, its files checked and grouped into units, and it is counted in units, apart from any corpus its rows came from. Task material comes first: material sets, grouped into collections, one per task family. A material set (task-ready) is the units admitted from one source, which reads one upstream (one dataset or one data catalog), for building tasks (the catalog column `kind` is `material_set`, and `collection` names its collection). A unit is a group of files that its upstream publishes as one thing, delivered whole; its key `unit_id` is the `unit_group` its rows share (`extra.source_meta.unit_group`), defined once, in the glossary of the data page's manual, https://battam-training-data-foundation.static.hf.space/index.html?lng=en#manual/glossary . A unit is material, not a task: one unit may give several tasks, and one task may use several units. Corpora come second, to search when no material set fits: a corpus (raw; plural corpora) is one whole upstream that a collector keeps reading, such as Common Crawl's office documents, PyPI's release files, Mendeley Data or NVD: its rows are pointers to files or API responses, and it is counted in rows (`kind` is `corpus`); `tools/fetch.py` takes a corpus row by row, each under its own key as its `unit_id`.- Pick material sets or corpora from `meta/catalog.parquet` (one row per material set or corpus, about 50 KB; do not download `meta/` whole). Columns: `source`; `kind`, `material_set` or `corpus` (select one layer: units and rows are never added together); `collection`, the code of a material set's collection (every code with its name is in `meta/vocabulary.json`), or of the collection that lists a corpus as holding its kind of material (`corpora` in `meta/vocabulary.json`; empty for any other corpus); `domain`, a list of codes D1 to D10 or leaves such as D3.5, or `multi`, `unclassified`; `form`, such as `test-suites` or `spreadsheets`; `upstream_kind`, `upstream_agent` and `upstream_entry`, the source's upstream (`dataset` or `catalog`, its agent, and the address its reading starts from; a source that still reads several upstreams gives each, joined by ` | `); `units` (a material set's distinct `unit_id` values: a test case, one workbook, one package; a corpus is counted in rows, and gives the same number as `files`) and `files` (its rows: for a material set, the files of its units and its README.md and LICENSE); `publishers` (a material set's distinct publisher names over all its rows; empty when its rows name none); `language` (the language codes of the rows' labels, what the default profile filters on; `not recorded` when a row has none); `contamination.level` (by the rule of the default profile of `tools/fetch.py` over `meta/bench_overlap.parquet` and `meta/bench_checked.parquet`: `none` when every data file is compared and kept and no row is removed, the hit class with the most removed rows when some are removed, `not scanned` otherwise); `license.ship`; `pii.level`; `distinct_bytes` (deduplicated size) and `bytes` (recorded size, the sum over rows); `size_check` (the rows read in `meta/sizes.parquet`, `compared` those that compared a size or hash, and how many have each status, `match` when the measured size agrees; the check's share is `match` over `compared`), `unsized_rows` (rows without a recorded size) and `unsized_estimate` (their estimated size, with its 95% range); `fetch_check` (whether the upstream still serves the files: `rows`, the sampled rows read in `meta/sizes.parquet`; `fetched`, those that fetched and matched their recorded size and hash; `read_at`, the day read; `level`, `all`, `some`, `none`, `needs auth` (no row read fetched, and the source's rows need the paying or signed-in reader its `needs_auth` names, which the check, reading anonymously, does not have) or `not read`); the same figures for the whole index, each layer and each collection are in `meta/size_figures.json`. Who published each file of a material set, and under which license and license URL, is in `meta/attribution.parquet` (one row per source, publisher, license and license URL, with its number of files). The vocabulary is `meta/vocabulary.json`: every domain code with its name (and `zh`, its Chinese name), what it covers and its parent, every form with its Chinese name and what it means, every category of `meta/not_included.parquet` with its requirement in English and in Chinese, the two layers with their relation, and every collection with its name, what it holds, its campaigns (take a collection with `--tag campaign:<name>` for each of its campaigns) and the corpora it lists, if any (take one with `--source`), and the criteria the default profile of `tools/fetch.py` applies, in its order (`profile`, each with the option that keeps what it removes).- Size of this release: Whole index: Recorded size 4.47 PB; deduplicated size 4.15 PB; size check: 99.3% match (35,825 of the 38,519 rows read compared); not compared: address unreachable 145, file gone 167, login needed 526, no size from the server 1,851, other error 5; estimated size of 279,904,983 of the 291,042,254 rows without a recorded size: 514 TB (an estimate; 95% range 252 TB to 1.05 PB, the sum of its sources' ranges, wider than a joint interval; from 4,306 rows read), the other 11,137,271 with too few rows read for an estimate. Task material: Recorded size 36.0 GB; deduplicated size 35.9 GB; size check: 99.2% match (11,918 of the 11,936 rows read compared); not compared: address unreachable 2, file gone 3, login needed 10, other error 3. Corpora: Recorded size 4.47 PB; deduplicated size 4.15 PB; size check: 99.4% match (23,907 of the 26,583 rows read compared); not compared: address unreachable 143, file gone 164, login needed 516, no size from the server 1,851, other error 2; estimated size of 279,904,983 of the 291,042,254 rows without a recorded size: 514 TB (an estimate; 95% range 252 TB to 1.05 PB, the sum of its sources' ranges, wider than a joint interval; from 4,306 rows read), the other 11,137,271 with too few rows read for an estimate. Distinct content is the sum of `size_bytes` over the rows minus the sizes of the rows that repeat another row's content (the same sha256, else sha1, else md5 and size, within the same hash scope; one copy of each content is kept, in the first source by registry order), counted after each release over the data files it published, per source in the catalog column `distinct_bytes`; archive members whose archive the same source also lists whole have other hashes, so they are not subtracted. `tools/fetch.py` removes duplicates over your own selection when it reads it. The deduplicated sizes here were counted over the data files of release `release-2026-11-21.1`. The recorded size is the sum of `size_bytes` over the rows that have one (catalog column `bytes`). The check reads a sample of rows of every data file (`meta/sizes.parquet`), each day the files with rows of a source not read there yet and those of the sources read longest ago, about a seventh of all the readings, so each is read again within a week: 20 of its rows with a recorded size of each source whose rows it holds, and of its rows without one its share of its source's sample, sized for their mean size within 25% at 95% confidence by the spread of the sizes read so far (at most 400 rows per source per round, 20 for a source with none read yet); its share is the rows that match their recorded size out of the rows it compared (status `match`, `size_mismatch` or `hash_mismatch`), and the rows it could not compare, which never reached their file, are counted beside it by status (`unreachable`, `gone`, `needs_auth`, `no_length`, `error`; catalog column `size_check`). The estimate for a source's rows without a recorded size (catalog columns `unsized_rows` and `unsized_estimate`) is their number times the mean measured size of such rows read, with a 95% BCa bootstrap range (`scipy.stats.bootstrap`, its default resample count); a source with fewer than 10 such rows read has none. Above one source, the estimate is the sum of its sources' estimates and its range the sum of their ranges, which is wider than a joint interval. The figures of every level are in `meta/size_figures.json`.- Fetch with one command: `uv run https://huggingface.co/datasets/Battam/training-data-foundation/resolve/main/tools/fetch.py --kind material_set --domain D3 --form spreadsheets --out ./data` takes those material sets whole, as the data page does unless told otherwise; take a corpus, whose whole can be petabytes, with `--sample N` (the data page takes 3 units of each by default) or `--limit N`. Without uv: `pip install duckdb`, download `tools/fetch.py` and run it with `python`. Select with `--source`, `--kind` (`material_set` or `corpus`: one layer), `--domain`, `--form`, `--tag`, `--ext`, or `--selection <file>` (a selection file the data page saves: the ids of its sources and its commit); `--sample N` takes at most N units per source, `--limit N` takes N units over the whole selection, `--unit <unit_id>` takes the unit of that `unit_id` whole (with `--source`); `--kind corpus --leaf <code>` takes the corpus units whose label for that leaf (such as `D2.3`) is at or above its threshold in `meta/labels.json`, read from `labels/<source>/` at the same commit (`--min-score X` sets another bar; `--sample`, `--seed` and `--limit` work over them as over any units); before its first download the run prints the units, files and total size it selected.- It pins the commit it reads and prints it; pass `--revision <commit>` to get the same files later. A name that does not exist stops with exit code 2 and the closest names.- The default profile removes duplicate copies, rows that matched a benchmark (copies of benchmark data, rows of groupings awaiting a ruling), rows not compared with the benchmark list yet (counted apart, with their own reason), rows recorded in a language other than English, files above 20 MB, and rows that the release's fetch check read and found refused by their site (HTTP 401 or 403, a login, or an empty or short body). Before downloading it prints how many units each criterion removed; each criterion has its own option (`--keep-duplicates`, `--allow-benchmark`, `--allow-not-compared`, `--any-language`, `--any-size`, `--allow-refused`; `--allow-benchmark` also keeps rows not compared yet), and `--all` turns off every criterion except benchmark and not compared, so rows that matched a benchmark or were not compared yet come in only with their own options. The license and the personal-data mark are labels of every row, not filters: by default every row comes, and two options leave rows out only when given, `--training-only` the files whose license does not allow shipping (license.ship yes and conditional stay) and `--no-personal-data` personal data (catalog pii.level present or suspected, rows marked sensitive). Compared with the benchmark list (keys of 2026-11-12): 2,222 of 2,222 material sets; 215 of 215 corpora. The profile also removes every row whose data file was not compared (`--allow-benchmark` keeps them, unchecked).- Output: `./data/<domain>/<source>/<unit folder>/...` holds each unit whole, in a folder of its own named after its `unit_id`, its files at their paths within the unit; `./data/<domain>/<source>/` also holds the README.md and LICENSE of a material set; `./data/_meta/manifest.jsonl` has one line per file (source, path, url, sha256, bytes, spdx, licence_url, publisher, retrieved, origin_kind, leaf, unit_id, verified); `./data/_meta/sizes.tsv` one line per source. Every file is checked against the sha256 the index records. A unit stored inside a container (such as a disk image inside a zip) is written as the unit itself: fetch.py takes the member out and checks it against the unit's recorded sha256, so no second tool is needed; only units marked expand (archives meant to be used as folders) are unpacked by `tools/to_pool.py`.- The index holds material only: what a task checks is decided when the task is built from the material. Keep out of the environment the agent works in whatever the task checks its result against:- Workbooks (such as the form `spreadsheets`): a published workbook holds the cached results of its formulas, so a workbook put in as fetched hands the agent the values a task may ask it to compute. Strip the cached values first: in .xlsx and .xlsm the `<v>` of every formula cell (`xl/worksheets/*.xml`), the chart caches (`c:numCache` and `c:strCache` in `xl/charts/*.xml`), the pivot caches (`xl/pivotCache/`, definitions and records) and the external link caches (`xl/externalLinks/`); in .ods the value attributes (`office:value` and the like) and the text of formula cells; in .xls the cached result of every FORMULA record and its STRING record.1234567891011# Training Data Foundation: for agents- The index holds sources of one kind over the same public web, each reading one upstream (one dataset or one data catalog). Every source is of one kind, and a unit is task material for a leaf through its labels, each of one method (agent or classifier); a source whose units an agent chose for a leaf (a material set) is counted in units, and every other source (a corpus, one whole upstream read in bulk) in rows, so units and rows are never added together. A unit is task material for a leaf of the domain grid through its labels (`meta/labels.json` and `labels/<source>/`), each with its method: `agent`, a unit an agent judged one by one usable for the leaf (every unit of a source an agent chose for a leaf, a material set, which `collection` names the collection of, one per task family; and the units of other sources the agents judged), and `classifier`, a classifier's score for the leaf, counted at or above the leaf's threshold. A unit is a group of files that its upstream publishes as one thing, delivered whole; its key `unit_id` is the `unit_group` its rows share (`extra.source_meta.unit_group`), defined once, in the glossary of the data page's manual, https://battam-training-data-foundation.static.hf.space/index.html?lng=en#manual/glossary . A unit is material, not a task: one unit may give several tasks, and one task may use several units. A corpus (plural corpora) is a source that is one whole upstream a collector keeps reading, such as Common Crawl's office documents, PyPI's release files, Mendeley Data or NVD: its rows are pointers to files or API responses, and it is counted in rows; `tools/fetch.py` takes a corpus row by row, each under its own key as its `unit_id`.- Pick sources from `meta/catalog.parquet` (one row per source, about 50 KB; do not download `meta/` whole), or units by label with `--leaf`. Columns: `source`; `collection`, the code of a material set's collection (every code with its name is in `meta/vocabulary.json`), or of the collection that lists a corpus as holding its kind of material (`corpora` in `meta/vocabulary.json`; empty for any other corpus); `domain`, a list of codes D1 to D10 or leaves such as D3.5, or `multi`, `unclassified`; `form`, such as `test-suites` or `spreadsheets`; `upstream_kind`, `upstream_agent` and `upstream_entry`, the source's upstream (`dataset` or `catalog`, its agent, and the address its reading starts from; a source that still reads several upstreams gives each, joined by ` | `); `units` (a material set's distinct `unit_id` values: a test case, one workbook, one package; a corpus is counted in rows, and gives the same number as `files`) and `files` (its rows: for a material set, the files of its units and its README.md and LICENSE); `publishers` (a material set's distinct publisher names over all its rows; empty when its rows name none); `language` (the language codes of the rows' labels, what the default profile filters on; `not recorded` when a row has none); `contamination.level` (by the rule of the default profile of `tools/fetch.py` over `meta/bench_overlap.parquet` and `meta/bench_checked.parquet`: `none` when every data file is compared and kept and no row is removed, the hit class with the most removed rows when some are removed, `not scanned` otherwise); `license.ship`; `pii.level`; `distinct_bytes` (deduplicated size) and `bytes` (recorded size, the sum over rows); `size_check` (the rows read in `meta/sizes.parquet`, `compared` those that compared a size or hash, and how many have each status, `match` when the measured size agrees; the check's share is `match` over `compared`), `unsized_rows` (rows without a recorded size) and `unsized_estimate` (their estimated size, with its 95% range); `fetch_check` (whether the upstream still serves the files: `rows`, the sampled rows read in `meta/sizes.parquet`; `fetched`, those that fetched and matched their recorded size and hash; `read_at`, the day read; `level`, `all`, `some`, `none`, `needs auth` (no row read fetched, and the source's rows need the paying or signed-in reader its `needs_auth` names, which the check, reading anonymously, does not have) or `not read`); the same figures for the whole index, each layer and each collection are in `meta/size_figures.json`. Who published each file of a material set, and under which license and license URL, is in `meta/attribution.parquet` (one row per source, publisher, license and license URL, with its number of files). The vocabulary is `meta/vocabulary.json`: every domain code with its name (and `zh`, its Chinese name), what it covers and its parent, every form with its Chinese name and what it means, every category of `meta/not_included.parquet` with its requirement in English and in Chinese, the two layers with their relation, and every collection with its name, what it holds, its campaigns (take a collection with `--tag campaign:<name>` for each of its campaigns) and the corpora it lists, if any (take one with `--source`), and the criteria the default profile of `tools/fetch.py` applies, in its order (`profile`, each with the option that keeps what it removes).- Size of this release: Whole index: Recorded size 6.32 PB; deduplicated size 5.84 PB; size check: 99.3% match (35,889 of the 38,608 rows read compared); not compared: address unreachable 145, file gone 167, login needed 526, no size from the server 1,876, other error 5; estimated size of 279,904,705 of the 298,463,449 rows without a recorded size: 514 TB (an estimate; 95% range 252 TB to 1.05 PB, the sum of its sources' ranges, wider than a joint interval; from 4,334 rows read), the other 18,558,744 with too few rows read for an estimate. Task material: Recorded size 36.0 GB; deduplicated size 35.9 GB; size check: 99.2% match (11,918 of the 11,936 rows read compared); not compared: address unreachable 2, file gone 3, login needed 10, other error 3; 9 rows without a recorded size, too few of them read for an estimate. Corpora: Recorded size 6.32 PB; deduplicated size 5.84 PB; size check: 99.4% match (23,971 of the 26,672 rows read compared); not compared: address unreachable 143, file gone 164, login needed 516, no size from the server 1,876, other error 2; estimated size of 279,904,705 of the 298,463,440 rows without a recorded size: 514 TB (an estimate; 95% range 252 TB to 1.05 PB, the sum of its sources' ranges, wider than a joint interval; from 4,334 rows read), the other 18,558,735 with too few rows read for an estimate. Distinct content is the sum of `size_bytes` over the rows minus the sizes of the rows that repeat another row's content (the same sha256, else sha1, else md5 and size, within the same hash scope; one copy of each content is kept, in the first source by registry order), counted after each release over the data files it published, per source in the catalog column `distinct_bytes`; archive members whose archive the same source also lists whole have other hashes, so they are not subtracted. `tools/fetch.py` removes duplicates over your own selection when it reads it. The deduplicated sizes here were counted over the data files of `release-2026-11-21.3`: a release tag, or `<tag>.p<n>`, main as the publish that brought its rows to version n after that tag left it. The recorded size is the sum of `size_bytes` over the rows that have one (catalog column `bytes`). The check reads a sample of rows of every data file (`meta/sizes.parquet`), each day the files with rows of a source not read there yet and those of the sources read longest ago, about a seventh of all the readings, so each is read again within a week: 20 of its rows with a recorded size of each source whose rows it holds, and of its rows without one its share of its source's sample, sized for their mean size within 25% at 95% confidence by the spread of the sizes read so far (at most 400 rows per source per round, 20 for a source with none read yet); its share is the rows that match their recorded size out of the rows it compared (status `match`, `size_mismatch` or `hash_mismatch`), and the rows it could not compare, which never reached their file, are counted beside it by status (`unreachable`, `gone`, `needs_auth`, `no_length`, `error`; catalog column `size_check`). The estimate for a source's rows without a recorded size (catalog columns `unsized_rows` and `unsized_estimate`) is their number times the mean measured size of such rows read, with a 95% BCa bootstrap range (`scipy.stats.bootstrap`, its default resample count); a source with fewer than 10 such rows read has none. Above one source, the estimate is the sum of its sources' estimates and its range the sum of their ranges, which is wider than a joint interval. The figures of every level are in `meta/size_figures.json`.- Fetch with one command: `uv run https://huggingface.co/datasets/Battam/training-data-foundation/resolve/main/tools/fetch.py --domain D3 --form spreadsheets --sample 3 --out ./data` takes three units of each of those sources; a corpus's whole can be petabytes, so take one with `--sample N` (the data page takes 3 units of each by default) or `--limit N`. Without uv: `pip install duckdb`, download `tools/fetch.py` and run it with `python`. Select with `--source`, `--leaf <code>` (the units labelled for that leaf), `--domain`, `--form`, `--tag`, `--ext`, or `--selection <file>` (a selection file the data page saves: the ids of its sources and its commit); `--sample N` takes at most N units per source, `--limit N` takes N units over the whole selection, `--unit <unit_id>` takes the unit of that `unit_id` whole (with `--source`); `--leaf <code>` takes the units labelled for that leaf (such as `D2.3`; a top-level code such as `D2` also takes those of every leaf under it), of every source: an `agent` label always counts, a `classifier` label at or above its leaf's threshold in `meta/labels.json`, `--method` keeps the labels of one method or more, and the labels are read from `labels/<source>/` at the same commit (`--min-score X` sets another bar; `--sample`, `--seed` and `--limit` work over them as over any units); before its first download the run prints the units, files and total size it selected.- It pins the commit it reads and prints it; pass `--revision <commit>` to get the same files later. A name that does not exist stops with exit code 2 and the closest names.- The default profile removes duplicate copies, rows that matched a benchmark (copies of benchmark data, rows of groupings awaiting a ruling), rows not compared with the benchmark list yet (counted apart, with their own reason), rows recorded in a language other than English, and files above 20 MB. Before downloading it prints how many units each criterion removed; each criterion has its own option (`--keep-duplicates`, `--allow-benchmark`, `--allow-not-compared`, `--any-language`, `--any-size`; `--allow-benchmark` also keeps rows not compared yet), and `--all` turns off every criterion except benchmark and not compared, so rows that matched a benchmark or were not compared yet come in only with their own options. The license, the personal-data mark and the fetch check's reading are labels of every row, not filters: by default every row comes, and three options leave rows out only when given, `--training-only` the files whose license does not allow shipping (license.ship yes and conditional stay), `--no-personal-data` personal data (catalog pii.level present or suspected, rows marked sensitive), and `--no-refused` the rows that the release's fetch check read and found refused by their site (HTTP 401 or 403, a login, or an empty or short body). Compared with the benchmark list (keys of 2026-11-18): 2,222 of 2,223 material sets; 141 of 289 corpora. The profile also removes every row whose data file was not compared (`--allow-benchmark` keeps them, unchecked).- Output: `./data/<domain>/<source>/<unit folder>/...` holds each unit whole, in a folder of its own named after its `unit_id`, its files at their paths within the unit; `./data/<domain>/<source>/` also holds the README.md and LICENSE of a material set; `./data/_meta/manifest.jsonl` has one line per file (source, path, url, sha256, bytes, spdx, licence_url, publisher, retrieved, origin_kind, leaf, unit_id, verified); `./data/_meta/sizes.tsv` one line per source. Every file is checked against the sha256 the index records. A unit stored inside a container (such as a disk image inside a zip) is written as the unit itself: fetch.py takes the member out and checks it against the unit's recorded sha256, so no second tool is needed; only units marked expand (archives meant to be used as folders) are unpacked by `tools/to_pool.py`.- The index holds material only: what a task checks is decided when the task is built from the material. Keep out of the environment the agent works in whatever the task checks its result against:- Workbooks (such as the form `spreadsheets`): a published workbook holds the cached results of its formulas, so a workbook put in as fetched hands the agent the values a task may ask it to compute. Strip the cached values first: in .xlsx and .xlsm the `<v>` of every formula cell (`xl/worksheets/*.xml`), the chart caches (`c:numCache` and `c:strCache` in `xl/charts/*.xml`), the pivot caches (`xl/pivotCache/`, definitions and records) and the external link caches (`xl/externalLinks/`); in .ods the value attributes (`office:value` and the like) and the text of formula cells; in .xls the cached result of every FORMULA record and its STRING record.
25 unmodified lines2627282930313233343536373839404142434445464748495011 unmodified lines62636465666751 unmodified lines11912012112212312485 unmodified lines2102112122132142156 unmodified lines22222322422522622722822923023123210 unmodified lines24324424524624724823 unmodified lines27227327427527627715 unmodified lines2932942952962972981 unmodified line30030130230330430556 unmodified lines36236336436536636766 unmodified lines4344354364374384396 unmodified lines44644744844945045113 unmodified lines46546646746846947047147247347447547629 unmodified lines50650750850951051151211 unmodified lines52452552652752825 unmodified lines"field.legendHalf": "kept, in the other layer","field.legendOff": "filtered out","strata.rest": "In no stage","strata.restTitle": "Sources none of whose units a stage counts, and the units or rows the stages leave out: they did not meet the condition, a rule removed them, or the release has not counted them yet. They are in the index like the others and can be taken the same way.","strata.restUnits_one": "{{n}} unit in no stage","strata.restUnits_other": "{{n}} units in no stage","strata.restRows_one": "{{n}} corpus row in no stage","strata.restRows_other": "{{n}} corpus rows in no stage","strata.whyUnits": "Units: {{list}}","strata.whyRows": "Corpus rows: {{list}}","strata.why.condition_one": "{{n}} did not meet the condition","strata.why.condition_other": "{{n}} did not meet the condition","strata.why.benchmark_one": "{{n}} overlaps a benchmark","strata.why.benchmark_other": "{{n}} overlap a benchmark","strata.why.notCompared_one": "{{n}} not compared with the benchmarks yet","strata.why.notCompared_other": "{{n}} not compared with the benchmarks yet","strata.why.duplicate_one": "{{n}} duplicate","strata.why.duplicate_other": "{{n}} duplicates","strata.why.notCounted_one": "{{n}} not counted yet","strata.why.notCounted_other": "{{n}} not counted yet","strata.why.other_one": "{{n}} {{why}}","strata.why.other_other": "{{n}} {{why}}","strata.domains_one": "domain","strata.domains_other": "domains","strata.all": "All {{n}} in the list below",11 unmodified lines"hero.lede": "Real public data for pre-training, mid-training and post-training: each file with its address, size, hashes and license, fetched with one command.","release.all": "All releases","hero.preview": "Preview data","link.dataset": "Dataset","link.fields": "Index fields",51 unmodified lines"n.pointerRow_other": "{{n}} pointer rows","n.rowsCompact_one": "{{n}} row","n.rowsCompact_other": "{{n}} rows","name.notClassified": "Not classified","name.noCollection": "No collection",85 unmodified lines"cat.lead.ready_other": "units","cat.lead.raw_one": "row in corpora","cat.lead.raw_other": "rows in corpora","coll.open": "Open its material sets","coll.showing": "Showing its material sets",6 unmodified lines"th.domain": "Domain","th.leaf": "Leaf","fewest.title": "Leaves with the fewest units","fewest.text": "The leaves of the domain grid whose material sets hold the fewest units, the fewest first: the leaves the data foundation promotes corpus rows into material sets for first.","leaves.title": "Units by leaf","leaves.text": "Every leaf of the domain grid with its units by method: agent, the units of the material sets whose domain holds the leaf, each chosen by an agent, and classifier, the corpus units scored by a classifier at or above the leaf's threshold, then the classifier's units by class. Each row's command takes the leaf's classifier units straight from the corpora (--kind corpus --leaf).","leaves.model": "Labels by {{model}}.","leaves.noLabels": "This commit carries no labels of corpus units yet.","th.agent": "Units chosen by an agent","th.classifier": "Units scored by a classifier","th.threshold": "Threshold",10 unmodified lines"th.state": "State","th.address": "Address","th.size": "Size","filter.title": "Filters","filter.noneOn": "none on",23 unmodified lines"filter.ext": "File type","filter.extNone": "No file type in this selection","filter.optCount": "{{name}} ({{n}})","chip.selection": "Selection","chip.none": "Whole index","chip.remove": "Remove {{k}}: {{v}}",15 unmodified lines"metric.sets": "Material sets","metric.units": "Units","metric.rows": "Corpus rows","map.units_one": "{{n}} unit","map.units_other": "{{n}} units","map.rows_one": "{{n}} corpus row",1 unmodified line"map.nothing": "Nothing matches","map.head": "{{amount}}, {{domains}}","map.title": "{{metric}}: domain × form","col.title": "Source","col.domain": "Domain",56 unmodified lines"detail.files": "Units and files","detail.from": "Comes from","detail.upstream": "Upstream","upstreamKind.dataset": "Dataset","upstreamKind.catalog": "Data catalog","detail.publishers_one": "{{n}} publisher; main site",66 unmodified lines"stage.noFigures": "No stage figures in this release yet (meta/stage_figures.json): the filter by stage is off.","stage.noSources": "This release's stage figures do not list each source's stages yet: the filter by stage is off.","stage.notCounted": "This release has no stage fields yet: the filter by stage is off.","status.flagged": "Flagged, not usable as it is","fetch.all": "All {{rows}} sampled rows read fetched and matched their recorded size and hash (read {{date}}).","fetch.some": "{{fetched}} of the {{rows}} sampled rows read ({{share}}) fetched and matched their recorded size and hash (read {{date}}); the others did not.",6 unmodified lines"detail.takeWholeNoSize": "The whole material set: {{units}}","detail.more": "Batches and first rows","detail.notCounted": "not counted","get.nothing": "Nothing to take","get.takeOne_one": "Get at most {{count}} unit",13 unmodified lines"get.change": "Change filters","get.take": "Take","get.sql": "DuckDB SQL, pinned to the commit","sql.headSets": "Training Data Foundation @ {{sha}}: {{sets}} ({{units}})","sql.headCorpora": "Training Data Foundation @ {{sha}}: {{corpora}} ({{rows}})","sql.all": "no filter","sql.noProfile": "Rows as published: this query applies no rule of the default profile of tools/fetch.py (no deduplication; benchmark copies, rows not compared with the benchmark list, languages other than English and files over 20 MB all stay in); the command applies them. Rows of any license and rows marked as carrying personal data stay in with either.","sql.catalogNoProfile": "Every source of the catalog as published: the default profile of tools/fetch.py is not applied here; the command applies it.","sql.chip": "{{k}}: {{v}}","csv.progress_one": "{{done}}/{{n}} file","csv.progress_other": "{{done}}/{{n}} files","csv.button": "CSV · {{rows}}",29 unmodified lines"tree.domainNote": ": such as D3_data or D3","tree.leftOut": "Left out by default","tree.flagNote": "Add the flag beside an item to the command to take it.","tree.labelNote": "Rows of any license and rows with personal data come by default; to leave them out, add","profile.duplicate": "Duplicates","profile.benchmark": "Benchmark copies","profile.not compared": "Not compared with the benchmark list",11 unmodified lines"manual.back": "Back to the page","manual.contents": "Contents","manual.loading": "Loading the manual…","manual.missing": "The manual is not on this page yet: {{error}}"}25 unmodified lines26272829303111 unmodified lines434445464748495051 unmodified lines10210310410510610710810985 unmodified lines1951961971981992002012026 unmodified lines20921021121221321421521621721821922022122222322422522622722822923010 unmodified lines24124224324424524624723 unmodified lines27127227327427527627727827928028128228328428515 unmodified lines3013023033043053063073081 unmodified line31031131231331431531631756 unmodified lines37437537637737837938066 unmodified lines4474484494504514524534544554564574584594604614624634644654664674684696 unmodified lines47647747847948048148248313 unmodified lines49749849950050150250350450550650750850951051129 unmodified lines54154254354454554654711 unmodified lines55956056156256356456525 unmodified lines"field.legendHalf": "kept, in the other layer","field.legendOff": "filtered out","strata.rest": "In no stage","strata.domains_one": "domain","strata.domains_other": "domains","strata.all": "All {{n}} in the list below",11 unmodified lines"hero.lede": "Real public data for pre-training, mid-training and post-training: each file with its address, size, hashes and license, fetched with one command.","release.all": "All releases","release.countedOn": "figures counted on","release.notCounted": "figures not counted yet","hero.preview": "Preview data","link.dataset": "Dataset","link.fields": "Index fields",51 unmodified lines"n.pointerRow_other": "{{n}} pointer rows","n.rowsCompact_one": "{{n}} row","n.rowsCompact_other": "{{n}} rows","n.source_one": "{{n}} source","n.source_other": "{{n}} sources","name.notClassified": "Not classified","name.noCollection": "No collection",85 unmodified lines"cat.lead.ready_other": "units","cat.lead.raw_one": "row in corpora","cat.lead.raw_other": "rows in corpora","cat.lead.rows_one": "row","cat.lead.rows_other": "rows","coll.open": "Open its material sets","coll.showing": "Showing its material sets",6 unmodified lines"th.domain": "Domain","th.leaf": "Leaf","fewest.title": "Leaves with the fewest units","fewest.text": "The leaves of the domain grid with the fewest units labelled for them by any method, the fewest first.","fewest.textSets": "The leaves of the domain grid whose material sets hold the fewest units, the fewest first.","leaves.title": "Units by leaf","leaves.text": "Every leaf of the domain grid with its units labelled by any method and by each method: agent (judged one by one usable for the leaf by an agent) and classifier (scored at or above the leaf's threshold, shown beside it); then its units by class. Each row's command takes the leaf's labelled units from every source (--leaf), by the method chosen above the table (--method).","leaves.model": "Labels by {{model}}.","leaves.noLabels": "This commit carries no labels of units yet.","leaves.method": "Method the commands take","leaves.methodAll": "Every method","leaves.textClassifier": "Every leaf of the domain grid with its units by method: agent, the units of the material sets whose domain holds the leaf, each chosen by an agent, and classifier, the corpus units scored by a classifier at or above the leaf's threshold, then the classifier's units by class. Each row's command takes the leaf's classifier units straight from the corpora (--kind corpus --leaf).","kinds.title": "Units by kind of source and by class","kinds.text": "Every source of this commit, whatever its status, by its kind of source (catalog/source_kinds.tsv) and by the class of its form (catalog/stages.yaml): its material sets with their units, and its corpora with their units, a corpus counting its rows. The units of the two layers are never added together.","kinds.none": "This commit's projection gives no counts by kind of source yet.","th.kind": "Kind of source","th.class": "Class","th.sources": "Sources","th.corpusUnits": "Corpus units","th.agent": "Units chosen by an agent","th.classifier": "Units scored by a classifier","th.threshold": "Threshold",10 unmodified lines"th.state": "State","th.address": "Address","th.size": "Size","th.sources": "Sources","filter.title": "Filters","filter.noneOn": "none on",23 unmodified lines"filter.ext": "File type","filter.extNone": "No file type in this selection","filter.optCount": "{{name}} ({{n}})","filter.facets": "By standard","facet.subject": "Subject","facet.industry": "Industry","facet.occupation": "Occupation and work","facet.business_process": "Business process","facet.resource_type": "Resource type","facet.file_format": "File format","facet.multi": "Spans the facet","facet.codePage": "{code} at the standard's source","chip.selection": "Selection","chip.none": "Whole index","chip.remove": "Remove {{k}}: {{v}}",15 unmodified lines"metric.sets": "Material sets","metric.units": "Units","metric.rows": "Corpus rows","metric.allRows": "Rows","metric.sources": "Sources","map.units_one": "{{n}} unit","map.units_other": "{{n}} units","map.rows_one": "{{n}} corpus row",1 unmodified line"map.nothing": "Nothing matches","map.head": "{{amount}}, {{domains}}","map.title": "{{metric}}: domain × form","map.allRows_one": "{{n}} row","map.allRows_other": "{{n}} rows","col.title": "Source","col.domain": "Domain",56 unmodified lines"detail.files": "Units and files","detail.from": "Comes from","detail.upstream": "Upstream","detail.card": "Card","upstreamKind.dataset": "Dataset","upstreamKind.catalog": "Data catalog","detail.publishers_one": "{{n}} publisher; main site",66 unmodified lines"stage.noFigures": "No stage figures in this release yet (meta/stage_figures.json): the filter by stage is off.","stage.noSources": "This release's stage figures do not list each source's stages yet: the filter by stage is off.","stage.notCounted": "This release has no stage fields yet: the filter by stage is off.","stage.countedBy": "Counted: {{list}}","stage.beside": "Beside the count, not in it: {{list}}","stage.agentLayers": "({{sets}} of material sets, {{judged}} judged corpus units)","stage.scored": "Classifier units of the {{n}} of {{m}} data files scored so far, by model {{model}}","stage.precision": "classifier precision {{p}} (95% interval {{low}} to {{high}}) at the thresholds of {{leaves}} leaves, on {{above}} held-out judgments","stage.precisionNone": "classifier precision not measured yet: no leaf has a threshold","stage.method.agent": "agent {{n}}","stage.method.classifier": "classifier {{n}}","stage.method.rule": "rules {{n}}","stage.status.notJudged": "not yet judged {{n}}","stage.status.below": "below threshold {{n}}","stage.status.duplicate": "duplicate {{n}}","stage.status.benchmark": "overlapping a benchmark {{n}}","stage.status.unsized": "size not recorded {{n}}","stage.status.archive": "archives of recorded members {{n}}","stage.byMethod_one": "{{method}}: {{n}} unit","stage.byMethod_other": "{{method}}: {{n}} units","status.flagged": "Flagged, not usable as it is","fetch.all": "All {{rows}} sampled rows read fetched and matched their recorded size and hash (read {{date}}).","fetch.some": "{{fetched}} of the {{rows}} sampled rows read ({{share}}) fetched and matched their recorded size and hash (read {{date}}); the others did not.",6 unmodified lines"detail.takeWholeNoSize": "The whole material set: {{units}}","detail.more": "Batches and first rows","detail.notCounted": "not counted","detail.labelsFirstMethod": "The labels of its first {{n}} units, each a classifier's score (in bold at or above its leaf's threshold) or the method agent","detail.unitsRows": "Units and rows","get.nothing": "Nothing to take","get.takeOne_one": "Get at most {{count}} unit",13 unmodified lines"get.change": "Change filters","get.take": "Take","get.sql": "DuckDB SQL, pinned to the commit","get.sourceWord_one": "source","get.sourceWord_other": "sources","sql.headSets": "Training Data Foundation @ {{sha}}: {{sets}} ({{units}})","sql.headCorpora": "Training Data Foundation @ {{sha}}: {{corpora}} ({{rows}})","sql.all": "no filter","sql.noProfile": "Rows as published: this query applies no rule of the default profile of tools/fetch.py (no deduplication; benchmark copies, rows not compared with the benchmark list, languages other than English and files over 20 MB all stay in); the command applies them. Rows of any license and rows marked as carrying personal data stay in with either.","sql.catalogNoProfile": "Every source of the catalog as published: the default profile of tools/fetch.py is not applied here; the command applies it.","sql.chip": "{{k}}: {{v}}","sql.headSources": "Training Data Foundation @ {{sha}}: {{sources}} ({{units}}, {{rows}})","csv.progress_one": "{{done}}/{{n}} file","csv.progress_other": "{{done}}/{{n}} files","csv.button": "CSV · {{rows}}",29 unmodified lines"tree.domainNote": ": such as D3_data or D3","tree.leftOut": "Left out by default","tree.flagNote": "Add the flag beside an item to the command to take it.","tree.labelNote": "Rows of any license, rows with personal data and rows the fetch check found refused by their site come by default; to leave them out, add","profile.duplicate": "Duplicates","profile.benchmark": "Benchmark copies","profile.not compared": "Not compared with the benchmark list",11 unmodified lines"manual.back": "Back to the page","manual.contents": "Contents","manual.loading": "Loading the manual…","manual.missing": "The manual is not on this page yet: {{error}}","method.agent": "Agent","method.classifier": "Classifier"}
25 unmodified lines262728293031323334353637383940414210 unmodified lines53545556575841 unmodified lines10010110210310410577 unmodified lines1831841851861871884 unmodified lines19319419519619719819920020120220310 unmodified lines21421521621721821922 unmodified lines24224324424524624715 unmodified lines26326426526626726826927027127227354 unmodified lines32832933033133233354 unmodified lines3883893903913923936 unmodified lines4004014024034044059 unmodified lines41541641741841942042142242342442542625 unmodified lines45245345445545645745811 unmodified lines47047147247347425 unmodified lines"field.legendHalf": "符合筛选,在另一层","field.legendOff": "被筛掉","strata.rest": "未归入任何阶段","strata.restTitle": "没有任何单元被哪个阶段计入的来源,以及各阶段没有计入的单元或行:它们没有满足条件、被某条规则去掉,或者这次发布还没有计数。它们和别的来源一样在索引里,取法也一样。","strata.restUnits_other": "{{n}} 个单元不在任何阶段中","strata.restRows_other": "{{n}} 行语料库数据不在任何阶段中","strata.whyUnits": "单元:{{list}}","strata.whyRows": "语料库行:{{list}}","strata.why.condition_other": "未满足条件 {{n}}","strata.why.benchmark_other": "与基准测试重叠 {{n}}","strata.why.notCompared_other": "尚未与基准测试比对 {{n}}","strata.why.duplicate_other": "重复 {{n}}","strata.why.notCounted_other": "尚未计数 {{n}}","strata.why.other_other": "{{why}} {{n}}","strata.domains_other": "个领域","strata.all": "全部 {{n}} 个见下方列表","strata.table": "下方列表有全部列",10 unmodified lines"hero.lede": "面向预训练、中训练和后训练的真实公开数据:每个文件都带地址、大小、哈希和许可证,一条命令即可获取。","release.all": "全部发布","hero.preview": "预览数据","link.dataset": "数据集","link.fields": "索引字段",41 unmodified lines"n.publisher_other": "{{n}} 个发布方","n.pointerRow_other": "{{n}} 条指针行","n.rowsCompact_other": "{{n}} 行","name.notClassified": "未分类","name.noCollection": "无合集",77 unmodified lines"kindOne.corpus": "语料库","cat.lead.ready_other": "个单元","cat.lead.raw_other": "行语料库数据","coll.open": "打开它的材料集","coll.showing": "正在显示它的材料集",4 unmodified lines"th.domain": "领域","th.leaf": "叶子","fewest.title": "单元最少的叶子","fewest.text": "领域网格中材料集单元最少的叶子,最少的在前:数据基座优先为这些叶子把语料库行提升为材料集。","leaves.title": "每个叶子的单元","leaves.text": "领域网格中的每个叶子按方法分的单元:Agent 逐个判过的,即领域含这个叶子的材料集的单元;分类器打分的,即对这个叶子的分数不低于其阈值的语料库单元;再按类别分分类器打分的单元。每一行的命令直接从语料库取这个叶子分类器打分的单元(--kind corpus --leaf)。","leaves.model": "标签由 {{model}} 给出。","leaves.noLabels": "这个提交还没有语料库单元的标签。","th.agent": "Agent 逐个判过的单元","th.classifier": "分类器打分的单元","th.threshold": "阈值",10 unmodified lines"th.state": "状态","th.address": "地址","th.size": "大小","filter.title": "筛选","filter.noneOn": "未启用",22 unmodified lines"filter.ext": "文件类型","filter.extNone": "当前选择中没有文件类型","filter.optCount": "{{name}}({{n}})","chip.selection": "当前选择","chip.none": "整个索引","chip.remove": "移除 {{k}}:{{v}}",15 unmodified lines"metric.sets": "材料集","metric.units": "单元","metric.rows": "语料库行数","map.units_other": "{{n}} 个单元","map.rows_other": "{{n}} 行语料库数据","map.nothing": "没有匹配项","map.head": "{{amount}},{{domains}}","map.title": "{{metric}}:领域 × 形式","col.title": "来源","col.domain": "领域",54 unmodified lines"detail.files": "单元和文件","detail.from": "出自","detail.upstream": "上游","upstreamKind.dataset": "数据集","upstreamKind.catalog": "数据目录","detail.publishers_other": "{{n}} 个发布方;主要网站",54 unmodified lines"stage.noFigures": "这次发布还没有阶段数字(meta/stage_figures.json):按阶段筛选已关闭。","stage.noSources": "这次发布的阶段数字还没有列出每个来源的阶段:按阶段筛选已关闭。","stage.notCounted": "这次发布还没有阶段字段:按阶段筛选已关闭。","status.flagged": "已标记,不能直接使用","fetch.all": "读过的 {{rows}} 个抽样行全部取到,大小和哈希与记录一致(读取于 {{date}})。","fetch.some": "读过的 {{rows}} 个抽样行中有 {{fetched}} 个({{share}})取到,大小和哈希与记录一致(读取于 {{date}});其余没有。",6 unmodified lines"detail.takeWholeNoSize": "整个材料集:{{units}}","detail.more": "批次与前几行","detail.notCounted": "未统计","get.nothing": "没有可获取的内容","get.takeOne_other": "最多获取 {{count}} 个单元",9 unmodified lines"get.change": "修改筛选","get.take": "获取","get.sql": "DuckDB SQL,固定到该提交","sql.headSets": "数据基座 @ {{sha}}:{{sets}}({{units}})","sql.headCorpora": "数据基座 @ {{sha}}:{{corpora}}({{rows}})","sql.all": "无筛选","sql.noProfile": "按发布原样读取各行:这条查询不应用 tools/fetch.py 默认配置的任何规则(不去重;基准副本、没有与基准测试清单比对过的行、非英文和超过 20 MB 的文件都保留);命令会应用这些规则。任何许可证的行和标为带有个人数据的行,两者都保留。","sql.catalogNoProfile": "按发布原样列出目录中的每个来源:这里不应用 tools/fetch.py 的默认配置,命令才应用它。","sql.chip": "{{k}}:{{v}}","csv.progress_other": "{{done}}/{{n}} 个文件","csv.button": "CSV · {{rows}}","csv.tooMany": "超过 {{n}} 条指针行:请使用命令或 SQL",25 unmodified lines"tree.domainNote": ":例如 D3_data 或 D3","tree.leftOut": "默认排除","tree.flagNote": "把某一项旁边的选项加进命令,就会取回它。","tree.labelNote": "任何许可证的行和带个人数据的行默认都会���到;要去掉它们,加上","profile.duplicate": "重复内容","profile.benchmark": "基准副本","profile.not compared": "未与基准测试清单比对",11 unmodified lines"manual.back": "返回页面","manual.contents": "目录","manual.loading": "正在加载手册…","manual.missing": "本页还没有手册:{{error}}"}25 unmodified lines26272829303110 unmodified lines424344454647484941 unmodified lines9192939495969777 unmodified lines1751761771781791801814 unmodified lines18618718818919019119219319419519619719819920020120220320420520620710 unmodified lines21821922022122222322422 unmodified lines24724824925025125225325425525625725825926026115 unmodified lines27727827928028128228328428528628728828929054 unmodified lines34534634734834935035154 unmodified lines4064074084094104114124134144154164174184194204214224234244254264276 unmodified lines4344354364374384394404419 unmodified lines45145245345445545645745845946046146246346425 unmodified lines49049149249349449549611 unmodified lines50850951051151251351425 unmodified lines"field.legendHalf": "符合筛选,在另一层","field.legendOff": "被筛掉","strata.rest": "未归入任何阶段","strata.domains_other": "个领域","strata.all": "全部 {{n}} 个见下方列表","strata.table": "下方列表有全部列",10 unmodified lines"hero.lede": "面向预训练、中训练和后训练的真实公开数据:每个文件都带地址、大小、哈希和许可证,一条命令即可获取。","release.all": "全部发布","release.countedOn": "数字统计于","release.notCounted": "数字尚未统计","hero.preview": "预览数据","link.dataset": "数据集","link.fields": "索引字段",41 unmodified lines"n.publisher_other": "{{n}} 个发布方","n.pointerRow_other": "{{n}} 条指针行","n.rowsCompact_other": "{{n}} 行","n.source_other": "{{n}} 个来源","name.notClassified": "未分类","name.noCollection": "无合集",77 unmodified lines"kindOne.corpus": "语料库","cat.lead.ready_other": "个单元","cat.lead.raw_other": "行语料库数据","cat.lead.rows_other": "行","coll.open": "打开它的材料集","coll.showing": "正在显示它的材料集",4 unmodified lines"th.domain": "领域","th.leaf": "叶子","fewest.title": "单元最少的叶子","fewest.text": "领域网格中以任一方法标注给它的单元最少的叶子,最少的在前。","fewest.textSets": "领域网格中材料集单元最少的叶子,最少的在前。","leaves.title": "每个叶子的单元","leaves.text": "领域网格中的每个叶子,以任一方法和按每种方法标注给它的单元:agent(Agent 逐个判定可用于该叶子)和 classifier(分数不低于该叶子的阈值,阈值列在旁边);再按类别分它的单元。每一行的命令从所有来源取这个叶子有标签的单元(--leaf),按表格上方选定的方法(--method)。","leaves.model": "标签由 {{model}} 给出。","leaves.noLabels": "这个提交还没有单元的标签。","leaves.method": "命令取用的方法","leaves.methodAll": "所有方法","leaves.textClassifier": "领域网格中的每个叶子按方法分的单元:Agent 逐个判过的,即领域含这个叶子的材料集的单元;分类器打分的,即对这个叶子的分数不低于其阈值的语料库单元;再按类别分分类器打分的单元。每一行的命令直接从语料库取这个叶子分类器打分的单元(--kind corpus --leaf)。","kinds.title": "\u6309\u6765\u6e90\u7c7b\u578b\u548c\u7c7b\u522b\u5206\u7684\u5355\u5143","kinds.text": "\u8fd9\u4e2a\u63d0\u4ea4\u7684\u6bcf\u4e2a\u6765\u6e90\uff0c\u4e0d\u8bba\u72b6\u6001\uff0c\u6309\u6765\u6e90\u7c7b\u578b\uff08catalog/source_kinds.tsv\uff09\u548c\u5176\u5f62\u6001\u7684\u7c7b\u522b\uff08catalog/stages.yaml\uff09\u5206\uff1a\u6750\u6599\u96c6\u53ca\u5176\u5355\u5143\uff0c\u8bed\u6599\u5e93\u53ca\u5176\u5355\u5143\uff08\u8bed\u6599\u5e93\u6309\u884c\u8ba1\uff09\u3002\u4e24\u5c42\u7684\u5355\u5143\u4ece\u4e0d\u76f8\u52a0\u3002","kinds.none": "\u8fd9\u4e2a\u63d0\u4ea4\u7684\u6295\u5f71\u8fd8\u6ca1\u6709\u6309\u6765\u6e90\u7c7b\u578b\u7684\u8ba1\u6570\u3002","th.kind": "\u6765\u6e90\u7c7b\u578b","th.class": "\u7c7b\u522b","th.sources": "\u6765\u6e90","th.corpusUnits": "\u8bed\u6599\u5e93\u5355\u5143","th.agent": "Agent 逐个判过的单元","th.classifier": "分类器打分的单元","th.threshold": "阈值",10 unmodified lines"th.state": "状态","th.address": "地址","th.size": "大小","th.sources": "来源","filter.title": "筛选","filter.noneOn": "未启用",22 unmodified lines"filter.ext": "文件类型","filter.extNone": "当前选择中没有文件类型","filter.optCount": "{{name}}({{n}})","filter.facets": "按标准","facet.subject": "学科","facet.industry": "行业","facet.occupation": "职业与工作","facet.business_process": "业务流程","facet.resource_type": "资源类型","facet.file_format": "文件格式","facet.multi": "跨越整个分面","facet.codePage": "{code} 在标准出处的页面","chip.selection": "当前选择","chip.none": "整个索引","chip.remove": "移除 {{k}}:{{v}}",15 unmodified lines"metric.sets": "材料集","metric.units": "单元","metric.rows": "语料库行数","metric.allRows": "行数","metric.sources": "来源","map.units_other": "{{n}} 个单元","map.rows_other": "{{n}} 行语料库数据","map.nothing": "没有匹配项","map.head": "{{amount}},{{domains}}","map.title": "{{metric}}:领域 × 形式","map.allRows_other": "{{n}} 行","col.title": "来源","col.domain": "领域",54 unmodified lines"detail.files": "单元和文件","detail.from": "出自","detail.upstream": "上游","detail.card": "卡片","upstreamKind.dataset": "数据集","upstreamKind.catalog": "数据目录","detail.publishers_other": "{{n}} 个发布方;主要网站",54 unmodified lines"stage.noFigures": "这次发布还没有阶段数字(meta/stage_figures.json):按阶段筛选已关闭。","stage.noSources": "这次发布的阶段数字还没有列出每个来源的阶段:按阶段筛选已关闭。","stage.notCounted": "这次发布还没有阶段字段:按阶段筛选已关闭。","stage.countedBy": "已计入:{{list}}","stage.beside": "列在计数旁、不计入其中:{{list}}","stage.agentLayers": "(材料集 {{sets}},判过的语料库单元 {{judged}})","stage.scored": "分类器的单元来自目前已打分的 {{n}} / {{m}} 个数据文件,模型 {{model}}","stage.precision": "分类器在 {{leaves}} 个叶子的阈值上的精确率 {{p}}(95% 区间 {{low}} 至 {{high}}),基于 {{above}} 个留出的判定","stage.precisionNone": "分类器精确率尚未测得:还没有叶子有阈值","stage.method.agent": "Agent {{n}}","stage.method.classifier": "分类器 {{n}}","stage.method.rule": "规则 {{n}}","stage.status.notJudged": "尚未判定 {{n}}","stage.status.below": "低于阈值 {{n}}","stage.status.duplicate": "重复 {{n}}","stage.status.benchmark": "与基准测试重叠 {{n}}","stage.status.unsized": "大小未记录 {{n}}","stage.status.archive": "成员已记录的归档 {{n}}","stage.byMethod_other": "{{method}}:{{n}} 个单元","status.flagged": "已标记,不能直接使用","fetch.all": "读过的 {{rows}} 个抽样行全部取到,大小和哈希与记录一致(读取于 {{date}})。","fetch.some": "读过的 {{rows}} 个抽样行中有 {{fetched}} 个({{share}})取到,大小和哈希与记录一致(读取于 {{date}});其余没有。",6 unmodified lines"detail.takeWholeNoSize": "整个材料集:{{units}}","detail.more": "批次与前几行","detail.notCounted": "未统计","detail.labelsFirstMethod": "它前 {{n}} 个单元的标签,每个是分类器的分数(不低于该叶子阈值的加粗)或方法 agent","detail.unitsRows": "单元和行","get.nothing": "没有可获取的内容","get.takeOne_other": "最多获取 {{count}} 个单元",9 unmodified lines"get.change": "修改筛选","get.take": "获取","get.sql": "DuckDB SQL,固定到该提交","get.sourceWord_other": "个来源","sql.headSets": "数据基座 @ {{sha}}:{{sets}}({{units}})","sql.headCorpora": "数据基座 @ {{sha}}:{{corpora}}({{rows}})","sql.all": "无筛选","sql.noProfile": "按发布原样读取各行:这条查询不应用 tools/fetch.py 默认配置的任何规则(不去重;基准副本、没有与基准测试清单比对过的行、非英文和超过 20 MB 的文件都保留);命令会应用这些规则。任何许可证的行和标为带有个人数据的行,两者都保留。","sql.catalogNoProfile": "按发布原样列出目录中的每个来源:这里不应用 tools/fetch.py 的默认配置,命令才应用它。","sql.chip": "{{k}}:{{v}}","sql.headSources": "数据基座 @ {{sha}}:{{sources}}({{units}},{{rows}})","csv.progress_other": "{{done}}/{{n}} 个文件","csv.button": "CSV · {{rows}}","csv.tooMany": "超过 {{n}} 条指针行:请使用命令或 SQL",25 unmodified lines"tree.domainNote": ":例如 D3_data 或 D3","tree.leftOut": "默认排除","tree.flagNote": "把某一项旁边的选项加进命令,就会取回它。","tree.labelNote": "任何许可证的行、带个人数据的行和取回核对发现被所在网站拒绝的行默认都会取到;要去掉它们,加上","profile.duplicate": "重复内容","profile.benchmark": "基准副本","profile.not compared": "未与基准测试清单比对",11 unmodified lines"manual.back": "返回页面","manual.contents": "目录","manual.loading": "正在加载手册…","manual.missing": "本页还没有手册:{{error}}","method.agent": "Agent 逐个判过的","method.classifier": "分类器打分的"}
12345678{"commit": "16188452d45d15924c3bd10a9cb6d200b0680878","digest": "047183764a18c5b568a448b8fc8152a75df3b0599e0c975ee8755d81b87703f5","files": 29,"format": "portal-deploy/1","funnel": "93c9d8ae26cfb409122f4cd4222359d30c31566c","index": "e26658c3df0ca7a6871d71cf0e815cb903b254fc"}12345678{"commit": "5b2c299894d9335564272afeccc2e23d697c0ef5","digest": "92cf7d2e1df52c87f209e31b8f497d006a119083ed0d96d8a2483e843732df60","files": 29,"format": "portal-deploy/1","funnel": "93c9d8ae26cfb409122f4cd4222359d30c31566c","index": "4fc6aaf347b76fb50f02464749b908a5e943f58e"}
350 unmodified lines351352353354355356357358359360350 unmodified lines.stratum .amount { text-align: right; white-space: nowrap; }.stratum .big { font-size: clamp(30px, 0.55vw + 22px, 36px); }.stratum .unit { font-size: var(--fs-1); color: var(--ink-muted); margin-left: 4px; }/* #2629: a line under the name and the figure: a stage's funnel (what meets its condition, then what each ruleremoves), or under the last band what no stage counts by reason; the core runs beside it */.stratum.has-steps .core { grid-row: span 2; }.stratum .steps { grid-column: 2 / -1; color: var(--ink-muted); font-size: var(--fs-1); line-height: 1.35; }.stratum[aria-pressed="true"] { background: var(--wash); box-shadow: inset 0 0 0 1px var(--panel-line); }/* while one stage is picked the others step back */.column.picked .stratum:not([aria-pressed="true"]) { opacity: 0.45; }350 unmodified lines351352353354355356357358359360361362350 unmodified lines.stratum .amount { text-align: right; white-space: nowrap; }.stratum .big { font-size: clamp(30px, 0.55vw + 22px, 36px); }.stratum .unit { font-size: var(--fs-1); color: var(--ink-muted); margin-left: 4px; }/* a band's lines under its name and its figure: its counted units by method, then its units of every other status (or,for figures without statuses, its funnel); the core runs beside them */.stratum.has-steps .core { grid-row: span 2; }.stratum .steps { grid-column: 2 / -1; color: var(--ink-muted); font-size: var(--fs-1); line-height: 1.35; }.stratum .steps > span { display: block; }.stratum .steps > .by { color: var(--ink-2); }.stratum[aria-pressed="true"] { background: var(--wash); box-shadow: inset 0 0 0 1px var(--panel-line); }/* while one stage is picked the others step back */.column.picked .stratum:not([aria-pressed="true"]) { opacity: 0.45; }
README.md+58-30
app.js+387-185
data.js+109-31
first.js+131-37
first.json+85-85
index.html+40-15
linked.js+39-17
llms.txt+5-5
locales/en.json+61-24
locales/zh.json+56-16
portal.json+3-3
style.css+4-2