Datatrove logo

Datatrove

Free

Freeing data processing from scripting madness by providing a set of platform-agnostic customizable pipeline processing blocks.

FreeFree tier
Inputs: text
Type
Open Source
Company
Hugging Face

About Datatrove

Datatrove is an open-source library from Hugging Face designed for large-scale text data processing, filtering, and deduplication. It provides a set of prebuilt commonly used processing blocks and a framework for easily adding custom functionality. Pipelines are platform-agnostic, running locally, on Slurm clusters, or with Ray. Datatrove features low memory usage and a multiple-step design, making it ideal for workloads such as preparing training data for large language models (LLMs). It supports multiple file systems via fsspec and can read formats like WARC, ARC, WET, Parquet, and Arrow. The library includes executors for local, Slurm, Ray, and job-based execution. Key capabilities include text extraction, filtering, tokenization, minhash deduplication, sentence deduplication, synthetic data generation, progress monitoring, and benchmarking.

Key Features

Large-scale text data processing, filtering, and deduplication
Prebuilt processing blocks for common tasks (extraction, filtering, tokenization, deduplication)
Custom block framework for adding custom functionality
Platform-agnostic: runs locally, on Slurm clusters, or with Ray
Low memory usage for large workloads
Support for multiple file systems via fsspec (local, remote, cloud)
Executors: LocalPipelineExecutor, SlurmPipelineExecutor, RayPipelineExecutor, JobsPipelineExecutor
Reads and writes WARC, ARC, WET, Parquet, Arrow, and optimized-parquet formats
Built-in minhash and sentence-level exact deduplication
Synthetic data generation capabilities

Pros & Cons

Pros
  • Open source and free to use
  • Designed for extremely large-scale data processing with low memory footprint
  • Platform-agnostic, works on local machines, Slurm, Ray, and other executors
  • Comes with many prebuilt processing blocks, reducing development time
  • Easy to extend with custom blocks or simple custom functions
  • Supports a wide variety of file formats and storage backends via fsspec
  • Backed by Hugging Face, a respected organization in the AI/ML community
Cons
  • Requires Python 3.10+ and uses the uv package manager (not pip) for installation

Best For

Processing CommonCrawl dumps for LLM training dataReproducing datasets like FineWebTokenizing large datasets (e.g., C4 with GPT-2 tokenizer)Estimating token counts for random shuffled subsamples of massive datasetsBuilding ~100B token subsets with specific mixtures (e.g., 50-30-20) from Hugging Face datasetsDeduplicating text data using minhash or sentence-level exact matchingDecontaminating datasets with LightEval (via 'decont' extra)Running large-scale text extraction and filtering pipelines

FAQ

What is Datatrove?
Datatrove is an open-source library by Hugging Face for processing, filtering, and deduplicating text data at very large scale. It provides a set of prebuilt processing blocks and a framework for custom pipelines, and can run on local machines or slurm clusters.
How do I install Datatrove?
Datatrove requires Python 3.10+ and uses the uv package manager. You can install it with 'uv sync' and choose optional extras like 'all', 'io', 'processing', 's3', 'ray', etc. For example, 'uv sync --extra all' installs everything.
What executors are available?
Datatrove provides four executors: LocalPipelineExecutor (runs locally), SlurmPipelineExecutor (for Slurm clusters), RayPipelineExecutor (distributed compute), and JobsPipelineExecutor (for custom job schedulers).
What file formats can Datatrove read and write?
It supports WARC, ARC, WET, Parquet, Arrow, and optimized-parquet formats. It also supports many file systems (local, remote, cloud) through fsspec.