{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 🎨 Data Designer 101: The Basics\n", "\n", "[Click here](https://raw.githubusercontent.com/NVIDIA-NeMo/DataDesigner/refs/heads/main/docs/notebooks/1-the-basics.ipynb) to download this notebook to your computer.", "\n", "#### 📚 What you'll learn\n", "\n", "This notebook demonstrates the basics of Data Designer by generating a simple product review dataset.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### đŸ“Ļ Import the essentials\n", "\n", "- The `essentials` module provides quick access to the most commonly used objects.\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from data_designer.essentials import (\n", " CategorySamplerParams,\n", " DataDesigner,\n", " DataDesignerConfigBuilder,\n", " InferenceParameters,\n", " LLMTextColumnConfig,\n", " ModelConfig,\n", " PersonSamplerParams,\n", " SamplerColumnConfig,\n", " SamplerType,\n", " SubcategorySamplerParams,\n", " UniformSamplerParams,\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### âš™ī¸ Initialize the Data Designer interface\n", "\n", "- `DataDesigner` is the main object that is used to interface with the library.\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "data_designer = DataDesigner()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### đŸŽ›ī¸ Define model configurations\n", "\n", "- Each `ModelConfig` defines a model that can be used during the generation process.\n", "\n", "- The \"model alias\" is used to reference the model in the Data Designer config (as we will see below).\n", "\n", "- The \"model provider\" is the external service that hosts the model (see the [model config](/models/default-model-settings.md) docs for more details).\n", "\n", "- By default, we use [build.nvidia.com](https://build.nvidia.com/models) as the model provider.\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# This name is set in the model provider configuration.\n", "MODEL_PROVIDER = \"nvidia\"\n", "\n", "# The model ID is from build.nvidia.com.\n", "MODEL_ID = \"nvidia/nvidia-nemotron-nano-9b-v2\"\n", "\n", "# We choose this alias to be descriptive for our use case.\n", "MODEL_ALIAS = \"nemotron-nano-v2\"\n", "\n", "# This sets reasoning to False for the nemotron-nano-v2 model.\n", "SYSTEM_PROMPT = \"/no_think\"\n", "\n", "model_configs = [\n", " ModelConfig(\n", " alias=MODEL_ALIAS,\n", " model=MODEL_ID,\n", " provider=MODEL_PROVIDER,\n", " inference_parameters=InferenceParameters(\n", " temperature=0.5,\n", " top_p=1.0,\n", " max_tokens=1024,\n", " ),\n", " )\n", "]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### đŸ—ī¸ Initialize the Data Designer Config Builder\n", "\n", "- The Data Designer config defines the dataset schema and generation process.\n", "\n", "- The config builder provides an intuitive interface for building this configuration.\n", "\n", "- The list of model configs is provided to the builder at initialization.\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "config_builder = DataDesignerConfigBuilder(model_configs=model_configs)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 🎲 Getting started with sampler columns\n", "\n", "- Sampler columns offer non-LLM based generation of synthetic data.\n", "\n", "- They are particularly useful for **steering the diversity** of the generated data, as we demonstrate below.\n", "\n", "
\n", "\n", "You can view available samplers using the config builder's `info` property:\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
─────────────────────────────────────────── NeMo Data Designer Samplers ───────────────────────────────────────────\n",
       "\n",
       "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n",
       "┃ Type              ┃ Parameter                     ┃ Data Type                     ┃ Required ┃ Constraints      ┃\n",
       "┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩\n",
       "│ bernoulli         │ p                             │ number                        │    ✓     │ >= 0.0, <= 1.0   │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ bernoulli_mixture │ p                             │ number                        │    ✓     │ >= 0.0, <= 1.0   │\n",
       "│                   │ dist_name                     │ string                        │    ✓     │                  │\n",
       "│                   │ dist_params                   │ dict                          │    ✓     │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ binomial          │ n                             │ integer                       │    ✓     │                  │\n",
       "│                   │ p                             │ number                        │    ✓     │ >= 0.0, <= 1.0   │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ category          │ values                        │ string[] | integer[] |        │    ✓     │ len > 1          │\n",
       "│                   │                               │ number[]                      │          │                  │\n",
       "│                   │ weights                       │ number[] | null               │          │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ datetime          │ start                         │ string                        │    ✓     │                  │\n",
       "│                   │ end                           │ string                        │    ✓     │                  │\n",
       "│                   │ unit                          │ string                        │          │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ gaussian          │ mean                          │ number                        │    ✓     │                  │\n",
       "│                   │ stddev                        │ number                        │    ✓     │                  │\n",
       "│                   │ decimal_places                │ integer | null                │          │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ person            │ locale                        │ string                        │          │                  │\n",
       "│                   │ sex                           │ string | null                 │          │                  │\n",
       "│                   │ city                          │ string | string[] | null      │          │                  │\n",
       "│                   │ age_range                     │ integer[]                     │          │ len > 2, len < 2 │\n",
       "│                   │ state                         │ string | string[] | null      │          │                  │\n",
       "│                   │ with_synthetic_personas       │ boolean                       │          │                  │\n",
       "│                   │ sample_dataset_when_available │ boolean                       │          │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ poisson           │ mean                          │ number                        │    ✓     │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ scipy             │ dist_name                     │ string                        │    ✓     │                  │\n",
       "│                   │ dist_params                   │ dict                          │    ✓     │                  │\n",
       "│                   │ decimal_places                │ integer | null                │          │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ subcategory       │ category                      │ string                        │    ✓     │                  │\n",
       "│                   │ values                        │ dict                          │    ✓     │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ timedelta         │ dt_min                        │ integer                       │    ✓     │ >= 0             │\n",
       "│                   │ dt_max                        │ integer                       │    ✓     │ > 0              │\n",
       "│                   │ reference_column_name         │ string                        │    ✓     │                  │\n",
       "│                   │ unit                          │ string                        │          │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ uniform           │ low                           │ number                        │    ✓     │                  │\n",
       "│                   │ high                          │ number                        │    ✓     │                  │\n",
       "│                   │ decimal_places                │ integer | null                │          │                  │\n",
       "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n",
       "│ uuid              │ prefix                        │ string | null                 │          │                  │\n",
       "│                   │ short_form                    │ boolean                       │          │                  │\n",
       "│                   │ uppercase                     │ boolean                       │          │                  │\n",
       "└───────────────────┴───────────────────────────────┴───────────────────────────────┴──────────┴──────────────────┘\n",
       "
\n" ], "text/plain": [ "\u001b[92m─────────────────────────────────────────── \u001b[0mNeMo Data Designer Samplers\u001b[92m ───────────────────────────────────────────\u001b[0m\n", "\n", "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n", "┃\u001b[1m \u001b[0m\u001b[1mType \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mParameter \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mData Type \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mRequired\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mConstraints \u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩\n", "│ bernoulli │ p │ number │ ✓ │ >= 0.0, <= 1.0 │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ bernoulli_mixture │ p │ number │ ✓ │ >= 0.0, <= 1.0 │\n", "│ │ dist_name │ string │ ✓ │ │\n", "│ │ dist_params │ dict │ ✓ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ binomial │ n │ integer │ ✓ │ │\n", "│ │ p │ number │ ✓ │ >= 0.0, <= 1.0 │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ category │ values │ string[] | integer[] | │ ✓ │ len > 1 │\n", "│ │ │ number[] │ │ │\n", "│ │ weights │ number[] | null │ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ datetime │ start │ string │ ✓ │ │\n", "│ │ end │ string │ ✓ │ │\n", "│ │ unit │ string │ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ gaussian │ mean │ number │ ✓ │ │\n", "│ │ stddev │ number │ ✓ │ │\n", "│ │ decimal_places │ integer | null │ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ person │ locale │ string │ │ │\n", "│ │ sex │ string | null │ │ │\n", "│ │ city │ string | string[] | null │ │ │\n", "│ │ age_range │ integer[] │ │ len > 2, len < 2 │\n", "│ │ state │ string | string[] | null │ │ │\n", "│ │ with_synthetic_personas │ boolean │ │ │\n", "│ │ sample_dataset_when_available │ boolean │ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ poisson │ mean │ number │ ✓ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ scipy │ dist_name │ string │ ✓ │ │\n", "│ │ dist_params │ dict │ ✓ │ │\n", "│ │ decimal_places │ integer | null │ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ subcategory │ category │ string │ ✓ │ │\n", "│ │ values │ dict │ ✓ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ timedelta │ dt_min │ integer │ ✓ │ >= 0 │\n", "│ │ dt_max │ integer │ ✓ │ > 0 │\n", "│ │ reference_column_name │ string │ ✓ │ │\n", "│ │ unit │ string │ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ uniform │ low │ number │ ✓ │ │\n", "│ │ high │ number │ ✓ │ │\n", "│ │ decimal_places │ integer | null │ │ │\n", "├───────────────────â”ŧ───────────────────────────────â”ŧ───────────────────────────────â”ŧ──────────â”ŧ──────────────────┤\n", "│ uuid │ prefix │ string | null │ │ │\n", "│ │ short_form │ boolean │ │ │\n", "│ │ uppercase │ boolean │ │ │\n", "└───────────────────┴───────────────────────────────┴───────────────────────────────┴──────────┴──────────────────┘\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "config_builder.info.display(\"samplers\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's start designing our product review dataset by adding product category and subcategory columns.\n" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[19:00:10] [INFO] ✅ Validation passed\n" ] }, { "data": { "text/html": [ "\n", "\n", "\n", "
DataDesignerConfigBuilder(\n",
       "    sampler_columns: ['product_category', 'product_subcategory', 'target_age_range']\n",
       ")\n",
       "
\n", "\n" ], "text/plain": [ "DataDesignerConfigBuilder(\n", " sampler_columns: ['product_category', 'product_subcategory', 'target_age_range']\n", ")" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "config_builder.add_column(\n", " SamplerColumnConfig(\n", " name=\"product_category\",\n", " sampler_type=SamplerType.CATEGORY,\n", " params=CategorySamplerParams(\n", " values=[\n", " \"Electronics\",\n", " \"Clothing\",\n", " \"Home & Kitchen\",\n", " \"Books\",\n", " \"Home Office\",\n", " ],\n", " ),\n", " )\n", ")\n", "\n", "config_builder.add_column(\n", " SamplerColumnConfig(\n", " name=\"product_subcategory\",\n", " sampler_type=SamplerType.SUBCATEGORY,\n", " params=SubcategorySamplerParams(\n", " category=\"product_category\",\n", " values={\n", " \"Electronics\": [\n", " \"Smartphones\",\n", " \"Laptops\",\n", " \"Headphones\",\n", " \"Cameras\",\n", " \"Accessories\",\n", " ],\n", " \"Clothing\": [\n", " \"Men's Clothing\",\n", " \"Women's Clothing\",\n", " \"Winter Coats\",\n", " \"Activewear\",\n", " \"Accessories\",\n", " ],\n", " \"Home & Kitchen\": [\n", " \"Appliances\",\n", " \"Cookware\",\n", " \"Furniture\",\n", " \"Decor\",\n", " \"Organization\",\n", " ],\n", " \"Books\": [\n", " \"Fiction\",\n", " \"Non-Fiction\",\n", " \"Self-Help\",\n", " \"Textbooks\",\n", " \"Classics\",\n", " ],\n", " \"Home Office\": [\n", " \"Desks\",\n", " \"Chairs\",\n", " \"Storage\",\n", " \"Office Supplies\",\n", " \"Lighting\",\n", " ],\n", " },\n", " ),\n", " )\n", ")\n", "\n", "config_builder.add_column(\n", " SamplerColumnConfig(\n", " name=\"target_age_range\",\n", " sampler_type=SamplerType.CATEGORY,\n", " params=CategorySamplerParams(values=[\"18-25\", \"25-35\", \"35-50\", \"50-65\", \"65+\"]),\n", " )\n", ")\n", "\n", "# Optionally validate that the columns are configured correctly.\n", "config_builder.validate()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, let's add samplers to generate data related to the customer and their review.\n" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[19:00:10] [INFO] ✅ Validation passed\n" ] }, { "data": { "text/html": [ "\n", "\n", "\n", "
DataDesignerConfigBuilder(\n",
       "    sampler_columns: [\n",
       "        "product_category",\n",
       "        "product_subcategory",\n",
       "        "target_age_range",\n",
       "        "customer",\n",
       "        "number_of_stars",\n",
       "        "review_style"\n",
       "    ]\n",
       ")\n",
       "
\n", "\n" ], "text/plain": [ "DataDesignerConfigBuilder(\n", " sampler_columns: [\n", " \"product_category\",\n", " \"product_subcategory\",\n", " \"target_age_range\",\n", " \"customer\",\n", " \"number_of_stars\",\n", " \"review_style\"\n", " ]\n", ")" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "config_builder.add_column(\n", " SamplerColumnConfig(\n", " name=\"customer\",\n", " sampler_type=SamplerType.PERSON,\n", " params=PersonSamplerParams(age_range=[18, 70], locale=\"en_GB\"),\n", " )\n", ")\n", "\n", "config_builder.add_column(\n", " SamplerColumnConfig(\n", " name=\"number_of_stars\",\n", " sampler_type=SamplerType.UNIFORM,\n", " params=UniformSamplerParams(low=1, high=5),\n", " convert_to=\"int\", # Convert the sampled float to an integer.\n", " )\n", ")\n", "\n", "config_builder.add_column(\n", " SamplerColumnConfig(\n", " name=\"review_style\",\n", " sampler_type=SamplerType.CATEGORY,\n", " params=CategorySamplerParams(\n", " values=[\"rambling\", \"brief\", \"detailed\", \"structured with bullet points\"],\n", " weights=[1, 2, 2, 1],\n", " ),\n", " )\n", ")\n", "\n", "config_builder.validate()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## đŸĻœ LLM-generated columns\n", "\n", "- The real power of Data Designer comes from leveraging LLMs to generate text, code, and structured data.\n", "\n", "- When prompting the LLM, we can use Jinja templating to reference other columns in the dataset.\n", "\n", "- As we see below, nested json fields can be accessed using dot notation.\n" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[19:00:10] [INFO] ✅ Validation passed\n" ] }, { "data": { "text/html": [ "\n", "\n", "\n", "
DataDesignerConfigBuilder(\n",
       "    sampler_columns: [\n",
       "        "product_category",\n",
       "        "product_subcategory",\n",
       "        "target_age_range",\n",
       "        "customer",\n",
       "        "number_of_stars",\n",
       "        "review_style"\n",
       "    ]\n",
       "    llm_text_columns: ['product_name', 'customer_review']\n",
       ")\n",
       "
\n", "\n" ], "text/plain": [ "DataDesignerConfigBuilder(\n", " sampler_columns: [\n", " \"product_category\",\n", " \"product_subcategory\",\n", " \"target_age_range\",\n", " \"customer\",\n", " \"number_of_stars\",\n", " \"review_style\"\n", " ]\n", " llm_text_columns: ['product_name', 'customer_review']\n", ")" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "config_builder.add_column(\n", " LLMTextColumnConfig(\n", " name=\"product_name\",\n", " prompt=(\n", " \"You are a helpful assistant that generates product names. DO NOT add quotes around the product name.\\n\\n\"\n", " \"Come up with a creative product name for a product in the '{{ product_category }}' category, focusing \"\n", " \"on products related to '{{ product_subcategory }}'. The target age range of the ideal customer is \"\n", " \"{{ target_age_range }} years old. Respond with only the product name, no other text.\"\n", " ),\n", " system_prompt=SYSTEM_PROMPT,\n", " model_alias=MODEL_ALIAS,\n", " )\n", ")\n", "\n", "config_builder.add_column(\n", " LLMTextColumnConfig(\n", " name=\"customer_review\",\n", " prompt=(\n", " \"You are a customer named {{ customer.first_name }} from {{ customer.city }}, {{ customer.state }}. \"\n", " \"You are {{ customer.age }} years old and recently purchased a product called {{ product_name }}. \"\n", " \"Write a review of this product, which you gave a rating of {{ number_of_stars }} stars. \"\n", " \"The style of the review should be '{{ review_style }}'.\"\n", " ),\n", " system_prompt=SYSTEM_PROMPT,\n", " model_alias=MODEL_ALIAS,\n", " )\n", ")\n", "\n", "config_builder.validate()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 🔁 Iteration is key – preview the dataset!\n", "\n", "1. Use the `preview` method to generate a sample of records quickly.\n", "\n", "2. Inspect the results for quality and format issues.\n", "\n", "3. Adjust column configurations, prompts, or parameters as needed.\n", "\n", "4. Re-run the preview until satisfied.\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[19:00:10] [INFO] 🧐 Preview generation in progress\n", "[19:00:10] [INFO] ✅ Validation passed\n", "[19:00:10] [INFO] â›“ī¸ Sorting column configs into a Directed Acyclic Graph\n", "[19:00:10] [INFO] đŸŠē Running health checks for models...\n", "[19:00:10] [INFO] |-- 👀 Checking 'nvidia/nvidia-nemotron-nano-9b-v2' in provider named 'nvidia' for model alias 'nemotron-nano-v2'...\n", "[19:00:13] [INFO] |-- ✅ Passed!\n", "[19:00:13] [INFO] 🎲 Preparing samplers to generate 10 records across 6 columns\n", "[19:00:13] [INFO] 📝 Preparing llm-text column generation\n", "[19:00:13] [INFO] |-- column name: 'product_name'\n", "[19:00:13] [INFO] |-- model config:\n", "{\n", " \"alias\": \"nemotron-nano-v2\",\n", " \"model\": \"nvidia/nvidia-nemotron-nano-9b-v2\",\n", " \"inference_parameters\": {\n", " \"temperature\": 0.5,\n", " \"top_p\": 1.0,\n", " \"max_tokens\": 1024,\n", " \"max_parallel_requests\": 4,\n", " \"timeout\": null,\n", " \"extra_body\": null\n", " },\n", " \"provider\": \"nvidia\"\n", "}\n", "[19:00:13] [INFO] 🐙 Processing llm-text column 'product_name' with 4 concurrent workers\n", "[19:00:17] [INFO] 📝 Preparing llm-text column generation\n", "[19:00:17] [INFO] |-- column name: 'customer_review'\n", "[19:00:17] [INFO] |-- model config:\n", "{\n", " \"alias\": \"nemotron-nano-v2\",\n", " \"model\": \"nvidia/nvidia-nemotron-nano-9b-v2\",\n", " \"inference_parameters\": {\n", " \"temperature\": 0.5,\n", " \"top_p\": 1.0,\n", " \"max_tokens\": 1024,\n", " \"max_parallel_requests\": 4,\n", " \"timeout\": null,\n", " \"extra_body\": null\n", " },\n", " \"provider\": \"nvidia\"\n", "}\n", "[19:00:17] [INFO] 🐙 Processing llm-text column 'customer_review' with 4 concurrent workers\n", "[19:00:31] [INFO] 📊 Model usage summary:\n", "{\n", " \"nvidia/nvidia-nemotron-nano-9b-v2\": {\n", " \"token_usage\": {\n", " \"prompt_tokens\": 1639,\n", " \"completion_tokens\": 5642,\n", " \"total_tokens\": 7281\n", " },\n", " \"request_usage\": {\n", " \"successful_requests\": 20,\n", " \"failed_requests\": 0,\n", " \"total_requests\": 20\n", " },\n", " \"tokens_per_second\": 398,\n", " \"requests_per_minute\": 65\n", " }\n", "}\n", "[19:00:31] [INFO] 📐 Measuring dataset column statistics:\n", "[19:00:31] [INFO] |-- 🎲 column: 'product_category'\n", "[19:00:31] [INFO] |-- 🎲 column: 'product_subcategory'\n", "[19:00:31] [INFO] |-- 🎲 column: 'target_age_range'\n", "[19:00:31] [INFO] |-- 🎲 column: 'customer'\n", "[19:00:31] [INFO] |-- 🎲 column: 'number_of_stars'\n", "[19:00:31] [INFO] |-- 🎲 column: 'review_style'\n", "[19:00:31] [INFO] |-- 📝 column: 'product_name'\n", "[19:00:31] [INFO] |-- 📝 column: 'customer_review'\n", "[19:00:31] [INFO] 🎉 Preview complete!\n" ] } ], "source": [ "preview = data_designer.preview(config_builder)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
                                                                                                                   \n",
       "                                                 Generated Columns                                                 \n",
       "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n",
       "┃ Name                ┃ Value                                                                                     ┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
       "│ product_category    │ Home & Kitchen                                                                            │\n",
       "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n",
       "│ product_subcategory │ Organization                                                                              │\n",
       "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n",
       "│ target_age_range    │ 50-65                                                                                     │\n",
       "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n",
       "│ customer            │ {                                                                                         │\n",
       "│                     │     'uuid': '67c0a53a-ddfb-49c4-adea-69a220eef85f',                                       │\n",
       "│                     │     'locale': 'en_GB',                                                                    │\n",
       "│                     │     'first_name': 'Angela',                                                               │\n",
       "│                     │     'last_name': 'Atkins',                                                                │\n",
       "│                     │     'middle_name': None,                                                                  │\n",
       "│                     │     'sex': 'Female',                                                                      │\n",
       "│                     │     'street_number': '3',                                                                 │\n",
       "│                     │     'street_name': 'Ashley turnpike',                                                     │\n",
       "│                     │     'city': 'Mohammedview',                                                               │\n",
       "│                     │     'state': None,                                                                        │\n",
       "│                     │     'postcode': 'WV02 7UH',                                                               │\n",
       "│                     │     'age': 31,                                                                            │\n",
       "│                     │     'birth_date': '1994-05-17',                                                           │\n",
       "│                     │     'country': 'Bahamas',                                                                 │\n",
       "│                     │     'marital_status': 'widowed',                                                          │\n",
       "│                     │     'education_level': 'doctorate',                                                       │\n",
       "│                     │     'unit': '',                                                                           │\n",
       "│                     │     'occupation': 'Metallurgist',                                                         │\n",
       "│                     │     'phone_number': '0117 496 0534',                                                      │\n",
       "│                     │     'bachelors_field': 'arts_humanities'                                                  │\n",
       "│                     │ }                                                                                         │\n",
       "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n",
       "│ number_of_stars     │ 4                                                                                         │\n",
       "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n",
       "│ review_style        │ detailed                                                                                  │\n",
       "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n",
       "│ product_name        │ CozyNest Organizer                                                                        │\n",
       "│                     │                                                                                           │\n",
       "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n",
       "│ customer_review     │ **Product Review: CozyNest Organizer (4 Stars)**                                          │\n",
       "│                     │ *By Angela, 31*                                                                           │\n",
       "│                     │                                                                                           │\n",
       "│                     │ I recently purchased the CozyNest Organizer from Mohammedview, and I’m thrilled to share  │\n",
       "│                     │ my experience. As someone who’s always struggled with clutter in my workspace and home, I │\n",
       "│                     │ was excited to try this product, and I’m glad I did—though I have a few thoughts to       │\n",
       "│                     │ share.                                                                                    │\n",
       "│                     │                                                                                           │\n",
       "│                     │ **Design and Build Quality**                                                              │\n",
       "│                     │ The CozyNest Organizer is a sleek, modern piece that immediately caught my eye. Its       │\n",
       "│                     │ minimalist design blends well with my existing decor, and the materials feel durable—no   │\n",
       "│                     │ flimsy plastic or cheap finishes. The organizers are made of a sturdy, eco-friendly       │\n",
       "│                     │ fabric that’s both soft to the touch and resistant to stains, which is a huge plus. I     │\n",
       "│                     │ appreciate the attention to detail, like the reinforced stitching and the way the         │\n",
       "│                     │ compartments are thoughtfully sized for different items. It’s not just a pretty box; it’s │\n",
       "│                     │ built to last.                                                                            │\n",
       "│                     │                                                                                           │\n",
       "│                     │ **Functionality**                                                                         │\n",
       "│                     │ This is where the CozyNest truly shines. The organizer comes with multiple compartments,  │\n",
       "│                     │ each designed for specific purposes—pens, papers, small electronics, and even a hidden    │\n",
       "│                     │ pocket for receipts or keys. I’ve used it in my office to keep my desk tidy, and it’s     │\n",
       "│                     │ been a game-changer. The layout is intuitive, and I can easily find what I need without   │\n",
       "│                     │ rummaging through a pile of items. However, I did find that the largest compartment is a  │\n",
       "│                     │ bit smaller than I expected, which made it a bit tight when storing bulkier items. That   │\n",
       "│                     │ said, it’s perfect for everyday essentials.                                               │\n",
       "│                     │                                                                                           │\n",
       "│                     │ **Ease of Use and Assembly**                                                              │\n",
       "│                     │ Setting up the CozyNest was straightforward. The instructions were clear, and it took me  │\n",
       "│                     │ about 10 minutes to assemble. The pieces fit together securely, and there were no tools   │\n",
       "│                     │ required, which is a big win. Once assembled, it’s easy to move around or adjust as       │\n",
       "│                     │ needed. I also love that it’s lightweight yet stable, so it doesn’t tip over easily.      │\n",
       "│                     │                                                                                           │\n",
       "│                     │ **Comfort and Practicality**                                                              │\n",
       "│                     │ One of the standout features is how comfortable it is to use. The fabric is soft enough   │\n",
       "│                     │ that I don’t mind touching it frequently, and the compartments are deep enough to hold    │\n",
       "│                     │ items without feeling cramped. I’ve used it to organize my craft supplies at home, and    │\n",
       "│                     │ it’s made my creative sessions much more enjoyable. The only minor downside is that the   │\n",
       "│                     │ fabric isn’t waterproof, so I had to be careful with spills. But for general use, this    │\n",
       "│                     │ hasn’t been an issue.                                                                     │\n",
       "│                     │                                                                                           │\n",
       "│                     │ **Value for Money**                                                                       │\n",
       "│                     │ At the price point, I feel the CozyNest Organizer is well worth it. It’s not the cheapest │\n",
       "│                     │ option on the market, but the quality and functionality justify the cost. I’ve already    │\n",
       "│                     │ noticed a significant reduction in clutter, and it’s helped me stay more organized in     │\n",
       "│                     │ both my personal and professional life.                                                   │\n",
       "│                     │                                                                                           │\n",
       "│                     │ **Final Thoughts**                                                                        │\n",
       "│                     │ While I gave it 4 stars instead of 5, it’s because of the slightly smaller main           │\n",
       "│                     │ compartment and the lack of waterproofing. These are minor flaws, though, and they don’t  │\n",
       "│                     │ detract from the overall value. If you’re looking for a stylish, functional organizer     │\n",
       "│                     │ that’s easy to use and durable, the CozyNest is a fantastic choice. I’d definitely        │\n",
       "│                     │ recommend it to anyone needing a reliable way to declutter their space.                   │\n",
       "│                     │                                                                                           │\n",
       "│                     │ Thanks to Mohammedview for offering such a great product—I’m already considering          │\n",
       "│                     │ purchasing another one for my home!                                                       │\n",
       "│                     │                                                                                           │\n",
       "└─────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────┘\n",
       "                                                                                                                   \n",
       "                                                    [index: 0]                                                     \n",
       "
\n" ], "text/plain": [ " \n", "\u001b[3m Generated Columns \u001b[0m\n", "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n", "┃\u001b[1m \u001b[0m\u001b[1mName \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mValue \u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n", "│ product_category │ Home & Kitchen │\n", "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n", "│ product_subcategory │ Organization │\n", "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n", "│ target_age_range │ 50-65 │\n", "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n", "│ customer │ \u001b[1m{\u001b[0m │\n", "│ │ \u001b[32m'uuid'\u001b[0m: \u001b[32m'67c0a53a-ddfb-49c4-adea-69a220eef85f'\u001b[0m, │\n", "│ │ \u001b[32m'locale'\u001b[0m: \u001b[32m'en_GB'\u001b[0m, │\n", "│ │ \u001b[32m'first_name'\u001b[0m: \u001b[32m'Angela'\u001b[0m, │\n", "│ │ \u001b[32m'last_name'\u001b[0m: \u001b[32m'Atkins'\u001b[0m, │\n", "│ │ \u001b[32m'middle_name'\u001b[0m: \u001b[3;35mNone\u001b[0m, │\n", "│ │ \u001b[32m'sex'\u001b[0m: \u001b[32m'Female'\u001b[0m, │\n", "│ │ \u001b[32m'street_number'\u001b[0m: \u001b[32m'3'\u001b[0m, │\n", "│ │ \u001b[32m'street_name'\u001b[0m: \u001b[32m'Ashley turnpike'\u001b[0m, │\n", "│ │ \u001b[32m'city'\u001b[0m: \u001b[32m'Mohammedview'\u001b[0m, │\n", "│ │ \u001b[32m'state'\u001b[0m: \u001b[3;35mNone\u001b[0m, │\n", "│ │ \u001b[32m'postcode'\u001b[0m: \u001b[32m'WV02 7UH'\u001b[0m, │\n", "│ │ \u001b[32m'age'\u001b[0m: \u001b[1;36m31\u001b[0m, │\n", "│ │ \u001b[32m'birth_date'\u001b[0m: \u001b[32m'1994-05-17'\u001b[0m, │\n", "│ │ \u001b[32m'country'\u001b[0m: \u001b[32m'Bahamas'\u001b[0m, │\n", "│ │ \u001b[32m'marital_status'\u001b[0m: \u001b[32m'widowed'\u001b[0m, │\n", "│ │ \u001b[32m'education_level'\u001b[0m: \u001b[32m'doctorate'\u001b[0m, │\n", "│ │ \u001b[32m'unit'\u001b[0m: \u001b[32m''\u001b[0m, │\n", "│ │ \u001b[32m'occupation'\u001b[0m: \u001b[32m'Metallurgist'\u001b[0m, │\n", "│ │ \u001b[32m'phone_number'\u001b[0m: \u001b[32m'0117 496 0534'\u001b[0m, │\n", "│ │ \u001b[32m'bachelors_field'\u001b[0m: \u001b[32m'arts_humanities'\u001b[0m │\n", "│ │ \u001b[1m}\u001b[0m │\n", "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n", "│ number_of_stars │ 4 │\n", "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n", "│ review_style │ detailed │\n", "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n", "│ product_name │ CozyNest Organizer │\n", "│ │ │\n", "├─────────────────────â”ŧ───────────────────────────────────────────────────────────────────────────────────────────┤\n", "│ customer_review │ **Product Review: CozyNest Organizer (4 Stars)** │\n", "│ │ *By Angela, 31* │\n", "│ │ │\n", "│ │ I recently purchased the CozyNest Organizer from Mohammedview, and I’m thrilled to share │\n", "│ │ my experience. As someone who’s always struggled with clutter in my workspace and home, I │\n", "│ │ was excited to try this product, and I’m glad I did—though I have a few thoughts to │\n", "│ │ share. │\n", "│ │ │\n", "│ │ **Design and Build Quality** │\n", "│ │ The CozyNest Organizer is a sleek, modern piece that immediately caught my eye. Its │\n", "│ │ minimalist design blends well with my existing decor, and the materials feel durable—no │\n", "│ │ flimsy plastic or cheap finishes. The organizers are made of a sturdy, eco-friendly │\n", "│ │ fabric that’s both soft to the touch and resistant to stains, which is a huge plus. I │\n", "│ │ appreciate the attention to detail, like the reinforced stitching and the way the │\n", "│ │ compartments are thoughtfully sized for different items. It’s not just a pretty box; it’s │\n", "│ │ built to last. │\n", "│ │ │\n", "│ │ **Functionality** │\n", "│ │ This is where the CozyNest truly shines. The organizer comes with multiple compartments, │\n", "│ │ each designed for specific purposes—pens, papers, small electronics, and even a hidden │\n", "│ │ pocket for receipts or keys. I’ve used it in my office to keep my desk tidy, and it’s │\n", "│ │ been a game-changer. The layout is intuitive, and I can easily find what I need without │\n", "│ │ rummaging through a pile of items. However, I did find that the largest compartment is a │\n", "│ │ bit smaller than I expected, which made it a bit tight when storing bulkier items. That │\n", "│ │ said, it’s perfect for everyday essentials. │\n", "│ │ │\n", "│ │ **Ease of Use and Assembly** │\n", "│ │ Setting up the CozyNest was straightforward. The instructions were clear, and it took me │\n", "│ │ about 10 minutes to assemble. The pieces fit together securely, and there were no tools │\n", "│ │ required, which is a big win. Once assembled, it’s easy to move around or adjust as │\n", "│ │ needed. I also love that it’s lightweight yet stable, so it doesn’t tip over easily. │\n", "│ │ │\n", "│ │ **Comfort and Practicality** │\n", "│ │ One of the standout features is how comfortable it is to use. The fabric is soft enough │\n", "│ │ that I don’t mind touching it frequently, and the compartments are deep enough to hold │\n", "│ │ items without feeling cramped. I’ve used it to organize my craft supplies at home, and │\n", "│ │ it’s made my creative sessions much more enjoyable. The only minor downside is that the │\n", "│ │ fabric isn’t waterproof, so I had to be careful with spills. But for general use, this │\n", "│ │ hasn’t been an issue. │\n", "│ │ │\n", "│ │ **Value for Money** │\n", "│ │ At the price point, I feel the CozyNest Organizer is well worth it. It’s not the cheapest │\n", "│ │ option on the market, but the quality and functionality justify the cost. I’ve already │\n", "│ │ noticed a significant reduction in clutter, and it’s helped me stay more organized in │\n", "│ │ both my personal and professional life. │\n", "│ │ │\n", "│ │ **Final Thoughts** │\n", "│ │ While I gave it 4 stars instead of 5, it’s because of the slightly smaller main │\n", "│ │ compartment and the lack of waterproofing. These are minor flaws, though, and they don’t │\n", "│ │ detract from the overall value. If you’re looking for a stylish, functional organizer │\n", "│ │ that’s easy to use and durable, the CozyNest is a fantastic choice. I’d definitely │\n", "│ │ recommend it to anyone needing a reliable way to declutter their space. │\n", "│ │ │\n", "│ │ Thanks to Mohammedview for offering such a great product—I’m already considering │\n", "│ │ purchasing another one for my home! │\n", "│ │ │\n", "└─────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────┘\n", " \n", " [index: 0] \n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Run this cell multiple times to cycle through the 10 preview records.\n", "preview.display_sample_record()" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
product_categoryproduct_subcategorytarget_age_rangecustomernumber_of_starsreview_styleproduct_namecustomer_review
0Home & KitchenOrganization50-65{'uuid': '67c0a53a-ddfb-49c4-adea-69a220eef85f...4detailedCozyNest Organizer\\n**Product Review: CozyNest Organizer (4 Stars)...
1BooksTextbooks18-25{'uuid': 'cb555c14-2773-4b91-9052-d8f736b34c79...4briefSmartStudyGuides\\n**Review:** \\nSmartStudyGuides is a solid too...
2Home & KitchenOrganization35-50{'uuid': 'd140c09d-ff91-4259-86bd-bfa86365f8b0...4detailedSmartSpace Organizer\\n**Product Review: SmartSpace Organizer (4 Star...
3Home OfficeLighting25-35{'uuid': '386fc57c-e769-442c-8fbb-7e92348fe052...5structured with bullet pointsBrightNest\\n**Trevor's Review of BrightNest (5 Stars) – La...
4Home & KitchenFurniture25-35{'uuid': 'a2dd98a8-6e95-4953-9c6d-0e35c40cb976...3detailedModernNest\\n**Product Review: ModernNest – A 3-Star Experi...
5BooksFiction35-50{'uuid': '4156a3d2-79d4-4b72-9fdb-4dd22b477935...3detailedWhispers of the Forgotten Realm\\n**Review Title:** A Mixed Experience with \"Whi...
6ElectronicsCameras65+{'uuid': '44af7f7c-2aa4-4cba-8099-41b47767c0f8...3detailedSeniorShutter\\n**Product Review: SeniorShutter – A Mixed Expe...
7ClothingMen's Clothing50-65{'uuid': '91d59484-dba8-494e-a9c1-f5e90044ac2b...4ramblingTimelessTactics\\nOkay, so I bought this thing called TimelessTa...
8Home OfficeDesks25-35{'uuid': '8b5c6ead-a39b-4ddf-bf36-c91af15cfe90...5detailedWorkNest Pro\\n**Product Review: WorkNest Pro – A Game-Change...
9BooksSelf-Help50-65{'uuid': '7ba8a0a6-f2a9-4145-b887-64957ee40158...4structured with bullet pointsMindful Moments\\n**Product Review: Mindful Moments – 4 Stars** ...
\n", "
" ], "text/plain": [ " product_category product_subcategory target_age_range \\\n", "0 Home & Kitchen Organization 50-65 \n", "1 Books Textbooks 18-25 \n", "2 Home & Kitchen Organization 35-50 \n", "3 Home Office Lighting 25-35 \n", "4 Home & Kitchen Furniture 25-35 \n", "5 Books Fiction 35-50 \n", "6 Electronics Cameras 65+ \n", "7 Clothing Men's Clothing 50-65 \n", "8 Home Office Desks 25-35 \n", "9 Books Self-Help 50-65 \n", "\n", " customer number_of_stars \\\n", "0 {'uuid': '67c0a53a-ddfb-49c4-adea-69a220eef85f... 4 \n", "1 {'uuid': 'cb555c14-2773-4b91-9052-d8f736b34c79... 4 \n", "2 {'uuid': 'd140c09d-ff91-4259-86bd-bfa86365f8b0... 4 \n", "3 {'uuid': '386fc57c-e769-442c-8fbb-7e92348fe052... 5 \n", "4 {'uuid': 'a2dd98a8-6e95-4953-9c6d-0e35c40cb976... 3 \n", "5 {'uuid': '4156a3d2-79d4-4b72-9fdb-4dd22b477935... 3 \n", "6 {'uuid': '44af7f7c-2aa4-4cba-8099-41b47767c0f8... 3 \n", "7 {'uuid': '91d59484-dba8-494e-a9c1-f5e90044ac2b... 4 \n", "8 {'uuid': '8b5c6ead-a39b-4ddf-bf36-c91af15cfe90... 5 \n", "9 {'uuid': '7ba8a0a6-f2a9-4145-b887-64957ee40158... 4 \n", "\n", " review_style product_name \\\n", "0 detailed CozyNest Organizer\\n \n", "1 brief SmartStudyGuides\\n \n", "2 detailed SmartSpace Organizer\\n \n", "3 structured with bullet points BrightNest\\n \n", "4 detailed ModernNest\\n \n", "5 detailed Whispers of the Forgotten Realm\\n \n", "6 detailed SeniorShutter\\n \n", "7 rambling TimelessTactics\\n \n", "8 detailed WorkNest Pro\\n \n", "9 structured with bullet points Mindful Moments\\n \n", "\n", " customer_review \n", "0 **Product Review: CozyNest Organizer (4 Stars)... \n", "1 **Review:** \\nSmartStudyGuides is a solid too... \n", "2 **Product Review: SmartSpace Organizer (4 Star... \n", "3 **Trevor's Review of BrightNest (5 Stars) – La... \n", "4 **Product Review: ModernNest – A 3-Star Experi... \n", "5 **Review Title:** A Mixed Experience with \"Whi... \n", "6 **Product Review: SeniorShutter – A Mixed Expe... \n", "7 Okay, so I bought this thing called TimelessTa... \n", "8 **Product Review: WorkNest Pro – A Game-Change... \n", "9 **Product Review: Mindful Moments – 4 Stars** ... " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# The preview dataset is available as a pandas DataFrame.\n", "preview.dataset" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 📊 Analyze the generated data\n", "\n", "- Data Designer automatically generates a basic statistical analysis of the generated data.\n", "\n", "- This analysis is available via the `analysis` property of generation result objects.\n" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
──────────────────────────────────────── 🎨 Data Designer Dataset Profile ─────────────────────────────────────────\n",
       "\n",
       "                                                                                                                   \n",
       "                                                 Dataset Overview                                                  \n",
       "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n",
       "┃ number of records               ┃ number of columns               ┃ percent complete records                    ┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
       "│ 10                              │ 8                               │ 100.0%                                      │\n",
       "└─────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────────────────┘\n",
       "                                                                                                                   \n",
       "                                                                                                                   \n",
       "                                                🎲 Sampler Columns                                                 \n",
       "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n",
       "┃ column name                      ┃        data type ┃               number unique values ┃         sampler type ┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩\n",
       "│ product_category                 │           string │                          5 (50.0%) │             category │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ product_subcategory              │           string │                          9 (90.0%) │          subcategory │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ target_age_range                 │           string │                          5 (50.0%) │             category │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ customer                         │             dict │                        10 (100.0%) │               person │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ number_of_stars                  │              int │                          3 (30.0%) │              uniform │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ review_style                     │           string │                          4 (40.0%) │             category │\n",
       "└──────────────────────────────────┴──────────────────┴────────────────────────────────────┴──────────────────────┘\n",
       "                                                                                                                   \n",
       "                                                                                                                   \n",
       "                                                📝 LLM-Text Columns                                                \n",
       "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n",
       "┃                       ┃               ┃                            ┃     prompt tokens ┃      completion tokens ┃\n",
       "┃ column name           ┃     data type ┃       number unique values ┃        per record ┃             per record ┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
       "│ product_name          │        string │                10 (100.0%) │      77.0 +/- 0.7 │            4.5 +/- 1.0 │\n",
       "├───────────────────────â”ŧ───────────────â”ŧ────────────────────────────â”ŧ───────────────────â”ŧ────────────────────────┤\n",
       "│ customer_review       │        string │                10 (100.0%) │      63.0 +/- 1.5 │        625.0 +/- 281.1 │\n",
       "└───────────────────────┴───────────────┴────────────────────────────┴───────────────────┴────────────────────────┘\n",
       "                                                                                                                   \n",
       "                                                                                                                   \n",
       "╭────────────────────────────────────────────────── Table Notes ──────────────────────────────────────────────────╮\n",
       "│                                                                                                                 │\n",
       "│  1. All token statistics are based on a sample of max(1000, len(dataset)) records.                              │\n",
       "│  2. Tokens are calculated using tiktoken's cl100k_base tokenizer.                                               │\n",
       "│                                                                                                                 │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "                                                                                                                   \n",
       "───────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n",
       "
\n" ], "text/plain": [ "\u001b[1;38;2;118;185;0m──────────────────────────────────────── \u001b[0m🎨 Data Designer Dataset Profile\u001b[1;38;2;118;185;0m ─────────────────────────────────────────\u001b[0m\n", "\n", " \n", "\u001b[1;38;2;118;185;0m Dataset Overview \u001b[0m\n", "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n", "┃\u001b[1;2m \u001b[0m\u001b[1;2mnumber of records \u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2mnumber of columns \u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2mpercent complete records \u001b[0m\u001b[1;2m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n", "│ 10 │ 8 │ 100.0% │\n", "└─────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────────────────┘\n", " \n", " \n", "\u001b[1;38;2;118;185;0m 🎲 Sampler Columns \u001b[0m\n", "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n", "┃\u001b[1;2m \u001b[0m\u001b[1;2mcolumn name \u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m data type\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m number unique values\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m sampler type\u001b[0m\u001b[1;2m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩\n", "│ product_category │ string │ 5 (50.0%) │ category │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ product_subcategory │ string │ 9 (90.0%) │ subcategory │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ target_age_range │ string │ 5 (50.0%) │ category │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ customer │ dict │ 10 (100.0%) │ person │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ number_of_stars │ int │ 3 (30.0%) │ uniform │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ review_style │ string │ 4 (40.0%) │ category │\n", "└──────────────────────────────────┴──────────────────┴────────────────────────────────────┴──────────────────────┘\n", " \n", " \n", "\u001b[1;38;2;118;185;0m 📝 LLM-Text Columns \u001b[0m\n", "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n", "┃\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m prompt tokens\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m completion tokens\u001b[0m\u001b[1;2m \u001b[0m┃\n", "┃\u001b[1;2m \u001b[0m\u001b[1;2mcolumn name \u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m data type\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m number unique values\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m per record\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m per record\u001b[0m\u001b[1;2m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩\n", "│ product_name │ string │ 10 (100.0%) │ 77.0 +/- 0.7 │ 4.5 +/- 1.0 │\n", "├───────────────────────â”ŧ───────────────â”ŧ────────────────────────────â”ŧ───────────────────â”ŧ────────────────────────┤\n", "│ customer_review │ string │ 10 (100.0%) │ 63.0 +/- 1.5 │ 625.0 +/- 281.1 │\n", "└───────────────────────┴───────────────┴────────────────────────────┴───────────────────┴────────────────────────┘\n", " \n", " \n", "\u001b[2m╭─\u001b[0m\u001b[2m─────────────────────────────────────────────────\u001b[0m\u001b[2m Table Notes \u001b[0m\u001b[2m─────────────────────────────────────────────────\u001b[0m\u001b[2m─╮\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m 1. All token statistics are based on a sample of max(1000, len(dataset)) records. \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m 2. Tokens are calculated using tiktoken's cl100k_base tokenizer. \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[2m│\u001b[0m\n", "\u001b[2m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n", " \n", "\u001b[1;38;2;118;185;0m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Print the analysis as a table.\n", "preview.analysis.to_report()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 🆙 Scale up!\n", "\n", "- Happy with your preview data?\n", "\n", "- Use the `create` method to submit larger Data Designer generation jobs.\n" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "[19:00:31] [INFO] 🎨 Creating Data Designer dataset\n", "[19:00:31] [INFO] ✅ Validation passed\n", "[19:00:31] [INFO] â›“ī¸ Sorting column configs into a Directed Acyclic Graph\n", "[19:00:31] [INFO] đŸŠē Running health checks for models...\n", "[19:00:31] [INFO] |-- 👀 Checking 'nvidia/nvidia-nemotron-nano-9b-v2' in provider named 'nvidia' for model alias 'nemotron-nano-v2'...\n", "[19:00:32] [INFO] |-- ✅ Passed!\n", "[19:00:32] [INFO] âŗ Processing batch 1 of 1\n", "[19:00:32] [INFO] 🎲 Preparing samplers to generate 20 records across 6 columns\n", "[19:00:32] [INFO] 📝 Preparing llm-text column generation\n", "[19:00:32] [INFO] |-- column name: 'product_name'\n", "[19:00:32] [INFO] |-- model config:\n", "{\n", " \"alias\": \"nemotron-nano-v2\",\n", " \"model\": \"nvidia/nvidia-nemotron-nano-9b-v2\",\n", " \"inference_parameters\": {\n", " \"temperature\": 0.5,\n", " \"top_p\": 1.0,\n", " \"max_tokens\": 1024,\n", " \"max_parallel_requests\": 4,\n", " \"timeout\": null,\n", " \"extra_body\": null\n", " },\n", " \"provider\": \"nvidia\"\n", "}\n", "[19:00:32] [INFO] 🐙 Processing llm-text column 'product_name' with 4 concurrent workers\n", "[19:00:43] [INFO] 📝 Preparing llm-text column generation\n", "[19:00:43] [INFO] |-- column name: 'customer_review'\n", "[19:00:43] [INFO] |-- model config:\n", "{\n", " \"alias\": \"nemotron-nano-v2\",\n", " \"model\": \"nvidia/nvidia-nemotron-nano-9b-v2\",\n", " \"inference_parameters\": {\n", " \"temperature\": 0.5,\n", " \"top_p\": 1.0,\n", " \"max_tokens\": 1024,\n", " \"max_parallel_requests\": 4,\n", " \"timeout\": null,\n", " \"extra_body\": null\n", " },\n", " \"provider\": \"nvidia\"\n", "}\n", "[19:00:43] [INFO] 🐙 Processing llm-text column 'customer_review' with 4 concurrent workers\n", "[19:01:10] [INFO] 📊 Model usage summary:\n", "{\n", " \"nvidia/nvidia-nemotron-nano-9b-v2\": {\n", " \"token_usage\": {\n", " \"prompt_tokens\": 3263,\n", " \"completion_tokens\": 9038,\n", " \"total_tokens\": 12301\n", " },\n", " \"request_usage\": {\n", " \"successful_requests\": 40,\n", " \"failed_requests\": 0,\n", " \"total_requests\": 40\n", " },\n", " \"tokens_per_second\": 323,\n", " \"requests_per_minute\": 63\n", " }\n", "}\n", "[19:01:10] [INFO] 📐 Measuring dataset column statistics:\n", "[19:01:10] [INFO] |-- 🎲 column: 'product_category'\n", "[19:01:10] [INFO] |-- 🎲 column: 'product_subcategory'\n", "[19:01:10] [INFO] |-- 🎲 column: 'target_age_range'\n", "[19:01:10] [INFO] |-- 🎲 column: 'customer'\n", "[19:01:10] [INFO] |-- 🎲 column: 'number_of_stars'\n", "[19:01:10] [INFO] |-- 🎲 column: 'review_style'\n", "[19:01:10] [INFO] |-- 📝 column: 'product_name'\n", "[19:01:10] [INFO] |-- 📝 column: 'customer_review'\n" ] } ], "source": [ "results = data_designer.create(config_builder, num_records=20)" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
product_categoryproduct_subcategorytarget_age_rangecustomernumber_of_starsreview_styleproduct_namecustomer_review
0ElectronicsHeadphones35-50{'age': 44, 'bachelors_field': 'arts_humanitie...3detailedSoundSage**Review Title: A Mixed Experience with SoundS...
1Home OfficeStorage50-65{'age': 52, 'bachelors_field': 'no_degree', 'b...3structured with bullet pointsTimelessTote**Review of TimelessTote (3 Stars)** \n", "\n", "- **De...
2ElectronicsAccessories25-35{'age': 56, 'bachelors_field': 'no_degree', 'b...4detailedNeonPulse**Product Review: NeonPulse by Mathew from Kie...
3ElectronicsSmartphones65+{'age': 48, 'bachelors_field': 'no_degree', 'b...4detailedSeniorSense Smartphone**Product Review: SeniorSense Smartphone – A T...
4Home OfficeDesks35-50{'age': 48, 'bachelors_field': 'no_degree', 'b...2briefWorkspaceElevate**Review:** Disappointing. Expected more from ...
\n", "
" ], "text/plain": [ " product_category product_subcategory target_age_range \\\n", "0 Electronics Headphones 35-50 \n", "1 Home Office Storage 50-65 \n", "2 Electronics Accessories 25-35 \n", "3 Electronics Smartphones 65+ \n", "4 Home Office Desks 35-50 \n", "\n", " customer number_of_stars \\\n", "0 {'age': 44, 'bachelors_field': 'arts_humanitie... 3 \n", "1 {'age': 52, 'bachelors_field': 'no_degree', 'b... 3 \n", "2 {'age': 56, 'bachelors_field': 'no_degree', 'b... 4 \n", "3 {'age': 48, 'bachelors_field': 'no_degree', 'b... 4 \n", "4 {'age': 48, 'bachelors_field': 'no_degree', 'b... 2 \n", "\n", " review_style product_name \\\n", "0 detailed SoundSage\n", " \n", "1 structured with bullet points TimelessTote\n", " \n", "2 detailed NeonPulse\n", " \n", "3 detailed SeniorSense Smartphone\n", " \n", "4 brief WorkspaceElevate\n", " \n", "\n", " customer_review \n", "0 **Review Title: A Mixed Experience with SoundS... \n", "1 **Review of TimelessTote (3 Stars)** \n", "\n", "- **De... \n", "2 **Product Review: NeonPulse by Mathew from Kie... \n", "3 **Product Review: SeniorSense Smartphone – A T... \n", "4 **Review:** Disappointing. Expected more from ... " ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Load the generated dataset as a pandas DataFrame.\n", "dataset = results.load_dataset()\n", "\n", "dataset.head()" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
──────────────────────────────────────── 🎨 Data Designer Dataset Profile ─────────────────────────────────────────\n",
       "\n",
       "                                                                                                                   \n",
       "                                                 Dataset Overview                                                  \n",
       "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n",
       "┃ number of records               ┃ number of columns               ┃ percent complete records                    ┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
       "│ 20                              │ 8                               │ 100.0%                                      │\n",
       "└─────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────────────────┘\n",
       "                                                                                                                   \n",
       "                                                                                                                   \n",
       "                                                🎲 Sampler Columns                                                 \n",
       "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n",
       "┃ column name                      ┃        data type ┃               number unique values ┃         sampler type ┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩\n",
       "│ product_category                 │           string │                          5 (25.0%) │             category │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ product_subcategory              │           string │                         14 (70.0%) │          subcategory │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ target_age_range                 │           string │                          5 (25.0%) │             category │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ customer                         │             dict │                        20 (100.0%) │               person │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ number_of_stars                  │              int │                          4 (20.0%) │              uniform │\n",
       "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n",
       "│ review_style                     │           string │                          4 (20.0%) │             category │\n",
       "└──────────────────────────────────┴──────────────────┴────────────────────────────────────┴──────────────────────┘\n",
       "                                                                                                                   \n",
       "                                                                                                                   \n",
       "                                                📝 LLM-Text Columns                                                \n",
       "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n",
       "┃                       ┃               ┃                            ┃     prompt tokens ┃      completion tokens ┃\n",
       "┃ column name           ┃     data type ┃       number unique values ┃        per record ┃             per record ┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
       "│ product_name          │        string │                20 (100.0%) │      77.0 +/- 0.8 │            4.5 +/- 0.9 │\n",
       "├───────────────────────â”ŧ───────────────â”ŧ────────────────────────────â”ŧ───────────────────â”ŧ────────────────────────┤\n",
       "│ customer_review       │        string │                20 (100.0%) │      62.0 +/- 2.1 │        406.5 +/- 322.5 │\n",
       "└───────────────────────┴───────────────┴────────────────────────────┴───────────────────┴────────────────────────┘\n",
       "                                                                                                                   \n",
       "                                                                                                                   \n",
       "╭────────────────────────────────────────────────── Table Notes ──────────────────────────────────────────────────╮\n",
       "│                                                                                                                 │\n",
       "│  1. All token statistics are based on a sample of max(1000, len(dataset)) records.                              │\n",
       "│  2. Tokens are calculated using tiktoken's cl100k_base tokenizer.                                               │\n",
       "│                                                                                                                 │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "                                                                                                                   \n",
       "───────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n",
       "
\n" ], "text/plain": [ "\u001b[1;38;2;118;185;0m──────────────────────────────────────── \u001b[0m🎨 Data Designer Dataset Profile\u001b[1;38;2;118;185;0m ─────────────────────────────────────────\u001b[0m\n", "\n", " \n", "\u001b[1;38;2;118;185;0m Dataset Overview \u001b[0m\n", "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n", "┃\u001b[1;2m \u001b[0m\u001b[1;2mnumber of records \u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2mnumber of columns \u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2mpercent complete records \u001b[0m\u001b[1;2m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n", "│ 20 │ 8 │ 100.0% │\n", "└─────────────────────────────────┴─────────────────────────────────┴─────────────────────────────────────────────┘\n", " \n", " \n", "\u001b[1;38;2;118;185;0m 🎲 Sampler Columns \u001b[0m\n", "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n", "┃\u001b[1;2m \u001b[0m\u001b[1;2mcolumn name \u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m data type\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m number unique values\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m sampler type\u001b[0m\u001b[1;2m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩\n", "│ product_category │ string │ 5 (25.0%) │ category │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ product_subcategory │ string │ 14 (70.0%) │ subcategory │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ target_age_range │ string │ 5 (25.0%) │ category │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ customer │ dict │ 20 (100.0%) │ person │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ number_of_stars │ int │ 4 (20.0%) │ uniform │\n", "├──────────────────────────────────â”ŧ──────────────────â”ŧ────────────────────────────────────â”ŧ──────────────────────┤\n", "│ review_style │ string │ 4 (20.0%) │ category │\n", "└──────────────────────────────────┴──────────────────┴────────────────────────────────────┴──────────────────────┘\n", " \n", " \n", "\u001b[1;38;2;118;185;0m 📝 LLM-Text Columns \u001b[0m\n", "â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”ŗâ”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”“\n", "┃\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m prompt tokens\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m completion tokens\u001b[0m\u001b[1;2m \u001b[0m┃\n", "┃\u001b[1;2m \u001b[0m\u001b[1;2mcolumn name \u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m data type\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m number unique values\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m per record\u001b[0m\u001b[1;2m \u001b[0m┃\u001b[1;2m \u001b[0m\u001b[1;2m per record\u001b[0m\u001b[1;2m \u001b[0m┃\n", "┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩\n", "│ product_name │ string │ 20 (100.0%) │ 77.0 +/- 0.8 │ 4.5 +/- 0.9 │\n", "├───────────────────────â”ŧ───────────────â”ŧ────────────────────────────â”ŧ───────────────────â”ŧ────────────────────────┤\n", "│ customer_review │ string │ 20 (100.0%) │ 62.0 +/- 2.1 │ 406.5 +/- 322.5 │\n", "└───────────────────────┴───────────────┴────────────────────────────┴───────────────────┴────────────────────────┘\n", " \n", " \n", "\u001b[2m╭─\u001b[0m\u001b[2m─────────────────────────────────────────────────\u001b[0m\u001b[2m Table Notes \u001b[0m\u001b[2m─────────────────────────────────────────────────\u001b[0m\u001b[2m─╮\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m 1. All token statistics are based on a sample of max(1000, len(dataset)) records. \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m 2. Tokens are calculated using tiktoken's cl100k_base tokenizer. \u001b[2m│\u001b[0m\n", "\u001b[2m│\u001b[0m \u001b[2m│\u001b[0m\n", "\u001b[2m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n", " \n", "\u001b[1;38;2;118;185;0m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Load the analysis results into memory.\n", "analysis = results.load_analysis()\n", "\n", "analysis.to_report()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## â­ī¸ Next Steps\n", "\n", "Now that you've seen the basics of Data Designer, check out the following notebooks to learn more about:\n", "\n", "- [Structured outputs and jinja expressions](/notebooks/2-structured-outputs-and-jinja-expressions/)\n", "\n", "- [Seeding synthetic data generation with an external dataset](/notebooks/3-seeding-with-a-dataset/)\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.9" } }, "nbformat": 4, "nbformat_minor": 4 }