SultanR commited on
Commit
1318877
·
verified ·
1 Parent(s): dd2166b

Update dataset card with clean/unfiltered subsets

Browse files
Files changed (1) hide show
  1. README.md +87 -21
README.md CHANGED
@@ -18,15 +18,40 @@ tags:
18
  - dclm
19
  pretty_name: WebTerminal
20
  size_categories:
21
- - 10M<n<100M
 
 
 
 
 
 
 
 
 
 
22
  ---
23
  # Terminal/CLI Web Text
24
 
25
  ![webterminal](webterminal.png)
26
 
27
- **v0.1**: 360B tokens, really noisy
28
 
29
- A filtered extract of terminal and command-line content from two large web-text corpora, consists of 360B tokens
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  ## Sources
32
 
@@ -35,6 +60,8 @@ A filtered extract of terminal and command-line content from two large web-text
35
 
36
  ## How it was built
37
 
 
 
38
  1. **Fast filter**: skip any document that doesn't contain obvious CLI indicators (`$`, `sudo`, `pip install`, `` ```bash ``, `root@`, etc.)
39
  2. **Score**: remaining docs are scored (0-34) across five signals, each with a per-match point value and a cap:
40
 
@@ -48,28 +75,67 @@ A filtered extract of terminal and command-line content from two large web-text
48
 
49
  Documents scoring >=5 are kept.
50
 
51
- 3. **Dedup**: exact dedup across both datasets using xxhash64 on full text.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  ## Stats
54
 
55
- | | Chunks | Size | Rows |
56
- |---|---|---|---|
57
- | DCLM | 13,144 | ~229 GB | ~18.8M |
58
- | FineWeb | 8,800 | ~669 GB | ~47.5M |
59
 
60
- | Score | Count | % | Cumulative |
61
- |---|---|---|---|
62
- | 5 | 39,025,201 | 63.62% | 63.62% |
63
- | 6 | 10,787,199 | 17.59% | 81.21% |
64
- | 7 | 4,063,886 | 6.63% | 87.83% |
65
- | 8 | 2,911,983 | 4.75% | 92.58% |
66
- | 9 | 1,304,162 | 2.13% | 94.70% |
67
- | 10 | 1,022,996 | 1.67% | 96.37% |
68
- | 11-14 | 1,609,090 | 2.62% | 98.99% |
69
- | 15-20 | 536,421 | 0.87% | 99.87% |
70
- | 21-34 | 80,340 | 0.13% | 100.00% |
71
- | **Total** | **61,341,278** | | |
 
 
 
 
72
 
73
  ## Use case
74
 
75
- Mostly for upsampling agentic-adjacent data during pretraining.
 
18
  - dclm
19
  pretty_name: WebTerminal
20
  size_categories:
21
+ - 1M<n<10M
22
+ configs:
23
+ - config_name: clean
24
+ data_files:
25
+ - split: train
26
+ path: clean/*.parquet
27
+ default: true
28
+ - config_name: unfiltered
29
+ data_files:
30
+ - split: train
31
+ path: unfiltered/*.parquet
32
  ---
33
  # Terminal/CLI Web Text
34
 
35
  ![webterminal](webterminal.png)
36
 
37
+ A filtered extract of terminal and command-line content from two large web-text corpora, designed for upsampling agentic-adjacent data during pretraining.
38
 
39
+ ## Subsets
40
+
41
+ | Subset | Rows | Tokens | Size | Quality |
42
+ |---|---|---|---|---|
43
+ | **`clean`** (default) | 2.33M | 4.6B | 11 GB | ~98% terminal content |
44
+ | `unfiltered` | 61.3M | 359B | 962 GB | ~15% terminal content |
45
+
46
+ ```python
47
+ from datasets import load_dataset
48
+
49
+ # Load the clean subset (default)
50
+ ds = load_dataset("AdaMLLab/WebTerminal")
51
+
52
+ # Load the unfiltered subset
53
+ ds = load_dataset("AdaMLLab/WebTerminal", "unfiltered")
54
+ ```
55
 
56
  ## Sources
57
 
 
60
 
61
  ## How it was built
62
 
63
+ ### v0.1 — Unfiltered
64
+
65
  1. **Fast filter**: skip any document that doesn't contain obvious CLI indicators (`$`, `sudo`, `pip install`, `` ```bash ``, `root@`, etc.)
66
  2. **Score**: remaining docs are scored (0-34) across five signals, each with a per-match point value and a cap:
67
 
 
75
 
76
  Documents scoring >=5 are kept.
77
 
78
+ 3. **Dedup**: exact dedup across both datasets using xxhash64 on full text. Removed 1,168 duplicates.
79
+
80
+ ### v0.2 — Clean
81
+
82
+ The unfiltered subset is ~84-86% noise at lower score levels (5-12), which make up 93% of the data. The root cause: v0.1's scoring uses context-blind keyword matching — CLI command names like `find`, `make`, `cat` appear in normal English prose, bare `$` matches currency amounts, and indented Python/SQL code gets scored as terminal content.
83
+
84
+ v0.2 applies a three-stage structural filter over the unfiltered data:
85
+
86
+ 1. **Context-aware gate**: instead of matching bare `$`, requires `$ sudo`, `$ git`, `$ docker`, etc. (dollar sign + space + known command). Eliminates ~87% of documents immediately.
87
+ 2. **Validation regex**: confirms a genuine structural terminal pattern exists — shell prompts followed by real commands, `user@host:~$` patterns, Python REPL `>>>`, tracebacks, `` ```bash `` code blocks, Unix file permission listings, man page headers, shebangs.
88
+ 3. **Weighted structural scoring** (`term_score_v2`): each pattern has a weight (1-3) and occurrences are capped. Documents need `term_score_v2 >= 3` to be kept.
89
+
90
+ | Weight | Signal | Max |
91
+ |---|---|---|
92
+ | 3 | Command prompts (`$ cmd` at line start) | 9 |
93
+ | 3 | SSH prompts (`user@host:~$`) | 9 |
94
+ | 2 | Python REPL, file listings, tracebacks, terminal code blocks, git/docker ops, Windows prompts, man pages | 2-6 each |
95
+ | 1 | Install output, systemd units, shebangs, sudo commands | 1 each |
96
+
97
+ No indentation-based scoring. No context-blind command substring matching.
98
+
99
+ **Result**: 3.8% of the unfiltered data survives — from 61.3M rows down to 2.33M rows. Quality jumps from ~15% to ~98% genuine terminal/CLI content.
100
+
101
+ ## Schema
102
+
103
+ ### Clean subset
104
+
105
+ | Column | Type | Description |
106
+ |---|---|---|
107
+ | `text` | string | Document text |
108
+ | `term_score` | int32 | Original v0.1 score (5-34) |
109
+ | `term_score_v2` | int32 | Structural score from v0.2 filter (3+) |
110
+
111
+ ### Unfiltered subset
112
+
113
+ | Column | Type | Description |
114
+ |---|---|---|
115
+ | `text` | string | Document text |
116
+ | `term_score` | int32 | Original v0.1 score (5-34) |
117
 
118
  ## Stats
119
 
120
+ ### Clean (v0.2)
 
 
 
121
 
122
+ - **2,334,414 rows** | **4.6B tokens** (Llama-3.2-1B tokenizer) | **11 GB**
123
+ - 62 parquet files, ~169-185 MB each, snappy compressed
124
+
125
+ ### Unfiltered (v0.1)
126
+
127
+ - **61,341,278 rows** | **359B tokens** | **962 GB**
128
+ - 4,187 parquet files, ~180-240 MB each, snappy compressed
129
+
130
+ | v0.1 Score | Count | % |
131
+ |---|---|---|
132
+ | 5 | 39,025,201 | 63.62% |
133
+ | 6 | 10,787,199 | 17.59% |
134
+ | 7 | 4,063,886 | 6.63% |
135
+ | 8 | 2,911,983 | 4.75% |
136
+ | 9-14 | 3,594,547 | 5.86% |
137
+ | 15-34 | 958,462 | 1.56% |
138
 
139
  ## Use case
140
 
141
+ Upsampling agentic-adjacent data during pretraining. The `clean` subset is recommended for most use cases. The `unfiltered` subset is available for researchers who want to apply their own filtering.