dataset-creation / CLAUDE.md
davanstrien's picture
davanstrien HF Staff
Add PDF to dataset conversion script with examples and documentation
cb5bdd5

Dataset Creation Scripts - Development Notes

This repository contains UV scripts for creating Hugging Face datasets from local files.

Important Configuration

Dataset Viewer

Since these are script repositories (not actual datasets), we should disable the dataset viewer to avoid confusion. Add the following to the dataset card YAML header:

---
viewer: false
---

This prevents Hugging Face from trying to display the scripts as data, which would be misleading since users are meant to download and run these scripts, not view them as datasets.

Reference: https://huggingface.co/docs/hub/datasets-viewer-configure#disable-the-viewer

Repository Structure

dataset-creation/
β”œβ”€β”€ README.md              # User-facing documentation
β”œβ”€β”€ CLAUDE.md             # Development notes (this file)
β”œβ”€β”€ pdf-to-dataset.py     # PDF processing script
β”œβ”€β”€ pdf-examples/         # Test PDFs for development
└── .gitignore           # Ignore test outputs

Testing

Test locally with:

uv run pdf-to-dataset.py pdf-examples test-dataset --private

Future Scripts

Potential additions (when needed):

  • images-to-dataset.py - Process image directories
  • text-to-dataset.py - Convert text files
  • audio-to-dataset.py - Process audio files
  • json-to-dataset.py - Structure JSON data

Design Decisions

  1. Simple is better: Scripts use built-in dataset loaders where possible
  2. No GPU required: These are data preparation scripts, not inference
  3. Direct upload: Use push_to_hub for simplicity
  4. Flexible output: Upload raw objects (PDFs, images) for user processing

Maintenance Notes

  • Always test scripts with local examples before pushing
  • Keep dependencies minimal
  • Follow UV script best practices from main CLAUDE.md
  • Ensure ruff formatting and linting passes