Skip to content

Canonicalise crop_types and agricultural_task in the dataset registry - #87

Merged
js2552 merged 1 commit into
mainfrom
fix/registry-vocabulary
Oct 20, 2026
Merged

js2552 merged 1 commit into
mainfrom
fix/registry-vocabulary

Conversation

@masonearles

Copy link
Copy Markdown
Contributor

Why

The home page charts count maize (42) and corn (17) as separate crops, and draw a 70-character bar label, crop image collection (unlabeled; for pretraining and foundation models), in the task chart. Both come from unconstrained metadata in hf_datasets.json. The pipeline side was fixed in Project-AgML/AgML-Journal-Ingestion#8 (merged); this PR applies the same canonicalisation to the registry already on the site.

What changed

static/data/hf_datasets.json — run through src/registry_vocabulary.py from the merged ingestion main. 148 of 725 datasets touched, only the crop_types and agricultural_task fields.

crop before after
maize 42 57
rice 42 43
soybean 34 36
grape 23 35
tomato 33 34
distinct crop strings 672 618

Crop labels merged away, by dataset count: corn 17, grapevine 9, canola 6 (→ rapeseed), paddy 3 (→ rice), brassica napus 3, then grapes, brinjal, urad bean, capsicum, soybeans and a dozen misspellings at 1–2 each. 86 further datasets only had capitalised Latin names lowercased (the site already lowercases for display, so nothing visible changes for those).

agricultural_task before after n
crop image collection (unlabeled; for pretraining and foundation models) → "" 18
plant part segmentation → plant_organ_segmentation 1
fruit_maturity_detection → maturity_detection 1
crop and weed segmentation → crop_and_weed_segmentation 1

The 18 image_safari entries now match the other 41 image_safari entries, which already carry "".

Derived files, regenerated exactly as npm run build's prebuild does:

  • static/data/performance/global.json — crop_types copies for the leaderboard filter.
  • static/data/embeddings/{meta.json,vectors.bin} — semantic search index. Record count goes 6286 → 6647 because the committed snapshot predated the October data batches; this is the first regeneration since 2026-09-25.

datasets.json and performance/index.json regenerated byte-identical.

Verification

  • npm run test:unit: 23/23 pass
  • npm run build: success; built output contains zero occurrences of the long label and zero corn crop entries
  • Diff of hf_datasets.json contains only crop_types / agricultural_task lines

Side effects

  • Bookmarked dataset-page links filtering on corn will match nothing; new links use maize.
  • Searching "corn" still works: semantic search embeds dataset names and descriptions, not just crop labels.

🤖 Generated with Claude Code

Applies AgML-Journal-Ingestion's src/registry_vocabulary.py (merged in
Project-AgML/AgML-Journal-Ingestion#8) to hf_datasets.json, then regenerates
the derived files the same way `npm run build` does.

- crop_types: corn -> maize (17 datasets), grapevine/grapes/vitis -> grape,
  canola/brassica napus -> rapeseed, paddy -> rice, brinjal -> eggplant,
  Latin names and misspellings -> common names; capitalised values
  lowercased. 148 datasets touched; maize 42 -> 57, corn 17 -> 0,
  distinct crop strings 672 -> 618.
- agricultural_task: the 70-character "crop image collection (unlabeled;
  for pretraining and foundation models)" label on 18 image_safari entries
  -> "" (matching the other 41 image_safari entries), plus three singleton
  token fixes. Removes the oversized bar from the home-page task chart.
- performance/global.json: crop_types copies refreshed by generate-datasets.
- embeddings/: regenerated by generate-embeddings (6286 -> 6647 records; the
  committed snapshot predated the October data batches).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@masonearles
masonearles requested a review from js2552 October 20, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants