Convert to Parquet format (remove legacy loading script)

#4
by davanstrien HF Staff - opened
Commit history is no longer available for this pull request.

This dataset currently can't be loaded with datasets v3+ because the legacy Python loading script is no longer supported. This PR migrates to standard Parquet files so the dataset works again out of the box.

Why Parquet?

The dataset currently uses a Python loading script that downloads a 19MB CSV from an external URL and processes it at load time. This approach was deprecated in datasets v3 and no longer works without pinning to an older library version.

Parquet is a columnar storage format that's now the standard on the Hub. Benefits:

  • Much smaller β€” the 19MB CSV compresses to 9.4MB total across all three configs, stored directly in the repo rather than fetched from an external URL
  • More efficient β€” columnar format means you can load specific columns without reading the entire file
  • Works with modern datasets β€” no trust_remote_code or version pinning needed
  • Dataset viewer β€” Parquet files are automatically indexed, enabling the dataset viewer, search, and filtering on the Hub
  • Broader compatibility β€” loadable directly with Pandas, Polars, DuckDB, and other tools without the datasets library

Changes

  • Add Parquet data files for all 3 configs under data/
  • Add explicit config definitions to README frontmatter
  • Remove blbooksgenre.py loading script and dataset_infos.json

All configs preserved

Config Rows Description
title_genre_classifiction (default) 1,736 Deduplicated titles with fiction/non-fiction labels
annotated_raw 4,398 Full crowdsourced annotations
raw 55,343 Complete catalogue metadata

Loading works the same as before

from datasets import load_dataset
ds = load_dataset("TheBritishLibrary/blbooksgenre", "title_genre_classifiction")
davanstrien changed pull request title from Add Parquet data files for all configs to Convert to Parquet format (remove legacy loading script)
British Library org

Thanks Daniel!

BritishLibrary changed pull request status to merged
BritishLibrary deleted the refs/pr/4 ref

Sign up or log in to comment