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
# To get an sdg_key, first create a project via the REST API (POST /projects/)
sdk = SyntheticDatasetClient(sdg_key="your-sdg-key")
# 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"Project ID: {result['project_id']}")
print(f"Total batches: {result['total_batches']}")
# 3. Check batch formation status
status = sdk.get_batch_status()
print(f"Processed: {len([b for b in status['batches'] if b['status'] == 'done'])} / {status['total_batches']}")
# 4. Fetch the generated dataset (paginated)
# This will return validated QA pairs once the pipeline is done
dataset = sdk.get_dataset(include_faulty=False, page=1, page_size=20)
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synthetic_dataset_sdk-0.1.2.tar.gz.
File metadata
- Download URL: synthetic_dataset_sdk-0.1.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dfb4a86f0cd57532ae51be6e742633351698db0648c67935a813841c996a27f
|
|
| MD5 |
ba676b1b40e71eec90cac60240be1333
|
|
| BLAKE2b-256 |
3aa17631f10bc195f527f17da6cb15a7354b2d0d67fbe858bd6769fb28a194e3
|
File details
Details for the file synthetic_dataset_sdk-0.1.2-py3-none-any.whl.
File metadata
- Download URL: synthetic_dataset_sdk-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b5823e4619361eed15413a1e23cd4342305ec3e226ffafb4d304dfd75969616
|
|
| MD5 |
54b9574a3561ad231cf0f447127993ad
|
|
| BLAKE2b-256 |
ed7b12feab8a8f33af2f90528356dc98b6cc02fe2dd10d66d4b794d72cb10337
|