Data Acquisition Concepts
This guide covers the core concepts for acquiring and processing text data from remote sources in NeMo Curator. Data acquisition focuses on downloading, extracting, and converting remote data sources into the DocumentBatch format for further processing.
Overview
Data acquisition in NeMo Curator follows a four-stage architecture:
- Generate URLs: Discover and generate download URLs from minimal input
- Download: Retrieve raw data files from remote sources
- Iterate: Extract individual records from downloaded containers
- Extract: Convert raw content to clean, structured text
This process transforms diverse remote data sources into a standardized DocumentBatch that can be used throughout the text curation pipeline.
Core Components
The data acquisition framework consists of four abstract base classes that define the acquisition workflow:
URLGenerator
Generates URLs for downloading from minimal input configuration. You need to override generate_urls which generates a bunch of URLs that user wants to download.
Example Implementation:
DocumentDownloader
Connects to and downloads data from remote repositories. You must override _get_output_filename and _download_to_path which are called by an underlying function called download which tries to be idempotent.
Example Implementation:
DocumentIterator
Extracts individual records from downloaded containers. You should only override iterate and output_columns where iterate must have logic to load the local file path and return bunch of documents. The list[dict] is finally considered to a Pandas DataFrame which is passed to Extractor.
Example Implementation:
DocumentExtractor (Optional)
DocumentExtractor works on a Pandas DataFrame and is optional.
Example Implementation:
Supported Data Sources
NeMo Curator provides built-in support for major public text datasets:
Download and extract web archive data from Common Crawl web-scale multilingual
Download and extract scientific papers from arXiv academic scientific
Download and extract Wikipedia articles from Wikipedia dumps encyclopedic structured
Implement a download and extract pipeline for a custom data source extensible specialized
Integration with Pipeline Architecture
The data acquisition process seamlessly integrates with NeMo Curator’s pipeline-based architecture. The DocumentDownloadExtractStage handles parallel processing through the distributed computing framework.
Acquisition Workflow
Performance Optimization
Parallel Processing
Data acquisition leverages distributed computing frameworks for scalable processing:
- Parallel Downloads: Each URL in the generated list downloads through separate workers
- Concurrent Extraction: Files process in parallel across workers
- Memory Management: Streaming processing for large files
Integration with Data Loading
Data acquisition produces a standardized output that integrates seamlessly with Curator’s Data Loading Concepts :
Data acquisition includes basic content-level deduplication during extraction (such as removing duplicate HTML content within individual web pages). This is separate from the main deduplication pipeline stages (exact, fuzzy, and semantic deduplication) that operate on the full dataset after acquisition.
This enables you to:
- Separate acquisition from processing for better workflow management
- Cache acquired data to avoid re-downloading
- Mix acquired and local data in the same processing pipeline
- Use standard loading patterns regardless of data origin