--- name: hf-dataset-search description: Find and compare Hugging Face datasets from a local index of metadata for every public dataset on the Hub (about 1.15 million). Use when the user asks which datasets exist for a language, task, domain, license or format, wants training or evaluation data for a model, asks about a dataset's size, columns or license, or wants counts and statistics about what is on the Hub. Searches by meaning, by keyword, and by structured filters, without downloading any dataset. --- # Hugging Face dataset search `scripts/hfmeta.py` queries a local SQLite index holding metadata for every public dataset on the Hugging Face Hub, plus a vector index for search by meaning. It answers in well under a minute and never downloads dataset contents. Run it from this skill's folder: ```bash python3 scripts/hfmeta.py ... # filters, keywords, stats, show uv run -q scripts/hfmeta.py search --semantic ... # search by meaning (uv installs numpy + model2vec) ``` Start with `python3 scripts/hfmeta.py stats`. It shows where the index is, how many datasets it holds and when it was last crawled. Tell the user that date when freshness matters. If the index is missing, see "Building the index" below. ## Choosing a search | The user wants | Use | |---|---| | Something described in words ("Swedish court rulings", "dialogues with tool calls") | `search --semantic ` | | An exact name, term or id fragment | `search ` (all words must appear) | | Everything matching hard constraints | `search` with filters only | | "How many…", "what is most common…" | `stats --by ` with filters | | Details of one dataset | `show ` | Filters combine with every search type, including `--semantic`. Semantic search uses a small, fast embedding model, so treat it as a wide net and not a precise ranker. For any real question run it **and** a keyword search **and** a filter-only search, then merge. It works best with a short topic phrase (three to six words) and with the constraints moved into filters: `--semantic court rulings --lang sv` beats one long sentence. It is multilingual, but English queries are the most reliable. Its footer reports how many datasets passed the filters, not how many are relevant. ## Filters ``` --lang sv language code (repeat: all must match) --task text-generation Hub task category --modality text text, audio, image, video, tabular, timeseries, ... --format parquet parquet, json, csv, ... --shape chat guessed example shape, see below --has-column messages exact column name --license mit exact license id (repeat: any of) --license-class permissive permissive | sharealike | noncommercial | noderivs | other | none --author KBLab user or organisation --min-downloads N --min-likes N --min-rows N --max-rows N --min-size 100K