curate/nemo_curator Configuration#
The curate/nemo_curator step reads JSONL text with NeMo Curator, optionally materializes a Hugging Face snapshot, applies language, word-count, and domain gates and an optional approved filter policy, and writes JSONL shards.
It is the only curation step that drops rows.
The step reads YAML from src/nemotron/steps/curate/nemo_curator/config/.
File |
Purpose |
|---|---|
|
Curator-container verification configuration. Optional filters are disabled. Override |
|
Example Hugging Face snapshot workflow for FineWeb-Edu-style JSONL with language and word-count filters enabled. |
|
Flow configurations, read by the flow driver rather than by this step. Refer to Curate Flow Configuration. |
Inputs and Outputs#
Direction |
Artifact type |
Required |
Content |
|---|---|---|---|
Consumes |
|
Yes |
Raw JSONL records, or a Hugging Face snapshot materialized before Curator reads |
Consumes |
|
No |
An approved policy whose thresholds the step applies. Without one, the step runs its language, length, and domain gates and the manifest records that no thresholds were applied. |
Produces |
|
Filtered JSONL records. Language and domain annotations are present only when those gates are enabled. |
|
Produces |
|
|
|
Produces |
|
|
Input and Output Fields#
- input_glob#
JSONL file path or glob passed to NeMo Curator
JsonlReader. The step reads.jsonl,.json, and.ndjson; Parquet must pass throughcurate/ingestfirst.
- output_dir#
Directory where NeMo Curator writes JSONL output shards.
- text_field#
Record field containing the text to curate.
Default:
text.
- metadata_fields#
Extra record fields to carry through the pipeline.
JsonlReadertreats fields as a projection, so any field omitted here is discarded at the first stage. An empty list reproduces the text-only read.Default:
[].
- id_field#
Field holding the source corpus’s own document identifier, recorded in the run manifest. This is the only document identifier that survives resharding; Curator’s
AddIdis positional.Default:
null.
- source_field#
Field naming the corpus a record came from. When set, the run manifest carries per-source input and output counts.
Default:
null.
- dataset#
Optional keyword arguments passed to
huggingface_hub.snapshot_download, such asrepo_id,repo_type,local_dir, andallow_patterns. Setdataset: nullfor local-input-only runs.Default:
null.
Policy Fields#
- heuristic_filters#
Approved filter policy block.
approved_policy: path of a promoted policy file. A candidate policy fromcurate/profilecarriesapproved: falseand is refused unlessallow_unvalidated_policyis set.allow_unvalidated_policy: apply a policy that does not meet the approval contract. The run logs a warning naming the policy and recordsoverride_unvalidatedin the manifest.langpack_dir: root of the language packs. Required when the policy uses pack-backed signals; no production pack is bundled or selected implicitly.langpack_content_hash: optional expected content hash of the pack. It pins the pack but does not replacelangpack_dir.tokenizer:{name, revision}mapping, required when the policy namestoken_count.
Signal names in a policy resolve through the closed registry in
runtime/registry.py, never through an import path. Refer to Filter Policy File.Default:
null.
- mode#
How the approved policy’s own signals are applied. One of
filter,annotate, orboth. Applies only whenheuristic_filtersnames a policy.modeRows the policy removes
Columns added
filterRejected rows
None; scores are discarded after use
annotateNone
__<signal>for every rowbothRejected rows
__<signal>for the survivorsmodedoes not govern the language, word-count, or domain gates, which drop rows under every mode.annotateis not a non-destructive mode when those gates are configured.Default:
filter.
Gate Fields#
- language_codes#
Uppercase language codes to keep. Set
language_codes: []to skip FastText language identification and language filtering. When the list is non-empty,models.fasttext_langidmust point at a FastText language identification model.Default:
[EN].
- quality_filters#
Optional quality settings.
min_langid_scoreapplies when language filtering is enabled.min_wordsandmax_wordsenable Curator’sWordCountFilterand must be provided together. They are not shipped as defaults becauseWordCountFiltersplits on whitespace and therefore removes a large share of a corpus in a language written without spaces. A run that declares a language pack is refused unless the pack declaresword_segmentation. Setquality_filters: {}to skip word-count filtering.Default:
{min_langid_score: 0.3}.
- domains#
Domains to keep through NeMo Curator
MultilingualDomainClassifier. Setdomains: []to skip domain classification.Default:
[].
- annotate_domains#
Run
MultilingualDomainClassifierwithout filtering: every document receives a label and none are dropped. Use it on a first run to obtain the domain distribution before choosing which domains to keep. Ignored whendomainsis non-empty, which already runs the classifier.Default:
false.
- domain_score_field#
Optional column for Curator’s complete class-probability vector, in model label order. It is not a scalar confidence. Absent, only the argmax label is recorded.
Default:
null.
Accounting Fields#
- emit_manifest#
Path for the run manifest describing what the run read, wrote, and whether it finished.
nullwrites none.Default:
null.
- emit_ledger#
Path for the run’s record accounting, consumed by
curate/audit. Without it an audit can detect that records are missing but cannot distinguish a record removed by a gate from one lost to a swallowed exception. Curator reports no per-stage removal counts, so the ledger attributes such removals tounattributedand states so in its notes.Default:
null.
Runtime Fields#
- models#
Optional model and cache paths.
fasttext_langidis required whenlanguage_codesis non-empty.hf_cache_diris the Hugging Face cache directory for classifier assets.Default:
null.
- ray.num_cpus#
Optional Ray CPU count. If omitted, the Lepton curate profile can provide
NEMOTRON_CURATOR_RAY_NUM_CPUS.Default:
null.
How the Stages Combine#
Every enabled stage must accept a record for it to be written: the gates combine with logical AND.
Within a list-valued parameter such as language_codes or domains, entries combine with OR.
Gate length in one place, either quality_filters or the policy; declaring the same gate twice builds two stages for it, and the per-gate breakdown in the ledger no longer reconciles with the removal measured on disk.
Minimal Local Configuration#
language_codes: []
domains: []
text_field: text
input_glob: ./data/**/*.jsonl
output_dir: ./output/curated-jsonl
dataset: null
models: {}
quality_filters: {}
Filtered Configuration#
language_codes:
- EN
domains: []
text_field: text
input_glob: ./data/**/*.jsonl
output_dir: ./output/curated-jsonl
dataset: null
models:
fasttext_langid: ./cache/models/fasttext/lid.176.bin
hf_cache_dir: ./cache/huggingface
quality_filters:
min_langid_score: 0.3
min_words: 50
max_words: 5000
Policy Configuration#
input_glob: ./output/vi/ingested/*.jsonl
output_dir: ./output/vi/filtered_jsonl
text_field: text
id_field: id
source_field: source
metadata_fields: [id, source, url]
language_codes: []
domains: []
quality_filters: {}
dataset: null
mode: both
heuristic_filters:
approved_policy: ./output/vi/policy/approved_policy.yaml
langpack_dir: ./src/nemotron/steps/curate/nemo_curator/data/langpacks
emit_manifest: ./output/vi/filtered_jsonl/run_manifest.json
emit_ledger: ./output/vi/filtered_jsonl/curation_ledger.json