๐จ Data Designer Tutorial: Structured Outputs and Jinja Expressionsยถ
๐ What you'll learnยถ
In this notebook, we will continue our exploration of Data Designer, demonstrating more advanced data generation using structured outputs and Jinja expressions.
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 that is used to interface with the library.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)
๐งโ๐จ Designing our dataยถ
We will again create a product review dataset, but this time we will use structured outputs and Jinja expressions.
Structured outputs let you specify the exact schema of the data you want to generate.
Data Designer supports schemas specified using either json schema or Pydantic data models (recommended).
We'll define our structured outputs using Pydantic data models
๐ก Why Pydantic?
Pydantic models provide better IDE support and type validation.
They are more Pythonic than raw JSON schemas.
They integrate seamlessly with Data Designer's structured output system.
from decimal import Decimal
from typing import Literal
from pydantic import BaseModel, Field
# We define a Product schema so that the name, description, and price are generated
# in one go, with the types and constraints specified.
class Product(BaseModel):
name: str = Field(description="The name of the product")
description: str = Field(description="A description of the product")
price: Decimal = Field(description="The price of the product", ge=10, le=1000, decimal_places=2)
class ProductReview(BaseModel):
rating: int = Field(description="The rating of the product", ge=1, le=5)
customer_mood: Literal["irritated", "mad", "happy", "neutral", "excited"] = Field(
description="The mood of the customer"
)
review: str = Field(description="A review of the product")
Next, let's design our product review dataset using a few more tricks compared to the previous notebook.
# Since we often only want a few attributes from Person objects, we can
# set drop=True in the column config to drop the column from the final dataset.
config_builder.add_column(
dd.SamplerColumnConfig(
name="customer",
sampler_type=dd.SamplerType.PERSON_FROM_FAKER,
params=dd.PersonFromFakerSamplerParams(),
drop=True,
)
)
config_builder.add_column(
dd.SamplerColumnConfig(
name="product_category",
sampler_type=dd.SamplerType.CATEGORY,
params=dd.CategorySamplerParams(
values=[
"Electronics",
"Clothing",
"Home & Kitchen",
"Books",
"Home Office",
],
),
)
)
config_builder.add_column(
dd.SamplerColumnConfig(
name="product_subcategory",
sampler_type=dd.SamplerType.SUBCATEGORY,
params=dd.SubcategorySamplerParams(
category="product_category",
values={
"Electronics": [
"Smartphones",
"Laptops",
"Headphones",
"Cameras",
"Accessories",
],
"Clothing": [
"Men's Clothing",
"Women's Clothing",
"Winter Coats",
"Activewear",
"Accessories",
],
"Home & Kitchen": [
"Appliances",
"Cookware",
"Furniture",
"Decor",
"Organization",
],
"Books": [
"Fiction",
"Non-Fiction",
"Self-Help",
"Textbooks",
"Classics",
],
"Home Office": [
"Desks",
"Chairs",
"Storage",
"Office Supplies",
"Lighting",
],
},
),
)
)
config_builder.add_column(
dd.SamplerColumnConfig(
name="target_age_range",
sampler_type=dd.SamplerType.CATEGORY,
params=dd.CategorySamplerParams(values=["18-25", "25-35", "35-50", "50-65", "65+"]),
)
)
# Sampler columns support conditional params, which are used if the condition is met.
# In this example, we set the review style to rambling if the target age range is 18-25.
# Note conditional parameters are only supported for Sampler column types.
config_builder.add_column(
dd.SamplerColumnConfig(
name="review_style",
sampler_type=dd.SamplerType.CATEGORY,
params=dd.CategorySamplerParams(
values=["rambling", "brief", "detailed", "structured with bullet points"],
weights=[1, 2, 2, 1],
),
conditional_params={
"target_age_range == '18-25'": dd.CategorySamplerParams(values=["rambling"]),
},
)
)
# Optionally validate that the columns are configured correctly.
data_designer.validate(config_builder)
[16:29:54] [INFO] โ Validation passed
Next, we will use more advanced Jinja expressions to create new columns.
Jinja expressions let you:
Access nested attributes:
{{ customer.first_name }}Combine values:
{{ customer.first_name }} {{ customer.last_name }}Use conditional logic:
{% if condition %}...{% endif %}
# We can create new columns using Jinja expressions that reference
# existing columns, including attributes of nested objects.
config_builder.add_column(
dd.ExpressionColumnConfig(name="customer_name", expr="{{ customer.first_name }} {{ customer.last_name }}")
)
config_builder.add_column(dd.ExpressionColumnConfig(name="customer_age", expr="{{ customer.age }}"))
config_builder.add_column(
dd.LLMStructuredColumnConfig(
name="product",
prompt=(
"Create a product in the '{{ product_category }}' category, focusing on products "
"related to '{{ product_subcategory }}'. The target age range of the ideal customer is "
"{{ target_age_range }} years old. The product should be priced between $10 and $1000."
),
output_format=Product,
model_alias=MODEL_ALIAS,
)
)
# We can even use if/else logic in our Jinja expressions to create more complex prompt patterns.
config_builder.add_column(
dd.LLMStructuredColumnConfig(
name="customer_review",
prompt=(
"Your task is to write a review for the following product:\n\n"
"Product Name: {{ product.name }}\n"
"Product Description: {{ product.description }}\n"
"Price: {{ product.price }}\n\n"
"Imagine your name is {{ customer_name }} and you are from {{ customer.city }}, {{ customer.state }}. "
"Write the review in a style that is '{{ review_style }}'."
"{% if target_age_range == '18-25' %}"
"Make sure the review is more informal and conversational.\n"
"{% else %}"
"Make sure the review is more formal and structured.\n"
"{% endif %}"
"The review field should contain only the review, no other text."
),
output_format=ProductReview,
model_alias=MODEL_ALIAS,
)
)
data_designer.validate(config_builder)
[16:29:54] [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)
[16:29:54] [INFO] ๐ต๏ธ Preview generation in progress
[16:29:54] [INFO] โ Validation passed
[16:29:55] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[16:29:55] [INFO] ๐ฉบ Running health checks for models...
[16:29:55] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[16:29:55] [INFO] |-- โ Passed!
[16:29:55] [INFO] ๐ฒ Preparing samplers to generate 2 records across 5 columns
[16:29:55] [INFO] ๐งฉ Generating column `customer_name` from expression
[16:29:55] [INFO] ๐งฉ Generating column `customer_age` from expression
[16:29:55] [INFO] ๐๏ธ llm-structured model config for column 'product'
[16:29:55] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[16:29:55] [INFO] |-- model alias: 'nemotron-nano-v3'
[16:29:55] [INFO] |-- model provider: 'nvidia'
[16:29:55] [INFO] |-- inference parameters:
[16:29:55] [INFO] | |-- generation_type=chat-completion
[16:29:55] [INFO] | |-- max_parallel_requests=4
[16:29:55] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[16:29:55] [INFO] | |-- temperature=1.00
[16:29:55] [INFO] | |-- top_p=1.00
[16:29:55] [INFO] | |-- max_tokens=2048
[16:29:55] [INFO] โก๏ธ Processing llm-structured column 'product' with 4 concurrent workers
[16:29:55] [INFO] โฑ๏ธ llm-structured column 'product' will report progress after each record
[16:29:56] [INFO] |-- ๐ llm-structured column 'product' progress: 1/2 (50%) complete, 1 ok, 0 failed, 1.12 rec/s, eta 0.9s
[16:29:57] [INFO] |-- ๐ llm-structured column 'product' progress: 2/2 (100%) complete, 2 ok, 0 failed, 1.46 rec/s, eta 0.0s
[16:29:57] [INFO] ๐๏ธ llm-structured model config for column 'customer_review'
[16:29:57] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[16:29:57] [INFO] |-- model alias: 'nemotron-nano-v3'
[16:29:57] [INFO] |-- model provider: 'nvidia'
[16:29:57] [INFO] |-- inference parameters:
[16:29:57] [INFO] | |-- generation_type=chat-completion
[16:29:57] [INFO] | |-- max_parallel_requests=4
[16:29:57] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[16:29:57] [INFO] | |-- temperature=1.00
[16:29:57] [INFO] | |-- top_p=1.00
[16:29:57] [INFO] | |-- max_tokens=2048
[16:29:57] [INFO] โก๏ธ Processing llm-structured column 'customer_review' with 4 concurrent workers
[16:29:57] [INFO] โฑ๏ธ llm-structured column 'customer_review' will report progress after each record
[16:29:59] [INFO] |-- ๐ llm-structured column 'customer_review' progress: 1/2 (50%) complete, 1 ok, 0 failed, 0.44 rec/s, eta 2.3s
[16:30:12] [INFO] |-- ๐ llm-structured column 'customer_review' progress: 2/2 (100%) complete, 2 ok, 0 failed, 0.13 rec/s, eta 0.0s
[16:30:12] [INFO] ๐ Model usage summary:
[16:30:12] [INFO] |-- model: nvidia/nemotron-3-nano-30b-a3b
[16:30:12] [INFO] |-- tokens: input=1316, output=2467, total=3783, tps=221
[16:30:12] [INFO] |-- requests: success=4, failed=0, total=4, rpm=14
[16:30:12] [INFO] ๐ Dropping columns: ['customer']
[16:30:12] [INFO] ๐ Measuring dataset column statistics:
[16:30:12] [INFO] |-- ๐ฒ column: 'product_category'
[16:30:12] [INFO] |-- ๐ฒ column: 'product_subcategory'
[16:30:12] [INFO] |-- ๐ฒ column: 'target_age_range'
[16:30:12] [INFO] |-- ๐ฒ column: 'review_style'
[16:30:12] [INFO] |-- ๐งฉ column: 'customer_name'
[16:30:12] [INFO] |-- ๐งฉ column: 'customer_age'
[16:30:12] [INFO] |-- ๐๏ธ column: 'product'
[16:30:12] [INFO] |-- ๐๏ธ column: 'customer_review'
[16:30:12] [INFO] ๐ Preview complete!
# Run this cell multiple times to cycle through the 2 preview records.
preview.display_sample_record()
Generated Columns โโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Name โ Value โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ product_category โ Clothing โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ product_subcategory โ Women's Clothing โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ target_age_range โ 18-25 โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ review_style โ rambling โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_name โ Katherine Thomas โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_age โ 105 โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ product โ { โ โ โ 'name': 'Chic Tie-Front Denim Mini Skirt', โ โ โ 'description': 'A stylish, high-quality denim mini skirt featuring a flattering โ โ โ tie-front detail, perfect for casual outings and campus life. Crafted from soft, โ โ โ breathable cotton blend fabric for all-day comfort and designed with a modern, โ โ โ figure-hugging silhouette. Ideal for 18-25 year olds seeking trendy, versatile โ โ โ wardrobe staples.', โ โ โ 'price': 49.99 โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_review โ { โ โ โ 'rating': 5, โ โ โ 'customer_mood': 'happy', โ โ โ 'review': "Okay wow, this Chic Tie-Front Denim Mini Skirt is just so cute I can โ โ โ barely stand it, seriously it is like the perfect combo of comfy and cute for just โ โ โ cruising around campus or grabbing coffee with friends, I got it in that light wash โ โ โ and honestly the fit is so flattering without feeling like Iโm wearing a stiff old โ โ โ jean you know? The tie front detail adds that playful little twist that makes it โ โ โ feel fresh and not like every other mini skirt out there, and the cotton blend โ โ โ fabric? unbelievably soft and breathable, like it doesn't even feel like youโre โ โ โ wearing anything heavy which is amazing for Alaskaโs weirdly warm indoor heating but โ โ โ also just for everyday wear, Iโve already paired it with a couple of different tees โ โ โ and even a sweater on cooler days and it always looks put together, honestly Iโve โ โ โ been getting so many compliments on it I canโt even tell you, itโs such a versatile โ โ โ little staple that just makes me feel effortlessly stylish, 10/10 would recommend to โ โ โ anyone who loves that sweet spot of trendy yet timeless, seriously this is a must โ โ โ have for your closet if youโre into that casual-but-cute vibe, Iโm so glad I got it, โ โ โ itโs become one of my favorite pieces, honestly itโs just perfect for that 18-25 โ โ โ crowd who want to look cool without trying too hard, itโs like the skirt just gets โ โ โ you, you know? Itโs so fun and flirty but still feels super comfortable and real, โ โ โ Iโm just obsessed, honestly itโs the best little purchase Iโve made in a while, Iโve โ โ โ worn it like every single day since I got it, itโs just that perfect mix of casual โ โ โ and chic, and the fact that itโs made with that soft cotton blend just makes it even โ โ โ better, like itโs so comfy you forget youโre wearing it, but then you look down and โ โ โ itโs still so cute and stylish, itโs just such a win-win, Iโm so happy with it, โ โ โ honestly itโs exceeded all my expectations, itโs so perfect for campus life and just โ โ โ hanging out with friends, itโs like youโre wearing your favorite cozy sweater but โ โ โ itโs a skirt, thatโs how comfortable it is, Iโm telling you, this is the skirt you โ โ โ need in your life, seriously, itโs got that perfect balance of style and comfort, โ โ โ and the tie front detail? itโs such a cute touch that just makes it feel extra โ โ โ special, Iโm so glad I decided to try it out, itโs become my go-to piece for so many โ โ โ different outfits, Iโve been wearing it with everything from oversized hoodies to โ โ โ cute little tops, and it always looks amazing, honestly itโs just the perfect little โ โ โ addition to any wardrobe for that age group, itโs so versatile and just makes you โ โ โ feel so confident and cute at the same time, Iโm literally obsessed, itโs like the โ โ โ skirt just fits you perfectly every single time you put it on, and the quality is so โ โ โ high, like itโs not some cheap fast fashion piece, itโs actually well-made and โ โ โ durable, which is so important because you want something that will last, and โ โ โ honestly, for the price of $49.99, itโs an absolute steal, itโs such a great value โ โ โ for how much you get out of it, Iโm just so happy with my purchase, itโs honestly โ โ โ one of the best things Iโve bought recently, Iโm telling you, you have to get this โ โ โ skirt, itโs just so perfect, itโs like it was made for you, honestly, itโs just so โ โ โ cute and stylish and comfortable all at once, and the tie front detail? itโs such a โ โ โ little extra something that just makes it feel extra special, Iโm so glad I got it, โ โ โ itโs become my favorite piece in my closet, honestly, Iโm just so happy with it, โ โ โ itโs such a great find, and itโs perfect for anyone who wants to look cute and feel โ โ โ comfortable at the same time, itโs just the best, Iโm so obsessed with it, honestly, โ โ โ itโs like the perfect little skirt for that campus vibe, and Iโve been wearing it โ โ โ nonstop since I got it, itโs just so perfect, I canโt even describe how much I love โ โ โ it, itโs just so cute and comfortable and stylish, and the quality is amazing, like โ โ โ itโs so soft and the fabric is so breathable, itโs just perfect for everyday wear, โ โ โ and honestly, itโs such a great price for how much you get, itโs such a steal, Iโm โ โ โ so happy with it, itโs just so perfect, Iโm literally obsessed, itโs like the skirt โ โ โ just fits me perfectly every single time I put it on, and the tie front detail? itโs โ โ โ such a cute little touch that makes it feel extra special, and the cotton blend โ โ โ fabric? itโs so soft and comfortable, like itโs so breathable and perfect for โ โ โ all-day wear, and honestly, Iโve been getting so many compliments on it, itโs like โ โ โ everyone wants to know where I got it, and I just tell them itโs the Chic Tie-Front โ โ โ Denim Mini Skirt, and theyโre always like wow, thatโs so cute, and Iโm just like โ โ โ yeah, itโs the best, honestly, itโs such a great piece, itโs just the perfect mix of โ โ โ casual and chic, and the quality is so high, like itโs not some cheap piece, itโs โ โ โ actually well-made and durable, and for the price of $49.99, itโs such a great โ โ โ value, Iโm so happy with my purchase, itโs honestly one of the best things Iโve โ โ โ bought in a while, itโs just perfect for that 18-25 age group, itโs so versatile and โ โ โ just makes you feel so cute and confident, and honestly, itโs such a great addition โ โ โ to any wardrobe, Iโm so glad I got it, itโs just the perfect little skirt for campus โ โ โ life and hanging out with friends, itโs so comfortable and stylish, and the tie โ โ โ front detail? itโs such a cute little touch that makes it feel extra special, Iโm so โ โ โ happy with it, itโs just the best, honestly, Iโm literally obsessed, itโs like the โ โ โ perfect little piece for your closet, itโs so cute and comfortable and stylish all โ โ โ at once, and the quality is amazing, like itโs so soft and the fabric is so โ โ โ breathable, itโs just perfect for all-day wear, and honestly, itโs such a great โ โ โ price for how much you get, itโs such a steal, Iโm so happy with my purchase, itโs โ โ โ honestly one of the best things Iโve bought in a while, itโs just perfect for that โ โ โ campus vibe, and Iโve been wearing it nonstop since I got it, itโs just so perfect, โ โ โ I canโt even describe how much I love it, itโs just so cute and comfortable and โ โ โ stylish, and the quality is amazing, like itโs so soft and the fabric is so โ โ โ breathable, itโs just perfect for everyday wear, and honestly, itโs such a great โ โ โ price for how much you get, itโs such a steal, Iโm so happy with it, itโs just โ โ โ perfect for that 18-25 crowd, and honestly, itโs the best little skirt ever, Iโm so โ โ โ obsessed with it, itโs like it was made for me, honestly, itโs just so cute and โ โ โ comfortable and stylish all at once, and the tie front detail? itโs such a cute โ โ โ little touch that makes it feel extra special, and the cotton blend fabric? itโs so โ โ โ soft and comfortable, like itโs so breathable and perfect for all-day wear, and โ โ โ honestly, Iโve been getting so many compliments on it, itโs like everyone wants to โ โ โ know where I got it, and I just tell them itโs the Chic Tie-Front Denim Mini Skirt, โ โ โ and theyโre always like wow, thatโs so cute, and Iโm just like yeah, itโs the best, โ โ โ honestly, itโs such a great piece, itโs just the perfect mix of casual and chic, and โ โ โ the quality is so high, like itโs not some cheap piece, itโs actually well-made and โ โ โ durable, and for the price of $49.99, itโs such a great value, Iโm so happy with my โ โ โ purchase, itโs honestly one of the best things Iโve bought in a while, itโs just โ โ โ perfect for that campus life and hanging out with friends, itโs so comfortable and โ โ โ stylish, and the tie front detail? itโs such a cute little touch that makes it feel โ โ โ extra special, Iโm so happy with it, honestly, Iโm literally obsessed, itโs like the โ โ โ perfect little piece for your closet, itโs so cute and comfortable and stylish all โ โ โ at once, and the quality is amazing, like itโs so soft and the fabric is so โ โ โ breathable, itโs just perfect for all-day wear, and honestly, itโs such a great โ โ โ price for how much you get, itโs such a steal, Iโm so happy with my purchase, itโs โ โ โ honestly one of the best things Iโve bought in a while, itโs just perfect for that โ โ โ 18-25 age group, itโs so versatile and just makes you feel so cute and confident, โ โ โ and honestly, itโs such a great addition to any wardrobe, Iโm so glad I got it, itโs โ โ โ just the perfect little skirt for campus life and hanging out with friends, itโs so โ โ โ comfortable and stylish, and the tie front detail? itโs such a cute little touch โ โ โ that makes it feel extra special, Iโm so happy with it, honestly, Iโm literally โ โ โ obsessed, itโs" โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [index: 0]
# The preview dataset is available as a pandas DataFrame.
preview.dataset
| product_category | product_subcategory | target_age_range | review_style | customer_name | customer_age | product | customer_review | |
|---|---|---|---|---|---|---|---|---|
| 0 | Clothing | Women's Clothing | 18-25 | rambling | Katherine Thomas | 105 | {'name': 'Chic Tie-Front Denim Mini Skirt', 'd... | {'rating': 5, 'customer_mood': 'happy', 'revie... |
| 1 | Electronics | Headphones | 25-35 | detailed | Thomas Martinez | 45 | {'name': 'SoundPulse Pro Wireless Headphones',... | {'rating': 5, 'customer_mood': 'happy', 'revie... |
๐ 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 โ 8 โ 100.0% โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ฒ Sampler Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ sampler type โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ product_category โ string โ 2 (100.0%) โ category โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ product_subcategory โ string โ 2 (100.0%) โ subcategory โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ target_age_range โ string โ 2 (100.0%) โ category โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ review_style โ string โ 2 (100.0%) โ category โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ ๐๏ธ LLM-Structured Columns โโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ prompt tokens โ completion tokens โ โ column name โ data type โ number unique values โ per record โ per record โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ product โ dict โ 2 (100.0%) โ 265.5 +/- 0.5 โ 82.0 +/- 9.9 โ โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_review โ dict โ 2 (100.0%) โ 335.0 +/- 8.0 โ 1088.0 +/- 1264.3 โ โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ Expression Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ customer_name โ string โ 2 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_age โ 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-2")
[16:30:12] [INFO] ๐จ Creating Data Designer dataset
[16:30:12] [INFO] โ Validation passed
[16:30:12] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[16:30:12] [INFO] ๐ฉบ Running health checks for models...
[16:30:12] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[16:30:13] [INFO] |-- โ Passed!
[16:30:13] [INFO] โณ Processing batch 1 of 1
[16:30:13] [INFO] ๐ฒ Preparing samplers to generate 10 records across 5 columns
[16:30:13] [INFO] ๐งฉ Generating column `customer_name` from expression
[16:30:13] [INFO] ๐งฉ Generating column `customer_age` from expression
[16:30:13] [INFO] ๐๏ธ llm-structured model config for column 'product'
[16:30:13] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[16:30:13] [INFO] |-- model alias: 'nemotron-nano-v3'
[16:30:13] [INFO] |-- model provider: 'nvidia'
[16:30:13] [INFO] |-- inference parameters:
[16:30:13] [INFO] | |-- generation_type=chat-completion
[16:30:13] [INFO] | |-- max_parallel_requests=4
[16:30:13] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[16:30:13] [INFO] | |-- temperature=1.00
[16:30:13] [INFO] | |-- top_p=1.00
[16:30:13] [INFO] | |-- max_tokens=2048
[16:30:13] [INFO] โก๏ธ Processing llm-structured column 'product' with 4 concurrent workers
[16:30:13] [INFO] โฑ๏ธ llm-structured column 'product' will report progress after each record
[16:30:14] [INFO] |-- ๐ถ llm-structured column 'product' progress: 1/10 (10%) complete, 1 ok, 0 failed, 1.02 rec/s, eta 8.8s
[16:30:14] [INFO] |-- ๐ถ llm-structured column 'product' progress: 2/10 (20%) complete, 2 ok, 0 failed, 1.92 rec/s, eta 4.2s
[16:30:14] [INFO] |-- ๐ด llm-structured column 'product' progress: 3/10 (30%) complete, 3 ok, 0 failed, 2.72 rec/s, eta 2.6s
[16:30:14] [INFO] |-- ๐ด llm-structured column 'product' progress: 4/10 (40%) complete, 4 ok, 0 failed, 2.99 rec/s, eta 2.0s
[16:30:15] [INFO] |-- ๐ llm-structured column 'product' progress: 5/10 (50%) complete, 5 ok, 0 failed, 2.74 rec/s, eta 1.8s
[16:30:15] [INFO] |-- ๐ llm-structured column 'product' progress: 6/10 (60%) complete, 6 ok, 0 failed, 2.83 rec/s, eta 1.4s
[16:30:15] [INFO] |-- ๐ llm-structured column 'product' progress: 7/10 (70%) complete, 7 ok, 0 failed, 2.93 rec/s, eta 1.0s
[16:30:15] [INFO] |-- โ๏ธ llm-structured column 'product' progress: 8/10 (80%) complete, 8 ok, 0 failed, 3.28 rec/s, eta 0.6s
[16:30:16] [INFO] |-- โ๏ธ llm-structured column 'product' progress: 9/10 (90%) complete, 9 ok, 0 failed, 2.68 rec/s, eta 0.4s
[16:30:16] [INFO] |-- ๐ llm-structured column 'product' progress: 10/10 (100%) complete, 10 ok, 0 failed, 2.92 rec/s, eta 0.0s
[16:30:16] [INFO] ๐๏ธ llm-structured model config for column 'customer_review'
[16:30:16] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[16:30:16] [INFO] |-- model alias: 'nemotron-nano-v3'
[16:30:16] [INFO] |-- model provider: 'nvidia'
[16:30:16] [INFO] |-- inference parameters:
[16:30:16] [INFO] | |-- generation_type=chat-completion
[16:30:16] [INFO] | |-- max_parallel_requests=4
[16:30:16] [INFO] | |-- extra_body={'chat_template_kwargs': {'enable_thinking': False}}
[16:30:16] [INFO] | |-- temperature=1.00
[16:30:16] [INFO] | |-- top_p=1.00
[16:30:16] [INFO] | |-- max_tokens=2048
[16:30:16] [INFO] โก๏ธ Processing llm-structured column 'customer_review' with 4 concurrent workers
[16:30:16] [INFO] โฑ๏ธ llm-structured column 'customer_review' will report progress after each record
[16:30:17] [INFO] |-- ๐ฑ llm-structured column 'customer_review' progress: 1/10 (10%) complete, 1 ok, 0 failed, 1.08 rec/s, eta 8.3s
[16:30:19] [INFO] |-- ๐ฑ llm-structured column 'customer_review' progress: 2/10 (20%) complete, 2 ok, 0 failed, 0.88 rec/s, eta 9.1s
[16:30:19] [INFO] |-- ๐บ llm-structured column 'customer_review' progress: 3/10 (30%) complete, 3 ok, 0 failed, 1.05 rec/s, eta 6.7s
[16:30:20] [INFO] |-- ๐บ llm-structured column 'customer_review' progress: 4/10 (40%) complete, 4 ok, 0 failed, 1.19 rec/s, eta 5.1s
[16:30:20] [INFO] |-- ๐ธ llm-structured column 'customer_review' progress: 5/10 (50%) complete, 5 ok, 0 failed, 1.45 rec/s, eta 3.5s
[16:30:20] [INFO] |-- ๐ธ llm-structured column 'customer_review' progress: 6/10 (60%) complete, 6 ok, 0 failed, 1.72 rec/s, eta 2.3s
[16:30:20] [INFO] |-- ๐ธ llm-structured column 'customer_review' progress: 7/10 (70%) complete, 7 ok, 0 failed, 1.91 rec/s, eta 1.6s
[16:30:21] [INFO] |-- ๐ผ llm-structured column 'customer_review' progress: 8/10 (80%) complete, 8 ok, 0 failed, 1.65 rec/s, eta 1.2s
[16:30:22] [INFO] |-- ๐ผ llm-structured column 'customer_review' progress: 9/10 (90%) complete, 9 ok, 0 failed, 1.60 rec/s, eta 0.6s
[16:30:22] [INFO] |-- ๐ฆ llm-structured column 'customer_review' progress: 10/10 (100%) complete, 10 ok, 0 failed, 1.64 rec/s, eta 0.0s
[16:30:23] [INFO] ๐ Dropping columns: ['customer']
[16:30:23] [INFO] ๐ Model usage summary:
[16:30:23] [INFO] |-- model: nvidia/nemotron-3-nano-30b-a3b
[16:30:23] [INFO] |-- tokens: input=6580, output=3136, total=9716, tps=993
[16:30:23] [INFO] |-- requests: success=20, failed=0, total=20, rpm=122
[16:30:23] [INFO] ๐ Measuring dataset column statistics:
[16:30:23] [INFO] |-- ๐ฒ column: 'product_category'
[16:30:23] [INFO] |-- ๐ฒ column: 'product_subcategory'
[16:30:23] [INFO] |-- ๐ฒ column: 'target_age_range'
[16:30:23] [INFO] |-- ๐ฒ column: 'review_style'
[16:30:23] [INFO] |-- ๐งฉ column: 'customer_name'
[16:30:23] [INFO] |-- ๐งฉ column: 'customer_age'
[16:30:23] [INFO] |-- ๐๏ธ column: 'product'
[16:30:23] [INFO] |-- ๐๏ธ column: 'customer_review'
# Load the generated dataset as a pandas DataFrame.
dataset = results.load_dataset()
dataset.head()
| product_category | product_subcategory | target_age_range | review_style | customer_name | customer_age | product | customer_review | |
|---|---|---|---|---|---|---|---|---|
| 0 | Home Office | Desks | 35-50 | detailed | William Palmer | 76 | {'description': 'A sleek, heightโadjustable de... | {'customer_mood': 'happy', 'rating': 5, 'revie... |
| 1 | Books | Classics | 65+ | rambling | Jerry Thomas | 40 | {'description': 'A beautifully bound collectio... | {'customer_mood': 'happy', 'rating': 4, 'revie... |
| 2 | Books | Classics | 65+ | brief | Michelle Hess | 112 | {'description': 'A beautifully bound anthology... | {'customer_mood': 'happy', 'rating': 5, 'revie... |
| 3 | Books | Textbooks | 50-65 | detailed | Heather Fernandez | 52 | {'description': 'A comprehensive, hardcover te... | {'customer_mood': 'happy', 'rating': 5, 'revie... |
| 4 | Electronics | Cameras | 35-50 | detailed | April Freeman | 67 | {'description': 'A compact, foldable mirrorles... | {'customer_mood': 'excited', 'rating': 5, 'rev... |
# 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 โ 8 โ 100.0% โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ฒ Sampler Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ sampler type โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ product_category โ string โ 5 (50.0%) โ category โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ product_subcategory โ string โ 9 (90.0%) โ subcategory โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ target_age_range โ string โ 5 (50.0%) โ category โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ review_style โ string โ 3 (30.0%) โ category โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ ๐๏ธ LLM-Structured Columns โโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ โ prompt tokens โ completion tokens โ โ column name โ data type โ number unique values โ per record โ per record โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ product โ dict โ 10 (100.0%) โ 264.5 +/- 0.9 โ 84.0 +/- 20.1 โ โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_review โ dict โ 10 (100.0%) โ 338.5 +/- 19.0 โ 175.5 +/- 112.8 โ โโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ Expression Columns โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ column name โ data type โ number unique values โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ customer_name โ string โ 10 (100.0%) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_age โ 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: