File size: 2,408 Bytes
8f3bc4f
 
 
 
 
f5b8667
 
8f3bc4f
 
 
 
 
f5b8667
8f3bc4f
 
 
5c4289f
 
 
 
 
f5b8667
 
 
 
 
5c4289f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
789f1a5
5c4289f
 
8f3bc4f
 
f5b8667
8f3bc4f
 
 
 
 
 
 
 
 
 
 
 
f5b8667
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
viewer: false
tags:
  - uv-script
  - dataset-statistics
  - polars
  - temporal-analysis
license: apache-2.0
---

# Dataset Statistics

UV scripts for analyzing HuggingFace datasets using streaming mode.

## Scripts

### `finepdfs-stats.py` - Temporal Educational Quality Analysis

Analyze educational quality trends across CommonCrawl dumps using Polars streaming. Answers: **"Is the web getting more educational over time?"**

**Features:**
- Polars streaming (no download of 300GB+ dataset)
- Temporal analysis across 106 CommonCrawl dumps (2013-2025)
- ASCII chart visualizations
- Uploads results to HF Hub with auto-generated dataset card
- Supports single language or all 70+ languages

**Quick Examples:**

```bash
# Quick test (10K samples)
uv run https://huggingface.co/datasets/uv-scripts/dataset-stats/raw/main/finepdfs-stats.py \
    --limit 10000 --show-plan

# Analyze English PDFs
uv run https://huggingface.co/datasets/uv-scripts/dataset-stats/raw/main/finepdfs-stats.py \
    --output-repo username/my-stats

# Analyze ALL 70+ languages
uv run https://huggingface.co/datasets/uv-scripts/dataset-stats/raw/main/finepdfs-stats.py \
    --all-languages --output-repo username/my-stats
```

**Run on HF Jobs (recommended for full dataset):**

```bash
hf jobs uv run \
    -s HF_TOKEN \
    -e HF_XET_HIGH_PERFORMANCE=1 \
    https://huggingface.co/datasets/uv-scripts/dataset-stats/raw/main/finepdfs-stats.py \
    -- --all-languages --output-repo username/finepdfs-temporal-stats
```

**Example output:** [davanstrien/finepdfs-temporal-stats-all](https://huggingface.co/datasets/davanstrien/finepdfs-temporal-stats-all)

**Performance:**
- 50M docs in ~14 minutes (~60K docs/sec)
- Single scan using [Polars HF Hub integration](https://huggingface.co/docs/hub/datasets-polars)
- Works on HF Jobs CPU instances

## Related Scripts

Check out other scripts in the [uv-scripts organization](https://huggingface.co/uv-scripts):
- **dataset-creation**: Create datasets from PDFs and other formats
- **vllm**: GPU-accelerated classification and inference
- **ocr**: Document OCR using vision-language models

## Why UV Scripts?

UV scripts are self-contained Python scripts that:
- Run with a single `uv run` command (no setup required)
- Include all dependencies in PEP 723 inline metadata
- Work seamlessly on both local machines and HF Jobs

Learn more about UV: https://docs.astral.sh/uv/