Generate Dataset Plan
Generate a structured dataset generation plan (taxonomy, sample schema, and distribution) from a natural language prompt using the Knowledgator Python SDK.
Example Usage
from knowledgator import Knowledgator
kg = Knowledgator(api_key="YOUR_API_KEY")
plan = kg.datasets.generate_plan(
prompt="Create an NER dataset for financial SEC filings extracting revenue, operating income, and dates"
)
print("Plan output:", plan)
Async Example
import asyncio
from knowledgator import Knowledgator
async def main():
kg = Knowledgator(api_key="YOUR_API_KEY")
plan = await kg.datasets.generate_plan_async(
prompt="Create a few-shot text classification dataset for customer support tickets"
)
print(plan)
asyncio.run(main())
Expected Output
{
"status": "success",
"plan": {
"domain": "Finance / Regulatory",
"suggested_types": [
"revenue",
"operating_income",
"reporting_date"
],
"distribution": {
"revenue": 0.4,
"operating_income": 0.35,
"reporting_date": 0.25
},
"guidelines": "Ensure numerical entities include unit context."
}
}