Generates synthetic datasets tailored for transformer-based models
Project description
sugardata
sugardata is a Python package that helps you generate synthetic datasets for NLP tasks, enabling experimentation, prototyping, and training when labeled data is limited or unavailable.
Installation
You can install sugardata via pip:
pip install sugardata
Quick Start
sugardata supports multiple NLP tasks out of the box.
Task 1: Sentiment Analysis
import sugardata as su
# generate synchronously
results = su.generate_sentiment_data(concept="online shopping")
# generate asynchronously
results = await su.generate_sentiment_data_async(concept="online shopping")
# generate concurrently with multiple vendors
vendors = {
"openai": "gpt-4o-mini",
"gemini": "gemini-2.0-flash-lite",
"groq": "meta-llama/llama-4-scout-17b-16e-instruct",
"ollama": "gemma3:12b",
}
results = await su.generate_sentiment_multi_vendor_async(
concept="online shopping",
vendors=vendors
)
# augment synchronously
examples = [
# some text
...
]
results = su.augment_sentiment_data(examples=examples)
# augment asynchronously
results = await su.augment_sentiment_data_async(examples=examples)
# augment concurrently with multiple vendors
vendors = {
"openai": "gpt-4o-mini",
"gemini": "gemini-2.0-flash-lite",
"groq": "meta-llama/llama-4-scout-17b-16e-instruct",
"ollama": "gemma3:12b",
}
results = await su.augment_sentiment_multi_vendor_async(
examples=examples,
vendors=vendors
)
Task 2: Named Entity Recognition (NER) Localization
import sugardata as su
examples = [
{
"text": "John works at Acme Corp in New York",
"ner_tags": [{"John": "PER", "Acme Corp": "ORG", "New York": "LOC"}]
},
# more examples...
]
entity_labels = {"PER": (1, 2), "ORG": (3, 4), "LOC": (5, 6)}
# localize synchronously
results = su.localize_ner_data(
examples=examples,
language="Turkish",
entity_labels=entity_labels
)
# localize asynchronously
results = await su.localize_ner_data_async(
examples=examples,
language="Turkish",
entity_labels=entity_labels
)
# localize concurrently with multiple vendors
vendors = {
"openai": "gpt-4o-mini",
"gemini": "gemini-2.0-flash-lite",
"groq": "meta-llama/llama-4-scout-17b-16e-instruct",
"ollama": "gemma3:12b",
}
results = await su.localize_ner_data_multi_vendor_async(
examples=examples,
language="Turkish",
entity_labels=entity_labels,
vendors=vendors
)
To learn more about configuration options, advanced parameters, and integration tips, please visit tutorials.
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
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 sugardata-0.0.5.tar.gz.
File metadata
- Download URL: sugardata-0.0.5.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5c67bdff4d19bce2652ae443091cdd41be5e0ce32fd8e73aef19bf40cffd5bd
|
|
| MD5 |
c12b6ed7083dbfd658c7f622bf61201c
|
|
| BLAKE2b-256 |
ab22c235b4516f2258fc54f02da76af0874d473d6e2fd56c751e3ea45f2aa9d4
|
File details
Details for the file sugardata-0.0.5-py3-none-any.whl.
File metadata
- Download URL: sugardata-0.0.5-py3-none-any.whl
- Upload date:
- Size: 45.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e7630d587e8a32c359aabc9972810a37c2a294062dd4106414d6509ce5caa73
|
|
| MD5 |
5887bc7edb157877d3579d14788c3424
|
|
| BLAKE2b-256 |
9f376dd7692deeae9da4aeaf3a50b75f0601ecd6156a5a578266277c89799f3b
|