Skip to content

Synthetic Documents generation

Overview

YData SDK supports the generation of synthetic documents — including PDF, Word (.docx), and HTML formats. This feature allows you to simulate realistic document collections with structured content, ideal for tasks such as building privacy preserving Knowledge Bases, provide private-by-design documents to a RAG system, testing document processing pipelines, training machine learning models (e.g., document classification or OCR), or developing data-centric applications that rely on unstructured or semi-structured documents.

This feature is built for flexibility and scalability, allowing users to define document structure, simulate content patterns, and export in widely used formats.

Why Synthetic Documents?

Synthetic document generation is essential in data-centric AI and software development because:

  • Data Scarcity: Real-world documents are often private, regulated, or hard to collect.
  • Privacy & Anonymity: Synthetic documents remove sensitive information while preserving structure and semantics.
  • Testing & Automation: Enable reliable testing of systems that rely on document ingestion, extraction, and classification.
  • AI & ML: Train models in areas such as LLMs, VLMs, OCR, document segmentation, and NLP, with full control over labels and layout.

Key Capabilities

  • Multi-format Output: Generate files in:
    • PDF
    • Word (.docx)
    • HTML
  • Customizable Templates: Define document schemas using flexible specifications.
  • Section-based Layout: Create documents with a title, headings, paragraphs, tables, and more.
  • Synthetic Content Generation: Populate sections with realistic data, based on your proprietary documents.
  • Multiple LLM Backends: Use Workbench (default), OpenAI, Anthropic, or Gemini via the backend parameter.
  • Multiple Output Modes: Generate single files or entire collections of documents programmatically.
  • Scanned document simulation: Pass scanned=True to generate() or include "scanned" in DatasetConfig.variations to apply a black-and-white, word-processor aesthetic — ideal for training OCR models or document classifiers on degraded input.
  • Batch configuration: Use DatasetConfig with generate_dataset() for controlled variation across many documents or for a list of pre-built payloads — see the DatasetConfig reference.
  • From existing structured data: Pass a dict or list of dicts so the document body comes from your data while layout and export still run — see Document generation from existing data.
  • From a template image: Reproduce the layout of an existing document by deriving an HTML skeleton from a reference image and reusing it across a batch — see Document generation from a template image.
  • Brand logos: Pass logo_path to generate(), generate_dataset(), or generate_from_template() to embed your logo (PNG, JPG, GIF, SVG, or WEBP) into each document's brand slot.

Feature in Beta

This feature is in beta. Contact us if you are having issues!

Related Materials