Vasily Alexeev commited on
Commit ·
3f61d08
1
Parent(s): 21c5c10
add base data
Browse files- .gitattributes +4 -0
- README.md +132 -0
- data/bow.csv +3 -0
- data/noow.csv +3 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
*.csv filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
*.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
*.vw filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
*.native filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: unknown
|
| 5 |
+
task_categories:
|
| 6 |
+
- text-classification
|
| 7 |
+
tags:
|
| 8 |
+
- topic-modeling
|
| 9 |
+
- topic-modelling
|
| 10 |
+
- text-clustering
|
| 11 |
+
- document-representation
|
| 12 |
+
size_categories:
|
| 13 |
+
- 1K<n<10K
|
| 14 |
+
configs:
|
| 15 |
+
- config_name: noow
|
| 16 |
+
default: true
|
| 17 |
+
data_files:
|
| 18 |
+
- split: corpus
|
| 19 |
+
path: data/noow.csv
|
| 20 |
+
- config_name: bow
|
| 21 |
+
data_files:
|
| 22 |
+
- split: corpus
|
| 23 |
+
path: data/bow.csv
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# BBC-News
|
| 27 |
+
|
| 28 |
+
This TopicNet derived preparation contains 2,085 retained BBC news bodies with five original directory labels. The source release contains 2,225 articles from 2004–2005. The body-only population differs from earlier title-plus-body preparations; the accepted count is 2,085. This is a derived research preparation, not the original release.
|
| 29 |
+
|
| 30 |
+
## Population, labels and research splits
|
| 31 |
+
|
| 32 |
+
Raw duplicate identity is body text after casefold and whitespace collapse. Same-label duplicates retain the lexicographically smallest ID; cross-label conflicts would be quarantined. There are 137 raw duplicate groups and three identical lemma-sequence groups; 140 documents are removed and none quarantined. Fourteen near-duplicate pairs join families without removing their members.
|
| 33 |
+
|
| 34 |
+
Family groups combine raw/lemma duplicate relations, source URL/DOI relations where present, and body five-token shingle Jaccard similarity ≥0.9. Groups are assigned by iterative multilabel stratification with seeds 20260824 and 20260825; all retained members of a group stay together. The resulting disjoint, exhaustive research splits are **fit 1,250, calibration 419, validation 416**. The Hugging Face split `corpus` contains every retained document; it is not `fit`. Original source membership is preserved in accepted audit/documents metadata and does not define these research splits.
|
| 35 |
+
|
| 36 |
+
Retained class supports come directly from `audit.json.output_rows`:
|
| 37 |
+
|
| 38 |
+
| Label | Documents |
|
| 39 |
+
| --- | ---: |
|
| 40 |
+
| business | 500 |
|
| 41 |
+
| entertainment | 366 |
|
| 42 |
+
| politics | 394 |
|
| 43 |
+
| sport | 491 |
|
| 44 |
+
| tech | 334 |
|
| 45 |
+
|
| 46 |
+
## Representations and pinned preparation
|
| 47 |
+
|
| 48 |
+
The source adapter separates the headline at the first blank line; the CSV body excludes that headline. IDs are `bbc_<directory-label>_<three-digit-file-stem>`.
|
| 49 |
+
|
| 50 |
+
Both configurations read a single UTF-8 CSV with exactly `id,raw_text,vw_text`, sorted lexicographically by ID. `raw_text` is only the saved `documents.jsonl.raw_text` body. Title text is separate metadata. NOOW VW preserves the saved prepared line exactly, excluding its line terminator: document ID followed by `|@title` followed by `|@word`. It retains every prepared occurrence, including terms outside the fitted vocabulary. BOW counts those same terms separately within each namespace as `token:count`, with lexicographic token ordering and the same namespace ordering. Class labels never appear as VW namespaces.
|
| 51 |
+
|
| 52 |
+
NOOW means occurrence order after preprocessing, not untouched or reversible prose. The accepted English preprocessing pins Python 3.11.15, NLTK 3.9.2 and NLTK-data commit `550b6625bcef1f2abff2ff770a5a0d272c9c6b2a`: WordPunctTokenizer, lowercase per original span, minimum token length 2, averaged_perceptron_tagger_eng, WordNet POS mapping J/V/N/R with noun fallback, English stopword removal and `lemma.isalpha()` filtering. The copied audit records the exact stopwords and resource hashes. Names are not masked.
|
| 53 |
+
|
| 54 |
+
The research model uses **only @word**, with vocabulary fitted on `fit` only, `min_df=5` and `max_df=0.9`. The saved `*-model.vw` and `*.vw` inputs project prepared text to @word; the separate fitted dictionary controls the vocabulary while the sequence retains OOV positions. The CSVs preserve full prepared sequences, including the title namespace where present. Occurrence offsets and chains are separate saved artifacts, not CSV columns.
|
| 55 |
+
|
| 56 |
+
`data/accepted/documents.jsonl` stores `offsets` and `title_offsets` as `[start, end]` arrays: zero-based Python character positions with an exclusive end (not byte offsets), relative to `raw_text` and `raw_title`, respectively. The corresponding `occurrences` and `title_occurrences` records contain `lemma`, `start`, `end` and `occurrence_index`, aligned in occurrence order with `tokens`/`offsets` and `title_tokens`/`title_offsets`; a lemma need not equal the raw substring. Per-split `data/accepted/bbc-news/*-occurrences.jsonl` files contain TF-IDF decision records keyed by `document_id` and `occurrence_index`, rather than raw spans. Join `document_id` to the document's `id` and use `occurrence_index` to select its body occurrence and raw span.
|
| 57 |
+
|
| 58 |
+
`tfidf-bank.json` and `*-chains.jsonl` preserve the immutable accepted TF-IDF reference bank and extracted chains. These are automatic reference constructions, not gold human annotations. This packaging converts saved representations and does not rerun preprocessing, dictionary creation, reference fitting, scoring or model training. Candidate model results and selected human-audit examples are not included.
|
| 59 |
+
|
| 60 |
+
## Loading and metadata joins
|
| 61 |
+
|
| 62 |
+
Authenticate with an account that has access if the intended remote repository is private:
|
| 63 |
+
|
| 64 |
+
```python
|
| 65 |
+
from datasets import load_dataset
|
| 66 |
+
|
| 67 |
+
repo = "TopicNet/BBC-News"
|
| 68 |
+
corpus = load_dataset(repo, "noow", split="corpus", token=True)
|
| 69 |
+
bow = load_dataset(repo, "bow", split="corpus", token=True)
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
Labels and research splits are auxiliary JSON files. Their actual schema is a direct ID-to-label-list object and a direct split-name-to-ID-list object, respectively; there are no `labels` or `splits` wrappers:
|
| 73 |
+
|
| 74 |
+
```python
|
| 75 |
+
import json
|
| 76 |
+
from huggingface_hub import hf_hub_download
|
| 77 |
+
|
| 78 |
+
def metadata_path(name):
|
| 79 |
+
return hf_hub_download(repo, "data/accepted/bbc-news/" + name,
|
| 80 |
+
repo_type="dataset", token=True)
|
| 81 |
+
|
| 82 |
+
with open(metadata_path("labels.json"), encoding="utf-8") as handle:
|
| 83 |
+
labels = json.load(handle)
|
| 84 |
+
with open(metadata_path("splits.json"), encoding="utf-8") as handle:
|
| 85 |
+
splits = json.load(handle)
|
| 86 |
+
membership = {doc_id: split for split, ids in splits.items() for doc_id in ids}
|
| 87 |
+
annotated = corpus.map(lambda row: {"labels": labels[row["id"]],
|
| 88 |
+
"research_split": membership[row["id"]]})
|
| 89 |
+
fit = annotated.filter(lambda row: row["research_split"] == "fit")
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
For offline access, obtain the complete package including actual LFS contents and set `HF_DATASETS_OFFLINE=1` and `HF_HUB_OFFLINE=1` before starting Python. Use a writable cache:
|
| 93 |
+
|
| 94 |
+
```python
|
| 95 |
+
import json
|
| 96 |
+
from pathlib import Path
|
| 97 |
+
from datasets import load_dataset
|
| 98 |
+
|
| 99 |
+
package = Path("/path/to/BBC-News")
|
| 100 |
+
corpus = load_dataset(str(package), "noow", split="corpus",
|
| 101 |
+
cache_dir="/writable/cache")
|
| 102 |
+
bow = load_dataset(str(package), "bow", split="corpus",
|
| 103 |
+
cache_dir="/writable/cache")
|
| 104 |
+
with (package / "data/accepted/bbc-news/labels.json").open(encoding="utf-8") as handle:
|
| 105 |
+
labels = json.load(handle)
|
| 106 |
+
with (package / "data/accepted/bbc-news/splits.json").open(encoding="utf-8") as handle:
|
| 107 |
+
splits = json.load(handle)
|
| 108 |
+
membership = {doc_id: split for split, ids in splits.items() for doc_id in ids}
|
| 109 |
+
fit = corpus.filter(lambda row: membership[row["id"]] == "fit")
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
An explicit CSV reader is also available:
|
| 113 |
+
`load_dataset("csv", data_files={"corpus": str(package / "data/noow.csv")}, split="corpus", cache_dir="/writable/cache")`.
|
| 114 |
+
For independent Python CSV inspection, raise `csv.field_size_limit` when needed for long bodies.
|
| 115 |
+
|
| 116 |
+
## Accepted files and integrity
|
| 117 |
+
|
| 118 |
+
The byte-preserving accepted tree totals **154,351,764 bytes** before adding export CSVs. NOOW CSV is **7,828,306 bytes** and BOW CSV is **7,506,218 bytes**.
|
| 119 |
+
|
| 120 |
+
All 34 files from the accepted source subtree are preserved byte for byte under `data/accepted/`, including the original nested `bbc-news/` directory. Root accepted files include documents, audit, config, spec, diagnostics, manifest, checksum manifest and TF-IDF bank. The nested directory retains labels, splits, vocabulary, eligible labels, dictionary exports/native dictionary and per-split prepared/model VW, occurrences, summaries and chains. Saved machine paths are provenance, not loading requirements.
|
| 121 |
+
|
| 122 |
+
[EXPORT_PROVENANCE.json](EXPORT_PROVENANCE.json) records each original file size/hash, input source pins, the pinned source manifest digest, verbatim source README identity, conversion rules and both CSV sizes/hashes. The original inner checksum manifests are unchanged. Root [SHA256SUMS](SHA256SUMS) covers every package file except itself and Git internals; run `sha256sum -c SHA256SUMS` from this directory. Git LFS attributes apply to CSV, JSONL, VW and native dictionaries; small JSON metadata and cards remain ordinary Git files.
|
| 123 |
+
|
| 124 |
+
## Rights, limitations and citation
|
| 125 |
+
|
| 126 |
+
License: unknown. The [compiler's source page](https://derekgreene.com/bbc/) and [author's repository](https://github.com/derekgreene/bbc-datasets) describe the corpus and its non-commercial research condition. BBC holds copyright in the articles. The verbatim [SOURCE_README.TXT](SOURCE_README.TXT) retains the source notice. The [SetFit card](https://huggingface.co/datasets/SetFit/bbc-news/blob/main/README.md) has no license field and explicitly credits BBC copyright; that card does not supply redistribution permission. Redistribution rights remain unresolved.
|
| 127 |
+
|
| 128 |
+
These local packages are intended for private research storage; remote visibility has not been verified or changed. Private storage does not supply redistribution permission. Labels and topic distributions reflect source selection, historical coverage, class imbalance and automatic preprocessing. Family grouping limits known leakage but does not establish that every semantic duplicate was detected. Normalized representations do not guarantee current facts, absence of personal information or suitability for downstream decisions.
|
| 129 |
+
|
| 130 |
+
Derek Greene and Pádraig Cunningham (2006), *Practical Solutions to the Problem of Diagonal Dominance in Kernel Document Clustering*, ICML.
|
| 131 |
+
|
| 132 |
+
Report this TopicNet derived population and the source manifest hash in [EXPORT_PROVENANCE.json](EXPORT_PROVENANCE.json). The [research repository](https://github.com/Alvant/Alekseev2026IntraTextCoherence) contains the [source adapters and preprocessing](https://github.com/Alvant/Alekseev2026IntraTextCoherence/blob/master/work/wintra/lib/dataset_adapters.py) and [model input preparation](https://github.com/Alvant/Alekseev2026IntraTextCoherence/blob/master/work/wintra/experiments/prepare_model_inputs.py). It is currently private and access-controlled; viewing those links requires permission. Code is linked rather than bundled, and this package does not promise public standalone reproducibility.
|
data/bow.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:22a0848ad858cbcd627ce1c0ae29c5dbc48614bc8a28279e2030439a233f97bc
|
| 3 |
+
size 7506218
|
data/noow.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15010f805a287f2d8b2edf7ec85f20d4f5bfc4a1ed7e2dcfd58a36713b129380
|
| 3 |
+
size 7828306
|