RuGlyphs / annotations /README.md
ruglyphs's picture
RuGlyphs
6a4aac7 verified
|
Raw History Blame Contribute Delete
2.97 kB
# Annotations: train / val / test split
`{train,val,test}_sharegpt.json`: 1301 / 130 / 260 handwritten pages in ShareGPT format.
Image paths are relative (`images/<image_id>.<ext>`, the repository's `images/` directory);
the scripts resolve them against `IMAGES_DIR` from `paths.env` by file name.
## Record format
```json
{
"messages": [
{"role": "user", "content": "<image>\nPlease transcribe all text from this image."},
{"role": "assistant", "content": "<reference transcription>"}
],
"images": ["images/1007_1.png"],
"metadata": {
"split": "val",
"source": "law_a4_pages",
"original_source": "law_a4_pages",
"text_file_name": "law_a4_pages_443.txt",
"final_file_name": "1007_1.txt",
"image_id": "1007_1",
"author_id": "1007",
"image_file": "1007_1.png"
}
}
```
- `source`: text domain, one of `wiki_aug_augmented_a4_pages` (W, Augmented Wikipedia),
`articles` (A), `law_a4_pages` (L). `original_source` keeps the value before normalization
(`articles_txt_new_augmented` and `articles` both map to `articles`).
- `text_file_name`: the source text; a text is identified by `(source, text_file_name)`.
- `image_id`: page ID, the stem of `final_file_name`; `author_id` is the part before the
first underscore (`123_7` -> author `123`).
## How the split was built
**Pages.** The page table had 2078 rows; deduplication by `image_id` (first occurrence kept)
left 2049 pages.
**Constraints.** No writer (`author_id`) and no text (`(source, text_file_name)`) is shared
between splits. Pages form a bipartite graph `author <-> text`; each connected component
goes to a single split (509 components, the largest has 1132 pages).
**Test.** An author may enter test only if all of their pages come from the benchmark's two
collection batches; a component with any ineligible author stays in train (503 of 509
components eligible). Components were selected with an exact bounded dynamic program to get
100 test pages per source: minimize the maximum per-source deviation, then the total
deviation, then break ties by deterministic component order. Both deviations are 0.
**Val.** Carved out of the remaining train: 50 pages per source, again with no shared author
or text. An integer program keeps train as large as possible, with a seeded tie-break
(`SEED = 42`); two articles pages had to be dropped and belong to no split.
**Content filtering.** After splitting the dataset, we screened the transcriptions for
sensitive content and excluded pages that met our exclusion criteria. We retained the original
split assignments for the remaining pages.
## Statistics
| Source | Train | Val | Test |
| --- | ---: | ---: | ---: |
| articles | 626 | 41 | 87 |
| law_a4_pages | 466 | 40 | 78 |
| wiki_aug_augmented_a4_pages | 209 | 49 | 95 |
| Total | 1301 | 130 | 260 |
Unique authors: train 610, val 92 (articles 14, law 40, wiki 49), test 162.
Author, text and image overlap is 0 for every pair of splits.