๐จ 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)
[21:16:05] [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)
[21:16:05] [INFO] ๐ญ Preview generation in progress
[21:16:05] [INFO] |-- ๐ Jinja rendering engine: secure
[21:16:05] [INFO] โ Validation passed
[21:16:05] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[21:16:05] [INFO] ๐ฉบ Running health checks for models...
[21:16:05] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[21:16:05] [INFO] |-- โ Passed!
[21:16:05] [INFO] โก DATA_DESIGNER_ASYNC_ENGINE is enabled - using async task-queue preview
[21:16:05] [INFO] ๐ llm-text model config for column 'physician_notes'
[21:16:05] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[21:16:05] [INFO] |-- model alias: 'nemotron-nano-v3'
[21:16:05] [INFO] |-- model provider: 'nvidia'
[21:16:05] [INFO] |-- inference parameters:
[21:16:05] [INFO] | |-- generation_type=chat-completion
[21:16:05] [INFO] | |-- max_parallel_requests=4
[21:16:05] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[21:16:05] [INFO] | |-- temperature=1.00
[21:16:05] [INFO] | |-- top_p=1.00
[21:16:05] [INFO] | |-- max_tokens=2048
[21:16:05] [INFO] โก๏ธ Async generation: 1 column(s) (physician_notes), 2 tasks across 1 row group(s)
[21:16:05] [INFO] ๐ (1/1) Dispatching with 2 records
[21:16:05] [INFO] ๐ฒ (1/1) Preparing samplers to generate 2 records across 5 columns
[21:16:05] [INFO] ๐ฑ (1/1) Sampling 2 records from seed dataset
[21:16:05] [INFO] |-- seed dataset size: 820 records
[21:16:05] [INFO] |-- sampling strategy: ordered
[21:16:05] [INFO] ๐งฉ (1/1) Generating column `last_name` from expression
[21:16:05] [INFO] ๐งฉ (1/1) Generating column `first_name` from expression
[21:16:05] [INFO] ๐งฉ (1/1) Generating column `dob` from expression
[21:16:05] [INFO] ๐งฉ (1/1) Generating column `physician` from expression
[21:16:11] [INFO] ๐ Progress [5.4s]:
[21:16:11] [INFO] |-- ๐ฆ physician_notes: 2/2 (100%) 0.4 rec/s
[21:16:11] [INFO] โ Async generation complete [5.4s]: 2 ok, 0 failed across 1 column(s)
[21:16:11] [INFO] ๐ Model usage summary:
[21:16:11] [INFO] |-- model: nvidia/nemotron-3-nano-30b-a3b
[21:16:11] [INFO] |-- tokens: input=330, output=2097, total=2427, tps=447
[21:16:11] [INFO] |-- requests: success=2, failed=0, total=2, rpm=22
[21:16:11] [INFO] ๐ Measuring dataset column statistics:
[21:16:11] [INFO] |-- ๐ฒ column: 'patient_sampler'
[21:16:11] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[21:16:11] [INFO] |-- ๐ฒ column: 'patient_id'
[21:16:11] [INFO] |-- ๐งฉ column: 'first_name'
[21:16:11] [INFO] |-- ๐งฉ column: 'last_name'
[21:16:11] [INFO] |-- ๐งฉ column: 'dob'
[21:16:11] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[21:16:11] [INFO] |-- ๐ฒ column: 'date_of_visit'
[21:16:11] [INFO] |-- ๐งฉ column: 'physician'
[21:16:11] [INFO] |-- ๐ column: 'physician_notes'
[21:16:11] [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': 'e6cc69aa-eb8c-4d4d-85e5-b4567442f910', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'Steven', โ โ โ 'last_name': 'Scott', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Male', โ โ โ 'street_number': '921', โ โ โ 'street_name': 'Natalie Shoals', โ โ โ 'city': 'New Traciebury', โ โ โ 'state': 'New Jersey', โ โ โ 'postcode': '86377', โ โ โ 'age': 101, โ โ โ 'birth_date': '1925-03-31', โ โ โ 'country': 'Belarus', โ โ โ 'marital_status': 'never_married', โ โ โ 'education_level': 'some_college', โ โ โ 'unit': '', โ โ โ 'occupation': 'Waste management officer', โ โ โ 'phone_number': '(600)971-3499x343', โ โ โ 'bachelors_field': 'no_degree' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ doctor_sampler โ { โ โ โ 'uuid': '4ff220cc-0ee1-4a8c-ac72-bc0dd5f94aa5', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'Nancy', โ โ โ 'last_name': 'Mcneil', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Female', โ โ โ 'street_number': '407', โ โ โ 'street_name': 'Gonzales Cliff', โ โ โ 'city': 'South Rhonda', โ โ โ 'state': 'Colorado', โ โ โ 'postcode': '72426', โ โ โ 'age': 56, โ โ โ 'birth_date': '1970-02-28', โ โ โ 'country': 'Iraq', โ โ โ 'marital_status': 'never_married', โ โ โ 'education_level': 'associates', โ โ โ 'unit': '', โ โ โ 'occupation': 'Psychologist, counselling', โ โ โ 'phone_number': '+1-777-863-7905x1240', โ โ โ 'bachelors_field': 'no_degree' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ patient_id โ PT-29834168 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ symptom_onset_date โ 2024-02-09T00:00:00 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ date_of_visit โ 2024-03-07T00:00:00 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician_notes โ **Patient:** Steven Scott โ โ โ **DOB:** [Not provided] โ โ โ **Date of Visit:** 2024-03-07 โ โ โ **Chief Complaint:** "Neck and back pain, balance issues, chronic cough, limb โ โ โ weakness." โ โ โ **HPI:** 65M with history of cervical spondylosis (diagnosed 2024-02-09). Reports โ โ โ worsening neck/back pain, subjective imbalance/coordination problems, recurrent cough โ โ โ (non-smoker, no recent URI), and proximal muscle weakness (difficulty rising from โ โ โ chairs, climbing stairs). Symptoms constant, non-traumatic, no radicular symptoms (no โ โ โ arm pain/numbness). Denies bowel/bladder changes, fever, weight loss, or trauma. โ โ โ **PMH:** Controlled HTN, hyperlipidemia. No prior spine surgery. โ โ โ **Medications:** Lisinopril, Atorvastatin. โ โ โ **Allergies:** NKDA. โ โ โ **ROS:** โ โ โ - Neuro: New imbalance, distal weakness (legs more than arms), no myelopathy signs โ โ โ (no gait deterioration, bladder issues). โ โ โ - Musculoskeletal: Chronic neck/back pain, stiffness. โ โ โ - Respiratory: Chronic cough (dry, no hemoptysis). โ โ โ - GI: No nausea/vomiting. โ โ โ - Skin: No rashes. โ โ โ **Physical Exam:** โ โ โ - Vitals: RR 18, T 98.6ยฐF, BP 138/88, P 72, SpOโ 98% RA. โ โ โ - Neuro: โ โ โ - Strength: 4/5 in proximal leg muscles (quadriceps/hamstrings), 5/5 distal; 4/5 โ โ โ proximal arm, 5/5 distal. โ โ โ - Reflexes: Diminished patellar (knees), biceps normal. โ โ โ - Coordination: Positive Romberg test (unsteadiness with eyes closed). โ โ โ - Sensation: Reduced proprioception in feet (vibration sense). โ โ โ - Musculoskeletal: Cervical/ lumbar tenderness, limited ROM (neck flexion/extension). โ โ โ - No clonus, Babinski negative. โ โ โ - Other: Normal heart/lungs. โ โ โ **Assessment:** โ โ โ - 1. Cervical spondylosis with progressive myelopathic symptoms? โ โ โ - *Rationale:* New neuro deficits (weakness, balance), cervical tenderness, ROM โ โ โ limitation. **Rule out myelopathy** vs. peripheral neuropathy (vibration loss) or โ โ โ vascular cause. โ โ โ - 2. Chronic cough etiology? โ โ โ - *Rationale:* Non-smoker, no URI, but persistent cough warrants evaluation (e.g., โ โ โ GERD, ACEi-related, or less likely respiratory). โ โ โ - 3. Peripheral neuropathy? โ โ โ - *Rationale:* Vibration loss, distal weakness, but pattern more proximalโsuggests โ โ โ cervical pathology vs. primary neuropathy. โ โ โ - 4. Secondary concerns: HTN control, medication adherence. โ โ โ **Plan:** โ โ โ - **Neuro:** โ โ โ - Order cervical MRI (cervical spine, T1-T2, sagittal/dynamic flexion-extension). โ โ โ - Consider EMG/NCS if MRI negative (evaluate for neuropathy). โ โ โ - **Urgent referral to Neurology** for myelopathy evaluation (e.g., gait โ โ โ assessment, SSEPs). โ โ โ - **Cough:** โ โ โ - Discontinue ACEi? *No*โpatient on lisinopril (no recent cough onset โ โ โ post-initiation). โ โ โ - Trial PPI (e.g., omeprazole) for GERD; refer to PCP/gastro if no improvement. โ โ โ - **Imaging:** โ โ โ - Order X-ray: Cervical spine AP/LAT, lateral views. โ โ โ - Follow-up in 4 weeks to review imaging/neuro referral. โ โ โ - **Symptom Management:** โ โ โ - Avoid neck hyperextension; ergonomic adjustments. โ โ โ - PT referral for cervical stabilization exercises. โ โ โ - **Reassess fall risk** (home safety, footwear). โ โ โ - **Follow-Up:** โ โ โ - Return in 4 weeks for imaging results, neuro consult, and symptom review. โ โ โ - **Do not delay** neurology referral due to myelopathic features. โ โ โ **Provider Notes:** *High suspicion for progressive cervical myelopathyโneuro workup โ โ โ is priority. Avoid attributing cough to spondylosis; investigate independently. โ โ โ Patient anxious about "neurological decline"; explain steps clearly to reduce โ โ โ concern.* โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ first_name โ Steven โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ last_name โ Scott โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ dob โ 1925-03-31 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician โ Dr. Mcneil โ โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# 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 | last_name | first_name | dob | physician | physician_notes | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | cervical spondylosis | I've been having a lot of pain in my neck and ... | {'uuid': 'e6cc69aa-eb8c-4d4d-85e5-b4567442f910... | {'uuid': '4ff220cc-0ee1-4a8c-ac72-bc0dd5f94aa5... | PT-29834168 | 2024-02-09T00:00:00 | 2024-03-07T00:00:00 | Scott | Steven | 1925-03-31 | Dr. Mcneil | **Patient:** Steven Scott \n**DOB:** [Not pro... |
| 1 | impetigo | I have a rash on my face that is getting worse... | {'uuid': 'e85cd49a-9e70-4a8f-806f-bf374146929f... | {'uuid': '9ab39446-0532-4c2d-9f21-882082f4c215... | PT-EA6760F8 | 2024-08-08T00:00:00 | 2024-08-18T00:00:00 | Wright | Andrew | 2000-07-06 | Dr. Villarreal | **Progress Notes - Dr. John Villarreal** \n**... |
๐ 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%) โ 136.0 +/- 4.0 โ 994.5 +/- 67.2 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ 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")
[21:16:11] [INFO] ๐จ Creating Data Designer dataset
[21:16:11] [INFO] |-- ๐ Jinja rendering engine: secure
[21:16:11] [INFO] โ Validation passed
[21:16:11] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[21:16:11] [INFO] ๐ฉบ Running health checks for models...
[21:16:11] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[21:16:11] [INFO] |-- โ Passed!
[21:16:11] [INFO] โก DATA_DESIGNER_ASYNC_ENGINE is enabled - using async task-queue builder
[21:16:11] [INFO] ๐ llm-text model config for column 'physician_notes'
[21:16:11] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[21:16:11] [INFO] |-- model alias: 'nemotron-nano-v3'
[21:16:11] [INFO] |-- model provider: 'nvidia'
[21:16:11] [INFO] |-- inference parameters:
[21:16:11] [INFO] | |-- generation_type=chat-completion
[21:16:11] [INFO] | |-- max_parallel_requests=4
[21:16:11] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[21:16:11] [INFO] | |-- temperature=1.00
[21:16:11] [INFO] | |-- top_p=1.00
[21:16:11] [INFO] | |-- max_tokens=2048
[21:16:11] [INFO] โก๏ธ Async generation: 1 column(s) (physician_notes), 10 tasks across 1 row group(s)
[21:16:11] [INFO] ๐ (1/1) Dispatching with 10 records
[21:16:11] [INFO] ๐ฒ (1/1) Preparing samplers to generate 10 records across 5 columns
[21:16:11] [INFO] ๐งฉ (1/1) Generating column `last_name` from expression
[21:16:11] [INFO] ๐งฉ (1/1) Generating column `first_name` from expression
[21:16:11] [INFO] ๐งฉ (1/1) Generating column `dob` from expression
[21:16:11] [INFO] ๐งฉ (1/1) Generating column `physician` from expression
[21:16:11] [INFO] ๐ฑ (1/1) Sampling 10 records from seed dataset
[21:16:11] [INFO] |-- seed dataset size: 820 records
[21:16:11] [INFO] |-- sampling strategy: ordered
[21:16:18] [INFO] ๐ Progress [6.5s]:
[21:16:18] [INFO] |-- ๐ธ physician_notes: 5/10 (50%) 0.8 rec/s
[21:16:24] [INFO] ๐ Progress [12.9s]:
[21:16:24] [INFO] |-- ๐ผ physician_notes: 9/10 (90%) 0.7 rec/s
[21:16:25] [INFO] ๐ Progress [14.0s]:
[21:16:25] [INFO] |-- ๐ฆ physician_notes: 10/10 (100%) 0.7 rec/s
[21:16:25] [INFO] โ Async generation complete [14.0s]: 10 ok, 0 failed across 1 column(s)
[21:16:25] [INFO] ๐ Model usage summary:
[21:16:25] [INFO] |-- model: nvidia/nemotron-3-nano-30b-a3b
[21:16:25] [INFO] |-- tokens: input=1616, output=10000, total=11616, tps=818
[21:16:25] [INFO] |-- requests: success=10, failed=0, total=10, rpm=42
[21:16:25] [INFO] ๐ Measuring dataset column statistics:
[21:16:25] [INFO] |-- ๐ฒ column: 'patient_sampler'
[21:16:25] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[21:16:25] [INFO] |-- ๐ฒ column: 'patient_id'
[21:16:25] [INFO] |-- ๐งฉ column: 'first_name'
[21:16:25] [INFO] |-- ๐งฉ column: 'last_name'
[21:16:25] [INFO] |-- ๐งฉ column: 'dob'
[21:16:25] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[21:16:25] [INFO] |-- ๐ฒ column: 'date_of_visit'
[21:16:25] [INFO] |-- ๐งฉ column: 'physician'
[21:16:25] [INFO] |-- ๐ column: 'physician_notes'
# Load the generated dataset as a pandas DataFrame.
dataset = results.load_dataset()
dataset.head()
| patient_sampler | doctor_sampler | patient_id | symptom_onset_date | date_of_visit | last_name | first_name | dob | physician | diagnosis | patient_summary | physician_notes | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | {'age': 109, 'bachelors_field': 'no_degree', '... | {'age': 60, 'bachelors_field': 'no_degree', 'b... | PT-7BFB69D8 | 2024-01-02T00:00:00 | 2024-01-05T00:00:00 | Barnett | Jessica | 1916-12-17 | Dr. Elliott | cervical spondylosis | I've been having a lot of pain in my neck and ... | **2024-01-05T00:00:00 | J. BARNETT, 62F | NEW ... |
| 1 | {'age': 54, 'bachelors_field': 'stem', 'birth_... | {'age': 60, 'bachelors_field': 'business', 'bi... | PT-FDA0BB9B | 2024-02-26T00:00:00 | 2024-03-09T00:00:00 | Brown | Martin | 1971-11-30 | Dr. Williams | impetigo | I have a rash on my face that is getting worse... | **Patient:** Martin Brown **DOB:** 01/12/197... |
| 2 | {'age': 33, 'bachelors_field': 'arts_humanitie... | {'age': 37, 'bachelors_field': 'business', 'bi... | PT-AEF4DE2F | 2024-06-23T00:00:00 | 2024-07-07T00:00:00 | Hicks | Ernest | 1993-02-03 | Dr. Waters | urinary tract infection | I have been urinating blood. I sometimes feel ... | **Visit Summary โ Ernest Hicks โ 2024โ07โ07** ... |
| 3 | {'age': 54, 'bachelors_field': 'no_degree', 'b... | {'age': 113, 'bachelors_field': 'stem', 'birth... | PT-BF6CE3C1 | 2024-06-03T00:00:00 | 2024-07-01T00:00:00 | Stephenson | Jose | 1972-04-19 | Dr. Rose | arthritis | I have been having trouble with my muscles and... | * 7/1/24 08:15 โ Pt presents with 3 wk hx of w... |
| 4 | {'age': 41, 'bachelors_field': 'education', 'b... | {'age': 30, 'bachelors_field': 'business', 'bi... | PT-8A170849 | 2024-07-03T00:00:00 | 2024-07-07T00:00:00 | Smith | Gloria | 1985-04-08 | Dr. Thompson | dengue | I have been feeling really sick. My body hurts... | **Chief Complaint:** "Feeling really sick. Bod... |
# 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%) โ 132.0 +/- 5.2 โ 1039.5 +/- 310.2 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ Expression Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ first_name โ string โ 9 (90.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ last_name โ string โ 9 (90.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: