Datasets:
Download make_open_authority_sample.py from SpecStreamAI/open-web-authority-10k: direct link, hf CLI and curl.
- Browser
- Download file 875 Bytes
-
https://huggingface.co/datasets/SpecStreamAI/open-web-authority-10k/resolve/main/make_open_authority_sample.py
- Command line
-
hf download hf://datasets/SpecStreamAI/open-web-authority-10k/make_open_authority_sample.py
-
curl -L -o make_open_authority_sample.py https://huggingface.co/datasets/SpecStreamAI/open-web-authority-10k/resolve/main/make_open_authority_sample.py
875 Bytes
| """Write the 10,000 domain open sample from domain_intel.parquet. | |
| uv run --no-project --with duckdb python make_open_authority_sample.py domain_intel.parquet out/ | |
| """ | |
| import sys | |
| from pathlib import Path | |
| import duckdb | |
| src, out = Path(sys.argv[1]), Path(sys.argv[2]) | |
| out.mkdir(parents=True, exist_ok=True) | |
| con = duckdb.connect() | |
| q = f""" | |
| select domain, authority_rank, authority_score, | |
| round(authority_score / 655.35, 1) as authority_0_100, | |
| nullif(server_platform, '') as server_platform, | |
| nullif(country, '') as country, | |
| org_count, product_count, job_count | |
| from read_parquet('{src}') | |
| where domain is not null | |
| order by authority_rank | |
| limit 10000 | |
| """ | |
| con.sql(f"copy ({q}) to '{out / 'data.parquet'}' (format parquet, compression zstd)") | |
| con.sql(f"copy ({q}) to '{out / 'data.csv'}' (header, delimiter ',')") | |