Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions docs/admin/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ This guide covers installing NeMo Curator with support for **all modalities** an

### System Requirements

For comprehensive system requirements and production deployment specifications, see [Production Deployment Requirements](deployment/requirements.md).
For comprehensive system requirements and production deployment specifications, refer to [Production Deployment Requirements](deployment/requirements.md).

**Quick Start Requirements:**

- **OS**: Ubuntu 24.04/22.04/20.04 (recommended)
- **Python**: 3.10, 3.11, or 3.12
- **Memory**: 16GB+ RAM for basic text processing
- **GPU** (optional): NVIDIA GPU with 16GB+ VRAM for acceleration
- **CUDA 12** (required for `audio_cuda12`, `video_cuda12`, `image_cuda12`, and `text_cuda12` extras)

### Development vs Production

Expand All @@ -41,9 +42,13 @@ For comprehensive system requirements and production deployment specifications,

Choose one of the following installation methods based on your needs:

:::{tip}
**Docker is the recommended installation method** for video and audio workflows. The NeMo Curator container includes FFmpeg (with NVENC support) pre-configured, avoiding manual dependency setup. Refer to the [Container Installation](#container-installation) tab below.
:::

::::{tab-set}

:::{tab-item} PyPI Installation (Recommended)
:::{tab-item} PyPI Installation

Install NeMo Curator from the Python Package Index using `uv` for proper dependency resolution.

Expand Down Expand Up @@ -89,9 +94,9 @@ uv sync --all-extras --all-groups

:::

:::{tab-item} Container Installation
:::{tab-item} Container Installation (Recommended for Video/Audio)

NeMo Curator is available as a standalone container on NGC: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nemo-curator. The container includes NeMo Curator with all dependencies pre-installed. You can run it with:
NeMo Curator is available as a standalone container on NGC: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nemo-curator. The container includes NeMo Curator with all dependencies pre-installed, including FFmpeg with NVENC support.

```bash
# Pull the container from NGC
Expand All @@ -101,6 +106,14 @@ docker pull nvcr.io/nvidia/nemo-curator:{{ container_version }}
docker run --gpus all -it --rm nvcr.io/nvidia/nemo-curator:{{ container_version }}
```

```{important}
After entering the container, activate the virtual environment before running any NeMo Curator commands:

source /opt/venv/env.sh

The container uses a virtual environment at `/opt/venv`. If you see `No module named nemo_curator`, the environment has not been activated.
```

Alternatively, you can build the NeMo Curator container locally using the provided Dockerfile:

```bash
Expand All @@ -115,7 +128,7 @@ docker run --gpus all -it --rm nemo-curator:latest

**Benefits:**

- Pre-configured environment with all dependencies
- Pre-configured environment with all dependencies (FFmpeg, CUDA libraries)
- Consistent runtime across different systems
- Ideal for production deployments

Expand Down Expand Up @@ -157,6 +170,10 @@ If encoders are missing, reinstall `FFmpeg` with the required options or use the
:::
::::

```{note}
**FFmpeg build requires CUDA toolkit (nvcc):** If you encounter `ERROR: failed checking for nvcc` during FFmpeg installation, ensure that the CUDA toolkit is installed and `nvcc` is available on your `PATH`. You can verify with `nvcc --version`. If using the NeMo Curator container, FFmpeg is pre-installed with NVENC support.
```

---

## Package Extras
Expand Down
1 change: 1 addition & 0 deletions docs/broken_links_false_positives.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"filename": "get-started/text.md", "lineno": 119, "status": "broken", "code": 0, "uri": "https://huggingface.co/settings/tokens", "info": "unauthorized"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid JSON structure

broken_links_false_positives.json is being written as a single JSON object, but the name suggests this file is consumed as a collection of entries. If the docs link-checker expects an array (common for “false positives” allowlists), this will break parsing or silently ignore the entry. Consider making this file a JSON array (even for one item), e.g. [ { ... } ], to match typical consumption patterns.

4 changes: 4 additions & 0 deletions docs/curate-text/process-data/deduplication/fuzzy.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Ideal for detecting documents with minor differences such as formatting changes,
- Ray cluster with GPU support (required for distributed processing)
- Stable document identifiers for removal (either existing IDs or IDs generated by the workflow and removal stages)

```{note}
**Running in Docker**: When running fuzzy deduplication inside the NeMo Curator container, ensure the container is started with `--gpus all` so that Ray workers can access the GPU. Without GPU access, you may see `CUDARuntimeError` or `AttributeError: 'CUDARuntimeError' object has no attribute 'msg'`. Also activate the virtual environment with `source /opt/venv/env.sh` after entering the container.
```

## Quick Start

Get started with fuzzy deduplication using the following example of identifying duplicates, then remove them:
Expand Down
4 changes: 4 additions & 0 deletions docs/curate-text/process-data/deduplication/semdedup.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ Based on [SemDeDup: Data-efficient learning at web-scale through semantic dedupl
- GPU acceleration (required for embedding generation and clustering)
- Stable document identifiers for removal (either existing IDs or IDs managed by the workflow and removal stages)

```{note}
**Running in Docker**: When running semantic deduplication inside the NeMo Curator container, ensure the container is started with `--gpus all` so that CUDA GPUs are available. Without this flag, you will see `RuntimeError: No CUDA GPUs are available`. Also activate the virtual environment with `source /opt/venv/env.sh` after entering the container.
```

## Quick Start

Get started with semantic deduplication using the following example of identifying duplicates, then remove them in one step:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The distributed data classification in NeMo Curator works by:

1. **Parallel Processing**: Chunking datasets across multiple computing nodes and GPUs to accelerate classification
2. **Pre-trained Models**: Using specialized models for different classification tasks
3. **Batched Inference**: Optimizing throughput with intelligent batching via CrossFit integration
3. **Batched Inference**: Optimizing throughput with intelligent batching
4. **Consistent API**: Providing a unified interface through the `DistributedDataClassifier` base class

The `DistributedDataClassifier` is designed to run on GPU clusters with minimal code changes regardless of which specific classifier you're using. All classifiers support filtering based on classification results and storing prediction scores as metadata.
Expand All @@ -29,6 +29,16 @@ The `DistributedDataClassifier` is designed to run on GPU clusters with minimal
Distributed classification requires GPU acceleration and is not supported for CPU-only processing. As long as GPU resources are available and NeMo Curator is correctly installed, GPU acceleration is handled automatically.
:::

```{tip}
**Running the tutorial notebooks**: The classification tutorial notebooks require the `text_cuda12` or `all` installation extra to include all relevant dependencies. If you encounter `ModuleNotFoundError`, reinstall with the appropriate extra:

uv pip install "nemo-curator[text_cuda12]"

When using classifiers that download from Hugging Face (such as Aegis and InstructionDataGuard), set your `HF_TOKEN` environment variable to avoid rate limiting:

export HF_TOKEN="your_token_here"
```

---

## Usage
Expand All @@ -39,16 +49,16 @@ NVIDIA NeMo Curator provides a base class `DistributedDataClassifier` that can b

| Classifier | Purpose | Model Location | Key Parameters | Requirements |
|---|---|---|---|---|
| DomainClassifier | Categorize English text by domain | [nvidia/domain-classifier](https://huggingface.co/nvidia/domain-classifier) | `filter_by`, `text_field` | None |
| MultilingualDomainClassifier | Categorize text in 52 languages by domain | [nvidia/multilingual-domain-classifier](https://huggingface.co/nvidia/multilingual-domain-classifier) | `filter_by`, `text_field` | None |
| QualityClassifier | Assess document quality | [nvidia/quality-classifier-deberta](https://huggingface.co/nvidia/quality-classifier-deberta) | `filter_by`, `text_field` | None |
| AegisClassifier | Detect unsafe content | [nvidia/Aegis-AI-Content-Safety-LlamaGuard-Defensive-1.0](https://huggingface.co/nvidia/Aegis-AI-Content-Safety-LlamaGuard-Defensive-1.0) | `aegis_variant`, `filter_by` | HuggingFace token |
| InstructionDataGuardClassifier | Detect poisoning attacks | [nvidia/instruction-data-guard](https://huggingface.co/nvidia/instruction-data-guard) | `text_field`, `label_field` | HuggingFace token |
| FineWebEduClassifier | Score educational value | [HuggingFaceFW/fineweb-edu-classifier](https://huggingface.co/HuggingFaceFW/fineweb-edu-classifier) | `label_field`, `int_field` | None |
| FineWebMixtralEduClassifier | Score educational value (Mixtral annotations) | [nvidia/nemocurator-fineweb-mixtral-edu-classifier](https://huggingface.co/nvidia/nemocurator-fineweb-mixtral-edu-classifier) | `label_field`, `int_field`, `model_inference_batch_size=1024` | None |
| FineWebNemotronEduClassifier | Score educational value (Nemotron annotations) | [nvidia/nemocurator-fineweb-nemotron-4-edu-classifier](https://huggingface.co/nvidia/nemocurator-fineweb-nemotron-4-edu-classifier) | `label_field`, `int_field`, `model_inference_batch_size=1024` | None |
| ContentTypeClassifier | Categorize by speech type | [nvidia/content-type-classifier-deberta](https://huggingface.co/nvidia/content-type-classifier-deberta) | `filter_by`, `text_field` | None |
| PromptTaskComplexityClassifier | Classify prompt tasks and complexity | [nvidia/prompt-task-and-complexity-classifier](https://huggingface.co/nvidia/prompt-task-and-complexity-classifier) | `text_field` | None |
| DomainClassifier | Assigns one of 26 domain labels (such as "Sports," "Science," "News") to English text | [nvidia/domain-classifier](https://huggingface.co/nvidia/domain-classifier) | `filter_by`, `text_field` | None |
| MultilingualDomainClassifier | Assigns domain labels to text in 52 languages; same labels as DomainClassifier | [nvidia/multilingual-domain-classifier](https://huggingface.co/nvidia/multilingual-domain-classifier) | `filter_by`, `text_field` | None |
| QualityClassifier | Rates document quality as "Low," "Medium," or "High" using a DeBERTa model | [nvidia/quality-classifier-deberta](https://huggingface.co/nvidia/quality-classifier-deberta) | `filter_by`, `text_field` | None |
| AegisClassifier | Detects unsafe content across 13 risk categories (violence, hate speech, and others) using LlamaGuard | [nvidia/Aegis-AI-Content-Safety-LlamaGuard-Defensive-1.0](https://huggingface.co/nvidia/Aegis-AI-Content-Safety-LlamaGuard-Defensive-1.0) | `aegis_variant`, `filter_by` | HuggingFace token |
| InstructionDataGuardClassifier | Identifies LLM poisoning attacks in instruction-response pairs | [nvidia/instruction-data-guard](https://huggingface.co/nvidia/instruction-data-guard) | `text_field`, `label_field` | HuggingFace token |
| FineWebEduClassifier | Scores educational value from 0 to 5 (0=spam, 5=scholarly) for training data selection | [HuggingFaceFW/fineweb-edu-classifier](https://huggingface.co/HuggingFaceFW/fineweb-edu-classifier) | `label_field`, `int_field` | None |
| FineWebMixtralEduClassifier | Scores educational value from 0 to 5 using Mixtral 8x22B annotation data | [nvidia/nemocurator-fineweb-mixtral-edu-classifier](https://huggingface.co/nvidia/nemocurator-fineweb-mixtral-edu-classifier) | `label_field`, `int_field`, `model_inference_batch_size=1024` | None |
| FineWebNemotronEduClassifier | Scores educational value from 0 to 5 using Nemotron-4-340B annotation data | [nvidia/nemocurator-fineweb-nemotron-4-edu-classifier](https://huggingface.co/nvidia/nemocurator-fineweb-nemotron-4-edu-classifier) | `label_field`, `int_field`, `model_inference_batch_size=1024` | None |
| ContentTypeClassifier | Categorizes text into 11 speech types (such as "Blogs," "News," "Academic") | [nvidia/content-type-classifier-deberta](https://huggingface.co/nvidia/content-type-classifier-deberta) | `filter_by`, `text_field` | None |
| PromptTaskComplexityClassifier | Labels prompts by task type (such as QA and summarization) and complexity dimensions | [nvidia/prompt-task-and-complexity-classifier](https://huggingface.co/nvidia/prompt-task-and-complexity-classifier) | `text_field` | None |

### Domain Classifier

Expand Down Expand Up @@ -365,6 +375,10 @@ pipeline.add_stage(writer)
results = pipeline.run() # Uses XennaExecutor by default
```

## Custom Model Integration
Comment thread
sarahyurick marked this conversation as resolved.
Resolved

You can integrate your own classification models by extending `DistributedDataClassifier`. Refer to the [Text Classifiers README](https://github.com/NVIDIA-NeMo/Curator/tree/main/nemo_curator/stages/text/classifiers#text-classifiers) for implementation details and examples.

## Performance Optimization

NVIDIA NeMo Curator's distributed classifiers are optimized for high-throughput processing through several key features:
Expand Down
2 changes: 1 addition & 1 deletion docs/curate-video/process-data/captions-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pipe.run()
:::{tab-item} Script Flags

```bash
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
... \
--generate-captions \
--captioning-algorithm qwen \
Expand Down
4 changes: 2 additions & 2 deletions docs/curate-video/process-data/clipping.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ pipe.run()

```bash
# Fixed stride
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
... \
--splitting-algorithm fixed_stride \
--fixed-stride-split-duration 10.0 \
--fixed-stride-min-clip-length-s 2.0 \
--limit-clips 0

# TransNetV2
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
... \
--splitting-algorithm transnetv2 \
--transnetv2-frame-decoder-mode pynvc \
Expand Down
2 changes: 1 addition & 1 deletion docs/curate-video/process-data/embeddings.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pipe.run()

```bash
# Cosmos-Embed1 (224p)
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
... \
--generate-embeddings \
--embedding-algorithm cosmos-embed1-224p \
Expand Down
4 changes: 2 additions & 2 deletions docs/curate-video/process-data/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pipe.run()

```bash
# Motion filtering
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
... \
--motion-filter enable \
--motion-decode-target-fps 2.0 \
Expand All @@ -95,7 +95,7 @@ python -m nemo_curator.examples.video.video_split_clip_example \
--motion-score-gpus-per-worker 0.5

# Aesthetic filtering
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
... \
--aesthetic-threshold 3.5 \
--aesthetic-reduction min \
Expand Down
4 changes: 2 additions & 2 deletions docs/curate-video/process-data/frame-extraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ pipe.run()

```bash
# Clip frames implicitly when generating embeddings or aesthetics
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
... \
--generate-embeddings \
--clip-extraction-target-res -1

# Full-video frames for TransNetV2 scene change
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
... \
--splitting-algorithm transnetv2 \
--transnetv2-frame-decoder-mode pynvc
Expand Down
4 changes: 2 additions & 2 deletions docs/curate-video/tutorials/beginner.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ pipeline.add_stage(
When using the example pipeline module, configure the writer-related flags:

```bash
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
--video-dir "$VIDEO_DIR" \
--model-dir "$MODEL_DIR" \
--output-clip-path "$OUT_DIR" \
--output-path "$OUT_DIR" \
--no-upload-clips # optional: do not write mp4s
--dry-run # optional: write nothing, validate only
--generate-embeddings # optional: enable embedding outputs
Expand Down
4 changes: 2 additions & 2 deletions docs/curate-video/tutorials/split-dedup.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ Learn how to run the splitting pipeline to generate clips and embeddings, then r
Run the splitting example. Set `VIDEO_DIR`, `OUT_DIR`, and `MODEL_DIR` first.

```bash
python -m nemo_curator.examples.video.video_split_clip_example \
python tutorials/video/getting-started/video_split_clip_example.py \
--video-dir "$VIDEO_DIR" \
--model-dir "$MODEL_DIR" \
--output-clip-path "$OUT_DIR" \
--output-path "$OUT_DIR" \
--splitting-algorithm fixed_stride \
--fixed-stride-split-duration 10.0 \
--embedding-algorithm cosmos-embed1-224p \
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ You can also run the pipeline using the downloaded configuration:

```bash
cd ~/nemo_curator
python -m nemo_curator.examples.audio.fleurs.run \
python tutorials/audio/fleurs/run.py \
--config-path ~/nemo_curator/configs \
--config-name fleurs_pipeline.yaml \
raw_data_dir=~/nemo_curator/audio_data
Expand Down
14 changes: 12 additions & 2 deletions docs/get-started/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ For this example, you'll need:

Here's a simple example to get started with NeMo Curator's image curation pipeline:

:::{note}
**CPU Memory Considerations**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add a note about lowering num_cpus during Ray Client set up.


Image loading and decoding happens in CPU memory before GPU processing. If you encounter out-of-memory errors during the `ImageReaderStage`, reduce:
- `batch_size`: Number of images per batch (reduce to 32-50 for systems with limited RAM)
- `num_threads`: Parallel decoding threads (reduce to 4 for systems with limited RAM)

The example below uses conservative defaults suitable for most systems. For high-memory systems, you can increase these values for better performance.
:::

```python
from nemo_curator.pipeline import Pipeline
from nemo_curator.backends.xenna import XennaExecutor
Expand All @@ -136,9 +146,9 @@ pipeline.add_stage(FilePartitioningStage(

# Stage 2: Read images from tar files using DALI
pipeline.add_stage(ImageReaderStage(
batch_size=100,
batch_size=50,
verbose=True,
num_threads=8,
num_threads=4,
num_gpus_per_worker=0.25,
))

Expand Down
10 changes: 9 additions & 1 deletion docs/get-started/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,15 @@ mkdir -p ~/nemo_curator/data/curated
```

```{note}
For this example, you'll need sample JSONL files in `~/nemo_curator/data/sample/`. Each line should be a JSON object with at least `text` and `id` fields. You can create test data or refer to {ref}`Read Existing Data <text-load-data-read-existing>` and {ref}`Data Loading <text-load-data>` for information on downloading data.
For this example, you need sample JSONL files in `~/nemo_curator/data/sample/`. Each line should be a JSON object with at least `text` and `id` fields. You can create test data or refer to {ref}`Read Existing Data <text-load-data-read-existing>` and {ref}`Data Loading <text-load-data>` for information on downloading data.
```

```{tip}
**Set your HuggingFace token** to avoid rate limiting when downloading models or datasets:

export HF_TOKEN="your_token_here"

Without a token, repeated downloads from Hugging Face may result in `429 Client Error` (rate limiting). Get a free token at [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens).
```

## Basic Text Curation Example
Expand Down
Loading
Loading