This is a viewer only at the moment see the article on how this works.
To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk
This is a preview from the server running through my markdig pipeline
Wednesday, 24 December 2025
में पार्ट 1 हम तत्व को कवर करते हैं: PII के बिना पारदर्शी खण्ड। पार्ट 2 सत्र प्रोफाइल, संकेत तथा खण्ड परिभाषाओं को कवर करता है.
पर पहले: आप कभी असली ग्राहक डाटा को छू के बिना इस में से किसी को कैसे मान्य है?
इस श्रंखला के लिए मैं स्थानीय रूप से एक संपूर्ण रसायनीय आकृति तैयार करता हूं:
यह उन लोगों में से एक है जो “ऐसा लगता है कि नकल करने के काम में लगे हुए हैं: आप यथार्थवादी साबित होते हैं, आप उन्हें किसी भी समय फिर से ठीक कर सकते हैं, और आप PII को अपने पर्यावरण में कभी नहीं प्रस्तुत करते ।
यदि आप खण्ड बनाना चाहते हैं / व्यक्तिगतकरण, तो आपको ऐसे डेटासेटों की ज़रूरत है जो:
असली डेटा विपरीत है: संवेदनशील, गड़बड़ी, चारों ओर चलने के लिए कठिन, और ऐतिहासिक भेदभाव से भरा हुआ ।
सिंथिक डाटा आपको तीन सुपर शक्तियाँ देता है:
flowchart LR
Taxonomy[gadget-taxonomy.json] --> Gen[SampleData generator]
Gen --> Products[products.json]
Gen --> Profiles[profiles.json]
Gen --> Images[images/*]
Products --> Import[Import into Postgres]
Profiles --> Import
style Taxonomy stroke:#1971c2,stroke-width:3px
style Gen stroke:#1971c2,stroke-width:3px
style Import stroke:#2f9e44,stroke-width:3px
दिल दहलानेवाली ज़िंदगी Mostlylucid.SegmentCommerce.SampleData.
यह अनजाने में “खरा ” नहीं है ।
विन्यास रात को तार दिया गया है ताकि आप इसे वातावरण चर के माध्यम से ड्राइव कर सकें:
// Mostlylucid.SegmentCommerce.SampleData/Program.cs
var configuration = new ConfigurationBuilder()
.SetBasePath(AppContext.BaseDirectory)
.AddJsonFile("appsettings.json", optional: true)
.AddEnvironmentVariables("SAMPLEDATA_")
.Build();
जनक के साथ आप आम तौर पर तीन स्थानीय सेवाओं को चलाते हैं:
flowchart LR
CLI[SampleData CLI] --> Ollama["Ollama
http://localhost:11434"]
CLI --> Comfy["ComfyUI
http://localhost:8188"]
CLI -. optional .-> DB[(Postgres)]
style CLI stroke:#1971c2,stroke-width:3px
style Ollama stroke:#1971c2,stroke-width:3px
style Comfy stroke:#2f9e44,stroke-width:3px
style DB stroke:#fab005,stroke-width:3px
सहेजेंसी रूट से जेनरेटर चलाएँ:
dotnet run --project Mostlylucid.SegmentCommerce.SampleData -- status
फिर डाटासेट बनाएँ:
# v1 generator: taxonomy + optional Ollama + optional ComfyUI
# Writes ./Output/products.json, ./Output/profiles.json, ./Output/images/...
dotnet run --project Mostlylucid.SegmentCommerce.SampleData -- generate --count 20
उपयोगी स्विचः
# No LLM calls, taxonomy only
dotnet run --project Mostlylucid.SegmentCommerce.SampleData -- generate --no-ollama
# No ComfyUI images
dotnet run --project Mostlylucid.SegmentCommerce.SampleData -- generate --no-images
# Write into Postgres (uses configured connection string)
dotnet run --project Mostlylucid.SegmentCommerce.SampleData -- generate --db
टीप: यदि कॉमfyUI उपलब्ध नहीं है, तो v1 जेनरेटर screr छवियों को रखने के लिए वापस गिर जाता है (यह उपयोग करता है) picsum.photosताकि मार्ग “पूरी तरह से ऑफ़लाइन ” न हो। और यदि आप निश्चित रूप से चाहते हैं, तो दौड़-धूप कर सकते हैं --no-images.
एक नया जनक कमांड भी है (.gen) कि एक और पूर्ण रूप से तैयार करता है "मार्केट" डाटासेट:
# v2 generator
# Writes dataset.json plus sellers/products/customers/orders split files
dotnet run --project Mostlylucid.SegmentCommerce.SampleData -- gen --sellers 50 --products 20 --customers 1000
यह एक बहु-पौशीय के रूप में बनाया गया है:
flowchart LR
A[Sellers] --> B[Products]
B --> C[Customers]
C --> D[Orders]
D --> E[Embeddings]
B -. optional .-> I[ComfyUI images]
style A stroke:#1971c2,stroke-width:3px
style B stroke:#1971c2,stroke-width:3px
style C stroke:#1971c2,stroke-width:3px
style D stroke:#1971c2,stroke-width:3px
style E stroke:#2f9e44,stroke-width:3px
style I stroke:#2f9e44,stroke-width:3px
और आप कोड में सीधे उन चरणों को देख सकते हैं:
// Mostlylucid.SegmentCommerce.SampleData/Services/DataGenerator.cs
// 1. Generate Sellers
// 2. Generate Products for each seller
// 3. Generate Customers
// 4. Generate Orders (with fake checkout data via Bogus)
// 5. Generate embeddings for all entities
वी2 जनक एम्बेडिंग की गणना NNX मॉडल के प्रयोग से कर सकते हैं (डिफ़ॉल्ट: all-MiniLM-L6-v2. पहली बार जब आप इसे चलाते हैं, यह मॉडल को डाउनलोड करता है और आपके आउटपुट फ़ोल्डर में वीडियोबत्ती डाउनलोड करता है.
इसका मतलब है:
--no-embeddings// Mostlylucid.SegmentCommerce.SampleData/Services/EmbeddingService.cs
private const string ModelUrl = "https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/onnx/model.onnx";
private const string VocabUrl = "https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/vocab.txt";
// Download model if not exists
if (!File.Exists(_config.ModelPath))
{
await DownloadFileAsync(ModelUrl, _config.ModelPath, ct);
}
उत्पाद पीढ़ी प्रायोगिक जानबूझकर सख्त है:LM केवल JSON के साथ ही, एक अंतर्निर्मित JSON स्कीमा उदाहरण के साथ वापस आना चाहिए.
// Mostlylucid.SegmentCommerce.SampleData/Services/OllamaProductGenerator.cs
return $"""
You are a product catalog generator for an e-commerce store. Generate {count} unique, realistic product listings for the \"{category.DisplayName}\" category.
Category description: {category.Description}
Example products in this category: {category.ExampleProducts}
Price range: £{category.PriceRange.Min:F2} - £{category.PriceRange.Max:F2}
For each product, provide:
1. A compelling product name (realistic brand-style naming)
2. A detailed description (2-3 sentences, highlighting key features and benefits)
3. A realistic price within the range
4. Optional original price if on sale (20-40% higher than current price)
5. 3-5 relevant tags
6. Whether it's trending (about 20% should be trending)
7. Whether it's featured (about 15% should be featured)
8. An image prompt for AI image generation (detailed, product photography style)
9. 2-3 colour variants for the product
IMPORTANT: Respond with ONLY valid JSON, no markdown formatting, no code blocks, no explanations.
Generate {count} diverse products now:
""";
यह मामला इसलिए है क्योंकि नीचे आन्तरिक व्यवस्थाएँ (एवीटी + आयात किया जा रहा है) संरचनात्मक डाटा चाहता है. सरकशी के लिए इनपुट, लिखने के लिए नहीं.
'JONON केवल" के साथ भी, आप अभी भी रक्षात्मक विश्लेषण और सुप्रयोगक कर की जरूरत है.
वी2 जनक यह करता है कि एक छोटे सहायक के द्वारा (एक छोटे से सहायक के साथ)LlmService) कि पहले खींच लेता है {...} ब्लॉक तथा डिइसबाइड्स यह:
// Mostlylucid.SegmentCommerce.SampleData/Services/LlmService.cs
var jsonStart = response.IndexOf('{');
var jsonEnd = response.LastIndexOf('}');
if (jsonStart >= 0 && jsonEnd > jsonStart)
{
var jsonStr = response.Substring(jsonStart, jsonEnd - jsonStart + 1);
return JsonSerializer.Deserialize<T>(jsonStr, new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
});
}
और पूरी पीढ़ी साफ जांचती है कि कब आवश्यकता होती है:
flowchart LR
A[EnableLlm=true?] -->|no| F[Fallback templates]
A -->|yes| B[GET /api/tags]
B -->|model present| C[LLM JSON prompts]
B -->|not available| F
style A stroke:#1971c2,stroke-width:3px
style C stroke:#2f9e44,stroke-width:3px
style F stroke:#fab005,stroke-width:3px
ग्राहकों के लिए व्यक्तित्व प्रेरित कम है और बनावटी है ताकि यह एक छोटे स्थानीय मॉडल के साथ जल्दी से उत्पन्न किया जा सकता है:
// Mostlylucid.SegmentCommerce.SampleData/Services/DataGenerator.cs
var prompt = $$"""
Generate a shopper persona interested in: {{string.Join(", ", categoryNames)}}.
Return JSON only:
{
"persona": "Brief persona description (e.g. 'Tech enthusiast who values quality')",
"name": "Realistic first name",
"bio": "One sentence about their shopping habits",
"age": 25,
"shopping_style": "budget|value|premium|luxury",
"preferred_categories": ["category1", "category2"]
}
""";
AfyuUI बहुत अच्छा है क्योंकि यह आपको एक नियंत्रणीय (कार्यशीलता) देता है, इसके बजाय एक "एक काला बॉक्स के अंत में छवि के अंत" के बजाय.
जेनरेटर:
ComfyUI/workflows/product_image.json)CLIPTextEncode/prompt/history/{promptId}/view?...sequenceDiagram
participant Gen as SampleData
participant Comfy as ComfyUI
Gen->>Comfy: POST /prompt (workflow + prompt)
Comfy-->>Gen: prompt_id
loop poll
Gen->>Comfy: GET /history/{prompt_id}
Comfy-->>Gen: outputs / images
end
Gen->>Comfy: GET /view?filename=...&type=output
Comfy-->>Gen: PNG bytes
कॉमीयू मॉडल चयन को चालू करने में भी पैच किया गया है (इसलिए आप JSON का संपादन किए बगैर जांच बिन्दु बदल सकते हैं):
// Mostlylucid.SegmentCommerce.SampleData/Services/ComfyUIImageGenerator.cs
TryPatchCheckpoint(workflow, _config.ComfyUICheckpointName ?? "sd_xl_base_1.0.safetensors");
TryPatchRefiner(workflow, _config.ComfyUIRefinerName ?? "sd_xl_refiner_1.0.safetensors");
और (उनके किनारे) गिलास रखे होंगे
// Mostlylucid.SegmentCommerce.SampleData/Services/ComfyUIImageGenerator.cs
// Update CLIPTextEncode nodes with our prompt
if (classType == "CLIPTextEncode")
{
var inputs = nodeObj["inputs"]?.AsObject();
if (inputs != null && inputs.ContainsKey("text"))
{
var currentText = inputs["text"]?.GetValue<string>() ?? "";
if (!currentText.Contains("bad") && !currentText.Contains("ugly") && !currentText.Contains("deformed"))
{
inputs["text"] = prompt;
}
}
}
// Update image dimensions
if (classType == "EmptyLatentImage")
{
var inputs = nodeObj["inputs"]?.AsObject();
if (inputs != null)
{
inputs["width"] = _config.ImageWidth;
inputs["height"] = _config.ImageHeight;
}
}
V1 निर्माता अज्ञात प्रोफ़ाइल पैदा करता है और फिर एक व्यक्तित्व के साथ उन्हें समृद्ध करता है (कोई PIII I). आप यथार्थ रूप से प्राप्त डेटा के साथ समाप्त होता है बिना ईमेल, पता, या आप कभी भी गंभीर जहाज बना सकते हैं.
v1 में, प्रोफाइल को एक रास्ते का उपयोग कर कुंजी है Oh, तो वहाँ कुछ भी नहीं है
// Mostlylucid.SegmentCommerce.SampleData/Services/ProfileGenerator.cs
var profileKey = Hash($"fp-{Guid.NewGuid():N}");
private static string Hash(string input)
{
using var sha = SHA256.Create();
var bytes = sha.ComputeHash(Encoding.UTF8.GetBytes(input));
return Convert.ToHexString(bytes).ToLowerInvariant();
}
यह ठीक वैसा ही है जैसा आपने कभी सोचा भी नहीं था ।
flowchart TB
Signals["Generated signals
views/cart/purchase weights"] --> Persona["Persona enrichment
Ollama JSON-only"]
Persona --> Portrait[Portrait prompt]
Portrait --> Comfy[ComfyUI]
style Signals stroke:#1971c2,stroke-width:3px
style Persona stroke:#1971c2,stroke-width:3px
style Comfy stroke:#2f9e44,stroke-width:3px
यह स्थानीय सिंक्रोनाइज़ेशन शक्तिशाली है क्योंकि यह समर्थन करता है मॉडल वैध, सिर्फ डेमो नहीं.
महत्वपूर्ण धूर्त: दोनों की रचना से पाठ और छवियाँ, आप पूरे उत्पाद अनुभव को वैध कर सकते हैं, सिर्फ वापस गणित नहीं.
पार्ट 2: सत्र प्रोफाइल, संकेत, और खण्ड परिभाषा
पार्ट 3 ( D) आउटबॉक्स पैटर्न, कार्य कतार, तथा पारदर्शी यूआई.
जेनरेटर कोड: Mostlylucid.SegmentCommerce.SampleData/
© 2026 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.