dataset-preprocessing-agent
Automated dataset standardization using LLM agents.
Every HuggingFace dataset has a unique schema (tweet_text, review_body, sentence1, …), making it hard to reuse models across tasks without manual mapping work. This library automates that step: given a raw dataset, an LLM inspects a small sample and produces a JSON mapping of raw column names to a canonical schema, evaluated against Unitxt and tasksource ground truths.
Installation
pip install dataset-preprocessing-agent
For notebook visualization support:
pip install "dataset-preprocessing-agent[notebook]"
Python 3.10+ required.
For the API backend, export your OpenRouter key:
export OPENROUTER_API_KEY="your_key_here"
Quick Start
from dataset_preprocessing_agent.standardize_api import load_standardized_dataset
result = load_standardized_dataset("glue", config="sst2")
print(result["mapping"])
# {"task": "classification", "text": "sentence", "label": "label"}
Evaluate against Unitxt ground truth
from dataset_preprocessing_agent.eval import evaluate
result = evaluate(hf_name="glue", hf_config="sst2", card_id="sst2")
print(result["score"])
print(result["gt_cols"]) # e.g. ['label', 'sentence']
print(result["pred_cols"]) # e.g. ['label', 'sentence']
Evaluate against tasksource ground truth
from dataset_preprocessing_agent.eval_ts import evaluate_ts
result = evaluate_ts("glue", "rte")
print(result["score"])
print(result["ts_gt"]) # GT mapping from tasksource preprocessing
Architecture
The pipeline runs in three stages:
- Standardization — an LLM inspects 5–10 raw samples and outputs a JSON mapping of raw column names to canonical fields (
task,text/text_a+text_b,label). - Mapping application —
apply_llm_mappingrenames columns and converts integer labels to class name strings. - Evaluation — the predicted raw column set is compared to the ground-truth column set using Jaccard similarity on raw HuggingFace column names.
Backends
| Module | Backend |
|---|---|
standardize_api |
Cloud LLM via OpenRouter API |
standardize_local |
Local HuggingFace model |
Baselines
| Baseline | Method |
|---|---|
baseline_keyword_match |
Synonym dictionary matching |
baseline_embedding_match |
Cosine similarity via all-MiniLM-L6-v2 |
Evaluation backends
| Module | Ground truth |
|---|---|
eval |
Unitxt task cards |
eval_ts |
tasksource preprocessing objects |
Dependencies
| Package | Purpose |
|---|---|
unitxt |
Ground-truth task cards |
tasksource |
Ground-truth preprocessing objects |
datasets |
HuggingFace dataset loading |
transformers + torch + accelerate |
Local model inference |
openai |
OpenRouter API client |
sentence-transformers |
Embedding baseline |
pandas |
Result DataFrames |
Metadata
Release files for dataset-preprocessing-agent 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dataset_preprocessing_agent-0.1.0.tar.gz | 16.2 kB | Without provenance | Details for dataset_preprocessing_agent-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dataset_preprocessing_agent-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for dataset_preprocessing_agent-0.1.0-py3-none-any.whl |
Total release size: 36.3 kB
Release files / dataset_preprocessing_agent-0.1.0.tar.gz
| Download URL | dataset_preprocessing_agent-0.1.0.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e86ae82fb6b52e9712c0f173cdd023cb5bda6ef651a31f471e63d1324f0c9c71
|
|
BLAKE2b-256 checksum How to use checksums |
a61989ef853e26683c246a174e2eae994d568adf42a28920c336713125c3b55a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Release files / dataset_preprocessing_agent-0.1.0-py3-none-any.whl
| Download URL | dataset_preprocessing_agent-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a926872388764d33b96f15d174c20915929cca6509cce5a1eae4fbb977b1567
|
|
BLAKE2b-256 checksum How to use checksums |
a589b216c7814e6edf00d026899cadfb3aa78238844df7942523b3acc8af6bb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Security for dataset-preprocessing-agent 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.