Skip to main content

SynthAI: Synthetic Data Generation Framework

PyPI version Python Version License

SynthAI is a lightweight framework for generating high-quality synthetic data using LLMs with techniques to ensure diversity and reduce bias.

Features

  • 🤖 LLM-Powered Generation: Create realistic synthetic data using language models
  • 🧩 Domain Adapters: Specialized components for different data domains (text, tabular, time-series)
  • 🔄 Diversity Enhancement: Built-in techniques to increase diversity in generated data
  • ⚖️ Bias Reduction: Methods to detect and mitigate bias in synthetic datasets
  • 📊 Quality Evaluation: Tools to measure the quality and utility of generated data
  • 🚀 Resource Efficiency: Optimized to work with lighter models and minimal compute requirements

Installation

pip install synthai

Quick Start

from synthai import SyntheticDataGenerator
from synthai.generators import TextGenerator
from synthai.evaluators import DiversityEvaluator

# Initialize a generator
generator = SyntheticDataGenerator(
    generator_type=TextGenerator(model="distilgpt2"),
    domain="customer_reviews"
)

# Generate synthetic data
synthetic_data = generator.generate(
    num_samples=100,
    prompt_template="Write a {sentiment} review for a {product_type}",
    parameters={
        "sentiment": ["positive", "negative", "neutral"],
        "product_type": ["smartphone", "laptop", "headphones"]
    }
)

# Evaluate diversity of the generated data
evaluator = DiversityEvaluator()
diversity_score = evaluator.evaluate(synthetic_data)
print(f"Diversity score: {diversity_score}")

# Save the generated data
generator.save_data(synthetic_data, "synthetic_reviews.csv")

Documentation

For full documentation, visit synthai.readthedocs.io.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

Author

Acknowledgments

Special thanks to the open-source community and the advancements in LLM technology that make this library possible.

Metadata

Release files for synthai-generator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for synthai-generator 0.1.0
File Size Uploaded
synthai_generator-0.1.0.tar.gz 20.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for synthai-generator 0.1.0
File Interpreter ABI Platform
synthai_generator-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.9 kB

Release files / synthai_generator-0.1.0.tar.gz

Download URL synthai_generator-0.1.0.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b65fba5fabaa590b3eb83836872dcc559679b2cac718bf41fb7594b09136d753
BLAKE2b-256 checksum
How to use checksums
be1efabf3db4b0b55573e85a72db7bcec12a5b400e9b7dc0b5df6632bafec2ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / synthai_generator-0.1.0-py3-none-any.whl

Download URL synthai_generator-0.1.0-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0005ae3f0dfb8252cb9672ac8a542b8c71959764d388ba361dbcd54dc4cff607
BLAKE2b-256 checksum
How to use checksums
87f9c0f1faacf480076bc114ad9e70d61cf4d508401ecdb037685b52f2102b0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page