File size: 39,147 Bytes
d5d7e02
3179772
d5d7e02
 
 
 
781a27e
8d1344a
 
d5d7e02
 
 
3179772
 
 
 
 
 
 
 
d5d7e02
 
8d1344a
 
3179772
 
8d1344a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d5d7e02
 
3179772
8d1344a
781a27e
d5d7e02
 
 
8d1344a
 
3179772
8d1344a
3179772
8d1344a
 
3179772
 
8d1344a
3179772
8d1344a
3179772
8d1344a
3179772
8d1344a
 
3179772
 
 
 
 
 
 
 
781a27e
3179772
8d1344a
 
 
 
781a27e
 
3179772
8d1344a
781a27e
8d1344a
 
 
 
 
781a27e
8d1344a
3179772
 
 
 
 
 
 
 
781a27e
3179772
 
 
 
 
781a27e
3179772
 
 
 
 
 
 
 
 
 
 
 
 
781a27e
3179772
781a27e
3179772
8d1344a
 
 
 
 
 
 
781a27e
8d1344a
 
781a27e
3179772
 
 
 
 
 
8d1344a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3179772
8d1344a
 
 
 
 
 
 
 
781a27e
 
3179772
8d1344a
 
 
 
 
 
 
 
3179772
8d1344a
 
 
 
 
 
 
 
 
 
 
 
c8e644b
8d1344a
 
 
3179772
8d1344a
 
 
3179772
 
 
 
 
 
 
 
 
8d1344a
 
 
 
3179772
8d1344a
 
 
c8e644b
8d1344a
 
 
 
 
3179772
8d1344a
 
 
 
3179772
8d1344a
 
 
 
 
3179772
8d1344a
 
 
3179772
 
 
 
8d1344a
 
 
 
 
3179772
8d1344a
 
 
 
 
3179772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
781a27e
3179772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
781a27e
3179772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
781a27e
3179772
8d1344a
 
 
 
 
 
781a27e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8d1344a
 
 
 
 
 
 
 
 
 
d5d7e02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3179772
 
 
 
 
 
 
 
781a27e
3179772
 
 
 
 
781a27e
3179772
8d1344a
d5d7e02
781a27e
d5d7e02
8d1344a
 
 
 
 
 
 
 
d5d7e02
3179772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d5d7e02
 
 
 
781a27e
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
---
pretty_name: ViTco
language:
  - vi
license: other
license_name: per-document-open-permissive-attribution
license_link: https://github.com/tamnd/gao/blob/main/law/posture.go
size_categories:
  - 100M<n<1B
task_categories:
  - text-generation
  - fill-mask
multilinguality:
  - monolingual
language_creators:
  - found
annotations_creators:
  - no-annotation
source_datasets:
  - original
tags:
  - vietnamese
  - pretraining
  - parquet
  - web
  - corpus
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/*/*.parquet
  - config_name: hplt3
    data_files:
      - split: train
        path: data/hplt3/*.parquet
  - config_name: fineweb2
    data_files:
      - split: train
        path: data/fineweb2/*.parquet
  - config_name: glotcc
    data_files:
      - split: train
        path: data/glotcc/*.parquet
  - config_name: finepdfs
    data_files:
      - split: train
        path: data/finepdfs/*.parquet
---

# ViTco

> 165,847,195 Vietnamese documents from 4 public corpora, 370.2 GB of Parquet, one schema

This dataset is the pinned public Vietnamese corpora as gao read them, every source put to one contract and one schema, before any cleaning.

## Contents

- [What is it](#what-is-it)
- [What is in it](#what-is-in-it)
- [Where the text came from](#where-the-text-came-from)
- [How it is laid out](#how-it-is-laid-out)
- [Reading it](#reading-it)
- [What you can build with it](#what-you-can-build-with-it)
- [One row](#one-row)
- [The columns](#the-columns)
- [What this repo is](#what-this-repo-is)
- [What ships and what does not](#what-ships-and-what-does-not)
- [Things to know before you use it](#things-to-know-before-you-use-it)
- [What this is not](#what-this-is-not)
- [Citation](#citation)
- [Where this comes from](#where-this-comes-from)

## What is it

Vietnamese is a language with a lot of public text and nowhere to get it from at once. HPLT v3 is not on the Hub at all, it is sorted zstd JSONL on a datalake behind a per language map file. GlotCC is Parquet with its own column names. fineweb-2 is Parquet with different ones. FinePDFs is text pulled out of PDFs with a third set. The four disagree about what a document is, about what the url field is called, and in places about whether there is one.

This repo is those corpora after that has been sorted out. Every document from every source is one row of the same schema, carrying its own url, its own host, its own license class, and a locator that says which file of which upstream corpus it came out of. Read one source or read all four and it is the same query either way.

Nothing has been dropped for quality and nothing has been deduplicated. Those are the two decisions that most change what a model trained on a corpus turns out to be, they are both irreversible, and neither of them is ours to make for somebody else. What is here instead is the columns to make them with: `lang_score`, `n_syllables`, `diacritics`, `host`, `license_class`, and the whole `upstream_fields` map each source arrived carrying.

For scale, the largest single Vietnamese corpus published on the Hub is the `vie_Latn` config of fineweb-2, at 61,092,524 documents and 130.2 GB. This repo is at 165,847,195 documents and 370.2 GB, and the ingest is not finished.

## What is in it

| source | documents | parts | input files | size | pinned at |
| --- | ---: | ---: | ---: | ---: | --- |
| `hplt3` | 120,230,406 | 444 | 9 | 210.3 GB | `hplt3-5b2785d5b11c` |
| `fineweb2` | 31,165,817 | 174 | 14 | 79.0 GB | `fineweb2-af9c13333eb9` |
| `glotcc` | 13,232,715 | 113 | 27 | 53.9 GB | `glotcc-9ad140b6be3a` |
| `finepdfs` | 1,218,257 | 54 | 3 | 26.9 GB | `finepdfs-220bac3acbf0` |
| **total** | **165,847,195** | **785** | | **370.2 GB** | |

Every count here is the row count in a part's own Parquet footer, added up. None of it is what a run reported writing, because a run that died between pushing a part and writing down that it had is exactly the case a count has to be right about.

The per part version of this table is `parts.csv` at the root of the repo, which is one row per file with its source, its snapshot, the input file it came from, its document count and its size. It is a CSV so that it can be read without a Parquet reader, and it is small enough to open in anything.

The repo grows while ingests run, so these numbers are the ones from the last time `gao store index` was run against it rather than a sealed total. The counts in `parts.csv` and the counts here always agree, because they are generated together.

## Where the text came from

Four public corpora, pinned at a revision, read once, and written out under the schema below. Nothing here was crawled by us. Every one of them has its own card, its own paper in most cases, and its own terms, and the links are the place to read them.

### HPLT v3, as `hplt3`

Web text from the High Performance Language Technologies project, built out of Internet Archive and Common Crawl WARCs and cleaned and language identified per document. It is the largest of the four here and the only one that is not on the Hub: the data is sorted zstd JSONL on the Sigma2 NIRD datalake, behind a per language map file, which is most of the reason a Vietnamese corpus assembled by hand usually does not include it.

120,230,406 documents here, 210.3 GB of Parquet, pinned at `hplt3-5b2785d5b11c`. Upstream: https://hplt-project.org/datasets/v3.0

### fineweb-2, as `fineweb2`

The multilingual half of FineWeb, which is Common Crawl put through the FineWeb recipe with the filters retuned per language. It is the largest single Vietnamese corpus published on the Hub and the one most Vietnamese web text work already starts from.

31,165,817 documents here, 79.0 GB of Parquet, pinned at `fineweb2-af9c13333eb9`. Upstream: https://huggingface.co/datasets/HuggingFaceFW/fineweb-2

### GlotCC v1, as `glotcc`

A Common Crawl derived corpus from CIS at LMU Munich, built for language coverage rather than for volume, with GlotLID doing the identification. Its documents run shorter than the other web sources and its tail of hosts runs wider, which is what makes it worth having beside them rather than under them.

13,232,715 documents here, 53.9 GB of Parquet, pinned at `glotcc-9ad140b6be3a`. Upstream: https://huggingface.co/datasets/cis-lmu/GlotCC-V1

### FinePDFs, as `finepdfs`

Text extracted from PDFs instead of from HTML. It is the smallest source here and the least like the others: government circulars, legal texts, filings and course material, written to be read on a page rather than scrolled, and long. If the interesting part of Vietnamese for a piece of work is the formal register, this is where it is.

1,218,257 documents here, 26.9 GB of Parquet, pinned at `finepdfs-220bac3acbf0`. Upstream: https://huggingface.co/datasets/HuggingFaceFW/finepdfs

Two more are pinned in the ingest manifest and are not here. CulturaX is gated on the Hub and the terms were never granted to anybody on this project, so not one byte of it has been read and it is dropped rather than pending. It is mC4 and OSCAR, both built out of Common Crawl, so it went over the same pages the sources above went over, though that is worth less than it sounds: identity here is a hash of the extracted text, and two Common Crawl derivatives in this repo share under one percent of the smaller of them, because two extractors rarely agree on every byte of a page. MADLAD-400 ships as gzipped JSONL rather than Parquet, so it costs a rewrite that the Parquet sources do not, and it is queued behind them.

The manifest with every pinned revision, every input file and its byte count is at https://github.com/tamnd/gao/blob/main/harvest/manifest.json.

## How it is laid out

```
README.md
parts.csv
data/hplt3/
  hplt3-5b2785d5b11c-00000-00000.parquet
  ... and 443 more
data/fineweb2/
  fineweb2-af9c13333eb9-00000-00000.parquet
  ... and 173 more
data/glotcc/
  glotcc-9ad140b6be3a-00000-00000.parquet
  ... and 112 more
data/finepdfs/
  finepdfs-220bac3acbf0-00000-00000.parquet
  ... and 53 more
```

One directory per source, and the file name is the snapshot, the input file of the source the part came out of, and the part. The snapshot is the source and the revision it was pinned at, so re-pinning a source puts its new parts beside the old ones in the same directory under a different name rather than moving the directory. That is deliberate: the directory is the config name somebody writes in a `load_dataset` call, and a name that moves every time a source is re-pinned is a name nobody can write down.

The directories are named plainly rather than Hive style. A Hive path spells the directory `snapshot=hplt3-5b2785d5b11c`, and then every reader who globs the repo gets a `snapshot` column in their result set that is in no file, sitting next to a `source` column that is, so the first thing the layout teaches them is a distinction they did not ask for.

## Reading it

The files are Parquet and they are readable in place. Nothing below downloads the repo, and none of it needs a token, because the repo is public.

### DuckDB

Install DuckDB, then:

```sql
INSTALL httpfs;
LOAD httpfs;
```

**What is in the repo, without opening a single Parquet file.** `parts.csv` is a CSV of one row per part, so this is a few tens of kilobytes of reading.

```sql
SELECT source, count(*) AS parts, sum(documents) AS documents,
       round(sum(bytes) / 1e9, 1) AS gb
FROM 'hf://datasets/open-index/vitco/parts.csv'
GROUP BY source ORDER BY documents DESC;
```

```
┌──────────┬───────┬───────────┬────────┐
│  source  │ parts │ documents │   gb   │
│ varchar  │ int64 │  int128   │ double │
├──────────┼───────┼───────────┼────────┤
│ hplt3    │   444 │ 120230406 │  210.3 │
│ fineweb2 │   174 │  31165817 │   79.0 │
│ glotcc   │   113 │  13232715 │   53.9 │
│ finepdfs │    54 │   1218257 │   26.9 │
└──────────┴───────┴───────────┴────────┘
```

**Count one source.** A count reads the row counts out of each file's footer rather than the file, so this is a few hundred kilobytes whatever the source weighs.

```sql
SELECT count(*) AS documents
FROM read_parquet('hf://datasets/open-index/vitco/data/finepdfs/*.parquet');
```

```
┌───────────┐
│ documents │
│   int64   │
├───────────┤
│   1218257 │
└───────────┘
```

**Group by a column.** Parquet is columnar, so a query over two columns reads two columns. This one touches 1,218,257 documents across 54 files.

```sql
SELECT license_class, count(*) AS documents,
       round(avg(n_syllables)) AS mean_syllables
FROM read_parquet('hf://datasets/open-index/vitco/data/finepdfs/*.parquet')
GROUP BY license_class ORDER BY documents DESC;
```

```
┌────────────────────────┬───────────┬────────────────┐
│     license_class      │ documents │ mean_syllables │
│        varchar         │   int64   │     double     │
├────────────────────────┼───────────┼────────────────┤
│ permissive-attribution │   1218257 │         3555.0 │
└────────────────────────┴───────────┴────────────────┘
```

**Look at some documents.** Reading `text` is the one thing here that is not cheap: the row groups hold 50,000 documents each, so the smallest useful read of the text column is a row group of it, which on a full sized part is a couple of hundred megabytes. That is why this one is pointed at a single part, and at the smallest part in the repo, rather than at a glob.

```sql
SELECT url, lang, n_syllables, substr(text, 1, 60) AS opening
FROM read_parquet('hf://datasets/open-index/vitco/data/glotcc/glotcc-9ad140b6be3a-00007-00004.parquet')
WHERE lang = 'vie' AND n_syllables BETWEEN 200 AND 400
LIMIT 5;
```

The `lang` column is ISO 639-3, so the value to filter on is `vie` rather than the `vi` in this card's front matter.

**Every column and its type.**

```sql
DESCRIBE SELECT * FROM read_parquet('hf://datasets/open-index/vitco/data/glotcc/glotcc-9ad140b6be3a-00007-00004.parquet');
```

### Python

The configs in this card's front matter are what `datasets` reads, so a source is a config name and `default` is all of them.

```python
from datasets import load_dataset

# One source, streamed rather than downloaded.
ds = load_dataset("open-index/vitco", "finepdfs", split="train", streaming=True)
print(next(iter(ds))["url"])
```

Streaming is the right default here. The whole repo does not fit on most disks and one source of it does not fit on many, so a run that reads once should read over the network rather than land the corpus first.

When it does need to be on disk, take a source or a single part rather than the repo.

```python
from huggingface_hub import snapshot_download

# One source on disk, which for the smallest of these is 26.9 GB.
snapshot_download(
    "open-index/vitco",
    repo_type="dataset",
    allow_patterns="data/finepdfs/*",
)
```

```python
import pyarrow.parquet as pq
from huggingface_hub import hf_hub_download

# One part, for looking rather than training. Read the columns you want:
# text is most of the bytes and a row group of it is a couple of hundred MB.
path = hf_hub_download("open-index/vitco", "data/glotcc/glotcc-9ad140b6be3a-00007-00004.parquet", repo_type="dataset")
table = pq.read_table(path, columns=["url", "host", "lang", "n_syllables"])
print(table.num_rows, table.schema.names)
```

## What you can build with it

The reason to keep the provenance columns and skip the filtering is that different people want different corpora out of the same text. These are the ones this repo was shaped for, each with the query that starts it.

### Pretraining, and continued pretraining

The whole repo is more Vietnamese than most runs have the budget for, so the first thing a pretraining corpus needs is a filter and a syllable count to spend against. Both are columns, so the count is cheap and the filter does not read the text.

```sql
SELECT count(*) AS documents, sum(n_syllables) AS syllables
FROM read_parquet('hf://datasets/open-index/vitco/data/finepdfs/*.parquet')
WHERE lang_score >= 0.9 AND n_syllables >= 200 AND diacritics = 'present';
```

```
┌───────────┬────────────┐
│ documents │ syllables  │
│   int64   │   int128   │
├───────────┼────────────┤
│    952841 │ 3826960848 │
└───────────┴────────────┘
```

Vietnamese is written in syllables and counted here in them, because a syllable count is a property of the text and a token count is a property of somebody's tokenizer. Across the tokenizers we have measured on this corpus a syllable costs between 1.25 and 1.32 tokens, so a syllable budget converts to a token budget by multiplying, and it does not go stale when the tokenizer changes.

For continued pretraining of a model that already speaks some Vietnamese, take one source rather than all of them. The four were built by different projects with different filters, so they fail differently, and a run that only ever sees one of them is a cleaner experiment than a run that sees a blend nobody has characterized.

### A corpus for one domain

`host` is on every row and it is dictionary encoded, so grouping by it across a whole source is a column scan rather than a text read. This is how the legal corpus, the finance corpus and the health corpus come out of a general one.

```sql
SELECT host, count(*) AS documents, sum(n_syllables) AS syllables
FROM read_parquet('hf://datasets/open-index/vitco/data/finepdfs/*.parquet')
GROUP BY host ORDER BY documents DESC LIMIT 5;
```

```
┌───────────────────────┬───────────┬───────────┐
│         host          │ documents │ syllables │
│        varchar        │   int64   │  int128   │
├───────────────────────┼───────────┼───────────┤
│ static2.vietstock.vn  │     29431 │ 169121447 │
│ static.luatvietnam.vn │     24418 │  93030746 │
│ dmec.moh.gov.vn       │     16702 │   8333159 │
│ cafef1.mediacdn.vn    │     10784 │  31723952 │
│ cldup.com             │      7801 │   1177148 │
└───────────────────────┴───────────┴───────────┘
```

Two securities sites, the national drug administration and a legal publisher, in the top five of a source that was assembled with none of that in mind. Swap the `LIMIT` for a `WHERE host IN (...)` and the domain corpus is a subset of a repo somebody else is already hosting.

### A Vietnamese tokenizer

A tokenizer wants a few gigabytes of representative text, not a quarter of a terabyte, and it wants the text to be representative rather than the first rows of the first file. Sample across sources and write the sample out once.

```sql
COPY (
  SELECT text
  FROM read_parquet('hf://datasets/open-index/vitco/data/finepdfs/*.parquet')
  WHERE n_syllables BETWEEN 100 AND 2000
  USING SAMPLE 200000 ROWS
) TO 'tokenizer-sample.txt' (FORMAT csv, HEADER false, QUOTE '');
```

Run it once per source and concatenate, rather than once over a glob of all four, so that the mix is one you chose. The sources are not the same size and sampling the union hands the tokenizer whatever the largest one happens to be.

The documents have newlines in them, so that file has many more lines than it has documents. Feed it to a tokenizer trainer as a stream of text rather than as one document per line, or write Parquet out instead of CSV and keep the row boundaries.

### Deduplication and overlap research

This repo is one of the few places the same Vietnamese page exists several times with its provenance intact, because nothing here has been deduplicated. That is a defect in a training corpus and it is the whole dataset for anybody working on dedup, near duplicate detection, or the question of how much four public web corpora actually overlap.

```sql
SELECT count(*) AS urls, count(DISTINCT url) AS distinct_urls
FROM read_parquet('hf://datasets/open-index/vitco/data/finepdfs/*.parquet');
```

```
┌─────────┬───────────────┐
│  urls   │ distinct_urls │
│  int64  │     int64     │
├─────────┼───────────────┤
│ 1218257 │       1208076 │
└─────────┴───────────────┘
```

Ten thousand repeats inside a single source, before anybody has compared it to the other three.

Joining two sources on `url` is the cross corpus version, and it is a column scan of both rather than a text read, which on the two web sources is a few minutes.

```sql
SELECT count(*) AS shared_urls FROM
  (SELECT DISTINCT url FROM read_parquet('hf://datasets/open-index/vitco/data/glotcc/*.parquet')) a
  JOIN (SELECT DISTINCT url FROM read_parquet('hf://datasets/open-index/vitco/data/fineweb2/*.parquet')) b
  USING (url);
```

```
┌─────────────┐
│ shared_urls │
│    int64    │
├─────────────┤
│     1399167 │
└─────────────┘
```

That was measured while the repo held 12,858,086 `glotcc` documents and 20,941,000 `fineweb2` ones. Two corpora built by different projects from overlapping crawls, sharing 1.4 million urls out of the 33.8 million documents they had here between them. That is the number a training run pays for if nobody looks, and it is the number a dedup paper wants to explain. Both sources are still growing, so run it again rather than quoting it.

`dup_cluster` and `is_representative` are in the schema for the stage that will do this properly, and they are zero in every row here.

### Diacritic restoration, and language identification

Vietnamese loses its diacritics constantly, in search boxes, in filenames, in chat, and restoring them is a real task with almost no labeled data published for it. The `diacritics` column labels every document as present, absent or mixed at ingest, which makes this corpus a training set for that task rather than only a source of text for it.

```sql
SELECT diacritics, count(*) AS documents, round(avg(lang_score), 3) AS mean_score
FROM read_parquet('hf://datasets/open-index/vitco/data/finepdfs/*.parquet')
GROUP BY diacritics ORDER BY documents DESC;
```

```
┌────────────┬───────────┬────────────┐
│ diacritics │ documents │ mean_score │
│  varchar   │   int64   │   double   │
├────────────┼───────────┼────────────┤
│ present    │   1078990 │      0.995 │
│ mixed      │    108122 │      0.951 │
│ absent     │     31145 │       0.37 │
└────────────┴───────────┴────────────┘
```

A hundred and eight thousand documents with the tone marks partly stripped and thirty one thousand with them gone, in one source, already paired with the identifier's confidence collapsing from 0.995 to 0.37 as they go. Nobody publishes that pairing on purpose.

`lang_score` is the upstream identifier's own confidence, kept rather than thresholded, so a language identification experiment can see the documents that a threshold would have removed. That is the set that matters: nobody learns anything from the documents every identifier already agrees on.

### Retrieval, embeddings and evaluation sets

Every row has a url and a host next to its text, so a retrieval corpus comes out of this without a separate metadata store, and the host doubles as a weak label for the kind of page it is. For an evaluation set, the same columns are what makes a held out slice defensible: hold out by host rather than by row, and the documents in the training set are not the same pages under a different path.

### Contamination checks

If a Vietnamese benchmark is public, some of it is in a web corpus. `contam_flags` is in the schema for the stage that will mark this and is empty in every row here, so for now the check is a search, which is a text read and is the expensive kind of query. Point it at one part first.

```sql
SELECT url, host
FROM read_parquet('hf://datasets/open-index/vitco/data/glotcc/glotcc-9ad140b6be3a-00007-00004.parquet')
WHERE contains(text, 'a sentence from your benchmark');
```

### Rebuilding it yourself

`source` and `source_locator` say which file of which upstream corpus each row came out of, down to the row offset, and `url` says what the page was. Between them a reader can go back to the original corpus and check any document here against it, or skip this repo entirely and take only the list of what is in it. That is deliberate. A corpus nobody can audit is a corpus somebody has to take on trust, and this one is assembled out of other people's work.

## One row

A document from `glotcc`, as `SELECT * ... LIMIT 1` returns it. The byte columns are printed as hex here and come back as blobs, and the text is cut because the document is seventeen hundred characters and the point of printing a row is the shape.

```json
{
  "doc_id": "249eac866336b8c059d9d40b0810bb925b7df9640c5f6f6a3d8b57fce13b43ba",
  "raw_id": "28ac80fee008e89826f9eb9884e6a8f914653cf2ebc34a420759270629d5aaac",
  "text": "Tập thể dục giúp nâng cao sức khỏe, cải thiện vóc dáng và giúp hình thành các cơ cho cơ thể dẻo dai hơn. Tuy nhiên không phải ai cũng có nhiều thời gian ...",
  "schema_version": 1,
  "source": "glotcc",
  "source_locator": "v1.0/vie-Latn/vie-Latn_15.parquet:499402",
  "url": "https://www.sanchoi.cc/t/mach-ban-2-cach-chon-dung-cu-tap-the-duc-cuc-chuan/3028",
  "host": "www.sanchoi.cc",
  "url_template": "",
  "fetched_at": "2024-02-24 11:02:49+07",
  "media_type": "text/html",
  "extractor": "gao-gat@1.0.0",
  "pipeline_version": "0.1.0",
  "http_status": 0,
  "robots_decision": "",
  "robots_rule": "",
  "robots_hash": "0000000000000000000000000000000000000000000000000000000000000000",
  "tdm_signals": {},
  "consent": "",
  "lang": "vie",
  "lang_score": 0.98,
  "diacritics": "present",
  "translated": false,
  "gao_qual": 0.0,
  "gao_edu": 0.0,
  "hplt_bucket": 0,
  "register": "",
  "heuristics": {"diacritic_ratio": 0.307, "glotcc_lid_consistency": 1.0, "glotcc_script_share": 1.0},
  "dup_cluster": "00000000000000000000000000000000",
  "dup_cluster_size": 0,
  "is_representative": false,
  "pii_level": 0,
  "pii_types": [],
  "pii_spans": [],
  "license_class": "open",
  "license_evidence": "CC0",
  "structure": "",
  "n_chars": 1737,
  "n_syllables": 389,
  "n_tokens": 0,
  "contam_flags": [],
  "upstream_fields": {"glotcc_sentences": "10", "glotcc_tlsh": "tlsh:T1EE572C41BC88D8...", "warc_record_id": "<urn:uuid:1216df49-7788-42c0-9aa4-7bbf0b516a1b>"}
}
```

`gao_qual`, `gao_edu`, `n_tokens` and `pii_level` are zero because the stages that fill them have not run on this repo. They are in the schema so that a query written here still runs against a release, where they are filled. `register` and `hplt_bucket` are the source corpus's own labels rather than gao's, filled where the corpus published them and empty where it did not.

## The columns

42 columns, in file order. Every part in this repo has all of them, and a column a stage has not run yet is null rather than absent, so a query written against one source works against the next.

| column | type | filled in by | meaning |
| --- | --- | --- | --- |
| `doc_id` | `bytes(32)` | `normalize` | blake3 of the normalized text, which is the document's identity: two documents with the same normalized text are the same document whichever path found them |
| `raw_id` | `bytes(32)` | `harvest` | blake3 of the bytes before extraction, which is what links this row back to the WARC record or the source file it came out of |
| `text` | `string` | `normalize` | the document text, normalized to NFC with canonical tone mark placement and legacy encodings already transcoded |
| `schema_version` | `uint16` | `store` | the version of this layout, carried per row because a store appended to across a pipeline upgrade holds two versions at once and a reader has to be able to tell |
| `source` | `string` | `harvest` | which acquisition path produced the document, one of the six gao runs |
| `source_locator` | `string` | `harvest` | where in that source it came from: shard and offset for an ingested corpus, file, offset and length for a WARC record |
| `url` | `string` | `harvest` | the page it came from, canonicalized |
| `host` | `string` | `harvest` | the host of that URL, which is the unit politeness, budgets and takedowns are all measured in |
| `url_template` | `string` | `harvest` | the URL with its variable path and query parts replaced by placeholders, which is what the crawl budgets against and how a calendar trap reads as one URL rather than ten thousand |
| `fetched_at` | `timestamp(millisecond)` | `harvest` | when the document was fetched, in UTC milliseconds |
| `media_type` | `string` | `harvest` | the media type the response declared, before extraction decided what to do with it |
| `extractor` | `string` | `harvest` | name and semver of the extractor, because two documents extracted by different versions of the same extractor are not comparable |
| `pipeline_version` | `string` | `store` | semver of the cleaning pipeline that produced this row |
| `http_status` | `uint16` | `harvest` | the status the fetch got, empty for a document that arrived through somebody else's corpus rather than through our crawl |
| `robots_decision` | `string` | `harvest` | what robots.txt said about this fetch, recorded per fetch rather than assumed from a global setting so that a consent question years later has an answer |
| `robots_rule` | `string` | `harvest` | the rule that decided it, in the spelling the site wrote |
| `robots_hash` | `bytes(32)` | `harvest` | blake3 of the robots.txt the decision was made against, so the decision can be rechecked against the file rather than against the file as it is today |
| `tdm_signals` | `map<string, string>` | `harvest` | the machine readable text and data mining reservations the response carried, keyed by mechanism and holding what that mechanism said |
| `consent` | `string` | `harvest` | what the page said about being kept and trained on, in one word, where empty means nobody asked rather than the page said yes |
| `lang` | `string` | `sift` | the language identifier's verdict, which is vie for everything in gao and is stored anyway because a column that is constant today needs no migration tomorrow |
| `lang_score` | `float32` | `sift` | how sure the identifier was |
| `diacritics` | `string` | `sift` | present, absent or mixed, because Vietnamese written without tone marks is still Vietnamese and is still not the same distribution |
| `translated` | `bool` | `sift` | the machine translation detector's verdict, since translated Vietnamese reads as fluent to a metric and as wrong to a native speaker |
| `gao_qual` | `float32` | `sift` | the quality classifier's score for this document |
| `gao_edu` | `float32` | `sift` | the educational value score, which is what the gao-edu slice is selected on |
| `hplt_bucket` | `uint8` | `harvest` | the source corpus's own quality bucket where it had one, kept so gao's classifier can be compared against an independent one rather than only against itself |
| `register` | `string` | `harvest` | the source corpus's own register label, kept for the same reason |
| `heuristics` | `map<string, float32>` | `sift` | the raw heuristic measurements rather than the verdicts, so the corpus can be refiltered at a different threshold without being recomputed from the text |
| `dup_cluster` | `bytes(16)` | `mill` | which duplicate cluster the document belongs to, empty when it is in none |
| `dup_cluster_size` | `uint32` | `mill` | how large that cluster is |
| `is_representative` | `bool` | `mill` | marks the one document per cluster a deduplicated view keeps, with the rest left in the store because deduplication is tuned rather than maximized |
| `pii_level` | `uint8` | `cover` | how much personal data has been removed: none, the structured identifiers, or those plus addresses and identifying names |
| `pii_types` | `list<string>` | `cover` | which kinds of personal data were found |
| `pii_spans` | `list<span>` | `cover` | where they were found, empty on every row the cleaning line writes, because the offsets index the text before it was covered and because offsets published next to covered text say where the identifiers were |
| `license_class` | `string` | `law` | the per document redistribution determination, stored by name so a file read without gao says restricted rather than 3 |
| `license_evidence` | `string` | `law` | what determined that class, since a class without evidence is a guess |
| `structure` | `string` | `harvest` | what the document is: article, forum thread, legal, thesis, gazette, transcript, which drives both the extraction handler and the mixture weights |
| `n_chars` | `uint32` | `normalize` | how many characters the text holds |
| `n_syllables` | `uint32` | `normalize` | how many Vietnamese syllables it holds, which is the unit that survives a change of tokenizer |
| `n_tokens` | `uint32` | `count` | how many gao tokens it holds, under the tokenizer named in the manifest |
| `contam_flags` | `list<string>` | `pick` | which evaluation benchmarks this document overlaps, flagged rather than deleted so one store can serve a training run that excludes them and an analysis that counts them |
| `upstream_fields` | `map<string, string>` | `harvest` | the source corpus's own metadata, verbatim, which is the difference between answering a provenance question later and having to ingest again |

`pii_spans` is a list of structs, and the struct is:

| field | type | meaning |
| --- | --- | --- |
| `start` | `uint32` | byte offset into the text where the identifier begins |
| `len` | `uint32` | how many bytes long it is, counted in bytes rather than runes because a reader slicing the text has bytes |
| `type` | `string` | which kind of identifier it is, from the same set pii_types draws on |

The full schema, including the Parquet spelling of each type and what the dictionary encoded columns cost, is at https://github.com/tamnd/gao/blob/main/SCHEMA.md.

## What this repo is

What a stage wrote on its way to a release, published as it is written so that a box can push a part and delete it rather than holding what it has finished. It is public like everything else here, it is rewritten when a source is pinned again, and it is not covered by a signed manifest. A release is, and that is the difference worth knowing before anybody builds on this.

## What ships and what does not

This repo carries document text, so it carries only documents whose text may be redistributed.

| license class | text | metadata |
| --- | --- | --- |
| open | yes | yes |
| permissive-attribution | yes | yes |

Every row carries its own class in the `license_class` column, so a reader who needs a narrower set than this repo holds can filter for it rather than trust the repo name.

A page that reserved its text and data mining rights is not here, whatever its license says. The two are separate questions and the reservation is honored at the write, so a page that said no cannot reach a published file through a stage that forgot to ask. The `consent` column records what each page said, and an empty value means nobody was there to ask, which is true of every document that came out of somebody else's corpus.

## Things to know before you use it

**It is web text, so it is what the web is.** The four sources are Common Crawl and Internet Archive derivatives plus a set of PDFs. Vietnamese on the open web skews towards commerce, SEO, news aggregation and forums, and away from anything behind a login or inside an app. Gambling and affiliate marketing sites are well represented, because they are well represented on the web and no filter here removed them. A model trained on this without filtering will write like that.

**It is not deduplicated.** Not within a source and not across sources. A page that all four corpora crawled is four documents here, and popular pages are duplicated inside a single source as well. This is on purpose and it is not a state you want to train on. Deduplicate before you do.

**It is not quality filtered.** `gao_qual` and `gao_edu` are zero in every row, boilerplate has not been stripped beyond what each upstream corpus did, and no classifier has been run. What the upstream projects removed is removed, and they do not agree about what that is.

**The language identification is inherited.** `lang` and `lang_score` come from whichever identifier the source used, and the sources used different ones. Documents that are mostly Vietnamese with English or Chinese passages in them are in here labeled Vietnamese, and so are some that are not Vietnamese at all.

**Personal information has not been removed.** `pii_level`, `pii_types` and `pii_spans` are in the schema and are empty, because the stage that fills them has not run on this repo. Names, phone numbers, addresses and email addresses that were on a public page are in the text as they were on the page. If that matters for what you are building, filter before you train rather than after.

**There is no split and no order.** The parts are the order the ingest happened to read the input files in. Nothing is shuffled, and consecutive rows in a part are frequently from the same site, so a reader taking the first N rows is taking a sample of one crawl of a handful of hosts rather than a sample of the corpus.

**The sources are not balanced and were never meant to be.** `hplt3` is 72% of the documents here on its own. If a run should see the sources evenly, sample them evenly, because reading the repo does not.

## What this is not

This is not a release. There is no signed manifest behind it, no merkle root over the files, and no promise that a part will still be there next week under the same name. A run pushes each part as it closes it and deletes the local copy, which is what lets a box with a terabyte of disk work through corpora that do not fit on it, and it means the file list is whatever the last run got through rather than a set anybody has fixed.

What that changes for a reader:

- Read it to see what the pipeline produces, and to build on the raw text under one schema without pulling four corpora in four formats.
- Do not cite a document count off it in anything that has to still be true later. Cite a release.
- Re-pinning a source rewrites its parts under a new revision in the same directory, so a query that has to be stable should name a revision rather than a source.
- Nothing here has been deduplicated against anything else here. The same page can be in three of these corpora and it is three documents in this repo.

The releases carry the signed manifest, the dedup, and the quality filtering. They are the other repos in [open-index](https://huggingface.co/open-index).

## Citation

If you use this, cite the corpora it is made of. They did the collecting. This repo did the reading.

- HPLT v3, https://hplt-project.org/datasets/v3.0
- fineweb-2, https://huggingface.co/datasets/HuggingFaceFW/fineweb-2
- GlotCC v1, https://huggingface.co/datasets/cis-lmu/GlotCC-V1
- FinePDFs, https://huggingface.co/datasets/HuggingFaceFW/finepdfs

For the assembly itself:

```bibtex
@misc{vitco,
  title        = {ViTco: Vietnamese corpora under one schema},
  author       = {The gao project},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/datasets/open-index/vitco}},
  note         = {Built with gao, https://github.com/tamnd/gao}
}
```

## Where this comes from

The pipeline that built it, the ingest contract every document had to pass, and the reasoning behind both are at https://github.com/tamnd/gao.

This card is generated by `gao store card`, from the snapshot manifest where there is one and from `parts.csv` where there is not. Editing it by hand works until the next run overwrites it.