๐จ Data Designer Tutorial: Seeding Synthetic Data Generation with an External Datasetยถ
๐ What you'll learnยถ
In this notebook, we will demonstrate how to seed synthetic data generation in Data Designer with an external dataset.
If this is your first time using Data Designer, we recommend starting with the first notebook in this tutorial series.
๐ฆ Import Data Designerยถ
data_designer.configprovides access to the configuration API.DataDesigneris the main interface for data generation.
import data_designer.config as dd
from data_designer.interface import DataDesigner
โ๏ธ Initialize the Data Designer interfaceยถ
DataDesigneris the main object responsible for managing the data generation process.When initialized without arguments, the default model providers are used.
data_designer = DataDesigner()
๐๏ธ Define model configurationsยถ
Each
ModelConfigdefines a model that can be used during the generation process.The "model alias" is used to reference the model in the Data Designer config (as we will see below).
The "model provider" is the external service that hosts the model (see the model config docs for more details).
By default, we use build.nvidia.com as the model provider.
# This name is set in the model provider configuration.
MODEL_PROVIDER = "nvidia"
# The model ID is from build.nvidia.com.
MODEL_ID = "nvidia/nemotron-3-nano-30b-a3b"
# We choose this alias to be descriptive for our use case.
MODEL_ALIAS = "nemotron-nano-v3"
model_configs = [
dd.ModelConfig(
alias=MODEL_ALIAS,
model=MODEL_ID,
provider=MODEL_PROVIDER,
inference_parameters=dd.ChatCompletionInferenceParams(
temperature=1.0,
top_p=1.0,
max_tokens=2048,
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
),
)
]
๐๏ธ Initialize the Data Designer Config Builderยถ
The Data Designer config defines the dataset schema and generation process.
The config builder provides an intuitive interface for building this configuration.
The list of model configs is provided to the builder at initialization.
config_builder = dd.DataDesignerConfigBuilder(model_configs=model_configs)
๐ฅ Prepare a seed datasetยถ
For this notebook, we'll create a synthetic dataset of patient notes.
We will seed the generation process with a symptom-to-diagnosis dataset.
We already have the dataset downloaded in the data directory of this repository.
๐ฑ Why use a seed dataset?
Seed datasets let you steer the generation process by providing context that is specific to your use case.
Seed datasets are also an excellent way to inject real-world diversity into your synthetic data.
During generation, prompt templates can reference any of the seed dataset fields.
# Download sample dataset from Github
import urllib.request
url = "https://raw.githubusercontent.com/NVIDIA/GenerativeAIExamples/refs/heads/main/nemo/NeMo-Data-Designer/data/gretelai_symptom_to_diagnosis.csv"
local_filename, _ = urllib.request.urlretrieve(url, "gretelai_symptom_to_diagnosis.csv")
# Seed datasets are passed as reference objects to the config builder.
seed_source = dd.LocalFileSeedSource(path=local_filename)
config_builder.with_seed_dataset(seed_source)
DataDesignerConfigBuilder( seed_dataset: local seed )
๐จ Designing our synthetic patient notes datasetยถ
- The prompt template can reference fields from our seed dataset:
{{ diagnosis }}- the medical diagnosis from the seed data{{ patient_summary }}- the symptom description from the seed data
config_builder.add_column(
dd.SamplerColumnConfig(
name="patient_sampler",
sampler_type=dd.SamplerType.PERSON_FROM_FAKER,
params=dd.PersonFromFakerSamplerParams(),
)
)
config_builder.add_column(
dd.SamplerColumnConfig(
name="doctor_sampler",
sampler_type=dd.SamplerType.PERSON_FROM_FAKER,
params=dd.PersonFromFakerSamplerParams(),
)
)
config_builder.add_column(
dd.SamplerColumnConfig(
name="patient_id",
sampler_type=dd.SamplerType.UUID,
params=dd.UUIDSamplerParams(
prefix="PT-",
short_form=True,
uppercase=True,
),
)
)
config_builder.add_column(dd.ExpressionColumnConfig(name="first_name", expr="{{ patient_sampler.first_name }}"))
config_builder.add_column(dd.ExpressionColumnConfig(name="last_name", expr="{{ patient_sampler.last_name }}"))
config_builder.add_column(dd.ExpressionColumnConfig(name="dob", expr="{{ patient_sampler.birth_date }}"))
config_builder.add_column(
dd.SamplerColumnConfig(
name="symptom_onset_date",
sampler_type=dd.SamplerType.DATETIME,
params=dd.DatetimeSamplerParams(start="2024-01-01", end="2024-12-31"),
)
)
config_builder.add_column(
dd.SamplerColumnConfig(
name="date_of_visit",
sampler_type=dd.SamplerType.TIMEDELTA,
params=dd.TimeDeltaSamplerParams(dt_min=1, dt_max=30, reference_column_name="symptom_onset_date"),
)
)
config_builder.add_column(dd.ExpressionColumnConfig(name="physician", expr="Dr. {{ doctor_sampler.last_name }}"))
config_builder.add_column(
dd.LLMTextColumnConfig(
name="physician_notes",
prompt="""\
You are a primary-care physician who just had an appointment with {{ first_name }} {{ last_name }},
who has been struggling with symptoms from {{ diagnosis }} since {{ symptom_onset_date }}.
The date of today's visit is {{ date_of_visit }}.
{{ patient_summary }}
Write careful notes about your visit with {{ first_name }},
as Dr. {{ doctor_sampler.first_name }} {{ doctor_sampler.last_name }}.
Format the notes as a busy doctor might.
Respond with only the notes, no other text.
""",
model_alias=MODEL_ALIAS,
)
)
data_designer.validate(config_builder)
[12:14:15] [INFO] โ Validation passed
๐ Iteration is key โย preview the dataset!ยถ
Use the
previewmethod to generate a sample of records quickly.Inspect the results for quality and format issues.
Adjust column configurations, prompts, or parameters as needed.
Re-run the preview until satisfied.
preview = data_designer.preview(config_builder, num_records=2)
[12:14:15] [INFO] ๐บ Preview generation in progress
[12:14:15] [INFO] โ Validation passed
[12:14:16] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[12:14:16] [INFO] ๐ฉบ Running health checks for models...
[12:14:16] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[12:14:16] [INFO] |-- โ Passed!
[12:14:16] [INFO] ๐ฑ Sampling 2 records from seed dataset
[12:14:16] [INFO] |-- seed dataset size: 820 records
[12:14:16] [INFO] |-- sampling strategy: ordered
[12:14:16] [INFO] ๐ฒ Preparing samplers to generate 2 records across 5 columns
[12:14:16] [INFO] (๐พ + ๐พ) Concatenating 2 datasets
[12:14:16] [INFO] ๐งฉ Generating column `first_name` from expression
[12:14:16] [INFO] ๐งฉ Generating column `last_name` from expression
[12:14:16] [INFO] ๐งฉ Generating column `dob` from expression
[12:14:16] [INFO] ๐งฉ Generating column `physician` from expression
[12:14:16] [INFO] ๐ llm-text model config for column 'physician_notes'
[12:14:16] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[12:14:16] [INFO] |-- model alias: 'nemotron-nano-v3'
[12:14:16] [INFO] |-- model provider: 'nvidia'
[12:14:16] [INFO] |-- inference parameters:
[12:14:16] [INFO] | |-- generation_type=chat-completion
[12:14:16] [INFO] | |-- max_parallel_requests=4
[12:14:16] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[12:14:16] [INFO] | |-- temperature=1.00
[12:14:16] [INFO] | |-- top_p=1.00
[12:14:16] [INFO] | |-- max_tokens=2048
[12:14:16] [INFO] โก๏ธ Processing llm-text column 'physician_notes' with 4 concurrent workers
[12:14:16] [INFO] โฑ๏ธ llm-text column 'physician_notes' will report progress after each record
[12:14:21] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 1/2 (50%) complete, 1 ok, 0 failed, 0.21 rec/s, eta 4.9s
[12:14:23] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 2/2 (100%) complete, 2 ok, 0 failed, 0.28 rec/s, eta 0.0s
[12:14:23] [INFO] ๐ Model usage summary:
[12:14:23] [INFO] |-- model: nvidia/nemotron-3-nano-30b-a3b
[12:14:23] [INFO] |-- tokens: input=292, output=2457, total=2749, tps=371
[12:14:23] [INFO] |-- requests: success=2, failed=0, total=2, rpm=16
[12:14:23] [INFO] ๐ Measuring dataset column statistics:
[12:14:23] [INFO] |-- ๐ฒ column: 'patient_sampler'
[12:14:23] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[12:14:23] [INFO] |-- ๐ฒ column: 'patient_id'
[12:14:23] [INFO] |-- ๐งฉ column: 'first_name'
[12:14:23] [INFO] |-- ๐งฉ column: 'last_name'
[12:14:23] [INFO] |-- ๐งฉ column: 'dob'
[12:14:23] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[12:14:23] [INFO] |-- ๐ฒ column: 'date_of_visit'
[12:14:23] [INFO] |-- ๐งฉ column: 'physician'
[12:14:23] [INFO] |-- ๐ column: 'physician_notes'
[12:14:23] [INFO] ๐ Preview complete!
# Run this cell multiple times to cycle through the 2 preview records.
preview.display_sample_record()
Seed Columns โโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Name โ Value โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ diagnosis โ cervical spondylosis โ โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ patient_summary โ I've been having a lot of pain in my neck and back. I've also been having trouble with โ โ โ my balance and coordination. I've been coughing a lot and my limbs feel weak. โ โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Generated Columns โโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Name โ Value โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ patient_sampler โ { โ โ โ 'uuid': '7ffa1b26-cfeb-4304-9ab1-04a5418a5f4c', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'Aaron', โ โ โ 'last_name': 'Sampson', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Male', โ โ โ 'street_number': '6450', โ โ โ 'street_name': 'Davis Mall', โ โ โ 'city': 'East Emily', โ โ โ 'state': 'Connecticut', โ โ โ 'postcode': '21884', โ โ โ 'age': 41, โ โ โ 'birth_date': '1985-03-16', โ โ โ 'country': 'Mayotte', โ โ โ 'marital_status': 'separated', โ โ โ 'education_level': 'associates', โ โ โ 'unit': '', โ โ โ 'occupation': 'Fine artist', โ โ โ 'phone_number': '001-642-441-0963', โ โ โ 'bachelors_field': 'no_degree' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ doctor_sampler โ { โ โ โ 'uuid': '142f8d65-52f7-4e20-9276-729ee6b6a83d', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'James', โ โ โ 'last_name': 'Pope', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Male', โ โ โ 'street_number': '668', โ โ โ 'street_name': 'Dana Skyway', โ โ โ 'city': 'West Brian', โ โ โ 'state': 'Wyoming', โ โ โ 'postcode': '54180', โ โ โ 'age': 94, โ โ โ 'birth_date': '1932-03-24', โ โ โ 'country': 'Barbados', โ โ โ 'marital_status': 'married_present', โ โ โ 'education_level': 'graduate', โ โ โ 'unit': '', โ โ โ 'occupation': 'Oncologist', โ โ โ 'phone_number': '(946)562-5787', โ โ โ 'bachelors_field': 'arts_humanities' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ patient_id โ PT-17812B49 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ symptom_onset_date โ 2024-04-07 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ date_of_visit โ 2024-04-21 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician_notes โ **2024-04-21 | Aaron Sampson | 48M | MD - Cardiologist/Neurologist** โ โ โ **CC:** "Neck/back pain + worsening balance, cough, weakness" (3 wk) โ โ โ โ โ โ **HISTORY:** โ โ โ - **Onset:** 3 wk ago, progressive neck/back pain (worsens with movement, no โ โ โ radiculopathy) โ โ โ - **Neuro:** Dysexecutive function? (Denies memory lapses), but **new bilateral lower โ โ โ limb weakness** (graded 4/5), **unsteady gait** (needs wall support), **frequent โ โ โ falls** (3x in 2 wk). โ โ โ - **Cough:** Daily, non-productive, worse with exertion (no hemoptysis). โ โ โ - **Spondylosis:** Known since 2024-04-07; **no prior imaging** (patient delayed โ โ โ evaluation). โ โ โ - **PMH:** HTN, DM2, Tobacco (1 PPD ร 20 yr), Obesity (BMI 32). โ โ โ - **Medications:** Lisinopril 10mg daily, Metformin 1000mg BID. โ โ โ - **Allergies:** NKDA. โ โ โ - **Soc:** Lives alone, minimal support. โ โ โ โ โ โ **EXAM:** โ โ โ - **Vitals:** T 98.4ยฐF, HR 82, BP 138/86, RR 18, SpO2 96% RA. โ โ โ - **Neuro:** โ โ โ - Strength: 4/5 in L/LEs (bilat), 5/5 UE. โ โ โ - Gait: **Wide-based, unsteady**, requires assistance. โ โ โ - Reflexes: 2+ in biceps/knees, hyperreflexia noted in heels? โ โ โ - Sensation: Diminished proprioception in feet. โ โ โ - **Resp:** Crackles at bilateral bases (no wheezing). โ โ โ - **Cardiac:** Normal S1/S2, no murmurs. โ โ โ - **CNS:** No asterixis, no pronator drift. โ โ โ โ โ โ **ASSESSMENT:** โ โ โ 1. **Cervical Spondylosis (Progressive) with Neurogenic Signs** โ โ โ - Worsening myelopathy (L/L weakness, gait instability, hyperreflexia). โ โ โ - **Biomechanical cause:** Undiagnosed severe stenosis (C5-C7) likely compressing โ โ โ cord. โ โ โ 2. **Dyspnea on Exertion + Cough** โ โ โ - Suspected **right heart strain** (secondary to chronic hypoxia from cervical โ โ โ dysfunction? Unlikely; consider *pulmonary involvement* or *CA doxorubicin?* โ **Rule โ โ โ out infection**). โ โ โ 3. **Fall Risk** โ โ โ - **Urgent:** High fall risk (weakness + gait instability). โ โ โ โ โ โ **PLAN:** โ โ โ - **IMMEDIATE TESTING:** โ โ โ - **MRI C-spine (cervical)** โ *Order STAT* (C5-C7 focus). *Cancel prior 2024-04-07 โ โ โ order*. โ โ โ - **Pulmonary Function Tests (PFTs)** โ Rule out restrictive lung disease (cough + โ โ โ crackles). โ โ โ - **Serum Calcium + Vitamin D** โ Nutritional deficiency exacerbating bone issues? โ โ โ - **EMERGENCY REFERRALS:** โ โ โ - **Neurosurgery** โ For urgent evaluation of cervical myelopathy. โ โ โ - **Physical Therapy** โ Fall risk assessment, gait training. โ โ โ - **MEDICATIONS:** โ โ โ - Continue current meds. *Avoid NSAIDs* (GI risk, renal). โ โ โ - *Add*: Vitamin D 2000 IU daily (if low). โ โ โ - **PATIENT EDUCATION:** โ โ โ - **Fall Prevention:** Install grab bars, use cane, avoid stairs. โ โ โ - **Activity Restriction:** No heavy lifting, neck strain. โ โ โ - **Red Flags:** New weakness, urinary incontinence, or vision changes โ *ER โ โ โ immediately*. โ โ โ - **FOLLOW-UP:** โ โ โ - **Neurosurgery Clinic:** 1 wk after MRI results. โ โ โ - **Pulmonology:** If PFTs abnormal. โ โ โ - **Primary Care:** 1 wk for test results review. โ โ โ โ โ โ **NOTE:** Patient anxious about "neck problem" but denies hearing loss (denies prior โ โ โ diagnosis). **Biomechanical correlation confirmed: Pathology is mechanical โ โ โ (spondylosis), not infectious/neoplastic.** Urgent intervention required to prevent โ โ โ permanent cord damage. โ โ โ โ โ โ --- โ โ โ *Note: "Compound bow" exposure irrelevant; chronic exposure to *lead/mercury*? No, โ โ โ patient reports *hand-tightening* (likely tool-related stress) โ not acute exposure. โ โ โ Focus on cervical spine.* โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ first_name โ Aaron โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ last_name โ Sampson โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ dob โ 1985-03-16 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician โ Dr. Pope โ โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# The preview dataset is available as a pandas DataFrame.
preview.dataset
| diagnosis | patient_summary | patient_sampler | doctor_sampler | patient_id | symptom_onset_date | date_of_visit | first_name | last_name | dob | physician | physician_notes | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | cervical spondylosis | I've been having a lot of pain in my neck and ... | {'uuid': '7ffa1b26-cfeb-4304-9ab1-04a5418a5f4c... | {'uuid': '142f8d65-52f7-4e20-9276-729ee6b6a83d... | PT-17812B49 | 2024-04-07 | 2024-04-21 | Aaron | Sampson | 1985-03-16 | Dr. Pope | **2024-04-21 | Aaron Sampson | 48M | MD - Card... |
| 1 | impetigo | I have a rash on my face that is getting worse... | {'uuid': 'f0909b01-7a4e-4a0e-adab-1a8aaffd0947... | {'uuid': '8631be7a-05d1-4223-aa8b-4cabbe2be0f3... | PT-0EC52E07 | 2024-02-15 | 2024-03-10 | Jasmine | Thomas | 1959-11-23 | Dr. Castillo | **Patient:** Jasmine Thomas \n**DOB:** 09/12/... |
๐ Analyze the generated dataยถ
Data Designer automatically generates a basic statistical analysis of the generated data.
This analysis is available via the
analysisproperty of generation result objects.
# Print the analysis as a table.
preview.analysis.to_report()
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐จ Data Designer Dataset Profile โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Dataset Overview โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ number of records โ number of columns โ percent complete records โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ 2 โ 10 โ 100.0% โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ฒ Sampler Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ sampler type โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ patient_sampler โ dict โ 2 (100.0%) โ person_from_faker โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ doctor_sampler โ dict โ 2 (100.0%) โ person_from_faker โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ patient_id โ string โ 2 (100.0%) โ uuid โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ symptom_onset_date โ string โ 2 (100.0%) โ datetime โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ date_of_visit โ string โ 2 (100.0%) โ timedelta โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ LLM-Text Columns โโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ prompt tokens โ completion tokens โ โ column name โ data type โ number unique values โ per record โ per record โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ physician_notes โ string โ 2 (100.0%) โ 122.5 +/- 4.5 โ 1166.5 +/- 221.3 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ Expression Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ first_name โ string โ 2 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ last_name โ string โ 2 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ dob โ string โ 2 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician โ string โ 2 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Table Notes โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ โ โ 1. All token statistics are based on a sample of max(1000, len(dataset)) records. โ โ 2. Tokens are calculated using tiktoken's cl100k_base tokenizer. โ โ โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Scale up!ยถ
Happy with your preview data?
Use the
createmethod to submit larger Data Designer generation jobs.
results = data_designer.create(config_builder, num_records=10, dataset_name="tutorial-3")
[12:14:24] [INFO] ๐จ Creating Data Designer dataset
[12:14:24] [INFO] โ Validation passed
[12:14:24] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[12:14:24] [INFO] ๐ฉบ Running health checks for models...
[12:14:24] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[12:14:24] [INFO] |-- โ Passed!
[12:14:24] [INFO] โณ Processing batch 1 of 1
[12:14:24] [INFO] ๐ฑ Sampling 10 records from seed dataset
[12:14:24] [INFO] |-- seed dataset size: 820 records
[12:14:24] [INFO] |-- sampling strategy: ordered
[12:14:24] [INFO] ๐ฒ Preparing samplers to generate 10 records across 5 columns
[12:14:24] [INFO] (๐พ + ๐พ) Concatenating 2 datasets
[12:14:24] [INFO] ๐งฉ Generating column `first_name` from expression
[12:14:24] [INFO] ๐งฉ Generating column `last_name` from expression
[12:14:24] [INFO] ๐งฉ Generating column `dob` from expression
[12:14:24] [INFO] ๐งฉ Generating column `physician` from expression
[12:14:24] [INFO] ๐ llm-text model config for column 'physician_notes'
[12:14:24] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[12:14:24] [INFO] |-- model alias: 'nemotron-nano-v3'
[12:14:24] [INFO] |-- model provider: 'nvidia'
[12:14:24] [INFO] |-- inference parameters:
[12:14:24] [INFO] | |-- generation_type=chat-completion
[12:14:24] [INFO] | |-- max_parallel_requests=4
[12:14:24] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[12:14:24] [INFO] | |-- temperature=1.00
[12:14:24] [INFO] | |-- top_p=1.00
[12:14:24] [INFO] | |-- max_tokens=2048
[12:14:24] [INFO] โก๏ธ Processing llm-text column 'physician_notes' with 4 concurrent workers
[12:14:24] [INFO] โฑ๏ธ llm-text column 'physician_notes' will report progress after each record
[12:14:26] [INFO] |-- ๐ฅ llm-text column 'physician_notes' progress: 1/10 (10%) complete, 1 ok, 0 failed, 0.52 rec/s, eta 17.3s
[12:14:28] [INFO] |-- ๐ฅ llm-text column 'physician_notes' progress: 2/10 (20%) complete, 2 ok, 0 failed, 0.55 rec/s, eta 14.5s
[12:14:29] [INFO] |-- ๐ฃ llm-text column 'physician_notes' progress: 3/10 (30%) complete, 3 ok, 0 failed, 0.63 rec/s, eta 11.1s
[12:14:29] [INFO] |-- ๐ฃ llm-text column 'physician_notes' progress: 4/10 (40%) complete, 4 ok, 0 failed, 0.81 rec/s, eta 7.4s
[12:14:29] [INFO] |-- ๐ฅ llm-text column 'physician_notes' progress: 5/10 (50%) complete, 5 ok, 0 failed, 0.99 rec/s, eta 5.0s
[12:14:31] [INFO] |-- ๐ฅ llm-text column 'physician_notes' progress: 6/10 (60%) complete, 6 ok, 0 failed, 0.84 rec/s, eta 4.8s
[12:14:31] [INFO] |-- ๐ฅ llm-text column 'physician_notes' progress: 7/10 (70%) complete, 7 ok, 0 failed, 0.95 rec/s, eta 3.2s
[12:14:32] [INFO] |-- ๐ค llm-text column 'physician_notes' progress: 8/10 (80%) complete, 8 ok, 0 failed, 1.06 rec/s, eta 1.9s
[12:14:32] [INFO] |-- ๐ค llm-text column 'physician_notes' progress: 9/10 (90%) complete, 9 ok, 0 failed, 1.09 rec/s, eta 0.9s
[12:14:38] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 10/10 (100%) complete, 10 ok, 0 failed, 0.70 rec/s, eta 0.0s
[12:14:39] [INFO] ๐ Model usage summary:
[12:14:39] [INFO] |-- model: nvidia/nemotron-3-nano-30b-a3b
[12:14:39] [INFO] |-- tokens: input=1430, output=7471, total=8901, tps=608
[12:14:39] [INFO] |-- requests: success=10, failed=0, total=10, rpm=40
[12:14:39] [INFO] ๐ Measuring dataset column statistics:
[12:14:39] [INFO] |-- ๐ฒ column: 'patient_sampler'
[12:14:39] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[12:14:39] [INFO] |-- ๐ฒ column: 'patient_id'
[12:14:39] [INFO] |-- ๐งฉ column: 'first_name'
[12:14:39] [INFO] |-- ๐งฉ column: 'last_name'
[12:14:39] [INFO] |-- ๐งฉ column: 'dob'
[12:14:39] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[12:14:39] [INFO] |-- ๐ฒ column: 'date_of_visit'
[12:14:39] [INFO] |-- ๐งฉ column: 'physician'
[12:14:39] [INFO] |-- ๐ column: 'physician_notes'
# Load the generated dataset as a pandas DataFrame.
dataset = results.load_dataset()
dataset.head()
| diagnosis | patient_summary | patient_sampler | doctor_sampler | patient_id | symptom_onset_date | date_of_visit | first_name | last_name | dob | physician | physician_notes | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | cervical spondylosis | I've been having a lot of pain in my neck and ... | {'age': 46, 'bachelors_field': 'arts_humanitie... | {'age': 103, 'bachelors_field': 'business', 'b... | PT-6143B461 | 2024-02-24 | 2024-03-20 | Mary | Perry | 1980-02-19 | Dr. Moore | Pt: Mary Perry DOB: 02/1988 Visit: 03/20/2... |
| 1 | impetigo | I have a rash on my face that is getting worse... | {'age': 76, 'bachelors_field': 'arts_humanitie... | {'age': 94, 'bachelors_field': 'no_degree', 'b... | PT-0030B0B9 | 2024-10-20 | 2024-11-11 | Molly | Brown | 1949-06-07 | Dr. Wheeler | **Visit Note โ 11/11/2024** **Patient:** Mol... |
| 2 | urinary tract infection | I have been urinating blood. I sometimes feel ... | {'age': 89, 'bachelors_field': 'education', 'b... | {'age': 102, 'bachelors_field': 'no_degree', '... | PT-0A957026 | 2024-06-18 | 2024-06-19 | Kathy | Hunt | 1936-11-30 | Dr. Bass | **Note โ 06/19/2024 โ Office Visit** **Pt:**... |
| 3 | arthritis | I have been having trouble with my muscles and... | {'age': 43, 'bachelors_field': 'no_degree', 'b... | {'age': 62, 'bachelors_field': 'education', 'b... | PT-DAC8D744 | 2024-07-15 | 2024-07-25 | Heather | Reilly | 1982-06-10 | Dr. Fletcher | **Patient:** Heather Reilly **DOB:** [redact... |
| 4 | dengue | I have been feeling really sick. My body hurts... | {'age': 101, 'bachelors_field': 'no_degree', '... | {'age': 37, 'bachelors_field': 'no_degree', 'b... | PT-92B3385C | 2024-02-12 | 2024-03-08 | Jason | Pacheco | 1924-05-08 | Dr. White | - 2024-03-08 Visit w/ Jason Pacheco (32M) โ De... |
# Load the analysis results into memory.
analysis = results.load_analysis()
analysis.to_report()
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐จ Data Designer Dataset Profile โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Dataset Overview โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ number of records โ number of columns โ percent complete records โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ 10 โ 10 โ 100.0% โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ฒ Sampler Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ sampler type โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ patient_sampler โ dict โ 10 (100.0%) โ person_from_faker โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ doctor_sampler โ dict โ 10 (100.0%) โ person_from_faker โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ patient_id โ string โ 10 (100.0%) โ uuid โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ symptom_onset_date โ string โ 10 (100.0%) โ datetime โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ date_of_visit โ string โ 9 (90.0%) โ timedelta โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ LLM-Text Columns โโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ prompt tokens โ completion tokens โ โ column name โ data type โ number unique values โ per record โ per record โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ physician_notes โ string โ 10 (100.0%) โ 117.5 +/- 5.8 โ 671.0 +/- 252.4 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ Expression Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ first_name โ string โ 9 (90.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ last_name โ string โ 10 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ dob โ string โ 10 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician โ string โ 10 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Table Notes โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ โ โ 1. All token statistics are based on a sample of max(1000, len(dataset)) records. โ โ 2. Tokens are calculated using tiktoken's cl100k_base tokenizer. โ โ โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โญ๏ธ Next Stepsยถ
Check out the following notebook to learn more about: