Hub documentation

数据设计师

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

数据设计师

Data Designer 是 NVIDIA NeMo 中用于利用 LLM 生成高质量合成数据集的框架。它允许您使用统计采样器、LLM 或现有的种子数据集来创建多样化的数据。

先决条件

pip install data-designer

从 Hub 下载数据集作为种子

使用 HuggingFaceSeedSource 直接从 Hub 加载数据集,作为生成过程的种子数据。

import data_designer.config as dd
from data_designer.interface import DataDesigner

data_designer = DataDesigner()
config_builder = dd.DataDesignerConfigBuilder()

# Load seed data from HuggingFace
seed_source = dd.HuggingFaceSeedSource(
    path="datasets/gretelai/symptom_to_diagnosis/data/train.parquet",
    token="hf_...",  # Optional, for private datasets
)
config_builder.with_seed_dataset(seed_source)

# Reference seed columns in prompts
config_builder.add_column(
    dd.LLMTextColumnConfig(
        name="physician_notes",
        model_alias="openai-gpt-5",
        prompt="Write notes for a patient with {{ diagnosis }}. Symptoms: {{ patient_summary }}",
    )
)

preview = data_designer.preview(config_builder, num_records=5)

将生成的数据集推送到 Hub

使用内置的 push_to_hub 方法将生成的数据集上传到 Hub。

# Generate dataset
results = data_designer.create(config_builder, num_records=1000, dataset_name="my-dataset")

# Push to Hub
url = results.push_to_hub(
    repo_id="username/my-synthetic-dataset",
    description="Synthetic dataset generated with Data Designer.",
    tags=["medical", "notes"],
    private=False,
)

资源

Update on GitHub