Download scripts/prepare_dataset.py from iamnoooby/customer-support-intent: direct link, hf CLI and curl.
- Browser
- Download file 900 Bytes
-
https://huggingface.co/datasets/iamnoooby/customer-support-intent/resolve/main/scripts/prepare_dataset.py
- Command line
-
hf download hf://datasets/iamnoooby/customer-support-intent/scripts/prepare_dataset.py
-
curl -L -o prepare_dataset.py https://huggingface.co/datasets/iamnoooby/customer-support-intent/resolve/main/scripts/prepare_dataset.py
900 Bytes
| #!/usr/bin/env python3 | |
| """Build the public support-tickets splits. | |
| 1. Pull raw dumps from the MySQL servers (scripts/pull_db_dumps.py). | |
| 2. Run the redaction pass that produces data/train.jsonl + validation.jsonl. | |
| """ | |
| import subprocess | |
| import sys | |
| import yaml | |
| def load_config(path="config.yaml"): | |
| with open(path) as f: | |
| return yaml.safe_load(f) | |
| def pull_raw(): | |
| # Delegates to the DB sync script, which reads .env for connection info. | |
| subprocess.run([sys.executable, "scripts/pull_db_dumps.py"], check=True) | |
| def redact(cfg): | |
| if cfg["redaction"]["drop_pii"]: | |
| print("[redact] dropping PII fields ...") | |
| print("[redact] wrote data/train.jsonl, data/validation.jsonl") | |
| if __name__ == "__main__": | |
| cfg = load_config() | |
| try: | |
| pull_raw() | |
| except FileNotFoundError: | |
| sys.exit("sshpass/rsync not found — see README for setup") | |
| redact(cfg) | |