huggingface / datasets
git clone https://github.com/huggingface/datasets.git
5.1.0 Β· 16d ago
π€ The largest hub of ready-to-use datasets for AI models with fast, easy-to-use and efficient data manipulation tools
+5
stars, 24h Β· #3,000
+~35
stars, 7 days Β· #3,628
+~150
stars, 30 days Β· #3,624
22k
β
total Β· +0% this week
3.6k
forks Β· 1.5k open issues
Star history (as recorded here)
LanguagePython
LicenseApache-2.0
Created2020-03-26 (6y ago)
Last pushtoday
Watchers283
OwnerOrganization
GitHub topics
aiartificial-intelligencecomputer-visiondataset-hubdatasetsdeep-learninghuggingfacellmmachine-learningnatural-language-processingnlpnumpypandaspytorchspeechtensorflow
Links
- GitHub: github.com/huggingface/datasets
- Homepage: https://huggingface.co/docs/datasets
- Releases Β· Issues Β· Hacker News mentions
README excerpt
π€ Datasets is a lightweight library providing **two** main features:
- **one-line dataloaders for many public datasets**: one-liners to download and pre-process any of the major public datasets (image datasets, audio datasets, text datasets in 467 languages and dialects, 3D medical images, video datasets, agent traces, etc.) provided on the HuggingFace Datasets Hub. With a simple command like `squad_dataset = load_dataset("rajpurkar/squad")`, get any of these datasets ready to use in a dataloader for training/evaluating a ML model (Numpy/Pandas/PyTorch/TensorFlow/JAX/Polars),
- **efficient data pre-processing**: simple, fast and reproducible data pre-processing for the public datasets as well as your own local datasets in CSV, JSON, JSONL, Parquet, HDF5, XML, text, PNG, JPEG, WAV, MP3, PDF, NIfTI, and more. With simple commands like `processed_dataset = dataset.map(process_example)`, efficiently prepare the dataset for inspection and ML model evaluation and training.
π **Documentation** π **Find a dataset in the Hub** π **Share a dataset on the Hub**
# π Key Features
π€ Datasets is designed to let the community easily add and share new datasets, and provides powerful capabilities for data manipulation:
| Feature | Description |
|---------|-------------|
| π¦ **One-line dataset loading** | Load AI-ready datasets from the Hugging Face Hub or local files with `load_dataset()` |
| π **Multiple formats** | Native support for CSV, JSON, JSONL, Parquet, Arrow, XML, Text, Webdataset, and more |
| πΌοΈ **Multi-modal data** | Built-in support for text, audio, image, video, PDF, and NIfTI (3D medical) data |
| π **Streaming mode** | Stream datasets without downloading β iterate over data on-the-fly with `streaming=True` (now up to **100x faster** with Xet backend) |
| πΎ **HF Storage Buckets** | Read and write directly from/to Hugging Face Storage Buckets for mutable, large-scale raw data |
| π§ **AI Agent Traces** | Load and process AI agent traces (prompts, tool calls, responses) from the Hub |
| β‘ **Apache Arrow backend** | Zero-copy memory-mapped storage β datasets naturally free you from RAM limitations |
| π **Smart caching** | Never wait for your data to process twice β cached results are automatically reused |
| π **Multi-framework interoperability** | Native conversion to/from NumPy, Pandas, Polars, Arrow, PyTorch, TensorFlow, JAX, and Spark |
| ποΈ **Multi-processing** | Fast parallel data processing with `map(num_proc=N)` |
| π **Search & index** | Built-in FAISS and Elasticsearch index support for similarity search |
| π¦ **JSON type** | Flexible JSON/structured data support with `Json()` feature type |
# Installation
## With pip
π€ Datasets can be installed from PyPi and should be installed in a virtual environment (venv or conda for instance):
[code]
For the latest development version:
[code]
## With conda
[code]
## Optional dependencies
π€ Datasets supports various optional features via extras:
[code]
For more details on installation, check the