Skip to main content

A CLI for generating synthetic data

Project description

Synda

[!WARNING] This project is in its very early stages of development and should not be used in production environments.

[!NOTE] PR are more than welcome. Check the roadmap if you want to contribute or create discussion to submit a use-case.

Synda (synthetic data) is a package that allows you to create synthetic data generation pipelines. It is opinionated and fast by design, with plans to become highly configurable in the future.

Installation

Synda requires Python 3.10 or higher.

You can install Synda using pipx:

pipx install synda

Usage

  1. Create a YAML configuration file (e.g., config.yaml) that defines your pipeline:
input:
  type: csv
  properties:
    path: tests/stubs/simple_pipeline/source.csv
    target_column: content
    separator: "\t"

pipeline:
  - type: split
    method: chunk
    name: chunk_faq
    parameters:
      size: 500
      # overlap: 20

  - type: split
    method: separator
    name: sentence_chunk_faq
    parameters:
      separator: .
      keep_separator: true

  - type: generation
    method: llm
    parameters:
      provider: openai
      model: gpt-4o-mini
      template: |
        Ask a question regarding the sentence about the content.
        content: {chunk_faq}
        sentence: {sentence_chunk_faq}

        Instructions :
        1. Use english only
        2. Keep it short

        question:

  - type: clean
    method: deduplicate-tf-idf
    parameters:
      strategy: fuzzy
      similarity_threshold: 0.9
      keep: first 

  - type: ablation
    method: llm-judge-binary
    parameters:
      provider: openai
      model: gpt-4o-mini
      consensus: all # any, majority
      criteria:
        - Is the question written in english?
        - Is the question consistent?

output:
  type: csv
  properties:
    path: tests/stubs/simple_pipeline/output.csv
    separator: "\t"
  1. Add a model provider:
synda provider add openai --api-key [YOUR_API_KEY]
  1. Generate some synthetic data:
synda generate config.yaml

Pipeline Structure

The Nebula pipeline consists of three main parts:

  • Input: Data source configuration
  • Pipeline: Sequence of transformation and generation steps
  • Output: Configuration for the generated data output

Available Pipeline Steps

Currently, Synda supports four pipeline steps (as shown in the example above):

  • split: Breaks down data (method: chunk or method: split)
  • generation: Generates content using LLMs (method: llm)
  • clean: Delete the duplicated data (method: deduplicate-tf-idf)
  • ablation: Filters data based on defined criteria (method: llm-judge-binary)
  • metadata: Add metadata to text (method: word-position)

More steps will be added in future releases.

Roadmap

The following features are planned for future releases.

Core

  • Implement a Proof of Concept
  • Implement a common interface (Node) for input and output of each step
  • Add SQLite support
  • Add setter command for provider variable (openai, etc.)
  • Store each execution and step in DB
  • Add "split" -> "separator" step
  • Add named step
  • Store each Node in DB
  • Add "clean" -> "deduplicate" step
  • Allow injecting params from distant step into prompt
  • Add Ollama with structured generation output
  • Retry a failed run
  • Add asynchronous behaviour for any CLI
  • Add vLLM with structured generation output
  • Batch processing logic (via param.) for LLMs steps
  • Move input into pipeline (step type: 'load')
  • Move output into pipeline (step type: 'export')
  • Allow pausing and resuming pipelines
  • Trace each synthetic data with his historic
  • Enable caching of each step's output
  • Implement custom scriptable step for developer
  • Use Ray for large workload
  • Add a programmatic API

Steps

  • input/output: .xls format
  • input/output: Hugging Face datasets
  • chunk: Semantic chunks
  • clean: embedding deduplication
  • ablation: LLMs as a juries
  • masking: NER (GliNER)
  • masking: Regexp
  • masking: PII
  • metadata: Word position
  • metadata: Regexp

Ideas

  • translations (SeamlessM4T)
  • speech-to-text
  • text-to-speech
  • metadata extraction
  • tSNE / PCA
  • custom steps?

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synda-0.8.1.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synda-0.8.1-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file synda-0.8.1.tar.gz.

File metadata

  • Download URL: synda-0.8.1.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/24.4.0

File hashes

Hashes for synda-0.8.1.tar.gz
Algorithm Hash digest
SHA256 970a5753c54840b793d8e25782f34bacd67f0898c7519773e3b247344d40f9b2
MD5 c7ccca1c884d42ab14be01400898d500
BLAKE2b-256 3f0db1046ec792f37db43fe5c43598a3b6c13c8056cf9fee19f7468b502f4ab4

See more details on using hashes here.

File details

Details for the file synda-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: synda-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/24.4.0

File hashes

Hashes for synda-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae07cf00664f0ef3947fa7fbde24c62b3dc4d8be8cd81c472497ac062179b541
MD5 3569caa3d3f67a57ece2c102c63906a9
BLAKE2b-256 3ff5a70c2968de833837b60b9fb72c4b85677907898a4e50ec8ccb70f5ebc285

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page