Skip to main content

Generate high-quality, large-scale synthetic datasets 📊🧪

Project description

Synthex - Generate high quality, synthetic datasets

Learn more · Documentation · Demo

Latest PyPi package version Tests status Sample Datasets on HuggingFace GitHub commit activity Synthex Documentation

🚀 Generate any structured dataset from scratch • 👤 Anonymize your dataset and be GDPR-compliant

🔥 Highlights

  • Want to train a AI model, but don't have a training dataset? Describe it to Synthex and it will generate it for you.
  • Need to anonymize your dataset to be GDPR-compliant? Synthex can replicate your dataset and remove Personally Identifiable Information (PII).
  • Need to test your software, but don't yet have customer data? Synthex will generate a dataset for you.

⏩ Demo

Don't have time to go through this README? We got you covered. Just click on the button below for an interactive demo.

Open In Colab

Introduction

Synthex is a Python library for generating large-scale, high-quality synthetic datasets. It is helpful in cases in which real data is too limited, unbalanced, completely absent or contains Personal Identifiable Information (PII).

Features & Use Cases

Key Features

  • Generate any dataset from scratch: you don't need any data at all; Synthex will generate any structured dataset, even if it has no sample dataset to copy from.
  • Natural language description: describe your requirements and any constraint the dataset may have in natural language.
  • Specify fields and types: Synthex allows you to specify your dataset schema, including field names and types.

Use Cases:

  • AI Model Training: lacking training data is no longer an issue; generate any training dataset for AI models with Synthex.
  • Dataset anonymization: need a dataset without Personally Identifiable Information to be GDPR-compliant? Synthex is anonymous by default.
  • Software testing: we all know testing your new software without customer data is not easy. Synthex will generate a testing dataset for you, so you can populate your DB.

🚀 Quickstart Guide

Installation

Install the library with

pip install synthex

Basic Usage

To create a new dataset, use Synthex.jobs.generate_data(). For this method's full documentation, see the Tanaos Docs.

from synthex import Synthex

client = Synthex()

client.jobs.generate_data(
    schema_definition = {
        "surface": {"type": "float"},
        "number_of_rooms": {"type": "integer"},
        "construction_year": {"type": "integer"},
        "city": {"type": "string"},
        "market_price": {"type": "float"}
    },
    examples = [
        {
            "surface": 104.00,
            "number_of_rooms": 3,
            "construction_year": 1985,
            "city": "Nashville",
            "market_price": 218000.00
        },
        {
            "surface": 98.00,
            "number_of_rooms": 2,
            "construction_year": 1999,
            "city": "Springfield",
            "market_price": 177000.00
        },
        {
            "surface": 52.00,
            "number_of_rooms": 1,
            "construction_year": 2014,
            "city": "Denver",
            "market_price": 230000.00
        }
    ],
    requirements = [
        "The 'market price' field should be realistic and should depend on the characteristics of the property.",
        "The 'city' field should specify cities in the USA, and the USA only"
    ],
    output_path = "output_data/output.csv",
    number_of_samples = 100,
    output_type = "csv"
)

where the parameters are as follows:

  • schema_definition: A dict which specifies the output dataset's schema. It must have the following format:

    {
        "<name_of_column_1>": {"type": "<datatype_of_column_1>"},
        "<name_of_column_2>": {"type": "<datatype_of_column_2>"},
        ...
        "<name_of_column_n>": {"type": "<datatype_of_column_n>"}
    }
    

    the possible values of "type" are "string", "integer" and "float".

  • examples: A List[dict], which specifies a few (3 to 5 are enough) sample datapoints that will help the data generation model understand what the output data should look like. They must have the same schema as the one specified in the schema_definition parameter, or an exception will be raised.

  • requirements: a List[str], where each string specifies a requirement or constraint for the job. It can be an empty list if no specific requirements are present.

  • output_path: a str which specifies the path where the output dataset will be generated. It does not need to contain a file name, as this will be added automatically if one is not provided. If output_path does contain a file name, its extension must be consistent with the output_type parameter. If this is the case, the provided output_path is used in its entirety. Otherwise, the provided extension is replaced with one that is consistent with output_type. For example:

  • number_of_samples: an int which specifies the number of datapoints that the model should generate. Keep in mind that the maximum number of datapoints you can generate with a single job depends on whether you are on a free or paid plan. For example:

  • output_type: a str which specifies the format of the output dataset. Only "csv" (meaning a .csv file will be generated) is supported at this time, but we will soon add more options.

🔗 Sample Datasets & Demos

  • Demo - Create your first Synthetic Dataset: an interactive tutorial on how to use Synthex to create your first synthetic dataset (Live Demo)
  • Online Store Chatbot Guardrail Training Dataset: a synthetic dataset, created with Synthex, used for training a Guardrail Model for an online store chatbot (See Dataset on HuggingFace).

🔑 Plans

Free plan: each user enjoys 1500 datapoints per month and 500 datapoints per job for free.

Pay-as-you-go: for additional usage beyond the free tier:

  1. create an account on our platform
  2. add credits to it
  3. create an Api Key and pass it to Synthex at initialization:
    from synthex import Synthex
    
    client = Synthex(
        api_key="<your-api-key>"
    )
    
    The pay-as-you-go pricing is 1$ per 100 datapoints. Once you finish your credits, if you have not exceeded the monthly limit, you will be automatically switched to the free plan.

📚 Documentation & Support

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

synthex-0.4.1.tar.gz (156.8 kB view details)

Uploaded Source

Built Distribution

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

synthex-0.4.1-py3-none-any.whl (125.7 kB view details)

Uploaded Python 3

File details

Details for the file synthex-0.4.1.tar.gz.

File metadata

  • Download URL: synthex-0.4.1.tar.gz
  • Upload date:
  • Size: 156.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for synthex-0.4.1.tar.gz
Algorithm Hash digest
SHA256 c9bc383444ac3393bb2d1557dfefc3d4ada53c529a3663f63a1a87e978a96874
MD5 5e4d0dd0a0ffd52f9b68f49ae4a6ccd2
BLAKE2b-256 cb50395cf9ea7f04604c72cd26ae787562c8a8b5dfd85ec69789d1e65c7e9fb1

See more details on using hashes here.

File details

Details for the file synthex-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: synthex-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 125.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for synthex-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a7b977cf2d535e11b3f24d30df2b455ec974f92e8a96d78874ec0448f3838a5
MD5 eeb7c44100e65716a9227a5b932902b1
BLAKE2b-256 7cf6483f2f072945619fc7724636f88cd5197e7152a6f97ab4f5b7904242fd71

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