๐จ 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:12:51] [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:12:51] [INFO] ๐ฅ Preview generation in progress
[12:12:51] [INFO] โ Validation passed
[12:12:51] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[12:12:51] [INFO] ๐ฉบ Running health checks for models...
[12:12:51] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[12:12:51] [INFO] |-- โ Passed!
[12:12:51] [INFO] ๐ฑ Sampling 2 records from seed dataset
[12:12:51] [INFO] |-- seed dataset size: 820 records
[12:12:51] [INFO] |-- sampling strategy: ordered
[12:12:51] [INFO] ๐ฒ Preparing samplers to generate 2 records across 5 columns
[12:12:51] [INFO] (๐พ + ๐พ) Concatenating 2 datasets
[12:12:51] [INFO] ๐งฉ Generating column `first_name` from expression
[12:12:51] [INFO] ๐งฉ Generating column `last_name` from expression
[12:12:51] [INFO] ๐งฉ Generating column `dob` from expression
[12:12:51] [INFO] ๐งฉ Generating column `physician` from expression
[12:12:51] [INFO] ๐ llm-text model config for column 'physician_notes'
[12:12:51] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[12:12:51] [INFO] |-- model alias: 'nemotron-nano-v3'
[12:12:51] [INFO] |-- model provider: 'nvidia'
[12:12:51] [INFO] |-- inference parameters:
[12:12:51] [INFO] | |-- generation_type=chat-completion
[12:12:51] [INFO] | |-- max_parallel_requests=4
[12:12:51] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[12:12:51] [INFO] | |-- temperature=1.00
[12:12:51] [INFO] | |-- top_p=1.00
[12:12:51] [INFO] | |-- max_tokens=2048
[12:12:51] [INFO] โก๏ธ Processing llm-text column 'physician_notes' with 4 concurrent workers
[12:12:51] [INFO] โฑ๏ธ llm-text column 'physician_notes' will report progress after each record
[12:12:54] [INFO] |-- โ llm-text column 'physician_notes' progress: 1/2 (50%) complete, 1 ok, 0 failed, 0.34 rec/s, eta 3.0s
[12:12:56] [INFO] |-- โ๏ธ llm-text column 'physician_notes' progress: 2/2 (100%) complete, 2 ok, 0 failed, 0.43 rec/s, eta 0.0s
[12:12:56] [INFO] ๐ Model usage summary:
[12:12:56] [INFO] |-- model: nvidia/nemotron-3-nano-30b-a3b
[12:12:56] [INFO] |-- tokens: input=291, output=1897, total=2188, tps=444
[12:12:56] [INFO] |-- requests: success=2, failed=0, total=2, rpm=24
[12:12:56] [INFO] ๐ Measuring dataset column statistics:
[12:12:56] [INFO] |-- ๐ฒ column: 'patient_sampler'
[12:12:56] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[12:12:56] [INFO] |-- ๐ฒ column: 'patient_id'
[12:12:56] [INFO] |-- ๐งฉ column: 'first_name'
[12:12:56] [INFO] |-- ๐งฉ column: 'last_name'
[12:12:56] [INFO] |-- ๐งฉ column: 'dob'
[12:12:56] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[12:12:56] [INFO] |-- ๐ฒ column: 'date_of_visit'
[12:12:56] [INFO] |-- ๐งฉ column: 'physician'
[12:12:56] [INFO] |-- ๐ column: 'physician_notes'
[12:12:56] [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': '6e06863f-85fe-4bf6-9d8d-aa28873f816f', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'Darren', โ โ โ 'last_name': 'Gonzalez', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Male', โ โ โ 'street_number': '17591', โ โ โ 'street_name': 'Charles Branch', โ โ โ 'city': 'South Rebeccafurt', โ โ โ 'state': 'New Hampshire', โ โ โ 'postcode': '26443', โ โ โ 'age': 54, โ โ โ 'birth_date': '1971-11-10', โ โ โ 'country': 'Iraq', โ โ โ 'marital_status': 'divorced', โ โ โ 'education_level': 'graduate', โ โ โ 'unit': '', โ โ โ 'occupation': 'Best boy', โ โ โ 'phone_number': '699.919.4274x29629', โ โ โ 'bachelors_field': 'stem' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ doctor_sampler โ { โ โ โ 'uuid': '3f328cf5-84c5-44a2-89a4-36c17dc0cf3a', โ โ โ 'locale': 'en_US', โ โ โ 'first_name': 'Jared', โ โ โ 'last_name': 'Barber', โ โ โ 'middle_name': None, โ โ โ 'sex': 'Male', โ โ โ 'street_number': '7757', โ โ โ 'street_name': 'Melanie Center', โ โ โ 'city': 'Huntertown', โ โ โ 'state': 'Mississippi', โ โ โ 'postcode': '53101', โ โ โ 'age': 100, โ โ โ 'birth_date': '1925-05-18', โ โ โ 'country': 'Bhutan', โ โ โ 'marital_status': 'separated', โ โ โ 'education_level': 'associates', โ โ โ 'unit': '', โ โ โ 'occupation': 'Warden/ranger', โ โ โ 'phone_number': '958-776-3660', โ โ โ 'bachelors_field': 'no_degree' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ patient_id โ PT-AB849F59 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ symptom_onset_date โ 2024-08-25 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ date_of_visit โ 2024-09-05 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician_notes โ **2024-09-05 | Dr. Jared Barber | Visit Summary โ Darren Gonzalez** โ โ โ โ โ โ - **Patient:** Darren Gonzalez, 48 M โ โ โ - **Chief Concern:** Progressive neck/back pain, recent balance & coordination โ โ โ issues, new chronic cough, generalized limb weakness. โ โ โ - **Onset:** โ โ โ - Neck/back pain began 2024โ08โ25, initially mild, now "constant ache" radiating to โ โ โ upper back; worsens with prolonged sitting & flexion. โ โ โ - Balance problems noted ~3โฏweeks ago; occasional nearโfalls when turning quickly. โ โ โ - Limb weakness (especially proximal upper & lower) began ~2โฏweeks ago; difficulty โ โ โ climbing stairs, lifting objects. โ โ โ - Cough (dry, nonโproductive) started 10โฏdays ago, nonโbilious, no sputum; worsens โ โ โ with exertion. โ โ โ - **Review of Systems:** โ โ โ - **Neurologic:** Reports numbness/paresthesia in hands, occasional โ โ โ electricโshockโlike sensations in neck. No urinary/bowel changes. โ โ โ - **Respiratory:** Cough unchanged; denies wheeze, dyspnea at rest, recent fever. โ โ โ - **Musculoskeletal:** Stiffness in cervical spine; mild tenderness over Cโ4/Cโ5 โ โ โ paraspinals. No swelling or redness. โ โ โ - **Cardiovascular:** No chest pain, palpitations. โ โ โ - **GI/ GU:** Normal appetite, no nausea/vomiting; no dysuria. โ โ โ - **Physical Exam (Focused):** โ โ โ - **Vitals:** HRโฏ78โฏbpm, BPโฏ126/78โฏmmHg, RRโฏ16, SpOโโฏ98โฏ% RA, Tempโฏ36.8โฏยฐC. โ โ โ - **General:** Alert, oriented ร3; appears mildly uncomfortable when seated โ โ โ upright. โ โ โ - **Neck:** Limited flexion/extension due to pain; no crepitus; no lymphadenopathy. โ โ โ - **Spine:** Tenderness over cervical paraspinals; mild lumbar tenderness; no โ โ โ step-off or deformity. โ โ โ - **Neurologic:** โ โ โ - Cranial nerves IIโXII intact. โ โ โ - Motor: 4/5 strength in bilateral deltoids, biceps, triceps; 5/5 hip flexors/ โ โ โ extensors; mild grip weakness (4/5). โ โ โ - Reflexes: 2+ throughout; hyperreflexia noted in patellar (right > left). โ โ โ - Sensory: Decreased pinprick sensation over C5โC6 dermatomes bilaterally. โ โ โ - Coordination: Fingerโnose test mildly dysmetria on right hand; heelโshin โ โ โ slightly offโaxis. โ โ โ - Gait: Wideโbased, shuffling; impaired tandem walking. โ โ โ - **Respiratory:** Clear to auscultation bilaterally; no wheeze. โ โ โ - **Skin:** No rashes or lesions. โ โ โ - **Assessment / Differential (Preโliminary):** โ โ โ 1. Cervical spondylosis with myelopathic features (progressive neck pain, โ โ โ myelopathic signs, hyperreflexia). โ โ โ 2. Possible hereditary spastic paraplegia / other neurodegenerative process (given โ โ โ gait disturbance, upper motor neuron signs). โ โ โ 3. Chronic cough etiology โ evaluate for interstitial lung disease, GERD, โ โ โ medication sideโeffects. โ โ โ 4. Rule out systemic inflammatory or infectious processes (e.g., sarcoidosis, โ โ โ infection). โ โ โ - **Plan / Recommendations:** โ โ โ - **Imaging:** โ โ โ - Cervical spine MRI (effortโdriven, include entire cervical spine and brain). โ โ โ - Chest Xโray (or lowโdose CT if cough persists/ worsens). โ โ โ - **Labs:** ESR, CRP, CBC, CMP, Vitamin B12 level, thyroid panel, autoimmune panel โ โ โ (ANA, rheumatoid factor). โ โ โ - **Referral:** Neurology (for detailed neuroโexam, EMG/NCS if indicated), โ โ โ Physiotherapy (focus on gait training, cervical stabilization). โ โ โ - **Medications:** โ โ โ - Continue current NSAID regimen (if tolerated) for pain; consider short course โ โ โ of oral steroids if MRI shows significant canal stenosis (to be decided after โ โ โ imaging). โ โ โ - Counsel on avoiding neck hyperextension; ergonomic adjustments at work. โ โ โ - **Activity:** โ โ โ - Limit activities that exacerbate neck flexion/extension; use supportive โ โ โ cervical collar only as needed for comfort (not longโterm). โ โ โ - Begin gentle core and upperโextremity strengthening under PT supervision. โ โ โ - **Followโup:** โ โ โ - Return in 1โ2โฏweeks after imaging results; earlier if new neurological โ โ โ deficits, worsening weakness, or respiratory symptoms. โ โ โ - **Patient Education:** โ โ โ - Discussed the natural history of cervical spondylosis and the importance of early โ โ โ imaging to prevent permanent myelopathy. โ โ โ - Explained that chronic cough is likely unrelated to spine pathology; further โ โ โ evaluation will be pursued. โ โ โ - Reviewed signs that require urgent care (new bowel/bladder dysfunction, severe โ โ โ weakness, sudden shortness of breath). โ โ โ - **Next Steps:** Orders placed; patient agrees to followโup after MRI and labs. โ โ โ โ โ โ *End of Note.* โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ first_name โ Darren โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ last_name โ Gonzalez โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ dob โ 1971-11-10 โ โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ physician โ Dr. Barber โ โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [index: 0]
# 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': '6e06863f-85fe-4bf6-9d8d-aa28873f816f... | {'uuid': '3f328cf5-84c5-44a2-89a4-36c17dc0cf3a... | PT-AB849F59 | 2024-08-25 | 2024-09-05 | Darren | Gonzalez | 1971-11-10 | Dr. Barber | **2024-09-05 | Dr. Jared Barber | Visit Summar... |
| 1 | impetigo | I have a rash on my face that is getting worse... | {'uuid': 'c9dc70dd-d36d-4b94-ab2c-41c960ce808f... | {'uuid': '07acf939-754d-4798-b0e3-359a6949e14b... | PT-260F7D3A | 2024-12-02 | 2024-12-28 | April | Christensen | 1946-07-18 | Dr. Jones | --- \n**2024-12-28 | Dr. Annette Jones** \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%) โ 123.0 +/- 3.0 โ 898.0 +/- 366.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:12:56] [INFO] ๐จ Creating Data Designer dataset
[12:12:56] [INFO] โ Validation passed
[12:12:56] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[12:12:56] [INFO] ๐ฉบ Running health checks for models...
[12:12:56] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[12:12:56] [INFO] |-- โ Passed!
[12:12:56] [INFO] โณ Processing batch 1 of 1
[12:12:57] [INFO] ๐ฑ Sampling 10 records from seed dataset
[12:12:57] [INFO] |-- seed dataset size: 820 records
[12:12:57] [INFO] |-- sampling strategy: ordered
[12:12:57] [INFO] ๐ฒ Preparing samplers to generate 10 records across 5 columns
[12:12:57] [INFO] (๐พ + ๐พ) Concatenating 2 datasets
[12:12:57] [INFO] ๐งฉ Generating column `first_name` from expression
[12:12:57] [INFO] ๐งฉ Generating column `last_name` from expression
[12:12:57] [INFO] ๐งฉ Generating column `dob` from expression
[12:12:57] [INFO] ๐งฉ Generating column `physician` from expression
[12:12:57] [INFO] ๐ llm-text model config for column 'physician_notes'
[12:12:57] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[12:12:57] [INFO] |-- model alias: 'nemotron-nano-v3'
[12:12:57] [INFO] |-- model provider: 'nvidia'
[12:12:57] [INFO] |-- inference parameters:
[12:12:57] [INFO] | |-- generation_type=chat-completion
[12:12:57] [INFO] | |-- max_parallel_requests=4
[12:12:57] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[12:12:57] [INFO] | |-- temperature=1.00
[12:12:57] [INFO] | |-- top_p=1.00
[12:12:57] [INFO] | |-- max_tokens=2048
[12:12:57] [INFO] โก๏ธ Processing llm-text column 'physician_notes' with 4 concurrent workers
[12:12:57] [INFO] โฑ๏ธ llm-text column 'physician_notes' will report progress after each record
[12:12:58] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 1/10 (10%) complete, 1 ok, 0 failed, 1.05 rec/s, eta 8.6s
[12:12:59] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 2/10 (20%) complete, 2 ok, 0 failed, 0.95 rec/s, eta 8.5s
[12:13:00] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 3/10 (30%) complete, 3 ok, 0 failed, 0.88 rec/s, eta 7.9s
[12:13:01] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 4/10 (40%) complete, 4 ok, 0 failed, 0.93 rec/s, eta 6.4s
[12:13:01] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 5/10 (50%) complete, 5 ok, 0 failed, 1.06 rec/s, eta 4.7s
[12:13:03] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 6/10 (60%) complete, 6 ok, 0 failed, 0.89 rec/s, eta 4.5s
[12:13:03] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 7/10 (70%) complete, 7 ok, 0 failed, 1.03 rec/s, eta 2.9s
[12:13:06] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 8/10 (80%) complete, 8 ok, 0 failed, 0.87 rec/s, eta 2.3s
[12:13:06] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 9/10 (90%) complete, 9 ok, 0 failed, 0.93 rec/s, eta 1.1s
[12:13:07] [INFO] |-- ๐ llm-text column 'physician_notes' progress: 10/10 (100%) complete, 10 ok, 0 failed, 0.92 rec/s, eta 0.0s
[12:13:08] [INFO] ๐ Model usage summary:
[12:13:08] [INFO] |-- model: nvidia/nemotron-3-nano-30b-a3b
[12:13:08] [INFO] |-- tokens: input=1431, output=9665, total=11096, tps=997
[12:13:08] [INFO] |-- requests: success=10, failed=0, total=10, rpm=53
[12:13:08] [INFO] ๐ Measuring dataset column statistics:
[12:13:08] [INFO] |-- ๐ฒ column: 'patient_sampler'
[12:13:08] [INFO] |-- ๐ฒ column: 'doctor_sampler'
[12:13:08] [INFO] |-- ๐ฒ column: 'patient_id'
[12:13:08] [INFO] |-- ๐งฉ column: 'first_name'
[12:13:08] [INFO] |-- ๐งฉ column: 'last_name'
[12:13:08] [INFO] |-- ๐งฉ column: 'dob'
[12:13:08] [INFO] |-- ๐ฒ column: 'symptom_onset_date'
[12:13:08] [INFO] |-- ๐ฒ column: 'date_of_visit'
[12:13:08] [INFO] |-- ๐งฉ column: 'physician'
[12:13:08] [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': 23, 'bachelors_field': 'no_degree', 'b... | {'age': 76, 'bachelors_field': 'no_degree', 'b... | PT-EB9FBF8A | 2024-12-01 | 2024-12-18 | Tracy | Owen | 2002-08-16 | Dr. Montoya | **Visit Summary โ Tracy Owen โ 12/18/2024** ... |
| 1 | impetigo | I have a rash on my face that is getting worse... | {'age': 110, 'bachelors_field': 'business', 'b... | {'age': 30, 'bachelors_field': 'stem', 'birth_... | PT-AC28045F | 2024-02-03 | 2024-02-08 | Rita | Ellis | 1915-07-01 | Dr. Yates | **Patient:** Rita Ellis **DOB:** 06/14/1982 ... |
| 2 | urinary tract infection | I have been urinating blood. I sometimes feel ... | {'age': 83, 'bachelors_field': 'no_degree', 'b... | {'age': 69, 'bachelors_field': 'stem', 'birth_... | PT-1FAA2DDD | 2024-07-27 | 2024-07-28 | Patrick | Lee | 1943-01-25 | Dr. Roberts | **SOAP Note: P. Lee** **45 y/o M | 2024-07-2... |
| 3 | arthritis | I have been having trouble with my muscles and... | {'age': 100, 'bachelors_field': 'education', '... | {'age': 19, 'bachelors_field': 'no_degree', 'b... | PT-1BF02ED0 | 2024-10-03 | 2024-10-18 | Justin | George | 1925-07-07 | Dr. Riley | - 2024-10-18: 45M with 3 weeksโ history of wor... |
| 4 | dengue | I have been feeling really sick. My body hurts... | {'age': 70, 'bachelors_field': 'stem', 'birth_... | {'age': 32, 'bachelors_field': 'no_degree', 'b... | PT-3B2D8A48 | 2024-10-22 | 2024-10-31 | Ronnie | Brown | 1955-08-03 | Dr. Gutierrez | **2024-10-31 | Pt: Ronnie Brown | 35M | D.O.B.... |
# 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 โ 10 (100.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.7 โ 937.5 +/- 396.2 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ Expression Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ first_name โ string โ 10 (100.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: