oliveirabruno01 commited on
Commit
552f235
·
verified ·
1 Parent(s): 6923aa6

Canonical corpus freeze v0.1.0

Browse files
README.md ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: PT-BR Creative Corpus
3
+ language:
4
+ - pt
5
+ license: other
6
+ task_categories:
7
+ - text-generation
8
+ tags:
9
+ - pt-br
10
+ - brazilian-portuguese
11
+ - creative-writing
12
+ - literature
13
+ - pretraining
14
+ - continued-pretraining
15
+ configs:
16
+ - config_name: corpus
17
+ default: true
18
+ data_files:
19
+ - split: corpus
20
+ path: "data/corpus/*.parquet"
21
+ - config_name: documents
22
+ data_files:
23
+ - split: documents
24
+ path: "data/documents/*.parquet"
25
+ - config_name: review_inventory
26
+ data_files:
27
+ - split: review
28
+ path: "data/review_inventory/*.parquet"
29
+ - config_name: curation_lineage
30
+ data_files:
31
+ - split: lineage
32
+ path: "data/curation_lineage/*.parquet"
33
+ - config_name: audit_metrics
34
+ data_files:
35
+ - split: audit
36
+ path: "data/audit_metrics/*.parquet"
37
+ ---
38
+
39
+ # PT-BR Creative Corpus v0.1.0
40
+
41
+ A curated Brazilian-Portuguese creative-writing corpus for continued pretraining / midtraining research.
42
+
43
+ ## Status
44
+
45
+ This is the **canonical corpus freeze**, not a final model-specific training build.
46
+
47
+ - Canonical text units: **1,354**
48
+ - Document/edition entities: **803**
49
+ - Characters: **82,538,439**
50
+ - Words (whitespace count): **13,929,410**
51
+ - Historical project estimate: **18,339,188 chars/4.5 tokens**, retained only in the `audit_metrics` config.
52
+
53
+ The canonical `corpus` config deliberately contains **no generic token-count column**. Exact token counts belong to tokenizer-specific CPT builds.
54
+
55
+ ## Load a small sample without loading the corpus
56
+
57
+ ```python
58
+ from datasets import load_dataset
59
+
60
+ ds = load_dataset("oliveirabruno01/ptbr-creative-cpt", "corpus", split="corpus", streaming=True)
61
+ for row in ds.take(100):
62
+ ...
63
+ ```
64
+
65
+ ## Load the full canonical corpus
66
+
67
+ ```python
68
+ from datasets import load_dataset
69
+
70
+ ds = load_dataset("oliveirabruno01/ptbr-creative-cpt", "corpus", split="corpus")
71
+ ```
72
+
73
+ For CPT, derive a model/run-specific training build from this corpus:
74
+
75
+ ```text
76
+ canonical corpus
77
+ -> work/author-level benchmark holdout + decontamination
78
+ -> target model tokenizer
79
+ -> EOS/document-boundary policy
80
+ -> sequence packing for chosen context length
81
+ -> trainer-specific binary/memmap format
82
+ ```
83
+
84
+ Tokenized/packed sequences are intentionally **not** baked into this repository.
85
+
86
+ ## Text-unit model
87
+
88
+ Most corpus rows are complete selected works/documents. FE-Unicamp is intentionally different: modern scholarly editions were segmented and only blocks classified as primary historical creative literature were retained. Those rows use `unit_kind="selected_segment"` and point to a real parent edition through `parent_document_id`.
89
+
90
+ For FE, `primary_authors` refers to the historical literary writer; modern scholarly editors are kept separately in `editors`.
91
+
92
+ ## Orthography
93
+
94
+ `text_variant="original"` means the extracted source orthography is preserved. Any future AO90-normalized material must be released as a separate derived variant, never as a replacement for original text.
95
+
96
+ ## Rights
97
+
98
+ Rights vary by source and are recorded per row with `rights_tier`, `license`, `license_url`, and `rights_evidence`.
99
+
100
+ Important caveat: the `ptbr-books-publicos` backbone is upstream-released under CC0-1.0 and described as public-domain, but this project did **not** independently establish per-item rights for every backbone book. The corpus therefore records that as a source-dataset claim rather than silently converting it into per-item legal provenance.
101
+
102
+ BBM scan-derived text is not included in `corpus`; it remains in the review/deferred inventory.
103
+
104
+ ## Auxiliary configs
105
+
106
+ - `documents`: document/edition hierarchy.
107
+ - `review_inventory`: deferred and review queues, without training text.
108
+ - `curation_lineage`: acceptance/dedup/curation lineage for canonical units.
109
+ - `audit_metrics`: historical project accounting metrics. These are audit artifacts, not canonical token counts.
110
+
111
+ ## Data architecture references
112
+
113
+ This repository keeps canonical text separate from tokenizer-specific training preprocessing, following the general architecture used by open pretraining projects such as Dolma/OLMo.
114
+
115
+ - Dolma data format: https://github.com/allenai/dolma/blob/main/docs/data-format.md
116
+ - OLMo memmap preprocessing: https://github.com/allenai/OLMo/blob/main/scripts/prepare_memmap_dataset.py
117
+ - Hugging Face manual dataset configs: https://huggingface.co/docs/hub/datasets-manual-configuration
data/audit_metrics/audit_metrics.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6b9a84b51a061ec7a7dc8584dac271e5f3ae226aaeb66a78d2ae031a141fe1d
3
+ size 134716
data/corpus/corpus-00000-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c7e612b11155a30ae29992b96a404745615442602c810d5030c1a5239617867
3
+ size 6893511
data/corpus/corpus-00001-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb65c783559877c2a24ff8daa2b8c635e0f94cbddda4d5066e104c95f7e3d222
3
+ size 6964589
data/corpus/corpus-00002-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bff13c7c2f40f0e8fb48f038dcbddda988923fc7f41aa1853b8eea1e88c30d20
3
+ size 6910804
data/corpus/corpus-00003-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c12bafde3c30c4952a85e45055b3f9f3f51da512fc61b3c5e23bd35ba8c164c0
3
+ size 7390913
data/corpus/corpus-00004-of-00005.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67ddb4ccf8078c84530d7b860f9fdd8b5a371660213b933cd9e43a3fcb425259
3
+ size 1283760
data/curation_lineage/curation_lineage.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4cfbd433f950a00e3547a3caf608f3e46698cb337196447bbf903a5ddd50532
3
+ size 311122
data/documents/documents.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:982f594f1ea314211eb567f6400ddf711ccb226f5bddf4170ae37de0591592a9
3
+ size 193610
data/review_inventory/review_inventory.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19391071dc17d00801127f13f0d96aa3b0be934f0b84abae7c6f6a9a48c7727c
3
+ size 179555
schema.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "0.1.0",
3
+ "corpus_columns": {
4
+ "id": "stable canonical text-unit identifier",
5
+ "text": "self-contained accepted text",
6
+ "unit_kind": "book/article/cordel/selected_segment/etc.",
7
+ "parent_document_id": "parent edition/document ID when unit is a selected segment",
8
+ "segment_index": "stable segment index within parent document",
9
+ "title": "source title; FE segments retain parent edition title",
10
+ "primary_authors": "creators of the literary text",
11
+ "editors": "modern editors/compilers where applicable",
12
+ "genre": "curated/model-assisted broad genre",
13
+ "year": "source/edition year when available",
14
+ "date_label": "human-readable historical content period when available",
15
+ "language": "language code",
16
+ "source": "specific source",
17
+ "source_family": "coarse source family",
18
+ "source_collection": "collection/journal/source subcollection",
19
+ "source_id": "stable source-specific identifier",
20
+ "landing_url": "provenance landing page",
21
+ "source_file_url": "upstream source-file URL for provenance; not needed to use frozen corpus",
22
+ "rights_tier": "project rights tier",
23
+ "license": "human-readable license/public-domain label",
24
+ "license_url": "license URL when available",
25
+ "rights_evidence": "why this unit was admitted",
26
+ "text_variant": "original; AO90 normalization is future separate derivative",
27
+ "orthography_hint": "historical/contemporary hint; original text is never overwritten",
28
+ "extraction_method": "how text was originally extracted or assembled",
29
+ "quality_label": "source-stage quality label",
30
+ "text_sha256": "SHA-256 of exact UTF-8 canonical text string",
31
+ "char_count": "Python Unicode character count of canonical text",
32
+ "word_count": "whitespace-split word count; not a tokenizer token count"
33
+ },
34
+ "auxiliary_tables": {
35
+ "documents": "document/edition hierarchy and parent metadata",
36
+ "review_inventory": "deferred/review queues; contains no training text",
37
+ "curation_lineage": "acceptance/dedup/curation provenance",
38
+ "audit_metrics": "legacy project token estimates/hashes kept out of canonical schema"
39
+ }
40
+ }
stats.json ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "0.1.0",
3
+ "schema_version": "0.1.0",
4
+ "canonical_units": 1354,
5
+ "document_entities": 803,
6
+ "characters": 82538439,
7
+ "words": 13929410,
8
+ "legacy_audit_est_tokens_4p5": 18339188,
9
+ "legacy_metric_warning": "Historical chars/4.5 project estimate retained only in audit_metrics. Canonical corpus intentionally contains no tokenizer-dependent token count.",
10
+ "source_families": [
11
+ {
12
+ "source_family": "Conta pra Mim",
13
+ "units": 1,
14
+ "characters": 6365,
15
+ "words": 1036
16
+ },
17
+ {
18
+ "source_family": "FCRB",
19
+ "units": 65,
20
+ "characters": 761029,
21
+ "words": 138351
22
+ },
23
+ {
24
+ "source_family": "FE-Unicamp",
25
+ "units": 556,
26
+ "characters": 3155902,
27
+ "words": 535932
28
+ },
29
+ {
30
+ "source_family": "OJS",
31
+ "units": 318,
32
+ "characters": 2114092,
33
+ "words": 351649
34
+ },
35
+ {
36
+ "source_family": "OMP/Open Books",
37
+ "units": 14,
38
+ "characters": 831288,
39
+ "words": 140721
40
+ },
41
+ {
42
+ "source_family": "UEMA",
43
+ "units": 1,
44
+ "characters": 106498,
45
+ "words": 18292
46
+ },
47
+ {
48
+ "source_family": "backbone_books",
49
+ "units": 399,
50
+ "characters": 75563265,
51
+ "words": 12743429
52
+ }
53
+ ],
54
+ "parquet_shards": [
55
+ {
56
+ "file": "corpus-00000-of-00005.parquet",
57
+ "rows": 93,
58
+ "chars": 19981747,
59
+ "bytes": 6893511
60
+ },
61
+ {
62
+ "file": "corpus-00001-of-00005.parquet",
63
+ "rows": 108,
64
+ "chars": 19913077,
65
+ "bytes": 6964589
66
+ },
67
+ {
68
+ "file": "corpus-00002-of-00005.parquet",
69
+ "rows": 99,
70
+ "chars": 19935467,
71
+ "bytes": 6910804
72
+ },
73
+ {
74
+ "file": "corpus-00003-of-00005.parquet",
75
+ "rows": 594,
76
+ "chars": 19995800,
77
+ "bytes": 7390913
78
+ },
79
+ {
80
+ "file": "corpus-00004-of-00005.parquet",
81
+ "rows": 460,
82
+ "chars": 2712348,
83
+ "bytes": 1283760
84
+ }
85
+ ]
86
+ }