Add dataset card

#1
by davanstrien HF Staff - opened
Files changed (1) hide show
  1. README.md +192 -0
README.md CHANGED
@@ -1,4 +1,22 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  dataset_info:
3
  features:
4
  - name: card_index
@@ -45,3 +63,177 @@ configs:
45
  - split: train
46
  path: data/train-*
47
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: cc-by-sa-4.0
3
+ language:
4
+ - nl
5
+ - fr
6
+ - de
7
+ - en
8
+ task_categories:
9
+ - image-to-text
10
+ size_categories:
11
+ - n<1K
12
+ pretty_name: Greetings From! — historical postcard address transcription
13
+ tags:
14
+ - glam
15
+ - handwritten-text-recognition
16
+ - htr
17
+ - ocr-evaluation
18
+ - postcards
19
+ - information-extraction
20
  dataset_info:
21
  features:
22
  - name: card_index
 
63
  - split: train
64
  path: data/train-*
65
  ---
66
+
67
+ # Greetings From! — historical postcard address transcription
68
+
69
+ 500 handwritten address regions cropped from the backs of historical picture postcards sent within and
70
+ between Belgium, France, Germany, Luxembourg, the Netherlands and the UK. Each region carries a
71
+ human-corrected ground-truth transcription, the HTR output it was corrected from, and GPT-4 structured
72
+ address extractions run over both.
73
+
74
+ Created by Thomas Smits, Wouter Haverals, Loren Verreyen, Mona Allaert and Mike Kestemont for
75
+ [*Greetings from! Extracting address information from 100,000 historical picture
76
+ postcards*](https://ceur-ws.org/Vol-3558/paper6180.pdf) (CHR 2023), and deposited on Zenodo
77
+ ([10.5281/zenodo.10005566](https://doi.org/10.5281/zenodo.10005566)).
78
+
79
+ This repository is a format conversion of that deposit — the same images and transcriptions, cut into
80
+ one row per postcard.
81
+
82
+ ## How the data was produced
83
+
84
+ The 500 are a random sample from a corpus of ~102,000 postcards hosted on
85
+ [Delcampe](https://www.delcampe.net/), passed through a three-stage pipeline:
86
+
87
+ | Stage | Method | Reported performance |
88
+ |---|---|---|
89
+ | Locate the address region on the card back | YOLOv8 | mAP50 0.94, mAP50-95 0.72 |
90
+ | Transcribe it | Transkribus **Text Titan I** | CER 7.62% (measured with CERberus) |
91
+ | Structure the address | GPT-4 | 419 of 500 geocodable coordinates |
92
+
93
+ Ground truth was made by five human annotators correcting the HTR output, not transcribing from
94
+ scratch.
95
+
96
+ ## The ground truth is address-only
97
+
98
+ > [!WARNING]
99
+ > `gt_text` is **not** a full corrected transcription. The annotators systematically corrected only the
100
+ > text carrying geographical address information. **49.4% of ground-truth lines (1,219 of 2,469) carry a
101
+ > `*` or `@` prefix**, marking them as outside that scope — roughly half the ground truth is
102
+ > uncorrected HTR.
103
+
104
+ The paper states the convention:
105
+
106
+ | Marker | Meaning |
107
+ |---|---|
108
+ | `*` line prefix | line without address information (e.g. a person's name) — **not corrected** |
109
+ | `@` line prefix | irrelevant line — **not corrected** |
110
+ | `#` | unreadable character |
111
+
112
+ So computing CER between `gt_text` and `htr_text` over the whole string measures partly against
113
+ uncorrected HTR, and will understate the real error rate. To reproduce the paper's 7.62%, score only
114
+ the unprefixed lines:
115
+
116
+ ```python
117
+ def address_lines(text):
118
+ return [l for l in text.splitlines() if not l.startswith(("*", "@"))]
119
+ ```
120
+
121
+ The rule is not absolute — some prefixed lines were corrected anyway. Card 0's addressee reads
122
+ `J Bath` in the HTR and `*J Buth` in the ground truth, so a starred line was edited despite carrying no
123
+ address information. Treat `*`/`@` as "outside the systematic correction pass", not as a guarantee that
124
+ the line is byte-identical to the HTR output.
125
+
126
+ ## Structure
127
+
128
+ One row per postcard, 500 rows, single `train` split.
129
+
130
+ | Field | Notes |
131
+ |---|---|
132
+ | `card_index` | 0–499, stable, ordered by composite then reading order |
133
+ | `gpt4_order` | the `Order` key from the GPT-4 files; `-1` where no record exists (5 cards) |
134
+ | `composite_id`, `region_id` | position in the source composite sheet |
135
+ | `image` | the cropped address region (JPEG, quality 92) |
136
+ | `bbox` | `[x, y, w, h]` of the crop within the source composite |
137
+ | `gt_text` / `htr_text` | region-level transcription, both sides |
138
+ | `gt_lines` / `htr_lines` | the same, split into PAGE text lines |
139
+ | `gt_address_json` / `htr_address_json` | raw GPT-4 output as a JSON string; empty where absent |
140
+ | `gt_city`, `gt_country`, `htr_city`, `htr_country` | convenience fields lifted from the JSON |
141
+
142
+ `gt_text` and `htr_text` are aligned by construction — the two source archives contain the same 5
143
+ composites (byte-identical JPEGs) with the same 100 regions each, so every row's two transcriptions
144
+ describe the same pixels.
145
+
146
+ ## Caveats
147
+
148
+ **The GPT-4 output has no fixed schema.** It is free-form LLM output, not structured fields. Across the
149
+ GT file 17 distinct keys appear; across the HTR file, 27 — including `Message`, `Date`, `Province`,
150
+ `State`, `Place of Interest`, `City/Village Name 2`, `Additional 7`. That is why the full output is
151
+ kept as a JSON string and only the two most consistent fields are lifted into columns. Do not assume
152
+ `gt_city` is populated: it is empty wherever GPT-4 did not emit that key.
153
+
154
+ **GPT-4 hallucinates plausible corrections.** The paper documents it silently changing `Junda` to
155
+ `Zundert`, and adding `France` as the country for Courcelles, which is in Belgium. These are
156
+ LLM outputs, not verified addresses — treat them as a system's predictions, not as ground truth.
157
+
158
+ **Five cards have no GPT-4 record.** The deposit's GPT-4 files hold 495 entries for 500 regions. Those
159
+ five rows have `gpt4_order = -1` and empty address fields: `c2/region_19`, `c2/region_89`,
160
+ `c4/region_26`, `c5/region_3`, `c5/region_84`.
161
+
162
+ **The join was reconstructed, not documented.** The `Order` field is not `region_index + 1` — because
163
+ five regions are missing, the offset accumulates unevenly through the sequence. A uniform per-composite
164
+ shift gets 100% / 70% / 94% / 69% / 81%: close enough to look right, wrong enough to mislabel rows.
165
+ The alignment here was recovered with a monotonic dynamic-programming match on normalised address
166
+ tokens, giving exactly 5 skips and an 88% token-match rate at aligned positions against a ~1% rate for
167
+ shifted controls. It is recomputed at build time and the build aborts if it degrades. It is still an
168
+ inference, and a handful of the 12% non-matching rows may be misaligned rather than simply cases where
169
+ GPT-4 emitted a garbled or empty city.
170
+
171
+ **Five cards have no HTR text at all**, and five have no ground truth. **472 of the 500 rows carry at
172
+ least one address-bearing line on both sides** — that is the subset usable for a paired transcription
173
+ comparison. Median length is comparable across the two sides (60 vs 59 characters), as you would expect
174
+ for a correction pass rather than a re-transcription.
175
+
176
+ **These are address regions, not whole postcards.** The crops are YOLOv8-detected address areas from
177
+ the card backs. Picture fronts are not in the deposit, and neither is any message text outside the
178
+ address region.
179
+
180
+ **If you go back to the original deposit:** the GT PAGE XML carries region-level `TextEquiv`, but the
181
+ HTR export does not — its text lives only on `TextLine`. Reading region-level text on both sides yields
182
+ 500 silently empty HTR strings. Here both sides are built by joining the line-level text, which
183
+ reproduces the GT region string exactly.
184
+
185
+ **Language is mixed and unlabelled.** Cards span six countries and the deposit carries no per-card
186
+ language field. Handwriting, spelling and place-name conventions vary accordingly — the paper
187
+ attributes the relatively high CER to exactly this "hyper-diversity".
188
+
189
+ ## Load
190
+
191
+ ```python
192
+ from datasets import load_dataset
193
+
194
+ ds = load_dataset("davanstrien/greetings-from-postcards", split="train")
195
+
196
+ # HTR error on the address lines only — the part that was actually corrected
197
+ scored = ds.filter(lambda r: r["gt_text"].strip() and r["gpt4_order"] > 0)
198
+ ```
199
+
200
+ ## Licence
201
+
202
+ CC BY-SA 4.0, following the upstream deposit. Share-alike: anything derived from this and redistributed
203
+ carries the same licence.
204
+
205
+ The postcards themselves are held by [Delcampe](https://www.delcampe.net/) sellers and collectors; the
206
+ deposit licenses the transcriptions and the cropped regions as distributed. The authors ask that the
207
+ paper be cited.
208
+
209
+ ## Credit
210
+
211
+ Data created by Thomas Smits (University of Amsterdam), Wouter Haverals (Princeton University), Loren
212
+ Verreyen, Mona Allaert and Mike Kestemont (University of Antwerp). Note that the Zenodo deposit lists
213
+ Haverals alone as creator whilst the accompanying paper has five authors; the citation below follows
214
+ the paper.
215
+
216
+ Converted and repackaged for the Hub by [Daniel van Strien](https://huggingface.co/davanstrien).
217
+
218
+ ```bibtex
219
+ @inproceedings{smits2023greetings,
220
+ author = {Smits, Thomas and Haverals, Wouter and Verreyen, Loren and
221
+ Allaert, Mona and Kestemont, Mike},
222
+ title = {{Greetings from! Extracting address information from 100,000 historical picture postcards}},
223
+ booktitle = {Proceedings of the Computational Humanities Research Conference (CHR 2023)},
224
+ series = {CEUR Workshop Proceedings},
225
+ volume = {3558},
226
+ pages = {512--529},
227
+ year = {2023},
228
+ address = {Paris, France},
229
+ url = {https://ceur-ws.org/Vol-3558/paper6180.pdf}
230
+ }
231
+
232
+ @dataset{haverals_2023_greetingsfrom,
233
+ author = {Haverals, Wouter},
234
+ title = {{Greetings From! Historical Postcards Address Transcription Dataset}},
235
+ year = {2023},
236
+ publisher = {Zenodo},
237
+ doi = {10.5281/zenodo.10005566}
238
+ }
239
+ ```