# CzechHistoricalNewspapers — Dataset Recap ## Overview `CzechHistoricalNewspapers.json` is a COCO-style annotation dataset of scanned Czech historical newspaper pages. It is the primary data source for `Clusterring.ipynb`, which uses the annotations as text input for clustering experiments and the cluster arrays as ground-truth labels for evaluation. ### Top-level keys | Key | Description | |---|---| | `images` | 30 scanned newspaper page records | | `categories` | 9 region type definitions | | `annotations` | 1 328 bounding-box annotations across all pages | | `clusters` | 30 arrays of ground-truth cluster labels, one per page | --- ## Categories Each annotation belongs to one category, describing the type of layout region it covers. | ID | Name | Supercategory | Role in notebook | |---|---|---|---| | 1 | SeparatorRegion | — | **Filtered out** (no text) | | 2 | Heading | Article | Kept — article headline text | | 3 | Caption | Article | **Filtered out** | | 4 | Enumeration | Article | Kept — list-style text | | 5 | TextRegion | Article | Kept — main body text (largest group) | | 6 | ImageRegion | Article | **Filtered out** (no text) | | 7 | Article | — | Defined but **zero annotations in dataset** | | 8 | TableRegion | Article | Kept — tabular text | | 9 | AdvertRegion | — | Kept — advertisement text | The notebook filters `category_id in [1, 3, 6, 7]` before building page text. Category 7 has no annotations, so its filter entry is a no-op. ### Annotation counts by category | ID | Name | Count | % of total | Has text content | |---|---|---|---|---| | 1 | SeparatorRegion | 297 | 22.4 % | No | | 2 | Heading | 132 | 9.9 % | Yes | | 3 | Caption | 67 | 5.0 % | Yes (but filtered) | | 4 | Enumeration | 17 | 1.3 % | Yes | | 5 | TextRegion | 572 | 43.1 % | Yes | | 6 | ImageRegion | 83 | 6.2 % | No | | 7 | Article | 0 | 0.0 % | — | | 8 | TableRegion | 1 | 0.1 % | Yes | | 9 | AdvertRegion | 159 | 12.0 % | Yes | | — | **Total** | **1 328** | **100 %** | — | Of the 1 328 annotations, **940 carry text content** (`metadata.content`) and **388 do not** (mainly SeparatorRegions and ImageRegions). The notebook wraps the content access in `try/except` to silently skip these. --- ## Images 30 pages from two newspaper series: | Series | Pages | |---|---| | Brnenske | 12 | | Lidove | 18 | | **Total** | **30** | Image IDs run 1–30, matching the order of the `pictures` dict in the notebook. --- ## Clusters (ground-truth labels) One cluster array per page. Array length equals the number of text-bearing annotations on that page (after category filtering). The notebook uses `max(array) + 1` to set the number of clusters for each algorithm. | Page | Text annotations | Unique clusters | |---|---|---| | Brnenske_48_D.jpg | 17 | 8 | | Brnenske_48_C.jpg | 49 | 3 | | Brnenske_48_B.jpg | 40 | 8 | | Brnenske_48_A.jpg | 36 | 5 | | Brnenske_44_D.jpg | 12 | 7 | | Brnenske_44_C.jpg | 35 | 11 | | Brnenske_44_B.jpg | 36 | 6 | | Brnenske_44_A.jpg | 33 | 5 | | Brnenske_09_D.jpg | 13 | 8 | | Brnenske_09_C.jpg | 39 | 9 | | Brnenske_09_B.jpg | 33 | 1 | | Brnenske_09_A.jpg | 17 | 6 | | Lidove_07_B.jpg | 43 | 9 | | Lidove_07_A.jpg | 35 | 7 | | Lidove_06_L.jpg | 44 | 14 | | Lidove_06_K.jpg | 12 | 12 | | Lidove_06_J.jpg | 11 | 11 | | Lidove_06_I.jpg | 33 | 25 | | Lidove_06_H.jpg | 43 | 6 | | Lidove_06_G.jpg | 38 | 3 | | Lidove_06_F.jpg | 19 | 19 | | Lidove_06_E.jpg | 31 | 27 | | Lidove_06_D.jpg | 20 | 4 | | Lidove_06_C.jpg | 33 | 4 | | Lidove_06_B.jpg | 39 | 10 | | Lidove_06_A.jpg | 28 | 4 | | Lidove_04_D.jpg | 13 | 13 | | Lidove_04_C.jpg | 23 | 15 | | Lidove_04_B.jpg | 37 | 3 | | Lidove_04_A.jpg | 19 | 3 | Notable: `Brnenske_09_B.jpg` has 33 annotations all assigned to the same cluster (unique_clusters = 1), meaning every text region on that page belongs to one article. Pages like `Lidove_06_E.jpg` (27 clusters from 31 annotations) are highly fragmented, with nearly every annotation being a separate article. --- ## Coherence with Clusterring.ipynb The JSON is fully aligned with the notebook's expectations: - All keys the notebook reads (`categories`, `annotations`, `clusters`) are present. - The 30 cluster keys match the 30 filenames in the notebook's `pictures` dict (the notebook strips the trailing `_` from filenames via `base_name[::-1].replace('_','',1)[::-1]`). - Cluster label array lengths match filtered annotation counts exactly for every page. - Czech text in `metadata.content` is valid UTF-8; Python on Colab reads it correctly. ### Known bugs in the notebook (not JSON issues) | Location | Bug | |---|---| | Image-masking cell | Uses `annota` (undefined); should be `annotations = data['annotations']` — causes `NameError` | | Image+text embedding loop | `counter` is never incremented inside the loop, so `pages[counter]` always returns `pages[0]` for all 30 pages |