๐จ 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 the essentialsยถ
- The
essentialsmodule provides quick access to the most commonly used objects.
from data_designer.essentials import (
CategorySamplerParams,
ChatCompletionInferenceParams,
DataDesigner,
DataDesignerConfigBuilder,
ExpressionColumnConfig,
LLMStructuredColumnConfig,
ModelConfig,
PersonFromFakerSamplerParams,
SamplerColumnConfig,
SamplerType,
SubcategorySamplerParams,
)
โ๏ธ 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 = [
ModelConfig(
alias=MODEL_ALIAS,
model=MODEL_ID,
provider=MODEL_PROVIDER,
inference_parameters=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 = 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(
SamplerColumnConfig(
name="customer",
sampler_type=SamplerType.PERSON_FROM_FAKER,
params=PersonFromFakerSamplerParams(),
drop=True,
)
)
config_builder.add_column(
SamplerColumnConfig(
name="product_category",
sampler_type=SamplerType.CATEGORY,
params=CategorySamplerParams(
values=[
"Electronics",
"Clothing",
"Home & Kitchen",
"Books",
"Home Office",
],
),
)
)
config_builder.add_column(
SamplerColumnConfig(
name="product_subcategory",
sampler_type=SamplerType.SUBCATEGORY,
params=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(
SamplerColumnConfig(
name="target_age_range",
sampler_type=SamplerType.CATEGORY,
params=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(
SamplerColumnConfig(
name="review_style",
sampler_type=SamplerType.CATEGORY,
params=CategorySamplerParams(
values=["rambling", "brief", "detailed", "structured with bullet points"],
weights=[1, 2, 2, 1],
),
conditional_params={
"target_age_range == '18-25'": CategorySamplerParams(values=["rambling"]),
},
)
)
# Optionally validate that the columns are configured correctly.
data_designer.validate(config_builder)
[21:54:09] [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(
ExpressionColumnConfig(name="customer_name", expr="{{ customer.first_name }} {{ customer.last_name }}")
)
config_builder.add_column(ExpressionColumnConfig(name="customer_age", expr="{{ customer.age }}"))
config_builder.add_column(
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(
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)
[21:54:09] [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:54:09] [INFO] ๐ญ Preview generation in progress
[21:54:09] [INFO] โ Validation passed
[21:54:09] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[21:54:09] [INFO] ๐ฉบ Running health checks for models...
[21:54:09] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[21:54:09] [INFO] |-- โ Passed!
[21:54:09] [INFO] ๐ฒ Preparing samplers to generate 2 records across 5 columns
[21:54:09] [INFO] ๐งฉ Generating column `customer_name` from expression
[21:54:09] [INFO] ๐งฉ Generating column `customer_age` from expression
[21:54:09] [INFO] ๐๏ธ llm-structured model config for column 'product'
[21:54:09] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[21:54:09] [INFO] |-- model alias: 'nemotron-nano-v3'
[21:54:09] [INFO] |-- model provider: 'nvidia'
[21:54:09] [INFO] |-- inference parameters: generation_type=chat-completion, max_parallel_requests=4, extra_body={'chat_template_kwargs': {'enable_thinking': False}}, temperature=1.00, top_p=1.00, max_tokens=2048
[21:54:09] [INFO] ๐ Processing llm-structured column 'product' with 4 concurrent workers
[21:54:10] [INFO] ๐๏ธ llm-structured model config for column 'customer_review'
[21:54:10] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[21:54:10] [INFO] |-- model alias: 'nemotron-nano-v3'
[21:54:10] [INFO] |-- model provider: 'nvidia'
[21:54:10] [INFO] |-- inference parameters: generation_type=chat-completion, max_parallel_requests=4, extra_body={'chat_template_kwargs': {'enable_thinking': False}}, temperature=1.00, top_p=1.00, max_tokens=2048
[21:54:10] [INFO] ๐ Processing llm-structured column 'customer_review' with 4 concurrent workers
[21:54:12] [INFO] ๐ Model usage summary:
{
"nvidia/nemotron-3-nano-30b-a3b": {
"token_usage": {
"input_tokens": 1293,
"output_tokens": 590,
"total_tokens": 1883
},
"request_usage": {
"successful_requests": 4,
"failed_requests": 0,
"total_requests": 4
},
"tokens_per_second": 731,
"requests_per_minute": 93
}
}
[21:54:12] [INFO] ๐ Dropping columns: ['customer']
[21:54:12] [INFO] ๐ Measuring dataset column statistics:
[21:54:12] [INFO] |-- ๐ฒ column: 'product_category'
[21:54:12] [INFO] |-- ๐ฒ column: 'product_subcategory'
[21:54:12] [INFO] |-- ๐ฒ column: 'target_age_range'
[21:54:12] [INFO] |-- ๐ฒ column: 'review_style'
[21:54:12] [INFO] |-- ๐งฉ column: 'customer_name'
[21:54:12] [INFO] |-- ๐งฉ column: 'customer_age'
[21:54:12] [INFO] |-- ๐๏ธ column: 'product'
[21:54:12] [INFO] |-- ๐๏ธ column: 'customer_review'
[21:54: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 โ Home Office โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ product_subcategory โ Storage โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ target_age_range โ 50-65 โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ review_style โ structured with bullet points โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_name โ Edward Phillips โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_age โ 42 โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ product โ { โ โ โ 'name': 'EleganceSmart Stackable Wire Mesh Drawer Organizers', โ โ โ 'description': 'Premium stainless-steel wire mesh drawer organizers designed for โ โ โ seniors seeking efficient, clutter-free home office storage. Features ergonomic pull tabs โ โ โ and stackable design to optimize desk or desktop space for paperwork, supplies, and โ โ โ accessories. Durable, rust-resistant construction ensures long-term reliability.', โ โ โ 'price': 49.99 โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_review โ { โ โ โ 'rating': 5, โ โ โ 'customer_mood': 'happy', โ โ โ 'review': 'โข Excellent design tailored for seniors, featuring ergonomic pull tabs โ โ โ that facilitate easy access.\nโข Robust stainless-steel construction offers rust โ โ โ resistance and longโterm durability.\nโข Stackable configuration maximizes drawer or โ โ โ desktop space, promoting an organized workspace.\nโข Smooth mesh material allows for quick โ โ โ visual identification of stored items.\nโข Price point of $49.99 provides strong value for โ โ โ the quality and functionality offered.\nโข Overall, the EleganceSmart organizers enhance โ โ โ efficiency and reduce clutter in home office environments.' โ โ โ } โ โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [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 | Home Office | Storage | 50-65 | structured with bullet points | Edward Phillips | 42 | {'name': 'EleganceSmart Stackable Wire Mesh Dr... | {'rating': 5, 'customer_mood': 'happy', 'revie... |
| 1 | Home Office | Lighting | 50-65 | detailed | Sheila Ramos | 64 | {'name': 'SunGlow LED Desk Lamp', 'description... | {'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 โ 1 (50.0%) โ category โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ product_subcategory โ string โ 2 (100.0%) โ subcategory โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค โ target_age_range โ string โ 1 (50.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%) โ 264.5 +/- 0.5 โ 72.5 +/- 12.0 โ โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_review โ dict โ 2 (100.0%) โ 330.5 +/- 10.5 โ 188.0 +/- 93.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")
[21:54:12] [INFO] ๐จ Creating Data Designer dataset
[21:54:12] [INFO] โ Validation passed
[21:54:12] [INFO] โ๏ธ Sorting column configs into a Directed Acyclic Graph
[21:54:12] [INFO] ๐ฉบ Running health checks for models...
[21:54:12] [INFO] |-- ๐ Checking 'nvidia/nemotron-3-nano-30b-a3b' in provider named 'nvidia' for model alias 'nemotron-nano-v3'...
[21:54:12] [INFO] |-- โ Passed!
[21:54:12] [INFO] โณ Processing batch 1 of 1
[21:54:12] [INFO] ๐ฒ Preparing samplers to generate 10 records across 5 columns
[21:54:12] [INFO] ๐งฉ Generating column `customer_name` from expression
[21:54:12] [INFO] ๐งฉ Generating column `customer_age` from expression
[21:54:12] [INFO] ๐๏ธ llm-structured model config for column 'product'
[21:54:12] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[21:54:12] [INFO] |-- model alias: 'nemotron-nano-v3'
[21:54:12] [INFO] |-- model provider: 'nvidia'
[21:54:12] [INFO] |-- inference parameters: generation_type=chat-completion, max_parallel_requests=4, extra_body={'chat_template_kwargs': {'enable_thinking': False}}, temperature=1.00, top_p=1.00, max_tokens=2048
[21:54:12] [INFO] ๐ Processing llm-structured column 'product' with 4 concurrent workers
[21:54:15] [INFO] ๐๏ธ llm-structured model config for column 'customer_review'
[21:54:15] [INFO] |-- model: 'nvidia/nemotron-3-nano-30b-a3b'
[21:54:15] [INFO] |-- model alias: 'nemotron-nano-v3'
[21:54:15] [INFO] |-- model provider: 'nvidia'
[21:54:15] [INFO] |-- inference parameters: generation_type=chat-completion, max_parallel_requests=4, extra_body={'chat_template_kwargs': {'enable_thinking': False}}, temperature=1.00, top_p=1.00, max_tokens=2048
[21:54:15] [INFO] ๐ Processing llm-structured column 'customer_review' with 4 concurrent workers
[21:54:20] [INFO] ๐ Dropping columns: ['customer']
[21:54:20] [INFO] ๐ Model usage summary:
{
"nvidia/nemotron-3-nano-30b-a3b": {
"token_usage": {
"input_tokens": 7177,
"output_tokens": 3884,
"total_tokens": 11061
},
"request_usage": {
"successful_requests": 21,
"failed_requests": 0,
"total_requests": 21
},
"tokens_per_second": 1444,
"requests_per_minute": 164
}
}
[21:54:20] [INFO] ๐ Measuring dataset column statistics:
[21:54:20] [INFO] |-- ๐ฒ column: 'product_category'
[21:54:20] [INFO] |-- ๐ฒ column: 'product_subcategory'
[21:54:20] [INFO] |-- ๐ฒ column: 'target_age_range'
[21:54:20] [INFO] |-- ๐ฒ column: 'review_style'
[21:54:20] [INFO] |-- ๐งฉ column: 'customer_name'
[21:54:20] [INFO] |-- ๐งฉ column: 'customer_age'
[21:54:20] [INFO] |-- ๐๏ธ column: 'product'
[21:54:20] [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 | Electronics | Smartphones | 25-35 | brief | Jamie Morrison | 75 | {'description': 'A sleek, 6.1-inch OLED displa... | {'customer_mood': 'neutral', 'rating': 4, 'rev... |
| 1 | Electronics | Headphones | 65+ | brief | Christopher Krause | 105 | {'description': 'CrystalClear Pro is a premium... | {'customer_mood': 'happy', 'rating': 5, 'revie... |
| 2 | Books | Self-Help | 18-25 | rambling | Michelle Matthews | 19 | {'description': 'A beautifully designed, 365-d... | {'customer_mood': 'excited', 'rating': 5, 'rev... |
| 3 | Home Office | Desks | 35-50 | structured with bullet points | Eric Edwards | 76 | {'description': 'A sleek, modern desk designed... | {'customer_mood': 'happy', 'rating': 5, 'revie... |
| 4 | Home & Kitchen | Cookware | 18-25 | rambling | Laura Baker | 62 | {'description': 'A 3-piece ceramic non-stick c... | {'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 โ 7 (70.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%) โ 265.0 +/- 0.5 โ 85.5 +/- 36.2 โ โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโค โ customer_review โ dict โ 10 (100.0%) โ 342.0 +/- 34.7 โ 168.5 +/- 138.9 โ โโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโ ๐งฉ 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: