Skip to main content

A lightweight Python client for the Synthetic Dataset Generation SaaS API

Project description

Synthetic Dataset SDK

A lightweight Python client for the Synthetic Dataset Generation API. This SDK allows you to easily ingest document pages and retrieve generated synthetic datasets.

Installation

pip install synthetic-dataset-sdk

Quick Start

from synthetic_dataset_sdk import SyntheticDatasetClient

# 1. Initialize the client
sdk = SyntheticDatasetClient(
    api_key="your-api-key",
    base_url="http://your-backend-url:8000"
)

# 2. Upload document pages
# pages should be a list of dicts: [{"page_no": 1, "doc_id": "DOC-A", "text": "..."}]
pages = [
    {
        "page_no": 1, 
        "doc_id": "DOC-A", 
        "text": "The quick brown fox jumps over the lazy dog."
    }
]
result = sdk.upload(pages)
print(f"Ingest status: {result['job_status']}")

# 3. Check batch formation status
status = sdk.get_batch_status()
print(f"Total batches: {status['total_batches']}")

# 4. Fetch the generated dataset
# This will return validated QA pairs once the pipeline is done
dataset = sdk.get_dataset(include_faulty=False)
for entry in dataset["entries"]:
    print(f"Q: {entry['question']}")
    print(f"A: {entry['answer']}")

Features

  • Easy Ingestion: Upload raw text pages directly from your pipeline.
  • Batch Tracking: Monitor the progress of batch formation and QA generation.
  • Faulty Filtering: Toggle between high-accuracy pairs and the full generated set.
  • Lightweight: Minimal dependencies (just requests).

Requirements

  • Python 3.8+
  • requests

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

synthetic_dataset_sdk-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

synthetic_dataset_sdk-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file synthetic_dataset_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: synthetic_dataset_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for synthetic_dataset_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b3f7d8230cd7b108c62d277f6650eb7ae9b01238c06e957251a7ed4a10753054
MD5 17069fbf79fd23a783cb1d5bacad58e8
BLAKE2b-256 bf3ef22d062547c889e02c3f6984fb4d52112a7dfc1c6567fb2edfea3bed0c75

See more details on using hashes here.

File details

Details for the file synthetic_dataset_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for synthetic_dataset_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca1f026d82b6627a31c7f7617549a7849c46caef116e7f7b931adc096ed8c819
MD5 6eb9ea44215010094abc08c870484e06
BLAKE2b-256 2109bd3a1ae1df4f0bc424b625bb4898c5656971a86e06b47a0afc04ab229c07

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